20210302-1
完成凉霸对接。
窗帘状态修改。
涂鸦四件套
| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs"> |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/RoomPage.cs" Line="80" Column="68" /> |
| | | <File FileName="HDL_ON/Entity/Room.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="417" Column="60" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs" Line="186" Column="38" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="148" Column="70" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs" Line="388" Column="54" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="863" Column="51" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="369" Column="13" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="750" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI0-Stan/Logic/HdlThreadLogic.cs" Line="97" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionPageBLL.cs" Line="13" Column="56" /> |
| | | <File FileName="HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs" Line="78" Column="52" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs" Line="340" Column="22" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="743" Column="75" /> |
| | | <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="249" Column="69" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="29" Column="55" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs" Line="340" Column="42" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Mqtt" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI0-Stan" expanded="True"> |
| | | <Node name="Logic" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI0-Stan" expanded="True" /> |
| | | <Node name="UI1-Login" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True"> |
| | | <Node name="ConditionDeviceFunList.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="4-PersonalCenter" expanded="True" /> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmSensor" expanded="True" /> |
| | | <Node name="Electrical" expanded="True"> |
| | | <Node name="ClothesHangerPage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Electrical" expanded="True"> |
| | | <Node name="ClothesHanger" expanded="True" /> |
| | | </Node> |
| | | <Node name="Curtain" expanded="True" /> |
| | | <Node name="Electrical" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <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="ClothesHanger" expanded="True" /> |
| | | <Node name="Resources" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="ys" expanded="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore /> |
| | |
| | | 414=Controller on |
| | | 415=Someone |
| | | 416=Log |
| | | 417=Water Leakage |
| | | 418=In Alarm |
| | | 419=Normal |
| | | 420=Hot dry |
| | | 421=Air dry |
| | | 422=Disinfect |
| | | 423=Lighting |
| | | 424=Time |
| | | 425=Hot dry time |
| | | 426=Air dry time |
| | | 427=Disinfect time |
| | | 428=Anion Time |
| | | |
| | | |
| | | 1002=Anion |
| | | |
| | | 5000=Music |
| | | 5001=Group |
| | |
| | | 413=控制器未开启 |
| | | 414=控制器已开启 |
| | | 415=有人 |
| | | 516=日志 |
| | | 416=日志 |
| | | 417=漏水 |
| | | 418=报警 |
| | | 419=正常 |
| | | 420=烘干 |
| | | 421=风干 |
| | | 422=消毒 |
| | | 423=照明 |
| | | 424=时间 |
| | | 425=烘干时间 |
| | | 426=风干时间 |
| | | 427=消毒时间 |
| | | 428=负离子时间 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 5047=你手机暂未安装"QQ音乐"{\r\n}请前往手机商场安装 |
| | | |
| | | |
| | | |
| | | 6000=正常 |
| | | 6001=设备状态 |
| | | 6002=个 |
| | |
| | | 6012=红外遥控 |
| | | 6013=设备管理 |
| | | 6014=添加遥控器 |
| | | 6015=在线 |
| | | 6016=离线 |
| | | 6017=版本号 |
| | | 6018=请输入遥控器名称 |
| | | 6019=提示:遥控器创建后可在功能-电器分类{\r\n}查找使用 |
| | | 6020=推荐按键 |
| | | 6021=请输入按键名称 |
| | | 6022=下一步 |
| | | 6023=电源 |
| | | 6024=音量+ |
| | | 6025=音量- |
| | | 6026=频道+ |
| | | 6027=频道- |
| | | 6028=上 |
| | | 6029=下 |
| | | 6030=左 |
| | | 6031=右 |
| | | 6032=静音 |
| | | 6034=确认 |
| | | 6035=播放 |
| | | 6037=退出 |
| | | 6038=菜单 |
| | | 6039=暂停 |
| | | 6040=返回 |
| | | 6041=停止 |
| | | 6042=主页 |
| | | 6043=快进 |
| | | 6044=快退 |
| | | 6045=定时 |
| | | 6046=复制遥控功能 |
| | | 6047=对准遥控器中心按下相同按键 |
| | | 6048=智能遥控器 |
| | | 6049=添加按键 |
| | | 6050=*长按可进行自定义排序 |
| | | 6051=完成 |
| | | 6052=添加成功 |
| | | 6053=可到分类-功能-电器操作使用 |
| | | 6054=所属分类 |
| | | 6055=遥控器名称 |
| | | 6056=所属区域 |
| | | 6057=继续添加 |
| | | 6058=电器 |
| | | 6059=添加失败 |
| | | 6060=重试 |
| | | |
| | | |
| | | |
| | | 7000=新建自动化 |
| | | 7001=编辑自动化 |
| | |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\icon1.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\icon2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\succeed.png" /> |
| | | <AndroidAsset Include="Assets\Phone\LogicIcon\selected+.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202102252" android:versionName="1.1.202102252" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103021" android:versionName="1.1.202103021" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> |
| | | <!-- 定位权限--> |
| | | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| | |
| | | <!-- Required. AppKey copied from Portal --> |
| | | <meta-data android:name="JPUSH_APPKEY" android:value="cbd90743ac45cbca06c8118b" /> |
| | | <!-- 极光推送结束 --> |
| | | |
| | | |
| | | |
| | | </application> |
| | | </manifest> |
| | |
| | | #pragma warning disable 1591 |
| | | //------------------------------------------------------------------------------ |
| | | // <auto-generated> |
| | | // 此代码由工具生成。 |
| | | // 运行时版本:4.0.30319.42000 |
| | | // This code was generated by a tool. |
| | | // |
| | | // 对此文件的更改可能会导致不正确的行为,并且如果 |
| | | // 重新生成代码,这些更改将会丢失。 |
| | | // Changes to this file may cause incorrect behavior and will be lost if |
| | | // the code is regenerated. |
| | | // </auto-generated> |
| | | //------------------------------------------------------------------------------ |
| | | |
| | |
| | | { |
| | | |
| | | |
| | | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] |
| | | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] |
| | | public partial class Resource |
| | | { |
| | | |
| | |
| | | <BundleResource Include="Resources\Phone\LogicIcon\-.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\+.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\point.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\ selected+.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\selected-.png" /> |
| | | <BundleResource Include="Resources\Phone\oRobot.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorWheelGray.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\PirIcon\online.png" /> |
| | | <BundleResource Include="Resources\Phone\PirIcon\adddevice.png" /> |
| | | <BundleResource Include="Resources\Phone\PirIcon\next.png" /> |
| | | <BundleResource Include="Resources\Phone\LogicIcon\selected+.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.1.202102242</string> |
| | | <string>1.1.202103021</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>202102242</string> |
| | | <string>202103021</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 417=Water Leakage |
| | | 418=In Alarm |
| | | 419=Normal |
| | | 420=Hot Dry |
| | | 421=Air Dry |
| | | 420=Hot dry |
| | | 421=Air dry |
| | | 422=Disinfect |
| | | 423=Lighting |
| | | 424=Time |
| | | 425=Hot dry time |
| | | 426=Air dry time |
| | | 427=Disinfect time |
| | | 428=Anion Time |
| | | 429=h |
| | | 430=m |
| | | |
| | | |
| | | 1002=Anion |
| | | |
| | | 5000=Music |
| | | 5001=Group |
| | |
| | | 421=风干 |
| | | 422=消毒 |
| | | 423=照明 |
| | | 424=时间 |
| | | 425=烘干时间 |
| | | 426=风干时间 |
| | | 427=消毒时间 |
| | | 428=负离子时间 |
| | | 429=小时 |
| | | 430=分钟 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | public const int Lightint = 433; |
| | | public const int MinuteUint = 430; |
| | | public const int HourUint = 429; |
| | | public const int AnionTime = 428; |
| | | public const int DisinfectTime = 427; |
| | | public const int WindDryTime = 426; |
| | | public const int HotDryTime = 425; |
| | | public const int Time = 424; |
| | | public const int Lightint = 423; |
| | | public const int Disinfect = 422; |
| | | public const int WindDry = 421; |
| | | public const int HotDry = 420; |
| | |
| | | /// A协议数据 |
| | | /// </summary> |
| | | /// <param name="updateBytes"></param> |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes) |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false) |
| | | { |
| | | MainPage.Log($"A协议更新状态:{revString}"); |
| | | |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | | { |
| | | if (FunctionList.List.GetDeviceFunctionList(SPK.BrandType.Tuya).Count == 0) |
| | | { |
| | | //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理..."); |
| | | return; |
| | | } |
| | | } |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString); |
| | | if (temp != null) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | //bool hadChange = false;//状态有变化再更新界面 |
| | | var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | | { |
| | | if(!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk)) |
| | | { |
| | | //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理........"); |
| | | return; |
| | | } |
| | | } |
| | | //MainPage.Log($"A协议更新状态:{revString}"); |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | var attrState = localFunction.status.Find((func) => func.key == attr.key); |
| | | if(attrState!= null) |
| | | { |
| | | attrState.value = attr.value; |
| | | } |
| | | } |
| | | |
| | | if (localFunction != null) |
| | | { |
| | | //更新界面状态 |
| | |
| | | try |
| | | { |
| | | var topic = e.ApplicationMessage.Topic; |
| | | MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //MainPage.Log($"收到mqtt主题:{topic}"); |
| | | //一端口主题处理 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | { |
| | |
| | | { |
| | | var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); |
| | | var revString = Encoding.UTF8.GetString(bytes); |
| | | Control.Ins.UpdataFunctionStatus(revString, null); |
| | | Control.Ins.UpdataFunctionStatus(revString, null,true); |
| | | } |
| | | //一端口数据解析 |
| | | else |
| | |
| | | { |
| | | public class NewAPI |
| | | { |
| | | #region 新微服务接口 |
| | | //#region 新微服务接口 |
| | | //*********************************************** |
| | | //注意:和住宅相关的接口要请求住宅所在区域的域名 regionUrl |
| | | //*********************************************** |
| | |
| | | /// 消毒剩余时间 |
| | | /// </summary> |
| | | public const string DisinfectTimeLeft = "disinfect_time_surplus"; |
| | | /// <summary> |
| | | /// 负离子 |
| | | /// </summary> |
| | | public const string Anion = "anion"; |
| | | /// <summary> |
| | | /// 负离子时间 |
| | | /// </summary> |
| | | public const string AnionTime = "anion_time"; |
| | | /// <summary> |
| | | /// 负离子剩余时间 |
| | | /// </summary> |
| | | public const string AnionTimeLeft = "anion_time_surplus"; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\WeatherCondition.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\1-test-\TestDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\ThirdPartyBrandListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\EmptyClass.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\AddThirdPartyBrandListpage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Entity\Integratedbrand\IntegratedBrand.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\AirCleaner.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Method.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FailView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\ClothesHangerSetTimePage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.1.0225"; |
| | | public static string VersionString = "1.1.0302"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | |
|
| | | var dialogBody = new NormalFrameLayout();
|
| | | FrameDialog.AddChidren(dialogBody);
|
| | | FrameDialog.Show();
|
| | | dialogBody.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (ClickBackClose == true && this.btnCancel != null)
|
| | |
| | | btnConfirm.TextSize = CSS_FontSize.TextFontSize;
|
| | | frameWhiteBack.AddChidren(btnConfirm);
|
| | |
|
| | | FrameDialog.Show();
|
| | |
|
| | | return frameWhiteBack;
|
| | | }
|
| | |
|
| | |
| | | /// 结束事件(0:点击了取消 1:点击了确定,第二,三参数为时和分)
|
| | | /// </summary>
|
| | | public Action<int, int, int> FinishEvent = null;
|
| | | /// <summary> |
| | | /// 小时取值范围 |
| | | /// </summary>
|
| | | List<int> hRange = new List<int>();
|
| | | /// <summary> |
| | | /// 分钟取值范围 |
| | | /// </summary>
|
| | | List<int> mRange = new List<int>(); |
| | | /// <summary> |
| | | /// 时间控件 |
| | | /// </summary> |
| | | UIPickerView pickerView; |
| | | //选择的时与分 |
| | | int selectHour = 0; |
| | | int selectMinute = 0; |
| | | //XX时 |
| | | List<string> listHour ; |
| | | //XX分 |
| | | List<string> listMinute;
|
| | |
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | {
|
| | | base.ClickBackClose = clickBackClose;
|
| | | base.StrTitle = i_title;
|
| | | |
| | | |
| | | for (int i = 0; i <= 23; i++)
|
| | | {
|
| | | hRange.Add(i);
|
| | | }
|
| | | for (int i = 0; i <= 59; i++)
|
| | | {
|
| | | mRange.Add(i);
|
| | | }
|
| | | } |
| | | |
| | | |
| | | /// <summary>
|
| | | /// 底部时间选择控件
|
| | | /// </summary>
|
| | | /// <param name="i_title">标题</param>
|
| | | /// <param name="clickBackClose">点击背景时,是否关闭弹窗</param>
|
| | | public BottomTimeSelectControl(List<int> hoursRange,List<int> minuteRange ,int rowCount, string i_title = "", bool clickBackClose = true)
|
| | | {
|
| | | base.ClickBackClose = clickBackClose;
|
| | | base.StrTitle = i_title;
|
| | |
|
| | | hRange = hoursRange; |
| | | mRange = minuteRange; |
| | | |
| | | base.RowCount = rowCount; |
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_hour">默认选择时</param>
|
| | | /// <param name="i_minute">默认选择分</param>
|
| | | public void InitControl(int i_hour, int i_minute)
|
| | | /// <param name="contentView">选择区域高度</param>
|
| | | public void InitControl(int i_hour, int i_minute,int contentView = 297)
|
| | | {
|
| | | //已经初始化
|
| | | if (base.btnCancel != null) { return; }
|
| | |
|
| | | //初始化底层控件
|
| | | var frameWhiteBack = base.InitBaseControl();
|
| | | frameWhiteBack.Height = Application.GetRealHeight(297);
|
| | | frameWhiteBack.Y = frameWhiteBack.Parent.Height - Application.GetRealHeight(297 + 20);
|
| | |
|
| | | //选择的时与分
|
| | | int selectHour = 0;
|
| | | int selectMinute = 0;
|
| | | frameWhiteBack.Height = Application.GetRealHeight(contentView);
|
| | | //frameWhiteBack.Y = frameWhiteBack.Parent.Height - Application.GetRealHeight(297 + 20);
|
| | |
|
| | | //取消
|
| | | base.btnCancel.ButtonClickEvent += (sender, e) =>
|
| | |
| | | frameWhiteBack.AddChidren(btnLine);
|
| | |
|
| | | //时间控件
|
| | | var pickerView = new UIPickerView();
|
| | | pickerView = new UIPickerView();
|
| | | //时
|
| | | var strhour = Language.StringByID(StringId.h);
|
| | | //分
|
| | | var strMinute = Language.StringByID(StringId.m);
|
| | | //XX时
|
| | | var listHour = new List<string> { "00" + strhour };
|
| | | listHour = new List<string>();// { "00" + strhour };
|
| | | //XX分
|
| | | var listMinute = new List<string> { "00" + strMinute };
|
| | | for (int i = 1; i <= 23; i++)
|
| | | listMinute = new List<string>();// { "00" + strMinute }; |
| | | //for (int i = 1; i <= 23; i++) |
| | | foreach(var hItem in hRange) |
| | | {
|
| | | listHour.Add(i.ToString().PadLeft(2, '0') + strhour);
|
| | | listHour.Add(hItem.ToString().PadLeft(2, '0') + strhour);
|
| | | }
|
| | | for (int i = 1; i <= 59; i++)
|
| | | //for (int i = 1; i <= 59; i++) |
| | | foreach (var mItem in mRange) |
| | | {
|
| | | listMinute.Add(i.ToString().PadLeft(2, '0') + strMinute);
|
| | | listMinute.Add(mItem.ToString().PadLeft(2, '0') + strMinute);
|
| | | }
|
| | | pickerView.Height = frameWhiteBack.Height - btnLine.Bottom;
|
| | | pickerView.Width = frameWhiteBack.Width - Application.GetRealWidth(8) * 2;
|
| | |
| | | };
|
| | | }
|
| | |
|
| | | /// <summary> |
| | | /// 特殊的集合选择事件,凉霸时间设置使用 |
| | | /// </summary>
|
| | | public void ChangePickerEvent() |
| | | { |
| | | pickerView.OnSelectChangeEvent = (value1, value2, value3) =>
|
| | | { |
| | | if (value1 == 0 && value2 == 0) |
| | | { |
| | | value2 = 1; |
| | | pickerView.setCurrentItems(value1, value2, 0); |
| | | } |
| | | else if (value1 == 4 && value2 == 1) |
| | | { |
| | | value2 = 0; |
| | | pickerView.setCurrentItems(value1, value2, 0); |
| | | } |
| | | else |
| | | { |
| | | //更改索引 |
| | | selectHour = Convert.ToInt32(listHour[value1].Substring(0, 2)); |
| | | selectMinute = Convert.ToInt32(listMinute[value2].Substring(0, 2)); |
| | | }
|
| | | }; |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
| | | //return; |
| | | if (b) |
| | | { |
| | | etAccount.Text = "13415629083";// "13415629083"//cf;//tujie"18316120654";// "15622703419";// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "18666455392";//"18316120654";//lcg "18316672920";//hzx;// "13415629083"//cf;//tujie"18316120654"; |
| | | // "15622703419";// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | } |
| | | else |
| | | { |
| | | etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | etAccount.Text = "18316672920";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | { |
| | | if (view.Tag.ToString() == function.sid) |
| | | { |
| | | var state = function.trait_on_off.curValue.ToString() == "on"; |
| | | var state = false; |
| | | if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || function.spk == SPK.CurtainTrietex || |
| | | function.spk == SPK.CurtainSwitch)//窗帘设备根据百分比判断开关状态 |
| | | { |
| | | state = function.GetAttrState(FunctionAttributeKey.Percent) != "0"; |
| | | } |
| | | else |
| | | { |
| | | state = function.trait_on_off.curValue.ToString() == "on"; |
| | | } |
| | | for (int i = 0; i < view.ChildrenCount; i++) |
| | | { |
| | | if (view.GetChildren(i).GetType() == typeof(Button)) |
| | |
| | | /// </summary> |
| | | void LoadEvent_ControlCurtain(Curtain curtain, Button btnClose, Button btnOpen) |
| | | { |
| | | btnClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = true; |
| | | }; |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnClose.IsSelected = false; |
| | | btnClose.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 0; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | btnOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnOpen.IsSelected = true; |
| | | }; |
| | | btnOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnOpen.IsSelected = false; |
| | | btnOpen.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 100; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | case FunctionCategory.Light: |
| | | case FunctionCategory.AC: |
| | | case FunctionCategory.FloorHeat: |
| | | case FunctionCategory.Electric: |
| | | #region 按钮状态更新 |
| | | if (cTag == updataFunction.sid + "_Switch") |
| | | { |
| | |
| | | #endregion |
| | | case FunctionCategory.Curtain: |
| | | #region 窗帘更新 |
| | | var uCurtain = updataFunction as Curtain; |
| | | switch (uCurtain.trait_on_off.curValue.ToString()) |
| | | //var uCurtain = updataFunction as Curtain; |
| | | var percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); |
| | | if (percentString != null) |
| | | { |
| | | case "off": |
| | | int percent = 0; |
| | | int.TryParse(percentString, out percent); |
| | | if (percent == 0) |
| | | { |
| | | if (cTag == updataFunction.sid + "_off") |
| | | { |
| | | try |
| | |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | case "on": |
| | | } |
| | | else |
| | | { |
| | | if (cTag == updataFunction.sid + "_on") |
| | | { |
| | | try |
| | |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | case "stop": |
| | | if (cTag == updataFunction.sid + "_stop") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | } |
| | | #endregion |
| | | break; |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "off", |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0", |
| | | Tag = function.sid + "_off" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainClose); |
| | |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", |
| | | Tag = function.sid + "_stop", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "stop" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainStop); |
| | | |
| | |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | Tag = function.sid + "_on", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on" |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0" |
| | | }; |
| | | bodyDiv.AddChidren(btnCurtainOpen); |
| | | LoadEvent_ControlCurtain(btnCurtainStop, btnCurtainOpen, btnCurtainClose, function as Curtain); |
| | |
| | | onDimmerBar = false; |
| | | (bodyDiv.Parent as VerticalScrolViewLayout).ScrollEnabled = true; |
| | | light.brightness = dimmerControlBar.Progress; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("brightness", light.brightness.ToString()); |
| | | Control.Ins.SendWriteCommand(light, d); |
| | | }; |
| | |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | |
| | | btnClose.IsSelected = false; |
| | | btnOpen.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | |
| | | btnStop.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | |
| | | { |
| | | |
| | | string value = dic["value"]; |
| | | if (value == "true") |
| | | if (value == "open") |
| | | { |
| | | inputView.btnState.Text = Language.StringByID(StringId.kaiqi); |
| | | |
| | |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | if (value == "true") |
| | | if (value == "open") |
| | | { |
| | | button1.Text = Language.StringByID(StringId.kaiqi); |
| | | } |
| | |
| | | { |
| | | if (uCurtain.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = true; |
| | | //bodyView.btnCurtainOpen.IsSelected = false; |
| | | //bodyView.btnCurtainClose.IsSelected = false; |
| | | //bodyView.btnCurtainStop.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = true; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | //bodyView.btnCurtainOpen.IsSelected = true; |
| | | //bodyView.btnCurtainClose.IsSelected = false; |
| | | //bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainBgIcon.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | //bodyView.btnCurtainOpen.IsSelected = false; |
| | | //bodyView.btnCurtainClose.IsSelected = true; |
| | | //bodyView.btnCurtainStop.IsSelected = false; |
| | | bodyView.btnCurtainBgIcon.IsSelected = false; |
| | | } |
| | | } |
| | |
| | | void LoadEvent_ControlEvent() |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) { IsBackground = true }.Start(); |
| | | btnCurtainBgIcon.IsSelected = false; |
| | | curtain.trait_on_off.curValue = "off"; |
| | | //Control.Send(CommandType_A.write,curtain); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | //btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | //{ |
| | | // btnCurtainStop.IsSelected = true; |
| | | // //btnCurtainClose.IsSelected = false; |
| | | // //btnCurtainOpen.IsSelected = false; |
| | | //}; |
| | | //btnCurtainOpen.MouseDownEventHandler = (sender, e) => { |
| | | // btnCurtainOpen.IsSelected = true; |
| | | //}; |
| | | //btnCurtainClose.MouseDownEventHandler = (sender, e) => { |
| | | // btnCurtainClose.IsSelected = true; |
| | | //}; |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | }; |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = true; |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | | btnCurtainStop.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("on_off", curtain.trait_on_off.curValue.ToString()); |
| | |
| | | }; |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | | btnCurtainOpen.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | btnCurtainBgIcon.IsSelected = true; |
| | | curtain.trait_on_off.curValue = "on"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | Height = Application.GetRealWidth(177), |
| | | Progress = curtain.percent, |
| | | ProgressTextColor =0x00000000, |
| | | IsInvertedProgress = true, |
| | | //IsInvertedProgress = true, |
| | | }; |
| | | controlView.AddChidren(curtainSeekBar); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = curtain.GetAttrState(FunctionAttributeKey.Percent) == "0" |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | IsSelected = curtain.GetAttrState(FunctionAttributeKey.Percent) != "0" |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
| | |
| | | return; |
| | | if (uCurtain.spk == bodyView.curtain.spk && uCurtain.sid == bodyView.curtain.sid) |
| | | { |
| | | if (uCurtain.trait_on_off.curValue.ToString() == "stop") |
| | | var percentString = uCurtain.GetAttrState(FunctionAttributeKey.Percent); |
| | | if (percentString != null) |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = true; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | int percent = 0; |
| | | int.TryParse(percentString, out percent); |
| | | bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | } |
| | | try |
| | | { |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainClose.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 100; |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | onCurtainAnimation = false; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainStop.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | onCurtainAnimation = false; |
| | | }; |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = true; |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainOpen.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 0; |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | CurtainAnimation(curtain.percent); |
| | | }; |
| | | |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | |
| | | //btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // curtain.percent--; |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = curtain.GetAttrState(FunctionAttributeKey.Percent) == "0", |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | IsSelected = curtain.GetAttrState(FunctionAttributeKey.Percent) != "0", |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
| | |
| | | return; |
| | | if (uCurtain.spk == bodyView.curtain.spk && uCurtain.sid == bodyView.curtain.sid) |
| | | { |
| | | if (uCurtain.trait_on_off.curValue.ToString() == "stop") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = true; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = true; |
| | | bodyView.btnCurtainClose.IsSelected = false; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | } |
| | | else if (uCurtain.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | bodyView.btnCurtainOpen.IsSelected = false; |
| | | bodyView.btnCurtainClose.IsSelected = true; |
| | | bodyView.btnCurtainStop.IsSelected = false; |
| | | } |
| | | var percentString = uCurtain.GetAttrState(FunctionAttributeKey.Percent); |
| | | int percent = 0; |
| | | int.TryParse(percentString, out percent); |
| | | bodyView.btnCurtainOpen.IsSelected = percent > 0; |
| | | bodyView.btnCurtainClose.IsSelected = percent == 0; |
| | | try |
| | | { |
| | | if (!bodyView.onCurtainAnimation) |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = false; |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainStop.IsSelected = false; |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainClose.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "off"; |
| | | curtain.percent = 100; |
| | | curtain.percent = 0; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = false; |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => { |
| | | btnCurtainStop.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "stop"; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | btnCurtainStop.IsSelected = false; |
| | | btnCurtainOpen.IsSelected = true; |
| | | //new System.Threading.Thread(() => { |
| | | // System.Threading.Thread.Sleep(2000); |
| | | // Application.RunOnMainThread(() => { |
| | | // btnCurtainOpen.IsSelected = false; |
| | | // }); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | curtain.trait_on_off.curValue = "on"; |
| | | curtain.percent = 0; |
| | | curtain.percent = 100; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString()); |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | |
| | | DriverLayer.Control.Ins.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainStop.IsSelected = true; |
| | | }; |
| | | btnCurtainOpen.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainOpen.IsSelected = true; |
| | | btnCurtainClose.IsSelected = false; |
| | | }; |
| | | btnCurtainClose.MouseDownEventHandler = (sender, e) => |
| | | { |
| | | btnCurtainClose.IsSelected = true; |
| | | btnCurtainOpen.IsSelected = false; |
| | | }; |
| | | |
| | | |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | |
| | | FrameWhiteCentet1.AddChidren(hotDryView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | device.SetAttrState(FunctionAttributeKey.HotDry, "true"); |
| | | string onoff = hotDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.HotDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.HotDry, "true"); |
| | | d.Add(FunctionAttributeKey.HotDry, onoff); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | hotDryView.SetThouchEvent(eventHandler); |
| | |
| | | FrameWhiteCentet1.AddChidren(windDryView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | device.SetAttrState(FunctionAttributeKey.WindDry, "true"); |
| | | string onoff = windDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.WindDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.WindDry, "true"); |
| | | d.Add(FunctionAttributeKey.WindDry, onoff); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | windDryView.SetThouchEvent(eventHandler); |
| | |
| | | FrameWhiteCentet1.AddChidren(disinfectView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | device.SetAttrState(FunctionAttributeKey.Disinfect, "true"); |
| | | string onoff = disinfectView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.Disinfect, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Disinfect, "true"); |
| | | d.Add(FunctionAttributeKey.Disinfect, onoff); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | disinfectView.SetThouchEvent(eventHandler); |
| | |
| | | |
| | | index++; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 时间设置 |
| | | var timeSetView = new ClothesHangerControl( |
| | | "FunctionIcon/Electrical/ClothesHanger/ClothesHangerTimeIcon.png", |
| | | "FunctionIcon/Electrical/ClothesHanger/ClothesHangerTimeIconOn.png", |
| | | Language.StringByID(StringId.Time), |
| | | ""); |
| | | timeSetView.Width = Application.GetRealWidth(96); |
| | | timeSetView.Height = Application.GetRealHeight(74); |
| | | timeSetView.Y = Application.GetRealHeight(409); |
| | | timeSetView.X = Application.GetRealWidth(266 - 33); |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler_timeSetView = (sender, e) => |
| | | { |
| | | var setTimePage = new ClothesHangerSetTimePage(device); |
| | | MainPage.BasePageView.AddChidren(setTimePage); |
| | | setTimePage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | timeSetView.SetThouchEvent(eventHandler_timeSetView); |
| | | |
| | | FrameWhiteCentet1.AddChidren(timeSetView); |
| | | |
| | | #endregion |
| | | } |
| | |
| | | if (hotDryTimeLeftTemp != null) |
| | | { |
| | | hotDryView.ChangeTime(hotDryTimeLeftTemp.value); |
| | | MainPage.Log($"烘干剩余时间{hotDryTimeLeftTemp.value}"); |
| | | } |
| | | var windDryTimeLeftTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.WindDryTimeLeft); |
| | | if (windDryTimeLeftTemp != null) |
| | | { |
| | | windDryView.ChangeTime(windDryTimeLeftTemp.value); |
| | | MainPage.Log($"风干剩余时间{windDryTimeLeftTemp.value}"); |
| | | } |
| | | var disinfectTimeLeftTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.DisinfectTimeLeft); |
| | | if (disinfectTimeLeftTemp != null) |
| | | { |
| | | disinfectView.ChangeTime(disinfectTimeLeftTemp.value); |
| | | MainPage.Log($"消毒剩余时间{disinfectTimeLeftTemp.value}"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | private Button btnTitle; |
| | | private Button btnTime; |
| | | /// <summary> |
| | | /// 倒计时时间 |
| | | /// </summary> |
| | | private int leftTime = 0; |
| | | /// <summary> |
| | | /// 控件是否点亮 |
| | | /// </summary> |
| | | public bool Lighting = false; |
| | | |
| | | |
| | | |
| | | public ClothesHangerControl(string iconPath1, string iconPath2,string title,string time) |
| | | { |
| | |
| | | /// <param name="newTime"></param> |
| | | public void ChangeTime (string newTime) |
| | | { |
| | | if(newTime == "0") |
| | | { |
| | | newTime = ""; |
| | | } |
| | | |
| | | int time = 0; |
| | | int.TryParse(newTime, out time); |
| | | time = time * 60; |
| | | |
| | | int.TryParse(newTime, out leftTime); |
| | | leftTime *= 60; |
| | | if (countdownThread == null) |
| | | { |
| | | countdownThread = new System.Threading.Thread(() => { |
| | | while(true) |
| | | { |
| | | if(time>1) |
| | | if(leftTime > 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnTime.Text = new TimeSpan(0, 0, time).ToString(); |
| | | btnTime.Text = new TimeSpan(0, 0, leftTime).ToString(); |
| | | }); |
| | | System.Threading.Thread.Sleep(1000); |
| | | time--; |
| | | leftTime--; |
| | | }else |
| | | { |
| | | Application.RunOnMainThread(() => |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class ClothesHangerSetTimePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | Function device; |
| | | |
| | | public ClothesHangerSetTimePage(Function function) |
| | | { |
| | | device = function; |
| | | bodyView = this; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Time)).LoadTopView(); |
| | | |
| | | VerticalScrolViewLayout functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(530), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 小时取值范围 |
| | | /// </summary> |
| | | List<int> hRange = new List<int> { 0, 1, 2, 3, 4 }; |
| | | /// <summary> |
| | | /// 分钟取值范围 |
| | | /// </summary> |
| | | List<int> mRange = new List<int> { 0, 30 }; |
| | | |
| | | var menu = new List<string>() { |
| | | FunctionAttributeKey.HotDryTime, |
| | | FunctionAttributeKey.WindDryTime, |
| | | FunctionAttributeKey.DisinfectTime, |
| | | FunctionAttributeKey.AnionTime |
| | | }; |
| | | List<string> attrs = device.GetAttributes(); |
| | | |
| | | #region 烘干时间 |
| | | ListCellView hotDryTimeCell; |
| | | hotDryTimeCell = new ListCellView() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | hotDryTimeCell.BtnTilte.TextID = StringId.HotDryTime; |
| | | |
| | | if (attrs.Contains(menu[0])) |
| | | { |
| | | |
| | | var hotDryTime = 0; |
| | | int.TryParse(device.GetAttrState(FunctionAttributeKey.HotDryTime), out hotDryTime); |
| | | hotDryTimeCell.BtnSubtitle.Text = hotDryTime / 60 + Language.StringByID(StringId.HourUint) + hotDryTime % 60 + Language.StringByID(StringId.MinuteUint); |
| | | |
| | | functionListView.AddChidren(hotDryTimeCell); |
| | | hotDryTimeCell.GoAction = () => |
| | | { |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.HotDryTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | | timeControl.ChangePickerEvent(); |
| | | timeControl.FinishEvent = (type, hours, min) => |
| | | { |
| | | if (type == 1)//0:取消;1:确定 |
| | | { |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var time = hours * 60 + min; |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(FunctionAttributeKey.HotDryTime, time.ToString()); |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | hotDryTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint); |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 风干时间 |
| | | ListCellView windDryCell; |
| | | windDryCell = new ListCellView() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | windDryCell.BtnTilte.TextID = StringId.WindDryTime; |
| | | |
| | | windDryCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.WindDryTime); |
| | | |
| | | if (attrs.Contains(menu[1])) |
| | | { |
| | | var windDryTime = 0; |
| | | int.TryParse(device.GetAttrState(FunctionAttributeKey.WindDryTime), out windDryTime); |
| | | windDryCell.BtnSubtitle.Text = windDryTime / 60 + Language.StringByID(StringId.HourUint) + windDryTime % 60 + Language.StringByID(StringId.MinuteUint); |
| | | |
| | | functionListView.AddChidren(windDryCell); |
| | | windDryCell.GoAction = () => |
| | | { |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.WindDryTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | | timeControl.ChangePickerEvent(); |
| | | timeControl.FinishEvent = (type, hours, min) => |
| | | { |
| | | if (type == 1)//0:取消;1:确定 |
| | | { |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var time = hours * 60 + min; |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(FunctionAttributeKey.WindDryTime, time.ToString()); |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | windDryCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint); |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | hotDryTimeCell.LineView.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 消毒时间 |
| | | ListCellView disinfectTimeCell; |
| | | disinfectTimeCell = new ListCellView() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | disinfectTimeCell.BtnTilte.TextID = StringId.DisinfectTime; |
| | | |
| | | disinfectTimeCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.DisinfectTime); |
| | | |
| | | if (attrs.Contains(menu[2])) |
| | | { |
| | | var disinfectTime = 0; |
| | | int.TryParse(device.GetAttrState(FunctionAttributeKey.DisinfectTime), out disinfectTime); |
| | | disinfectTimeCell.BtnSubtitle.Text = disinfectTime / 60 + Language.StringByID(StringId.HourUint) + disinfectTime % 60 + Language.StringByID(StringId.MinuteUint); |
| | | |
| | | functionListView.AddChidren(disinfectTimeCell); |
| | | disinfectTimeCell.GoAction = () => { |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3, Language.StringByID(StringId.DisinfectTime)); |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | | timeControl.ChangePickerEvent(); |
| | | timeControl.FinishEvent = (type, hours, min) => { |
| | | if (type == 1)//0:取消;1:确定 |
| | | { |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var time = hours * 60 + min; |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(FunctionAttributeKey.DisinfectTime, time.ToString()); |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | disinfectTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint); |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | windDryCell.LineView.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 负离子时间 |
| | | ListCellView anionTimeCell; |
| | | anionTimeCell = new ListCellView() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | anionTimeCell.BtnTilte.TextID = StringId.AnionTime; |
| | | |
| | | anionTimeCell.BtnSubtitle.Text = device.GetAttrState(FunctionAttributeKey.AnionTime); |
| | | |
| | | if (attrs.Contains(menu[3])) |
| | | { |
| | | var anionTime = 0; |
| | | int.TryParse(device.GetAttrState(FunctionAttributeKey.HotDryTime), out anionTime); |
| | | anionTimeCell.BtnSubtitle.Text = anionTime / 60 + Language.StringByID(StringId.HourUint) + anionTime % 60 + Language.StringByID(StringId.MinuteUint); |
| | | |
| | | functionListView.AddChidren(anionTimeCell); |
| | | anionTimeCell.LineView.RemoveFromParent(); |
| | | |
| | | anionTimeCell.GoAction = () => { |
| | | BottomTimeSelectControl timeControl = new BottomTimeSelectControl(hRange, mRange,3,Language.StringByID(StringId.AnionTime)); |
| | | |
| | | |
| | | timeControl.RowHeight = Application.GetRealHeight(50); |
| | | timeControl.InitControl(0, 1, 162); |
| | | |
| | | timeControl.ChangePickerEvent(); |
| | | |
| | | timeControl.FinishEvent = (type, hours, min) => { |
| | | if (type == 1)//0:取消;1:确定 |
| | | { |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | var time = hours * 60 + min; |
| | | var dic = new Dictionary<string, string>(); |
| | | dic.Add(FunctionAttributeKey.AnionTime, time.ToString()); |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | anionTimeCell.BtnSubtitle.Text = time / 60 + Language.StringByID(StringId.HourUint) + time % 60 + Language.StringByID(StringId.MinuteUint); |
| | | }); |
| | | }); |
| | | } |
| | | }; |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | disinfectTimeCell.LineView.RemoveFromParent(); |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | |
| | | //--------------------------------------- |
| | | public partial class ClothesHangerSetTimePage |
| | | { |
| | | |
| | | } |
| | | |
| | | //======================================== |
| | | |
| | | |
| | | } |