2个文件已添加
45个文件已修改
1 文件已重命名
| | |
| | | <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/FunctionBaseInfoSetPage.cs"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/ResponseEntity/CityInfo.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttInfoConfig.cs" /> |
| | | <File FileName="HDL_ON/Common/FileUtlis.cs" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="630" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" Line="851" Column="74" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" Line="694" Column="59" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs" Line="529" Column="20" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/PjtPage.cs" Line="13" Column="25" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPage.cs" Line="348" Column="10" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="1054" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs" Line="11" Column="9" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrLearnPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs" Line="256" Column="64" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/RoomPage.cs" Line="72" Column="11" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="9" Column="45" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" Line="692" Column="21" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="693" Column="36" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" Line="363" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" Line="531" Column="80" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs" Line="265" Column="45" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/BrandListPage.cs" Line="157" Column="50" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs" Line="127" Column="74" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="203" Column="52" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" Line="179" Column="46" /> |
| | | <File FileName="HDL_ON/Entity/ResponseEntity/CityInfo.cs" Line="32" Column="32" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Device" expanded="True" /> |
| | | <Node name="Enumerative" expanded="True" /> |
| | | <Node name="Function" expanded="True" /> |
| | | <Node name="ResponseEntity" expanded="True"> |
| | | <Node name="CityInfo.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI0-Stan" expanded="True"> |
| | | <Node name="Form" expanded="True"> |
| | | <Node name="Base" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="UI1-Login" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="AddFunction" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="1ContorlPage" expanded="True" /> |
| | | <Node name="Electrical" expanded="True" /> |
| | | <Node name="Energy" expanded="True" /> |
| | | <Node name="EnvironmentalScience" expanded="True" /> |
| | | <Node name="Light" expanded="True" /> |
| | | <Node name="Music" expanded="True" /> |
| | | <Node name="Video" expanded="True" /> |
| | | <Node name="FunctionBaseInfoSetPage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Electrical" expanded="True" /> |
| | | <Node name="Icon" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <Node name="Resources" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Electrical" expanded="True" /> |
| | | <Node name="Icon" expanded="True"> |
| | | <Node name="HomeIcon" expanded="True" /> |
| | | </Node> |
| | | <Node name="Icon" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs" line="313" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs" line="392" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs" line="327" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="1841" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 458=Date |
| | | 459=Real time energy consumption |
| | | 460=Energy consumption of this month |
| | | 461=Outdoor/Indoor |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 458=日期 |
| | | 459=实时能耗 |
| | | 460=本月能耗 |
| | | 461=室外/室内 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 6006=电视 |
| | | 6007=风扇 |
| | | 6008=机顶盒 |
| | | 6009=DVD/EVD/VCD |
| | | 6009=DVD |
| | | 6010=投影仪 |
| | | 6011=自定义 |
| | | 6012=红外遥控 |
| | |
| | | 6078=系统维护中~请稍后再试~ |
| | | 6079=获取数据失败 |
| | | 6080=暂时不支持该功能 |
| | | 6081=选择红外品牌 |
| | | 6082=摇头 |
| | | 6083=低速 |
| | | 6084=中速 |
| | | 6085=高速 |
| | | 6086=自动 |
| | | 6087=温度+ |
| | | 6088=温度- |
| | | 6089=空气净化器 |
| | | 6090=热水器 |
| | | 6091=不存在的产品 |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | |
| | | |
| | | |
| | | 7000=新建自动化 |
| | | 7001=编辑自动化 |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irstb_blue.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irstb_white.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Energy\EnergyDrodUpIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensormegahealth.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104282" android:versionName="1.2.202104282" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202105251" android:versionName="1.2.202105251" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!-- 可视对讲权限--> |
| | | <uses-permission android:name="android.permission.CAMERA" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\irpjt.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\irstb.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Energy\EnergyDrodUpIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensormegahealth.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202104282</string> |
| | | <string>1.2.202105252</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>202104282</string> |
| | | <string>1.2.05252</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 458=Date |
| | | 459=Real time energy consumption |
| | | 460=Energy consumption of this month |
| | | 461=Outdoor/Indoor |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 458=日期 |
| | | 459=实时能耗 |
| | | 460=本月能耗 |
| | | 461=室外/室内 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 6006=电视 |
| | | 6007=风扇 |
| | | 6008=机顶盒 |
| | | 6009=DVD/EVD/VCD |
| | | 6009=DVD |
| | | 6010=投影仪 |
| | | 6011=自定义 |
| | | 6012=红外遥控 |
| | |
| | | 6078=系统维护中~请稍后再试~ |
| | | 6079=获取数据失败 |
| | | 6080=暂时不支持该功能 |
| | | 6081=选择红外品牌 |
| | | 6082=摇头 |
| | | 6083=低速 |
| | | 6084=中速 |
| | | 6085=高速 |
| | | 6086=自动 |
| | | 6087=温度+ |
| | | 6088=温度- |
| | | 6089=空气净化器 |
| | | 6090=热水器 |
| | | 6091=不存在的产品 |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | |
| | | |
| | | |
| | | 7000=新建自动化 |
| | | 7001=编辑自动化 |
| | |
| | | public static class StringId |
| | | { |
| | | /// <summary> |
| | | /// 室内室外 |
| | | /// </summary> |
| | | public const int InOutdoor = 461; |
| | | /// <summary> |
| | | /// 本月能耗 |
| | | /// </summary> |
| | | public const int EnergyConsumptionOfThisMonth = 460; |
| | |
| | | public const int xitongweihuzhong = 6078; |
| | | public const int huoqushujushibao = 6079; |
| | | public const int zanshibuzhichigaigongneng = 6080; |
| | | |
| | | |
| | | |
| | | |
| | | public const int xuanzehongwaipinpai= 6081; |
| | | public const int yaotou = 6082; |
| | | public const int disu = 6083; |
| | | public const int zhongsu = 6084; |
| | | public const int gaosu = 6085; |
| | | public const int zidong = 6086; |
| | | public const int wendujia = 6087; |
| | | public const int wendujian = 6088; |
| | | public const int kongqijinghauqi = 6089; |
| | | public const int reshuiqi = 6090; |
| | | public const int bucunzaichanpin = 6091; |
| | | public const int shebeibucunzai = 6092; |
| | | public const int shebeibuzaixian = 6093; |
| | | public const int wangguanshebeibuzaixian = 6094; |
| | | |
| | | public const int newAutomation = 7000; |
| | | public const int editAutomation = 7001; |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | if(localFunction.spk == SPK.SensorTemperature) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | | } |
| | | else if (localFunction.spk == SPK.SensorHumidity) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.controldata = revString; |
| | | HDL_ON.UI.UI2.PersonalCenter.PirDevice.PirMethod.controldata = revString; |
| | | } |
| | | //App订阅遥控器自学按键学习成功通知 |
| | | else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/irCodeStudyDone/up") |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | UI.UI2.PersonalCenter.PirDevice.Method.buttondata = revString; |
| | | UI.UI2.PersonalCenter.PirDevice.PirMethod.buttondata = revString; |
| | | } |
| | | #region 数据更新推送主题 |
| | | //appHomeRefresh:住宅数据刷新通知 |
| | |
| | | case "18778381374": |
| | | case "18316672920": |
| | | case "15971583093": |
| | | case "15626203746": |
| | | return; |
| | | } |
| | | |
| | |
| | | /// <returns></returns> |
| | | static async Task GetMqttInfoAndMQTTConnectAsync() |
| | | { |
| | | var mqttInfoRequestResult_Obj = new Server.HttpServerRequest().GetMqttRemoteInfo(GetRandomKey()); |
| | | var mqttInfoRequestResult_Obj = new HttpServerRequest().GetMqttRemoteInfo(GetRandomKey()); |
| | | if (mqttInfoRequestResult_Obj != null) |
| | | { |
| | | MainPage.Log($"获取mqtt info 成功 /r/n clientId:{mqttInfoRequestResult_Obj.clientId}/r/n passWord:{mqttInfoRequestResult_Obj.passWord} /r/n url:{mqttInfoRequestResult_Obj.url}/r/n userName:{mqttInfoRequestResult_Obj.userName}"); |
| | | |
| | | |
| | | MqttInfoConfig.Current.mMqttInfo = mqttInfoRequestResult_Obj; |
| | | await MQTTConnectAsync(); |
| | | //1.判断是否绑定了网关,获取网关远程连接的加密KEY |
| | |
| | | d.Add("key", key); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_SensorLastMonthHistoricalData, requestJson); |
| | | } |
| | | |
| | | |
| | |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string SensorDryContact = "sensor.dryContact"; |
| | | /// <summary> |
| | | /// 毫米波传感器 |
| | | /// </summary> |
| | | public const string SenesorMegahealth = "sensor.megahealth"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 安防传感器spk列表 |
| | |
| | | spkList.Add(SensorDuiShe); |
| | | spkList.Add(SensoruUtrasonic); |
| | | spkList.Add(SensorDryContact); |
| | | spkList.Add(SenesorMegahealth); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// 时区 |
| | | /// </summary> |
| | | public string timeZone; |
| | | /// <summary> |
| | | /// 最低温 |
| | | /// </summary> |
| | | public string lowestTemperature = "--"; |
| | | /// <summary> |
| | | /// 最高温 |
| | | /// </summary> |
| | | public string highestTemperature = "--"; |
| | | |
| | | /// <summary> |
| | | /// 温度 |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirSend.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\AddControlComplete.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PatchView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Method.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FailView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\ClothesHangerSetTimePage.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\DvdPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\PjtPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\StbPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirMethod.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)DAL\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0428"; |
| | | public static string VersionString = "1.2.0525"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | //return; |
| | | if (b) |
| | | { |
| | | etAccount.Text = "13375012446";//测试服务器 |
| | | etAccount.Text = "15626203746";//测试服务器 |
| | | //etAccount.Text = "13375012446";//测试服务器 |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | |
| | | /// </summary> |
| | | FrameLayout environmentalView; |
| | | /// <summary> |
| | | /// 当前温度信息 |
| | | /// 当前温度信息-室外 |
| | | /// </summary> |
| | | TextButton btnTempValues; |
| | | /// <summary> |
| | | /// 当前湿度信息 |
| | | /// 当前湿度信息-室外 |
| | | /// </summary> |
| | | TextButton btnHumidityValues; |
| | | /// <summary> |
| | | /// 当前温度信息-室内 |
| | | /// </summary> |
| | | TextButton btnIndoorTempValues; |
| | | /// <summary> |
| | | /// 当前湿度信息-室内 |
| | | /// </summary> |
| | | TextButton btnIndoorHumiValues; |
| | | /// <summary> |
| | | /// 当前pm2.5状态 |
| | | /// </summary> |
| | |
| | | }; |
| | | topView.AddChidren(environmentalView); |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | |
| | | var btnEnvirValuesTitle = new Button() { |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.InOutdoor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | if (tempSensorList.Count > 0 || humiSensorList.Count > 0) |
| | | { |
| | | btnEnvirValuesTitle.Width = Application.GetRealWidth(8)+ btnEnvirValuesTitle.GetTextWidth(); |
| | | } |
| | | environmentalView.AddChidren(btnEnvirValuesTitle); |
| | | |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | X = btnEnvirValuesTitle.Right,//+ Application.GetRealWidth(4), |
| | | //X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | |
| | | btnTempValues = new TextButton() |
| | | { |
| | | X = btnTempIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(30), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = MainPage.cityInfo.temperature + "°", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | environmentalView.AddChidren(btnTempValues); |
| | | |
| | | btnIndoorTempValues = new TextButton() |
| | | { |
| | | X = btnTempValues.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "/--°", |
| | | }; |
| | | if (tempSensorList.Count > 0) |
| | | { |
| | | double tempTotalValues = 0; |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | | double tempValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue); |
| | | tempTotalValues += tempValue; |
| | | } |
| | | if (tempTotalValues > 0) |
| | | { |
| | | btnIndoorTempValues.Text = "/" + tempTotalValues + "°"; |
| | | } |
| | | btnIndoorTempValues.Width = btnIndoorTempValues.GetTextWidth(); |
| | | } |
| | | environmentalView.AddChidren(btnIndoorTempValues); |
| | | |
| | | Button btnHumidityIcon = new Button() |
| | | { |
| | | X = btnTempValues.Right + Application.GetRealWidth(2), |
| | | X = btnIndoorTempValues.Right + Application.GetRealWidth(8), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | |
| | | btnHumidityValues = new TextButton() |
| | | { |
| | | X = btnHumidityIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(30), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = MainPage.cityInfo.humidity + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); |
| | | environmentalView.AddChidren(btnHumidityValues); |
| | | |
| | | btnIndoorHumiValues = new TextButton() |
| | | { |
| | | X = btnHumidityValues.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "/--%", |
| | | }; |
| | | if (tempSensorList.Count > 0) |
| | | { |
| | | double humiTotalValues = 0; |
| | | foreach (var humi in humiSensorList) |
| | | { |
| | | double humiValue = 0; |
| | | double.TryParse(humi.GetAttrState(FunctionAttributeKey.Value), out humiValue); |
| | | humiTotalValues += humiValue; |
| | | } |
| | | if (humiTotalValues > 0) |
| | | { |
| | | btnIndoorHumiValues.Text = "/" + humiTotalValues + "%"; |
| | | } |
| | | btnIndoorHumiValues.Width = btnIndoorHumiValues.GetTextWidth(); |
| | | } |
| | | environmentalView.AddChidren(btnIndoorHumiValues); |
| | | |
| | | Button btnPm25Icon = new Button() |
| | | { |
| | | X = btnHumidityValues.Right + Application.GetRealWidth(2), |
| | | X = btnIndoorHumiValues.Right + Application.GetRealWidth(4), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | |
| | | btnPm25Values = new TextButton() |
| | | { |
| | | X = btnPm25Icon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(130), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = MainPage.cityInfo.pm25, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnPm25Values.Width = btnPm25Values.GetTextWidth(); |
| | | environmentalView.AddChidren(btnPm25Values); |
| | | #endregion |
| | | |
| | |
| | | bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新室内传感器数据-湿度 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshEnvirIndoorHumi() |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | double humiTotalValues = 0; |
| | | foreach (var temp in humiSensorList) |
| | | { |
| | | double humiValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out humiValue); |
| | | humiTotalValues += humiValue; |
| | | } |
| | | if (humiTotalValues > 0) |
| | | { |
| | | bodyView.btnIndoorHumiValues.Text = "/" + humiTotalValues + "%"; |
| | | } |
| | | bodyView.btnIndoorHumiValues.Width = bodyView.btnIndoorHumiValues.GetTextWidth(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新室内传感器数据-晚点 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshEnvirIndoorTemp() |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | double tempTotalValues = 0; |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | | double tempValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue); |
| | | tempTotalValues += tempValue; |
| | | } |
| | | if (tempTotalValues > 0) |
| | | { |
| | | bodyView.btnIndoorTempValues.Text = "/" + tempTotalValues + "°"; |
| | | } |
| | | bodyView.btnIndoorTempValues.Width = bodyView.btnIndoorTempValues.GetTextWidth(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新功能列表主页 |
| | | /// </summary> |
| | |
| | | |
| | | foreach (var function in room.GetRoomFunctions(false)) |
| | | { |
| | | if (function.Spk_Prefix == FunctionCategory.Sensor) |
| | | if (function.Spk_Prefix == FunctionCategory.Sensor || function.spk == SPK.ElectricEnergy) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | BackgroundColor = CSS.CSS_Color.viewMiddle, |
| | | }; |
| | | this.AddChidren(viewLayout); |
| | | #region 时间 功能 |
| | | #region 时间 功能 室外变化 |
| | | //时间 |
| | | LogicView.SelectTypeView timeView = new LogicView.SelectTypeView(); |
| | | timeView.btnText.TextID = StringId.time; |
| | |
| | | viewLayout.AddChidren(shiwaiView.FLayoutView()); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 所有点击事件 |
| | | //时间 |
| | |
| | | LogicView.SelectTypeView delayView = new LogicView.SelectTypeView(); |
| | | delayView.frameLayout.Y = sceneView.frameLayout.Bottom; |
| | | delayView.btnText.TextID = StringId.delayLogic; |
| | | delayView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png"; |
| | | delayView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; |
| | | //viewLayout.AddChidren(delayView.FLayoutView()); |
| | | #endregion |
| | | |
| | |
| | | break; |
| | | case "3": |
| | | { |
| | | targetView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png"; |
| | | targetView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png"; |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | |
| | | { |
| | | List<string> deviceStrTypeList = new List<string>(); |
| | | deviceStrTypeList.Clear(); |
| | | var lightjosn = deviceList.Find((device) => device.spk == SPK.LightSwitch || device.spk == SPK.LightDimming || device.spk == SPK.LightCCT || device.spk == SPK.LightRGB || device.spk == SPK.LightRGBW); |
| | | var lightjosn = deviceList.Find((device) => |
| | | device.spk == SPK.LightSwitch |
| | | || device.spk == SPK.LightDimming |
| | | || device.spk == SPK.LightCCT |
| | | || device.spk == SPK.LightRGB |
| | | || device.spk == SPK.LightRGBW); |
| | | if (lightjosn != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Lights)); |
| | | } |
| | | |
| | | var curtainjosn = deviceList.Find((device) => device.spk == SPK.CurtainSwitch || device.spk == SPK.CurtainTrietex || device.spk == SPK.CurtainRoller); |
| | | var curtainjosn = deviceList.Find((device) => |
| | | device.spk == SPK.CurtainSwitch |
| | | || device.spk == SPK.CurtainTrietex |
| | | || device.spk == SPK.CurtainRoller); |
| | | if (curtainjosn != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Curtain)); |
| | |
| | | //Y = Application.GetRealHeight(12), |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | IsMoreLines = true, |
| | | // IsMoreLines = true, |
| | | }; |
| | | /// <summary> |
| | | /// 图标 |
| | |
| | | { |
| | | //初始化列表 |
| | | var hList = new List<string>(); |
| | | for (int i = 0; i < 23; i++) |
| | | for (int i = 0; i < 24; i++) |
| | | { |
| | | if (i < 10) |
| | | { |
| | |
| | | var jay = jArray[a]; |
| | | //数据返序列化为Logic对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | Console.WriteLine("获取逻辑==="+str); |
| | | var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str); |
| | | if (logic != null) |
| | | { |
| | |
| | | if (if_logic == null) |
| | | { |
| | | |
| | | //Logic newlogic = new Logic(); |
| | | //newlogic.name = logic.name; |
| | | //newlogic.userLogicId = logic.userLogicId; |
| | | //newlogic.sid = logic.sid; |
| | | //newlogic.relation = logic.relation; |
| | | //newlogic.enable = logic.enable; |
| | | //newlogic.cycle = logic.cycle; |
| | | //for (int i = 0; i < logic.input.Count; i++) |
| | | //{ |
| | | // if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type)) |
| | | // { |
| | | // //防止调试软件乱传东西上来; |
| | | // //防止有空对象; |
| | | // //正常情况下不会出现的现象; |
| | | // continue; |
| | | // } |
| | | // newlogic.input.Add(logic.input[i]); |
| | | //} |
| | | //for (int i = 0; i < logic.output.Count; i++) |
| | | //{ |
| | | // if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type)) |
| | | // { |
| | | // //防止调试软件乱传东西上来; |
| | | // //防止有空对象; |
| | | // //正常情况下不会该现象; |
| | | // continue; |
| | | // } |
| | | // newlogic.output.Add(logic.output[i]); |
| | | //} |
| | | |
| | | Logic newlogic = new Logic(); |
| | | newlogic.name = logic.name; |
| | | newlogic.userLogicId = logic.userLogicId; |
| | | newlogic.sid = logic.sid; |
| | | newlogic.relation = logic.relation; |
| | | newlogic.enable = logic.enable; |
| | | newlogic.cycle = logic.cycle; |
| | | for (int i = 0; i < logic.input.Count; i++) |
| | | { |
| | | if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type)) |
| | | { |
| | | //防止调试软件乱传东西上来; |
| | | //防止有空对象; |
| | | //正常情况下不会出现的现象; |
| | | continue; |
| | | } |
| | | newlogic.input.Add(logic.input[i]); |
| | | } |
| | | for (int i = 0; i < logic.output.Count; i++) |
| | | { |
| | | if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type)) |
| | | { |
| | | //防止调试软件乱传东西上来; |
| | | //防止有空对象; |
| | | //正常情况下不会该现象; |
| | | continue; |
| | | } |
| | | newlogic.output.Add(logic.output[i]); |
| | | } |
| | | newlogic.noticeConfig = logic.noticeConfig; |
| | | newlogic.pushConfigs = logic.pushConfigs; |
| | | //添加逻辑 |
| | | Logic.LogicList.Add(logic); |
| | | Logic.LogicList.Add(newlogic); |
| | | } |
| | | } |
| | | |
| | |
| | | switch (device.spk) |
| | | { |
| | | case SPK.IrModule: |
| | | new UI2.PersonalCenter.PirDevice.Method().MainView(this, device,()=> {}); |
| | | new UI2.PersonalCenter.PirDevice.PirMethod().MainView(this, device,()=> {}); |
| | | break; |
| | | } |
| | | }; |
| | |
| | | //移除添加按钮界面 |
| | | this.RemoveFromParent(); |
| | | //移除之前可能存在的界面 |
| | | Method.RemoveView("AddControl"); |
| | | PirMethod.RemoveView("AddControl"); |
| | | //加载数据界面 |
| | | AddControl addControl = new AddControl(); |
| | | MainPage.BasePageView.AddChidren(addControl); |
| | |
| | | else |
| | | { |
| | | replication.RemView(); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(null,"添加失败"); |
| | | } |
| | | |
| | |
| | | public override void RemoveFromParent() |
| | | { |
| | | //刷新指定界面 |
| | | Method.RefreshView("PirMain"); |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | } |
| | | } |
| | |
| | | //移除当前界面 |
| | | this.RemoveFromParent(); |
| | | //可能之前已经存在该界面 |
| | | Method.RemoveView("AddControlComplete"); |
| | | PirMethod.RemoveView("AddControlComplete"); |
| | | AddControlComplete addControlComplete = new AddControlComplete(); |
| | | MainPage.BasePageView.AddChidren(addControlComplete); |
| | | addControlComplete.Show(control, false); |
| | |
| | | View.Buttons buttons = new View.Buttons(); |
| | | buttons.AddButton2(vv, control.status, (obj) => |
| | | { |
| | | Method.ThreadSend(control, (responsePackNew) => |
| | | PirMethod.ThreadSend(control, (responsePackNew) => |
| | | { |
| | | var buttonObj = control.status.Find((c) => c.value == obj.value); |
| | | if (buttonObj != null) |
| | |
| | | //添加所有遥控名称列表 |
| | | list.Add(Pir.currPir.FunctioList[i].name); |
| | | } |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.EditControlName(StringId.editName, list, control.name, (name, dialog) => |
| | | { |
| | | //发送更新名称命令 |
| | | Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | //关闭窗口 |
| | | dialog.Close(); |
| | |
| | | //所属区域点击事件 |
| | | quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ManagementPosition(GetFunction(control.deviceId), () => |
| | | { |
| | | //更新区域 |
| | |
| | | { |
| | | if (bool_library) |
| | | {//继续添加库的遥控器 |
| | | Method.RefreshView("PirMain");//刷新指点界面 |
| | | PirMethod.RefreshView("PirMain");//刷新指点界面 |
| | | this.RemoveFromParent(); |
| | | } |
| | | else |
| | | {//继续添加自定义的遥控器 |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.AddControl(this, (controlDevice) => |
| | | { |
| | | AddButton addButton = new AddButton(); |
| | |
| | | saveView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //刷新指点界面 |
| | | Method.RefreshView("PirMain"); |
| | | PirMethod.RefreshView("PirMain"); |
| | | //移除所有界面 |
| | | MainPage.BasePageView.RemoveViewByTag("PirView"); |
| | | }; |
| | |
| | | public override void RemoveFromParent() |
| | | { |
| | | //刷新指定界面 |
| | | Method.RefreshView("PirMain"); |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | } |
| | | } |
| | |
| | | string s = brandList[str].brandName; |
| | | strList.Add(s); |
| | | } |
| | | JLCountrycode.CountryCodeView.Current.ShowSortSelection("选择红外品牌", GetDateList(strList), (countryName) => |
| | | var dicList = GetDateList(strList); |
| | | JLCountrycode.CountryCodeView.Current.ShowSortSelection(Language.StringByID(StringId.xuanzehongwaipinpai), dicList, (countryName) => |
| | | { |
| | | |
| | | var brandObj = brandList.Find((c) => c.brandName == countryName); |
| | |
| | | { |
| | | if (libraryList.Count < 40) |
| | | { |
| | | //限制40个库; |
| | | libraryList.Add(library); |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(responsePackNew, ""); |
| | | } |
| | | }, id, "品牌红外码库列表"); |
| | |
| | | { |
| | | list.Add(Pir.currPir.FunctioList[i].name); |
| | | } |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.EditControlName(StringId.editName,list, control.name, (name, dialog) => |
| | | { |
| | | Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | dialog.Close(); |
| | | editNameFLayout.btnEditText.Text = name; |
| | |
| | | //遥控器所属区域选中事件 |
| | | areaFLayout.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ManagementPosition(control, () => |
| | | { |
| | | //更新区域 |
| | |
| | | code = 1; |
| | | GetBtnText(testBtn, code, spk); |
| | | }; |
| | | |
| | | //测试Text |
| | | testBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var library = libraryList[index - 1]; |
| | | var control = GetControl(spk, testBtn.TextID, library); |
| | | //发送测试码命令 |
| | | Method.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null); |
| | | PirMethod.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null); |
| | | if (code == 3) { |
| | | //标记最后那个码 |
| | | if_bool = true; |
| | |
| | | { |
| | | var library = libraryList[index-1]; |
| | | var control = GetControl(spk, testBtn.TextID, library); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | //发送库添加遥控器命令 |
| | | method.ThreadAddControl(control, this, (device) => |
| | | { |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.FanIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | } |
| | | break; |
| | | case StringId.zhongsu: |
| | | { |
| | | key = "middle"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | case StringId.yaotou: |
| | | { |
| | | key = "swing"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.PjtIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | } |
| | | break; |
| | | case StringId.yinliangjia: |
| | | { |
| | | key = "volume+"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | case StringId.yinliangjian: |
| | | { |
| | | key = "volume-"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.StbIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | } |
| | | break; |
| | | case StringId.yinliangjia: |
| | | { |
| | | key = "volume+"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | case StringId.yinliangjian: |
| | | { |
| | | key = "volume-"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.DvDIr: |
| | | { |
| | | |
| | | } |
| | | break; |
| | | case SPK.PurifierIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | } |
| | | break; |
| | | case StringId.zidong: |
| | | { |
| | | key = "auto"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | case StringId.jingyin: |
| | | { |
| | | key = "mute"; |
| | | value = "0"; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.HeaterIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | } |
| | | break; |
| | | case StringId.wendujia: |
| | | { |
| | | key = "temp+"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | case StringId.wendujian: |
| | | { |
| | | key = "temp-"; |
| | | value = ""; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | AttributesStatus buttonObj = new AttributesStatus(); |
| | | buttonObj.key = key; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.FanIr: |
| | | { |
| | | switch (code) |
| | | { |
| | | case 1: |
| | | { |
| | | textValue = StringId.dianyuan; |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | textValue = StringId.zhongsu; |
| | | } |
| | | break; |
| | | case 3: |
| | | { |
| | | textValue = StringId.yaotou; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.PjtIr: |
| | | { |
| | | switch (code) |
| | | { |
| | | case 1: |
| | | { |
| | | textValue = StringId.dianyuan; |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | textValue = StringId.yinliangjia; |
| | | } |
| | | break; |
| | | case 3: |
| | | { |
| | | textValue = StringId.yinliangjian; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.StbIr: |
| | | { |
| | | switch (code) |
| | | { |
| | | case 1: |
| | | { |
| | | textValue = StringId.dianyuan; |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | textValue = StringId.yinliangjia; |
| | | } |
| | | break; |
| | | case 3: |
| | | { |
| | | textValue = StringId.yinliangjian; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.DvDIr: |
| | | { |
| | | |
| | | } |
| | | break; |
| | | case SPK.PurifierIr: |
| | | { |
| | | switch (code) |
| | | { |
| | | case 1: |
| | | { |
| | | textValue = StringId.dianyuan; |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | textValue = StringId.zidong; |
| | | } |
| | | break; |
| | | case 3: |
| | | { |
| | | textValue = StringId.jingyin; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.HeaterIr: |
| | | { |
| | | switch (code) |
| | | { |
| | | case 1: |
| | | { |
| | | textValue = StringId.dianyuan; |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | textValue = StringId.wendujia; |
| | | } |
| | | break; |
| | | case 3: |
| | | { |
| | | textValue = StringId.wendujian; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | testBtn.TextID = textValue; |
| | | } |
| | |
| | | |
| | | }; |
| | | middFLayout.AddChidren(addDevice); |
| | | if (Pir.currPir.FunctioList.Count < 10) |
| | | { |
| | | //10个遥控器就会隐藏添加图标 |
| | | // middFLayout.AddChidren(addDevice); |
| | | addDevice.Visible = true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 界面点击事件 |
| | |
| | | ////关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | |
| | | Method.GetControlList(this, () => |
| | | PirMethod.GetControlList(this, () => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | //1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义; |
| | | if (if_value == 7) |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.AddControl(this, (control) => |
| | | { |
| | | //成功后移除; |
| | |
| | | } |
| | | else |
| | | { |
| | | if (if_value == 3 || if_value == 4 || if_value == 5 || if_value == 6) |
| | | if (if_value == 6) |
| | | { |
| | | new TipPopView().FlashingBox(Language.StringByID(StringId.zanshibuzhichigaigongneng)); |
| | | return; |
| | |
| | | ///初始化界面 |
| | | UIView(vv); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载UI界面 |
| | | /// </summary> |
| | | /// <param name="vv">上下滑控件</param> |
| | | private void UIView(VerticalRefreshLayout vv) |
| | | { |
| | | if (Pir.currPir.FunctioList.Count < 10) |
| | | { |
| | | //10个遥控器就会隐藏添加图标 |
| | | // middFLayout.AddChidren(addDevice); |
| | | addDevice.Visible = true; |
| | | } |
| | | vv.RemoveAll(); |
| | | #region 红外宝图标 版本号 名称 状态 |
| | | FrameLayout fLayout = new FrameLayout |
| | |
| | | TipPopView tipPopView = new TipPopView(); |
| | | tipPopView.TipBox(StringId.tip, text, (dialog) => |
| | | { |
| | | Method.ThreadSend(new Control { deviceId=control.deviceId}, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId=control.deviceId}, (responsePackNew) => |
| | | { |
| | | dialog.Close(); |
| | | var function = Pir.currPir.FunctioList.Find((c) => c.sid == Function.sid); |
| | |
| | | { |
| | | if (tag) |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(responsePackNew, ""); |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(responsePackNew, ""); |
| | | } |
| | | }, id, "品牌列表"); |
File was renamed from HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs |
| | |
| | | |
| | | namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice |
| | | { |
| | | public class Method |
| | | public class PirMethod |
| | | { |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | View.TipView tipView = new View.TipView(); |
| | | tipView.InputBox(frameLayout, "", (name, frame) => |
| | | { |
| | | if (Pir.currPir != null && Pir.currPir.FunctioList.Count < 10) |
| | | { |
| | | Control control = new Control(); |
| | | control.name = name; |
| | | control.type = "learn"; |
| | | control.spk = "ir.learn"; |
| | | control.deviceId = Pir.currPir.deviceId; |
| | | ThreadAddControl(control, frame, action); |
| | | } |
| | | else |
| | | { |
| | | View.TipView tt = new View.TipView(); |
| | | tt.TipBox(StringId.tip, StringId.bunengchaoguo10); |
| | | } |
| | | }, false); |
| | | { |
| | | if (Pir.currPir != null && Pir.currPir.FunctioList.Count < 10) |
| | | { |
| | | Control control = new Control(); |
| | | control.name = name; |
| | | control.type = "learn"; |
| | | control.spk = "ir.learn"; |
| | | control.deviceId = Pir.currPir.deviceId; |
| | | ThreadAddControl(control, frame, action); |
| | | } |
| | | else |
| | | { |
| | | View.TipView tt = new View.TipView(); |
| | | tt.TipBox(StringId.tip, StringId.bunengchaoguo10); |
| | | } |
| | | }, false); |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | |
| | | if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) |
| | | {
|
| | | { |
| | | PirDevice.Pir.pirDeviceList.Add(pirJosn); |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | loading.Hide(); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(null, "读取红外宝列表失败"); |
| | | } |
| | | } |
| | |
| | | public static void GetControlList(FrameLayout frame, Action action, Pir pirDevice) |
| | | { |
| | | ThreadSend(new Control { deviceId = pirDevice.deviceId }, (responsePackNew) => |
| | | { |
| | | var jArray = JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | { |
| | | var jay = jArray[a]; |
| | | //数据返序列化为Logic对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); |
| | | if (pirJosn != null) |
| | | { |
| | | if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) |
| | | { |
| | | pirDevice.FunctioList.Add(pirJosn); |
| | | } |
| | | } |
| | | } |
| | | action(); |
| | | }, "获取遥控器列表", "frame", frame, null); |
| | | { |
| | | var jArray = JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | | { |
| | | var jay = jArray[a]; |
| | | //数据返序列化为Logic对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); |
| | | var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); |
| | | if (pirJosn != null) |
| | | { |
| | | if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) |
| | | { |
| | | pirDevice.FunctioList.Add(pirJosn); |
| | | } |
| | | } |
| | | } |
| | | action(); |
| | | }, "获取遥控器列表", "frame", frame, null); |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | /// <param name="frame">log父控件</param> |
| | | /// <param name="dialog">log父控件</param> |
| | | /// <param name="attributesStatus">学习按键</param> |
| | | public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus=null) |
| | | public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus = null) |
| | | { |
| | | |
| | | //加载log |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | //自定义错误提示文本 |
| | | string eorroText = ""; |
| | | if (str == "删除") |
| | |
| | | |
| | | } |
| | | break; |
| | | case "14002": |
| | | { |
| | | str = Language.StringByID(StringId.bucunzaichanpin); |
| | | } |
| | | break; |
| | | case "10805": |
| | | { |
| | | str = Language.StringByID(StringId.shebeibucunzai); |
| | | } |
| | | break; |
| | | case "14006": |
| | | { |
| | | str = Language.StringByID(StringId.shebeibuzaixian); |
| | | } |
| | | break; |
| | | case "9": |
| | | { |
| | | str = Language.StringByID(StringId.wangguanshebeibuzaixian); |
| | | } |
| | | break; |
| | | case "2": |
| | | { |
| | | str = Language.StringByID(StringId.xitongweihuzhong); |
| | |
| | | public string id = ""; |
| | | public List<Objects> objects = new List<Objects>(); |
| | | public string time_stamp = string.Empty; |
| | | |
| | | |
| | | } |
| | | [Serializable] |
| | | public class Objects |
| | | { |
| | | |
| | | public string sid = string.Empty; |
| | | public string spk = string.Empty; |
| | | public List<Attributes> attributes = new List<Attributes>(); |
| | |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy); |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | Method method = new Method(); |
| | | Method.buttondata = ""; |
| | | PirMethod method = new PirMethod(); |
| | | PirMethod.buttondata = ""; |
| | | cloud = method.MqttDate("按键", control.sid, 25); |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(responsePackNew, ""); |
| | | } |
| | | } |
| | |
| | | editNameFLayout.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | List<string> list = new List<string>(); |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | method.EditControlName(StringId.editName, list, Pir.currPir.name, (name, dialog) => |
| | | { |
| | | Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => |
| | | { |
| | | dialog.Close(); |
| | | editNameFLayout.btnEditText.Text = name; |
| | |
| | | tipPopView.TipBox(StringId.tip, text, (dialog) => |
| | | { |
| | | |
| | | Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => |
| | | PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => |
| | | { |
| | | var pir = Pir.pirDeviceList.Find((c) => c.deviceId == Pir.currPir.deviceId); |
| | | if (pir != null) |
| | |
| | | } |
| | | dialog.Close(); |
| | | this.RemoveFromParent(); |
| | | Method.RemoveView("PirMain"); |
| | | PirMethod.RemoveView("PirMain"); |
| | | }, "删除", "dialog", null, dialog); |
| | | |
| | | }, () => |
| | |
| | | public override void RemoveFromParent() |
| | | { |
| | | //刷新PirMain界面 |
| | | Method.RefreshView("PirMain"); |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | |
| | | } |
| | |
| | | break; |
| | | case 5: |
| | | { |
| | | iconPath = "PirIcon/dvd.png"; |
| | | deviceNameIndex = StringId.dvd; |
| | | iconPath = "PirIcon/projector.png"; |
| | | deviceNameIndex = StringId.touyingyi; |
| | | } |
| | | break; |
| | | case 6: |
| | | { |
| | | iconPath = "PirIcon/projector.png"; |
| | | deviceNameIndex = StringId.touyingyi; |
| | | iconPath = "PirIcon/dvd.png"; |
| | | deviceNameIndex = StringId.dvd; |
| | | } |
| | | break; |
| | | case 7: |
| | |
| | | case 3: |
| | | { |
| | | //风扇 |
| | | // type = "fan-" + SPK.ElectricFan; |
| | | type = "fan-" + SPK.FanIr; |
| | | } |
| | | break; |
| | | case 4: |
| | | { |
| | | //机顶盒 |
| | | // type = "set_top_box-" + SPK.ElectricTV; |
| | | type = "set_top_box-" + SPK.StbIr; |
| | | } |
| | | break; |
| | | case 5: |
| | | { |
| | | //影碟机 |
| | | // type = "dvd-" + SPK.ElectricTV; |
| | | //投影仪 |
| | | type = "projector-" + SPK.PjtIr; |
| | | } |
| | | break; |
| | | case 6: |
| | | { |
| | | //投影仪 |
| | | // type = "projector-" + SPK.ElectricTV; |
| | | //影碟机 |
| | | type = "dvd-" + SPK.DvDIr; |
| | | |
| | | } |
| | | break; |
| | | |
| | | |
| | | } |
| | | return type; |
| | | } |
| | |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(72), |
| | | Width = Application.GetRealWidth(120), |
| | | Width = Application.GetRealWidth(120+80), |
| | | Height = Application.GetRealHeight(20), |
| | | //Text = pirDevice.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | { |
| | | EnergyRow(energy, energyListView, index); |
| | | index++; |
| | | DriverLayer.Control.Ins.SendReadCommand(energy); |
| | | Control.Ins.SendReadCommand(energy); |
| | | } |
| | | |
| | | |
| | |
| | | Action backAction = () => |
| | | { |
| | | btnName.Text = energy.name; |
| | | btnFromFloor.Text = energy.GetRoomListName(); |
| | | }; |
| | | var infoView = new FunctionBaseInfoSetPage(energy, backAction); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "--°C", |
| | | Text = $"{MainPage.cityInfo.highestTemperature}°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUpperLimitText); |
| | | |
| | |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "--°C", |
| | | Text = $"{MainPage.cityInfo.lowestTemperature}°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempLowerLimitText); |
| | | |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (bodyView != null) |
| | | try |
| | | { |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | if (bodyView != null) |
| | | { |
| | | var sensorTag = updateTemp.sid; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | if (view.Tag.ToString() != sensorTag) |
| | | var sensorTag = updateTemp.sid; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | if (view.Tag.ToString() != sensorTag) |
| | | { |
| | | if (btn.Tag != null) |
| | | continue; |
| | | } |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | { |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | if (btn.Tag != null) |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }catch(Exception ex ) |
| | | { |
| | | MainPage.Log($"更新环境传感器界面异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | tipTextView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(43), |
| | | TextID = StringId.ExtremelyCold, |
| | | TextID = StringId.SlightlyCold, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | tipValuesView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(151), |
| | | Text = "70", |
| | | Text = "40%", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | tipValuesView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(151), |
| | | Text = "40", |
| | | Text = "70%", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | tipTextView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(101), |
| | | TextID = StringId.SensorReferenceTVOCTipLevel1, |
| | | TextID = StringId.SensorReferenceHumidityTipLevel1, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | tipTextView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(101), |
| | | TextID = StringId.SensorReferenceTVOCTipLevel2, |
| | | TextID = StringId.SensorReferenceHumidityTipLevel2, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | tipTextView.AddChidren(new Button() |
| | | { |
| | | Width = Application.GetRealWidth(101), |
| | | TextID = StringId.SensorReferenceTVOCTipLevel3, |
| | | TextID = StringId.SensorReferenceHumidityTipLevel3, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | }; |
| | | energyView1.AddChidren(btnEnergyText1); |
| | | |
| | | |
| | | double realTimePower = 0; |
| | | double.TryParse(function.GetAttrState(FunctionAttributeKey.Power), out realTimePower); |
| | | realTimePower /= 1000; |
| | | |
| | | var energyValue1 = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(355), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = function.GetAttrState(FunctionAttributeKey.Power) + "kW", |
| | | Text = realTimePower + "kW", |
| | | }; |
| | | energyView1.AddChidren(energyValue1); |
| | | |
| | |
| | | }; |
| | | energyView2.AddChidren(btnEnergyText2); |
| | | |
| | | var energyValue2 = new Button() |
| | | var btnEnergyValue2 = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(355), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = "--kW", |
| | | }; |
| | | energyView2.AddChidren(energyValue2); |
| | | energyView2.AddChidren(btnEnergyValue2); |
| | | |
| | | energyView2.AddChidren( |
| | | new Button() |
| | |
| | | Height = Application.GetRealHeight(1) |
| | | }); |
| | | |
| | | new System.Threading.Thread(() => { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var data = pm.GetLastMonthHistory(function.deviceId,FunctionAttributeKey.TotalElectricity); |
| | | if(data!= null) |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var data = pm.GetLastMonthHistory(function.deviceId, FunctionAttributeKey.TotalElectricity); |
| | | if (data != null) |
| | | { |
| | | if(data.Code == StateCode.SUCCESS) |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var dataPack = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(data.Data.ToString()); |
| | | if(dataPack!=null) |
| | | if (dataPack != null) |
| | | { |
| | | var dataValue = dataPack.GetValue("property").ToString(); |
| | | if(!string.IsNullOrEmpty(dataValue)) |
| | | try |
| | | { |
| | | btnEnergyText2.Text = dataValue + "kW"; |
| | | var dataValue = dataPack.GetValue("monthDiff").ToString(); |
| | | if (!string.IsNullOrEmpty(dataValue)) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnEnergyValue2.Text = dataValue + "kW‧h"; |
| | | }); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) { IsBackground = true }.Start(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | PirMethod method = new PirMethod(); |
| | | //自定义错误提示文本 |
| | | string eorroText = ""; |
| | | if (str == "获取可视对讲") |
| | |
| | | Height = Application.GetRealHeight(32), |
| | | Width = Application.GetRealWidth(82+5), |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize =20,//24 |
| | | TextSize =18,//24 |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | Text = str1, |