diff --git a/Binaries/Win64/UnrealEditor-MasharovDev.dll b/Binaries/Win64/UnrealEditor-MasharovDev.dll index 064f8e558..8df12bab0 100644 Binary files a/Binaries/Win64/UnrealEditor-MasharovDev.dll and b/Binaries/Win64/UnrealEditor-MasharovDev.dll differ diff --git a/Binaries/Win64/UnrealEditor-MasharovDev.pdb b/Binaries/Win64/UnrealEditor-MasharovDev.pdb index b3a7cb244..10dcbb9b5 100644 Binary files a/Binaries/Win64/UnrealEditor-MasharovDev.pdb and b/Binaries/Win64/UnrealEditor-MasharovDev.pdb differ diff --git a/Content/Blueprints/Player/GI.uasset b/Content/Blueprints/Player/GI.uasset index dd4994b97..d3455a0ec 100644 Binary files a/Content/Blueprints/Player/GI.uasset and b/Content/Blueprints/Player/GI.uasset differ diff --git a/Content/Maps/crmTest.umap b/Content/Maps/crmTest.umap index 29cb2819c..65dd31e25 100644 Binary files a/Content/Maps/crmTest.umap and b/Content/Maps/crmTest.umap differ diff --git a/Content/Xml/managers.txt b/Content/Xml/managers.txt index 1c17f1ae4..96341436a 100644 --- a/Content/Xml/managers.txt +++ b/Content/Xml/managers.txt @@ -1,7 +1,2 @@ -тест - andronchik92@gmail.com -Хажин Рустам Илгизович - ri.khazhin@masharov-kvartal.ru -Кокшина Яна Эдуардовна - ye.kokshina@masharov-kvartal.ru -Иванченко Никита Александрович - na.ivanchenko@masharov-kvartal.ru -Куринский Кирилл Сергеевич - ks.kurinskii@masharov-kvartal.ru -Киреев Алексей Сергеевич - ks.kireev@masharov-kvartal.ru -Ефимова Мария Александровна - ma.efimova@masharov-kvartal.ru \ No newline at end of file +Макаров Александр - 8(922)070-90-88 +Фишер Вероника - 8(922)041-38-38 \ No newline at end of file diff --git a/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll b/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll index 89f408113..6cace612c 100644 Binary files a/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll and b/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.dll differ diff --git a/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb b/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb index b30b4cc86..aef2b6783 100644 Binary files a/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb and b/Plugins/manageTextFile/Binaries/Win64/UnrealEditor-manageTextFile.pdb differ diff --git a/Plugins/manageTextFile/Source/manageTextFile/Private/manageTextFileBPLibrary.cpp b/Plugins/manageTextFile/Source/manageTextFile/Private/manageTextFileBPLibrary.cpp index 1a3974346..bce4b514e 100644 --- a/Plugins/manageTextFile/Source/manageTextFile/Private/manageTextFileBPLibrary.cpp +++ b/Plugins/manageTextFile/Source/manageTextFile/Private/manageTextFileBPLibrary.cpp @@ -1,6 +1,7 @@ // Copyright Epic Games, Inc. All Rights Reserved. #include "manageTextFileBPLibrary.h" +#include "Kismet/KismetStringLibrary.h" #include "manageTextFile.h" UmanageTextFileBPLibrary::UmanageTextFileBPLibrary(const FObjectInitializer& ObjectInitializer) @@ -72,4 +73,36 @@ bool UmanageTextFileBPLibrary::readFile(FString Path, FString FileName,FString & FString fullpath = Path + "\\" + FileName; return FFileHelper::LoadFileToString(Str, *fullpath); -} \ No newline at end of file +} + +bool UmanageTextFileBPLibrary::parseIniFile(FString Path, FString FileName, TMap& Pairs) { + FString outstr; + readFile(Path, FileName, outstr); + FJsonSerializableArray arr; + outstr.ParseIntoArrayLines(arr); + for (auto& a : arr) { + a.TrimStartAndEndInline(); + if (a.StartsWith("#") || a.StartsWith(";")) continue; + FString k; + FString v; + if (!a.Split(L"=", &k, &v)) continue; + k.TrimStartAndEndInline(); + v.TrimStartAndEndInline(); + Pairs.Add(k, v); + } + return !Pairs.IsEmpty(); +} + +FString UmanageTextFileBPLibrary::getValueFromIniFile(FString Path, FString FileName, FString Key, bool& exists, int& asInt, double& asFloat) { + TMap pairs; + parseIniFile(Path, FileName, pairs); + const auto out=pairs.Find(Key); + if (!out) { + exists = false; + return FString(); + } + asInt = UKismetStringLibrary::Conv_StringToInt(*out); + asFloat = UKismetStringLibrary::Conv_StringToDouble(*out); + exists = true; + return *out; +} \ No newline at end of file diff --git a/Plugins/manageTextFile/Source/manageTextFile/Public/manageTextFileBPLibrary.h b/Plugins/manageTextFile/Source/manageTextFile/Public/manageTextFileBPLibrary.h index ec551b090..bafe55fc5 100644 --- a/Plugins/manageTextFile/Source/manageTextFile/Public/manageTextFileBPLibrary.h +++ b/Plugins/manageTextFile/Source/manageTextFile/Public/manageTextFileBPLibrary.h @@ -40,4 +40,11 @@ class UmanageTextFileBPLibrary : public UBlueprintFunctionLibrary static bool DeleteFile(FString Path, FString FileName); UFUNCTION(BlueprintCallable, Category = "manageTextFile") static bool readFile(FString Path, FString FileName, FString & Str); + + /*# or ; at line begin is comment. line-by-line key=value.*/ + UFUNCTION(BlueprintCallable, Category = "manageTextFile") + static bool parseIniFile(FString Path, FString FileName, TMap& Pairs); + /*# or ; at line begin is comment. line-by-line key=value.*/ + UFUNCTION(BlueprintCallable, Category = "manageTextFile") + static FString getValueFromIniFile(FString Path, FString FileName, FString Key, bool& exists, int& asInt, double& asFloat); }; diff --git a/Source/MasharovDev/commands_model.h b/Source/MasharovDev/commands_model.h index a9783cb41..437833b67 100644 --- a/Source/MasharovDev/commands_model.h +++ b/Source/MasharovDev/commands_model.h @@ -155,7 +155,6 @@ sendCommand(socket, cmd);*/ std::cerr << "Error creating socket" << std::endl; return; } - struct sockaddr_in serverAddress; serverAddress.sin_family = AF_INET; serverAddress.sin_port = htons(port_); // Порт сервера diff --git a/Source/MasharovDev/cppGI.cpp b/Source/MasharovDev/cppGI.cpp index c75dfe34d..c467acba4 100644 --- a/Source/MasharovDev/cppGI.cpp +++ b/Source/MasharovDev/cppGI.cpp @@ -8,6 +8,7 @@ #include "Engine/levelstreamingdynamic.h" CSocket* soc; +char ipc[100]; /*for working tarray::Contains*/ bool operator==(const Fcppcoords& c1, const Fcppcoords& c2) { @@ -132,9 +133,11 @@ void UcppGI::avoidAutoState() void UcppGI::makeSocket(FString ip, int port) { - char* ipc=NULL; - wcstombs(ipc, *ip, ip.Len()); - soc = new CSocket(ipc, port); + //static char ipc[100]; + wcstombs(&ipc[0], *ip, ip.Len()+1); + //size_t sz; + //wcstombs_s(&sz, ipc, ip.Len(),*ip,ip.Len()); + soc = new CSocket(&ipc[0], port); } void UcppGI::setColor(uint8 code, FColor color) diff --git a/Source/MasharovDev/cppGI.h b/Source/MasharovDev/cppGI.h index ff0a07c7f..e0e0e995d 100644 --- a/Source/MasharovDev/cppGI.h +++ b/Source/MasharovDev/cppGI.h @@ -1,4 +1,4 @@ -// Fill out your copyright notice in the Description page of Project Settings. +// Fill out your copyright notice in the Description page of Project Settings. #pragma once @@ -73,31 +73,30 @@ public: UFUNCTION(blueprintcallable, Category = "maketConnection") void makeSocket(FString ip, int port); /*codes: - *0 - - *1 - (, ) - *2 - (, ) */ + *0 - цвет купола в режиме работы с приложением + *1 - первый цвет подсветки квартир (например, подсветка всего здания при его выборе) + *2 - второй цвет подсветки квартир (например, подсветка выбранных квартир) */ UFUNCTION(blueprintcallable, Category = "maketConnection") void setColor(uint8 code, FColor color); /*assign -1 to set all, i.e. flat==-1 -> set whole floor, floor==-1 -> set whole house states: - *0 ( ) - *1 ( ) - *2 ( ) - *3 ( )*/ + *0 — Выключить подсветку(нельзя изменить) + *1 — Подсветка первым цветом(задаётся командой) + *2 — Подсветка вторым цветом(задаётся командой) + *3 — Подсветка белым цветом(нельзя изменить)*/ UFUNCTION(blueprintcallable, Category = "maketConnection") void setLight(int house=-1, int floor=-1, int strip=-1, uint8 state=0); - /*assign -1 to set all, i.e. flat==-1 -> set whole floor, floor==-1 -> set whole house - * parts: - * 255 - * 0 - * 2 - * 4 - * 8 - * + /* parts: + *Все части — 255 + *Купол — 1 + *Все здания — 2 + *Уличная подсветка — 4 + *Офисная подсветка — 8 + * доступно битовое ИЛИ states: - *0 - *1 , ( , , ) - *2 , ( )*/ + *0 — Выключить часть + *1 — Включить часть, в ручном режиме(часть работает в статическом режиме, день ночь на ней, не меняется) + *2 — Включить часть, в автоматическом режиме(часть работает в режиме смены дня и ночи)*/ UFUNCTION(blueprintcallable, Category = "maketConnection") void setPartState(uint8 part, uint8 state); diff --git a/maket.ini b/maket.ini new file mode 100644 index 000000000..e3fb062fc --- /dev/null +++ b/maket.ini @@ -0,0 +1,2 @@ +ip=127.0.0.1 +port=12345 \ No newline at end of file diff --git a/stripMapping.ini b/stripMapping.ini new file mode 100644 index 000000000..26db492bb --- /dev/null +++ b/stripMapping.ini @@ -0,0 +1,84 @@ +#strip map. {app id of apartment}={maket building}-{maket strip} +Z1_H7_S1_A0 =2-3 +Z1_H7_S1_A1 =2-5 +Z1_H7_S1_A2 =2-2 +Z1_H7_S1_A3 =2-4 +Z1_H7_S1_A4 =2-5 +Z1_H7_S1_A5 =2-1 +Z1_H7_S1_A6 =2-0 +Z1_H7_S1_A7 =2-0 +Z1_H7_S1_A8 =2-0 +Z1_H7_S2_A0 =1-5 +Z1_H7_S2_A1 =1-3 +Z1_H7_S2_A2 =1-2 +Z1_H7_S2_A3 =1-1 +Z1_H7_S2_A4 =1-5 +Z1_H7_S2_A5 =1-6 +Z1_H7_S2_A6 =1-4 +Z1_H7_S2_A7 =1-3 +Z1_H7_S2_A8 =1-3 +Z1_H7_S2_A9 =1-0 +Z1_H7_S2_A10=1-1 +Z1_H7_S2_A11=1-1 +Z1_H7_S2_A12=1-1 +Z1_H7_S2_A13=1-3 +Z1_H7_S2_A14=1-0 +Z1_H7_S3_A0 =0-1 +Z1_H7_S3_A1 =0-2 +Z1_H7_S3_A2 =0-3 +Z1_H7_S3_A3 =0-4 +Z1_H7_S3_A4 =0-5 +Z1_H7_S3_A5 =0-6 +Z1_H7_S3_A6 =0-0 +Z1_H7_S3_A7 =0-2 +Z1_H7_S3_A8 =0-6 +Z1_H7_S3_A9 =0-3 +Z1_H9_S1_A0 =4-0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