Sergiu 2 лет назад
Родитель
Сommit
16ceae0c88

+ 82 - 2
Content/ConfigurationData/UI_Config.json

@@ -122,12 +122,92 @@
         {
           "name": "2000",
           "display_name": ["2000"],
-          "condition": "NonConfigurable"
+          "condition": "model_V80 or model_S80 or model_S85 or model_ONE or model_TWO"
         },
         {
           "name": "1900",
           "display_name": ["1900"],
-          "condition": "NonConfigurable"
+          "condition": "model_V80 or model_S80 or model_S85 or model_ONE or model_TWO"
+        }
+      ]
+    },
+    {
+      "name": "door_opening_width",
+      "options": [
+        {
+          "name": "680",
+          "display_name": ["618"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "680",
+          "display_name": ["618"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "730",
+          "display_name": ["668"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "730",
+          "display_name": ["668"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "730",
+          "display_name": ["668"],
+          "condition": "(active_door_side_B) and (shaft_size_BD_900 or shaft_size_BD_1000 or shaft_size_BD_1100 or shaft_size_BD_1200)"
+        },
+        {
+          "name": "830",
+          "display_name": ["768"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "830",
+          "display_name": ["768"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "830",
+          "display_name": ["768"],
+          "condition": "(active_door_side_B) and (shaft_size_BD_1000 or shaft_size_BD_1100 or shaft_size_BD_1200 or shaft_size_BD_1300)"
+        },
+        {
+          "name": "930",
+          "display_name": ["868"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "930",
+          "display_name": ["868"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "930",
+          "display_name": ["868"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "1030",
+          "display_name": ["968"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "1030",
+          "display_name": ["968"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "1030",
+          "display_name": ["968"],
+          "condition": "active_door_side_C"
+        },
+        {
+          "name": "1130",
+          "display_name": ["1068"],
+          "condition": "active_door_side_C"
         }
       ]
     },

+ 1 - 1
Content/ConfigurationData/UI_State.json

@@ -9,7 +9,7 @@
     "active_options": ["A"]
   },
   "active_shaft_page": {
-    "active_options": ["colors"]
+    "active_options": ["doors"]
   },
   "sidebar_header": {
     "active_options": ["settings"]

BIN
Content/_CibesConfigurator/Blueprints/Core/BP_GameInstance_Cibes.uasset


BIN
Content/_CibesConfigurator/Blueprints/ProceduralElevator/BP_ProceduralShaft.uasset


BIN
Content/_CibesConfigurator/Blueprints/ProceduralElevator/Doors/BP_ProceduralDoor_2023.uasset


BIN
Content/_CibesConfigurator/FunctionLibrary/BFL_Configuration.uasset


BIN
Content/_CibesConfigurator/FunctionLibrary/BFL_General.uasset


BIN
Content/_CibesConfigurator/Widgets/WBP_Configuration_Doors_Type.uasset


BIN
Content/_CibesConfigurator/Widgets/WBP_Configuration_Settings_Series.uasset


BIN
Content/_CibesConfigurator/Widgets/WBP_Configuration_Settings_Size.uasset


BIN
Content/_CibesConfigurator/Widgets/WBP_Debug.uasset


BIN
Content/_CibesConfigurator/Widgets/WBP_Prefab_CheckboxGroup_Conditional.uasset


+ 2 - 0
Source/Localization/LocalizationModule.Build.cs

@@ -14,5 +14,7 @@ public class LocalizationModule : ModuleRules
         PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
 
         PrivateDependencyModuleNames.AddRange(new string[] { "Noesis", "NoesisRuntime" });
+
+        PublicIncludePaths.Add("Runtime/Core/Public/Containers");
     }
 }

+ 62 - 0
Source/Localization/MyBlueprintFunctionLibrary.cpp

@@ -2,6 +2,12 @@
 
 
 #include "MyBlueprintFunctionLibrary.h"
+#include "Internationalization/Regex.h"
+
+
+
+
+
 
 void UMyBlueprintFunctionLibrary::AdjustViewportSize(float OriginX, float OriginY, float SizeX, float SizeY)
 {
@@ -19,3 +25,59 @@ FColor UMyBlueprintFunctionLibrary::HexToColor(FString HexString)
     return FColor::FromHex(HexString);
 }
 
+
+
+
+TArray<FString> UMyBlueprintFunctionLibrary::GetCode(const FString& Condition)
+{
+    std::regex pattern("\\w{2,26}");
+    std::smatch match;
+    TArray<FString> code_list;
+
+    std::string conditionString = TCHAR_TO_UTF8(*Condition);
+    std::string::const_iterator search_start(conditionString.cbegin());
+    while (std::regex_search(search_start, conditionString.cend(), match, pattern))
+    {
+        FString code(match[0].str().c_str());
+        code_list.Add(code);
+        search_start = match.suffix().first;
+    }
+
+    code_list.Sort([](const FString& a, const FString& b)
+        {
+            return a.Len() > b.Len();
+        });
+
+    return code_list;
+}
+
+FString UMyBlueprintFunctionLibrary::ReplaceBoolean(const FString& Condition)
+{
+    FString result = Condition.Replace(TEXT("|"), TEXT("or"));
+    result = result.Replace(TEXT("&"), TEXT("and"));
+    result = result.Replace(TEXT("!"), TEXT("not "));
+    return result;
+}
+
+bool UMyBlueprintFunctionLibrary::Solver(const TArray<FString>& ProductCodeList, const FString& Condition)
+{
+    FString condition = Condition;
+    TArray<FString> condition_code = GetCode(condition);
+    check(condition_code.Num() > 0);
+
+    for (const FString& p_code : condition_code)
+    {
+        if (ProductCodeList.Contains(p_code))
+        {
+            condition = condition.Replace(*p_code, TEXT("True"));
+        }
+        else
+        {
+            condition = condition.Replace(*p_code, TEXT("False"));
+        }
+    }
+
+    FString resultString = ReplaceBoolean(condition);
+    std::string result = TCHAR_TO_UTF8(*resultString);
+    return std::stoi(result);
+}

+ 13 - 0
Source/Localization/MyBlueprintFunctionLibrary.h

@@ -14,6 +14,8 @@ class LOCALIZATIONMODULE_API UMyBlueprintFunctionLibrary : public UBlueprintFunc
 {
 	GENERATED_BODY()
 
+public:
+
 	UFUNCTION(BlueprintCallable, Category = "MyUtilities")
 		static void AdjustViewportSize(float OriginX, float OriginY, float SizeX, float SizeY);
 
@@ -22,5 +24,16 @@ class LOCALIZATIONMODULE_API UMyBlueprintFunctionLibrary : public UBlueprintFunc
 	UFUNCTION(BlueprintCallable, Category="MyUtilities")
 		static FColor HexToColor(FString HexString);
 
+
+
+	UFUNCTION(BlueprintCallable, Category = "MyLibrary")
+		static TArray<FString> GetCode(const FString& Condition);
+
+	UFUNCTION(BlueprintCallable, Category = "MyLibrary")
+		static FString ReplaceBoolean(const FString& Condition);
+
+	UFUNCTION(BlueprintCallable, Category = "MyLibrary")
+		static bool Solver(const TArray<FString>& ProductCodeList, const FString& Condition);
+
 	
 };