| | |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddQingpingSensorEnvirTipPage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="15" Column="40" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" /> |
| | | <File FileName="HDL_ON/Entity/Enumerative/Command.cs" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="310" Column="62" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="316" Column="28" /> |
| | | <File FileName="HDL_ON/Entity/Function/Function.cs" Line="1347" Column="46" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="1114" Column="90" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="127" Column="64" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="127" Column="38" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="1118" Column="61" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs" Line="118" Column="43" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" Line="158" Column="79" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddSensorEnvironmentPage.cs" Line="133" Column="43" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorEnvironment/AddQingpingSensorEnvirTipPage.cs" Line="30" Column="4" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL-ON_Android" selected="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.2ffc9a07" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" /> |
| | |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="481" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="541" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="314" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="492" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="491" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="315" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="475" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="474" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="153" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="338" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2144" column="1" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109232" android:versionName="1.2.202109232" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109241" android:versionName="1.2.202109241" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; |
| | | if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix)) |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | i++; |
| | | continue; |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | useRemote = true; |
| | | break; |
| | | } |
| | |
| | | DimmerPage.UpdataStates(localFunction); |
| | | break; |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | localFunction.lastState = Language.StringByID(StringId.Level) + " : " + |
| | | localFunction.GetAttrState(FunctionAttributeKey.OpenLevel); |
| | | FanPage.UpdataState(localFunction); |
| | |
| | | ACPage.UpdataStates(localFunction); |
| | | } |
| | | break; |
| | | case SPK.HvacFloorHeat: |
| | | case SPK.FloorHeatStandard: |
| | | localFunction.lastState = ""; |
| | | switch (localFunction.GetAttrState(FunctionAttributeKey.Mode)) |
| | |
| | | //A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | | break; |
| | | case SPK.ElectricTV: |
| | | break; |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWaterValve2: |
| | | case SPK.SensorPir: |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorSmoke: |
| | |
| | | case SPK.ClothesHanger: |
| | | case SPK.AcIr: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | break; |
| | | case SPK.LightRGB: |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | if (f.status.Find((obj)=>obj.key ==FunctionAttributeKey.Mode) == null) |
| | | { |
| | | foreach (var dic in f.status) |
| | |
| | | } |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | foreach (var attr in f.status) |
| | | { |
| | | if (attr.key == FunctionAttributeKey.OnOff) |
| | |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.LoopId; |
| | | |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.Light: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.LightCCT: |
| | | #region cct light |
| | | byte b0 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | |
| | | 0, |
| | | 0,0}; |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1); |
| | | #endregion |
| | | break; |
| | | case SPK.LightRGB: |
| | | #region rgb light |
| | | byte b = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | |
| | | (byte)tempLight.GetColor(2,function), |
| | | 0,0}; |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1); |
| | | #endregion |
| | | break; |
| | | case SPK.LightDimming: |
| | | #region dimming light |
| | | byte b1 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | |
| | | function.bus.LoopId, |
| | | b1, |
| | | 0, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) }); |
| | | #endregion |
| | | break; |
| | | case SPK.LightSwitch: |
| | | #region LightSwitch |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 }); |
| | | #endregion |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.CurtainSwitch: |
| | | byte b1 = 0; |
| | | #region switch curtain |
| | | byte switchCurtain = 0; |
| | | if (function.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | b1 = 0; |
| | | switchCurtain = 0; |
| | | } |
| | | else if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | b1 = 1; |
| | | switchCurtain = 1; |
| | | } |
| | | else |
| | | { |
| | | b1 = 2; |
| | | switchCurtain = 2; |
| | | } |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, b1 }); |
| | | ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, switchCurtain }); |
| | | #endregion |
| | | break; |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | |
| | | |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.AcStandard: |
| | | var ac = new AC(); |
| | | //ControlBytesSend(Command.SetACMode, subnetId, deviceId, new byte[] { function.bus.LoopId, 0, 32, 32, 32, 32, 32, 0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, |
| | | // ac.GetModeIndex(function), |
| | | // ac.GetFanIndex(function), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.SetTemp)), 0 }); |
| | | foreach (var dic in commandDictionary) |
| | | { |
| | | switch (dic.Key) |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | var fhTemp = new FloorHeating(); |
| | | switch (function.spk) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | if (function.Fh_Mode_Temp.Count == 4) |
| | | { |
| | | if (function.GetAttribute(FunctionAttributeKey.Mode) == null) |
| | |
| | | else |
| | | { |
| | | var onoffString = function.trait_on_off.curValue.ToString(); |
| | | byte b1 = 1; |
| | | byte b12 = 1; |
| | | if (onoffString == "off") |
| | | { |
| | | b1 = 0; |
| | | b12 = 0; |
| | | } |
| | | var wm = fhTemp.GetWorkModeIndex(function); |
| | | if (wm > 0) |
| | | { |
| | | b1 += (byte)(16 + wm); |
| | | b12 += (byte)(16 + wm); |
| | | } |
| | | if (commandDictionary.ContainsKey("set_temp")) |
| | | { |
| | |
| | | } |
| | | } |
| | | var tt = fhTemp.GetTempUintIndex(function); |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b1, |
| | | ControlBytesSend(Command.SetFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId, b12, |
| | | (byte)tt,fhTemp.GetModeIndex(function), function.Fh_Mode_Temp["normal"], function.Fh_Mode_Temp["day"], function.Fh_Mode_Temp["night"], function.Fh_Mode_Temp["away"], 0, 0 }); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | #region ElectricFan |
| | | if (function.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) }); |
| | |
| | | { |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 }); |
| | | } |
| | | #endregion |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.AirFresh: |
| | | switch(function.spk) |
| | | { |
| | | case SPK.AirFreshJinmao: |
| | | case SPK.AirFreshJinmao:case SPK.HvacAirFreshJinmao: |
| | | #region AirFresh |
| | | //1 新风编号 1~200 |
| | | //2 类型 第三方类型 0:金茂新风 |
| | | |
| | |
| | | //function.GetAttrState(FunctionAttributeKey.FilterTimeout) =="true"?1:0, |
| | | 0,0 |
| | | }); |
| | | break; |
| | | } |
| | | #endregion |
| | | break; |
| | | } |
| | | #region 发送命令立即更新UI |
| | |
| | | var deviceId = function.bus.DeviceID; |
| | | var loopId = function.bus.LoopId; |
| | | |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.Light: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.LightSwitch: |
| | |
| | | case SPK.LightCCT: |
| | | ControlBytesSend(Command.ReadLogicLoopColor, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Curtain: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | case SPK.CurtainRoller: |
| | | ControlBytesSend(Command.ReadCurtainStatus, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.AC: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.AcStandard: |
| | | ControlBytesSend(Command.ReadACMode, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | ControlBytesSend(Command.ReadFloorHeat, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | switch (function.spk) |
| | | { |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | case FunctionCategory.Sensor: |
| | | byte sensorType = 0; |
| | | switch (function.spk) |
| | | { |
| | | case SPK.SensorTemperature: |
| | | sensorType = 2; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 2, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | sensorType = 3; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 3, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | sensorType = 5; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 5, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | sensorType = 6; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 6, function.bus.LoopId }); |
| | | break; |
| | | case SPK.SensorCO2: |
| | | sensorType = 7; |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, 7, function.bus.LoopId }); |
| | | break; |
| | | } |
| | | ControlBytesSend(Command.ReadDeviceLoopInfo, subnetId, deviceId, new byte[] { 5, sensorType, function.bus.LoopId }); |
| | | break; |
| | | case FunctionCategory.AirFresh: |
| | | switch(function.spk) |
| | | { |
| | | case SPK.AirFreshJinmao: |
| | | case SPK.HvacAirFreshJinmao: |
| | | ControlBytesSend(Command.FreshAirRead_JinMao, subnetId, deviceId, new byte[] { function.bus.LoopId }); |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | switch (updataObj.spk) |
| | | { |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | updataObj.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString()); |
| | | updataObj.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2]; |
| | |
| | | case SPK.LightDimming: |
| | | DimmerPage.UpdataStates(updataObj); |
| | | break; |
| | | case SPK.HvacFan: |
| | | case SPK.ElectricFan: |
| | | FanPage.UpdataState(updataObj); |
| | | break; |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | FanPage.UpdataState(function); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | SocketPage.UpdataState(function); |
| | | break; |
| | | } |
| | |
| | | for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; |
| | | if (localFunction.Spk_Prefix == FunctionCategory.Music || string.IsNullOrEmpty(localFunction.Spk_Prefix)) |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | i++; |
| | | continue; |
| | |
| | | { |
| | | get |
| | | { |
| | | return spk.Replace(".",""); |
| | | string iconPath = spk.Replace(".", ""); |
| | | switch (spk) |
| | | { |
| | | case SPK.PanelSocket: |
| | | iconPath = "electricalsocket"; |
| | | break; |
| | | case SPK.SenesorMegahealth2: |
| | | iconPath = "sensormegahealth"; |
| | | break; |
| | | case SPK.SensorEnvironmentHailin: |
| | | iconPath = "sensorenvironment"; |
| | | break; |
| | | case SPK.HvacAirFresh: |
| | | iconPath = "airFreshstandard"; |
| | | break; |
| | | case SPK.HvacAirFreshJinmao: |
| | | iconPath = "airFreshjinmao"; |
| | | break; |
| | | case SPK.HvacAC: |
| | | iconPath = "acstandard"; |
| | | break; |
| | | case SPK.HvacFan: |
| | | iconPath = "electricalfan"; |
| | | break; |
| | | case SPK.ElectricTuyaFan2: |
| | | iconPath = "electricaltyqborgovyzytytz"; |
| | | break; |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | iconPath = "electricalQ1RsefNf91tIXyyQ"; |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve2: |
| | | iconPath = "electricalkoiGhMKwLf2ZP81g"; |
| | | break; |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | iconPath = "electricalai6HtccKFIw3dxo3"; |
| | | break; |
| | | case SPK.AvMusic: |
| | | iconPath = "musicstandard"; |
| | | break; |
| | | |
| | | } |
| | | return iconPath; |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public string spk = ""; |
| | | |
| | | string spk_Prefix; |
| | | private string _SpkCategory = string.Empty; |
| | | /// <summary> |
| | | /// spk前缀 |
| | | /// 大类 |
| | | /// 功能类别 |
| | | /// 如:空调类、灯光类、窗帘类 |
| | | /// spk 产品的品类 |
| | | /// </summary> |
| | | public string Spk_Prefix |
| | | public string SpkCategory |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(spk_Prefix)) |
| | | if (string.IsNullOrEmpty(_SpkCategory)) |
| | | { |
| | | spk_Prefix = spk.Split(".")[0]; |
| | | } |
| | | return spk_Prefix; |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 0) |
| | | { |
| | | _SpkCategory = arr[0]; |
| | | } |
| | | } |
| | | return _SpkCategory; |
| | | } |
| | | } |
| | | |
| | | private string _SpkClassification = string.Empty; |
| | | /// <summary> |
| | | /// spk 产品品类下的分类 |
| | | /// </summary> |
| | | public string SpkClassification |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_SpkClassification)) |
| | | { |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 1) |
| | | { |
| | | _SpkClassification = arr[1]; |
| | | } |
| | | } |
| | | return _SpkClassification; |
| | | } |
| | | } |
| | | |
| | | string _SpkManufacturer = string.Empty; |
| | | /// <summary> |
| | | /// spk 产品的厂商 |
| | | /// </summary> |
| | | public string SpkManufacturer |
| | | { |
| | | get |
| | | { |
| | | if (string.IsNullOrEmpty(_SpkManufacturer)) |
| | | { |
| | | var arr = spk.Split("."); |
| | | if (arr.Length > 2) |
| | | { |
| | | _SpkManufacturer = arr[2]; |
| | | } |
| | | } |
| | | return _SpkManufacturer; |
| | | } |
| | | } |
| | | |
| | | |
| | | //string spk_Prefix; |
| | | ///// <summary> |
| | | ///// spk前缀 |
| | | ///// 大类 |
| | | ///// 功能类别 |
| | | ///// 如:空调类、灯光类、窗帘类 |
| | | ///// </summary> |
| | | //public string Spk_Prefix |
| | | //{ |
| | | // get |
| | | // { |
| | | // if (string.IsNullOrEmpty(spk_Prefix)) |
| | | // { |
| | | // spk_Prefix = spk.Split(".")[0]; |
| | | // } |
| | | // return spk_Prefix; |
| | | // } |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// A协议功能的特性 |
| | | /// 如:是AC功能:特性:on_off,mode,fan,temperature |
| | |
| | | /// (红外空调) |
| | | /// </summary> |
| | | public const string AcIr= "ir.ac"; |
| | | /// <summary> |
| | | /// 空调 |
| | | /// </summary> |
| | | public const string HvacAC = "hvac.ac"; |
| | | |
| | | /// <summary> |
| | | /// 空调spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AcStandard); |
| | | spkList.Add(HvacAC); |
| | | spkList.Add(AcIr); |
| | | return spkList; |
| | | } |
| | |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeatStandard = "floorHeat.standard"; |
| | | /// <summary> |
| | | /// 地暖 |
| | | /// </summary> |
| | | public const string HvacFloorHeat = "hvac.floorHeat"; |
| | | |
| | | /// <summary> |
| | | /// 地热spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(FloorHeatStandard); |
| | | spkList.Add(HvacFloorHeat); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// </summary> |
| | | public const string AirFreshStandard = "airFresh.standard"; |
| | | /// <summary> |
| | | /// 新风 |
| | | /// </summary> |
| | | public const string HvacAirFresh = "hvac.airFresh"; |
| | | /// <summary> |
| | | /// 新风 ——金茂定制 |
| | | /// </summary> |
| | | public const string AirFreshJinmao = "airFresh.jinmao"; |
| | | /// <summary> |
| | | /// 新风 ——金茂定制 |
| | | /// </summary> |
| | | public const string HvacAirFreshJinmao = "hvac.airFresh.jinmao"; |
| | | |
| | | /// <summary> |
| | | /// 新风spk列表 |
| | |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AirFreshStandard); |
| | | spkList.Add(AirFreshJinmao); |
| | | spkList.Add(HvacAirFresh); |
| | | spkList.Add(HvacAirFreshJinmao); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string MusicStandard = "music.standard"; |
| | | /// <summary> |
| | | /// 音乐 |
| | | /// </summary> |
| | | public const string AvMusic = "av.music"; |
| | | |
| | | /// <summary> |
| | | /// 音乐spk列表 |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(MusicStandard); |
| | | spkList.Add(AvMusic); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// 毫米波传感器 |
| | | /// </summary> |
| | | public const string SenesorMegahealth = "sensor.megahealth"; |
| | | public const string SenesorMegahealth2 = "sensor.megahealth.zg"; |
| | | /// <summary> |
| | | /// 安防传感器spk列表 |
| | | /// </summary> |
| | |
| | | //spkList.Add(SensoruUtrasonic); |
| | | spkList.Add(SensorDryContact); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment3 = "sensor.environment3"; |
| | | public const string SensorEnvironmentHailin = "sensor.environment.hailin"; |
| | | /// <summary> |
| | | /// 甲醛 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string ElectricSocket = "electrical.socket"; |
| | | /// <summary> |
| | | /// 面板、插座、面板 |
| | | /// </summary> |
| | | public const string PanelSocket = "panel.socket"; |
| | | /// <summary> |
| | | /// 家电、电视 |
| | | /// </summary> |
| | | public const string ElectricTV = "electrical.tv"; |
| | |
| | | /// 家电、风扇 |
| | | /// </summary> |
| | | public const string ElectricFan = "electrical.fan"; |
| | | public const string HvacFan = "hvac.fan"; |
| | | /// <summary> |
| | | /// 凉霸 |
| | | /// </summary> |
| | |
| | | /// 家电、涂鸦空气净化器 |
| | | /// </summary> |
| | | public const string ElectricTuyaAirCleaner = "electrical.Q1RsefNf91tIXyyQ"; |
| | | public const string ElectricTuyaAirCleaner2 = "hvac.air.tuya_epi345"; |
| | | /// <summary> |
| | | /// 家电、涂鸦电风扇 |
| | | /// </summary> |
| | | public const string ElectricTuyaFan = "electrical.tyqborgovyzytytz"; |
| | | public const string ElectricTuyaFan2 = "hvac.fan.tuya_ef101"; |
| | | /// <summary> |
| | | /// 家电、涂鸦扫地机器人 |
| | | /// </summary> |
| | | public const string ElectricTuyaWeepRobot = "electrical.ai6HtccKFIw3dxo3"; |
| | | public const string ElectricTuyaWeepRobot2 = "electrical.sweep.tuya"; |
| | | /// <summary> |
| | | /// 家电、涂鸦水阀 |
| | | /// </summary> |
| | | public const string ElectricTuyaWaterValve = "electrical.koiGhMKwLf2ZP81g"; |
| | | public const string ElectricTuyaWaterValve2 = "electrical.watervalve.tuya_aw713"; |
| | | #endregion |
| | | |
| | | |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(ElectricSocket); |
| | | spkList.Add(PanelSocket); |
| | | spkList.Add(ElectricTV); |
| | | spkList.Add(TvIr); |
| | | spkList.Add(TvXmIr); |
| | | spkList.Add(ElectricFan); |
| | | spkList.Add(HvacFan); |
| | | spkList.Add(FanIr); |
| | | spkList.Add(ClothesHanger); |
| | | spkList.Add(IrLearn); |
| | | spkList.Add(PjtIr); |
| | | spkList.Add(StbIr); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaAirCleaner2); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaFan2); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWeepRobot2); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(AirSwitch); |
| | | return spkList; |
| | | } |
| | |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaAirCleaner2); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaFan2); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | spkList.Add(ElectricTuyaWaterValve2); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWeepRobot2); |
| | | spkList.Add(SenesorMegahealth); |
| | | spkList.Add(SenesorMegahealth2); |
| | | return spkList; |
| | | } |
| | | /// <summary> |
| | |
| | | list.Add(ElectricTuyaFan); |
| | | list.Add(ElectricTuyaWaterValve); |
| | | list.Add(ElectricTuyaWeepRobot); |
| | | list.Add(ElectricTuyaAirCleaner2); |
| | | list.Add(ElectricTuyaFan2); |
| | | list.Add(ElectricTuyaWaterValve2); |
| | | list.Add(ElectricTuyaWeepRobot2); |
| | | break; |
| | | case BrandType.All3tyBrand: |
| | | list.Add(SenesorMegahealth);//兆观 |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 功能类别 |
| | | /// </summary> |
| | | public static class FunctionCategory |
| | | { |
| | | /// <summary> |
| | | ///(灯) |
| | | /// </summary> |
| | | public const string Light = "light"; |
| | | /// <summary> |
| | | /// (窗帘) |
| | | /// </summary> |
| | | public const string Curtain = "curtain"; |
| | | /// <summary> |
| | | /// (空调) |
| | | /// </summary> |
| | | public const string AC = "ac"; |
| | | /// <summary> |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeat = "floorHeat"; |
| | | /// <summary> |
| | | /// (新风) |
| | | /// </summary> |
| | | public const string AirFresh = "airFresh"; |
| | | /// <summary> |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string Music = "music"; |
| | | /// <summary> |
| | | /// (传感器) |
| | | /// </summary> |
| | | public const string Sensor = "sensor"; |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string DryContact = "dryContact"; |
| | | /// <summary> |
| | | /// 家电 |
| | | /// </summary> |
| | | public const string Electric = "electrical"; |
| | | /// <summary> |
| | | /// 红外设备 |
| | | /// </summary> |
| | | public const string IR = "ir"; |
| | | ///// <summary> |
| | | ///// 功能类别 |
| | | ///// </summary> |
| | | //public static class FunctionCategory |
| | | //{ |
| | | // /// <summary> |
| | | // ///(灯) |
| | | // /// </summary> |
| | | // public const string Light = "light"; |
| | | // /// <summary> |
| | | // /// (窗帘) |
| | | // /// </summary> |
| | | // public const string Curtain = "curtain"; |
| | | // /// <summary> |
| | | // /// (空调) |
| | | // /// </summary> |
| | | // public const string AC = "ac"; |
| | | // /// <summary> |
| | | // /// (地热) |
| | | // /// </summary> |
| | | // public const string FloorHeat = "floorHeat"; |
| | | // /// <summary> |
| | | // /// (新风) |
| | | // /// </summary> |
| | | // public const string AirFresh = "airFresh"; |
| | | // /// <summary> |
| | | // /// (音乐) |
| | | // /// </summary> |
| | | // public const string Music = "music"; |
| | | // /// <summary> |
| | | // /// (传感器) |
| | | // /// </summary> |
| | | // public const string Sensor = "sensor"; |
| | | // /// <summary> |
| | | // /// (干接点) |
| | | // /// </summary> |
| | | // public const string DryContact = "dryContact"; |
| | | // /// <summary> |
| | | // /// 家电 |
| | | // /// </summary> |
| | | // public const string Electric = "electrical"; |
| | | // /// <summary> |
| | | // /// 红外设备 |
| | | // /// </summary> |
| | | // public const string IR = "ir"; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //} |
| | | |
| | | |
| | | public class VersionInfo |
| | |
| | | { |
| | | foreach (var function in GetDeviceFunctionList(SPK.BrandType.Hdl)) |
| | | { |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.Music: |
| | | case FunctionCategory.DryContact: |
| | | continue; |
| | | } |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | //switch (function.Spk_Prefix) |
| | | //{ |
| | | // case FunctionCategory.Light: |
| | | // case FunctionCategory.Electric: |
| | | // case FunctionCategory.Curtain: |
| | | // case FunctionCategory.AC: |
| | | // case FunctionCategory.FloorHeat: |
| | | // case FunctionCategory.Sensor: |
| | | // DriverLayer.Control.Ins.SendReadCommand(function); |
| | | // break; |
| | | //} |
| | | Control.Ins.SendReadCommand(function); |
| | | } |
| | | if(DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | |
| | | /// 设备绑定方式 WIFI、QRSCAN、ZIG_BEE、ETHERNET |
| | | /// </summary> |
| | | public string bindType; |
| | | |
| | | /// <summary> |
| | | /// icon文件名称 |
| | | /// </summary> |
| | | public string IconName |
| | | { |
| | | get |
| | | { |
| | | return spk.Replace(".", ""); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0923"; |
| | | public static string VersionString = "1.2.0924"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.FloorHeatStandard, |
| | | SPK.AirFreshStandard, |
| | | SPK.FloorHeatStandard,SPK.HvacFloorHeat, |
| | | SPK.AirFreshStandard,SPK.HvacAirFresh, |
| | | SPK.AirSwitch, |
| | | }; |
| | | |
| | | |
| | | static List<string> _RoomNotSupportFunctionList = null; |
| | | /// <summary> |
| | | /// 房间功能列表不加载的功能列表 |
| | | /// </summary> |
| | | public static List<string> RoomNotSupportFunctionList = new List<string> |
| | | public static List<string> RoomNotSupportFunctionList |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | SPK.AirSwitch, |
| | | SPK.ElectricEnergy, |
| | | }; |
| | | get { |
| | | if(_RoomNotSupportFunctionList == null) |
| | | { |
| | | _RoomNotSupportFunctionList = new List<string>(); |
| | | _RoomNotSupportFunctionList.Add(SPK.EnergyStandard); |
| | | _RoomNotSupportFunctionList.Add(SPK.MusicStandard); |
| | | _RoomNotSupportFunctionList.Add(SPK.AvMusic); |
| | | _RoomNotSupportFunctionList.Add(SPK.AirSwitch); |
| | | _RoomNotSupportFunctionList.Add(SPK.ElectricEnergy); |
| | | _RoomNotSupportFunctionList.AddRange(SPK.EnvironDeviceSpkList()); |
| | | _RoomNotSupportFunctionList.AddRange(SPK.ArmSensorSpkList()); |
| | | } |
| | | return _RoomNotSupportFunctionList; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat: |
| | | var fhView = new FloorHeatingPage(function); |
| | | MainPage.BasePageView.AddChidren(fhView); |
| | | fhView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.ElectricFan: |
| | | case SPK.HvacFan: |
| | | var fanView = new FanPage(function); |
| | | MainPage.BasePageView.AddChidren(fanView); |
| | | fanView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.PanelSocket: |
| | | var sView = new SocketPage(function); |
| | | MainPage.BasePageView.AddChidren(sView); |
| | | sView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
| | | break;
|
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaAirCleaner2: |
| | | var airCleaner = new TuyaAirCleanerPage(); |
| | | airCleaner.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break;
|
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaFan2: |
| | | var tuyaFan = new TuyaFanPage(); |
| | | tuyaFan.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.ElectricTuyaWaterValve:
|
| | | case SPK.ElectricTuyaWaterValve2:
|
| | | var tyWaterValve = new TuyaWaterValvePage();
|
| | | tyWaterValve.AddForm(function, btnCollectionIcon, btnName, btnFromFloor);
|
| | | break;
|
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ElectricTuyaWeepRobot2: |
| | | var weepRobot = new TuyaWeepRobotPage(); |
| | | weepRobot.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | Music.A31MusicModel.Current = (function as Music.A31MusicModel);//当前播放器 |
| | | var a31PlayMusicPage = new Music.A31PlayMusicPage(); |
| | | MainPage.BasePageView.AddChidren(a31PlayMusicPage); |
| | |
| | | doorwindowPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthPage(); |
| | | smPage.ShowColltionButton = false; |
| | | smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break;
|
| | | case SPK.AirFreshJinmao: |
| | | case SPK.HvacAirFreshJinmao: |
| | | var airFresh1 = new AirFreshControlPage(); |
| | | airFresh1.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | var airFresh2 = new AirFreshRelayControlPage(); |
| | | airFresh2.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | |
| | | foreach (var function in list) |
| | | { |
| | | //音乐模块有主从关系,需要特殊处理 |
| | | if (function.Spk_Prefix == FunctionCategory.Music) |
| | | if (SPK.MusicSpkList().Contains( function.spk)) |
| | | { |
| | | //var music = function as Music.A31MusicModel; |
| | | var music = Music.A31MusicModel.A31MusicModelList.Find((obj) => obj.sid == function.sid); |
| | |
| | | LoadEvent_ControlTV(function, btnPower); |
| | | } |
| | | |
| | | else if (function.spk == SPK.MusicStandard) |
| | | else if (function.spk == SPK.MusicStandard || function.spk == SPK.AvMusic) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicIcon.png"; |
| | | btnIcon.SelectedImagePath = "FunctionIcon/Music/MusicOnIcon.png"; |
| | |
| | | //取消收藏事件 |
| | | Action cannelCollect = () => { |
| | | function.collect = false; |
| | | if (function.Spk_Prefix == FunctionCategory.Music)//处理音乐主从关系 |
| | | if (SPK.MusicSpkList().Contains(function.spk))//处理音乐主从关系 |
| | | { |
| | | if ((function as Music.A31MusicModel).ServerClientType == 1) |
| | | { |
| | |
| | | btn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | function.collect = false; |
| | | if (function.Spk_Prefix == FunctionCategory.Music)//处理音乐主从关系 |
| | | if (SPK.MusicSpkList().Contains(function.spk))//处理音乐主从关系 |
| | | { |
| | | if ((function as Music.A31MusicModel).ServerClientType == 1) |
| | | { |
| | |
| | | btn.IsSelected = state; |
| | | if (btn.Tag != null && btn.Tag.ToString() == "state") |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Music) |
| | | if (SPK.MusicSpkList().Contains(function.spk)) |
| | | { |
| | | btn.Text = (function as Music.A31MusicModel).A31PlayStatus.Title; |
| | | } |
| | |
| | | if (fcView.GetChildren(j).Tag == null) |
| | | continue; |
| | | var cTag = fcView.GetChildren(j).Tag.ToString(); |
| | | switch (updataFunction.Spk_Prefix) |
| | | if (SPK.LightSpkList().Contains(updataFunction.spk) || |
| | | SPK.AcSpkList().Contains(updataFunction.spk) || |
| | | SPK.FhSpkList().Contains(updataFunction.spk) || |
| | | SPK.ElectricalSpkList().Contains(updataFunction.spk) || |
| | | SPK.AirFreshSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | case FunctionCategory.Light: |
| | | case FunctionCategory.AC: |
| | | case FunctionCategory.FloorHeat: |
| | | case FunctionCategory.Electric: |
| | | case FunctionCategory.AirFresh: |
| | | #region 按钮状态更新 |
| | | if (cTag == updataFunction.sid + "_Switch") |
| | | { |
| | |
| | | MainPage.Log($"{this.GetType()} error 2 : {ex.Message}"); |
| | | } |
| | | } |
| | | break; |
| | | #endregion |
| | | case FunctionCategory.Curtain: |
| | | } |
| | | else if (SPK.CurtainSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | #region 窗帘更新 |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | if (onoffString == "stop") |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | break; |
| | | case FunctionCategory.Music: |
| | | } |
| | | else if (SPK.MusicSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | #region 音乐更新 |
| | | var uMusic = updataFunction as Music.A31MusicModel; |
| | | if (cTag == updataFunction.spk + "_State_" + updataFunction.sid) |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | ShowFunction vv = ShowFunction.Light; |
| | | switch (function.spk) |
| | | if (SPK.ElectricalSpkList().Contains(function.spk)) |
| | | { |
| | | case SPK.FloorHeatStandard: |
| | | vv = ShowFunction.FloorHeating; |
| | | break; |
| | | case SPK.AcStandard: |
| | | vv = ShowFunction.AC; |
| | | break; |
| | | case SPK.CurtainRoller: |
| | | case SPK.CurtainShades: |
| | | case SPK.CurtainSwitch: |
| | | case SPK.CurtainTrietex: |
| | | vv = ShowFunction.Curtain; |
| | | break; |
| | | case SPK.LightCCT: |
| | | case SPK.LightDimming: |
| | | case SPK.LightRGB: |
| | | case SPK.LightSwitch: |
| | | vv = ShowFunction.Light; |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | case SPK.ElectricTuyaAirCleaner: |
| | | case SPK.ElectricTuyaFan: |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ClothesHanger: |
| | | case SPK.AirSwitch: |
| | | vv = ShowFunction.Electric; |
| | | break; |
| | | case SPK.AirFreshJinmao: |
| | | case SPK.AirFreshStandard: |
| | | } |
| | | else if (SPK.FhSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FloorHeating; |
| | | } |
| | | else if (SPK.AcSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.AC; |
| | | } |
| | | else if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Curtain; |
| | | } |
| | | else if (SPK.LightSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.Light; |
| | | } |
| | | else if (SPK.AirFreshSpkList().Contains(function.spk)) |
| | | { |
| | | vv = ShowFunction.FreshAir; |
| | | break; |
| | | } |
| | | UpdataFunctionOnCount(vv, function.spk); |
| | | UpdataCloseAllButton(function); |
| | |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; |
| | | |
| | | if (function.Spk_Prefix == FunctionCategory.Curtain//窗帘没有开关按钮 |
| | | || function.Spk_Prefix == FunctionCategory.Music//音乐没有开关按钮 |
| | | || function.Spk_Prefix == FunctionCategory.Sensor//传感器没有开关按钮 |
| | | ) |
| | | { |
| | | switch (function.Spk_Prefix) |
| | | { |
| | | case FunctionCategory.Curtain: |
| | | if (SPK.CurtainSpkList().Contains(function.spk)) |
| | | {//窗帘没有开关按钮 |
| | | CurtainFragment(); |
| | | break; |
| | | case FunctionCategory.Sensor: |
| | | } |
| | | else if (SPK.MusicSpkList().Contains(function.spk)) |
| | | {//音乐没有开关按钮 |
| | | MusicFragment(); |
| | | } |
| | | else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk)) //传感器没有开关按钮) |
| | | { |
| | | var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState); |
| | | if (powerLowTipAttr != null) |
| | | { |
| | |
| | | }; |
| | | this.AddChidren(btnTipPowerLow); |
| | | } |
| | | } |
| | | |
| | | break; |
| | | case FunctionCategory.Music: |
| | | MusicFragment(); |
| | | break; |
| | | |
| | | } |
| | | } |
| | | else |
| | |
| | | LoadEvent_SwitchFunction(btnSwitch); |
| | | } |
| | | |
| | | switch (function.Spk_Prefix) |
| | | if (SPK.AcSpkList().Contains(function.spk) || |
| | | SPK.FhSpkList().Contains(function.spk)) |
| | | { |
| | | case FunctionCategory.AC: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.IR: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.FloorHeat: |
| | | LoadLastStatesButton(); |
| | | break; |
| | | case FunctionCategory.Light: |
| | | } |
| | | else if (SPK.LightSpkList().Contains(function.spk)) |
| | | { |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | LoadLightControl(); |
| | | break; |
| | | case FunctionCategory.Electric: |
| | | } |
| | | else if (SPK.ElectricalSpkList().Contains(function.spk)) |
| | | { |
| | | btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on"; |
| | | break; |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | }; |
| | | //bodyDiv.AddChidren(btnCollectionIcon); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if ( function.Spk_Prefix != FunctionCategory.Sensor)//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | if ( !SPK.ArmSensorSpkList().Contains(function.spk) || !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && |
| | | { |
| | | bodyDiv.AddChidren(btnCollectionIcon); |
| | | } |
| | |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Light) |
| | | if (SPK.LightSpkList().Contains( function.spk)) |
| | | { |
| | | function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | |
| | | foreach (var function in room.GetRoomFunctions(false)) |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Sensor || function.spk == SPK.ElectricEnergy) |
| | | if (MainPage.RoomNotSupportFunctionList.Contains( function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | |
| | | break; |
| | | //毫米波传感器 |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | | view.btnText.TextID = StringId.mubiaozhuangtai;//目标状态 |
| | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | keyVlaue = "action_state"; |
| | | } |
| | |
| | | break; |
| | | case StringId.wuren: |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth || device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | value = "uninhabited"; |
| | | } |
| | |
| | | //空调 |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.HvacFloorHeat:case SPK.FloorHeatStandard: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | {//开关灯 |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string set_temp = GetKeyValue("set_temp", dicList); |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | string on_off = GetKeyValue("on_off", dicList); |
| | | string fan = GetKeyValue("fan", dicList); |
| | |
| | | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | |
| | | foreach (var dic in dicList) |
| | |
| | | } |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | } |
| | | break; |
| | | case SPK.AcStandard: |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | strPath = "LogicIcon/airconditionerlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | strPath = "LogicIcon/heatlogic.png"; |
| | | } |
| | |
| | | case SPK.SensorDoorWindow: |
| | | case SPK.SensorUtrasonic: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AC)); |
| | | } |
| | | var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard); |
| | | var floorHeating = deviceList.Find((device) => device.spk == SPK.FloorHeatStandard || device.spk == SPK.HvacFloorHeat); |
| | | if (floorHeating != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.FloorHeating)); |
| | | } |
| | | var airFresh = deviceList.Find((device) => device.spk == SPK.AirFreshStandard); |
| | | var airFresh = deviceList.Find((device) => device.spk == SPK.AirFreshStandard || device.spk == SPK.HvacAirFresh); |
| | | if (airFresh != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.AirFresh)); |
| | |
| | | || device.spk == SPK.SensorDoorWindow |
| | | || device.spk == SPK.SensorUtrasonic |
| | | || device.spk == SPK.SenesorMegahealth |
| | | || device.spk == SPK.SenesorMegahealth2 |
| | | || device.spk == SPK.SensorEnvironment |
| | | || device.spk == SPK.SensorEnvironment2 |
| | | || device.spk == SPK.SensorEnvironment3 |
| | |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.FloorHeating)) |
| | | { |
| | | functionTypeList.Add(SPK.FloorHeatStandard); |
| | | functionTypeList.Add(SPK.FloorHeatStandard);functionTypeList.Add(SPK.HvacFloorHeat); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.AirFresh)) |
| | | { |
| | | functionTypeList.Add(SPK.AirFreshStandard); |
| | | functionTypeList.Add(SPK.AirFreshStandard); functionTypeList.Add(SPK.HvacAirFresh); |
| | | } |
| | | else if (deviceType == Language.StringByID(StringId.Sensor)) |
| | | { |
| | |
| | | functionTypeList.Add(SPK.SensorDoorWindow); |
| | | functionTypeList.Add(SPK.SensorUtrasonic); |
| | | functionTypeList.Add(SPK.SenesorMegahealth); |
| | | functionTypeList.Add(SPK.SenesorMegahealth2); |
| | | functionTypeList.Add(SPK.SensorEnvironment); |
| | | functionTypeList.Add(SPK.SensorEnvironment2); |
| | | functionTypeList.Add(SPK.SensorEnvironment3); |
| | |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.SensorSmoke); |
| | | deviceTypeList.Add(SPK.SensorWater); |
| | | deviceTypeList.Add(SPK.SensorGas); |
| | |
| | | deviceTypeList.Add(SPK.SensorDoorWindow); |
| | | deviceTypeList.Add(SPK.SensorUtrasonic); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth); |
| | | deviceTypeList.Add(SPK.SenesorMegahealth2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment); |
| | | deviceTypeList.Add(SPK.SensorEnvironment2); |
| | | deviceTypeList.Add(SPK.SensorEnvironment3); |
| | |
| | | deviceTypeList.Add(SPK.CurtainSwitch); |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.AcStandard); deviceTypeList.Add(SPK.HvacAirFresh); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); deviceTypeList.Add(SPK.HvacFloorHeat); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | } |
| | | break; |
| | |
| | | #endregion |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | |
| | | } |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | case SPK.HvacAirFresh: |
| | | { |
| | | #region 界面 |
| | | ///开关 |
| | |
| | | break; |
| | | } |
| | | case SPK.AcStandard: |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.FloorHeatStandard:case SPK.HvacFloorHeat: |
| | | { |
| | | //做了一个特殊处理; |
| | | bool _bool = false; |
| | |
| | | /// </summary> |
| | | public Action<Function> AddDeviceEvent = null; |
| | | |
| | | public IntegratedBrandDevice device; |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | |
| | | /// </summary> |
| | | public void ShowForm(IntegratedBrandDevice device) |
| | | { |
| | | this.device = device; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | //设置头部信息 |
| | |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.IndependentRegister3TyDevcie(SPK.SenesorMegahealth, snCode,Language.StringByID(StringId.SenesorMillimeterWave)); |
| | | var pack = pm.IndependentRegister3TyDevcie(device.spk, snCode,Language.StringByID(StringId.SenesorMillimeterWave)); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString()); |
| | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.spk.Replace(".","")}.png", |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.IconName}.png", |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | |
| | | }; |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var form1 = new AddSenesorMegahealthDirection1Page(); |
| | | form1.AddForm(device); |
| | | form1.AddDeviceEvent = (functionObj) => { |
| | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.spk.Replace(".", "")}.png", |
| | | UnSelectedImagePath = $"FunctionIcon/Icon/{device.IconName}.png", |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | |
| | | }); |
| | | break; |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.SenesorMegahealth2: |
| | | var smPage = new SenesorMegahealthManagerPage(); |
| | | smPage.AddForm(device); |
| | | smPage.DelDeviceEvent = () => |
| | |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth|| device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device, true); |
| | | } |
| | |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | if (device.spk == SPK.SenesorMegahealth|| device.spk == SPK.SenesorMegahealth2) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device, true); |
| | | } |