From 90fadf3023d54d780154eaa2a839e2106317297f Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 05 七月 2021 13:38:59 +0800 Subject: [PATCH] 代码合并整理 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs | 35 + HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs | 425 ++----------- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 358 ++---------- HDL_ON/HDL_ON.projitems | 86 +- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs | 28 HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs | 12 HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs | 6 HDL_ON/UI/UI2/3-Intelligence/Automation.zip | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 72 - HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs | 81 ++ .vs/HDL_APP_Project/xs/UserPrefs.xml | 53 - HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs | 14 HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs | 36 - HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs | 242 -------- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs | 2 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs | 1 HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs | 36 - HDL_ON/UI/UI0-Public/TopViewDiv.cs | 6 HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 10 HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs | 16 HDL_ON/DAL/Server/NewAPI.cs | 69 ++ HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Automation/OnePortAutomation.cs | 6 HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs | 12 HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs | 7 HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs | 34 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs | 43 HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs | 22 HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs | 9 30 files changed, 510 insertions(+), 1,217 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index d28de8c..d390c4c 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,51 +1,14 @@ -锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> - <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Electrical/PjtPage.cs"> +锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> + <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget." /> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs"> <Files> - <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="15" Column="35" /> - <File FileName="HDL_ON/Common/HDLCommon.cs" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs" /> - <File FileName="HDL-ON_Android/Application.cs" /> - <File FileName="HDL_ON/UI/MainPage.cs" Line="359" Column="40" /> - <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" /> - <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" /> - <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" /> - <File FileName="HDL-ON_iOS/Resources/Language.ini" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" Line="11" Column="27" /> - <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="14" Column="78" /> - <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="87" Column="59" /> - <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="946" Column="53" /> - <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="406" Column="26" /> - <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="148" Column="49" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs" Line="341" Column="13" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/PjtPage.cs" Line="309" Column="1" /> + <File FileName="HDL_ON/Entity/Enumerative/Command.cs" Line="16" Column="1" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="200" Column="80" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> - <Node name="HDL_APP_Project" expanded="True"> - <Node name="HDL_ON" expanded="True"> - <Node name="Entity" expanded="True"> - <Node name="Function" expanded="True" /> - </Node> - <Node name="UI" expanded="True"> - <Node name="UI0-Public" expanded="True" /> - <Node name="UI2" expanded="True"> - <Node name="1-HomePage" expanded="True" /> - <Node name="2-Classification" expanded="True" /> - <Node name="FuntionControlView" expanded="True"> - <Node name="Electrical" expanded="True"> - <Node name="PjtPage.cs" selected="True" /> - </Node> - </Node> - </Node> - </Node> - </Node> - <Node name="HDL-ON_Android" expanded="True" /> - <Node name="HDL-ON_iOS" expanded="True"> - <Node name="Resources" expanded="True" /> - </Node> - </Node> + <Node name="HDL_APP_Project" expanded="True" /> </State> </Pad> </Pads> @@ -56,8 +19,8 @@ <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> - <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> - <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> + <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> + <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.822QECU5228FU" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 1673c11..d038f71 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -163,10 +163,6 @@ string requestFullUrl = urlHead + apiPath; - ////**************娴嬭瘯************** - string requestFullUrl = GlobalRequestHttpsHost + apiPath; - ////**************娴嬭瘯************** - RestClient client = new RestClient(requestFullUrl); RestRequest request = new RestRequest(method); diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index 4be919c..2871e44 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -151,7 +151,7 @@ /// 涓嬭浇璐﹀彿澶村儚 /// </summary> public const string API_POST_DownloadHeadImage = "/home-wisdom/app/head/portrait/downWithAccount"; - + #region 鏁版嵁鍒嗕韩 /// <summary> /// 鍒嗕韩鎸囧畾鏂囦欢缁欐寚瀹氭垚鍛� @@ -310,14 +310,14 @@ /// <summary> /// 妫�娴嬫洿鏂�,鏄惁闇�瑕佸己鍒舵洿鏂� /// </summary> - public const string API_POST_CheckAppVersion= "/smart-footstone/app/appVersion/check"; + public const string API_POST_CheckAppVersion = "/smart-footstone/app/appVersion/check"; ///// <summary> ///// 鏌ヨAPP鏈�鏂扮増鏈� ///// </summary> //public const string API_POST_GetAppVersion = "/smart-footstone/app/getAppVersion"; #endregion - + #region 鈻� -- 鎴块棿鍦烘櫙鑳屾櫙鍥剧墖涓婁紶涓嬭浇鎺ュ彛___________________________ /// <summary> @@ -348,7 +348,7 @@ /// 鑾峰彇璁惧璇︽儏 /// </summary> public const string Api_Post_GetDevcieInfoList = "/home-wisdom/app/device/info"; - + /// <summary> /// 鍒锋柊璁惧鐘� /// </summary> @@ -450,6 +450,53 @@ #endregion + #region Kaede -- 瀹夐槻鎺ュ彛____________________________ + /// <summary> + /// 鑾峰彇瀹夐槻鍒楄〃 + /// </summary> + public const string Api_Post_Security_List = "/home-wisdom/app/security/list"; + /// <summary> + /// 鑾峰彇瀹夐槻璇︽儏 + /// </summary> + public const string Api_Post_Security_Info = "/home-wisdom/app/security/info"; + /// <summary> + /// 娣诲姞瀹夐槻 + /// </summary> + public const string Api_Post_Security_Add = "/home-wisdom/app/security/add"; + /// <summary> + /// 缂栬緫瀹夐槻 + /// </summary> + public const string Api_Post_Security_Edit = "/home-wisdom/app/security/update"; + /// <summary> + /// 鍒犻櫎瀹夐槻 + /// </summary> + public const string Api_Post_Security_Delete = "/home-wisdom/app/security/delete"; + /// <summary> + /// 璇诲彇瀹夐槻闃插尯鐘舵�� + /// </summary> + public const string Api_Post_Security_StatusRead = "/home-wisdom/app/security/statusRead"; + /// <summary> + /// 璁剧疆瀹夐槻闃插尯鐘舵�� + /// </summary> + public const string Api_Post_Security_StatusSet = "/home-wisdom/app/security/statusSet"; + /// <summary> + /// 瀹夐槻bypass璁剧疆 + /// </summary> + public const string Api_Post_Security_BypassSet = "/home-wisdom/app/security/bypassSet"; + /// <summary> + /// 瀹夐槻bypass璇诲彇 + /// </summary> + public const string Api_Post_Security_BypassRead = "/home-wisdom/app/security/bypassRead"; + /// <summary> + /// 鏌ヨ瀹夐槻鎵�鏈夎褰� + /// </summary> + public const string Api_Post_Security_ListSecurityLog = "/home-wisdom/app/security/listSecurityLog"; + /// <summary> + /// 鏌ヨ瀹夐槻鎶ヨ璁板綍 + /// </summary> + public const string Api_Post_Security_ListAlarmLog = "/home-wisdom/app/security/listAlarmLog"; + + #endregion #region 鈻� -- 鎴块棿銆佽澶囥�佸満鏅垎浜玙__________________________ @@ -553,13 +600,13 @@ /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙� /// </summary> public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/childToken"; - + #endregion #region 鈻� -- 涓版灄鐩稿叧鐩稿叧鎺ュ彛___________________________ /// <summary> - /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋� + /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃 /// </summary> public const string API_POST_FL_Check = "/home-wisdom/app/fl/vi/check"; /// <summary> @@ -573,7 +620,7 @@ /// <summary> /// 寮�閿佹垚鍔� /// </summary> - public const string API_POST_FL_Unlock= "/home-wisdom/app/fl/vi/unlock"; + public const string API_POST_FL_Unlock = "/home-wisdom/app/fl/vi/unlock"; /// <summary> /// 閫氳瘽瑙嗛鎴浘涓婁紶 /// </summary> @@ -585,8 +632,7 @@ /// <summary> /// 鑾峰彇閫氳瘽璁板綍 /// </summary> - //public const string API_POST_FL_GetCallList = "/home-wisdom/app/fl/vi/list"; - public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; + public const string API_POST_FL_GetCallList = "/home-wisdom/app/fl/vi/list"; /// <summary> /// 鍒犻櫎閫氳瘽璁板綍 /// </summary> @@ -600,6 +646,7 @@ /// </summary> public const string API_POST_FL_QRcode = "http://112.74.164.111:180/api.php/Device/setdynamicpwd"; #endregion + #region 鍙瀵硅鏍囧噯閫氱敤鎺ュ彛 /// <summary> @@ -616,7 +663,9 @@ public const string API_POST_VideoDevice_UpdateCallStatus = "/home-wisdom/platform/imou/updateCallStatus"; #endregion - #region 鍙瀵硅鏍囧噯閫氱敤鎺ュ彛 + + #region 鈻� -- 闂ㄩ攣鐩稿叧鎺ュ彛_______________________________ + /// <summary> /// 鍒ゆ柇闂ㄩ攣鏄惁绗竴浣跨敤 /// </summary> diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 73160f0..f919b8e 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -142,46 +142,6 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\MessageCenterPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\1-HomePage\HomePage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\IntelligencePage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Send.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\FunTpye.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OutdoorEnvironment.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Weather.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\ConditionDeviceFunList.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\TimeTpye.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Logic.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\PublicInterface.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\MainView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Time3.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddLogic.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Set.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\WeatherCondition.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\TargetDeviceFunList.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InpOrOutLogicMethod.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\SpeciaTime.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddTarget.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddInputType.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\FunAllAreaView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\DateView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AreaView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\MonView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicAddView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\FunTypeView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TopView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SelectTypeView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SwitchView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TemperatureView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicTypeTitleView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeHorizonView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TextSize.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TipPopView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\brightnessView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputTextView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SaveView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\CheckView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SingleLogicView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneAddPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneEditPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\SceneAddPage.cs" /> @@ -411,12 +371,9 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\ObjectClass.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneAddPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Scene\CatchSceneCatchFunctionListPage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InputPushText.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AirQuality.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\ArmCenterPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\SecurityAlarm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\ArmDeploymentSettingPage.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OnePortAutomation.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EchartsOption_BrokenLine.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\SmartSpeakerListPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\SmartSpeakerSelectDevicesPage.cs" /> @@ -489,6 +446,49 @@ <Compile Include="$(MSBuildThisFileDirectory)Entity\Room.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Device\DeviceModule.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Device\SBK_SceneListObj.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Send.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\FunTpye.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OutdoorEnvironment.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Weather.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\ConditionDeviceFunList.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\TimeTpye.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Logic.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\PublicInterface.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AirQuality.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\MainView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OnePortAutomation.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicMethod.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Time3.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddLogic.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Set.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InputPushText.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\WeatherCondition.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\TargetDeviceFunList.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InpOrOutLogicMethod.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\SpeciaTime.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddTarget.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AddInputType.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\FunAllAreaView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\DateView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AreaView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\MonView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicAddView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\FunTypeView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TopView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SelectTypeView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SwitchView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TemperatureView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\LogicTypeTitleView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TimeHorizonView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TextSize.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\TipPopView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\brightnessView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\AddOutputInputTextView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SaveView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\CheckView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\SingleLogicView.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs index 27de3ca..9ebf6a1 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs @@ -131,7 +131,7 @@ LoadTopView(); } - public void LoadTopView_RoomTop(Action backAction ,Action editAction) + public void LoadTopView_RoomTop(Action backAction, Action editAction) { this.backAction = backAction; @@ -275,7 +275,7 @@ /// <summary> /// 妤煎眰绠$悊椤堕儴鏍� /// </summary> - public void LoadTopView_FloorTopView(Action<string> callBack,Action action) + public void LoadTopView_FloorTopView(Action<string> callBack, Action action) { LoadTopView(); @@ -340,7 +340,7 @@ /// <summary> /// 鎴愬憳椤堕儴鏍� /// </summary> - public void LoadTopView_MemberTopView(Action callBack, Action action) + public void LoadTopView_MemberTopView(Action addAction, Action action) { LoadTopView(); backAction = action; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation.zip b/HDL_ON/UI/UI2/3-Intelligence/Automation.zip new file mode 100644 index 0000000..252e880 --- /dev/null +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation.zip Binary files differ diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs index 7698eca..2bc0a26 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs @@ -252,7 +252,7 @@ ) => { Logic.currlogic.name = logicName; - Logic.currlogic.sid = LogicMethod.CurrLogicMethod.NewSid(); + Logic.currlogic.sid = LogicMethod.NewSid(); loading.Start(); new System.Threading.Thread(() => { @@ -295,7 +295,7 @@ } Logic.LogicList.Add(Logic.currlogic); - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); MainView.MainShow(); } else if (responsePackNew != null && responsePackNew.Code == "14005") @@ -335,7 +335,7 @@ loading.Hide(); if (responsePackNew != null && responsePackNew.Code == "0") { - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); MainView.MainShow(); } else if (responsePackNew != null && responsePackNew.Code == "14005") @@ -504,7 +504,6 @@ { //瀹氫箟涓�涓眬閮╳eekList鍒楄〃鐢ㄦ潵璁板綍閫変腑鏁版嵁; List<string> weekStateList = new List<string>(); - PublicInterface weekView = new PublicInterface(); if (Logic.currlogic.cycle.type == "week") { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs index cdb06f7..d185e19 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs @@ -85,7 +85,7 @@ /// </summary> public void SceneMethod() { - var sceneList = LogicMethod.CurrLogicMethod.GetSceneList(); + var sceneList = LogicMethod.GetSceneList(); List<string> nameList = new List<string>(); for (int i = 0; i < sceneList.Count; i++) { var scene = sceneList[i]; @@ -101,7 +101,7 @@ //娌″暐浣滅敤锛屼负浜嗗彂閫佹暟鎹牸寮忕粺涓�; outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "scene" }, { "value", "0" } } }; AddOutput(outputDevice); - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); @@ -168,11 +168,11 @@ return; } Output outputTime= new Output(); - outputTime.sid = LogicMethod.CurrLogicMethod.NewSid(); + outputTime.sid = LogicMethod.NewSid(); outputTime.target_type = "3"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", "delay"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", timepoint); + LogicMethod.dictionary(dic, "key", "delay"); + LogicMethod.dictionary(dic, "value", timepoint); outputTime.status.Add(dic); if (edit) { @@ -187,7 +187,7 @@ AddOutput(outputTime); } fLayout.RemoveFromParent(); - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs index 71b6f63..4176826 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs @@ -72,7 +72,7 @@ AddDic(value); }; } - + } /// <summary> /// 灏佽鏁版嵁 @@ -81,13 +81,13 @@ private void AddDic(string value) { Input input = new Input(); - input.sid = LogicMethod.CurrLogicMethod.NewSid(); + input.sid = LogicMethod.NewSid(); input.condition_type = "9"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", "air_quality"); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", value); + LogicMethod.dictionary(dic, "key", "air_quality"); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", value); input.condition.Add(dic); AddCondition(input); } @@ -121,7 +121,7 @@ Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index e2ec5ee..5e24b64 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using HDL_ON.Entity; - namespace HDL_ON.UI.UI2.Intelligence.Automation { public class ConditionDeviceFunList : FrameLayout @@ -20,7 +19,6 @@ /// 瀹氫箟涓�涓彉閲忥紝璁板綍閫変腑鐘舵�� /// </summary> private string selectedState = "unknown"; - public void Show(Entity.Function device, int index, bool edit) { #region 鐣岄潰甯冨眬 @@ -71,7 +69,6 @@ } } break; - //姘存蹈浼犳劅鍣� case SPK.SensorWater: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -88,9 +85,7 @@ } break; - //鐑熼浘浼犳劅鍣� case SPK.SensorSmoke: - //鐕冩皵浼犳劅鍣� case SPK.SensorGas: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -107,7 +102,6 @@ } break; - //骞叉帴鐐� case SPK.SensorDryContact: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -124,11 +118,8 @@ } break; - //绾㈠鐝婃爮浼犳劅鍣� case SPK.SensorShanLan: - //绾㈠瀵瑰皠浼犳劅鍣� case SPK.SensorDuiShe: - //绾㈠绉诲姩浼犳劅鍣� case SPK.SensorPir: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -144,7 +135,6 @@ } } break; - //闂ㄧ獥浼犳劅鍣� case SPK.SensorDoorWindow: { LogicView.FunTypeView view = new LogicView.FunTypeView(); @@ -160,7 +150,6 @@ } } break; - //瓒呭0娉紶鎰熷櫒 case SPK.SensoruUtrasonic: { @@ -186,11 +175,10 @@ } } break; - //姣背娉紶鎰熷櫒 case SPK.SenesorMegahealth: { LogicView.FunTypeView view = new LogicView.FunTypeView(); - view.btnText.TextID = StringId.mubiaozhuangtai;//鐩爣鐘舵�� + view.btnText.TextID = StringId.mubiaozhuangtai ;//鐩爣鐘舵�� fLayout.AddChidren(view.FLayoutView()); view.btnClick.MouseUpEventHandler += (sender, e) => { @@ -202,72 +190,7 @@ } } break; - //鐜妫�娴嬩紶鎰熷櫒 - case SPK.SenesorEnvironment: - { - #region 鐣岄潰 - ///娓╁害 - LogicView.FunTypeView wenuView = new LogicView.FunTypeView(); - wenuView.btnText.TextID = StringId.wendu; - fLayout.AddChidren(wenuView.FLayoutView()); - ///婀垮害 - LogicView.FunTypeView shiduView = new LogicView.FunTypeView(); - shiduView.frameLayout.Y = wenuView.frameLayout.Bottom; - shiduView.btnText.TextID = StringId.shidu; - fLayout.AddChidren(shiduView.FLayoutView()); - ///pm2.5 - LogicView.FunTypeView pm25View = new LogicView.FunTypeView(); - pm25View.frameLayout.Y = shiduView.frameLayout.Bottom; - pm25View.btnText.TextID = StringId.pm25; - fLayout.AddChidren(pm25View.FLayoutView()); - ///co2 - LogicView.FunTypeView co2View = new LogicView.FunTypeView(); - co2View.frameLayout.Y = pm25View.frameLayout.Bottom; - co2View.btnText.TextID = StringId.co2; - fLayout.AddChidren(co2View.FLayoutView()); - ///tvoc - LogicView.FunTypeView tvocView = new LogicView.FunTypeView(); - tvocView.frameLayout.Y = co2View.frameLayout.Bottom; - tvocView.btnText.TextID = StringId.tvoc; - fLayout.AddChidren(tvocView.FLayoutView()); - #endregion - #region 鐐瑰嚮浜嬩欢 - ///娓╁害鐐瑰嚮浜嬩欢 - wenuView.btnClick.MouseUpEventHandler += (sender, e) => - { - new PublicInterface { }.ViewZuHe(this, StringId.wendugaoyu, StringId.wendudiyu, (intText, view) => - { - InputBoxAction(device,intText, index, edit); - }); - }; - ///婀垮害鐐瑰嚮浜嬩欢 - shiduView.btnClick.MouseUpEventHandler += (sender, e) => - { - new PublicInterface { }.ViewZuHe(this, StringId.shidugaoyu, StringId.shidudiyu, (intText, view) => - { - InputBoxAction(device,intText, index, edit); - }); - }; - ///pm2.5鐐瑰嚮浜嬩欢 - pm25View.btnClick.MouseUpEventHandler += (sender, e) => - { - PmCo2TvocAction(this,device, "pm25",StringId.pm25, index,edit); - }; - ///co2鐐瑰嚮浜嬩欢 - co2View.btnClick.MouseUpEventHandler += (sender, e) => - { - PmCo2TvocAction(this,device, "co2", StringId.co2, index, edit); - }; - ///tvoc鐐瑰嚮浜嬩欢 - tvocView.btnClick.MouseUpEventHandler += (sender, e) => - { - PmCo2TvocAction(this,device, "tvoc", StringId.tvoc, index, edit); - - }; - #endregion - } - break; } #region 淇濆瓨 ///淇濆瓨View @@ -277,65 +200,55 @@ this.AddChidren(saveView.FLayoutView()); saveView.btnClick.MouseUpEventHandler += (sen, e) => { - Save(device,index, edit); - }; - - #endregion - - } - /// <summary> - /// 淇濆瓨杈撳叆鏉′欢 - /// </summary> - /// <param name="index">绱㈠紩鍊�</param> - /// <param name="edit"></param> - private void Save(Entity.Function device,int index, bool edit) - { - - if (selectedState != "unknown") - { - Input inputDevice = new Input(); - inputDevice.condition_type = "3"; - inputDevice.sid = device.sid; - inputDevice.condition = dicSateteList; - if (edit) + if (selectedState != "unknown") { - //绉婚櫎鏃ф暟鎹� - Logic.currlogic.input.RemoveAt(index); - //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�; - Logic.currlogic.input.Insert(index, inputDevice); + Input inputDevice = new Input(); + inputDevice.condition_type = "3"; + inputDevice.sid = device.sid; + inputDevice.condition = dicSateteList; + if (edit) + { + //绉婚櫎鏃ф暟鎹� + Logic.currlogic.input.RemoveAt(index); + //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�; + Logic.currlogic.input.Insert(index, inputDevice); + } + else + { + //娣诲姞涓�涓潯浠� + AddCondition(inputDevice); + } } else { - //娣诲姞涓�涓潯浠� - AddCondition(inputDevice); - } - } - else - { - if (!edit) - { - //鎻愮ず鐢ㄦ埛 + if (!edit) + { + //鎻愮ず鐢ㄦ埛 + return; + } + this.RemoveFromParent(); return; } - this.RemoveFromParent(); - return; - } - LogicMethod.CurrLogicMethod.RemoveAllView(); - if (MainView.IsGatewayType) - { //A缃戝叧 - var addLogic = new AddLogic(); - MainPage.BasePageView.AddChidren(addLogic); - addLogic.Show(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else - { - //涓�绔彛缃戝叧 - var onePortAutomation = new OnePortAutomation(); - MainPage.BasePageView.AddChidren(onePortAutomation); - onePortAutomation.Show(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } + LogicMethod.RemoveAllView(); + + if (MainView.IsGatewayType) + { //A缃戝叧 + var addLogic = new AddLogic(); + MainPage.BasePageView.AddChidren(addLogic); + addLogic.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + else + { + //涓�绔彛缃戝叧 + var onePortAutomation = new OnePortAutomation(); + MainPage.BasePageView.AddChidren(onePortAutomation); + onePortAutomation.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + }; + + #endregion } /// <summary> @@ -345,8 +258,7 @@ /// <param name="button">閫変腑鐘舵�佹樉绀烘枃鏈珺tn鎺т欢</param> /// <param name="btnText1">灞炴�х姸鎬佸�兼枃鏈�1</param> /// <param name="btnText2">灞炴�х姸鎬佸�兼枃鏈�2</param> - private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2) - { + private void DeviceView(Entity.Function device,Button button,int btnText1,int btnText2) { FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence }; this.AddChidren(frame); LogicView.SwitchView switchView = new LogicView.SwitchView(); @@ -447,99 +359,10 @@ //鏄剧ず鏂囨湰 button.TextID = intValue; selectedState = device.spk + "_" + value; - AddDictionary(keyVlaue, value, "string"); + AddDictionary(keyVlaue, value); }); - } - /// <summary> - /// 娓╁害,婀垮害寮规璁剧疆鍊� - /// </summary> - /// <param name="textInt">鏂囨湰</param> - /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�20</param> - public void InputBoxAction(Entity.Function device, int textInt, int index, bool edit, string stateValue = "20") - { - if (edit) - { - Input inputs = Logic.currlogic.input[index]; - //娓呴櫎涔嬪墠鏃ф暟鎹� - dicSateteList.Clear(); - if (inputs.condition.Count != 0) - { - //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = inputs.condition; - } - } - new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => - { - string keyValue = "20"; - string data_type = "integer"; - string comparator = "="; - switch (textInt) - { - case StringId.wendugaoyu: - { - keyValue = "temperature"; - comparator = ">"; - data_type = "float"; - } - break; - case StringId.wendudiyu: - { - keyValue = "temperature"; - comparator = "<"; - data_type = "float"; - } - break; - case StringId.shidugaoyu: - { - keyValue = "humidity"; - comparator = ">"; - } - break; - case StringId.shidudiyu: - { - keyValue = "humidity"; - comparator = "<"; - } - break; - } - selectedState = device.spk + "_" + value; - AddDictionary(keyValue, value, data_type, comparator); - Save(device,index, edit); - }); - } - /// PM2.5,Co2,Tvoc璁剧疆鍊� - /// </summary> - /// <param name="frame">褰撳墠鐣岄潰</param> - /// <param name="key">灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�<</param> - /// <param name="title">鏍囬鏂囨湰</param> - /// <param name="index"></param> - /// <param name="edit"></param> - /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�""</param> - public void PmCo2TvocAction(FrameLayout frame, Entity.Function device,string key,int title, int index, bool edit, string stateValue = "") - { - if (edit) - { - Input inputs = Logic.currlogic.input[index]; - //娓呴櫎涔嬪墠鏃ф暟鎹� - dicSateteList.Clear(); - if (inputs.condition.Count != 0) - { - //鏈夋暟鎹噸鏂拌祴鍊� - dicSateteList = inputs.condition; - } - } - PublicInterface view = new PublicInterface(); - var listStr = view.GetViewList(key); - view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue) - , (text) => - { - var value = view.GetValue(key, text); - selectedState = device.spk + "_"+ key; - AddDictionary(key, value, "integer"); - Save(device,index, edit); - }); } /// <summary> /// 鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬� @@ -568,28 +391,36 @@ /// </summary> /// <param name="KeyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> /// <param name="selectedValue">鐘舵�佸��</param> - /// <param name="data_type">绫诲瀷</param> - /// <param name="comparator">姣旇緝鍏崇郴</param> - private void AddDictionary(string KeyValue, string selectedValue, string data_type, string comparator = "=") + private void AddDictionary(string KeyValue, string selectedValue) { //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", KeyValue); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", comparator); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", data_type); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", selectedValue); - AddDictionaryList(dic); + LogicMethod.dictionary(dic, "key", KeyValue); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", selectedValue); + AddDictionaryList(KeyValue, dic); } /// <summary> /// 鏇存柊鏁版嵁鍒楄〃 /// </summary> - /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> - /// <param name="comparator">姣旇緝鍏崇郴</param> + /// <param name="keyValue">璁惧灞炴�у�硷紝浜戦泙涓婂畾涔夊ソ鐨�</param> /// <param name="dictionary">娣诲姞閫変腑鏁版嵁</param> /// <returns></returns> - private void AddDictionaryList(Dictionary<string, string> dictionary) + private void AddDictionaryList(string keyValue, Dictionary<string, string> dictionary) { - var indexValue = IsContainsAll(dictionary, dicSateteList); + int indexValue = -1; + for (int i = 0; i < dicSateteList.Count; i++) + { + var dic = dicSateteList[i]; + if (dic.ContainsValue(keyValue)) + { + //鍒ゆ柇鏄惁瀛樺湪 + indexValue = i; + break; + } + } + if (indexValue != -1) { //瀛樺湪绉婚櫎 @@ -615,13 +446,8 @@ { if (Logic.currlogic.input[i].sid == input.sid) { - //鏈変簺璁惧姣旇緝鐗规畩锛堜緥濡傦細娴锋灄浼犳劅鍣ㄨ繕鏄鍒ゆ柇灞炴�у�硷紝娓╂箍搴﹀睘鎬ц繕瑕佸垽鏂瘮杈冨叧绯伙紝鎵嶈兘纭鏄惁宸茬粡瀛樺湪璇ユ潯浠讹紝鍏朵粬璁惧鏉′欢鐩存帴鐢╯id鍒ゆ柇鍗冲彲锛� - //鍔犱竴绾у垽鏂槸涓哄吋瀹圭壒娈婅澶� - if (IsContainsAll(input.condition, Logic.currlogic.input[i].condition)) - { - indexValue = i; - break; - } + indexValue = i; + break; } } @@ -636,53 +462,5 @@ } } - /// <summary> - /// 鍒ゆ柇dictionaryB鍒楄〃鏄惁瀹屾暣鍖呭惈鍙︿竴涓猟ictionaryA - /// </summary> - /// <param name="dictionaryA">瀵硅薄</param> - /// <param name="dictionaryB">鍒楄〃</param> - /// <returns>杩斿洖鍒楄〃鐨勭储寮曞��</returns> - public int IsContainsAll(Dictionary<string, string> dictionaryA, List<Dictionary<string, string>> dictionaryB) - { - int valueInt = -1; - for (int i = 0; i < dictionaryB.Count; i++) - { - var dic = dictionaryB[i]; - string key = dic["key"]; - string comparatorValue = dic["comparator"]; - if (dictionaryA["key"] == key && dictionaryA["comparator"] == comparatorValue) - { - //鍒ゆ柇鏄惁瀛樺湪 - valueInt = i; - break; - } - } - return valueInt; - } - /// <summary> - /// 鍒ゆ柇dictionaryB鏄惁瀹屾暣鍖呭惈鍙︿竴涓猟ictionaryA - /// </summary> - /// <param name="dictionaryA"></param> - /// <param name="dictionaryB"></param> - /// <returns></returns> - public bool IsContainsAll(List<Dictionary<string, string>> dictionaryA, List<Dictionary<string, string>> dictionaryB) - { - - for (int i = 0; i < dictionaryA.Count; i++) - { - var dic = dictionaryA[i]; - string key = dic["key"]; - string comparatorValue = dic["comparator"]; - var list = dictionaryB.FindAll((dictionary) => dictionary["key"] == key && dictionary["comparator"] == comparatorValue); - if (list.Count> 0) - { - return true; - } - - } - return false; - } - - } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs index addf896..b79e2b2 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/FunTpye.cs @@ -81,7 +81,7 @@ Width = Application.GetRealWidth(144), Height = Application.GetRealHeight(44 * 5), }; - var roomList = LogicMethod.CurrLogicMethod.GetGatewayRoomList(Language.StringByID(StringId.allAreas)); + var roomList = LogicMethod.GetGatewayRoomList(Language.StringByID(StringId.allAreas)); if (roomList.Count > 5) { @@ -122,7 +122,7 @@ funAllAreaView.btnText2.Text = Language.StringByID(StringId.allFun); selectedRoom = (areaView.btnClick.Tag as Entity.Room); ///鑾峰彇鏄剧ず璁惧鍒楄〃 - var list = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room,if_type); + var list = LogicMethod.GetFunctionDeviceList(areaView.btnClick.Tag as Entity.Room,if_type); DeviceListView(vv, list); }; @@ -138,9 +138,9 @@ EventHandler<MouseEventArgs> funClick = (sender3, e3) =>{ //鑾峰彇鏈�缁堟樉绀哄垪琛� - var functionList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type); + var functionList = LogicMethod.GetFunctionDeviceList(selectedRoom, if_type); //鑾峰彇璁惧鍒楄〃鐨勭被鍨嬶紙渚嬪锛氱伅鍏夌被锛岀獥甯樼被銆傘�傘�傦級 - var deviceTypeList = LogicMethod.CurrLogicMethod.GetDeviceTypeList(functionList); + var deviceTypeList = LogicMethod.GetDeviceTypeList(functionList); if (deviceTypeList.Count==0) { //娌℃湁绫诲瀷鐩存帴杩斿洖鍘�; return; @@ -219,9 +219,9 @@ fLayout.RemoveFromParent(); funAllAreaView.btnText2.Text = areaView.btnClick.Tag.ToString(); ///鑾峰彇鍗曚釜绫诲瀷锛堜緥濡傦細鐏厜绫汇�傘�傦級璁惧FunctionType鍒楄〃 - var typeFunctionList = LogicMethod.CurrLogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString()); + var typeFunctionList = LogicMethod.GetDeviceTypeFunctionList(areaView.btnClick.Tag.ToString()); ///鑾峰彇鍗曚釜鐏厜绫诲瀷锛堜緥濡傦細鐏厜1,鐏厜2銆傘�傦級鏄剧ず璁惧鍒楄〃 - var lists = LogicMethod.CurrLogicMethod.GetShowDeviceList(typeFunctionList, functionList); + var lists = LogicMethod.GetShowDeviceList(typeFunctionList, functionList); DeviceListView(vv, lists); }; if (deviceTypeList.Count - 1 == i) @@ -234,7 +234,7 @@ funAllAreaView.btnText2.MouseUpEventHandler += funClick; funAllAreaView.btnIcon2.MouseUpEventHandler += funClick; ///鑾峰彇鏄剧ず璁惧鍒楄〃 - var deviceList = LogicMethod.CurrLogicMethod.GetFunctionDeviceList(selectedRoom, if_type); + var deviceList = LogicMethod.GetFunctionDeviceList(selectedRoom, if_type); DeviceListView(vv, deviceList); } @@ -255,7 +255,7 @@ funView.btnLine.X = Application.GetRealWidth(16); funView.btnLine.Width = Application.GetRealWidth(343); verticalScrolView.AddChidren(funView.FLayoutView()); - funView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(dev.spk); + funView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(dev.spk); funView.btnDeviceName.Text = dev.name; funView.btnRoomName.Text = dev.GetRoomListName(); funView.btnClick.MouseUpEventHandler += (sen,e) => { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs index c2f9703..c888bc1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs @@ -20,14 +20,12 @@ ///鍚勭鏉′欢鐨刅iew LogicView.AddOutputInputView inputView = new LogicView.AddOutputInputView(); inputView.FLayoutView(viewLayout); - //娣诲姞娌℃湁寤舵椂锛岄殣钘忓欢鏃舵寜閽�; - inputView.btnDelay.Visible = false; ///璁板綍鏉′欢绫诲瀷 inputView.btnClick.Name = inputCondition.condition_type; ///璁板綍鏉′欢绱㈠紩 - inputView.btnClick.Tag = inputCondition; + inputView.btnClick.Tag = inputCondition.sid; ///鏉′欢鐘舵�佹暟缁� - List<Dictionary<string, string>> dicList = inputCondition.condition; + List<Dictionary<string, string>> dicList = inputCondition.condition as List<Dictionary<string, string>>; //鏄剧ず鏉′欢鍚勭绫诲瀷鐘舵�� switch (inputCondition.condition_type) { @@ -125,9 +123,9 @@ case "3": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(inputCondition.sid); + var device = LogicMethod.GetDevice(inputCondition.sid); //鐢ㄨ澶囩殑functionType绫诲瀷鎵惧埌瀵瑰簲鍥炬爣锛� - inputView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(device.spk); + inputView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(device.spk); //鏄剧ず璁惧鍚嶇О inputView.btnText.Text = device.name; //鏀瑰彉璁惧鍚嶇О鏄剧ず鎺т欢瀹藉害 @@ -270,7 +268,7 @@ { if (value == "true") { - str += Language.StringByID(StringId.youren) + ";"; + str+= Language.StringByID(StringId.youren)+";"; } else { @@ -315,65 +313,6 @@ } } break; - case SPK.SenesorEnvironment: - { - string strtext = ""; - foreach (var dic in dicList) - { - string key = dic["key"]; - string value = dic["value"]; - string comparator = dic["comparator"]; - switch (key) - { - - case "temperature": - { - if (comparator == ">") - { - strtext = ">" + value + "鈩�"; - } - else if (comparator == "<") - { - strtext = "<" + value + "鈩�"; - } - - } - break; - case "humidity": - { - if (comparator == ">") - { - strtext = ">" + value + "%"; - } - else if (comparator == "<") - { - strtext = "<" + value + "%"; - } - - } - break; - case "co2": - { - strtext = Language.StringByID(StringId.co2) + new PublicInterface { }.GetString("co2", value); - } - break; - case "pm25": - { - strtext = Language.StringByID(StringId.pm25) + new PublicInterface { }.GetString("pm25", value); - } - break; - case "tvoc": - { - strtext = Language.StringByID(StringId.tvoc) + new PublicInterface { }.GetString("tvoc", value); - } - break; - } - inputView.btnState.Text = strtext; - } - - - } - break; } } @@ -393,7 +332,7 @@ { case "outdoor_temp": { - strvalue = value + "鈩�"; + strvalue = value; if (comparator == ">") { strtext = Language.StringByID(StringId.wendugaoyu); @@ -407,7 +346,7 @@ break; case "outdoor_humity": { - strvalue = value + "%"; + strvalue = value; if (comparator == ">") { strtext = Language.StringByID(StringId.shidugaoyu); @@ -422,7 +361,7 @@ case "pm2.5": { strtext = Language.StringByID(StringId.PM25); - strvalue = new PublicInterface { }.GetString("pm25", value); + strvalue = new OutdoorEnvironment { }.GetString(value); } break; @@ -468,40 +407,57 @@ } } break; + case "9": + { + inputView.btnIcon.UnSelectedImagePath = "LogicIcon/changesinoutdoor.png"; + foreach (var dic in dicList) + { + string strtext = ""; + string value = dic["value"]; + switch (value) + { + case "excellent": + { + strtext = Language.StringByID(StringId.kongqiyou); + + } + break; + case "good": + { + + strtext = Language.StringByID(StringId.kongqiliang); + + } + break; + case "poor": + { + strtext = Language.StringByID(StringId.kongqicha); + } + break; + + } + inputView.btnText.TextID = StringId.kongqizhiliang; + inputView.btnState.Text = strtext; + } + } + break; } //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠� inputView.btnClick.MouseUpEventHandler += (sen, e) => { Button button = (Button)sen; - //褰撳墠缂栬緫鐨勬潯浠� - Input ckcliInput = inputView.btnClick.Tag as Input; //鎵惧埌褰撳墠缂栬緫鐨勭储寮� int indexVulae = 0; for (int index = 0; index < Logic.currlogic.input.Count; index++) { Input input = Logic.currlogic.input[index]; - if (input.sid == ckcliInput.sid) + if (input.sid == inputView.btnClick.Tag.ToString()) { - if (button.Name == "3") - { - //鏈変簺璁惧姣旇緝鐗规畩锛堜緥濡傦細娴锋灄浼犳劅鍣ㄨ繕鏄鍒ゆ柇灞炴�у�硷紝娓╂箍搴﹀睘鎬ц繕瑕佸垽鏂瘮杈冨叧绯伙紝鎵嶈兘纭鏄惁宸茬粡瀛樺湪璇ユ潯浠讹紝鍏朵粬璁惧鏉′欢鐩存帴鐢╯id鍒ゆ柇鍗冲彲锛� - //鍔犱竴绾у垽鏂槸涓哄吋瀹圭壒娈婅澶� - if (new ConditionDeviceFunList { }.IsContainsAll(ckcliInput.condition, input.condition)) - { - //鐢ㄦ埛鍙兘鍒犻櫎鏁版嵁锛屼娇鍒楄〃绱㈠紩鍙戠敓鏀瑰彉锛� - //閫氳繃鍞竴sid閲嶆柊鏌ユ壘鍒扮储寮曚笖鏇存柊绱㈠紩鍊� - indexVulae = index; - break; - } - } - else - { - //鐢ㄦ埛鍙兘鍒犻櫎鏁版嵁锛屼娇鍒楄〃绱㈠紩鍙戠敓鏀瑰彉锛� - //閫氳繃鍞竴sid閲嶆柊鏌ユ壘鍒扮储寮曚笖鏇存柊绱㈠紩鍊� - indexVulae = index; - break; - } + //鐢ㄦ埛鍙兘鍒犻櫎鏁版嵁锛屼娇鍒楄〃绱㈠紩鍙戠敓鏀瑰彉锛� + //閫氳繃鍞竴sid閲嶆柊鏌ユ壘鍒扮储寮曚笖鏇存柊绱㈠紩鍊� + indexVulae = index; + break; } } //鏍囪缂栬緫鐘舵�� @@ -514,7 +470,7 @@ Input _input = Logic.currlogic.input[indexVulae]; if (_input.condition_type == "1") { - var dicLists = _input.condition; + var dicLists = _input.condition as List<Dictionary<string, string>>; foreach (var dic in dicLists) { string keyValue = dic["key"]; @@ -564,78 +520,11 @@ case "3": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(inputCondition.sid); - if (device.spk == SPK.SenesorEnvironment) - { - //杩欎釜璁惧姣旇緝鐗规畩 - ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList(); - ///褰撳墠鐨勭储寮曞�兼暟鎹璞� - Input inputedit = Logic.currlogic.input[indexVulae]; - ///鐘舵�佸�� - string stateValue = ""; - foreach (var dic in inputedit.condition) - { - string key = dic["key"]; - string comparator = dic["comparator"]; - stateValue = dic["value"]; - switch (key) - { - - case "temperature": - { - int titleInt = 0; - if (comparator == ">") - { - titleInt = StringId.wendugaoyu; - } - else if (comparator == "<") - { - titleInt = StringId.wendudiyu; - } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); - } - break; - case "humidity": - { - int titleInt = 0; - if (comparator == ">") - { - titleInt = StringId.shidugaoyu; - } - else if (comparator == "<") - { - titleInt = StringId.shidudiyu; - } - conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); - } - break; - case "co2": - { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); - } - break; - case "pm25": - { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); - - } - break; - case "tvoc": - { - conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); - } - break; - } - } - - } - else - { - ConditionDeviceFunList deviceFunList = new ConditionDeviceFunList(); - MainPage.BasePageView.AddChidren(deviceFunList); - deviceFunList.Show(device, indexVulae, edit); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } + var device = LogicMethod.GetDevice(inputCondition.sid); + ConditionDeviceFunList deviceFunList = new ConditionDeviceFunList(); + MainPage.BasePageView.AddChidren(deviceFunList); + deviceFunList.Show(device, indexVulae, edit); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } break; case "4": @@ -710,6 +599,15 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } break; + case "9": + { + + AirQuality airQuality = new AirQuality(); + MainPage.BasePageView.AddChidren(airQuality); + airQuality.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + break; } }; ///鍒犻櫎鎺т欢 @@ -740,23 +638,22 @@ ///璁板綍鏉′欢绱㈠紩 targetView.btnClick.Tag = outputTarget.sid; ///鏉′欢鐘舵�佹暟缁� - List<Dictionary<string, string>> dicList = outputTarget.status; - //鏄剧ず鐘舵�佸�� - string stateStr = ""; + List<Dictionary<string, string>> dicList = outputTarget.status as List<Dictionary<string, string>>; //鏄剧ず杈撳嚭鏉′欢鍚勭绫诲瀷鐘舵�� switch (outputTarget.target_type) { case "1": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(outputTarget.sid); + var device = LogicMethod.GetDevice(outputTarget.sid); //鐢ㄨ澶囩殑functionType绫诲瀷鎵惧埌瀵瑰簲鍥炬爣锛� - targetView.btnIcon.UnSelectedImagePath = LogicMethod.CurrLogicMethod.GetIconPath(device.spk); + targetView.btnIcon.UnSelectedImagePath = LogicMethod.GetIconPath(device.spk); //鏄剧ず璁惧鍚嶇О targetView.btnText.Text = device.name; //鏀瑰彉璁惧鍚嶇О鏄剧ず鎺т欢瀹藉害 targetView.btnText.Width = Application.GetRealWidth(80); - + //绗竴涓彉閲忔樉绀虹姸鎬佸�� + string stateStr = ""; //鍖哄埆涓嶅悓璁惧锛屾樉绀轰笉鍚岃澶囩姸鎬� switch (device.spk) { @@ -776,6 +673,7 @@ stateStr = Language.StringByID(StringId.offLogic); } } + targetView.btnState.Text = stateStr; } break; case SPK.LightRGB: @@ -801,7 +699,7 @@ { stateStr = brightness + "%"; } - + targetView.btnState.Text = stateStr; } break; case SPK.CurtainSwitch: @@ -830,6 +728,7 @@ break; } } + targetView.btnState.Text = stateStr; } break; case SPK.AcStandard: @@ -921,11 +820,11 @@ } if (on_off != "" && on_off == "off") { - stateStr = Language.StringByID(StringId.offLogic); + targetView.btnState.Text = Language.StringByID(StringId.offLogic); } else { - stateStr = stateStr.TrimEnd(','); + targetView.btnState.Text = stateStr.TrimEnd(','); } @@ -1019,11 +918,11 @@ } if (on_off != "" && on_off == "off") { - stateStr = Language.StringByID(StringId.offLogic); + targetView.btnState.Text = Language.StringByID(StringId.offLogic); } else { - stateStr = stateStr.TrimEnd(','); + targetView.btnState.Text = stateStr.TrimEnd(','); } } @@ -1034,11 +933,11 @@ case "2": { //鐢╯id鎵惧埌鍦烘櫙锛� - var scene = LogicMethod.CurrLogicMethod.GetSecne(outputTarget.sid); + var scene = LogicMethod.GetSecne(outputTarget.sid); targetView.btnIcon.UnSelectedImagePath = "LogicIcon/scene.png"; targetView.btnNextIcon.Visible = false; //鏄剧ず鍦烘櫙鍚嶇О - stateStr = scene.name; + targetView.btnText.Text = scene.name; } break; case "3": @@ -1047,19 +946,10 @@ foreach (var dic in dicList) { string value = dic["value"]; - stateStr = value; + targetView.btnText.Text = value; } } break; - } - - if (outputTarget.target_type == "1") - { - targetView.btnState.Text =new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; - } - else - { - targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; } //鍐嶆缂栬緫鏉′欢鐘舵�佺偣鍑讳簨浠� targetView.btnClick.MouseUpEventHandler += (sen, e) => @@ -1085,7 +975,7 @@ case "1": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(outputTarget.sid); + var device = LogicMethod.GetDevice(outputTarget.sid); TargetDeviceFunList deviceFunList = new TargetDeviceFunList(); MainPage.BasePageView.AddChidren(deviceFunList); deviceFunList.Show(device, indexVulae, edit); @@ -1107,25 +997,6 @@ } break; } - }; - //寤舵椂鐐瑰嚮浜嬩欢 - targetView.btnDelay.MouseUpEventHandler += (sen, e) => - { - - InpOrOutLogicMethod inpOrOutLogicMethod = new InpOrOutLogicMethod(); - inpOrOutLogicMethod.Delayed(thisView, outputTarget, (value) => - { - outputTarget.delay = value.ToString(); - if (outputTarget.target_type == "1") - { - targetView.btnState.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; - } - else - { - targetView.btnText.Text = new InpOrOutLogicMethod { }.GetTimeText(outputTarget.delay) + stateStr; - } - }); - }; ///鍒犻櫎鎺т欢 targetView.btnDel.MouseUpEventHandler += (sender, e) => @@ -1188,11 +1059,7 @@ break; case "brightness": { - if (button2 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } + button2.Text = value + "%"; } break; @@ -1255,21 +1122,11 @@ break; case "set_temp": { - if (button2 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } button2.Text = value + "鈩�"; } break; case "mode": { - if (button3 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } switch (value) { case "cool": @@ -1300,11 +1157,6 @@ break; case "fan": { - if (button4 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } switch (value) { case "high": @@ -1367,21 +1219,11 @@ break; case "set_temp": { - if (button2 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } button2.Text = value + "鈩�"; } break; case "mode": { - if (button3 == null) - { - //鎬曡皟璇曡蒋浠朵贡涓婁笢瑗垮鑷存姏寮傚父 - break; - } switch (value) { case "day": @@ -1613,7 +1455,7 @@ case "3": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(inputCondition.sid); + var device = LogicMethod.GetDevice(inputCondition.sid); name = device.name + "-"; } break; @@ -1628,7 +1470,7 @@ case "1": { //鐢╯id鎵惧埌璁惧锛� - var device = LogicMethod.CurrLogicMethod.GetDevice(outputTarget.sid); + var device = LogicMethod.GetDevice(outputTarget.sid); //鏄剧ず璁惧鍚嶇О name += device.name; string stateStr = ""; @@ -1733,7 +1575,7 @@ case "2": { //鐢╯id鎵惧埌鍦烘櫙锛� - var scene = LogicMethod.CurrLogicMethod.GetSecne(outputTarget.sid); + var scene = LogicMethod.GetSecne(outputTarget.sid); name += scene.name; } @@ -1743,108 +1585,5 @@ catch { } return name; } - - - /// <summary> - /// 寤舵椂鏃堕棿鏂规硶 - /// </summary> - /// <param name="fLayout">鍦ㄥ摢涓晫闈㈡樉绀�</param> - /// <param name="edit">锛坱rue=缂栬緫锛沠alse=鏂板缓锛�</param> - /// <param name="index">缂栬緫鏉′欢鐨勭储寮�</param> - private void Delayed(FrameLayout thisFLayout, Output output, Action<int> action) - { - FrameLayout fLayout = new FrameLayout - { - BackgroundColor = CSS.CSS_Color.viewTrans60lucence, - }; - thisFLayout.AddChidren(fLayout); - LogicView.TimeView timePointView = new LogicView.TimeView(); - timePointView.FLayoutView(fLayout); - EventHandler<MouseEventArgs> RemovefLayout = (sender, e1) => - { - //绉婚櫎fLayout鐣岄潰 - fLayout.RemoveFromParent(); - }; - //鍙栨秷鐐瑰嚮浜嬩欢 - timePointView.btnCancel.MouseUpEventHandler += RemovefLayout; - - //鍔犺浇鏁版嵁鐣岄潰鐨勮缃柟娉�(鍒楄〃浜掍笉鑱斿姩) - timePointView.mUIPickerView.setNPicker(timePointView.GetmStringList(), timePointView.GetsStringList(), null); - //榛樿鍒濆閫変腑鐘舵�� - timePointView.mUIPickerView.setCurrentItems(0, 5, 0); - //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鏃堕棿 - int timepoint = 5; - - if (output.delay != "0") - { - int intValue = int.Parse(output.delay); - var m = intValue / 60; - var s = intValue % 60; - - string timeValue = m.ToString() + ":" + s.ToString(); - int mIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GetmIntList()); - int sIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList()); - //鏇存柊鍒濆鐘舵�� - timePointView.mUIPickerView.setCurrentItems(mIndex, sIndex, 0); - timepoint = intValue; - } - - - //閫変腑鏃堕棿鍥炶皟鏂规硶,鏃堕棿鍙樺寲涓�娆″洖璋冧竴娆� - timePointView.mUIPickerView.OnSelectChangeEvent += (index1, index2, index3) => - { - string minuet = timePointView.GethStringList0()[index1].Split(' ')[0]; - string second = timePointView.GetmStringList()[index2].Split(' ')[0]; - int minuetIntValue = int.Parse(minuet); - int secondIntValue = int.Parse(second); - timepoint = minuetIntValue * 60 + secondIntValue; - }; - //纭畾鐐瑰嚮浜嬩欢 - timePointView.btnConfirm.MouseUpEventHandler += (sender, e3) => - { - if (timepoint == 0) - { - //鎻愮ず - return; - } - fLayout.RemoveFromParent(); - action(timepoint); - }; - } - /// <summary> - /// 鑾峰彇鏃堕棿鏂囨湰鎻忚堪 - /// </summary> - /// <param name="strTimeValue">鏃堕棿鍊硷紙鍗曚綅s绉掞級</param> - /// <returns></returns> - private string GetTimeText(string strTimeValue) - { - var timeValue = int.Parse(strTimeValue); - string state = ""; - var minutes = timeValue / 60; - var seconds = timeValue % 60; - if (minutes != 0) - { - if (seconds == 0) - { - state = minutes.ToString() + Language.StringByID(StringId.minute); - } - else - { - state = minutes.ToString() + Language.StringByID(StringId.minute) + seconds.ToString() + Language.StringByID(StringId.s); - } - } - else - { - if (seconds != 0) - { - state = seconds.ToString() + Language.StringByID(StringId.s); - } - } - if (!string.IsNullOrEmpty(state)) { - state = Language.StringByID(StringId.delayLogic) + state; - } - return state; - } - } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs index 92d5437..d392722 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs @@ -5,6 +5,7 @@ /// <summary> /// 閫昏緫瀛樺偍鏁版嵁瀵硅薄 /// </summary> + [Serializable] public class Logic { @@ -62,6 +63,7 @@ /// <summary> /// 鎵ц鍛ㄦ湡瀵硅薄 /// </summary> + [Serializable] public class Cycle { /// <summary> @@ -74,6 +76,7 @@ /// <summary> /// 杈撳叆鏉′欢瀵硅薄 /// </summary> + [Serializable] public class Input { /// <summary> @@ -93,20 +96,21 @@ /// </summary> public string condition_type = ""; public List<Dictionary<string, string>> condition = new List<Dictionary<string, string>>(); + /// <summary> + /// 鍦扮悊鍥存爮閰嶇疆 + /// </summary> + public Fence geo_fence = new Fence(); } /// <summary> /// 杈撳嚭鐩爣瀵硅薄 /// </summary> + [Serializable] public class Output { /// <summary> /// 閫昏緫杈撳嚭鐩爣鍞竴鏍囪瘑 /// </summary> public string sid = ""; - /// <summary> - /// 閫昏緫杈撳嚭鐩爣寤舵椂闂�(鍗曚綅鐢ㄧ) - /// </summary> - public string delay = "0"; /// <summary> /// 閫昏緫杈撳嚭鐩爣绫诲瀷 /// 璁惧=1; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index da993e1..d40c649 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -8,22 +8,6 @@ public class LogicMethod { - - private static LogicMethod logicMethod = null; - - public static LogicMethod CurrLogicMethod - { - get - { - if (logicMethod == null) - { - return new LogicMethod(); - } - return logicMethod; - } - - } - /// <summary> /// 琛ㄧず鏄潯浠� /// </summary> @@ -35,15 +19,15 @@ /// <summary> /// 绉婚櫎鎵�鏈�"Logic"鐣岄潰 /// </summary> - public void RemoveAllView() + public static void RemoveAllView() { MainPage.BasePageView.RemoveViewByTag("Logic"); } - + /// <summary> Converts an array of bytes into a formatted string of hex digits (ex: E4 CA B2)</summary> /// <param name="data"> The array of bytes to be translated into a string of hex digits. </param> /// <returns> Returns a well formatted string of hex digits with spacing. </returns> - public string byteArrayToHexString(byte[] data) + static string byteArrayToHexString(byte[] data) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); foreach (byte b in data) @@ -62,7 +46,7 @@ * @param i 涓�涓猧nt鏁板瓧 * @return byte[] */ - public byte[] int2ByteArray(int i) + public static byte[] int2ByteArray(int i) { byte[] result = new byte[4]; result[0] = (byte)((i >> 24) & 0xFF); @@ -75,7 +59,7 @@ /// 鑾峰彇鏃堕棿鎴� /// </summary> /// <returns></returns> - public int getTimeStamp() + static int getTimeStamp() { TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); return (int)ts.TotalSeconds; @@ -83,7 +67,7 @@ /// <summary> /// 鐢熸垚閫昏緫sid鏂规硶 /// </summary> - public string NewSid() + public static string NewSid() { string logicId = ""; try @@ -127,7 +111,7 @@ /// <param name="dic">Dictionary绫�</param> /// <param name="key">鍋�</param> /// <param name="value">鍊�</param> - public void dictionary(Dictionary<string, string> dic, string key, string value) + public static void dictionary(Dictionary<string, string> dic, string key, string value) { if (dic.ContainsKey(key)) //鍒ゆ柇鏄惁瀛樺湪閿�� { @@ -141,7 +125,7 @@ /// 鑾峰彇缃戝叧鎴块棿鍒楄〃 /// </summary> /// <returns></returns> - public List<HDL_ON.Entity.Room> GetGatewayRoomList() + public static List<HDL_ON.Entity.Room> GetGatewayRoomList() { return HDL_ON.Entity.SpatialInfo.CurrentSpatial.RoomList; } @@ -149,7 +133,7 @@ /// 鑾峰彇缃戝叧鎴块棿鍒楄〃 /// </summary> /// <returns></returns> - public List<HDL_ON.Entity.Room> GetGatewayRoomList(string name) + public static List<HDL_ON.Entity.Room> GetGatewayRoomList(string name) { List<Entity.Room> roomList = new List<Entity.Room>(); Entity.Room room1 = new Entity.Room(); @@ -174,7 +158,7 @@ /// 鑾峰彇缃戝叧璁惧鍒楄〃 /// </summary> /// <returns></returns> - public List<HDL_ON.Entity.Function> GetGatewayDeviceList() + public static List<HDL_ON.Entity.Function> GetGatewayDeviceList() { return Entity.FunctionList.List.GetDeviceFunctionList(); } @@ -182,7 +166,7 @@ /// 鑾峰彇缃戝叧鍦烘櫙鍒楄〃 /// </summary> /// <returns></returns> - public List<HDL_ON.Entity.Scene> GetSceneList() + public static List<HDL_ON.Entity.Scene> GetSceneList() { return HDL_ON.Entity.FunctionList.List.scenes; } @@ -191,7 +175,7 @@ /// </summary> /// <param name="room">褰撳墠鎴块棿</param> /// <returns></returns> - public List<HDL_ON.Entity.Function> GetRoomDevice(HDL_ON.Entity.Room room) + public static List<HDL_ON.Entity.Function> GetRoomDevice(HDL_ON.Entity.Room room) { List<HDL_ON.Entity.Function> deviceLists = new List<Entity.Function>(); List<HDL_ON.Entity.Function> lists = GetGatewayDeviceList(); @@ -221,7 +205,7 @@ /// </summary> /// <param name="sid">璁惧鍞竴鏍囪瘑</param> /// <returns></returns> - public HDL_ON.Entity.Function GetDevice(string sid) + public static HDL_ON.Entity.Function GetDevice(string sid) { HDL_ON.Entity.Function device = new Entity.Function() { name = "Unknown" }; List<HDL_ON.Entity.Function> deviceLists = GetGatewayDeviceList(); @@ -242,7 +226,7 @@ /// </summary> /// <param name="sid">鍦烘櫙鍞竴鏍囪瘑</param> /// <returns></returns> - public HDL_ON.Entity.Scene GetSecne(string sid) + public static HDL_ON.Entity.Scene GetSecne(string sid) { HDL_ON.Entity.Scene scene = new Entity.Scene() { name = "Unknown" }; List<HDL_ON.Entity.Scene> sceneLists = GetSceneList(); @@ -262,7 +246,7 @@ /// </summary> /// <param name="device">璁惧</param> /// <returns></returns> - public string GetGetRoomName(HDL_ON.Entity.Function device) + public static string GetGetRoomName(HDL_ON.Entity.Function device) { string roomName = ""; List<HDL_ON.Entity.Room> roomLists = GetGatewayRoomList(); @@ -284,7 +268,7 @@ /// </summary> /// <param name="functionType">璁惧绫诲瀷</param> /// <returns></returns> - public string GetIconPath(string functionType) + public static string GetIconPath(string functionType) { string strPath = ""; switch (functionType) @@ -325,7 +309,6 @@ case SPK.SensorDoorWindow: case SPK.SensoruUtrasonic: case SPK.SenesorMegahealth: - case SPK.SenesorEnvironment: { strPath = "LogicIcon/sensor.png"; } @@ -339,7 +322,7 @@ /// </summary> /// <param name="deviceList">璁惧鍒楄〃</param> /// <returns></returns> - public List<string> GetDeviceTypeList(List<HDL_ON.Entity.Function> deviceList) + public static List<string> GetDeviceTypeList(List<HDL_ON.Entity.Function> deviceList) { List<string> deviceStrTypeList = new List<string>(); deviceStrTypeList.Clear(); @@ -384,7 +367,6 @@ || device.spk == SPK.SensorDoorWindow || device.spk == SPK.SensoruUtrasonic || device.spk == SPK.SenesorMegahealth - || device.spk == SPK.SenesorEnvironment ); if (sensor != null) { @@ -398,7 +380,7 @@ /// </summary> /// <param name="deviceType">璁惧绫诲瀷(鐏厜绫伙紝绐楀笜绫汇��)</param> /// <returns></returns> - public List<string> GetDeviceTypeFunctionList(string deviceType) + public static List<string> GetDeviceTypeFunctionList(string deviceType) { List<string> functionTypeList = new List<string>(); if (deviceType == Language.StringByID(StringId.Lights)) @@ -435,8 +417,6 @@ functionTypeList.Add(SPK.SensorDoorWindow); functionTypeList.Add(SPK.SensoruUtrasonic); functionTypeList.Add(SPK.SenesorMegahealth); - functionTypeList.Add(SPK.SenesorEnvironment); - } return functionTypeList; @@ -446,7 +426,7 @@ /// 鏉′欢/鐩爣鏀寔璁惧 /// </summary> /// <returns></returns> - public List<string> GetSupportEquipment(string if_type) + public static List<string> GetSupportEquipment(string if_type) { List<string> deviceTypeList = new List<string>(); switch (if_type) @@ -473,8 +453,6 @@ deviceTypeList.Add(SPK.SensorDoorWindow); deviceTypeList.Add(SPK.SensoruUtrasonic); deviceTypeList.Add(SPK.SenesorMegahealth); - deviceTypeList.Add(SPK.SenesorEnvironment); - } break; case target_if: @@ -501,7 +479,7 @@ /// <param name="functionType">婧愭暟鎹垪琛�1</param> /// <param name="deviceList">婧愭暟鎹垪琛�2</param> /// <returns></returns> - public List<Entity.Function> GetShowDeviceList(List<string> functionType, List<HDL_ON.Entity.Function> deviceList) + public static List<Entity.Function> GetShowDeviceList(List<string> functionType, List<HDL_ON.Entity.Function> deviceList) { List<HDL_ON.Entity.Function> devList = new List<Entity.Function>(); for (int i = 0; i < deviceList.Count; i++) @@ -523,7 +501,7 @@ /// <param name="room">褰撳墠鎴块棿</param> /// <param name="str">鍒ゆ柇绗︼紙琛ㄧず=杈撳叆璁惧鍜岃緭鍑鸿澶囷級</param> /// <returns></returns> - public List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str) + public static List<Entity.Function> GetFunctionDeviceList(Entity.Room room, string str) { List<string> functionTypeList = GetSupportEquipment(str); //杩斿洖鎴块棿璁惧鍒楄〃 @@ -535,7 +513,7 @@ /// <summary> /// 缃戝叧ID(鑾峰彇鍢変箰缃戝叧ID) /// </summary> - public string GatewayId + public static string GatewayId { get { @@ -549,7 +527,7 @@ /// <summary> /// 浣忓畢ID /// </summary> - public string HomeId + public static string HomeId { get { @@ -559,14 +537,12 @@ /// <summary> /// 鏄惁涓哄叾浠栦富鐢ㄦ埛鍒嗕韩杩囨潵鐨勪綇瀹� /// </summary> - public bool IsOthreShare + public static bool IsOthreShare { get { return Entity.DB_ResidenceData.Instance.CurrentRegion.isOtherShare; } } - - } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs index 9360e67..90736a0 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputTextView.cs @@ -35,7 +35,6 @@ frameLayout.Height = Application.GetRealHeight(flHeight); btnIf.Y= Application.GetRealHeight(btnY); frameLayout.AddChidren(btnIf); - return frameLayout; } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs index 9f8dc40..37e2d2d 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/AddOutputInputView.cs @@ -7,11 +7,11 @@ /// <summary> /// 涓绘帶浠禫iew /// </summary> - public FrameLayout frameLayout = new FrameLayout + public FrameLayout frameLayout= new FrameLayout { Height = Application.GetRealHeight(44), Width = Application.GetRealWidth(343), - BackgroundColor = CSS.CSS_Color.view, + BackgroundColor= CSS.CSS_Color.view, X = Application.GetRealWidth(LogicView.TextSize.left16), }; @@ -23,28 +23,28 @@ Height = Application.GetRealHeight(43), Width = Application.GetRealWidth(343), LineColor = CSS.CSS_Color.viewTranslucence, - SubViewWidth = Application.GetRealWidth(68), + SubViewWidth=Application.GetRealWidth(68), }; /// <summary> /// 锛堟潯浠舵垨鑰呯洰鏍囷級鍥炬爣 /// </summary> - public Button btnIcon = new Button + public Button btnIcon= new Button { - Width = Application.GetRealWidth(28), - Height = Application.GetRealWidth(28), + Width= Application.GetRealWidth(28), + Height =Application.GetRealWidth(28), //Y = Application.GetRealHeight(8), X = Application.GetRealWidth(TextSize.left12), - + }; /// <summary> /// 锛堟潯浠舵垨鑰呯洰鏍囷級鏂囨湰鎻忚堪 /// </summary> - public Button btnText = new Button + public Button btnText= new Button { TextSize = TextSize.text14, Width = Application.GetRealWidth(250), Height = Application.GetRealHeight(20), - TextColor = CSS.CSS_Color.textColor, + TextColor= CSS.CSS_Color.textColor, //Y=Application.GetRealHeight(12), X = Application.GetRealWidth(52), }; @@ -58,9 +58,9 @@ Width = Application.GetRealWidth(130), Height = Application.GetRealHeight(17), TextColor = CSS.CSS_Color.textCancelColor, - Y = Application.GetRealHeight(14), + Y=Application.GetRealHeight(14), X = Application.GetRealWidth(165), - TextAlignment = TextAlignment.CenterRight, + TextAlignment=TextAlignment.CenterRight, }; /// <summary> @@ -81,26 +81,13 @@ /// </summary> public Button btnLine = new Button { - Width = Application.GetRealWidth(279), - Y = Application.GetRealHeight(44 - 1), + Width=Application.GetRealWidth(279), + Y = Application.GetRealHeight(44-1), X = Application.GetRealWidth(52), Height = 1, BackgroundColor = CSS.CSS_Color.viewLine, }; - /// <summary> - /// 寤舵椂 - /// </summary> - public Button btnDelay = new Button - { - BackgroundColor = CSS.CSS_Color.AuxiliaryColor1, - TextID = StringId.delayLogic, - TextSize = LogicView.TextSize.text16, - TextColor = CSS.CSS_Color.view, - }; - /// <summary> - /// 鍒犻櫎 - /// </summary> public Button btnDel = new Button { BackgroundColor = CSS.CSS_Color.textRedColor, @@ -108,6 +95,7 @@ TextSize = LogicView.TextSize.text16, TextColor = CSS.CSS_Color.view, }; + public Button btnClick = new Button { Height = Application.GetRealHeight(44), @@ -129,13 +117,12 @@ rowLayout.AddChidren(btnText); rowLayout.AddChidren(btnState); rowLayout.AddChidren(btnNextIcon); - rowLayout.AddRightView(btnDelay); rowLayout.AddRightView(btnDel); rowLayout.AddChidren(btnClick); btnLine.Y = frameLayout.Height - 1; frameLayout.AddChidren(btnLine); } - + } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs index dd2ea61..a674af7 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/SelectTypeView.cs @@ -132,7 +132,5 @@ frameLayout.AddChidren(btnClick); return frameLayout; } - - } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs index a79324c..a36dc65 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TimeView.cs @@ -72,6 +72,7 @@ /// </summary> /// <returns></returns> public void FLayoutView(FrameLayout fLayout) + //public void FLayoutView(FrameLayout fLayout, string currState, Action<string> action) { fLayout.AddChidren(frameLayout); @@ -79,6 +80,7 @@ frameLayout.AddChidren(btnCancel); frameLayout.AddChidren(btnConfirm); frameLayout.AddChidren(btnLine); + //TimePoint(fLayout, action,currState); } /// <summary> /// 閫変腑鏃堕棿鐨勬柟娉� @@ -240,32 +242,6 @@ { //娣诲姞鏁版嵁 mList.Add(i.ToString() + " " + Language.StringByID(StringId.m)); - } - - } - - return mList; - } - /// <summary> - /// 鑾峰彇60绉掑垪琛� - /// </summary> - /// <returns></returns> - public List<string> GetsStringList() - { - //鍒濆鍖栧垪琛� - var mList = new List<string>(); - for (int i = 0; i < 60; i++) - { - if (i < 10) - { - var a = "0" + i.ToString(); - //娣诲姞鏁版嵁 - mList.Add(a + " " + Language.StringByID(StringId.s)); - } - else - { - //娣诲姞鏁版嵁 - mList.Add(i.ToString() + " " + Language.StringByID(StringId.s)); } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs index 00a669b..c7d0a64 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TopView.cs @@ -9,7 +9,7 @@ /// <summary> /// 鏈�涓婇潰鍧梀iew /// </summary> - public FrameLayout frameLayout = new FrameLayout + public FrameLayout frameLayout = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTop, Height = Application.GetRealHeight(64), @@ -22,7 +22,7 @@ { TextSize = TextSize.text18, TextColor = CSS.CSS_Color.textColor, - Width = Application.GetRealWidth(TextSize.view375-60-60), + Width = Application.GetRealWidth(TextSize.view375 - 60 - 60), Height = Application.GetRealHeight(25), Y = Application.GetRealHeight(30), X = Application.GetRealWidth(60) @@ -62,7 +62,7 @@ /// <summary> /// 璁剧疆鍥炬爣澧炲姞鐑敭澶у皬 /// </summary> - public Button clickSetBtn = new Button + public Button clickSetBtn = new Button { X = Application.GetRealWidth(337 - 37), Width = Application.GetRealWidth(28 + 37), @@ -82,6 +82,35 @@ return frameLayout; } #endregion + + /// <summary> + /// 鏄剧ず浣嶇疆 + /// </summary> + public void Location() + { + //鑾峰彇瀹藉害 + int widthValue = topNameBtn.GetTextWidth(); + int textWidth = (Application.GetRealWidth(255) - widthValue) / 2; + Button locationBtn = new Button + { + Width = Application.GetRealWidth(18), + Height = Application.GetRealWidth(18), + X = Application.GetRealWidth(60 + 4) + textWidth + widthValue, + Y = Application.GetRealHeight(34 + 1), + UnSelectedImagePath = "LogicIcon/location.png", + }; + frameLayout.AddChidren(locationBtn); + + Button textBtn = new Button + { + Height = Application.GetRealHeight(14), + Y = Application.GetRealHeight(57), + TextSize = LogicView.TextSize.text10, + TextColor = CSS.CSS_Color.textCancelColor, + Text = "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�", + }; + frameLayout.AddChidren(textBtn); + } } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs index 50c4e4f..ae546df 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs @@ -261,7 +261,7 @@ if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "") { var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data); - var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Date>>(date); + var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date); for (int i = 0; i < dateList.Count; i++) { //娣诲姞閫昏緫ID @@ -526,12 +526,12 @@ } } } - class Date + class LogicData { /// <summary> /// 浜戠鍞竴id /// </summary> - public string userLogicId = ""; + public string userLogicId = ""; /// <summary> /// 缃戝叧id /// </summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OnePortAutomation.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OnePortAutomation.cs index 37d4567..4610303 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/OnePortAutomation.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/OnePortAutomation.cs @@ -199,7 +199,7 @@ ) => { Logic.currlogic.name = logicName; - Logic.currlogic.sid = LogicMethod.CurrLogicMethod.NewSid(); + Logic.currlogic.sid = LogicMethod.NewSid(); loading.Start(); new System.Threading.Thread(() => { @@ -242,7 +242,7 @@ } Logic.LogicList.Add(Logic.currlogic); - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); MainView.MainShow(); } else if (responsePackNew != null && responsePackNew.Code == "14005") @@ -282,7 +282,7 @@ loading.Hide(); if (responsePackNew != null && responsePackNew.Code == "0") { - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); MainView.MainShow(); } else if (responsePackNew != null && responsePackNew.Code == "14005") diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs index d8930a7..5781fc1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs @@ -75,7 +75,7 @@ pmhigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); pmhigherView.btnText.TextID = StringId.PM25; viewLayout.AddChidren(pmhigherView.FLayoutView()); - + #endregion @@ -110,7 +110,7 @@ PmAction(this); }; - + #endregion } @@ -119,7 +119,7 @@ /// </summary> /// <param name="textInt">鏂囨湰</param> /// <param name="stateValue">缂栬緫涔嬪墠鐨勭姸鎬佸��,榛樿涓�20</param> - public void InputBoxAction(int textInt, string stateValue = "20") + public void InputBoxAction(int textInt,string stateValue="20") { new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => { @@ -164,11 +164,31 @@ public void PmAction(FrameLayout frame, string stateValue = "") { PublicInterface pmView = new PublicInterface(); - var pmListStr = pmView.GetViewList("pm25"); - pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), pmView.GetString("pm25", stateValue) + var pmListStr = pmView.GetViewList("pm2.5"); + pmView.SingleSelectionShow(frame, pmListStr, Language.StringByID(StringId.PM25), GetString(stateValue) , (text) => { - var value= pmView.GetValue("pm25", text); + string value = ""; + if (text == Language.StringByID(StringId.pmyou)) + { + value = "10"; + } + else if (text == Language.StringByID(StringId.pmliang)) + { + value = "50"; + } + else if (text == Language.StringByID(StringId.pmqingdu)) + { + value = "90"; + } + else if (text == Language.StringByID(StringId.pmzhongdu)) + { + value = "130"; + } + else if (text == Language.StringByID(StringId.pmzhongduwuran)) + { + value = "170"; + } AddDic("pm2.5", "=", value); }); } @@ -181,13 +201,13 @@ private void AddDic(string keyValue, string comparator, string value) { Input input = new Input(); - input.sid = LogicMethod.CurrLogicMethod.NewSid(); + input.sid = LogicMethod.NewSid(); input.condition_type = "4"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", keyValue); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", comparator); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "float"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", value); + LogicMethod.dictionary(dic, "key", keyValue); + LogicMethod.dictionary(dic, "comparator", comparator); + LogicMethod.dictionary(dic, "data_type", "float"); + LogicMethod.dictionary(dic, "value", value); input.condition.Add(dic); AddCondition(input, keyValue, comparator); } @@ -197,7 +217,7 @@ /// <param name="input"></param> /// <param name="keyValue"></param> /// <param name="comparator">姣旇緝鍏崇郴</param> - private void AddCondition(Input input, string keyValue, string comparator) + private void AddCondition(Input input, string keyValue,string comparator) { ///璁板綍绱㈠紩鍊� int index = -1; @@ -227,7 +247,7 @@ Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); @@ -241,7 +261,7 @@ /// <param name="keyValue"></param> /// <param name="comparator">姣旇緝鍏崇郴</param> /// <returns></returns> - private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator) + private bool ExistKey(List<Dictionary<string, string>> dicList, string keyValue, string comparator) { for (int i = 0; i < dicList.Count; i++) { @@ -257,6 +277,37 @@ return false; } - + + public string GetString(string strValue) + { + string text = ""; + int intValue = 0; + if (strValue != "") + { + intValue = int.Parse(strValue); + } + if (intValue > 0 && intValue < 35) + { + text = Language.StringByID(StringId.pmyou); + } + else if (intValue > 35 && intValue < 75) + { + text = Language.StringByID(StringId.pmliang); + } + else if (intValue > 75 && intValue < 115) + { + text = Language.StringByID(StringId.pmqingdu); + } + else if (intValue > 115 && intValue < 150) + { + text = Language.StringByID(StringId.pmzhongdu); + } + else if (intValue > 150) + { + text = Language.StringByID(StringId.pmzhongduwuran); + } + + return text; + } } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs index 4683464..18ec0c8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs @@ -16,10 +16,6 @@ /// <param name="textSize">鏄剧ず鏂囨湰瀛椾綋澶у皬</param> public void SingleSelectionShow(FrameLayout frame, List<string> list, string titleText, string stateText, Action<string> action, int textSize = LogicView.TextSize.text14) { - if (list == null) - { - return; - } FrameLayout frameLayout = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence, @@ -79,7 +75,7 @@ }; } - + /// <summary> /// 澶氶�夋嫨 /// </summary> @@ -263,8 +259,7 @@ /// <param name="list">鏄剧ず鏁版嵁婧�</param> /// <param name="titleText">鏍囬</param> /// <param name="action">杩斿洖鍊肩储寮曞��</param> - public void FrameOrVv(FrameLayout frame, List<string> list, int titleText, Action<int> action) - { + public void FrameOrVv(FrameLayout frame, List<string>list, int titleText,Action<int> action) { int line = 0; if (list.Count == 0 || list.Count > 5) @@ -401,7 +396,7 @@ /// <param name="stateList">涔嬪墠鐘舵�佹暟鎹簮</param> /// <param name="titleText">鏍囬</param> /// <param name="action">杩斿洖鍊肩储寮曞��</param> - public void FrameOrVvList(FrameLayout frame, List<string> list, List<string> stateList, int titleText, Action<List<string>> action) + public void FrameOrVvList(FrameLayout frame, List<string> list,List<string>stateList, int titleText, Action<List<string>> action) { int line = 0; @@ -500,8 +495,7 @@ { verticalRefresh.AddChidren(checkView.FLayoutView()); } - if (stateList.Contains(strName)) - { + if (stateList.Contains(strName)) { checkView.btnClick.IsSelected = true; checkView.btnCheckIcon.IsSelected = true; selecetdList.Add(strName); @@ -545,63 +539,6 @@ } - /// <summary> - /// 娓╂箍搴︾粍鍚堢晫闈� - /// </summary> - /// <param name="frameLayout">鐖舵帶浠�</param> - /// <param name="text1">鏍囬鏂囨湰1</param> - /// <param name="text2">鏍囬鏂囨湰2</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void ViewZuHe(FrameLayout frameLayout, int text1, int text2, Action<int, FrameLayout> action) - { - - FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewMiddle }; - frameLayout.AddChidren(frame); - LogicView.TopView topView = new LogicView.TopView(); - topView.topNameBtn.TextID = StringId.wendu; - frame.AddChidren(topView.FLayoutView()); - topView.clickBackBtn.MouseUpEventHandler += (e, sen) => - { - frame.RemoveFromParent(); - }; - FrameLayout viewLayout = new FrameLayout - { - Y = Application.GetRealHeight(64), - Width = Application.GetRealWidth(LogicView.TextSize.view375), - Height = Application.GetRealHeight(LogicView.TextSize.view667 - 64), - BackgroundColor = CSS.CSS_Color.viewMiddle, - }; - frame.AddChidren(viewLayout); - - //娓�,婀垮害楂樹簬 - LogicView.SelectTypeView temperaturehigherView = new LogicView.SelectTypeView(); - temperaturehigherView.btnIcon.Visible = false; - temperaturehigherView.btnText.X = Application.GetRealWidth(16); - temperaturehigherView.btnLine.X = Application.GetRealWidth(16); - temperaturehigherView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); - temperaturehigherView.btnText.TextID = text1; - viewLayout.AddChidren(temperaturehigherView.FLayoutView()); - //娓�,婀垮害浣庝簬 - LogicView.SelectTypeView temperatureunderView = new LogicView.SelectTypeView(); - temperatureunderView.frameLayout.Y = temperaturehigherView.frameLayout.Bottom; - temperatureunderView.btnIcon.Visible = false; - temperatureunderView.btnText.X = Application.GetRealWidth(16); - temperatureunderView.btnLine.X = Application.GetRealWidth(16); - temperatureunderView.btnLine.Width = Application.GetRealWidth(375 - 16 - 16); - temperatureunderView.btnText.TextID = text2; - viewLayout.AddChidren(temperatureunderView.FLayoutView()); - - //娓�,婀垮害楂樹簬 - temperaturehigherView.btnClick.MouseUpEventHandler += (sen, e) => - { - action(text1, frame); - }; - //娓�,婀垮害浣庝簬 - temperatureunderView.btnClick.MouseUpEventHandler += (sen, e) => - { - action(text2, frame); - }; - } /// <summary> /// 鑾峰彇鐣岄潰鍒楄〃 @@ -676,7 +613,7 @@ }; } break; - case "pm25": + case "pm2.5": { list = new List<string> { Language.StringByID(StringId.pmyou), @@ -684,24 +621,6 @@ Language.StringByID(StringId.pmqingdu), Language.StringByID(StringId.pmzhongdu), Language.StringByID(StringId.pmzhongduwuran), - }; - } - break; - case "co2": - { - list = new List<string> { - Language.StringByID(StringId.zhengchang), - Language.StringByID(StringId.piangao), - Language.StringByID(StringId.chaobiao), - }; - } - break; - case "tvoc": - { - list = new List<string> { - Language.StringByID(StringId.zhengchang), - Language.StringByID(StringId.chaobiao), - Language.StringByID(StringId.yanzhong), }; } break; @@ -878,157 +797,6 @@ } return stateList; - } - /// <summary> - /// 鏁板�艰繑鍥炴枃鏈� - /// </summary> - /// <param name="type">绫诲瀷</param> - /// <param name="strValue">鍊�</param> - /// <returns></returns> - public string GetString(string type, string strValue) - { - string text = ""; - int intValue = 0; - if (strValue != "") - { - intValue = int.Parse(strValue); - } - - switch (type) - { - case "pm25": - { - - if (intValue > 0 && intValue < 35) - { - text = Language.StringByID(StringId.pmyou); - } - else if (intValue > 35 && intValue < 75) - { - text = Language.StringByID(StringId.pmliang); - } - else if (intValue > 75 && intValue < 115) - { - text = Language.StringByID(StringId.pmqingdu); - } - else if (intValue > 115 && intValue < 150) - { - text = Language.StringByID(StringId.pmzhongdu); - } - else if (intValue > 150) - { - text = Language.StringByID(StringId.pmzhongduwuran); - } - } - break; - case "co2": - { - - if (intValue > 0 && intValue < 800) - { - text = Language.StringByID(StringId.zhengchang); - } - else if (intValue > 800 && intValue < 1100) - { - text = Language.StringByID(StringId.piangao); - } - else if (intValue > 1100) - { - text = Language.StringByID(StringId.chaobiao); - } - } - break; - case "tvoc": - { - - if (intValue >=1 && intValue <= 3) - { - text = Language.StringByID(StringId.zhengchang); - } - else if (intValue >=4 && intValue<=6) - { - text = Language.StringByID(StringId.chaobiao); - } - else if (intValue >= 7 && intValue <= 9) - { - text = Language.StringByID(StringId.yanzhong); - } - } - break; - } - return text; - } - - /// <summary> - /// 鏈枃杩斿洖鏁板�艰繑鍥� - /// </summary> - /// <param name="type">绫诲瀷</param> - /// <param name="text">鏂囨湰</param> - /// <returns></returns> - public string GetValue(string type, string text) - { - string value = ""; - switch (type) - { - case "pm25": - { - if (text == Language.StringByID(StringId.pmyou)) - { - value = "10"; - } - else if (text == Language.StringByID(StringId.pmliang)) - { - value = "50"; - } - else if (text == Language.StringByID(StringId.pmqingdu)) - { - value = "90"; - } - else if (text == Language.StringByID(StringId.pmzhongdu)) - { - value = "130"; - } - else if (text == Language.StringByID(StringId.pmzhongduwuran)) - { - value = "170"; - } - } - break; - case "co2": - { - if (text == Language.StringByID(StringId.zhengchang)) - { - value = "400"; - } - else if (text == Language.StringByID(StringId.piangao)) - { - value = "850"; - } - else if (text == Language.StringByID(StringId.chaobiao)) - { - value = "1200"; - } - } - break; - case "tvoc": - { - if (text == Language.StringByID(StringId.zhengchang)) - { - value = "2"; - } - else if (text == Language.StringByID(StringId.chaobiao)) - { - value = "5"; - } - else if (text == Language.StringByID(StringId.yanzhong)) - { - value = "8"; - } - } - break; - - } - return value; } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs index d95ea34..28e66fa 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs @@ -4,18 +4,40 @@ using HDL_ON.DAL.Server; using Newtonsoft.Json.Linq; using System.Collections.Generic; +using HDL_ON.Entity; namespace HDL_ON.UI.UI2.Intelligence.Automation { public class Send { + + /// <summary> + /// 璋冪敤鑾峰彇浣忓畢瀛愯处鍙峰垪琛� + /// </summary> + public static List<ResidenceMemberInfo> GetResidenceMemberAccount() + { + + var responePack = new HttpServerRequest().GetResidenceMemberAccount(); + if (responePack.Code == StateCode.SUCCESS) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject<List<ResidenceMemberInfo>>(responePack.Data.ToString()); + } + //澶辫触 + else + { + //鎻愮ず + IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); + } + return new List<ResidenceMemberInfo>(); + } + /// <summary> /// 鑾峰彇閫昏緫ID鍒楄〃 /// </summary> /// <returns></returns> public static ResponsePackNew GetLogicIdList() { - var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId } }; + var jObject = new JObject { { "homeId", LogicMethod.HomeId } }; var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_List); //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) @@ -92,7 +114,6 @@ { var outputTypeJOb = new JObject { }; outputTypeJOb.Add("sid", dictionary.sid); - outputTypeJOb.Add("delay", dictionary.delay); outputTypeJOb.Add("target_type", dictionary.target_type); var statusArray = new JArray { }; foreach (var dic in dictionary.status) @@ -132,7 +153,7 @@ var logicjArray = new JArray { }; var logicIfon = new JObject { }; logicIfon.Add("sid", logic.sid); - logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId); + logicIfon.Add("gatewayId", LogicMethod.GatewayId); logicIfon.Add("name", logic.name); logicIfon.Add("relation", logic.relation); logicIfon.Add("enable", logic.enable); @@ -142,7 +163,7 @@ logicIfon.Add("noticeConfig", noticeConfigJObject); logicIfon.Add("pushConfigs", pushConfigsArray); logicjArray.Add(logicIfon); - var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } }; + var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } }; responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Add,5); //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) @@ -205,7 +226,6 @@ { var outputTypeJOb = new JObject { }; outputTypeJOb.Add("sid", dictionary.sid); - outputTypeJOb.Add("delay", dictionary.delay); outputTypeJOb.Add("target_type", dictionary.target_type); var statusArray = new JArray { }; foreach (var dic in dictionary.status) @@ -246,7 +266,7 @@ var logicIfon = new JObject { }; logicIfon.Add("userLogicId", logic.userLogicId); logicIfon.Add("sid", logic.sid); - logicIfon.Add("gatewayId", LogicMethod.CurrLogicMethod.GatewayId); + logicIfon.Add("gatewayId", LogicMethod.GatewayId); logicIfon.Add("name", logic.name); logicIfon.Add("relation", logic.relation); logicIfon.Add("enable", logic.enable); @@ -257,7 +277,7 @@ logicIfon.Add("pushConfigs", pushConfigsArray); logicjArray.Add(logicIfon); - var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } }; + var jObject = new JObject { { "homeId", LogicMethod.HomeId }, { "logics", logicjArray } }; responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update,5); //濡傛灉鏄痶oken杩囨湡鍒欏埛鏂皌oken if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs index 7113132..442dae4 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Set.cs @@ -118,7 +118,7 @@ loading.Hide(); if (responsePackNew != null && responsePackNew.Code == "0") { - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); Logic.LogicList.Remove(Logic.currlogic); MainView.MainShow(); //鍙戦�佸垹闄ら�昏緫鍛戒护锛� diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index ecd18e9..2bc0fba 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -387,8 +387,6 @@ if (edit) { - //鏇存柊寤舵椂鏃堕棿 - outputDevice.delay = Logic.currlogic.output[index].delay; //绉婚櫎鏃ф暟鎹� Logic.currlogic.output.RemoveAt(index); //鏂版暟鎹彃鍏ユ棫鏁版嵁鐨勪綅缃�; @@ -410,7 +408,7 @@ this.RemoveFromParent(); return; } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); @@ -516,7 +514,7 @@ private void GetEditState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4) { Output outputs = Logic.currlogic.output[index]; - var dicList = outputs.status; + var dicList = outputs.status as List<Dictionary<string, string>>; //娓呴櫎涔嬪墠鏃ф暟鎹� dicSateteList.Clear(); if (dicList.Count != 0) @@ -535,8 +533,8 @@ { //鏁版嵁灏佽 Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", KeyValue); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", selectedValue); + LogicMethod.dictionary(dic, "key", KeyValue); + LogicMethod.dictionary(dic, "value", selectedValue); AddDictionaryList(KeyValue, dic); } /// <summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs index 9d4af53..7d58572 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Time3.cs @@ -18,29 +18,7 @@ topView.frameLayout.Height = Application.GetRealHeight(64 + 20); this.AddChidren(topView.FLayoutView()); topView.topNameBtn.Text = titelText; - //鑾峰彇瀹藉害 - int widthValue = topView.topNameBtn.GetTextWidth(); - int textWidth = (Application.GetRealWidth(255) - widthValue) / 2; - Button locationBtn = new Button - { - Width = Application.GetRealWidth(18), - Height = Application.GetRealWidth(18), - X = Application.GetRealWidth(60 + 4) + textWidth + widthValue, - Y = Application.GetRealHeight(34 + 1), - UnSelectedImagePath = "LogicIcon/location.png", - - }; - topView.frameLayout.AddChidren(locationBtn); - - Button textBtn = new Button - { - Height = Application.GetRealHeight(14), - Y = Application.GetRealHeight(57), - TextSize = LogicView.TextSize.text10, - TextColor = CSS.CSS_Color.textCancelColor, - Text = "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�", - }; - topView.frameLayout.AddChidren(textBtn); + topView.Location(); topView.clickBackBtn.MouseUpEventHandler += (e, sen) => { RemoveFromParent(); @@ -244,13 +222,13 @@ private void AddDic(string keyValue, string value, bool edit, int index) { Input inputTime = new Input(); - inputTime.sid = LogicMethod.CurrLogicMethod.NewSid(); + inputTime.sid = LogicMethod.NewSid(); inputTime.condition_type = "1"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", keyValue); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", value); + LogicMethod.dictionary(dic, "key", keyValue); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", value); inputTime.condition.Add(dic); AddCondition(inputTime, edit, index); } @@ -272,7 +250,7 @@ //娣诲姞涓�涓柊鐨勬椂闂存潯浠� Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs index fb0a481..ee08deb 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TimeTpye.cs @@ -129,13 +129,13 @@ timePointView.FLayoutView(fLayout); timePointView.TimePoint(fLayout, editTime, (timeValue)=>{ Input inputTime = new Input(); - inputTime.sid = LogicMethod.CurrLogicMethod.NewSid(); + inputTime.sid = LogicMethod.NewSid(); inputTime.condition_type = "1"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", "timepoint"); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", timeValue); + LogicMethod.dictionary(dic, "key", "timepoint"); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", timeValue); inputTime.condition.Add(dic); AddCondition(inputTime, edit, index); }); @@ -252,13 +252,13 @@ } Input inputTime = new Input(); - inputTime.sid = LogicMethod.CurrLogicMethod.NewSid(); + inputTime.sid = LogicMethod.NewSid(); inputTime.condition_type = "2"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", "timesection"); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "-" + btnEndTimeText.Text); + LogicMethod.dictionary(dic, "key", "timesection"); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", btnStartTimeText.Text + "-" + btnEndTimeText.Text); inputTime.condition.Add(dic); AddCondition(inputTime, edit, index); @@ -349,7 +349,7 @@ //娣诲姞涓�涓柊鐨勬椂闂存潯浠� Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs index 90ab211..e0d3cbc 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs @@ -72,7 +72,14 @@ weatherCondition.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - + //绌烘皵璐ㄩ噺 + kongqiViewk.btnClick.MouseUpEventHandler += (sen, e) => { + AirQuality airQuality = new AirQuality(); + MainPage.BasePageView.AddChidren(airQuality); + airQuality.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + #endregion } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs index f1da613..fbe50e2 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs @@ -16,29 +16,7 @@ topView.frameLayout.Height = Application.GetRealHeight(64 + 20); this.AddChidren(topView.FLayoutView()); topView.topNameBtn.TextID = StringId.selectionCondition; - //鑾峰彇瀹藉害 - int widthValue = topView.topNameBtn.GetTextWidth(); - int textWidth = (Application.GetRealWidth(255) - widthValue) / 2; - Button locationBtn = new Button - { - Width = Application.GetRealWidth(18), - Height = Application.GetRealWidth(18), - X = Application.GetRealWidth(60 + 4) + textWidth + widthValue, - Y = Application.GetRealHeight(34 + 1), - UnSelectedImagePath = "LogicIcon/location.png", - - }; - topView.frameLayout.AddChidren(locationBtn); - - Button textBtn = new Button - { - Height = Application.GetRealHeight(14), - Y = Application.GetRealHeight(57), - TextSize = LogicView.TextSize.text10, - TextColor = CSS.CSS_Color.textCancelColor, - Text = "骞夸笢骞垮窞甯傜暘绂哄尯鐭虫ゼ闀�", - }; - topView.frameLayout.AddChidren(textBtn); + topView.Location(); topView.clickBackBtn.MouseUpEventHandler += (e, sen) => { RemoveFromParent(); @@ -100,13 +78,13 @@ private void AddDic(string value) { Input input = new Input(); - input.sid = LogicMethod.CurrLogicMethod.NewSid(); + input.sid = LogicMethod.NewSid(); input.condition_type = "6"; Dictionary<string, string> dic = new Dictionary<string, string>(); - LogicMethod.CurrLogicMethod.dictionary(dic, "key", "weather"); - LogicMethod.CurrLogicMethod.dictionary(dic, "comparator", "="); - LogicMethod.CurrLogicMethod.dictionary(dic, "data_type", "string"); - LogicMethod.CurrLogicMethod.dictionary(dic, "value", value); + LogicMethod.dictionary(dic, "key", "weather"); + LogicMethod.dictionary(dic, "comparator", "="); + LogicMethod.dictionary(dic, "data_type", "string"); + LogicMethod.dictionary(dic, "value", value); input.condition.Add(dic); AddCondition(input); } @@ -140,7 +118,7 @@ Logic.currlogic.input.Add(input); } - LogicMethod.CurrLogicMethod.RemoveAllView(); + LogicMethod.RemoveAllView(); AddLogic addLogic = new AddLogic(); MainPage.BasePageView.AddChidren(addLogic); addLogic.Show(); -- Gitblit v1.8.0