16个文件已添加
3个文件已删除
38个文件已修改
| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.26569F89-0BA9-4C06-81F2-764A3AF2E1B7" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL-ON_Android/Application.cs"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI0-Public/TopViewDiv.cs" Line="151" Column="14" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttInfoConfig.cs" /> |
| | | <File FileName="HDL_ON/Common/FileUtlis.cs" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" /> |
| | | <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="176" Column="1" /> |
| | | <File FileName="HDL_ON/Common/ApiUtlis.cs" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/AppUnlockPage.cs" Line="8" Column="31" /> |
| | | <File FileName="HDL-ON_Android/Application.cs" Line="329" Column="58" /> |
| | | <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" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="DAL" expanded="True" /> |
| | | <Node name="Entity" 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> |
| | | <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="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <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> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Application.cs" selected="True" /> |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Electrical" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <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> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <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/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/3-Intelligence/Scene/SceneAddPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" line="822" 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" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 73=Floor Management |
| | | 74=Room Management |
| | | 75=Administrator migration |
| | | 76=Administrator privilege migration |
| | | 76=Privilege Migration |
| | | 77=Debugging privilege |
| | | 78=The administrator is migrated to other user. |
| | | 79=All of the data for the residence is migrated to new user. |
| | |
| | | 453=Alarm mute |
| | | 454=Deployment information |
| | | 455=The name can not be blank. |
| | | 456=Canvas |
| | | 457=Energy consumption |
| | | 458=Date |
| | | 459=Real time energy consumption |
| | | 460=Energy consumption of this month |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 453=报警静音 |
| | | 454=布防信息 |
| | | 455=名称不能为空。 |
| | | |
| | | 456=画布 |
| | | 457=能耗 |
| | | 458=日期 |
| | | 459=实时能耗 |
| | | 460=本月能耗 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Music\MusicIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Music\MusicOnIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\FanIconBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\TVIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\FanThinIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\FanIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\FanIconOnBg.png" /> |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Curtain\CurtainUpIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Curtain\CurtainUpIconOn.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\SmartSpeaker.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\irpjt.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\irstb.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irpjt_blue.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irpjt_white.png" /> |
| | | <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" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | <CodesignProvision>On+Dev-20210510-1</CodesignProvision> |
| | | <CodesignProvision>On+Dev-20210519-1</CodesignProvision> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | | <DebugType>none</DebugType> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\TV\PlusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\TV\ReduceIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\TVThinIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\TVIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\SmogIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\LocationIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\UpArrow.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Curtain\CurtainUpIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Curtain\CurtainUpIconOn.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\SmartSpeaker.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irpjt_blue.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irpjt_white.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irstb_blue.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irstb_white.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\irpjt.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\irstb.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Energy\EnergyDrodUpIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 453=Alarm mute |
| | | 454=Deployment information |
| | | 455=The name can not be blank. |
| | | |
| | | 456=Canvas |
| | | 457=Energy consumption |
| | | 458=Date |
| | | 459=Real time energy consumption |
| | | 460=Energy consumption of this month |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 453=报警静音 |
| | | 454=布防信息 |
| | | 455=名称不能为空。 |
| | | |
| | | 456=画布 |
| | | 457=能耗 |
| | | 458=日期 |
| | | 459=实时能耗 |
| | | 460=本月能耗 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 本月能耗 |
| | | /// </summary> |
| | | public const int EnergyConsumptionOfThisMonth = 460; |
| | | /// <summary> |
| | | /// 实时能耗 |
| | | /// </summary> |
| | | public const int RealTimeEnergyConsumption=459; |
| | | /// <summary> |
| | | /// 日期 |
| | | /// </summary> |
| | | public const int Date = 458; |
| | | /// <summary> |
| | | /// 能耗 |
| | | /// </summary> |
| | | public const int EnergyConsumption = 457; |
| | | /// <summary> |
| | | /// 画布 |
| | | /// </summary> |
| | | public const int Canvas = 456; |
| | | /// <summary> |
| | | /// 名称不能为空 |
| | | /// </summary> |
| | | public const int NameCannotBeEmpty = 455; |
| | | /// <summary> |
| | | /// 布防信息 |
| | |
| | | |
| | | string sendDataString = topicString + lengthString + bodyDataString; |
| | | byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString); |
| | | //MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n"); |
| | | MainPage.Log($"转换HDL-Link数据\r\n{sendDataString}\r\n"); |
| | | |
| | | return sendDataBytes; |
| | | } |
| | |
| | | { |
| | | Ins.GatewayId = device.device_mac; |
| | | } |
| | | reportIp = "239.0.168.188";// device.ip_address; |
| | | reportIp = "239.0.168.188";// device.ip_address;//主播地址也能控制设备 |
| | | } |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" || |
| | |
| | | Function localObj = null; |
| | | switch (localFunction.spk) |
| | | { |
| | | case SPK.ElectricEnergy: |
| | | EnergyMainPage.UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.LightSwitch: |
| | | RelayPage.UpdataState(localFunction); |
| | | break; |
| | |
| | | |
| | | try |
| | | { |
| | | //MainPage.Log("发送数据:" + SendFlag); |
| | | MainPage.Log("发送数据:" + SendFlag); |
| | | UdpSocket._BusSocket.AsyncBeginSend(packet); |
| | | packet.HaveSendCount--; |
| | | |
| | |
| | | var sendBytes = Control.Ins.ConvertSendBodyData(CommunicationTopic.SearchLoaclGateway, bodyString); |
| | | //组播发送 |
| | | packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("239.0.168.188"), 8585)); |
| | | packet.HaveSendCount = 4;//ps:没有重发,后期有时间可以增加重发判断 |
| | | packet.HaveSendCount = 4; |
| | | System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount)); |
| | | thread.IsBackground = true; |
| | | thread.Start(packet); |
| | | //wait();不需要等待 |
| | | |
| | | |
| | | |
| | | |
| | | //hjSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
| | | //hjSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); |
| | | //EndPoint ipep = new IPEndPoint(IPAddress.Parse(CsConst.myLocalIP), HDLUDP.UDPPort); |
| | | //hjSocket.Bind(ipep); |
| | | |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | busSocket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
| | | busSocket.EnableBroadcast = true; |
| | | try { |
| | | //busSocket.Bind (new IPEndPoint (IPAddress.Any, 6000)); |
| | | busSocket.Bind(new IPEndPoint(IPAddress.Any, Port)); |
| | | busSocket.Bind(new IPEndPoint(IPAddress.Any, Port)); |
| | | |
| | | busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188"))); |
| | | busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188"))); |
| | | } |
| | | catch{ |
| | | busSocket = null; |
| | |
| | | { |
| | | try |
| | | { |
| | | System.Threading.Thread.Sleep(500); |
| | | System.Threading.Thread.Sleep(2000); |
| | | //进入后台不处理 |
| | | if (MainPage.IsEnterBackground) continue; |
| | | if (MqttInfoConfig.Current.HomeGatewayInfo == null) |
| | |
| | | catch (Exception ex) |
| | | { |
| | | Utlis.WriteLine($"error:" + ex.Message); |
| | | //mqtt连接异常,清空本地mqtt信息,可能需要重新获取:wxr |
| | | MqttInfoConfig.Current.Refresh(); |
| | | } |
| | | finally |
| | | { |
| | |
| | | //重新中心服务器获取参数标记 |
| | | MqttInfoConfig.Current.IfGetMqttInfoSuccess = false; |
| | | Console.WriteLine("Connect error: " + ex.Message); |
| | | //mqtt连接异常,清空本地mqtt信息,可能需要重新获取:wxr |
| | | MqttInfoConfig.Current.Refresh(); |
| | | } |
| | | finally |
| | | { |
| | |
| | | public void Refresh() |
| | | { |
| | | m_Current = null; |
| | | Save(); |
| | | Common.FileUtlis.Files.DeleteFile(ConfigFile); |
| | | //Save(); |
| | | } |
| | | |
| | | public void Save() |
| | |
| | | d.Add("type", qType); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId ); |
| | | d.Add("key", "value" ); |
| | | d.Add("key", deviceKey ); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson); |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 读取最近一个月的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetLastMonthHistory(string deviceId,string key) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("key", key); |
| | | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetSpeakerObj |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_List_Get, requestJson); |
| | | } |
| | |
| | | public ResponsePackNew GetSpeakerDeviceList(int getType, string tokenId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("tokenId", tokenId); |
| | | if (getType > 0) |
| | | { |
| | |
| | | /// 获取安防传感器历史数据 |
| | | /// </summary> |
| | | public const string Api_Post_ArmSensorHistoricalData = "/home-wisdom/app/device/message"; |
| | | /// <summary> |
| | | /// 读取最近一个月的数据 |
| | | /// </summary> |
| | | public const string Api_Post_SensorLastMonthHistoricalData = "/home-wisdom/app/statistics/device/monthDiff"; |
| | | #endregion |
| | | |
| | | #region Kaede -- 场景接口____________________________ |
| | |
| | | /// <returns>修改结果</returns> |
| | | public bool SetAttrState(string key, object value) |
| | | { |
| | | //var attrState = status.Find((s) => s.key == key.ToString()); |
| | | var attr = attributes.Find((s) => s.key == key); |
| | | if (attr == null) |
| | | { |
| | |
| | | /// </summary> |
| | | public const string TuyaWaterTime = "countdown_1"; |
| | | #endregion |
| | | /// <summary> |
| | | /// 功率 |
| | | /// </summary> |
| | | public const string Power = "power"; |
| | | /// <summary> |
| | | /// 总电量 |
| | | /// </summary> |
| | | public const string TotalElectricity = "total_electricity"; |
| | | |
| | | |
| | | } |
| | |
| | | /// 能源模块 |
| | | /// </summary> |
| | | public const string EnergyStandard = "energy.standard"; |
| | | |
| | | /// <summary> |
| | | /// 能源-电能 |
| | | /// </summary> |
| | | public const string ElectricEnergy = "energy.electric"; |
| | | /// <summary> |
| | | /// 能源spk列表 |
| | | /// </summary> |
| | |
| | | public static List<string> EnergySpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(EnergyStandard); |
| | | spkList.Add(ElectricEnergy); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | |
| | | /// 红外遥控器 |
| | | /// </summary> |
| | | public const string IrLearn = "ir.learn"; |
| | | /// <summary> |
| | | /// 红外投影仪 |
| | | /// </summary> |
| | | public const string PjtIr = "ir.pjt"; |
| | | /// <summary> |
| | | /// 红外机顶盒 |
| | | /// </summary> |
| | | public const string StbIr = "ir.stb"; |
| | | /// <summary> |
| | | /// 红外影碟机 |
| | | /// </summary> |
| | | public const string DvDIr = "ir.dvd"; |
| | | /// <summary> |
| | | /// 红外空气净化器 |
| | | /// </summary> |
| | | public const string PurifierIr = "ir.air_purifier"; |
| | | /// <summary> |
| | | /// 红外热水器 |
| | | /// </summary> |
| | | public const string HeaterIr = " ir.water_heater"; |
| | | /// <summary> |
| | | /// 红外风扇 |
| | | /// </summary> |
| | | public const string FanIr = "ir.fan"; |
| | | |
| | | #region 涂鸦 |
| | | /// <summary> |
| | |
| | | spkList.Add(ElectricFan); |
| | | spkList.Add(ClothesHanger); |
| | | spkList.Add(IrLearn); |
| | | spkList.Add(PjtIr); |
| | | spkList.Add(StbIr); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 设备类 |
| | | /// <summary> |
| | | /// 红外宝 |
| | |
| | | /// </summary> |
| | | public string delay = "0"; |
| | | /// <summary> |
| | | /// 场景的最好一次执行时间 |
| | | /// 场景的最后一次执行时间 |
| | | /// </summary> |
| | | public string LastExecutionTime = ""; |
| | | |
| | |
| | | /// </summary> |
| | | public string GetDelayText() |
| | | { |
| | | string text = ""; |
| | | var delayInt = 0; |
| | | int.TryParse(delay,out delayInt); |
| | | if(delayInt == 0) |
| | | { |
| | | return Language.StringByID(StringId.NoDelay); |
| | | } |
| | | string text = (delayInt / 60)+Language.StringByID(StringId.m)+(delayInt % 60)+Language.StringByID(StringId.s); |
| | | return text; |
| | | switch (delay) |
| | | { |
| | | case "0": |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage_AddIrButton.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EnergyMainPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\ESOnVideo.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EchartsOption_Energy.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AirFreshControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoSend.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\SmartSpeakerListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\SmartSpeakerSelectDevicesPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\SmartSpeakerRoomListPage.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" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)DAL\" />
|
| | |
| | | { |
| | | if (view != null) |
| | | { |
| | | view.RemoveFromParent(); |
| | | if(view.Tag.ToString() != "unlockpage") |
| | | { |
| | | view.RemoveFromParent(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | |
| | | /// 场景延时设置弹窗 |
| | | /// </summary> |
| | | /// <param name="function"></param> |
| | | public void SetSceneDelayDialog(Dictionary<string,string>items, Action<string> action,string curItemKey) |
| | | public void SetSceneDelayDialog(Action<string> action,string curItemKey)//Dictionary<string,string>items, |
| | | { |
| | | Button lastButton = new Button(); |
| | | Dialog dialog = new Dialog(); |
| | | var pView = new FrameLayout() |
| | | List<int> mRange = new List<int>(); |
| | | List<int> sRange = new List<int>(); |
| | | for (int i = 0; i <= 59; i++) |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(pView); |
| | | |
| | | var itemCount = items.Count; |
| | | var optionBaseViewHeight = ((itemCount > 3 ? itemCount : 3) + 1) * Application.GetRealHeight(50); |
| | | var optionBaseView = new FrameLayout() |
| | | { |
| | | //Y = Application.GetRealHeight(439), |
| | | Y = Application.GetRealHeight(647) - optionBaseViewHeight, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | //Height = Application.GetRealHeight(208), |
| | | Height = optionBaseViewHeight, |
| | | //AnimateSpeed = 0.3f, |
| | | //Animate = Animate.DownToUp, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | pView.AddChidren(optionBaseView); |
| | | |
| | | var topView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | optionBaseView.AddChidren(topView); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextAlignment = TextAlignment.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | TextID = StringId.SceneDelay, |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | topView.AddChidren(btnTitle); |
| | | |
| | | var btnCancel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(21), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Cancel, |
| | | }; |
| | | topView.AddChidren(btnCancel); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | X = Application.GetRealWidth(160), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Confirm, |
| | | }; |
| | | topView.AddChidren(btnConfrim); |
| | | |
| | | var itemsView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = topView.Bottom, |
| | | Height = optionBaseViewHeight - Application.GetRealHeight(50), |
| | | ScrollEnabled = itemCount > 4, |
| | | }; |
| | | optionBaseView.AddChidren(itemsView); |
| | | |
| | | bool isFrist = true; |
| | | Button btnLastSelectedTip = null; |
| | | |
| | | foreach (var item in items) |
| | | { |
| | | if (isFrist) |
| | | { |
| | | isFrist = false; |
| | | } |
| | | else |
| | | { |
| | | itemsView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | var row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | itemsView.AddChidren(row); |
| | | |
| | | var btnTipSelected = new Button() |
| | | { |
| | | X = Application.GetRealWidth(303), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(28), |
| | | Height= Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | }; |
| | | row.AddChidren(btnTipSelected); |
| | | if( item.Key == curItemKey) |
| | | { |
| | | btnTipSelected.IsSelected = true; |
| | | btnLastSelectedTip = btnTipSelected; |
| | | } |
| | | |
| | | |
| | | var btnRowTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Text = item.Value, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | row.AddChidren(btnRowTitle); |
| | | |
| | | btnRowTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (btnTipSelected.IsSelected) |
| | | { |
| | | curItemKey = "0"; |
| | | btnTipSelected.IsSelected = false; |
| | | btnLastSelectedTip = null; |
| | | } |
| | | else |
| | | { |
| | | curItemKey = item.Key; |
| | | if (btnLastSelectedTip != null) |
| | | { |
| | | btnLastSelectedTip.IsSelected = false; |
| | | } |
| | | btnTipSelected.IsSelected = true; |
| | | btnLastSelectedTip = btnTipSelected; |
| | | } |
| | | }; |
| | | |
| | | mRange.Add(i); |
| | | sRange.Add(i); |
| | | } |
| | | sRange.Add(60); |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(mRange, sRange, 5, Language.StringByID(StringId.SceneDelay)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 0, 262, false); |
| | | //timeControl.ChangePickerEvent2(); |
| | | timeControl.FinishEvent = (type, hours, min) => |
| | | { |
| | | if(type == 1) |
| | | { |
| | | curItemKey = (hours * 60 + min).ToString(); |
| | | action(curItemKey); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | return; |
| | | |
| | | // Button lastButton = new Button(); |
| | | //Dialog dialog = new Dialog(); |
| | | //var pView = new FrameLayout() |
| | | //{ |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | //}; |
| | | //dialog.AddChidren(pView); |
| | | |
| | | //var itemCount = items.Count; |
| | | //var optionBaseViewHeight = ((itemCount > 3 ? itemCount : 3) + 1) * Application.GetRealHeight(50); |
| | | //var optionBaseView = new FrameLayout() |
| | | //{ |
| | | // //Y = Application.GetRealHeight(439), |
| | | // Y = Application.GetRealHeight(647) - optionBaseViewHeight, |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // //Height = Application.GetRealHeight(208), |
| | | // Height = optionBaseViewHeight, |
| | | // //AnimateSpeed = 0.3f, |
| | | // //Animate = Animate.DownToUp, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | //}; |
| | | //pView.AddChidren(optionBaseView); |
| | | |
| | | //var topView = new FrameLayout() |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | //}; |
| | | //optionBaseView.AddChidren(topView); |
| | | |
| | | //var btnTitle = new Button() |
| | | //{ |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextID = StringId.SceneDelay, |
| | | // IsBold = true, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | //}; |
| | | //topView.AddChidren(btnTitle); |
| | | |
| | | //var btnCancel = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(21), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Cancel, |
| | | //}; |
| | | //topView.AddChidren(btnCancel); |
| | | |
| | | //var btnConfrim = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(160), |
| | | // Width = Application.GetRealWidth(160), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Confirm, |
| | | //}; |
| | | //topView.AddChidren(btnConfrim); |
| | | |
| | | //var itemsView = new VerticalScrolViewLayout() |
| | | //{ |
| | | // Y = topView.Bottom, |
| | | // Height = optionBaseViewHeight - Application.GetRealHeight(50), |
| | | // ScrollEnabled = itemCount > 4, |
| | | //}; |
| | | //optionBaseView.AddChidren(itemsView); |
| | | |
| | | //bool isFrist = true; |
| | | //Button btnLastSelectedTip = null; |
| | | |
| | | //foreach (var item in items) |
| | | //{ |
| | | // if (isFrist) |
| | | // { |
| | | // isFrist = false; |
| | | // } |
| | | // else |
| | | // { |
| | | // itemsView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | // } |
| | | // var row = new FrameLayout() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // }; |
| | | // itemsView.AddChidren(row); |
| | | |
| | | // var btnTipSelected = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(303), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetRealWidth(28), |
| | | // Height= Application.GetRealWidth(28), |
| | | // UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | // SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | // }; |
| | | // row.AddChidren(btnTipSelected); |
| | | // if( item.Key == curItemKey) |
| | | // { |
| | | // btnTipSelected.IsSelected = true; |
| | | // btnLastSelectedTip = btnTipSelected; |
| | | // } |
| | | |
| | | |
| | | // var btnRowTitle = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(16), |
| | | // Text = item.Value, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // }; |
| | | // row.AddChidren(btnRowTitle); |
| | | |
| | | // btnRowTitle.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // if (btnTipSelected.IsSelected) |
| | | // { |
| | | // curItemKey = "0"; |
| | | // btnTipSelected.IsSelected = false; |
| | | // btnLastSelectedTip = null; |
| | | // } |
| | | // else |
| | | // { |
| | | // curItemKey = item.Key; |
| | | // if (btnLastSelectedTip != null) |
| | | // { |
| | | // btnLastSelectedTip.IsSelected = false; |
| | | // } |
| | | // btnTipSelected.IsSelected = true; |
| | | // btnLastSelectedTip = btnTipSelected; |
| | | // } |
| | | // }; |
| | | |
| | | //} |
| | | |
| | | //Button btn1 = new Button() |
| | | //{ |
| | |
| | | |
| | | |
| | | |
| | | dialog.Show(); |
| | | //dialog.Show(); |
| | | |
| | | pView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | //pView.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // dialog.Close(); |
| | | //}; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | action(curItemKey); |
| | | dialog.Close(); |
| | | }; |
| | | //btnCancel.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // dialog.Close(); |
| | | //}; |
| | | //btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // action(curItemKey); |
| | | // dialog.Close(); |
| | | //}; |
| | | //btn1.MouseUpEventHandler = (sender, e) => { |
| | | // btn1.IsSelected = !btn1.IsSelected; |
| | | // btn2.IsSelected = false; |
| | |
| | | MainPage.BasePageView.AddChidren(tvView); |
| | | tvView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.PjtIr://投影仪 |
| | | var pjtView = new PjtPage(function); |
| | | MainPage.BasePageView.AddChidren(pjtView); |
| | | pjtView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.StbIr://机顶盒 |
| | | var stbView = new StbPage(function); |
| | | MainPage.BasePageView.AddChidren(stbView); |
| | | stbView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
| | | break;
|
| | | case SPK.ElectricTuyaAirCleaner: |
| | | var airCleaner = new TuyaAirCleanerPage(); |
| | |
| | | /// <param name="i_hour">默认选择时</param>
|
| | | /// <param name="i_minute">默认选择分</param>
|
| | | /// <param name="contentView">选择区域高度</param>
|
| | | public void InitControl(int i_hour, int i_minute,int contentView = 297)
|
| | | public void InitControl(int i_hour, int i_minute,int contentView = 297,bool isHour = true)
|
| | | {
|
| | | //已经初始化
|
| | | if (base.btnCancel != null) { return; }
|
| | |
| | | base.btnConfirm.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //有选择了才能点确认
|
| | | if (selectHour != 0 || selectMinute != 0)
|
| | | //if (selectHour != 0 || selectMinute != 0)
|
| | | {
|
| | | base.Close();
|
| | | this.FinishEvent?.Invoke(1, selectHour, selectMinute);
|
| | |
| | | var strhour = Language.StringByID(StringId.h);
|
| | | //分
|
| | | var strMinute = Language.StringByID(StringId.m);
|
| | |
|
| | | if(!isHour) |
| | | { |
| | | strhour = Language.StringByID(StringId.m); |
| | | strMinute = Language.StringByID(StringId.s);
|
| | | }
|
| | |
|
| | | //XX时
|
| | | listHour = new List<string>();// { "00" + strhour };
|
| | | //XX分
|
| | |
| | | value2 = 0; |
| | | pickerView.setCurrentItems(value1, value2, 0); |
| | | } |
| | | else |
| | | //else |
| | | { |
| | | //更改索引 |
| | | selectHour = Convert.ToInt32(listHour[value1].Substring(0, 2)); |
| | | selectMinute = Convert.ToInt32(listMinute[value2].Substring(0, 2)); |
| | | }
|
| | | }; |
| | | }
|
| | | } |
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | MainPage.Log($"HomePage LoadPage Error : {ex.Message}"); |
| | | } |
| | | |
| | | |
| | | #if DEBUG |
| | | FunctionList.List.Functions.Add(new Function() { spk = SPK.PjtIr, name = "测试投影仪", |
| | | attributes = new List<FunctionAttributes>() { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | new FunctionAttributes(){ key = "computer",value = new List<string>(){"电脑" } }, |
| | | new FunctionAttributes(){ key = "video",value = new List<string>(){"视频" } }, |
| | | new FunctionAttributes(){ key = "source",value = new List<string>(){"信号源" } }, |
| | | new FunctionAttributes(){ key = "zoom+",value = new List<string>(){"变焦+" } }, |
| | | new FunctionAttributes(){ key = "zoom-",value = new List<string>(){"变焦-" } }, |
| | | new FunctionAttributes(){ key = "page+",value = new List<string>(){"画面+" } }, |
| | | new FunctionAttributes(){ key = "page-",value = new List<string>(){"画面-" } }, |
| | | new FunctionAttributes(){ key = "menu",value = new List<string>(){"菜单" } }, |
| | | new FunctionAttributes(){ key = "ok",value = new List<string>(){"确认" } }, |
| | | new FunctionAttributes(){ key = "up",value = new List<string>(){"上" } }, |
| | | new FunctionAttributes(){ key = "left",value = new List<string>(){"左" } }, |
| | | new FunctionAttributes(){ key = "right",value = new List<string>(){"右" } }, |
| | | new FunctionAttributes(){ key = "down",value = new List<string>(){"下" } }, |
| | | new FunctionAttributes(){ key = "exit",value = new List<string>(){"退出" } }, |
| | | new FunctionAttributes(){ key = "volume+",value = new List<string>(){"音量+" } }, |
| | | new FunctionAttributes(){ key = "volume-",value = new List<string>(){"音量-" } }, |
| | | new FunctionAttributes(){ key = "mute",value = new List<string>(){"静音" } }, |
| | | new FunctionAttributes(){ key = "auto",value = new List<string>(){"自动" } }, |
| | | new FunctionAttributes(){ key = "pause",value = new List<string>(){"暂停" } }, |
| | | } |
| | | }); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.StbIr, |
| | | name = "测试机顶盒", |
| | | attributes = new List<FunctionAttributes>() { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | new FunctionAttributes(){ key = "computer",value = new List<string>(){"电脑" } }, |
| | | new FunctionAttributes(){ key = "video",value = new List<string>(){"视频" } }, |
| | | new FunctionAttributes(){ key = "source",value = new List<string>(){"信号源" } }, |
| | | new FunctionAttributes(){ key = "zoom+",value = new List<string>(){"变焦+" } }, |
| | | new FunctionAttributes(){ key = "zoom-",value = new List<string>(){"变焦-" } }, |
| | | new FunctionAttributes(){ key = "page+",value = new List<string>(){"画面+" } }, |
| | | new FunctionAttributes(){ key = "page-",value = new List<string>(){"画面-" } }, |
| | | new FunctionAttributes(){ key = "menu",value = new List<string>(){"菜单" } }, |
| | | new FunctionAttributes(){ key = "ok",value = new List<string>(){"确认" } }, |
| | | new FunctionAttributes(){ key = "up",value = new List<string>(){"上" } }, |
| | | new FunctionAttributes(){ key = "left",value = new List<string>(){"左" } }, |
| | | new FunctionAttributes(){ key = "right",value = new List<string>(){"右" } }, |
| | | new FunctionAttributes(){ key = "down",value = new List<string>(){"下" } }, |
| | | new FunctionAttributes(){ key = "exit",value = new List<string>(){"退出" } }, |
| | | new FunctionAttributes(){ key = "volume+",value = new List<string>(){"音量+" } }, |
| | | new FunctionAttributes(){ key = "volume-",value = new List<string>(){"音量-" } }, |
| | | new FunctionAttributes(){ key = "mute",value = new List<string>(){"静音" } }, |
| | | new FunctionAttributes(){ key = "auto",value = new List<string>(){"自动" } }, |
| | | new FunctionAttributes(){ key = "pause",value = new List<string>(){"暂停" } }, |
| | | } |
| | | }); |
| | | |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.TvIr, |
| | | name = "测试电视", |
| | | attributes = new List<FunctionAttributes>() { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | new FunctionAttributes(){ key = "computer",value = new List<string>(){"电脑" } }, |
| | | new FunctionAttributes(){ key = "video",value = new List<string>(){"视频" } }, |
| | | new FunctionAttributes(){ key = "source",value = new List<string>(){"信号源" } }, |
| | | new FunctionAttributes(){ key = "zoom+",value = new List<string>(){"变焦+" } }, |
| | | new FunctionAttributes(){ key = "zoom-",value = new List<string>(){"变焦-" } }, |
| | | new FunctionAttributes(){ key = "page+",value = new List<string>(){"画面+" } }, |
| | | new FunctionAttributes(){ key = "page-",value = new List<string>(){"画面-" } }, |
| | | new FunctionAttributes(){ key = "menu",value = new List<string>(){"菜单" } }, |
| | | new FunctionAttributes(){ key = "ok",value = new List<string>(){"确认" } }, |
| | | new FunctionAttributes(){ key = "up",value = new List<string>(){"上" } }, |
| | | new FunctionAttributes(){ key = "left",value = new List<string>(){"左" } }, |
| | | new FunctionAttributes(){ key = "right",value = new List<string>(){"右" } }, |
| | | new FunctionAttributes(){ key = "down",value = new List<string>(){"下" } }, |
| | | new FunctionAttributes(){ key = "exit",value = new List<string>(){"退出" } }, |
| | | new FunctionAttributes(){ key = "volume+",value = new List<string>(){"音量+" } }, |
| | | new FunctionAttributes(){ key = "volume-",value = new List<string>(){"音量-" } }, |
| | | new FunctionAttributes(){ key = "mute",value = new List<string>(){"静音" } }, |
| | | new FunctionAttributes(){ key = "auto",value = new List<string>(){"自动" } }, |
| | | new FunctionAttributes(){ key = "pause",value = new List<string>(){"暂停" } }, |
| | | } |
| | | }); |
| | | #endif |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载内容区域 |
| | |
| | | }; |
| | | view.AddChidren(btnIcon); |
| | | |
| | | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | |
| | | |
| | | Button btnName; |
| | | btnName = new Button() |
| | | { |
| | |
| | | LoadEvent_ControlCurtain(function, btnCurtainClose, btnCurtainOpen); |
| | | } |
| | | |
| | | else if (function.spk == SPK.ElectricTV || function.spk == SPK.TvIr) |
| | | else if (function.spk == SPK.ElectricTV || function.spk == SPK.TvIr |
| | | ||function.spk == SPK.StbIr || function.spk == SPK.PjtIr) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVIcon.png"; |
| | | |
| | | //btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | //btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; |
| | | |
| | | Button btnPower; |
| | | btnPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(131), |
| | | Y = Application.GetRealHeight(70), |
| | | Y = Application.GetRealHeight(80), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | |
| | | btnIcon.MouseUpEventHandler = skipControlPageEvent; |
| | | btnState.MouseUpEventHandler = skipControlPageEvent; |
| | | //电视不需要更新状态 |
| | | if(function.spk!= SPK.ElectricTV) |
| | | if(function.spk!= SPK.ElectricTV && function.spk != SPK.StbIr && function.spk != SPK.PjtIr) |
| | | { |
| | | UpdataFunctionStates(function); |
| | | } |
| | |
| | | break; |
| | | case ShowFunction.EnergyMonitoring: |
| | | #region 能源 |
| | | functionCount = FunctionList.List.GetElectricals().Count; |
| | | functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | functionCount = FunctionList.List.GetEnergyList().Count; |
| | | functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | #endregion |
| | | //functionCount = 1; |
| | | break; |
| | | case ShowFunction.Environmental: |
| | | #region 环境数据 |
| | |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | IsSelected = scene.collect, |
| | | }; |
| | | //view.AddChidren(btnCollection); |
| | | view.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | view.AddChidren(btnCollection); |
| | | } |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |
| | | // view.AddChidren(btnCollection); |
| | | //} |
| | | btnCollection.MouseUpEventHandler = (sender, e) => { |
| | | scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected; |
| | | scene.CollectScene(); |
| | |
| | | items.Add("60", "1min"); |
| | | items.Add("120", "2min"); |
| | | items.Add("300", "5min"); |
| | | new PublicAssmebly().SetSceneDelayDialog(items, action ,scene.delay); |
| | | new PublicAssmebly().SetSceneDelayDialog( action ,scene.delay); |
| | | |
| | | |
| | | }; |
| | | |
| | | contentView.AddChidren(new Button() |
| | |
| | | items.Add("60", "1min"); |
| | | items.Add("120", "2min"); |
| | | items.Add("300", "5min"); |
| | | new PublicAssmebly().SetSceneDelayDialog(items,action,scene.delay); |
| | | new PublicAssmebly().SetSceneDelayDialog(action,scene.delay); |
| | | }; |
| | | |
| | | contentView.AddChidren(new Button() |
| | |
| | | items.Add("60", "1min"); |
| | | items.Add("120", "2min"); |
| | | items.Add("300", "5min"); |
| | | new PublicAssmebly().SetSceneDelayDialog(items,action,sceneFunction.delay); |
| | | new PublicAssmebly().SetSceneDelayDialog(action, sceneFunction.delay); |
| | | }; |
| | | #endregion |
| | | |
| | |
| | | |
| | | |
| | | #region 智能音箱 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | //supportView 加高 显示3行 3*44 |
| | | supportView.Height = Application.GetRealWidth(3*44); |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = DB_ResidenceData.Instance.CurrentRegion.Name, |
| | | Text = DB_ResidenceData.Instance.CurrentRegion.homeName, |
| | | }; |
| | | titleView.AddChidren(btnHomeTitle); |
| | | |
| | |
| | | public AppUnlockGesturePage(string pw, Action action) |
| | | { |
| | | bodyView = this; |
| | | bodyView.Tag = "unlockpage"; |
| | | oldPasswrod = pw; |
| | | backAction = action; |
| | | } |
| | |
| | | public AppUnlockPasswordPage(string pw, Action action) |
| | | { |
| | | bodyView = this; |
| | | bodyView.Tag = "unlockpage"; |
| | | oldPasswrod = pw; |
| | | backAction = action; |
| | | } |
| | |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载额外对红外按钮界面 |
| | | /// </summary> |
| | |
| | | { |
| | | lightingView.SetViewStatus(lightTemp.state == "on"); |
| | | } |
| | | MainPage.Log($"时间戳:{device.time_stamp} 时间:{device.GeteTime()} 烘干:{hotDryTemp.state} 风干:{windDryTemp.state} 消毒:{disinfectTemp.state} 灯光状态:{lightTemp.state}"); |
| | | //MainPage.Log($"时间戳:{device.time_stamp} 时间:{device.GeteTime()} 烘干:{hotDryTemp.state} 风干:{windDryTemp.state} 消毒:{disinfectTemp.state} 灯光状态:{lightTemp.state}"); |
| | | #endregion |
| | | |
| | | #region 修改时间 |
| | |
| | | using System; |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Electrical |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class DvdPage |
| | | public class DvdPage : FrameLayout |
| | | { |
| | | public DvdPage() |
| | | #region 控件集合 |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 功能名称按钮 |
| | | /// </summary> |
| | | Button btnFunctionName; |
| | | /// <summary> |
| | | /// 房间楼层信息按钮 |
| | | /// </summary> |
| | | Button btnFromFoorAndRoom; |
| | | /// <summary> |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollection; |
| | | |
| | | Button btnChangeTVAV; |
| | | FrameLayout topMenuView; |
| | | Button btnTopMenuUp; |
| | | Button btnTopMenuLeft; |
| | | Button btnTopMenuRight; |
| | | Button btnTopMenuDown; |
| | | Button btnOk; |
| | | FrameLayout channleView; |
| | | Button btnChlReduce; |
| | | Button btnChlPlus; |
| | | FrameLayout volView; |
| | | Button btnVolReduce; |
| | | Button btnVolPlus; |
| | | Button btnBack; |
| | | Button btnMenu; |
| | | Button btn123; |
| | | Button btnMute; |
| | | Button btnPower; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | TV tvTemp = new TV(); |
| | | Function function; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | |
| | | public DvdPage(Function func) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | } |
| | | |
| | | |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | btnCollection_Out = btnCollectionIcon; |
| | | btnFunctionName_Out = btnFunctionNameOut; |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | |
| | | FrameLayout controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | bodyView.AddChidren(controlView); |
| | | |
| | | btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(37), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = function.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | | btnFromFoorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnFunctionName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | | btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | |
| | | #region 轮盘控制区域 |
| | | topMenuView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(88), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(199), |
| | | Height = Application.GetRealWidth(199), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png", |
| | | }; |
| | | controlView.AddChidren(topMenuView); |
| | | |
| | | btnTopMenuUp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuUp); |
| | | |
| | | btnTopMenuLeft = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuLeft); |
| | | |
| | | btnTopMenuRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuRight); |
| | | |
| | | btnTopMenuDown = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuDown); |
| | | |
| | | btnOk = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(100), |
| | | }; |
| | | topMenuView.AddChidren(btnOk); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 频道音量调节 |
| | | channleView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(channleView); |
| | | |
| | | btnChlPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlPlus); |
| | | |
| | | Button btnChlText; |
| | | btnChlText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Chl, |
| | | }; |
| | | channleView.AddChidren(btnChlText); |
| | | |
| | | btnChlReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlReduce); |
| | | |
| | | volView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(257), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(volView); |
| | | |
| | | btnVolPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolPlus); |
| | | |
| | | Button btnVolText; |
| | | btnVolText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Vol, |
| | | }; |
| | | volView.AddChidren(btnVolText); |
| | | |
| | | btnVolReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolReduce); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 底部控制区域 |
| | | btnBack = new Button() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVBackIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnBack); |
| | | |
| | | btnChangeTVAV = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVAV.png", |
| | | }; |
| | | controlView.AddChidren(btnChangeTVAV); |
| | | |
| | | btn123 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TV123Icon.png", |
| | | }; |
| | | controlView.AddChidren(btn123); |
| | | |
| | | btnMute = new Button() |
| | | { |
| | | X = Application.GetRealWidth(244), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMuteIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMute); |
| | | |
| | | btnMenu = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | |
| | | btnPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVPowerIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnPower); |
| | | |
| | | #endregion |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(function, actionRefresh); |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 投影仪页面 |
| | | /// </summary> |
| | | public class PjtPage : FrameLayout |
| | | { |
| | | #region 控件集合 |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 功能名称按钮 |
| | | /// </summary> |
| | | Button btnFunctionName; |
| | | /// <summary> |
| | | /// 房间楼层信息按钮 |
| | | /// </summary> |
| | | Button btnFromFoorAndRoom; |
| | | /// <summary> |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollection; |
| | | |
| | | FrameLayout topMenuView; |
| | | Button btnTopMenuUp; |
| | | Button btnTopMenuLeft; |
| | | Button btnTopMenuRight; |
| | | Button btnTopMenuDown; |
| | | Button btnOk; |
| | | FrameLayout channleView; |
| | | Button btnChlReduce; |
| | | Button btnChlPlus; |
| | | FrameLayout volView; |
| | | Button btnVolReduce; |
| | | Button btnVolPlus; |
| | | Button btnBack; |
| | | Button btnMenu; |
| | | Button btnMore; |
| | | Button btnPower; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | //TV tvTemp = new TV(); |
| | | Function device; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | |
| | | public PjtPage(Function func) |
| | | { |
| | | bodyView = this; |
| | | device = func; |
| | | } |
| | | |
| | | |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | btnCollection_Out = btnCollectionIcon; |
| | | btnFunctionName_Out = btnFunctionNameOut; |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | |
| | | FrameLayout controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | bodyView.AddChidren(controlView); |
| | | |
| | | btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(37), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = device.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | | btnFromFoorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnFunctionName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = device.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | | btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = device.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | |
| | | #region 轮盘控制区域 |
| | | topMenuView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(88), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(199), |
| | | Height = Application.GetRealWidth(199), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png", |
| | | }; |
| | | controlView.AddChidren(topMenuView); |
| | | |
| | | btnTopMenuUp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuUp); |
| | | |
| | | btnTopMenuLeft = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuLeft); |
| | | |
| | | btnTopMenuRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuRight); |
| | | |
| | | btnTopMenuDown = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuDown); |
| | | |
| | | btnOk = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(100), |
| | | }; |
| | | topMenuView.AddChidren(btnOk); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 频道音量调节 |
| | | channleView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(channleView); |
| | | |
| | | btnChlPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlPlus); |
| | | |
| | | Button btnChlText; |
| | | btnChlText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Canvas, |
| | | }; |
| | | channleView.AddChidren(btnChlText); |
| | | |
| | | btnChlReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlReduce); |
| | | |
| | | volView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(257), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(volView); |
| | | |
| | | btnVolPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolPlus); |
| | | |
| | | Button btnVolText; |
| | | btnVolText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Vol, |
| | | }; |
| | | volView.AddChidren(btnVolText); |
| | | |
| | | btnVolReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolReduce); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 底部控制区域 |
| | | btnBack = new Button() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVBackIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnBack); |
| | | |
| | | |
| | | btnMenu = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | |
| | | btnMore = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/AC/More.png", |
| | | }; |
| | | controlView.AddChidren(btnMore); |
| | | |
| | | btnMore.MouseUpEventHandler = (sender, e) => { |
| | | LoadDialog_IrMoreView(); |
| | | }; |
| | | |
| | | btnPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(244), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVPowerIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnPower); |
| | | |
| | | #endregion |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(device, actionRefresh); |
| | | DriverLayer.Control.Ins.SendReadCommand(device); |
| | | |
| | | LoadEventList(); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载额外对红外按钮界面 |
| | | /// </summary> |
| | | void LoadDialog_IrMoreView() |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | var div = new FrameLayout(); |
| | | dialog.AddChidren(div); |
| | | div.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var bodyView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(427),//667 |
| | | Height = Application.GetRealHeight(240), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | div.AddChidren(bodyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(296 + 200), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | var row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(296), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | |
| | | int index = 0; |
| | | List<FunctionAttributes> attrList = new List<FunctionAttributes>(); |
| | | attrList.AddRange(device.attributes); |
| | | attrList.Add(new FunctionAttributes() |
| | | { |
| | | key = "+", |
| | | }); |
| | | |
| | | foreach (var attr in attrList) |
| | | { |
| | | if (attr.key == "up" |
| | | || attr.key == "down" |
| | | || attr.key == "right" |
| | | || attr.key == "left" |
| | | || attr.key == "zoom+" |
| | | || attr.key == "zoom-" |
| | | || attr.key == "volume+" |
| | | || attr.key == "volume-" |
| | | || attr.key == "back" |
| | | || attr.key == "menu" |
| | | || attr.key == FunctionAttributeKey.OnOff |
| | | ) |
| | | { |
| | | continue; |
| | | } |
| | | if (index != 0 && index % 3 == 0) |
| | | { |
| | | row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(56), |
| | | Width = Application.GetRealWidth(296), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | } |
| | | if (attr.key == "+") |
| | | { |
| | | var addView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(88), |
| | | Height = Application.GetRealHeight(40), |
| | | Radius = (uint)Application.GetRealHeight(18), |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | BorderWidth = (uint)Application.GetRealWidth(2), |
| | | }; |
| | | |
| | | |
| | | if (index % 3 == 1) |
| | | { |
| | | addView.Gravity = Gravity.Center; |
| | | } |
| | | else if (index % 3 == 2) |
| | | { |
| | | addView.X = Application.GetRealWidth(208); |
| | | } |
| | | row.AddChidren(addView); |
| | | |
| | | var btnAdd = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | UnSelectedImagePath = "Public/PlusSignIcon.png", |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | }; |
| | | addView.AddChidren(btnAdd); |
| | | |
| | | btnAdd.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | Action action = () => { |
| | | LoadDialog_IrMoreView(); |
| | | }; |
| | | var addButton = new AcControlPage_AddIrButton(action); |
| | | MainPage.BasePageView.AddChidren(addButton); |
| | | addButton.Show(device); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | var btn = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(88), |
| | | Height = Application.GetRealHeight(40), |
| | | Radius = (uint)Application.GetRealHeight(18), |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | BorderWidth = (uint)Application.GetRealWidth(2), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | }; |
| | | if (attr.value.Count > 0) |
| | | { |
| | | btn.Text = attr.value[0]; |
| | | } |
| | | if (index % 3 == 1) |
| | | { |
| | | btn.Gravity = Gravity.Center; |
| | | } |
| | | else if (index % 3 == 2) |
| | | { |
| | | btn.X = Application.GetRealWidth(208); |
| | | } |
| | | row.AddChidren(btn); |
| | | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(attr.key, ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btn.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | index++; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | | /// </summary> |
| | | void LoadEventList() |
| | | { |
| | | LoadControlEvent(); |
| | | LoadCollectionEvent(); |
| | | |
| | | //回退刷新信息事件 |
| | | actionRefresh = () => { |
| | | btnFunctionName.Text = btnFunctionName_Out.Text = device.name; |
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = device.GetRoomListName(); |
| | | device.UpdataFuncitonInfo(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏功能按钮事件 |
| | | /// </summary> |
| | | void LoadCollectionEvent() |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = device.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | device.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载控制事件 |
| | | /// </summary> |
| | | void LoadControlEvent() |
| | | { |
| | | |
| | | btnChlPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch+", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnChlReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch-", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnVolPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume+", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnVolReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume-", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnBack.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("return", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("menu", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | |
| | | btnTopMenuUp.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("up", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("left", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnTopMenuRight.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("right", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnTopMenuDown.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("down", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | btnOk.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ok", ""); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class StbPage : FrameLayout |
| | | { |
| | | #region 控件集合 |
| | | StbPage bodyView; |
| | | /// <summary> |
| | | /// 功能名称按钮 |
| | | /// </summary> |
| | | Button btnFunctionName; |
| | | /// <summary> |
| | | /// 房间楼层信息按钮 |
| | | /// </summary> |
| | | Button btnFromFoorAndRoom; |
| | | /// <summary> |
| | | /// 收藏按钮 |
| | | /// </summary> |
| | | Button btnCollection; |
| | | |
| | | Button btnMenu; |
| | | FrameLayout topMenuView; |
| | | Button btnTopMenuUp; |
| | | Button btnTopMenuLeft; |
| | | Button btnTopMenuRight; |
| | | Button btnTopMenuDown; |
| | | Button btnOk; |
| | | FrameLayout channleView; |
| | | Button btnChlReduce; |
| | | Button btnChlPlus; |
| | | FrameLayout volView; |
| | | Button btnVolReduce; |
| | | Button btnVolPlus; |
| | | Button btnBack; |
| | | Button btnMore; |
| | | Button btn123; |
| | | Button btnMute; |
| | | Button btnPower; |
| | | |
| | | #endregion |
| | | |
| | | #region 区域变量 |
| | | Function function; |
| | | Button btnCollection_Out; |
| | | Button btnFunctionName_Out; |
| | | Button btnFromFloor_Out; |
| | | /// <summary> |
| | | /// 刷新显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | #endregion |
| | | |
| | | public StbPage(Function func) |
| | | { |
| | | bodyView = this; |
| | | function = func; |
| | | } |
| | | |
| | | |
| | | public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | btnCollection_Out = btnCollectionIcon; |
| | | btnFunctionName_Out = btnFunctionNameOut; |
| | | btnFromFloor_Out = btnFromFloorOut; |
| | | |
| | | FrameLayout controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | bodyView.AddChidren(controlView); |
| | | |
| | | btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(37), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | Text = function.name, |
| | | }; |
| | | controlView.AddChidren(btnFunctionName); |
| | | |
| | | btnFromFoorAndRoom = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnFunctionName.Bottom, |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(21), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetRoomListName() |
| | | }; |
| | | controlView.AddChidren(btnFromFoorAndRoom); |
| | | |
| | | btnCollection = new Button() |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetMinRealAverage(40), |
| | | Height = Application.GetMinRealAverage(40), |
| | | SelectedImagePath = "Collection/CollectionIcon.png", |
| | | UnSelectedImagePath = "Collection/CollectionGrayIcon.png", |
| | | IsSelected = function.collect |
| | | }; |
| | | controlView.AddChidren(btnCollection); |
| | | //2020-12-16 如果是成员隐藏收藏功能 |
| | | //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | //{ |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | |
| | | #region 轮盘控制区域 |
| | | topMenuView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(88), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(199), |
| | | Height = Application.GetRealWidth(199), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png", |
| | | }; |
| | | controlView.AddChidren(topMenuView); |
| | | |
| | | btnTopMenuUp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuUp); |
| | | |
| | | btnTopMenuLeft = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuLeft); |
| | | |
| | | btnTopMenuRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuRight); |
| | | |
| | | btnTopMenuDown = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuDown); |
| | | |
| | | btnOk = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(100), |
| | | }; |
| | | topMenuView.AddChidren(btnOk); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 频道音量调节 |
| | | channleView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(channleView); |
| | | |
| | | btnChlPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlPlus); |
| | | |
| | | Button btnChlText; |
| | | btnChlText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Chl, |
| | | }; |
| | | channleView.AddChidren(btnChlText); |
| | | |
| | | btnChlReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlReduce); |
| | | |
| | | volView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(257), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(volView); |
| | | |
| | | btnVolPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolPlus); |
| | | |
| | | Button btnVolText; |
| | | btnVolText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Vol, |
| | | }; |
| | | volView.AddChidren(btnVolText); |
| | | |
| | | btnVolReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolReduce); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 底部控制区域 |
| | | btnBack = new Button() |
| | | { |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVBackIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnBack); |
| | | |
| | | btnMenu = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | |
| | | btn123 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TV123Icon.png", |
| | | }; |
| | | controlView.AddChidren(btn123); |
| | | |
| | | btnMute = new Button() |
| | | { |
| | | X = Application.GetRealWidth(244), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMuteIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMute); |
| | | |
| | | btnMore = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/AC/More.png", |
| | | }; |
| | | controlView.AddChidren(btnMore); |
| | | |
| | | btnPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVPowerIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnPower); |
| | | |
| | | #endregion |
| | | |
| | | LoadEventList(); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.TV)).LoadTopView_FunctionTop(function, actionRefresh); |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
| | | |
| | | } |
| | | |
| | | |
| | | void ShowNumberView() |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout dialogView = new FrameLayout() |
| | | { |
| | | AnimateSpeed = 0.3f, |
| | | Animate = Animate.DownToUp, |
| | | }; |
| | | dialog.AddChidren(dialogView); |
| | | |
| | | dialogView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | FrameLayout numberView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(403), |
| | | Height = Application.GetRealHeight(264), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | dialogView.AddChidren(numberView); |
| | | |
| | | for (int i = 0; i < 10; i++) |
| | | { |
| | | Button btn = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(98), |
| | | Height = Application.GetRealHeight(44), |
| | | Radius = (uint)Application.GetRealWidth(8), |
| | | BorderWidth = (uint)Application.GetRealWidth(1), |
| | | BorderColor = CSS_Color.PromptingColor1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | IsBold = true, |
| | | Text = i.ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | if (i == 1 || i == 4 || i == 7) |
| | | { |
| | | btn.X = Application.GetRealWidth(24); |
| | | |
| | | } |
| | | else if (i == 2 || i == 5 || i == 8) |
| | | { |
| | | btn.X = Application.GetRealWidth(138); |
| | | } |
| | | else if (i == 3 || i == 6 || i == 9) |
| | | { |
| | | btn.X = Application.GetRealWidth(252); |
| | | } |
| | | else |
| | | { |
| | | btn.X = Application.GetRealWidth(138); |
| | | } |
| | | if (i == 0) |
| | | { |
| | | btn.Y = Application.GetRealHeight(204); |
| | | } |
| | | else if (i < 4) |
| | | { |
| | | btn.Y = Application.GetRealHeight(24); |
| | | |
| | | } |
| | | else if (i < 7) |
| | | { |
| | | btn.Y = Application.GetRealHeight(84); |
| | | } |
| | | else |
| | | { |
| | | btn.Y = Application.GetRealHeight(144); |
| | | } |
| | | numberView.AddChidren(btn); |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | string index = (sender as Button).Text; |
| | | btn.IsSelected = false; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add($"number_{index}", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btn.MouseDownEventHandler = (sender, e) => { |
| | | btn.IsSelected = true; |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | dialog.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载事件列表 |
| | | /// </summary> |
| | | void LoadEventList() |
| | | { |
| | | LoadControlEvent(); |
| | | LoadCollectionEvent(); |
| | | |
| | | //回退刷新信息事件 |
| | | actionRefresh = () => { |
| | | btnFunctionName.Text = btnFunctionName_Out.Text = function.name; |
| | | btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName(); |
| | | function.UpdataFuncitonInfo(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏功能按钮事件 |
| | | /// </summary> |
| | | void LoadCollectionEvent() |
| | | { |
| | | btnCollection.MouseUpEventHandler += (sender, e) => { |
| | | btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; |
| | | function.CollectFunction(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载控制事件 |
| | | /// </summary> |
| | | void LoadControlEvent() |
| | | { |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("av_tv", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnChlPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch+", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnChlReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch-", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnVolPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume+", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnVolReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume-", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnBack.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("return", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("menu", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btn123.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ShowNumberView(); |
| | | }; |
| | | btnMute.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("mute", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | |
| | | btnTopMenuUp.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("up", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("left", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnTopMenuRight.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("right", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnTopMenuDown.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("down", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | btnOk.MouseUpEventHandler = (sender, e) => { |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ok", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.UI.UI2.EchartsOption_Energy; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class EnergyMainPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | static EnergyMainPage bodyView; |
| | | |
| | | /// <summary> |
| | | /// 顶部区域 |
| | | /// </summary> |
| | | FrameLayout generalTableView; |
| | | |
| | | /// <summary> |
| | | /// 实时功耗 |
| | | /// </summary> |
| | | Button btnRealTimeData; |
| | | /// <summary> |
| | | /// 实时功耗单位 |
| | | /// </summary> |
| | | Button btnTotalValueUint; |
| | | /// <summary> |
| | | /// 总功耗 |
| | | /// </summary> |
| | | TextButton btnTotalValue; |
| | | /// <summary> |
| | | /// 历史数据区域 |
| | | /// </summary> |
| | | FrameLayout diagramView; |
| | | /// <summary> |
| | | /// 曲线图 |
| | | /// </summary> |
| | | MyEchartsViewOn myLineEchartsView; |
| | | /// <summary> |
| | | /// 曲线图数据string |
| | | /// </summary> |
| | | EchartsOption_BrokenLine brokenLine; |
| | | /// <summary> |
| | | /// 曲线图下拉按钮 |
| | | /// </summary> |
| | | Button btnDrodDown; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 插查询的能源列表 |
| | | /// </summary> |
| | | List<Function> queryList = new List<Function>(); |
| | | /// <summary> |
| | | /// 查询条件 |
| | | /// hour、week、month |
| | | /// </summary> |
| | | string curQueryType = "hour"; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 能源列表区域 |
| | | /// </summary> |
| | | FrameLayout energyListView; |
| | | /// <summary> |
| | | /// 历史数据图表 |
| | | /// </summary> |
| | | MyEchartsViewOn myEchartsView; |
| | | /// <summary> |
| | | /// 曲线图是否展开 |
| | | /// </summary> |
| | | bool isUnfoldOrStow = false; |
| | | |
| | | List<Function> energyList = new List<Function>(); |
| | | |
| | | List<uint> colorList = new List<uint>(){0xFF80AEFF, 0xFFFFD154, 0xFFFF9D54, 0xFFFE6A6A, 0xFFB183C3, 0xFFADE764, |
| | | 0xFFD7504B, 0xFFC6E579, 0xFFF4E001, 0xFFF0805A, 0xFF26C0C0}; |
| | | List<string> colorList2 = new List<string>() { |
| | | "#80AEFF", "#FFD154", "#FF9D54", "#FE6A6A", "#B183C3", "#ADE764", |
| | | "#D7504B", "#C6E579", "#F4E001", "#F0805A", "#26C0C0"}; |
| | | |
| | | /// <summary> |
| | | /// 主页 |
| | | /// </summary> |
| | | public EnergyMainPage() |
| | | { |
| | | bodyView = this; |
| | | energyList = FunctionList.List.GetEnergyList(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 顶部view |
| | | var generalTableView = new FrameLayout() |
| | | generalTableView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(148), |
| | | Height = Application.GetRealWidth(148),//419//148 |
| | | Radius = (uint)Application.GetRealWidth(5), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(generalTableView); |
| | | |
| | | TextButton btnTotalValue = new TextButton() |
| | | btnTotalValue = new TextButton() |
| | | { |
| | | X = Application.GetRealWidth(18), |
| | | Y = Application.GetRealWidth(24), |
| | |
| | | }; |
| | | generalTableView.AddChidren(btnTotalValue); |
| | | |
| | | btnTotalValue.Width = btnTotalValue.GetTextWidth(); |
| | | |
| | | var btnTotalValueUint = new Button() |
| | | btnTotalValueUint = new Button() |
| | | { |
| | | X = btnTotalValue.Right, |
| | | Y = Application.GetRealWidth(24), |
| | |
| | | }; |
| | | generalTableView.AddChidren(btnTotalValueUint); |
| | | |
| | | var btnRealTimeData = new Button() |
| | | btnRealTimeData = new Button() |
| | | { |
| | | X = Application.GetRealWidth(18), |
| | | Y = btnTotalValue.Bottom, |
| | |
| | | TextID = StringId.RealTimePowerConsumption, |
| | | }; |
| | | generalTableView.AddChidren(btnRealTimeData); |
| | | btnRealTimeData.Text = Language.StringByID(StringId.RealTimePowerConsumption).Replace("{0}", "0"); |
| | | |
| | | UpdataValue(); |
| | | |
| | | |
| | | var echartsView = new FrameLayout() |
| | | { |
| | |
| | | //Y = Application.GetRealWidth(16), |
| | | }; |
| | | generalTableView.AddChidren(echartsView); |
| | | MyEchartsViewOn myEchartsView = new MyEchartsViewOn() |
| | | myEchartsView = new MyEchartsViewOn() |
| | | { |
| | | Width = Application.GetRealWidth(118), |
| | | Height = Application.GetRealWidth(118), |
| | |
| | | |
| | | echartsView.AddChidren(myEchartsView); |
| | | Dictionary<string, string> list = new Dictionary<string, string>(); |
| | | list.Add("电冰箱", "12"); |
| | | list.Add("电风扇", "2"); |
| | | list.Add("空调", "9"); |
| | | list.Add("洗衣机", "3"); |
| | | list.Add("电脑", "33"); |
| | | |
| | | foreach(var ene in energyList) |
| | | { |
| | | double tt = 0; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out tt); |
| | | tt *= 100;//乘以100,小于1无法加载echart |
| | | |
| | | list.Add(ene.name, tt.ToString()); |
| | | } |
| | | |
| | | var echartsPie = new EchartsOption_Pie(); |
| | | var echartRootJson = echartsPie.InitDateJson(list); |
| | | //var echartRootJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(echartRootJson); |
| | | myEchartsView.ShowWithOption(echartRootJson); |
| | | |
| | | |
| | | var btnDrodDown = new Button() |
| | | btnDrodDown = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(118), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(30), |
| | | UnSelectedImagePath = "FunctionIcon/Energy/EnergyDrodDownIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Energy/EnergyDrodUpIcon.png", |
| | | }; |
| | | initDiagramView(); |
| | | generalTableView.AddChidren(btnDrodDown); |
| | | btnDrodDown.MouseUpEventHandler = (sender, e) => { |
| | | isUnfoldOrStow = btnDrodDown.IsSelected = !btnDrodDown.IsSelected; |
| | | showDiagramView(); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var energyList = FunctionList.List.GetEnergyList(); |
| | | var energyListView = new FrameLayout() |
| | | energyListView = new FrameLayout() |
| | | { |
| | | Y = generalTableView.Bottom + Application.GetRealWidth(8), |
| | | Height = Application.GetRealWidth(116 * energyList.Count), |
| | | Height = Application.GetRealWidth(116 * energyList.Count + 50), |
| | | }; |
| | | contentView.AddChidren(energyListView); |
| | | int index = 0; |
| | |
| | | { |
| | | EnergyRow(energy, energyListView, index); |
| | | index++; |
| | | DriverLayer.Control.Ins.SendReadCommand(energy); |
| | | } |
| | | } |
| | | FrameLayout diagramView; |
| | | List<Function> queryList = new List<Function>(); |
| | | string curQueryType = "hour"; |
| | | |
| | | void d1(FrameLayout contentView) |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | void showDiagramView() |
| | | { |
| | | if (isUnfoldOrStow)//展开 |
| | | { |
| | | generalTableView.Height = Application.GetRealHeight(419); |
| | | btnDrodDown.Y = Application.GetRealWidth(389); |
| | | btnDrodDown.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | generalTableView.Height = Application.GetRealHeight(148); |
| | | btnDrodDown.Y = Application.GetRealWidth(118); |
| | | btnDrodDown.IsSelected = false; |
| | | } |
| | | |
| | | energyListView.Y = generalTableView.Bottom + Application.GetRealWidth(8); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载曲线图 |
| | | /// </summary> |
| | | /// <param name="contentView"></param> |
| | | void initDiagramView() |
| | | { |
| | | brokenLine = new EchartsOption_BrokenLine(); |
| | | |
| | | |
| | | diagramView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(136), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(420), |
| | | Height = Application.GetRealWidth(241), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(diagramView); |
| | | generalTableView.AddChidren(diagramView); |
| | | |
| | | #region 选择数据日期范围 |
| | | var showDataTypeView = new FrameLayout() |
| | |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "hour"; |
| | | d2(); |
| | | brokenLine.YvalueText = ""; |
| | | foreach (var enery in queryList) |
| | | { |
| | | LoadMothed_GetHistoryData(enery,false); |
| | | } |
| | | }; |
| | | |
| | | btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = true; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "week"; |
| | | d2(); |
| | | }; |
| | | btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = false; |
| | | btnShowHistroyData_Week.IsSelected = true; |
| | | curQueryType = "week"; |
| | | brokenLine.YvalueText = ""; |
| | | foreach (var enery in queryList) |
| | | { |
| | | LoadMothed_GetHistoryData(enery, false); |
| | | } |
| | | }; |
| | | btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; |
| | | btnShowHistroyData_Day.IsSelected = false; |
| | | btnShowHistroyData_Month.IsSelected = true; |
| | | btnShowHistroyData_Week.IsSelected = false; |
| | | curQueryType = "month"; |
| | | d2(); |
| | | brokenLine.YvalueText = ""; |
| | | foreach (var enery in queryList) |
| | | { |
| | | LoadMothed_GetHistoryData(enery, false); |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(52), |
| | | Width = Application.GetRealWidth(343 - 32), |
| | | Height = Application.GetRealHeight(270), |
| | | //Width = Application.GetRealWidth(343 - 32), |
| | | Height = Application.GetRealHeight(178), |
| | | }; |
| | | diagramView.AddChidren(historyDataView); |
| | | |
| | | var myEchartsView = new MyEchartsViewOn(); |
| | | myEchartsView = new MyEchartsViewOn() { |
| | | Y = Application.GetRealHeight(10), |
| | | Height = Application.GetRealHeight(150), |
| | | }; |
| | | |
| | | historyDataView.AddChidren(myEchartsView); |
| | | |
| | | } |
| | | |
| | | void d2() |
| | | /// <summary> |
| | | /// 读取历史数据 |
| | | /// </summary> |
| | | void LoadMothed_GetHistoryData(Function sr,bool isDel) |
| | | { |
| | | int index = 0; |
| | | var echartRootJson = new EchartsOption_Energy(); |
| | | var seriesList = new List<EchartSeriesItem>(); |
| | | foreach (var function in queryList) |
| | | if(isDel)//删除数据现实 |
| | | { |
| | | var seriesItem = d3(function, index, echartRootJson.xAxis.data); |
| | | seriesList.Add(seriesItem); |
| | | brokenLine.YvalueText = ""; |
| | | foreach (var ene in queryList) |
| | | { |
| | | brokenLine.YvalueText += ene.GetAttrState("ydata") + ","; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myEchartsView.ShowWithOption(brokenLine.InitOption()); |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 查询列表 |
| | | /// </summary> |
| | | /// <summary> |
| | | /// 读取传感器历史数据 |
| | | /// </summary> |
| | | EchartSeriesItem d3(Function function, int index, List<string> xAxisData) |
| | | { |
| | | EchartSeriesItem sItem = null; |
| | | List<string> data = new List<string>(); |
| | | |
| | | var loadPage = new Loading() |
| | | { |
| | | LodingBackgroundColor = 0x88888888, |
| | | }; |
| | | diagramView.AddChidren(loadPage); |
| | | |
| | | try |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | try |
| | | { |
| | | loadPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | var sensorType = function.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, function.deviceId, sensorType); |
| | | |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | loadPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | }); |
| | | |
| | | sItem = new EchartSeriesItem |
| | | var sensorType = sr.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, "total_electricity"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | data = new List<int>(), |
| | | lineStyle = new EchartLineStyle() |
| | | { |
| | | color = colorList2[index], |
| | | #if __IOS__ |
| | | width = 5, |
| | | #elif __ANDROID__ |
| | | width = 2, |
| | | #endif |
| | | }, |
| | | }; |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); |
| | | |
| | | try |
| | | { |
| | | foreach (var d in revertData) |
| | | List<string> vs = new List<string>(); |
| | | if (brokenLine.YvalueText == "") |
| | | { |
| | | if (xAxisData.Count == 0) |
| | | foreach (var data in revertData) |
| | | { |
| | | data.Add(d.fieldName); |
| | | vs.Add(data.fieldName); |
| | | } |
| | | sItem.data.Add(Convert.ToInt32(d.fieldValue)); |
| | | brokenLine.InitXdataText(vs); |
| | | |
| | | if (sr.GetAttribute("ydata") == null) |
| | | { |
| | | sr.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | sr.SetAttrState("ydata", brokenLine.InitYdataText(sr.name, revertData, sr.GetAttrState("color")) + ","); |
| | | } |
| | | xAxisData.AddRange(data); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"revertData:{ex.Message}"); |
| | | else |
| | | { |
| | | if (sr.GetAttribute("ydata") == null) |
| | | { |
| | | sr.attributes.Add(new FunctionAttributes() { key = "ydata" }); |
| | | } |
| | | sr.SetAttrState("ydata", brokenLine.InitYdataText(sr.name, revertData, sr.GetAttrState("color"))+","); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | brokenLine.yTitle = Language.StringByID(StringId.EnergyConsumption) + "(kW)"; |
| | | brokenLine.xTitle = Language.StringByID(StringId.timeMode); |
| | | if(curQueryType != "hour") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter("", true, 2, Language.StringByID(StringId.GetSensorHistoryFailed), false); |
| | | }); |
| | | brokenLine.xTitle = Language.StringByID(StringId.Date); |
| | | } |
| | | var opString = brokenLine.InitOption(); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myEchartsView.ShowWithOption(opString); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"sensor history error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | catch (Exception ex) |
| | | { |
| | | loadPage.Hide(); |
| | | }); |
| | | } |
| | | return sItem; |
| | | |
| | | //var echartRootJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(echartRootJson); |
| | | //myEchartsView.ShowWithOptionJsonString(echartRootJsonString); |
| | | MainPage.Log($"sensor history error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loadPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | }; |
| | | view.AddChidren(btnLine); |
| | | |
| | | var row = new FrameLayout() |
| | | //定义代表色 |
| | | energy.attributes.Add(new FunctionAttributes() { key = "color", state = colorList2[index] }); |
| | | |
| | | var row = new EnergyRow(energy, colorList[index]); |
| | | |
| | | row.SetHistory_Action = (isAdd) => |
| | | { |
| | | Y = btnLine.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(100), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | if (isAdd) |
| | | { |
| | | if(!isUnfoldOrStow)//如果曲线图没有加载出来,则自动加载出来 |
| | | { |
| | | isUnfoldOrStow = true; |
| | | showDiagramView(); |
| | | } |
| | | queryList.Add(row.function); |
| | | LoadMothed_GetHistoryData(row.function, false); |
| | | } |
| | | else |
| | | { |
| | | queryList.Remove(row.function); |
| | | LoadMothed_GetHistoryData(row.function, true); |
| | | if (queryList.Count == 0)//如果查询列表为0,自动收起曲线图 |
| | | { |
| | | isUnfoldOrStow = false; |
| | | showDiagramView(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | row.Y = btnLine.Bottom; |
| | | view.AddChidren(row); |
| | | listButton_value.Add(row.btnValue); |
| | | |
| | | Control.Ins.SendReadCommand(energy); |
| | | } |
| | | |
| | | |
| | | public List<Button> listButton_value = new List<Button>(); |
| | | |
| | | /// <summary> |
| | | /// 更新功能状态 |
| | | /// </summary> |
| | | public static void UpdataStatus(Function updataTemp) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | if (bodyView == null) |
| | | return; |
| | | foreach (var btn in bodyView.listButton_value) |
| | | { |
| | | if (btn.Tag.ToString() == updataTemp.sid) |
| | | { |
| | | var newValue = updataTemp.GetAttrState(FunctionAttributeKey.Power); |
| | | //if (newValue != btn.Text) |
| | | { |
| | | btn.Text = newValue; |
| | | UpdataValue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{bodyView.GetType().Name } UpdataStates error : {ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新数据 |
| | | /// </summary> |
| | | static void UpdataValue() |
| | | { |
| | | double totalValue = 0; |
| | | double realtimeValue = 0; |
| | | foreach (var ene in bodyView.energyList) |
| | | { |
| | | double power = 0; |
| | | double.TryParse(ene.GetAttrState(FunctionAttributeKey.TotalElectricity), out power); |
| | | totalValue += power; |
| | | |
| | | int realTimePower = 0; |
| | | int.TryParse(ene.GetAttrState(FunctionAttributeKey.Power), out realTimePower); |
| | | realtimeValue += realTimePower; |
| | | } |
| | | bodyView.btnTotalValue.Text = totalValue.ToString(); |
| | | realtimeValue /= 1000; |
| | | bodyView.btnRealTimeData.Text = Language.StringByID(StringId.RealTimePowerConsumption).Replace("{0}", realtimeValue.ToString()); |
| | | ///动态获取文本宽度 |
| | | bodyView.btnTotalValue.Width = bodyView.btnTotalValue.GetTextWidth() + Application.GetRealWidth(5); |
| | | bodyView.btnTotalValueUint.X = bodyView.btnTotalValue.Right; |
| | | } |
| | | } |
| | | |
| | | |
| | | public class EnergyRow : FrameLayout |
| | | { |
| | | public Button btnValue; |
| | | Button btnShowData; |
| | | public Function function; |
| | | public Action<bool> SetHistory_Action; |
| | | public EnergyRow(Function energy, uint color) |
| | | { |
| | | function = energy; |
| | | Gravity = Gravity.CenterHorizontal; |
| | | Width = Application.GetRealWidth(343); |
| | | Height = Application.GetRealWidth(100); |
| | | Radius = (uint)Application.GetRealWidth(12); |
| | | BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | Tag = energy.sid; |
| | | |
| | | var btnColorTip = new Button() |
| | | { |
| | |
| | | Y = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(12), |
| | | Height = Application.GetRealWidth(12), |
| | | BackgroundColor = colorList[index], |
| | | BackgroundColor = color |
| | | }; |
| | | row.AddChidren(btnColorTip); |
| | | AddChidren(btnColorTip); |
| | | |
| | | var btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(24), |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | row.AddChidren(btnName); |
| | | AddChidren(btnName); |
| | | |
| | | var btnFromFloor = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 10 + 32), |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(10 + 24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(18), |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | row.AddChidren(btnFromFloor); |
| | | AddChidren(btnFromFloor); |
| | | |
| | | var btnValue = new Button() |
| | | btnValue = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealWidth(57), |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "---" |
| | | Text = energy.GetAttrState(FunctionAttributeKey.Power), |
| | | Tag = energy.sid, |
| | | IsBold = true, |
| | | }; |
| | | row.AddChidren(btnValue); |
| | | AddChidren(btnValue); |
| | | |
| | | |
| | | var btnSetting = new Button() |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/FuncInfoSetIcon.png", |
| | | }; |
| | | row.AddChidren(btnSetting); |
| | | AddChidren(btnSetting); |
| | | |
| | | Button btnSeltSensorValue = new Button() |
| | | var btnSeltSensorValue = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(47), |
| | |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | }; |
| | | row.AddChidren(btnSeltSensorValue); |
| | | AddChidren(btnSeltSensorValue); |
| | | |
| | | Button btnShowData; |
| | | btnShowData = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", |
| | | SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", |
| | | IsSelected = true, |
| | | IsSelected = false, |
| | | }; |
| | | row.AddChidren(btnShowData); |
| | | AddChidren(btnShowData); |
| | | |
| | | btnSetting.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | btnShowData.MouseUpEventHandler = (sender, e) => { |
| | | btnShowData.IsSelected = !btnShowData.IsSelected; |
| | | SetHistory_Action(btnShowData.IsSelected); |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 饼图 |
| | | /// 曲线图 |
| | | /// </summary> |
| | | public class EchartsOption_BrokenLine |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// x轴数据 |
| | | /// </summary> |
| | | /// <param name="xData"></param> |
| | | public void InitXdata (List<string> xData) |
| | | public string XvalueText = ""; |
| | | |
| | | /// <summary> |
| | | /// Y轴数据 |
| | | /// </summary> |
| | | public string YvalueText = ""; |
| | | /// <summary> |
| | | /// x轴标题 |
| | | /// </summary> |
| | | public string xTitle = ""; |
| | | /// <summary> |
| | | /// y轴标题 |
| | | /// </summary> |
| | | public string yTitle = ""; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 组装Option数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string InitOption() |
| | | { |
| | | //组装Value |
| | | string valueText = string.Empty; |
| | | foreach (var data in xData) |
| | | { |
| | | valueText += "'" + data + "',"; |
| | | } |
| | | optionString = optionString.Replace("{0}", valueText); |
| | | var newstring = optionString.Replace("{0}", XvalueText); |
| | | newstring = newstring.Replace("{1}", YvalueText); |
| | | newstring = newstring.Replace("{10}", xTitle); |
| | | newstring = newstring.Replace("{20}", yTitle); |
| | | return newstring; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 组装x轴文本 |
| | | /// </summary> |
| | | /// <param name="xData"></param> |
| | | public void InitXdataText(List<string> xData) |
| | | { |
| | | XvalueText = ""; |
| | | foreach (var data in xData) |
| | | { |
| | | XvalueText += "'" + data + "',"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 组装y轴文本 |
| | | /// </summary> |
| | | /// <param name="yData"></param> |
| | | public string GetYdata(string name, List<EnvironmentalSensorHistor> yData, string color) |
| | | public string InitYdataText(string name, List<EnvironmentalSensorHistor> yData, string color) |
| | | { |
| | | //组装Value |
| | | string valueText = string.Empty; |
| | | var yAxisValue = @"{name:'{0}', |
| | | var YvalueTextItem = @"{name:'{0}', |
| | | data:[{1}], |
| | | type:'line', |
| | | smooth:0.6, |
| | | symbol:'none', |
| | | color:'{2}'} |
| | | "; |
| | | yAxisValue = yAxisValue.Replace("{0}", name); |
| | | YvalueTextItem = YvalueTextItem.Replace("{0}", name); |
| | | |
| | | foreach (var data in yData) |
| | | { |
| | | valueText += "'" + data.fieldValue + "',"; |
| | | } |
| | | yAxisValue = yAxisValue.Replace("{1}", valueText); |
| | | yAxisValue = yAxisValue.Replace("{2}", color); |
| | | return yAxisValue; |
| | | } |
| | | YvalueTextItem = YvalueTextItem.Replace("{1}", valueText); |
| | | YvalueTextItem = YvalueTextItem.Replace("{2}", color); |
| | | |
| | | public void InitYdataString(string yData) |
| | | { |
| | | //组装Value |
| | | optionString = optionString.Replace("{1}", yData); |
| | | if (YvalueText == "") |
| | | { |
| | | YvalueText = YvalueTextItem; |
| | | } |
| | | else |
| | | { |
| | | YvalueText += "," + YvalueTextItem; |
| | | } |
| | | |
| | | return YvalueTextItem; |
| | | } |
| | | |
| | | |
| | | public string optionString = @"{ |
| | | #if __IOS__ |
| | | public string optionString = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | top: '10%', |
| | | left: '10%', |
| | | right: '10%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | name: '{10}', |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}], |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | name: '{20}', |
| | | type: 'value', |
| | | axisLabel : { |
| | | fontSize:30, |
| | | }, |
| | | }, |
| | | series: [ |
| | | {1} |
| | | ] |
| | | }"; |
| | | #else |
| | | public string optionString = @"{ |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | grid: { |
| | | top: '10%', |
| | | left: '10%', |
| | | right: '10%', |
| | | bottom: '10%', |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [{0}] |
| | | data: [{0}], |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | {1} |
| | | ] |
| | | }"; |
| | | #endif |
| | | |
| | | /// <summary> |
| | | /// 颜色列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<string> ColorList () |
| | | public List<string> ColorList() |
| | | { |
| | | var list = new List<string>(); |
| | | return list; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | var sensorType = sr.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,sensorType); |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,"value"); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | { |
| | | vs.Add(data.fieldName); |
| | | } |
| | | ebl.InitXdata(vs); |
| | | ebl.InitXdataText(vs); |
| | | } |
| | | yDataString += ebl.GetYdata(sr.name, revertData, tipColorStringList[i]); |
| | | yDataString += ebl.InitYdataText(sr.name, revertData, tipColorStringList[i]); |
| | | } |
| | | } |
| | | i++; |
| | | } |
| | | |
| | | ebl.InitYdataString(yDataString); |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myEchartsView.ShowWithOption(ebl.optionString); |
| | | myEchartsView.ShowWithOption(ebl.InitOption()); |
| | | }); |
| | | |
| | | } |
| | |
| | | // controlView.AddChidren(btnCollection); |
| | | //} |
| | | |
| | | |
| | | var minValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min; |
| | | var maxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max; |
| | | var progress = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04, |
| | | OfflineProgressBarColor = CSS_Color.PromptingColor2, |
| | | IsOffline = function.trait_on_off.curValue.ToString() == "off", |
| | | MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min, |
| | | MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | MinValue = minValue,//function.GetAttribute(FunctionAttributeKey.SetTemp).min, |
| | | MaxValue = maxValue,// function.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)), |
| | | Progress = progress, |
| | | #if __IOS__ |
| | | Y = Application.GetRealHeight(120+25), |
| | | Width = Application.GetRealWidth(260-40), |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 56, |
| | | IsBold = true, |
| | | Text = function.GetAttrState(FunctionAttributeKey.SetTemp), |
| | | Text = progress.ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | controlView.AddChidren(btnTemp); |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(600), |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region name view |
| | | var nameView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(nameView); |
| | | contentView.AddChidren(nameView); |
| | | |
| | | var btnNameText = new Button() |
| | | { |
| | |
| | | #region 位置管理 |
| | | var locationMagtView = new FrameLayout() |
| | | { |
| | | Y = nameView.Bottom, |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(locationMagtView); |
| | | contentView.AddChidren(locationMagtView); |
| | | |
| | | var btnLocationMagtTitle = new Button() |
| | | { |
| | |
| | | #region 共享 |
| | | //var sharedView = new FrameLayout() |
| | | //{ |
| | | // Y = locationMagtView.Bottom, |
| | | // Height = Application.GetRealHeight(55), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //}; |
| | | //bodyView.AddChidren(sharedView); |
| | | //contentView.AddChidren(sharedView); |
| | | |
| | | //var btnSharedText = new Button() |
| | | //{ |
| | |
| | | #region 添加到桌面 |
| | | var addToDesktopView = new FrameLayout() |
| | | { |
| | | Y = locationMagtView.Bottom, |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(addToDesktopView); |
| | | contentView.AddChidren(addToDesktopView); |
| | | |
| | | var btnAddToDesktopText = new Button() |
| | | { |
| | |
| | | |
| | | #endregion |
| | | #endif |
| | | |
| | | if (function.spk == SPK.ElectricEnergy) |
| | | { |
| | | #region 能源数据 |
| | | var energyView1 = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(energyView1); |
| | | |
| | | var btnEnergyText1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.RealTimeEnergyConsumption, |
| | | }; |
| | | energyView1.AddChidren(btnEnergyText1); |
| | | |
| | | 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", |
| | | }; |
| | | energyView1.AddChidren(energyValue1); |
| | | |
| | | energyView1.AddChidren( |
| | | new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(54), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1) |
| | | }); |
| | | //----------------- |
| | | |
| | | var energyView2 = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(energyView2); |
| | | |
| | | var btnEnergyText2 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.EnergyConsumptionOfThisMonth, |
| | | }; |
| | | energyView2.AddChidren(btnEnergyText2); |
| | | |
| | | var energyValue2 = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(355), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = "--kW", |
| | | }; |
| | | energyView2.AddChidren(energyValue2); |
| | | |
| | | energyView2.AddChidren( |
| | | new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(54), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | 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) |
| | | { |
| | | if(data.Code == StateCode.SUCCESS) |
| | | { |
| | | var dataPack = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(data.Data.ToString()); |
| | | if(dataPack!=null) |
| | | { |
| | | var dataValue = dataPack.GetValue("property").ToString(); |
| | | if(!string.IsNullOrEmpty(dataValue)) |
| | | { |
| | | btnEnergyText2.Text = dataValue + "kW"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) { IsBackground = true }.Start(); |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | LoadEventList(); |
| | | } |
| | | |