| | |
| | | var req = new SendAuth.Req { Scope = "snsapi_userinfo", State = "ZigbeeApp" }; |
| | | api.SendReq(req); |
| | | } |
| | | /// <summary>
/// 所有初始化全部在这个方法实现
/// </summary>
void initAll()
{
BaseActivity.IsEnnableGPS = false; |
| | | /// <summary>
/// 所有初始化全部在这个方法实现
/// </summary>
void initAll()
{ |
| | | Shared.Application.IsGpsEnable = false; |
| | | //设置极光调试模式,为false时只打印警告信息 |
| | | // System.Console.WriteLine($"AAA : {System.DateTime.Now.ToString()}"); |
| | | #if Release
JPushInterface.SetDebugMode(false); |
| | |
| | | 5366=联动事件 |
| | | 5367=当前 |
| | | 5368=选择楼层 |
| | | |
| | | 5369=请选择延时时间,否则无法执行下一步. |
| | | 5370=请选择用户,否则无法执行下一步. |
| | | 5371=请选择场景,否则无法执行下一步. |
| | | 5372=请选择安防模式,否则无法执行下一步. |
| | | |
| | | |
| | | |
| | |
| | | 13506=5挡 |
| | | 13511=请清洁滤网 |
| | | |
| | | |
| | | 13600=没功能 {\r\n} 请先添加 |
| | | 13601=没场景 {\r\n} 请先添加 |
| | | |
| | | |
| | | |
| | |
| | | 15050=停止搜索 |
| | | 15051=正在搜索网关… |
| | | 15052=请稍候··· |
| | | 15053=请确保网关与网线连接{0}系统灯每秒闪烁一次 |
| | | 15053=请确保网关用网线正常连接路由器{0}正常连接则系统指示灯1秒闪烁 |
| | | 15054=网关名称 |
| | | 15055=住宅名称 |
| | | 15056=完成 |
| | |
| | | 15776=还没有共享区域给成员{0}可点击右上角“+”添加 |
| | | 15777=确认删除共享房间? |
| | | 15778=还没绑定网关哦 |
| | | 15779=解决方法,可选择执行以下任意一种方式: |
| | | 15780=1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。 |
| | | 15781=2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。 |
| | | 15779=解决方法,可选择执行以下任意一种方式: |
| | | 15780=1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP |
| | | 15781=2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启 |
| | | 15782=3.请重试,重新添加网关。 |
| | | 15783=4.返回网关管理。 |
| | | 15784=重试 |
| | |
| | | 15904=AP模式 |
| | | 15905=跳转到移动设备 |
| | | 15906=WLAN设置连接家庭WiFi |
| | | 15907=长按网关HID/WCFG按键20秒{0}系统灯快闪60秒则进入配网状态{0}系统灯每秒闪烁一次{0}则连接成功 |
| | | 15908=长按网关HID/WCFG按键5秒{0}系统灯常亮60秒后则进入配网状态 |
| | | 15909=跳转到移动设备WLAN设置{0}选择hdlZigbeeGW-xxxx网络 |
| | | 15907=网关如果正常连接路由器{0}系统指示灯会1秒闪烁 |
| | | 15908=请先长按HID/WCFG按键大概5秒{0}直到系统指示灯常亮{0}网关进入AP模式热点 |
| | | 15909=手机去设置连接网关热点{0}即hdlZigbeeGW-xxxx,密码hdl123456{0}可查看网关背面标签查看热点名字和密码 |
| | | 15910=请输入家庭WIFI账号 |
| | | 15911=请前往移动设备WLAN设置{0}重新连接家庭wiFi |
| | | 15912=系统灯每秒闪烁一次{0}则连接成功 |
| | | 15911=手机去设置连接路由器 |
| | | 15912=网关如果正常连接路由器{0}系统指示灯会1秒闪烁 |
| | | 15915=选择地点 |
| | | 15916=您的反馈和意见会让我们变得更好 |
| | | 15917=反馈类型 |
| | |
| | | 15981=选择hdlZigbeeGW-xxxx网络 |
| | | 15982=请连接家庭WiFi |
| | | 15983=正在获取分享数据 |
| | | 15984=请先去设置手机连接到路由器{0}然后长按网关HID/WCFG按键大概20秒{0}直到系统指示灯快闪{0}网关进入UDP模式WIFI配网 |
| | | 15985=网关添加指引 |
| | | 15986=1.请用网线连接网关网口到路由器,并观察网口LED亮并闪烁或观察外壳网口指示灯亮并闪烁 |
| | | 15987=2.网关重启大约需要1分钟,这时观察外壳系统指示灯,如果1秒闪烁,表示网关连接路由器正常,可以用APP进行添加网关步骤 |
| | | 15988=网关硬件问题帮助 |
| | | 15989=1.网口指示灯不亮,检查网线或路由器是否正常 |
| | | 15990=2.系统启动之后(系统指示灯5秒闪烁,表示系统启动成功),系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP |
| | | 15991=系统启动之后(系统指示灯5秒闪烁,表示系统启动成功) |
| | | 15992=2.根据APP提示进入之后的步骤 |
| | | 15993=1.请先长按网关HID/WCFG按键大概20秒,直到系统指示灯快闪,网关进入UDP模式WIFI配网 |
| | | 15994=1.请先长按网关HID/WCFG按键大概5秒,直到系统指示灯常亮,网关进入AP模式WIFI配网 |
| | | 15995=1.短按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏 |
| | | 15996=2.长按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏 |
| | | 15997=3.系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP |
| | | 15998=请前往住宅管理{0}设置住宅的地理位置 |
| | | 15999=未知楼层 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | <Reference Include="Xamarin.Android.Support.Core.Utils">
|
| | | <HintPath>..\Shared\DLL\Android\Xamarin.Android.Support.Core.Utils.dll</HintPath>
|
| | | </Reference>
|
| | | <Reference Include="Xamarin.Android.Support.Design">
|
| | | <HintPath>..\Shared\DLL\Android\Xamarin.Android.Support.Design.dll</HintPath>
|
| | | </Reference>
|
| | | <Reference Include="Xamarin.Android.Support.Fragment">
|
| | | <HintPath>..\Shared\DLL\Android\Xamarin.Android.Support.Fragment.dll</HintPath>
|
| | | </Reference>
|
| | |
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\ZigeeLogic\sensor0.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Item\SeekBarIcon.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\ZigeeLogic\progressbtn_2.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\ZigeeLogic\progressbtn2.png" />
|
| | | </ItemGroup>
|
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
| | | <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" />
|
| | |
| | | <CodesignKey>iPhone Developer</CodesignKey> |
| | | <MtouchDebug>true</MtouchDebug> |
| | | <MtouchExtraArgs>-gcc_flags -dead_strip</MtouchExtraArgs> |
| | | <MtouchI18n>cjk</MtouchI18n> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | | <DebugType>none</DebugType> |
| | |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | <MtouchArch>ARM64</MtouchArch> |
| | | <CodesignKey>iPhone Developer</CodesignKey> |
| | | <MtouchI18n>cjk</MtouchI18n> |
| | | <DeviceSpecificBuild>true</DeviceSpecificBuild> |
| | | <MtouchExtraArgs>-gcc_flags -dead_strip</MtouchExtraArgs> |
| | | </PropertyGroup> |
| | | <ItemGroup> |
| | | <Reference Include="System" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Item\Down.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\CollectionSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\Room.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\SeekBarIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\Category_FunctionBG.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\Remote.png" /> |
| | | <BundleResource Include="Resources\Phone\Item\ScreeningType.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\ac.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\curtain.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\doorlock.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\progressbtn2.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\nodelay.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\withdrawal.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\logicaddcolor.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\security1.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\delay.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\sunrise.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\progressbtn_2.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\temperature.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\AddSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\ZigeeLogic\light_1.png" /> |
| | |
| | | 220=密码可能不存在,尝试重新验证远程开锁密码 |
| | | 221=绑定失败,绑定出现未知错误 |
| | | 222=离线场景 |
| | | 223=确认删除按键模式及清空所有目标 |
| | | 224=绑定目标为空,请选择需要绑定目标 |
| | | |
| | | 548=提醒设置 |
| | | 550=新增用户 |
| | |
| | | 5366=联动事件 |
| | | 5367=当前 |
| | | 5368=选择楼层 |
| | | |
| | | 5369=请选择延时时间,否则无法执行下一步. |
| | | 5370=请选择用户,否则无法执行下一步. |
| | | 5371=请选择场景,否则无法执行下一步. |
| | | 5372=请选择安防模式,否则无法执行下一步. |
| | | |
| | | |
| | | |
| | |
| | | 13506=5挡 |
| | | 13511=请清洁滤网 |
| | | |
| | | |
| | | 13600=没功能 {\r\n} 请先添加 |
| | | 13601=没场景 {\r\n} 请先添加 |
| | | |
| | | |
| | | |
| | |
| | | 15050=停止搜索 |
| | | 15051=正在搜索网关… |
| | | 15052=请稍候··· |
| | | 15053=请确保网关与网线连接{0}系统灯每秒闪烁一次 |
| | | 15053=请确保网关用网线正常连接路由器{0}正常连接则系统指示灯1秒闪烁 |
| | | 15054=网关名称 |
| | | 15055=住宅名称 |
| | | 15056=完成 |
| | |
| | | 15776=还没有共享区域给成员{0}可点击右上角“+”添加 |
| | | 15777=确认删除共享房间? |
| | | 15778=还没绑定网关哦 |
| | | 15779=解决方法,可选择执行以下任意一种方式: |
| | | 15780=1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。 |
| | | 15781=2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。 |
| | | 15779=解决方法,可选择执行以下任意一种方式: |
| | | 15780=1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP |
| | | 15781=2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启 |
| | | 15782=3.请重试,重新添加网关。 |
| | | 15783=4.返回网关管理。 |
| | | 15784=重试 |
| | |
| | | 15904=AP模式 |
| | | 15905=跳转到移动设备 |
| | | 15906=WLAN设置连接家庭WiFi |
| | | 15907=长按网关HID/WCFG按键20秒{0}系统灯快闪60秒则进入配网状态{0}系统灯每秒闪烁一次{0}则连接成功 |
| | | 15908=长按网关HID/WCFG按键5秒{0}系统灯常亮60秒后则进入配网状态 |
| | | 15909=跳转到移动设备WLAN设置{0}选择hdlZigbeeGW-xxxx网络 |
| | | 15907=网关如果正常连接路由器{0}系统指示灯会1秒闪烁 |
| | | 15908=请先长按HID/WCFG按键大概5秒{0}直到系统指示灯常亮{0}网关进入AP模式热点 |
| | | 15909=手机去设置连接网关热点{0}即hdlZigbeeGW-xxxx,密码hdl123456{0}可查看网关背面标签查看热点名字和密码 |
| | | 15910=请输入家庭WIFI账号 |
| | | 15911=请前往移动设备WLAN设置{0}重新连接家庭wiFi |
| | | 15912=系统灯每秒闪烁一次{0}则连接成功 |
| | | 15911=手机去设置连接路由器 |
| | | 15912=网关如果正常连接路由器{0}系统指示灯会1秒闪烁 |
| | | 15915=选择地点 |
| | | 15916=您的反馈和意见会让我们变得更好 |
| | | 15917=反馈类型 |
| | |
| | | 15981=选择hdlZigbeeGW-xxxx网络 |
| | | 15982=请连接家庭WiFi |
| | | 15983=正在获取分享数据 |
| | | 15984=请先去设置手机连接到路由器{0}然后长按网关HID/WCFG按键大概20秒{0}直到系统指示灯快闪{0}网关进入UDP模式WIFI配网 |
| | | 15985=网关添加指引 |
| | | 15986=1.请用网线连接网关网口到路由器,并观察网口LED亮并闪烁或观察外壳网口指示灯亮并闪烁 |
| | | 15987=2.网关重启大约需要1分钟,这时观察外壳系统指示灯,如果1秒闪烁,表示网关连接路由器正常,可以用APP进行添加网关步骤 |
| | | 15988=网关硬件问题帮助 |
| | | 15989=1.网口指示灯不亮,检查网线或路由器是否正常 |
| | | 15990=2.系统启动之后(系统指示灯5秒闪烁,表示系统启动成功),系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP |
| | | 15991=系统启动之后(系统指示灯5秒闪烁,表示系统启动成功) |
| | | 15992=2.根据APP提示进入之后的步骤 |
| | | 15993=1.请先长按网关HID/WCFG按键大概20秒,直到系统指示灯快闪,网关进入UDP模式WIFI配网 |
| | | 15994=1.请先长按网关HID/WCFG按键大概5秒,直到系统指示灯常亮,网关进入AP模式WIFI配网 |
| | | 15995=1.短按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏 |
| | | 15996=2.长按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏 |
| | | 15997=3.系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP |
| | | 15998=请前往住宅管理{0}设置住宅的地理位置 |
| | | 15999=未知楼层 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | 30003=水侵传感器 |
| | | 30004=钥匙扣 |
| | | 30005=门窗传感器 |
| | | 30006=Zigbee微断云控制器 |
| | | 30006=智能空开 |
| | | 30007=Zigbee智能开合帘电机 |
| | | 30008=4按键触摸面板(4路继电器底座) |
| | | 30009=220Pir传感器 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.0.19120901"; |
| | | public static string CodeIDString = "1.0.19121201"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | |
| | | /// <summary> |
| | | /// 用于中国大陆验证手机号正则表达式 |
| | | /// 等同于--- "^[1]+\\d{10}" |
| | | /// </summary> |
| | | public static string PhoneRegexStr = "^[1]+[0,1,2,3,4,5,6,7,8,9]+\\d{9}"; |
| | | public static string PhoneRegexStr = "^[1][0-9]{10}$"; |
| | | /// <summary> |
| | | /// 用于验证非中国大陆手机号正则表达式 |
| | | /// </summary> |
| | |
| | | List<string> listFile = this.GetAllDeviceFile(); |
| | | foreach (string file in listFile)
|
| | | {
|
| | | CommonDevice device = null;
|
| | | //反序列化为指定的类,不然数据会丢失而导致无法强转
|
| | | var device = ZigBee.Device.CommonDevice.CommonDeviceByFilePath(file);
|
| | | try |
| | | {
|
| | | device = CommonDevice.CommonDeviceByFilePath(file);
|
| | | }
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | if (device == null || device.CurrentGateWayId == null)
|
| | | {
|
| | | #if DEBUG
|
| | |
| | | int receiveCount = 0;
|
| | | //设备列表
|
| | | var listDevice = new List<CommonDevice>();
|
| | |
|
| | | //网关里面有可能会有重复的回路
|
| | | var listCheck = new HashSet<string>();
|
| | | Action<string, string> getDeviceAction = (topic, message) =>
|
| | | {
|
| | | try
|
| | | {
|
| | | if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | {
|
| | | try
|
| | | {
|
| | | lock (listDevice)
|
| | | {
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | |
|
| | | TimeOut = 0;
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | |
| | | //设置需要接收多少个设备
|
| | | deviceCount = totalNum;
|
| | | }
|
| | | //设备接收数
|
| | | receiveCount++;
|
| | |
|
| | | var deviceID = (DeviceType)jobject.Value<int>("Device_ID");
|
| | | //根据设备类型创建设备对象的实例
|
| | | var device = this.NewDeviceObjectByDeviceId(deviceID, jobject, zbGateway);
|
| | | if (device != null)
|
| | | {
|
| | | try
|
| | | string mainkeys = this.GetDeviceMainKeys(device);
|
| | | //网关里面有可能会有重复的回路
|
| | | if (listCheck.Contains(mainkeys) == false)
|
| | | {
|
| | | //回调函数
|
| | | deviceComingAction?.Invoke(device);
|
| | | listDevice.Add(device);
|
| | |
|
| | | listCheck.Add(mainkeys);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | //Log出力
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | |
|
| | | listDevice.Add(device);
|
| | | }
|
| | | if (deviceCount == receiveCount)
|
| | | if (receiveCount == deviceCount && deviceCount != -1)
|
| | | {
|
| | | //设备全部接收完成
|
| | | canBreak = true;
|
| | | }
|
| | | }
|
| | | }
|
| | | catch { }
|
| | | };
|
| | |
|
| | | realWay.Actions += getDeviceAction;
|
| | |
| | | /// </summary>
|
| | | AirSwitch = -4100,
|
| | | /// <summary>
|
| | | /// 微断云控制器 镜像id:4100
|
| | | /// 智能空开 镜像id:4100
|
| | | /// </summary>
|
| | | AirSwitch_CloudContr = 4100,
|
| | |
|
| | |
| | | homeTemp.AddRoomListFilePath(fRoom);
|
| | | }
|
| | |
|
| | | var listRoomFile = new List<string>();
|
| | | foreach (string fileName in listFile)
|
| | | {
|
| | | if (fileName.StartsWith("Room_"))
|
| | | {
|
| | | homeTemp.AddRoomListFilePath(fileName);
|
| | | listRoomFile.Add(fileName);
|
| | | }
|
| | | }
|
| | | //检测楼层数据的合法性
|
| | | CheckFloorData(listRoomFile);
|
| | |
|
| | | homeTemp.Save(false);
|
| | | InitAllRoom();
|
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 检测楼层数据的合法性
|
| | | /// </summary>
|
| | | /// <param name="listRoomFile"></param> |
| | | private static void CheckFloorData(List<string> listRoomFile)
|
| | | {
|
| | | for (int i = 0; i < listRoomFile.Count; i++)
|
| | | {
|
| | | try
|
| | | {
|
| | | var byteData = Global.ReadFileByHomeId(listRoomFile[i]);
|
| | | string valueData = System.Text.Encoding.UTF8.GetString(byteData);
|
| | | var roomTemp = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.Room>(valueData);
|
| | |
|
| | | //检测多个手机来回创建,然后又删除之后,楼层数据不能保证100%同步的问题
|
| | | if (roomTemp.FloorId != string.Empty && Config.Instance.Home.FloorDics.ContainsKey(roomTemp.FloorId) == false)
|
| | | {
|
| | | //未知楼层
|
| | | Config.Instance.Home.FloorDics[roomTemp.FloorId] = Language.StringByID(R.MyInternationalizationString.uUnKnownFloor);
|
| | | }
|
| | | }
|
| | | catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex); }
|
| | | }
|
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <returns></returns> |
| | | public List<Room> GetRoomsByFloorId(string id) |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | return Lists; |
| | | } |
| | | return Lists.FindAll((obj) => obj.FloorId == id); |
| | | } |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public List<Room> GetRoomsByFloorIdAppendLoveRoom(string id) |
| | | { |
| | | if (Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | return Lists; |
| | | } |
| | | var r= Lists.FindAll((obj) => obj.FloorId == id); |
| | | r.Insert(0, GetLoveRoom()); |
| | | return r; |
| | |
| | | ///第三方用户唯一标识 |
| | | /// </summary> |
| | | public string OpenID; |
| | | /// <summary>
|
| | | /// 用户昵称
|
| | | /// </summary> |
| | | public string UserName; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Width = Application.GetRealWidth(modeItem_Width - modeItem_X), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.SelectFanMode, |
| | | TextID = R.MyInternationalizationString.SelectMode, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | changeModeFL.AddChidren(changeModeBtn); |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Account_TextChange(object sender, string mouseEventArgs) |
| | | { |
| | | errorBtn.Text = ""; |
| | | errorBtn.Text = string.Empty; |
| | | |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | { |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void Code_TextChange(object sender, string mouseEventArgs) |
| | | { |
| | | errorBtn.Text = ""; |
| | | errorBtn.Text = string.Empty; |
| | | if ((sender as EditText).Text.Trim().Length > 0) |
| | | { |
| | | resetBtn.Enable = resetBtn.IsSelected = true; |
| | |
| | | { |
| | | if (CheckAccount(account) == false) |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | | return; |
| | | } |
| | | |
| | | if (AccountLogic.Instance.CheckPwdLength(pwdRow.PasswrodET.Text.Trim()) == false) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.ThePWDLengthError; |
| | | return; |
| | | } |
| | | |
| | |
| | | RefreshToken = authRes.refresh_token, |
| | | OpenID = authRes.openid |
| | | }; |
| | | //获取微信昵称
|
| | | var strUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authRes.access_token;
|
| | | strUrl += "&openid=" + authRes.openid;
|
| | | var byteData = await Common.CommonPage.Instance.DoRequestZigbeeHttpsInterface(strUrl, null, null, "GET");
|
| | | if (byteData == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var receipData = System.Text.Encoding.UTF8.GetString(byteData);
|
| | | var nickData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserCenter.NicknameInfo>(receipData);
|
| | | auth.UserName = nickData.nickname; |
| | | |
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth); |
| | | var revertObj = await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/InsertOrUpdateAuthUser", System.Text.Encoding.UTF8.GetBytes(requestJson)); |
| | | if (revertObj == null) |
| | |
| | | var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(requestRevetLoginCodeOBJ.ResponseData.ToString()); |
| | | var revertData = responseDataObj; |
| | | Config.ReFresh(); |
| | | Config.Instance.Password = string.Empty; |
| | | Config.Instance.Account = revertData.Account; |
| | | Config.Instance.Guid = revertData.Guid; |
| | | Config.Instance.MD5PWD = revertData.MD5PWD; |
| | |
| | | { |
| | | return; |
| | | } |
| | | //先判断2次密码输入是否一致 |
| | | if (pwdRow.PasswrodET.Text.Trim() != pwdComfireRow.PasswrodET.Text.Trim()) |
| | | { |
| | | errorBtn.TextID = R.MyInternationalizationString.TwoPasswordInconsistency; |
| | |
| | | var logicRowlayout = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(190 + 30), |
| | | Width = Application.GetRealWidth(1080), |
| | | Width = Application.GetRealWidth(1080-58), |
| | | LineColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | |
| | | { |
| | | curRoom = rooms[index1][index2]; |
| | | zoneRow.SetTitle($"{Config.Instance.Home.GetFloorNameById(floorIds[index1])} , {rooms[index1][index2].Name}"); |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | { |
| | | curRoom = rs[index1]; |
| | | zoneRow.SetTitle(rs[index1].Name); |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongFloor), |
| | | }, 0, Language.StringByID(R.MyInternationalizationString.BelongZone), |
| | | Language.StringByID(R.MyInternationalizationString.Confrim), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | |
| | | confirmBtn.SetTitle(R.MyInternationalizationString.Save); |
| | | confirmBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (totalSecond == 0) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | sceneTargetDevice.DelayTime = totalSecond; |
| | | selectedTimeAction?.Invoke(sceneTargetDevice); |
| | | RemoveFromParent(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | |
| | | Y = Application.GetMinRealAverage(17), |
| | | Width = Application.GetMinRealAverage(320), |
| | | Height = Application.GetMinRealAverage(63), |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextAlignment=TextAlignment.CenterLeft |
| | | }; |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addscene, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | if (clickTag == "no" || tempScene == null) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.scenetip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.custompush, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(600), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Text = Common.Logic.CurrentLogic.LogicCustomPushText, |
| | |
| | | middle.AddChidren(btnsave); |
| | | btnsave.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | Common.Logic.CurrentLogic.LogicCustomPushText = textBox.Text.Trim(); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | | { |
| | | ///只改推送内容; |
| | | Send.LogicControlSwitch(Common.Logic.CurrentLogic); |
| | | } |
| | | else { |
| | | Send.AddModifyLogic(Common.Logic.CurrentLogic); |
| | | } |
| | | RemoveFromParent(); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.cycle, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectweek), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | |
| | | alert.Show(); |
| | | return; |
| | |
| | | public void Show(int isInt = 0, bool edit = false) |
| | | { |
| | | |
| | | |
| | | #region 最上面的布局代码 |
| | | var topRowLayout = new RowLayout |
| | | { |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.adddelay, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | color.AddChidren(btnicon); |
| | | var titleText = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(480), |
| | | Width = Application.GetMinRealAverage(580), |
| | | Height = Application.GetMinRealAverage(60), |
| | | X = Application.GetRealWidth(300), |
| | | X = Application.GetRealWidth(250), |
| | | Y = blancolor.Bottom + Application.GetRealHeight(50), |
| | | TextID = MyInternationalizationString.createtimetext, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | |
| | | if (!edit) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.delaytip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
old mode 100644
new mode 100755
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | foolrname.Text = btnfoolrname.Text; |
| | | flMain.RemoveFromParent(); |
| | | var list = Send.GetRoomList(btnfoolrname.Tag.ToString()); |
| | | |
| | | AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol); |
| | | }; |
| | | foolrRowLayout.MouseUpEventHandler += foolrnameclick; |
| | |
| | | /// </summary> |
| | | void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol) |
| | | { |
| | | |
| | | for (int i = 0; i < roomlist.Count; i++) |
| | | { |
| | | var room = roomlist[i]; |
| | |
| | | }; |
| | | devicefra.AddChidren(Btntemperaturevalue); |
| | | |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | { |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = timetype.Bottom + Application.GetRealHeight(70 + 60 + 70), |
| | | X = Application.GetRealWidth(80), |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(160), |
| | | IsProgressTextShow = false,//显示百分比 |
| | | IsClickable = true,//进度条是否滑动 |
| | | ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色 |
| | | ThumbImagePath = "ZigeeLogic/progressbtn_2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//进度条原颜色 |
| | | //ProgressTextSize = 13,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | devicefra.AddChidren(horizontalSeekBarVol); |
| | | horizontalSeekBarVol.MouseUpEventHandler += (sender, e) => |
| | | |
| | | EventHandler<int> progressclick = (sender, e) => |
| | | { |
| | | |
| | | SelectedDeviceStatuscondition = "TemperatureSensor"; |
| | | if (temperatureSensor.SensorDiv == 1) |
| | | { |
| | |
| | | Btntemperaturevalue.Text = current + "<" + horizontalSeekBarVol.Progress.ToString() + "%"; |
| | | dictionary(deviceConditionsInfo, "AttriButeData1", horizontalSeekBarVol.Progress.ToString());//温度值 |
| | | } |
| | | }; |
| | | |
| | | }; |
| | | horizontalSeekBarVol.OnProgressChangedEvent += progressclick; |
| | | horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick; |
| | | |
| | | |
| | | if (temperatureSensor.SensorDiv == 1) |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addaction, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addaction, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.userlist, |
| | | IsBold = true, |
| | | //Text = "选择用户", |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | |
| | | if (conditionsIndex == -1) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.usertip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | }; |
| | | flMain.AddChidren(devicefra); |
| | | devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | |
| | | #region -------取消 完成 |
| | | var timetype = new RowLayout |
| | | { |
| | |
| | | }; |
| | | timetype.AddChidren(Btncomplete); |
| | | #endregion |
| | | |
| | | |
| | | string SelectedDeviceStatusaction = "no"; |
| | | actionsInfo.Add("LinkType", 0); |
| | |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarRow); |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | { |
| | | Y = openrowlayout.Bottom, |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = Application.GetRealHeight(25), |
| | | //Gravity = Gravity.CenterVertical, |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | IsCanMove = false |
| | | Height = Application.GetRealHeight(160), |
| | | X = Application.GetRealWidth(80), |
| | | IsProgressTextShow = true,//显示百分比 |
| | | IsClickable = false,//进度条是否滑动 |
| | | ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色 |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 13,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | horizontalSeekBarRow.AddChidren(horizontalSeekBarVol); |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | | |
| | | #endregion |
| | | |
| | |
| | | #endregion |
| | | |
| | | int Progressvalue = 100; |
| | | horizontalSeekBarVol.ProgressChanged += (sender, e) => |
| | | EventHandler<int> progressclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | |
| | | switchdictionary.Add("Data1", lightbrightnessvalue.ToString()); |
| | | |
| | | }; |
| | | horizontalSeekBarVol.OnProgressChangedEvent += progressclick; |
| | | horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick; |
| | | ///确认事件 |
| | | EventHandler<MouseEventArgs> openclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = false; |
| | |
| | | EventHandler<MouseEventArgs> closeclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | takebackBtnSelected.Visible = false; |
| | |
| | | EventHandler<MouseEventArgs> takebackclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = true; |
| | |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | takebackBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | else if (value["Data1"] == "2") |
| | | { |
| | |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = true; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | |
| | | } |
| | |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.Progress = int.Parse(value["Data1"]) * 100 / 254; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | | |
| | |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarRow); |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | { |
| | | Y = openrowlayout.Bottom, |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = Application.GetRealHeight(25), |
| | | //Gravity = Gravity.CenterVertical, |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | IsCanMove = false |
| | | Height = Application.GetRealHeight(160), |
| | | X = Application.GetRealWidth(80), |
| | | IsProgressTextShow = true,//显示百分比 |
| | | IsClickable = false,//进度条是否滑动 |
| | | ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色 |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 13,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | horizontalSeekBarRow.AddChidren(horizontalSeekBarVol); |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | #endregion |
| | | int Progressvalue = 100; |
| | | horizontalSeekBarVol.ProgressChanged += (sender, e) => |
| | | EventHandler<int> progressclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | |
| | | switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString()); |
| | | |
| | | }; |
| | | horizontalSeekBarVol.OnProgressChangedEvent += progressclick; |
| | | horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick; |
| | | ///确认事件 |
| | | EventHandler<MouseEventArgs> openclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.Progress = Progressvalue; |
| | |
| | | EventHandler<MouseEventArgs> closeclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | |
| | |
| | | } |
| | | switchdictionary.Add("Data1", "5"); |
| | | switchdictionary.Add("Data2", value["Data2"]); |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.Progress = int.Parse(value["Data2"]); |
| | |
| | | switchdictionary.Add("Data1", "1"); |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | case DeviceType.Thermostat: |
| | | { |
| | | |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | Btncomplete.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addscene, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | if (clickTag == "no" || tempScene == null) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.scenetip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.linkageevent, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | Text = titlename, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectweek), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | |
| | | alert.Show(); |
| | | return; |
| | |
| | | TextID = MyInternationalizationString.cycle, |
| | | TextSize = 16, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | Text = name, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | int selectIndex1 = timevalue / 60; |
| | | int selectIndex2 = timevalue % 60; |
| | | int selectIndex1 = 0; |
| | | int selectIndex2 = 0; |
| | | if (timevalue > 3600) |
| | | { |
| | | selectIndex1 = 60; |
| | | selectIndex2 = timevalue - 3600; |
| | | } |
| | | else |
| | | { |
| | | selectIndex1 = timevalue / 60; |
| | | selectIndex2 = timevalue % 60; |
| | | } |
| | | PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) => |
| | | { |
| | | selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]); |
| | |
| | | if (!edit) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.delaytip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | else |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | Button clicktextcolcrbutton = new Button(); |
| | | public void Show() |
| | | { |
| | | |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; |
| | | #region 最上面的布局代码 |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarRow); |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | { |
| | | Y = openrowlayout.Bottom, |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = Application.GetRealHeight(25), |
| | | //Gravity = Gravity.CenterVertical, |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | IsCanMove = false |
| | | }; |
| | | horizontalSeekBarRow.AddChidren(horizontalSeekBarVol); |
| | | Height = Application.GetRealHeight(160), |
| | | IsProgressTextShow = true,//显示百分比 |
| | | IsClickable = false,//进度条是否滑动 |
| | | ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色 |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 13,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | | #endregion |
| | | |
| | | #region 关 |
| | |
| | | #endregion |
| | | |
| | | int Progressvalue = 100; |
| | | horizontalSeekBarVol.ProgressChanged += (sender, e) => |
| | | EventHandler<int> progressclick = (sender, e) => |
| | | { |
| | | Console.WriteLine("12345"); |
| | | SelectedDeviceStatusaction = "yes"; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | | if (switchdictionary.ContainsKey("TaskType")) |
| | |
| | | switchdictionary.Add("Data1", lightbrightnessvalue.ToString()); |
| | | |
| | | }; |
| | | horizontalSeekBarVol.OnProgressChangedEvent += progressclick; |
| | | horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick; |
| | | ///确认事件 |
| | | EventHandler<MouseEventArgs> openclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = false; |
| | |
| | | EventHandler<MouseEventArgs> closeclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | takebackBtnSelected.Visible = false; |
| | |
| | | EventHandler<MouseEventArgs> takebackclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = true; |
| | |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | takebackBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | else if (value["Data1"] == "2") |
| | | { |
| | |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = true; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | |
| | | } |
| | |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | takebackBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.Progress = int.Parse(value["Data1"])*100/254; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | | |
| | |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | openframelayout.AddChidren(horizontalSeekBarRow); |
| | | var horizontalSeekBarVol = new HorizontalSeekBar |
| | | var horizontalSeekBarVol = new DiyImageSeekBar |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Y = openrowlayout.Bottom, |
| | | Width = Application.GetRealWidth(920), |
| | | Height = Application.GetRealHeight(80), |
| | | Radius = (uint)Application.GetRealHeight(25), |
| | | Y = Application.GetRealHeight(25), |
| | | //Gravity = Gravity.CenterVertical, |
| | | ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected, |
| | | Max = 100, |
| | | SleepTime = 1000, |
| | | ThumbRadius = 9, |
| | | IsCanMove = false |
| | | Height = Application.GetRealHeight(160), |
| | | IsProgressTextShow = true,//显示百分比 |
| | | IsClickable = false,//进度条是否滑动 |
| | | ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//选中进度条颜色 |
| | | ThumbImagePath = "ZigeeLogic/progressbtn2.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(56),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 14,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(10),//进度条的高度 |
| | | }; |
| | | horizontalSeekBarRow.AddChidren(horizontalSeekBarVol); |
| | | openframelayout.AddChidren(horizontalSeekBarVol); |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | #endregion |
| | | int Progressvalue = 100; |
| | | horizontalSeekBarVol.ProgressChanged += (sender, e) => |
| | | |
| | | EventHandler<int> progressclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | Progressvalue = horizontalSeekBarVol.Progress; |
| | |
| | | switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString()); |
| | | |
| | | }; |
| | | horizontalSeekBarVol.OnProgressChangedEvent += progressclick; |
| | | horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick; |
| | | ///确认事件 |
| | | EventHandler<MouseEventArgs> openclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.Progress = Progressvalue; |
| | |
| | | EventHandler<MouseEventArgs> closeclick = (sender, e) => |
| | | { |
| | | SelectedDeviceStatusaction = "yes"; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | |
| | |
| | | } |
| | | switchdictionary.Add("Data1", "5"); |
| | | switchdictionary.Add("Data2", value["Data2"]); |
| | | horizontalSeekBarVol.IsCanMove = true; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | horizontalSeekBarVol.IsClickable = true; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected; |
| | | openBtnSelected.Visible = true; |
| | | closeBtnSelected.Visible = false; |
| | | horizontalSeekBarVol.Progress = int.Parse(value["Data2"]); |
| | |
| | | switchdictionary.Add("Data1", "1"); |
| | | openBtnSelected.Visible = false; |
| | | closeBtnSelected.Visible = true; |
| | | horizontalSeekBarVol.IsCanMove = false; |
| | | horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor; |
| | | horizontalSeekBarVol.IsClickable = false; |
| | | horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor; |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | TextID = MyInternationalizationString.automation, |
| | | TextSize = 16, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren (titleName); |
| | | |
| | |
| | | TextID = MyInternationalizationString.automation, |
| | | TextSize = 16, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren (titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.userlist, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.securitymode, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | if (!athomedefenceSelected.Visible && !leavehomedefenceSelected.Visible && !withdrawalSelected.Visible && !urgentwithdrawalSelected.Visible) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.securitytip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | | |
| | |
| | | //Text = "时间条件", |
| | | TextID = MyInternationalizationString.Timecondition, |
| | | TextSize = 17, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren (titleName); |
| | | |
| | |
| | | TextID = MyInternationalizationString.automation, |
| | | TextSize = 16, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren (titleName); |
| | | |
| | |
| | | TextID = MyInternationalizationString.automation, |
| | | TextSize = 16, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | IsBold = true, |
| | | }; |
| | | topFrameLayout.AddChidren (titleName); |
| | | |
| | |
| | | public static List<Common.Room> GetRoomList(string floorId) |
| | | { |
| | | return Common.Room.Lists.FindAll((obj) => obj.FloorId == floorId); |
| | | |
| | | //var list1 = new List<Common.Room>(); |
| | | /////找到某楼层房间列表; |
| | | //var list = Common.Room.Lists.FindAll((obj) => obj.FloorId == floorId); |
| | | //for (int i = 0; i < list.Count; i++) |
| | | //{ |
| | | // if (str == "device") |
| | | // { |
| | | // if (list[i].DeviceUIList.Count != 0) |
| | | // { ///过滤掉没有设备的房间 |
| | | // list1.Add(list[i]); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // if (list[i].SceneUIList.Count != 0) |
| | | // { ///过滤掉没有场景的房间 |
| | | // list1.Add(list[i]); |
| | | // } |
| | | // } |
| | | //} |
| | | /////返回房间列表; |
| | | //return list1; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ----获取门锁 |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.devicestate, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | Text = name, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | int selectIndex1 = timevalue / 60; |
| | | int selectIndex2 = timevalue % 60; |
| | | int selectIndex1 = 0; |
| | | int selectIndex2 = 0; |
| | | if (timevalue > 3600) |
| | | { |
| | | selectIndex1 = 60; |
| | | selectIndex2 = timevalue - 3600; |
| | | } |
| | | else |
| | | { |
| | | selectIndex1 = timevalue / 60; |
| | | selectIndex2 = timevalue % 60; |
| | | } |
| | | PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) => |
| | | { |
| | | selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]); |
| | |
| | | if (!edit) |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.delaytip), |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | if (Common.Logic.CurrentLogic.LogicId != 0) |
| | |
| | | logicTextBox = new EditText |
| | | { |
| | | Y = Application.GetRealHeight(35), |
| | | Width = Application.GetRealWidth(900), |
| | | Width = Application.GetRealWidth(1080 - 58 - 300), |
| | | Height = Application.GetRealHeight(60), |
| | | X = text.Right, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | |
| | | { |
| | | int minute = int.Parse(conditions["IgnoreTime"]) / 60; |
| | | int second = int.Parse(conditions["IgnoreTime"]) % 60; |
| | | if (second != 0) |
| | | if (minute != 0 && second != 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | else |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); |
| | | if (minute == 0 && second != 0) |
| | | { |
| | | devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | if (minute != 0 && second == 0) |
| | | { |
| | | devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addtime, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Tag = "0", |
| | | TextSize = 14, |
| | | }; |
| | | timeendrow.AddChidren(btnendtime); |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.completeNext), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.sametime), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | alert.Show(); |
| | | return; |
| | | } |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.addtime, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | Text = titlename, |
| | | IsBold = true, |
| | | }; |
| | | topRowLayout.AddChidren(titleName); |
| | | |
| | |
| | | { |
| | | var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), |
| | | Language.StringByID(MyInternationalizationString.selectweek), |
| | | Language.StringByID(MyInternationalizationString.complete)); |
| | | Language.StringByID(MyInternationalizationString.confrim)); |
| | | |
| | | alert.Show(); |
| | | return; |
| | |
| | | var floorRow = new DeviceInfoRow(308); |
| | | floorRow.Init(); |
| | | floorRow.SetTipTitle($"{Language.StringByID(R.MyInternationalizationString.BelongFloor)} :"); |
| | | infoFL.AddChidren(floorRow); |
| | | if (!room.IsLove) |
| | | if (Config.Instance.Home.FloorDics.Count > 0 && room.IsLove == false) |
| | | { |
| | | infoFL.AddChidren(floorRow); |
| | | } |
| | | floorRow.SetTitle(room.FloorName); |
| | | floorRow.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | }, floorIds.IndexOf(room.FloorId), Language.StringByID(R.MyInternationalizationString.BelongFloor), Language.StringByID(R.MyInternationalizationString.Confrim), Language.StringByID(R.MyInternationalizationString.Cancel)); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | |
| | | var temperatureRow = new DeviceInfoRow(446); |
| | | temperatureRow.Init(); |
| | |
| | | (selectTemp as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); |
| | | }; |
| | | }; |
| | | |
| | | if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) |
| | | { |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice"); |
| | |
| | | (dev as ZigBee.Device.TemperatureSensor).ReadTemperatureOrHumidity(); |
| | | } |
| | | } |
| | | |
| | | |
| | | var humidityRow = new DeviceInfoRow(585); |
| | | humidityRow.Init(); |
| | |
| | | } |
| | | } |
| | | |
| | | if (Config.Instance.Home.FloorDics.Count == 0 || room.IsLove) |
| | | { |
| | | temperatureRow.Y = Application.GetRealHeight(308); |
| | | humidityRow.Y= Application.GetRealHeight(446); |
| | | } |
| | | |
| | | var confirm = new Device.CommonForm.CompleteButton(1700, 700, 127); |
| | | confirm.SetTitle(R.MyInternationalizationString.Confrim); |
| | |
| | | }; |
| | | |
| | | floorBtn.Text = Config.Instance.Home.GetCurrentFloorName; |
| | | if(Config.Instance.Home.FloorDics.Count>0) |
| | | { |
| | | top.topView.AddChidren(floorBtn); |
| | | top.topView.AddChidren(selectFloorBtn); |
| | | } |
| | | selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | } |
| | |
| | | public void ShowFunction(bool selectAll) |
| | | { |
| | | SelectAll = selectAll; |
| | | |
| | | var devList = Common.Room.AllRoomDeviceUIList; |
| | | |
| | | //选择功能--直接从房间的devicelist中获取 |
| | | if (Common.Room.AllRoomDeviceUIList == null) |
| | | if (devList == null) |
| | | { |
| | | return; |
| | | } |
| | | if (Common.Room.AllRoomDeviceUIList.Count == 0) |
| | | if (devList.Count == 0) |
| | | { |
| | | ShowNoFunctionTip(); |
| | | } |
| | |
| | | functionTypeIMG.ClickBtn.MouseUpEventHandler += ShowSameTypeFunction; |
| | | |
| | | |
| | | if (deviceType == Shared.Common.Room.AllRoomDeviceUIList[0].CommonDevice.Type) |
| | | if (deviceType == devList[0].CommonDevice.Type) |
| | | { |
| | | ShowSameTypeFunction(functionTypeIMG.ImageBtn, null); |
| | | } |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = R.MyInternationalizationString.NoFunction, |
| | | //Text = "没有功能 \n 请在个人中心中--设备管理处添加", |
| | | Text= Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true |
| | |
| | | Height = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(700), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = R.MyInternationalizationString.NoScene, |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true |
| | |
| | | {
|
| | | return new AccountOption();
|
| | | }
|
| | | try
|
| | | {
|
| | | var varByte = Shared.IO.FileUtils.ReadFile(fileName);
|
| | | string strValue = System.Text.Encoding.UTF8.GetString(varByte);
|
| | | var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOption>(strValue);
|
| | |
| | |
|
| | | return info;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | return new AccountOption();
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 重置密码剩余次数
|
| | |
| | | dic["NoExist"] = R.MyInternationalizationString.uErrorAndLostOtherPatyInfo;
|
| | | //指定账号不存在
|
| | | dic["AccountNoExists"] = R.MyInternationalizationString.uAccountNoExists;
|
| | |
|
| | | //修改子帐号远程权限
|
| | | keys = "ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl";
|
| | | dicMsg[keys] = new Dictionary<string, int>();
|
| | | dic = dicMsg[keys];
|
| | | //请求参数错误
|
| | | dic["ParameterOrEmpty"] = R.MyInternationalizationString.uParameterError;
|
| | | //无效登录Token
|
| | | dic["NoLogin"] = R.MyInternationalizationString.uNoLogin;
|
| | | //指定的住宅不存在
|
| | | dic["HomeIdNoRecord"] = R.MyInternationalizationString.uZigbeeHome_NoRecord;
|
| | | //指定账号不存在
|
| | | dic["DistributedMarkNoRecord"] = R.MyInternationalizationString.uAccountNoExists;
|
| | | //权限不足
|
| | | dic["BeRestrict"] = R.MyInternationalizationString.uBeRestrict;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | }
|
| | | string statuCode = revertObj.StateCode;
|
| | |
|
| | | HdlLogLogic.Current.WriteLog(-1, "接口访问失败:" + requestName + " " + statuCode + " " + revertObj.ErrorInfo == null ? string.Empty : revertObj.ErrorInfo);
|
| | | HdlLogLogic.Current.WriteLog(-1, "当前激活的界面:" + UserCenterResourse.NowActionFormID);
|
| | | string errorMsg = "接口访问失败:" + requestName + " " + statuCode + " " + revertObj.ErrorInfo == null ? string.Empty : revertObj.ErrorInfo + "\r\n";
|
| | | errorMsg += "当前激活的界面:" + UserCenterResourse.NowActionFormID + "\r\n";
|
| | | if (pra != null)
|
| | | {
|
| | | //序列化对象
|
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra);
|
| | | HdlLogLogic.Current.WriteLog(-1, "参数:\r\n" + requestJson);
|
| | | errorMsg += "参数:\r\n" + requestJson;
|
| | | }
|
| | | HdlLogLogic.Current.WriteLog(-1, errorMsg);
|
| | |
|
| | | //共通码
|
| | | if (statuCode == "ParameterOrEmpty")
|
| | |
| | | public string UserName = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 昵称信息
|
| | | /// </summary>
|
| | | public class NicknameInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 昵称
|
| | | /// </summary>
|
| | | public string nickname = string.Empty;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 成员信息类__________________________
|
| | |
| | | /// AccountType
|
| | | /// </summary> |
| | | public int AccountType = 0;
|
| | | /// <summary>
|
| | | /// 是否拥有远程控制权限
|
| | | /// </summary>
|
| | | public bool IsAllowRemoteCtrl = false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter
|
| | | {
|
| | | /// <summary>
|
| | | /// 左右滑动的进度条控件
|
| | | /// </summary>
|
| | | public class SeekBarControl : DiyImageSeekBar
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | private uint nowProgressBarColor = 0;
|
| | | /// <summary>
|
| | | /// 控件能否使用
|
| | | /// </summary>
|
| | | public new bool Enable
|
| | | {
|
| | | set
|
| | | {
|
| | | this.IsClickable = value;
|
| | | if (value == true)
|
| | | {
|
| | | //原来的颜色
|
| | | base.ProgressBarColor = nowProgressBarColor;
|
| | | }
|
| | | else
|
| | | {
|
| | | //灰色
|
| | | base.ProgressBarColor = 0xffe8e8e8;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 进度条颜色
|
| | | /// </summary>
|
| | | public new uint ProgressBarColor
|
| | | {
|
| | | set
|
| | | {
|
| | | nowProgressBarColor = value;
|
| | | base.ProgressBarColor = value;
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 进度值改变,如果要设置初始进度值,此变量要在设置初始进度值之前进行设置(第一个参数0:滑动的时候,1:手指弹起的时候)
|
| | | /// </summary>
|
| | | public Action<int, int> ProgressChangedEvent = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 左右滑动的进度条控件
|
| | | /// </summary>
|
| | | /// <param name="i_width">宽度,非真实值</param>
|
| | | public SeekBarControl(int i_width = 962)
|
| | | {
|
| | | this.Width = Application.GetRealWidth(i_width);
|
| | | this.Height = Application.GetRealHeight(84);
|
| | | this.ThumbImageHeight = Application.GetRealHeight(84);
|
| | | this.ThumbImagePath = "Item/SeekBarIcon.png";
|
| | | this.SeekBarViewHeight = Application.GetRealHeight(10);
|
| | | this.SeekBarBackgroundColor = 0xfff5f5f5;
|
| | | this.IsProgressTextShow = false;
|
| | | this.MaxValue = 100;
|
| | | this.Gravity = Gravity.CenterHorizontal;
|
| | |
|
| | | //进度条值改变事件
|
| | | this.OnProgressChangedEvent += this.MyProgressChangedEvent;
|
| | | //手指弹起事件
|
| | | this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 事件_______________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 进度条值改变事件
|
| | | /// </summary>
|
| | | /// <param name="sender"></param>
|
| | | /// <param name="value"></param>
|
| | | private void MyProgressChangedEvent(object sender, int value)
|
| | | {
|
| | | if (this.ProgressChangedEvent == null)
|
| | | {
|
| | | this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
|
| | | return;
|
| | | }
|
| | | this.ProgressChangedEvent(0, value);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 手指弹起事件
|
| | | /// </summary>
|
| | | /// <param name="sender"></param>
|
| | | /// <param name="value"></param>
|
| | | private void MyStopTrackingTouchEvent(object sender, int value)
|
| | | {
|
| | | if (this.ProgressChangedEvent == null)
|
| | | {
|
| | | this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
|
| | | return;
|
| | | }
|
| | | this.ProgressChangedEvent(1, value);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 控件摧毁
|
| | | /// </summary>
|
| | | public override void RemoveFromParent()
|
| | | {
|
| | | this.ProgressChangedEvent = null;
|
| | | base.RemoveFromParent();
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | public MostRightIconControl(int i_width, int i_height) |
| | | { |
| | | this.Width = Application.GetMinRealAverage(110); |
| | | this.Height = ControlCommonResourse.ListViewRowHeight; |
| | | this.Height = this.Parent != null ? this.Parent.Height : ControlCommonResourse.ListViewRowHeight; |
| | | this.Gravity = Gravity.CenterVertical; |
| | | |
| | | var XX = Application.CurrentWidth - Application.GetMinRealAverage(i_width) - ControlCommonResourse.XXLeft; |
| | |
| | | frameBack.AddChidren(listView);
|
| | |
|
| | | //请选择区号
|
| | | var btnTitle = new NormalViewControl(230, 60, true);
|
| | | var btnTitle = new NormalViewControl(270, 60, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(69);
|
| | | btnTitle.TextID = R.MyInternationalizationString.uPleaseSelectAreaCode;
|
| | |
| | | btnSearch.Y = Application.GetRealHeight(46);
|
| | | frameBack.AddChidren(btnSearch);
|
| | | btnSearch.BindEvent(this.SearchEvent);
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //初始化地区列表
|
| | | this.InitAreaList();
|
| | | });
|
| | |
|
| | | //让这个按钮这个区域不能点击菜单
|
| | | var frameTemp = new FrameLayout(); |
| | |
| | | }
|
| | | this.CloseForm();
|
| | | };
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //初始化地区列表
|
| | | this.InitAreaList();
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | this.Height = Application.GetRealHeight(104);
|
| | | this.Radius = (uint)Application.GetRealHeight(17);
|
| | | this.BorderColor = 0xffbfc1c2;
|
| | | this.BorderWidth = (uint)Application.GetMinRealAverage(3);
|
| | | this.BorderWidth = 1;
|
| | | }
|
| | |
|
| | | /// <summary> |
| | |
| | | {
|
| | | try
|
| | | {
|
| | | //删除本地全部Log
|
| | | Global.CreateEmptyDirectory(Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory), true);
|
| | | var listAllFile = HdlAutoBackupLogic.GetFileFromDirectory(upPath);
|
| | | if (listAllFile.Count > 10)
|
| | | {
|
| | | listAllFile.Sort();
|
| | | while (listAllFile.Count >= 10)
|
| | | {
|
| | | System.IO.File.Delete(listAllFile[0]);
|
| | | listAllFile.RemoveAt(0);
|
| | | }
|
| | | }
|
| | | }
|
| | | catch { }
|
| | | }
|
| | | ProgressFormBar.Current.Close();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var contr = new ShowMsgControl(ShowMsgType.Tip, "Log上传成功");
|
| | | contr.Show();
|
| | | });
|
| | |
|
| | | return result;
|
| | | }
|
| | |
|
| | |
| | | foreach (var data in result.addedDeviceBindResponseData.BindList)
|
| | | {
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(data.BindMacAddr, data.BindEpoint);
|
| | | //0:添加成功 3:已经存在,也可以代表成功
|
| | | if (data.Result == 0 || data.Result == 3)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | listSuccess.Add(dicDevice[mainkeys]);
|
| | | }
|
| | | }
|
| | | //1:失败,节点设备或场景不存在
|
| | | else if (data.Result == 1)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | }
|
| | | //2:未知,由节点设备反馈发送“Bind/BindResult”主题消息确定是否成功
|
| | | else if (data.Result == 2)
|
| | | {
|
| | | if (result.addBindResultResponseData == null)
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | else
|
| | | {
|
| | | //添加成功
|
| | | if (result.addBindResultResponseData.Result == 0)
|
| | | {
|
| | | if (dicDevice.ContainsKey(mainkeys) == true)
|
| | | {
|
| | | listSuccess.Add(dicDevice[mainkeys]);
|
| | | }
|
| | | }
|
| | | //设备名称 绑定列表已满
|
| | | else if (result.addBindResultResponseData.Result == 140)
|
| | | {
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.uBindListIsFull);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | else
|
| | | {
|
| | | //设备名称 绑定失败
|
| | | string msg = Common.LocalDevice.Current.GetDeviceEpointName(dicDevice[mainkeys]) + "\r\n";
|
| | | msg += Language.StringByID(R.MyInternationalizationString.BindFailed);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (listSuccess.Count == 0)
|
| | | {
|
| | | //绑定目标设置失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uSetBindTargetsFail);
|
| | | this.ShowTipMsg(msg);
|
| | | }
|
| | | return listSuccess;
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | /// <param name="realGateway">真实物理网关对象</param>
|
| | | /// <param name="backupId">备份主键</param>
|
| | | public bool RecoverGateway(ZbGateway realGateway, string backupId)
|
| | | /// <param name="isAutoBack">0:获取网关手动备份文件列表 1:获取网关自动备份文件列表</param>
|
| | | public bool RecoverGateway(ZbGateway realGateway, string backupId, int isAutoBack)
|
| | | {
|
| | | //展开进度条
|
| | | ProgressFormBar.Current.Start();
|
| | | //从云端获取备份文件列表
|
| | | var result = this.GetGatewayFileList(realGateway, backupId);
|
| | | var result = this.GetGatewayFileList(realGateway, backupId, isAutoBack);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | }
|
| | |
|
| | | //从云端下载备份文件
|
| | | result = this.DownloadGatewayFile(realGateway, backupId);
|
| | | result = this.DownloadGatewayFile(realGateway, backupId, isAutoBack);
|
| | | if (result == false)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | /// <param name="realGateway"></param>
|
| | | /// <param name="backupClassId"></param>
|
| | | /// <returns></returns>
|
| | | private bool GetGatewayFileList(ZbGateway realGateway, string backupClassId)
|
| | | private bool GetGatewayFileList(ZbGateway realGateway, string backupClassId, int isAutoBack)
|
| | | {
|
| | | //正在获取备份文件列表
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileListGetting));
|
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 6202 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject {
|
| | | { "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", 0 },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
|
| | | { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
|
| | | { "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
|
| | | };
|
| | |
| | | /// <param name="realGateway"></param>
|
| | | /// <param name="backupClassId"></param>
|
| | | /// <returns></returns>
|
| | | private bool DownloadGatewayFile(ZbGateway realGateway, string backupClassId)
|
| | | private bool DownloadGatewayFile(ZbGateway realGateway, string backupClassId, int isAutoBack)
|
| | | {
|
| | | //正在下载备份文件
|
| | | ProgressFormBar.Current.SetMsg(Language.StringByID(R.MyInternationalizationString.uBackupFileDownloading));
|
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 6203 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject {
|
| | | { "url", fullUrl }, { "RequestVersion", Common.CommonPage.RequestVersion },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", 0 },
|
| | | { "LoginAccessToken", UserCenterLogic.GetConnectMainToken() }, { "IsGatewayAutoBackup", isAutoBack },
|
| | | { "BackupClassId", backupClassId },{ "GatewayUniqueId",HdlGatewayLogic.Current.GetGatewayId(realGateway)},
|
| | | { "IsOtherAccountCtrl",connectMode == HttpConnectMode.Admin?1:0}
|
| | | };
|
| | |
| | | /// <returns></returns> |
| | | private ZbGateway GetGatewayFromFile(string file)
|
| | | {
|
| | | try
|
| | | {
|
| | | byte[] filebyte = Global.ReadFileByHomeId(file);
|
| | | string strvalue = System.Text.Encoding.UTF8.GetString(filebyte);
|
| | | var gateway = JsonConvert.DeserializeObject<ZbGateway>(strvalue);
|
| | | return gateway;
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | return null;
|
| | | }
|
| | | } |
| | | |
| | | #endregion |
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | if (result != 1)
|
| | | if (result == -1)
|
| | | {
|
| | | return false;
|
| | | } |
| | | return true; |
| | | //设置网关的经纬度 |
| | | bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude); |
| | | return falge; |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | //错误:网关对象丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
|
| | | this.ShowTipMsg(msg);
|
| | | return -1;
|
| | | }
|
| | | //设置网关的经纬度
|
| | | bool falge = this.SetGatewaySite(zbGateway, Common.Config.Instance.Home.Longitude, Common.Config.Instance.Home.Latitude); |
| | | if (falge == false)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 85 } }; |
| | | if (this.IsGatewayExist(zbGateway) == true)
|
| | | {
|
| | | realWay.Send("GwLinuxLocate_Respon", jObject.ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | //如果这个网关还没有绑定的话,则强制使用本地连接
|
| | | realWay.SendLocation("GwLinuxLocate_Respon", System.Text.Encoding.UTF8.GetBytes(jObject.ToString()));
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion |
| | |
| | | var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 2013 } };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "Longitude", intLongitude }, { "Latitude", intLatitude } };
|
| | | jObject.Add("Data", data);
|
| | | if (this.IsGatewayExist(gateway) == true)
|
| | | {
|
| | | realWay.Send("Logic/SetSite", jObject.ToString());
|
| | | }
|
| | | else
|
| | | {
|
| | | //如果这个网关还没有绑定的话,则强制使用本地连接
|
| | | realWay.SendLocation("Logic/SetSite", System.Text.Encoding.UTF8.GetBytes(jObject.ToString()));
|
| | | }
|
| | |
|
| | | int TimeOut = 0;
|
| | | while (result == -1 && TimeOut < 30)
|
| | |
| | | {
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | HdlLogLogic.Current.WriteLog(-1, msg);
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | /// Log出力
|
| | | /// </summary>
|
| | | /// <param name="ex"></param>
|
| | | public void WriteLog(Exception ex)
|
| | | /// <param name="appendMsg">附加消息</param>
|
| | | public void WriteLog(Exception ex, string appendMsg = "")
|
| | | {
|
| | | //Log出力
|
| | | string msg = ex.Message + "\r\n";
|
| | | string msg = appendMsg == "" ? string.Empty : appendMsg + "\r\n";
|
| | | msg += ex.Message + "\r\n";
|
| | | msg += ex.StackTrace;
|
| | | this.WriteLog(-1, msg);
|
| | | }
|
| | |
| | | }
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + nowFormId + "]";
|
| | | HdlLogLogic.Current.WriteLog(-1, msg);
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | |
| | | }
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + nowFormId + "]";
|
| | | HdlLogLogic.Current.WriteLog(-1, msg);
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | });
|
| | |
|
| | |
| | |
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + nowFormId + "]";
|
| | | HdlLogLogic.Current.WriteLog(-1, msg);
|
| | | HdlLogLogic.Current.WriteLog(ex);
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | }
|
| | | });
|
| | | }
|
old mode 100644
new mode 100755
| | |
| | | var formTemp = UserCenterResourse.DicActionForm[formName];
|
| | | formTemp.CloseForm();
|
| | | UserCenterResourse.DicActionForm.Remove(formName);
|
| | | formTemp = null;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
| | | //移除ID
|
| | | UserCenterResourse.listActionFormId.Remove(UserCenterResourse.DicActionForm[formName].FormID);
|
| | | //移除画面
|
| | | var formTemp = UserCenterResourse.DicActionForm[formName];
|
| | | UserCenterResourse.DicActionForm.Remove(formName);
|
| | | formTemp = null;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | //APP缓存加载开始
|
| | | UserCenterResourse.Option.AppCanSignout = false;
|
| | | //还原远程连接变量
|
| | | ZigBee.Device.ZbGateway.AllowRemoteCtrl = true;
|
| | |
|
| | | //只有在住宅ID不一样的时候才做这个操作
|
| | | if (Common.Config.Instance.HomeId != UserCenterResourse.Option.OldHomeStringId
|
| | |
| | | /// 控件信息
|
| | | /// </summary>
|
| | | private Dictionary<string, RowControlInfo> dicControl = new Dictionary<string, RowControlInfo>();
|
| | | /// <summary>
|
| | | /// 激活的设备地址
|
| | | /// </summary>
|
| | | private string actionDeviceKeys = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | btnDeviceName.X = Application.GetRealWidth(193);
|
| | | btnDeviceName.Y = Application.GetRealHeight(45);
|
| | | frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
|
| | | rowInfo.btnDeviceName = btnDeviceName;
|
| | | //房间
|
| | | var btnRoom = new NormalViewControl(400, 50, true);
|
| | | btnRoom.X = btnDeviceName.X;
|
| | |
| | | btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
|
| | | frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly);
|
| | | rowInfo.btnRoom = btnRoom;
|
| | | //摄氏度
|
| | | var btnValue = new NormalViewControl(300, 60, true);
|
| | | btnValue.Y = Application.GetRealHeight(58);
|
| | |
| | |
|
| | | frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.actionDeviceKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | |
|
| | | var form = new IndoorUnitSettionForm();
|
| | | form.AddForm(device);
|
| | | };
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面重新激活事件___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
|
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | if (this.actionDeviceKeys != null && dicControl.ContainsKey(this.actionDeviceKeys) == true)
|
| | | {
|
| | | //刷新设备信息
|
| | | var device = Common.LocalDevice.Current.GetDevice(this.actionDeviceKeys);
|
| | | if (device != null)
|
| | | {
|
| | | var contr = dicControl[this.actionDeviceKeys];
|
| | | contr.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | contr.btnRoom.Text = Common.Room.CurrentRoom.GetRoomNameByDevice(device);
|
| | | }
|
| | | }
|
| | | this.actionDeviceKeys = null;
|
| | |
|
| | | return 1;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 结构体_____________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | private class RowControlInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 设备名字
|
| | | /// </summary>
|
| | | public NormalViewControl btnDeviceName = null;
|
| | | /// <summary>
|
| | | /// 设备房间
|
| | | /// </summary>
|
| | | public NormalViewControl btnRoom = null;
|
| | | /// <summary>
|
| | | /// 设备图标背景
|
| | | /// </summary>
|
| | | public FrameLayout btnIconBack = null;
|
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | btnAddFrameLayout.AddChidren(btnBindDown); |
| | | |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | btnBindDown.Visible = false; |
| | | } |
| | | |
| | | btnBindDown.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | SideslipFramelayout(); |
| | |
| | | dicFloor = Common.Room.CurrentRoom.GetFloorSortList(); |
| | | currentKey.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | // 获取没有楼层房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | if (string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | | roomList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 获取楼层对应对房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | |
| | | roomList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | //首次拿到所有房间中按键的目标并存储 |
| | | GetALlDispalyRoomDeviceList(); |
| | | if (currentKeyAllRoomDeviceList.Count != 0) |
| | | { |
| | | if (currentKey.bindList != null && currentKey.bindList.Count != 0) |
| | | if (currentKey.bindList.Count != 0) |
| | | { |
| | | foreach (var devA in currentKeyAllRoomDeviceList) |
| | | { |
| | |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | btnChooseKeyMode.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (targetList.Count == 0) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnChooseKeyMode); |
| | | return; |
| | | } |
| | | this.RemoveFromParent(); |
| | | |
| | | var chooseKeyModePage = new Shared.Phone.UserCenter.DeviceBind.ChooseKeyModePage(currentKey, curDeviceBindType, targetList); |
| | |
| | | |
| | | var btnRoomFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(78), |
| | | Width = Application.GetRealWidth(187), |
| | | Y = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(58), |
| | | Radius = (uint)Application.GetMinRealAverage(78 / 2), |
| | | BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange, |
| | | Height = Application.GetRealHeight(159), |
| | | Width = Application.GetRealWidth(255), |
| | | Y = Application.GetRealHeight(23), |
| | | X = Application.GetRealWidth(5), |
| | | BackgroundImagePath = "Item/RoomIconBackground.png", |
| | | BorderWidth = 1, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayout); |
| | |
| | | btnRoom.IsSelected = false; |
| | | if (index == 0) |
| | | { |
| | | btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | btnRoomFrameLayout.BorderWidth = 0; |
| | | btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | |
| | | if (curentOldRoom != null) |
| | | { |
| | | curentOldRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; |
| | | } |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curRoom = room; |
| | | currentKey.RoomId = room.Id; |
| | | RefreshDeviceList(curRoom); |
| | | if (curTypeDeviceList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | | if (btnRoomFrameLayout.BorderWidth == 1) |
| | |
| | | if (curentOldRoomFrameLayout != null) |
| | | { |
| | | curentOldRoomFrameLayout.BorderWidth = 1; |
| | | curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; |
| | | curentOldRoomFrameLayout.BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackground.png"; |
| | | } |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | | curentOldRoomFrameLayout.BorderWidth = 0; |
| | | curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | } |
| | | curRoom = room; |
| | | currentKey.RoomId = room.Id; |
| | | RefreshDeviceList(curRoom); |
| | |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | }; |
| | | btnRoom.MouseUpEventHandler += eHandlerRoom; |
| | | btnRoomFrameLayout.MouseUpEventHandler += eHandlerRoom; |
| | | |
| | | var btnEmpty = new Button |
| | | { |
| | | Width = Application.GetRealWidth(58), |
| | | X = btnRoom.Right, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnEmpty); |
| | | index++; |
| | | } |
| | | BindInfo.FinishDisplay(roomTempList, btnChooseKeyMode); |
| | |
| | | case "AddSwitch": |
| | | foreach (var r in Shared.Common.Room.Lists) |
| | | { |
| | | if (r.IsLove == true) |
| | | { |
| | | var aa = 0; ; |
| | | } |
| | | if (r.DeviceUIList.Count == 0) |
| | | { |
| | | continue; |
| | |
| | | X = Application.GetRealWidth(861 + 81), |
| | | Y = Application.GetRealHeight(35), |
| | | SelectedImagePath = "DoorLock/SelectedIcon.png", |
| | | //Text = device.CommonDevice?.DeviceEpointName, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | Visible = false, |
| | | Tag = device.CommonDevice?.DeviceEpointName, |
| | |
| | | } |
| | | else |
| | | { |
| | | if (targetList.Count > 9) |
| | | if (targetList.Count > 7) |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFull), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | } |
| | |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | } |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | }; |
| | | rowLayout.MouseUpEventHandler += hander; |
| | |
| | | |
| | | curIndex++; |
| | | } |
| | | //IsInitEntry = false; |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | | // 侧边导航栏 |
| | |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | //var dev = common as Panel; |
| | | }); |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 按键配置的目标列表 |
| | | /// </summary> |
| | | List<CommonDevice> targetList = new List<CommonDevice>(); |
| | | List<Room> roomList = new List<Room>(); |
| | | List<CommonDevice> targetList = new List<CommonDevice>();//临时目标列表 |
| | | List<Room> roomList = new List<Room>();//本地房间列表 |
| | | public Action<List<BindListResponseObj>> action; |
| | | Button btnFinifh; |
| | | Button btnFloorText; |
| | | Dictionary<string, string> dicFloor; |
| | | |
| | | Dictionary<string, string> dicFloor;//楼层列表 |
| | | List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 添加场景页显示 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.AddScene)); |
| | |
| | | dicFloor = Common.Room.CurrentRoom.GetFloorSortList(); |
| | | currentKey.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId(); |
| | | btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName(); |
| | | |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | // 获取没有楼层房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | if (string.IsNullOrEmpty(room.FloorId)) |
| | | { |
| | | roomList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 获取楼层对应对房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | |
| | | roomList.Add(room); |
| | | } |
| | | } |
| | | } |
| | | if (roomList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | //首次拿到所有房间中按键的目标并存储 |
| | | GetALlDispalyRoomSceneList(); |
| | | |
| | | if (currentKeyAllRoomSceneList.Count != 0) |
| | | { |
| | | if (currentKey.bindList.Count != 0) |
| | | { |
| | | foreach (var scTemp in currentKeyAllRoomSceneList) |
| | | { |
| | | var sc = currentKey.bindList.Find(obj => (obj != null) && (obj.BindScenesId == scTemp.Id)); |
| | | if (sc != null) |
| | | { |
| | | targetList.Add(scTemp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Shared.Common.Room curRoom = roomList[0]; |
| | | int index = 0; |
| | | RefreshRoomList(curRoom, btnFinifh, ref index); |
| | | RefreshRoomList(curRoom, ref index); |
| | | RefreshSceneList(roomList[index]); |
| | | |
| | | if (curRoom.SceneUIList.Count == 0) |
| | |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | btnFinifh.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | bool isFinish = false; |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | try |
| | | { |
| | | if (targetList.Count == 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.BindDeviceTargetIsEmpty); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); |
| | | if (currentKey.bindList.Count != 0) |
| | | { |
| | |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | this.RemoveFromParent(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Scene_Trigger); |
| | | if (temp.setWritableValueResponData?.Status != 0) |
| | | if (temp == null || temp.setWritableValueResponData == null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | var myTip = new Tip(); |
| | | myTip.Direction = AMPopTipDirection.None; |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | if (temp.setWritableValueResponData.Status != 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | myTip.CloseTime = 2; |
| | | myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode); |
| | | myTip.Show(Common.CommonPage.Instance); |
| | | //new Tip() { Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(btnFinifh); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | |
| | | var addBindeDev = new AddBindData(); |
| | | addBindeDev.DeviceAddr = currentKey.DeviceAddr; |
| | | addBindeDev.Epoint = currentKey.DeviceEpoint; |
| | | |
| | | foreach (var de in targetList) |
| | | { |
| | | if (de.DeviceAddr != null) |
| | |
| | | |
| | | var dev = new AddedDeviceBindResponseAllData(); |
| | | dev = await currentKey.AddDeviceBindAsync(addBindeDev); |
| | | foreach (var ab in dev.addedDeviceBindResponseData?.BindList) |
| | | if (dev.addedDeviceBindResponseData == null) |
| | | { |
| | | switch (ab.Result) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | case 0: |
| | | currentKey.bindList.Add((BindListResponseObj)ab); |
| | | |
| | | for (int i = 0; i < targetList.Count; i++) |
| | | { |
| | | var de = targetList[i]; |
| | | var sc1 = new SceneUI(); |
| | | if (de.DeviceAddr == null) |
| | | { |
| | | sc1 = (SceneUI)de; |
| | | |
| | | if (sc1.Id == ab.BindScenesId) |
| | | { |
| | | targetList.RemoveAt(i); |
| | | i--; |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (dev.addedDeviceBindResponseData.Result == 0) |
| | | { |
| | | currentKey.bindList = dev.addedDeviceBindResponseData.BindList; |
| | | targetList.Clear(); |
| | | isFinish = true; |
| | | break; |
| | | case 1: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindErrorAbsence), |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | case 2: |
| | | switch (dev.addBindResultResponseData?.Result) |
| | | { |
| | | case 0: |
| | | currentKey.bindList.Add((BindListResponseObj)ab); |
| | | for (int i = 0; i < targetList.Count; i++) |
| | | { |
| | | var de = targetList[i]; |
| | | if (de.DeviceAddr == ab.BindMacAddr && de.DeviceEpoint == ab.BindEpoint) |
| | | { |
| | | targetList.RemoveAt(i); |
| | | i--; |
| | | } |
| | | } |
| | | isFinish = true; |
| | | break; |
| | | case 140: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFull), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | default: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | } |
| | | break; |
| | | case 3: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindErrorExisted), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | case 4: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | if (isFinish) |
| | | { |
| | | if (action != null) |
| | |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | }); |
| | | } |
| | | else if (dev.addedDeviceBindResponseData.Result == 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed), |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError), |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | }; |
| | | #endregion |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="key">Key.</param> |
| | | void RefreshRoomList(Shared.Common.Room curRoom, Button btnChooseKeyMode, ref int index2) |
| | | void RefreshRoomList(Shared.Common.Room curRoom, ref int index2) |
| | | { |
| | | if (roomList.Count == 0) |
| | | { |
| | |
| | | |
| | | var btnRoomFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(78), |
| | | Width = Application.GetRealWidth(187), |
| | | Y = Application.GetRealHeight(58), |
| | | X = Application.GetRealWidth(58), |
| | | Radius = (uint)Application.GetMinRealAverage(78 / 2), |
| | | BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange, |
| | | Height = Application.GetRealHeight(159), |
| | | Width = Application.GetRealWidth(255), |
| | | Y = Application.GetRealHeight(23), |
| | | X = Application.GetRealWidth(5), |
| | | BackgroundImagePath = "Item/RoomIconBackground.png", |
| | | BorderWidth = 1, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnRoomFrameLayout); |
| | |
| | | btnRoom.IsSelected = false; |
| | | if (index == 0) |
| | | { |
| | | btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | btnRoomFrameLayout.BorderWidth = 0; |
| | | btnRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | |
| | | if (curentOldRoom != null) |
| | | { |
| | | curentOldRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; |
| | | curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; |
| | | } |
| | | curentOldRoom = btnRoom; |
| | | curentOldRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite; |
| | | curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curRoom = room; |
| | | currentKey.RoomId = room.Id; |
| | | RefreshSceneList(curRoom); |
| | | if (curRoom.SceneUIList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | | if (btnRoomFrameLayout.BorderWidth == 1) |
| | | { |
| | | if (curentOldRoomFrameLayout != null) |
| | | { |
| | | curentOldRoomFrameLayout.BorderWidth = 1; |
| | | curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; |
| | | curentOldRoomFrameLayout.BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackground.png"; |
| | | } |
| | | curentOldRoomFrameLayout = btnRoomFrameLayout; |
| | | curentOldRoomFrameLayout.BorderWidth = 0; |
| | | curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange; |
| | | curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; |
| | | } |
| | | curRoom = room; |
| | | currentKey.RoomId = room.Id; |
| | | RefreshSceneList(curRoom); |
| | | if (curRoom.SceneUIList.Count == 0) |
| | | { |
| | | btnChooseKeyMode.Enable = false; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnChooseKeyMode.Enable = true; |
| | | btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | RefreshSceneList(curRoom); |
| | | |
| | | }; |
| | | btnRoom.MouseUpEventHandler += eHandlerRoom; |
| | | btnRoomFrameLayout.MouseUpEventHandler += eHandlerRoom; |
| | | |
| | | var btnEmpty = new Button |
| | | { |
| | | Width = Application.GetRealWidth(58), |
| | | X = btnRoom.Right, |
| | | }; |
| | | btnHorizontalScrolViewLayout.AddChidren(btnEmpty); |
| | | index++; |
| | | } |
| | | BindInfo.FinishDisplay(roomTempList, btnChooseKeyMode); |
| | | BindInfo.FinishDisplay(roomTempList, btnFinifh); |
| | | RefreshSceneList(curRoom); |
| | | } |
| | | |
| | | //按键绑定场景表显示 |
| | | void RefreshSceneList(Shared.Common.Room curRoom) |
| | | { |
| | | midVerticalScrolViewLayout.RemoveAll(); |
| | | if (curRoom.SceneUIList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | midVerticalScrolViewLayout.RemoveAll(); |
| | | |
| | | Button oldScene = null; |
| | | int curIndex = 0; |
| | | foreach (var scene in curRoom.SceneUIList) |
| | |
| | | { |
| | | btnBindName.Text = scene.Name; |
| | | } |
| | | |
| | | if (targetList.Count == 0) |
| | | { |
| | | foreach (var bindedSc in currentKey.bindList) |
| | | { |
| | | if (scene.Id == bindedSc.BindScenesId) |
| | |
| | | btnChoose.Visible = true; |
| | | oldScene = btnChoose; |
| | | targetList.Add(scene); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | foreach (var bindedSc in targetList) |
| | | { |
| | | var sc1 = (SceneUI)bindedSc; |
| | | if (scene.Id == sc1.Id) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldScene = btnChoose; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | oldScene.IsSelected = false; |
| | | oldScene.Visible = false; |
| | | targetList.Clear(); |
| | | } |
| | | oldScene = btnChoose; |
| | | oldScene.IsSelected = true; |
| | |
| | | targetList.Clear(); |
| | | targetList.Add(scene); |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | }; |
| | | rowLayout.MouseUpEventHandler += hander; |
| | | devicePic.MouseUpEventHandler += hander; |
| | | btnBindName.MouseUpEventHandler += hander; |
| | | btnChoose.MouseUpEventHandler += hander; |
| | | curIndex++; |
| | | } |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | } |
| | | |
| | |
| | | currentKey.currentSelectFloorId = curFloorId; |
| | | btnFloorText.Text = dicFloor[floorId]; |
| | | roomList.Clear(); |
| | | |
| | | if (!btnMethodText.IsSelected) |
| | | { |
| | | if (oldbutton != null) |
| | |
| | | roomList.Add(curRoom); |
| | | } |
| | | int index = 0; |
| | | RefreshRoomList(curRoom, btnFinifh, ref index); |
| | | RefreshRoomList(curRoom, ref index); |
| | | RefreshSceneList(roomList[0]); |
| | | |
| | | if (targetList.Count == 0) |
| | | { |
| | | btnFinifh.Enable = false; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; |
| | | } |
| | | else |
| | | { |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | btnAllMethod.MouseUpEventHandler += hander; |
| | |
| | | } |
| | | } |
| | | |
| | | //当前按键所有显示房间的所有场景处理 |
| | | List<SceneUI> GetALlDispalyRoomSceneList() |
| | | { |
| | | currentKeyAllRoomSceneList.Clear(); |
| | | // 获取所有房间 |
| | | foreach (var room in Shared.Common.Room.Lists) |
| | | { |
| | | //如果房间为喜爱,则不显示 |
| | | if (room.IsLove == true) |
| | | { |
| | | continue; |
| | | } |
| | | //如果房间中没有场景,则不显示 |
| | | if (room.SceneUIList.Count == 0) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | foreach (var scene in room.SceneUIList) |
| | | { |
| | | currentKeyAllRoomSceneList.Add(scene); |
| | | } |
| | | } |
| | | return currentKeyAllRoomSceneList; |
| | | } |
| | | |
| | | public void DeviceInfoChange(CommonDevice common, string typeTag) |
| | | { |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public static string GetCurrentSelectFloorId() |
| | | { |
| | | var dicFloor = Common.Room.CurrentRoom.GetFloorSortList(); |
| | | var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();// |
| | | foreach (var floorId in dicFloor.Keys) |
| | | { |
| | | //第一个楼层 |
| | |
| | | Action<List<BindListResponseObj>> devicBindAction;//设备被绑定通知 |
| | | private System.Collections.Generic.List<CommonDevice> localDeviceList = new System.Collections.Generic.List<CommonDevice>();//本地设备列表 |
| | | private System.Collections.Generic.List<SceneUI> scList = new System.Collections.Generic.List<SceneUI> { };//本地场景列表 |
| | | FrameLayout blankFrameLayout;//空数据显示布局 |
| | | #endregion |
| | | |
| | | //初始化按键数据 |
| | |
| | | } |
| | | else |
| | | { |
| | | currentKey.panelMode = 65535; |
| | | SideslipFramelayout(); |
| | | } |
| | | }; |
| | |
| | | btnAddFrameLayout.MouseDownEventHandler += eHandlerAdd; |
| | | #endregion |
| | | CommonPage.Loading.Start(""); |
| | | middleFrameLayout(); |
| | | InitListInfo(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | | void middleFrameLayout() |
| | | { |
| | | topFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetMinRealAverage(0), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | this.midFrameLayout.AddChidren(topFrameLayout); |
| | | |
| | | #region BindEmptyPic UI |
| | | entryStatusPic = new Button |
| | | { |
| | | X = Application.GetRealWidth(213), |
| | | Y = Application.GetRealHeight(418), |
| | | UnSelectedImagePath = "BindPic/BindEmptyPic.png", |
| | | Visible = false, |
| | | }; |
| | | this.midFrameLayout.AddChidren(entryStatusPic); |
| | | |
| | | btnPicTip = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1020), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoControlTargets), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Visible = false, |
| | | }; |
| | | this.midFrameLayout.AddChidren(btnPicTip); |
| | | #endregion |
| | | |
| | | midVerticalRefreshLayout = new VerticalRefreshLayout() |
| | | { |
| | | }; |
| | |
| | | InitListInfo(); |
| | | midVerticalRefreshLayout.EndHeaderRefreshing(); |
| | | }; |
| | | topFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetMinRealAverage(0), |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | }; |
| | | midVerticalRefreshLayout.AddChidren(topFrameLayout); |
| | | |
| | | BlankPicUI(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空数据UI显示 |
| | | /// </summary> |
| | | void BlankPicUI() |
| | | { |
| | | blankFrameLayout = new FrameLayout |
| | | { |
| | | }; |
| | | midVerticalRefreshLayout.AddChidren(blankFrameLayout); |
| | | |
| | | entryStatusPic = new Button |
| | | { |
| | | X = Application.GetRealWidth(213), |
| | | Y = Application.GetRealHeight(418), |
| | | UnSelectedImagePath = "BindPic/BindEmptyPic.png", |
| | | Visible = false, |
| | | }; |
| | | blankFrameLayout.AddChidren(entryStatusPic); |
| | | |
| | | btnPicTip = new Button |
| | | { |
| | | Y = Application.GetRealHeight(1020), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoControlTargets), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Visible = false, |
| | | }; |
| | | blankFrameLayout.AddChidren(btnPicTip); |
| | | } |
| | | /// <summary> |
| | | /// 按键绑定表显示 |
| | | /// </summary> |
| | | async void RefreshList() |
| | | { |
| | | midVerticalRefreshLayout.RemoveAll(); |
| | | this.midFrameLayout.RemoveAll(); |
| | | middleFrameLayout(); |
| | | midVerticalRefreshLayout.RemoveAll(); |
| | | |
| | | var frameLayoutRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetMinRealAverage(0), |
| | |
| | | btnPicTip.Height = Application.GetRealHeight(49); |
| | | btnPicTip.Visible = true; |
| | | entryStatusPic.Visible = true; |
| | | midVerticalRefreshLayout.Height = Application.GetRealHeight(0); |
| | | blankFrameLayout.Height = midVerticalRefreshLayout.Height; |
| | | } |
| | | else |
| | | { |
| | |
| | | btnPicTip.Height = Application.GetRealHeight(0); |
| | | btnPicTip.Visible = false; |
| | | entryStatusPic.Visible = false; |
| | | blankFrameLayout.Height = Application.GetRealHeight(0); |
| | | if (currentKey.panelMode == 1) |
| | | { |
| | | topFrameLayout.Height = Application.GetRealHeight(0); |
| | |
| | | else |
| | | { |
| | | topFrameLayout.Height = Application.GetRealHeight(150); |
| | | midVerticalRefreshLayout.Y = Application.GetRealHeight(150); |
| | | BindModeDisplay(); |
| | | } |
| | | int curIndex = 0; |
| | |
| | | { |
| | | devicePic.UnSelectedImagePath = curSceneUI.IconPath; |
| | | btnBindName.Text = curSceneUI.Name; |
| | | if (curSceneUI.GetZone() != null) |
| | | { |
| | | btnFloorRoomName.Text = curSceneUI.GetZone(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | //获取设备所属房间 |
| | | var tempDevRoom = Common.Room.CurrentRoom.GetRoomByDevice(tempDev); |
| | | //获取设备所在楼层 |
| | | if (Common.Config.Instance.Home.FloorDics.Count == 0) |
| | | { |
| | | } |
| | | if (tempDevRoom != null) |
| | | { |
| | | var tempDevFloorId = tempDevRoom.FloorId; |
| | | //获取楼层的名字 |
| | | var tempDevRoomName = tempDevRoom.Name; |
| | | //获取楼层的名字 |
| | | var tempDevFloorName = Common.Config.Instance.Home.GetFloorNameById(tempDevFloorId); |
| | | btnFloorRoomName.Text = tempDevFloorName + "," + tempDevRoomName; |
| | | } |
| | | var deviceUi = Common.LocalDevice.Current.GetDeviceUI(tempDev); |
| | | if (deviceUi != null) |
| | | { |
| | | devicePic.UnSelectedImagePath = deviceUi.IconPath; |
| | | devicePic.Width = Application.GetRealWidth(110); |
| | | devicePic.Text = ""; |
| | | } |
| | | if (tempDev.DeviceEpointName == "") |
| | | { |
| | | btnBindName.Text = tempDev.DeviceEpoint + Language.StringByID(R.MyInternationalizationString.uDeviceCircuit); |
| | |
| | | //一键清除按键事件 |
| | | btnDel.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | var alert = new Alert(Language.StringByID(R.MyInternationalizationString.Tip), Language.StringByID(R.MyInternationalizationString.SureClearKeyModeAndTargets), |
| | | Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | alert.Show(); |
| | | |
| | | alert.ResultEventHandler += async (s1, e1) => |
| | | { |
| | | if (e1) |
| | | { |
| | | bool isDelSuccess = false; |
| | | try |
| | | { |
| | |
| | | } |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | }; |
| | | |
| | | }; |
| | | } |
| | | |
| | |
| | | CommonPage.Loading.Start(""); |
| | | var delResult = new DelDeviceBindResponseAllData(); |
| | | delResult = await currentKey.DelDeviceBindAsync(delDevice); |
| | | //if (delResult != null) |
| | | //{ |
| | | // if (delResult.removeBindResultResponseData != null) |
| | | // { |
| | | // if (delResult.removeBindResultResponseData.Result == 0) |
| | | // { |
| | | // currentKey.bindList.Remove(bindDevice); |
| | | // RefreshList(); |
| | | // return 0; |
| | | // } |
| | | // else |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | // } |
| | | // } |
| | | // else if (delResult.delDeviceBindResponseData != null) |
| | | // { |
| | | // foreach (var remTarget in delResult.delDeviceBindResponseData.RemoveBindList) |
| | | // { |
| | | // if (remTarget.Result == 0) |
| | | // { |
| | | // currentKey.bindList.Remove(bindDevice); |
| | | // RefreshList(); |
| | | // //如果是场景,用户删除清空当前到房间列表 |
| | | // currentKey.RoomId = ""; |
| | | // currentKey.ReSave(); |
| | | // return 0; |
| | | // } |
| | | // else |
| | | // { |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RemoveFailed), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(CommonPage.Instance); |
| | | //} |
| | | |
| | | if (delResult != null && delResult.removeBindResultResponseData != null) |
| | | if (delResult != null && delResult.delDeviceBindResponseData != null) |
| | | { |
| | | if (delResult.delDeviceBindResponseData?.RemoveBindList != null) |
| | | { |
| | |
| | | currentKey.bindList.Remove(bindDevice); |
| | | RefreshList(); |
| | | //如果是场景,用户删除清空当前到房间列表 |
| | | if(re.BindType == 2) |
| | | { |
| | | currentKey.panelMode = 65535; |
| | | } |
| | | currentKey.RoomId = ""; |
| | | currentKey.ReSave(); |
| | | return 0; |
| | |
| | | { |
| | | this.currentKey = key; |
| | | this.currentModeID = key.panelMode; |
| | | this.oldModeID = key.panelMode; |
| | | this.curDeviceBindType = deviceBindType; |
| | | this.targetList = targetSelectList; |
| | | } |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | ZigBee.Device.Panel currentKey; |
| | | ZigBee.Device.Panel currentKey;//当前按键 |
| | | //显示被绑定设备或场景的view |
| | | VerticalScrolViewLayout midVerticalScrolViewLayout; |
| | | HorizontalScrolViewLayout btnHorizontalScrolViewLayout; |
| | | VerticalScrolViewLayout midVerticalScrolViewLayout;//中部刷新列表 |
| | | HorizontalScrolViewLayout btnHorizontalScrolViewLayout;//房间列表左右滑动布局 |
| | | /// <summary> |
| | | /// 按键配置的目标列表 |
| | | /// </summary> |
| | | List<CommonDevice> targetList = new List<CommonDevice>(); |
| | | List<CommonDevice> targetList = new List<CommonDevice>();//本地临时选中列表 |
| | | /// <summary> |
| | | /// 新的按键配置目标列表中,目标实际存在按键中,此时要删掉的数据 |
| | | /// </summary> |
| | | List<CommonDevice> oldTargetList = new List<CommonDevice>(); |
| | | List<Room> roomList = new List<Room>(); |
| | | int currentClusterID = 6; |
| | | public Action<List<BindListResponseObj>> action; |
| | | int currentModeID = 0; |
| | | int oldModeID = 0; |
| | | string curDeviceBindType = ""; |
| | | List<CommonDevice> oldTargetList = new List<CommonDevice>();//本地旧的选中列表 |
| | | int currentClusterID = 6;//当前簇ID |
| | | public Action<List<BindListResponseObj>> action;//回调绑定目标页面刷新 |
| | | int currentModeID = 0;//当前模式ID |
| | | string curDeviceBindType = "";//当前设备绑定类型 |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 显示按键模式页 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.ChooseKeyMode)); |
| | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | | async void MidFrameLayoutContent() |
| | | { |
| | | #region UI |
| | |
| | | #endregion |
| | | |
| | | #region 数据处理 |
| | | roomList = Shared.Common.Room.Lists; |
| | | Shared.Common.Room curRoom = roomList[0]; |
| | | int index = 0; |
| | | KeyModeList(roomList[index]); |
| | | |
| | | KeyModeList(); |
| | | btnFinifh.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | oldTargetList.Clear(); |
| | |
| | | if (currentKey.bindList != null) |
| | | { |
| | | var bindResult = await currentKey.ClearBindInfoAsync(); |
| | | |
| | | if (bindResult != null && bindResult.clearBindInfoResponseData != null) |
| | | { |
| | | if (bindResult.clearBindInfoResponseData.Result != 0) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | CommonPage.Loading.Hide(); |
| | | this.RemoveFromParent(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | //是亮度再次发6命令 |
| | | if (currentClusterID == 8) |
| | | { |
| | | foreach (var de in targetList) |
| | | { |
| | | if (de.DeviceAddr != null) |
| | | { |
| | | var addBindInfo = new AddBindListObj(); |
| | | addBindInfo.BindType = 0; |
| | | addBindInfo.BindCluster = 6; |
| | | addBindInfo.BindMacAddr = de.DeviceAddr; |
| | | addBindInfo.BindEpoint = de.DeviceEpoint; |
| | | addBindeDev.BindList.Add(addBindInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var dev = new AddedDeviceBindResponseAllData(); |
| | | dev = await currentKey.AddDeviceBindAsync(addBindeDev); |
| | | if (dev.addedDeviceBindResponseData == null) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | foreach (var ab in dev.addedDeviceBindResponseData?.BindList) |
| | | if (dev.addedDeviceBindResponseData.Result == 0) |
| | | { |
| | | switch (ab.Result) |
| | | if (currentClusterID == 8) |
| | | { |
| | | case 0: |
| | | currentKey.bindList.Add((BindListResponseObj)ab); |
| | | |
| | | for (int i = 0; i < targetList.Count; i++) |
| | | foreach (var de in dev.addedDeviceBindResponseData.BindList) |
| | | { |
| | | var de = targetList[i]; |
| | | var sc1 = new SceneUI(); |
| | | if (de.DeviceAddr == null) |
| | | if (de.BindCluster == 8) |
| | | { |
| | | sc1 = (SceneUI)de; |
| | | |
| | | if (sc1.Id == ab.BindScenesId) |
| | | { |
| | | targetList.RemoveAt(i); |
| | | i--; |
| | | currentKey.bindList.Add(de); |
| | | } |
| | | } |
| | | } |
| | | //isFinish = true; |
| | | break; |
| | | case 1: |
| | | else |
| | | { |
| | | currentKey.bindList = dev.addedDeviceBindResponseData.BindList; |
| | | } |
| | | if (action != null) |
| | | { |
| | | action(currentKey.bindList); |
| | | } |
| | | this.RemoveFromParent(); |
| | | targetList.Clear(); |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | else if (dev.addedDeviceBindResponseData.Result == 1) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() |
| | | { |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindErrorAbsence), |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindFailed), |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | case 2: |
| | | var abr = dev.addBindResultResponseData?.Result; |
| | | switch (dev.addBindResultResponseData?.Result) |
| | | { |
| | | case 0: |
| | | currentKey.bindList.Add((BindListResponseObj)ab); |
| | | for (int i = 0; i < targetList.Count; i++) |
| | | { |
| | | var de = targetList[i]; |
| | | if (de.DeviceAddr == ab.BindMacAddr && de.DeviceEpoint == ab.BindEpoint) |
| | | { |
| | | targetList.RemoveAt(i); |
| | | i--; |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | } |
| | | //isFinish = true; |
| | | break; |
| | | case 140: |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFull), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | default: |
| | | Application.RunOnMainThread(() => |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = ab.ESName + Language.StringByID(R.MyInternationalizationString.BindUnknownError), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | MaxWidth = 150, |
| | | Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError), |
| | | Direction = AMPopTipDirection.Up, |
| | | CloseTime = 1 |
| | | }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | } |
| | | break; |
| | | case 3: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = ab.ESName + Language.StringByID(R.MyInternationalizationString.BindErrorExisted), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | case 4: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = ab.ESName + Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | default: |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = ab.ESName + Language.StringByID(R.MyInternationalizationString.BindUnknownError), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh); |
| | | }); |
| | | break; |
| | | } |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh); |
| | | }); |
| | | btnFinifh.Enable = true; |
| | |
| | | return; |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | catch |
| | | { |
| | | //if (isFinish) |
| | | //{ |
| | | // if (action != null) |
| | | // { |
| | | // action(currentKey.bindList); |
| | | // } |
| | | // this.RemoveFromParent(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // this.RemoveFromParent(); |
| | | //} |
| | | if (action != null) |
| | | { |
| | | action(currentKey.bindList); |
| | | } |
| | | this.RemoveFromParent(); |
| | | CommonPage.Loading.Hide(); |
| | | btnFinifh.Enable = true; |
| | | btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | |
| | | /// </summary> |
| | | /// <param name="gateway">Gateway.</param> |
| | | /// <param name="key">Key.</param> |
| | | void KeyModeList(Shared.Common.Room curRoom) |
| | | private void KeyModeList() |
| | | { |
| | | midVerticalScrolViewLayout.RemoveAll(); |
| | | |
| | | switch (curDeviceBindType) |
| | | { |
| | | case "AddSwitch": |
| | |
| | | } |
| | | } |
| | | |
| | | public void AddSwitchMode() |
| | | private void AddSwitchMode() |
| | | { |
| | | Button oldMode = null; |
| | | for (int i = 0; i < 3; i++) |
| | |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | } |
| | | else if ((currentKey.panelMode == 65535) && i == 0) |
| | | { |
| | | //默认第一个 |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | currentModeID = 100; |
| | | currentKey.panelMode = currentModeID; |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> hander = async (sender, e) => |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public void AddDimmerMode() |
| | | private void AddDimmerMode() |
| | | { |
| | | Button oldMode = null; |
| | | for (int i = 0; i < 5; i++) |
| | |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | } |
| | | else if ((currentKey.panelMode == 65535) && i == 0) |
| | | { |
| | | //默认第一个 |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | currentModeID = 200; |
| | | currentKey.panelMode = currentModeID; |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public void AddCurtainMode() |
| | | private void AddCurtainMode() |
| | | { |
| | | Button oldMode = null; |
| | | for (int i = 0; i < 5; i++) |
| | |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | } |
| | | else if ((currentKey.panelMode == 65535) && i == 0) |
| | | { |
| | | //默认第一个 |
| | | btnChoose.IsSelected = true; |
| | | btnChoose.Visible = true; |
| | | oldMode = btnChoose; |
| | | currentModeID = 300; |
| | | currentKey.panelMode = currentModeID; |
| | | } |
| | | |
| | | EventHandler<MouseEventArgs> hander = (sender, e) => |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private void FinisfhEventHandler(object sender, MouseEventArgs e) |
| | | { |
| | | |
| | | } |
| | | |
| | | public void DeviceInfoChange(CommonDevice common, string typeTag) |
| | | { |
| | | } |
| | |
| | | frameBorder.Gravity = Gravity.CenterHorizontal;
|
| | | frameBorder.Width = Application.GetRealWidth(887);
|
| | | frameBorder.Height = Application.GetRealHeight(423);
|
| | | frameBorder.BorderWidth = (uint)Application.GetMinRealAverage(3);
|
| | | frameBorder.Radius = (uint)Application.GetRealHeight(6);
|
| | | frameBorder.BorderWidth = 1;
|
| | | frameBorder.BorderColor = 0xffd0d0d0;
|
| | | bodyFrameLayout.AddChidren(frameBorder);
|
| | |
|
| | |
| | | btnIcon.Name = "btn" + listDevice[i].DeviceEpoint;
|
| | | btnIcon.X = defultXX + i * (frame.Height + space);
|
| | | btnIcon.Radius = (uint)frame.Height / 2;
|
| | | btnIcon.BorderWidth = (uint)Application.GetMinRealAverage(6);
|
| | | btnIcon.BorderWidth = 2;
|
| | | btnIcon.BorderColor = 0xff979797;
|
| | | btnIcon.TextAlignment = TextAlignment.Center;
|
| | | btnIcon.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | |
| | | var frameBorder = new FrameLayout();
|
| | | frameBorder.Y = Application.GetRealHeight(147);
|
| | | frameBorder.Gravity = Gravity.CenterHorizontal;
|
| | | frameBorder.Width = Application.GetMinRealAverage(887);
|
| | | frameBorder.Height = Application.GetMinRealAverage(423);
|
| | | frameBorder.BorderWidth = 3;
|
| | | frameBorder.Width = Application.GetRealWidth(887);
|
| | | frameBorder.Height = Application.GetRealHeight(423);
|
| | | frameBorder.Radius = (uint)Application.GetRealHeight(6);
|
| | | frameBorder.BorderWidth = 1;
|
| | | frameBorder.BorderColor = 0xffd0d0d0;
|
| | | bodyFrameLayout.AddChidren(frameBorder);
|
| | |
|
| | |
| | | btnIcon.Name = "btn" + listDevice[i].DeviceEpoint;
|
| | | btnIcon.X = defultXX + i * (frame.Height + space);
|
| | | btnIcon.Radius = (uint)frame.Height / 2;
|
| | | btnIcon.BorderWidth = (uint)Application.GetMinRealAverage(6);
|
| | | btnIcon.BorderWidth = 2;
|
| | | btnIcon.BorderColor = 0xff979797;
|
| | | btnIcon.TextAlignment = TextAlignment.Center;
|
| | | btnIcon.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | |
| | | if (info.Result != 0)
|
| | | {
|
| | | //出现未知错误,请重新入网
|
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndReAccessNetwork));
|
| | | //HdlLogLogic.Current.WriteLog(-1, resultData);
|
| | | //this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uUnKnowErrorAndReAccessNetwork));
|
| | | HdlLogLogic.Current.WriteLog(-1, resultData);
|
| | | return 2;
|
| | | }
|
| | | this.topTimeOut = topMaxTime;
|
| | |
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirectionHelpForm();
|
| | | form.AddForm("Device");
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_deviceDiv">设备区分</param> |
| | | public void ShowForm(string i_deviceDiv) |
| | | public void ShowForm() |
| | | { |
| | | //设置头部信息 |
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSearchHelp)); |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(i_deviceDiv); |
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | /// <param name="deviceDiv">设备区分</param> |
| | | private void InitMiddleFrame(string i_deviceDiv) |
| | | private void InitMiddleFrame() |
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | if (i_deviceDiv == "Device")
|
| | | {
|
| | | //初始化设备帮助控件
|
| | | this.InitDeviceHelpControl();
|
| | | }
|
| | | else
|
| | | {
|
| | | //初始化网关帮助控件
|
| | | this.InitGatewayHelpControl();
|
| | | } |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | //设备添加指引
|
| | | var btnHelp1 = new NormalViewControl(942, 60, true);
|
| | | btnHelp1.IsBold = true;
|
| | | btnHelp1.TextID = R.MyInternationalizationString.uAddDeviceHelp1;
|
| | | btnHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp1.Y = Application.GetRealHeight(58);
|
| | |
| | | btnHelp5.TextSize = 12;
|
| | | btnHelp5.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp5);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化网关帮助控件
|
| | | /// </summary>
|
| | | private void InitGatewayHelpControl()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | frameBack.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(253);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xff3e99f4;
|
| | | seekBar1.Progress = energyModeInfo.level;
|
| | | seekBar1.ProgressBarColor = 0xff3e99f4;
|
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | energyModeInfo.level = value;
|
| | | };
|
| | | seekBar1.Progress = energyModeInfo.level;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | frameBack.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(147);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xfffdb500;
|
| | | seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
|
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | linghtLevelInfo.panelDirectionsLevel = value;
|
| | | };
|
| | | seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | btnColor.BackgroundColor = backColor;
|
| | | frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = backColor;
|
| | |
|
| | | var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
|
| | | btnRight.UnSelectedImagePath = "Item/Next.png";
|
| | | btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
|
| | |
| | | this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
|
| | |
|
| | | btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = btnColor.BackgroundColor;
|
| | | };
|
| | | };
|
| | | }
|
| | |
| | | frameBack.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(147);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xff2b62fd;
|
| | | seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | linghtLevelInfo.panelBacklightLevel = value;
|
| | | };
|
| | | seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | btnColor.BackgroundColor = backColor;
|
| | | frameColor.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = backColor;
|
| | |
|
| | | var btnRight = new NormalViewControl(Application.GetMinRealAverage(58), Application.GetMinRealAverage(58), false);
|
| | | btnRight.UnSelectedImagePath = "Item/Next.png";
|
| | | btnRight.X = frameColor.Width - Application.GetMinRealAverage(58);
|
| | |
| | | this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
|
| | |
|
| | | btnColor.BackgroundColor= this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = btnColor.BackgroundColor;
|
| | | };
|
| | | };
|
| | | }
|
| | |
| | | /// <param name="i_iasZone">传感器设备</param> |
| | | public void ShowForm(IASZone i_iasZone) |
| | | {
|
| | | UserView.HomePage.Instance.ScrollEnabled = false;
|
| | | deviceIASZone = i_iasZone;
|
| | |
|
| | | //设置头部信息
|
| | |
| | | var result = await this.GetDeviceAllDefultData();
|
| | | if (result == false)
|
| | | {
|
| | | //显示重新加载的界面
|
| | | this.ShowReLoadView();
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | btnLight.Y = Application.GetRealHeight(58);
|
| | | frameLight.AddChidren(btnLight);
|
| | | //进度条
|
| | | var seekBar = new HorizontalSeekBar();
|
| | | seekBar.X = Application.GetRealWidth(138);
|
| | | seekBar.Y = Application.GetRealHeight(152);
|
| | | seekBar.Width = Application.GetRealWidth(884);
|
| | | seekBar.Height = Application.GetRealHeight(84);
|
| | | seekBar.Max = lightLevelCount - 1;
|
| | | seekBar.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar.ProgressColor = 0xfffdb500;
|
| | | seekBar.Progress = lightLevelCount - Lightconfigure.levelSize;
|
| | | var seekBar = new SeekBarControl(900);
|
| | | seekBar.Gravity = Gravity.Frame;
|
| | | seekBar.X = Application.GetRealWidth(125);
|
| | | seekBar.Y = Application.GetRealHeight(142);
|
| | | seekBar.MaxValue = lightLevelCount - 1;
|
| | | seekBar.ProgressBarColor = 0xfffdb500;
|
| | | frameLight.AddChidren(seekBar);
|
| | | seekBar.ProgressChanged += (sender, value) =>
|
| | | seekBar.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | //因为它的等级刻度从左往右是从大到小的
|
| | | this.Lightconfigure.levelSize = lightLevelCount - value;
|
| | | };
|
| | | seekBar.Progress = lightLevelCount - Lightconfigure.levelSize;
|
| | |
|
| | | //低
|
| | | var btnDown = new NormalViewControl(300, 50, true);
|
| | |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 界面关闭
|
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | UserView.HomePage.Instance.ScrollEnabled = true;
|
| | | base.CloseFormBefore();
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | frameBack.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(253);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xff3e99f4;
|
| | | seekBar1.Progress = energyModeInfo.level;
|
| | | seekBar1.ProgressBarColor = 0xff3e99f4;
|
| | | frameBack.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | energyModeInfo.level = value;
|
| | | valueChanged = true;
|
| | | };
|
| | | seekBar1.Progress = energyModeInfo.level;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | frameLinght.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(124);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xfffdb500;
|
| | | seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
|
| | | seekBar1.ProgressBarColor = 0xfffdb500;
|
| | | frameLinght.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | linghtLevelInfo.panelDirectionsLevel = value;
|
| | | valueChanged = true;
|
| | | };
|
| | | seekBar1.Progress = linghtLevelInfo.panelDirectionsLevel;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | frameLinght.AddChidren(btnProgress1);
|
| | |
|
| | | //进度条
|
| | | var seekBar1 = new HorizontalSeekBar();
|
| | | var seekBar1 = new SeekBarControl();
|
| | | seekBar1.Y = Application.GetRealHeight(464);
|
| | | seekBar1.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar1.Width = Application.GetRealWidth(962);
|
| | | seekBar1.Height = Application.GetRealHeight(81);
|
| | | seekBar1.Max = 100;
|
| | | seekBar1.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar1.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar1.ProgressColor = 0xfffdb500;
|
| | | seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | | seekBar1.ProgressBarColor = 0xfffdb500;
|
| | | frameLinght.AddChidren(seekBar1);
|
| | | seekBar1.ProgressChanged += (sender, value) =>
|
| | | seekBar1.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnProgress1.Text = value + "%";
|
| | | //数据变更
|
| | | linghtLevelInfo.panelBacklightLevel = value;
|
| | | valueChanged = true;
|
| | | };
|
| | | seekBar1.Progress = linghtLevelInfo.panelBacklightLevel;
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 49, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.GatewayAdd
|
| | | {
|
| | | /// <summary>
|
| | | /// 添加网关的帮助界面
|
| | | /// </summary>
|
| | | public class AddGatewayHelpForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_div">区分</param>
|
| | | public void ShowForm(string i_div)
|
| | | {
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSearchHelp));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame(i_div);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame(string i_div)
|
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //网关添加指引
|
| | | var btnHelp1 = new NormalViewControl(942, 60, true);
|
| | | btnHelp1.IsBold = true;
|
| | | btnHelp1.TextID = R.MyInternationalizationString.uAddGatewayGuide;
|
| | | btnHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp1.Y = Application.GetRealHeight(58);
|
| | | bodyFrameLayout.AddChidren(btnHelp1);
|
| | |
|
| | | if (i_div == "Wired")
|
| | | {
|
| | | //初始化有线网关帮助控件
|
| | | this.InitWiredGatewayHelpControl();
|
| | | }
|
| | | else if (i_div == "Udp")
|
| | | {
|
| | | //初始化无线网关Udp模式帮助控件
|
| | | this.InitWirelessUdpGatewayHelpControl();
|
| | | }
|
| | | else if (i_div == "Ap")
|
| | | {
|
| | | //初始化无线网关Ap模式帮助控件
|
| | | this.InitWirelessApGatewayHelpControl();
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化有线网关帮助控件
|
| | | /// </summary>
|
| | | private void InitWiredGatewayHelpControl()
|
| | | {
|
| | | //1.请用网线连接网关网口到路由器,并观察网口LED亮并闪烁或观察外壳网口指示灯亮并闪烁
|
| | | var btnHelp1 = new NormalViewControl(942, 100, true);
|
| | | btnHelp1.TextID = R.MyInternationalizationString.uAddWiredGatewayHelp1;
|
| | | btnHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp1.Y = Application.GetRealHeight(164);
|
| | | btnHelp1.TextSize = 12;
|
| | | btnHelp1.IsMoreLines = true;
|
| | | btnHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp1);
|
| | | //2.网关重启大约需要1分钟,这时观察外壳系统指示灯,如果1秒闪烁,表示网关连接路由器正常,可以用APP进行添加网关步骤
|
| | | var btnHelp2 = new NormalViewControl(942, 150, true);
|
| | | btnHelp2.TextID = R.MyInternationalizationString.uAddWiredGatewayHelp2;
|
| | | btnHelp2.IsMoreLines = true;
|
| | | btnHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp2.Y = btnHelp1.Bottom + Application.GetRealHeight(35);
|
| | | btnHelp2.TextSize = 12;
|
| | | btnHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp2);
|
| | |
|
| | | //网关硬件问题帮助
|
| | | var btnHardHelp = new NormalViewControl(942, 60, true);
|
| | | btnHardHelp.IsBold = true;
|
| | | btnHardHelp.TextID = R.MyInternationalizationString.uGatewayHardDeviceHelp;
|
| | | btnHardHelp.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp.Y = btnHelp2.Bottom + Application.GetRealHeight(60);
|
| | | bodyFrameLayout.AddChidren(btnHardHelp);
|
| | |
|
| | | //1.网口指示灯不亮,检查网线或路由器是否正常
|
| | | var btnHardHelp1 = new NormalViewControl(942, 50, true);
|
| | | btnHardHelp1.TextID = R.MyInternationalizationString.uWiredGatewayHardDeviceHelp1;
|
| | | btnHardHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp1.Y = btnHardHelp.Bottom + Application.GetRealHeight(46);
|
| | | btnHardHelp1.TextSize = 12;
|
| | | btnHardHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp1);
|
| | |
|
| | | //2.系统启动之后(系统指示灯5秒闪烁,表示系统启动成功),系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP
|
| | | var btnHardHelp2 = new NormalViewControl(942, 150, true);
|
| | | btnHardHelp2.TextID = R.MyInternationalizationString.uWiredGatewayHardDeviceHelp2;
|
| | | btnHardHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp2.Y = btnHardHelp1.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp2.TextSize = 12;
|
| | | btnHardHelp2.IsMoreLines = true;
|
| | | btnHardHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp2);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化无线网关Udp模式帮助控件
|
| | | /// </summary>
|
| | | private void InitWirelessUdpGatewayHelpControl()
|
| | | {
|
| | | //系统启动之后(系统指示灯5秒闪烁,表示系统启动成功)
|
| | | var btnHelp1 = new NormalViewControl(942, 50, true);
|
| | | btnHelp1.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp1;
|
| | | btnHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp1.Y = Application.GetRealHeight(164);
|
| | | btnHelp1.TextSize = 12;
|
| | | btnHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp1);
|
| | | //1.请先长按网关HID/WCFG按键大概20秒,直到系统指示灯快闪,网关进入UDP模式WIFI配网
|
| | | var btnHelp2 = new NormalViewControl(942, 100, true);
|
| | | btnHelp2.TextID = R.MyInternationalizationString.uAddWirelessUdpGatewayHelp1;
|
| | | btnHelp2.IsMoreLines = true;
|
| | | btnHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp2.Y = btnHelp1.Bottom + Application.GetRealHeight(46);
|
| | | btnHelp2.TextSize = 12;
|
| | | btnHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp2);
|
| | | //2.根据APP提示进入之后的步骤
|
| | | var btnHelp3 = new NormalViewControl(942, 50, true);
|
| | | btnHelp3.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp2;
|
| | | btnHelp3.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp3.Y = btnHelp2.Bottom + Application.GetRealHeight(35);
|
| | | btnHelp3.TextSize = 12;
|
| | | btnHelp3.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp3);
|
| | |
|
| | | //网关硬件问题帮助
|
| | | var btnHardHelp = new NormalViewControl(942, 60, true);
|
| | | btnHardHelp.IsBold = true;
|
| | | btnHardHelp.TextID = R.MyInternationalizationString.uGatewayHardDeviceHelp;
|
| | | btnHardHelp.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp.Y = btnHelp3.Bottom + Application.GetRealHeight(60);
|
| | | bodyFrameLayout.AddChidren(btnHardHelp);
|
| | |
|
| | | //系统启动之后(系统指示灯5秒闪烁,表示系统启动成功)
|
| | | var btnHardHelp1 = new NormalViewControl(942, 50, true);
|
| | | btnHardHelp1.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp1;
|
| | | btnHardHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp1.Y = btnHardHelp.Bottom + Application.GetRealHeight(46);
|
| | | btnHardHelp1.TextSize = 12;
|
| | | btnHardHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp1);
|
| | |
|
| | | //1.短按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | var btnHardHelp2 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp2.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp1;
|
| | | btnHardHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp2.Y = btnHardHelp1.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp2.TextSize = 12;
|
| | | btnHardHelp2.IsMoreLines = true;
|
| | | btnHardHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp2);
|
| | |
|
| | | //2.长按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | var btnHardHelp3 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp3.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp2;
|
| | | btnHardHelp3.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp3.Y = btnHardHelp2.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp3.TextSize = 12;
|
| | | btnHardHelp3.IsMoreLines = true;
|
| | | btnHardHelp3.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp3);
|
| | |
|
| | | //3.系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP
|
| | | var btnHardHelp4 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp4.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp3;
|
| | | btnHardHelp4.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp4.Y = btnHardHelp3.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp4.TextSize = 12;
|
| | | btnHardHelp4.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnHardHelp4.IsMoreLines = true;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp4);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化无线网关Ap模式帮助控件
|
| | | /// </summary>
|
| | | private void InitWirelessApGatewayHelpControl()
|
| | | {
|
| | | //系统启动之后(系统指示灯5秒闪烁,表示系统启动成功)
|
| | | var btnHelp1 = new NormalViewControl(942, 50, true);
|
| | | btnHelp1.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp1;
|
| | | btnHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp1.Y = Application.GetRealHeight(164);
|
| | | btnHelp1.TextSize = 12;
|
| | | btnHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp1);
|
| | | //1.请先长按网关HID/WCFG按键大概5秒,直到系统指示灯常亮,网关进入AP模式WIFI配网
|
| | | var btnHelp2 = new NormalViewControl(942, 100, true);
|
| | | btnHelp2.TextID = R.MyInternationalizationString.uAddWirelessApGatewayHelp1;
|
| | | btnHelp2.IsMoreLines = true;
|
| | | btnHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp2.Y = btnHelp1.Bottom + Application.GetRealHeight(46);
|
| | | btnHelp2.TextSize = 12;
|
| | | btnHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp2);
|
| | | //2.根据APP提示进入之后的步骤
|
| | | var btnHelp3 = new NormalViewControl(942, 50, true);
|
| | | btnHelp3.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp2;
|
| | | btnHelp3.X = ControlCommonResourse.XXLeft;
|
| | | btnHelp3.Y = btnHelp2.Bottom + Application.GetRealHeight(35);
|
| | | btnHelp3.TextSize = 12;
|
| | | btnHelp3.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHelp3);
|
| | |
|
| | | //网关硬件问题帮助
|
| | | var btnHardHelp = new NormalViewControl(942, 60, true);
|
| | | btnHardHelp.IsBold = true;
|
| | | btnHardHelp.TextID = R.MyInternationalizationString.uGatewayHardDeviceHelp;
|
| | | btnHardHelp.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp.Y = btnHelp3.Bottom + Application.GetRealHeight(60);
|
| | | bodyFrameLayout.AddChidren(btnHardHelp);
|
| | |
|
| | | //系统启动之后(系统指示灯5秒闪烁,表示系统启动成功)
|
| | | var btnHardHelp1 = new NormalViewControl(942, 50, true);
|
| | | btnHardHelp1.TextID = R.MyInternationalizationString.uAddWirelessGatewayHelp1;
|
| | | btnHardHelp1.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp1.Y = btnHardHelp.Bottom + Application.GetRealHeight(46);
|
| | | btnHardHelp1.TextSize = 12;
|
| | | btnHardHelp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp1);
|
| | |
|
| | | //1.短按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | var btnHardHelp2 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp2.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp1;
|
| | | btnHardHelp2.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp2.Y = btnHardHelp1.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp2.TextSize = 12;
|
| | | btnHardHelp2.IsMoreLines = true;
|
| | | btnHardHelp2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp2);
|
| | |
|
| | | //2.长按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | var btnHardHelp3 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp3.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp2;
|
| | | btnHardHelp3.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp3.Y = btnHardHelp2.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp3.TextSize = 12;
|
| | | btnHardHelp3.IsMoreLines = true;
|
| | | btnHardHelp3.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp3);
|
| | |
|
| | | //3.系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP
|
| | | var btnHardHelp4 = new NormalViewControl(942, 100, true);
|
| | | btnHardHelp4.TextID = R.MyInternationalizationString.uWirelessGatewayHardDeviceHelp3;
|
| | | btnHardHelp4.X = ControlCommonResourse.XXLeft;
|
| | | btnHardHelp4.Y = btnHardHelp3.Bottom + Application.GetRealHeight(35);
|
| | | btnHardHelp4.TextSize = 12;
|
| | | btnHardHelp4.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnHardHelp4.IsMoreLines = true;
|
| | | bodyFrameLayout.AddChidren(btnHardHelp4);
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | row1.AddBottomLine();
|
| | | row1.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //检测住宅经纬度
|
| | | if (this.CheckResidencePoint() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var form = new WiredGatewayDirectionForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | row2.AddRightArrow();
|
| | | row2.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //检测住宅经纬度
|
| | | if (this.CheckResidencePoint() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var menuContr = new BottomMenuSelectForm();
|
| | | menuContr.AddForm(2);
|
| | | //UDP模式(推荐)
|
| | |
| | | });
|
| | | }; |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 检测住宅经纬度
|
| | | /// </summary>
|
| | | /// <returns></returns> |
| | | private bool CheckResidencePoint()
|
| | | {
|
| | | if (Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0)
|
| | | {
|
| | | //请前往住宅管理{0}设置住宅的地理位置
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGotoResidenceAndSetLocation).Replace("{0}", "\r\n");
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | var form = new Residence.ResidenceManagementForm();
|
| | | form.AddForm(false);
|
| | |
|
| | | }, Language.StringByID(R.MyInternationalizationString.uGotoSettion));
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | } |
| | | } |
| | | } |
| | |
| | | btnimage.UnSelectedImagePath = "Gateway/WiredGatewayInstruct.png"; |
| | | bodyFrameLayout.AddChidren(btnimage); |
| | | |
| | | //请确保网关与网线连接{0}系统灯每秒闪烁一次 |
| | | //请确保网关用网线正常连接路由器{0}正常连接则系统指示灯1秒闪烁 |
| | | string[] strMsg = Language.StringByID(R.MyInternationalizationString.ConfirmLineConnectMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); |
| | | var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | |
| | | btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uSearchHelp);
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("Gateway");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Wired");
|
| | | };
|
| | | bodyFrameLayout.AddChidren(btnHelp);
|
| | | //底线
|
| | |
| | | btnMsg1.Y = picGwImage.Bottom + Application.GetRealHeight(112);
|
| | | btnMsg1.TextID = R.MyInternationalizationString.uSearchGatewayFailMsg1;
|
| | | bodyFrameLayout.AddChidren(btnMsg1);
|
| | | //1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。
|
| | | //1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP
|
| | | var btnMsg2 = new NormalViewControl(930, 100, true);
|
| | | btnMsg2.X = Application.GetRealWidth(75);
|
| | | btnMsg2.Y = btnMsg1.Bottom + Application.GetRealHeight(35);
|
| | |
| | | btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnMsg2.IsMoreLines = true;
|
| | | bodyFrameLayout.AddChidren(btnMsg2);
|
| | | //2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。
|
| | | //2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启
|
| | | var btnMsg3 = new NormalViewControl(930, 100, true);
|
| | | btnMsg3.X = Application.GetRealWidth(75);
|
| | | btnMsg3.Y = btnMsg2.Bottom + Application.GetRealHeight(12);
|
| | |
| | | framePic.BackgroundImagePath = "Gateway/WirelessApDirection.png";
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | |
|
| | | //长按网关HID/WCFG按键5秒
|
| | | //系统灯常亮60秒后则进入配网状态
|
| | | //请先长按HID/WCFG按键大概5秒{0}直到系统指示灯常亮{0}网关进入AP模式热点
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int yy = framePic.Bottom + Application.GetRealHeight(291);
|
| | | foreach (var msg in ArryMsg)
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Ap");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | |
|
| | | //跳转到移动设备WLAN设置
|
| | | //选择hdlZigbeeGW-xxxx网络
|
| | | //手机去设置连接网关热点{0}即hdlZigbeeGW-xxxx,密码hdl123456{0}可查看网关背面标签查看热点名字和密码
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int yy = framePic.Bottom + Application.GetRealHeight(213);
|
| | | foreach (var msg in ArryMsg)
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Ap");
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Ap");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | framePic.BackgroundImagePath = "Gateway/WirelessApGatewaySearching.png";
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | |
|
| | | //请前往移动设备WLAN设置
|
| | | //重新连接家庭wiFi
|
| | | //手机去设置连接路由器
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg3).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int yy = framePic.Bottom + Application.GetRealHeight(369);
|
| | | foreach (var msg in ArryMsg)
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //系统灯每秒闪烁一次
|
| | | //则连接成功
|
| | | //网关如果正常连接路由器{0}系统指示灯会1秒闪烁
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg4).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int yy = Application.GetRealHeight(1066);
|
| | | foreach (var msg in ArryMsg)
|
| | |
| | | btnMsg1.Y = picGwImage.Bottom + Application.GetRealHeight(112);
|
| | | btnMsg1.TextID = R.MyInternationalizationString.uSearchGatewayFailMsg1;
|
| | | bodyFrameLayout.AddChidren(btnMsg1);
|
| | | //1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。
|
| | | //1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP
|
| | | var btnMsg2 = new NormalViewControl(930, 100, true);
|
| | | btnMsg2.X = Application.GetRealWidth(75);
|
| | | btnMsg2.Y = btnMsg1.Bottom + Application.GetRealHeight(35);
|
| | |
| | | btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnMsg2.IsMoreLines = true;
|
| | | bodyFrameLayout.AddChidren(btnMsg2);
|
| | | //2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。
|
| | | //2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启
|
| | | var btnMsg3 = new NormalViewControl(930, 100, true);
|
| | | btnMsg3.X = Application.GetRealWidth(75);
|
| | | btnMsg3.Y = btnMsg2.Bottom + Application.GetRealHeight(12);
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Ap");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png";
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | |
|
| | | //跳转到移动设备
|
| | | //请先去设置手机连接到路由器{0}然后长按网关HID/WCFG按键大概20秒{0}直到系统指示灯快闪{0}网关进入UDP模式WIFI配网
|
| | | string[] strMsg = Language.StringByID(R.MyInternationalizationString.uAddUdpWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int YY = framePic.Bottom + Application.GetRealHeight(128);
|
| | | for (int i = 0; i < strMsg.Length; i++)
|
| | | {
|
| | | var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | btnMsg1.Y = framePic.Bottom + Application.GetRealHeight(248);
|
| | | btnMsg1.TextID = R.MyInternationalizationString.uJumpToMobileDevice;
|
| | | btnMsg1.Y = YY;
|
| | | btnMsg1.Text = strMsg[i];
|
| | | btnMsg1.TextAlignment = TextAlignment.Center;
|
| | | btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnMsg1);
|
| | | //WLAN设置连接家庭WiFi
|
| | | var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | btnMsg2.Y = btnMsg1.Bottom;
|
| | | btnMsg2.TextID = R.MyInternationalizationString.uWlanConnectHomeWifi;
|
| | | btnMsg2.TextAlignment = TextAlignment.Center;
|
| | | btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | bodyFrameLayout.AddChidren(btnMsg2);
|
| | | YY = btnMsg1.Bottom;
|
| | | }
|
| | |
|
| | | //去设置
|
| | | var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
|
| | | btnSettion.Y = btnMsg2.Bottom + Application.GetRealHeight(12);
|
| | | btnSettion.Y = YY + Application.GetRealHeight(12);
|
| | | btnSettion.TextSize = 12;
|
| | | btnSettion.TextAlignment = TextAlignment.Center;
|
| | | btnSettion.TextColor = 0xff0075ff;
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Udp");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //长按网关HID/WCFG按键20秒
|
| | | //系统灯快闪60秒则进入配网状态
|
| | | //系统灯每秒闪烁一次
|
| | | //则连接成功
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddUdpWirelessGatewayMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | //网关如果正常连接路由器{0}系统指示灯会1秒闪烁
|
| | | string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddUdpWirelessGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | int yy = Application.GetRealHeight(1037);
|
| | | foreach (var msg in ArryMsg)
|
| | | {
|
| | |
| | | btnMsg1.Y = picGwImage.Bottom + Application.GetRealHeight(112);
|
| | | btnMsg1.TextID = R.MyInternationalizationString.uSearchGatewayFailMsg1;
|
| | | bodyFrameLayout.AddChidren(btnMsg1);
|
| | | //1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。
|
| | | //1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP
|
| | | var btnMsg2 = new NormalViewControl(930, 100, true);
|
| | | btnMsg2.X = Application.GetRealWidth(75);
|
| | | btnMsg2.Y = btnMsg1.Bottom + Application.GetRealHeight(35);
|
| | |
| | | btnMsg2.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnMsg2.IsMoreLines = true;
|
| | | bodyFrameLayout.AddChidren(btnMsg2);
|
| | | //2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。
|
| | | //2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启
|
| | | var btnMsg3 = new NormalViewControl(930, 100, true);
|
| | | btnMsg3.X = Application.GetRealWidth(75);
|
| | | btnMsg3.Y = btnMsg2.Bottom + Application.GetRealHeight(12);
|
| | |
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDirection.DeviceDirectionHelpForm();
|
| | | form.AddForm("WirelessUdp");
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Udp");
|
| | | };
|
| | |
|
| | | //下一步
|
| | |
| | | //进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //获取自动备份的数据
|
| | | var pageAuto = await HdlBackupLogic.Current.GetBackupListNameFromDB(3, HdlGatewayLogic.Current.GetGatewayId(realGateway));
|
| | | if (pageAuto == null)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | |
|
| | | //从云端获取数据
|
| | | var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(2, HdlGatewayLogic.Current.GetGatewayId(realGateway));
|
| | | if (pageData == null)
|
| | |
| | | {
|
| | | listView.RemoveAll();
|
| | | listView.RecoverHeight();
|
| | |
|
| | | //自动备份的ID
|
| | | string autoID = string.Empty;
|
| | | if (pageAuto.Count > 0)
|
| | | {
|
| | | autoID = pageAuto[0].Id;
|
| | | //添加自动备份行
|
| | | this.AddRowlayout(pageAuto[0], pageData.Count > 0, true);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < pageData.Count; i++)
|
| | | {
|
| | | //添加备份行
|
| | | this.AddRowlayout(pageData[i], i != pageData.Count - 1);
|
| | | this.AddRowlayout(pageData[i], i != pageData.Count - 1, false);
|
| | | }
|
| | |
|
| | | this.btnDownload?.RemoveFromParent();
|
| | | if (pageData.Count > 0)
|
| | | if (pageData.Count > 0 || pageAuto.Count > 0)
|
| | | {
|
| | | //下载
|
| | | this.btnDownload = new BottomClickButton();
|
| | |
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //读取备份文档
|
| | | bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId);
|
| | | bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId, autoID == this.nowSelectBackId ? 1 : 0);
|
| | | if (result == true)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | |
| | | //调整真实高度
|
| | | listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23));
|
| | | }
|
| | |
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | /// <param name="fileInfo"></param>
|
| | | /// <param name="addLine"></param>
|
| | | private void AddRowlayout(BackupListNameInfo fileInfo, bool addLine)
|
| | | /// <param name="isAuto"></param>
|
| | | private void AddRowlayout(BackupListNameInfo fileInfo, bool addLine, bool isAuto)
|
| | | {
|
| | | var rowLayout = new RowLayoutControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowLayout);
|
| | |
| | | txtText.TextSize = 15;
|
| | | txtText.Y = Application.GetRealHeight(12) + rowLayout.chidrenYaxis;
|
| | | rowLayout.frameTable.AddChidren(txtText, ChidrenBindMode.BindEventOnly);
|
| | | if (isAuto == true)
|
| | | {
|
| | | txtText.TextID = R.MyInternationalizationString.uAutoBackup;
|
| | | }
|
| | |
|
| | | //时间 2019-11-11T11:31:01
|
| | | var btnTime = rowLayout.frameTable.AddLeftCaption("", 600, 50, true);
|
| | | btnTime.Y = Application.GetRealHeight(72) + rowLayout.chidrenYaxis;
|
| | |
| | | }
|
| | | };
|
| | |
|
| | | //自动备份不允许编辑
|
| | | if (isAuto == false)
|
| | | {
|
| | | //编辑
|
| | | var btnEditor = rowLayout.AddEditorControl();
|
| | | btnEditor.ButtonClickEvent += (sender, e) =>
|
| | |
| | | //显示编辑备考名画面
|
| | | this.ShowEditorBackupForm(fileInfo);
|
| | | };
|
| | | }
|
| | |
|
| | | //删除
|
| | | var btnDelete = rowLayout.AddDeleteControl();
|
| | |
| | |
|
| | | this.AddRowControl("当前身份", 400, UserCenterResourse.UserInfo.AuthorityText, 400);
|
| | |
|
| | | this.AddRowControl("住宅ID", 400, Common.Config.Instance.Home.Id, 700);
|
| | |
|
| | | this.AddRowControl("账号GUID", 400, Common.Config.Instance.Home.MainUserDistributedMark, 700);
|
| | |
|
| | | this.AddRowControl("住宅分享", 400, Common.Config.Instance.Home.IsOthreShare == true ? "是" : "否", 400);
|
| | |
|
| | | this.AddRowControl("账号类型", 400, Common.Config.Instance.Home.AccountType.ToString(), 400);
|
| | |
| | |
|
| | | //开关
|
| | | var btnSwitch = row.AddMostRightSwitchIcon();
|
| | | if (this.memberInfo.IsAllowRemoteCtrl == true)
|
| | | {
|
| | | btnSwitch.IsSelected = true;
|
| | | }
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | var pra = new
|
| | | {
|
| | | HouseDistributedMark = Common.Config.Instance.Home.Id,
|
| | | DistributedMark = this.memberInfo.DistributedMark,
|
| | | IsAllowRemoteCtrl = !btnSwitch.IsSelected,
|
| | | IsOtherAccountCtrl = Common.Config.Instance.isAdministrator
|
| | | };
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/ChangeSubAccountIsAllowRemoteCtrl", true, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected;
|
| | | });
|
| | | });
|
| | | |
| | | };
|
| | | //底线
|
| | | row.AddBottomLine();
|
| | |
| | | {
|
| | | //解除绑定
|
| | | bindTipText = Language.StringByID(R.MyInternationalizationString.uUnBinded);
|
| | | bindNameText = dicBindData["Wechat"].Nickname;
|
| | | bindNameText = dicBindData["Wechat"].UserName;
|
| | | }
|
| | | var rowChat = new FrameRowControl(listView.rowSpace / 2);
|
| | | rowChat.Y = Application.GetRealHeight(11);
|
| | |
| | | btnChat.TextSize = 15;
|
| | | rowChat.AddChidren(btnChat, ChidrenBindMode.BindEventOnly);
|
| | | //未授权 OR 名字
|
| | | var btnTip1 = rowChat.AddLeftCaption(bindNameText, 400, 49);
|
| | | var btnTip1 = rowChat.AddLeftCaption(bindNameText == null ? string.Empty : bindNameText, 400, 50);
|
| | | btnTip1.Y = Application.GetRealHeight(72) + rowChat.chidrenYaxis;
|
| | | btnTip1.TextSize = 12;
|
| | | btnTip1.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | this.dicBindData[info.Platform] = info;
|
| | | }
|
| | |
|
| | | //获取用户昵称
|
| | | if (this.dicBindData.ContainsKey("Wechat") == true)
|
| | | {
|
| | | var myData = this.dicBindData["Wechat"];
|
| | | //给个默认值
|
| | | myData.Nickname = "Wechat";
|
| | | var strUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + myData.AccessToken;
|
| | | strUrl += "&openid=" + myData.OpenID;
|
| | | var byteData = await Common.CommonPage.Instance.DoRequestZigbeeHttpsInterface(strUrl, null, null, "GET");
|
| | | if (byteData != null)
|
| | | {
|
| | | var receipData = System.Text.Encoding.UTF8.GetString(byteData);
|
| | | var nickData = Newtonsoft.Json.JsonConvert.DeserializeObject<NicknameInfo>(receipData);
|
| | | myData.Nickname = nickData.nickname;
|
| | | }
|
| | | }
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | |
| | | /// <param name="infoData"></param>
|
| | | private async void BindWechat(string accessToken, string refreshToken, string openID)
|
| | | {
|
| | | var pra = new { AccessToken = accessToken, RefreshToken = refreshToken, OpenID = openID };
|
| | | //获取微信昵称
|
| | | var strUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken;
|
| | | strUrl += "&openid=" + openID;
|
| | | var byteData = await Common.CommonPage.Instance.DoRequestZigbeeHttpsInterface(strUrl, null, null, "GET");
|
| | | if (byteData == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var receipData = System.Text.Encoding.UTF8.GetString(byteData);
|
| | | var nickData = Newtonsoft.Json.JsonConvert.DeserializeObject<NicknameInfo>(receipData);
|
| | |
|
| | | //先上传微信资料
|
| | | var pra = new { AccessToken = accessToken, RefreshToken = refreshToken, OpenID = openID, UserName = nickData.nickname };
|
| | | var listNotShow = new List<string>() { "UserNoBindAccount" };
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/InsertOrUpdateAuthUser", false, pra, listNotShow);
|
| | | if (result == false)
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | //再执行绑定
|
| | | var pra2 = new { AccountGuid = Common.Config.Instance.Guid, OpenID = openID };
|
| | | result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/BindAuthUserToAccount", false, pra2);
|
| | | if (result == true)
|
| | |
| | | /// </summary>
|
| | | public string Platform = string.Empty;
|
| | | /// <summary>
|
| | | /// 昵称(需要自己去获取)
|
| | | /// </summary>
|
| | | public string Nickname = string.Empty;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 昵称信息
|
| | | /// </summary>
|
| | | private class NicknameInfo
|
| | | {
|
| | | /// <summary>
|
| | | /// 昵称
|
| | | /// </summary>
|
| | | public string nickname = string.Empty;
|
| | | public string UserName = string.Empty;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway();
|
| | | foreach (var gateway in listGateway)
|
| | | {
|
| | | ZigBee.Device.ZbGateway realWay = null;
|
| | | if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, gateway) == false)
|
| | | {
|
| | | //错误:网关对象丢失
|
| | | continue;
|
| | | }
|
| | | var result = HdlGatewayLogic.Current.SetGatewaySite(gateway, longitude, latitude);
|
| | | if (result == false)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //进度条
|
| | | var seekBar = new HorizontalSeekBar();
|
| | | seekBar.Enable = false;
|
| | | var seekBar = new SeekBarControl(919);
|
| | | seekBar.Y = Application.GetRealHeight(268);
|
| | | seekBar.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar.Width = Application.GetRealWidth(919);
|
| | | seekBar.Height = Application.GetRealHeight(89);
|
| | | seekBar.Max = 100;
|
| | | seekBar.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar.ProgressColor = 0xfffdb500;
|
| | | seekBar.ProgressBarColor = 0xfffdb500;
|
| | | seekBar.Enable = false;
|
| | | if (dicTaskinfo.ContainsKey(5) == true)
|
| | | {
|
| | | //5:百分比调节
|
| | | seekBar.Progress = dicTaskinfo[5].Data2;
|
| | | }
|
| | | detailBackFrame.AddChidren(seekBar);
|
| | | seekBar.ProgressChanged += (sender, value) =>
|
| | | seekBar.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnPersent.Text = value + "%";
|
| | | };
|
| | |
| | | btnOpenSelect.Visible = false;
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | seekBar.Enable = false;
|
| | | seekBar.ProgressColor = 0xffe8e8e8;
|
| | |
|
| | | dicTaskinfo.Remove(0);
|
| | | }
|
| | |
| | | //开 可用
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextColor1;
|
| | | seekBar.Enable = true;
|
| | | seekBar.ProgressColor = 0xfffdb500;
|
| | | if (seekBar.Progress == 0)
|
| | | {
|
| | | seekBar.Progress = 100;
|
| | |
| | | //开 不可用
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | seekBar.Enable = false;
|
| | | seekBar.ProgressColor = 0xffe8e8e8;
|
| | |
|
| | | //移除打开
|
| | | dicTaskinfo.Remove(0);
|
| | |
| | | }
|
| | |
|
| | | //进度条
|
| | | var seekBar = new HorizontalSeekBar();
|
| | | seekBar.Enable = false;
|
| | | var seekBar = new SeekBarControl(919);
|
| | | seekBar.Y = Application.GetRealHeight(268);
|
| | | seekBar.Gravity = Gravity.CenterHorizontal;
|
| | | seekBar.Width = Application.GetRealWidth(919);
|
| | | seekBar.Height = Application.GetRealHeight(89);
|
| | | seekBar.Max = 100;
|
| | | seekBar.BackgroundColor = 0xfff5f5f5;
|
| | | seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
|
| | | seekBar.ProgressColor = 0xfffdb500;
|
| | | seekBar.ProgressBarColor = 0xfffdb500;
|
| | | seekBar.Enable = false;
|
| | | if (dicTaskinfo.ContainsKey(3) == true)
|
| | | {
|
| | | //3:亮度调节
|
| | | seekBar.Progress = dicTaskinfo[3].Data1;
|
| | | }
|
| | | detailBackFrame.AddChidren(seekBar);
|
| | | seekBar.ProgressChanged += (sender, value) =>
|
| | | seekBar.ProgressChangedEvent += (div, value) =>
|
| | | {
|
| | | btnPersent.Text = value + "%";
|
| | | };
|
| | |
| | | btnOpenSelect.Visible = false;
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | seekBar.Enable = false;
|
| | | seekBar.ProgressColor = 0xffe8e8e8;
|
| | |
|
| | | dicTaskinfo.Remove(1);
|
| | | }
|
| | |
| | | //开 可用
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextColor1;
|
| | | seekBar.Enable = true;
|
| | | seekBar.ProgressColor = 0xfffdb500;
|
| | | if (seekBar.Progress == 0)
|
| | | {
|
| | | seekBar.Progress = 100;
|
| | |
| | | //开 不可用
|
| | | btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | seekBar.Enable = false;
|
| | | seekBar.ProgressColor = 0xffe8e8e8;
|
| | |
|
| | | dicTaskinfo[1] = new Safeguard.TaskListInfo();
|
| | | dicTaskinfo[1].TaskType = 1;
|
| | |
| | | //添加向右图标
|
| | | rowOther.AddRightArrow();
|
| | | //微信、QQ
|
| | | var btnQQ = rowOther.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uWebChatAndQQ), 500);
|
| | | //var btnQQ = rowOther.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uWebChatAndQQ), 500);
|
| | | var btnQQ = rowOther.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uWebChat), 500);
|
| | | btnQQ.IsBold = true;
|
| | | rowOther.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Floor.png" |
| | | }; |
| | | if (Config.Instance.Home.FloorDics.Count > 0) |
| | | { |
| | | topFrameLayout.AddChidren(floor); |
| | | } |
| | | |
| | | floorBtn = new Button |
| | | { |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextColor, |
| | | Text = Config.Instance.Home.GetCurrentFloorName |
| | | }; |
| | | |
| | | if(Config.Instance.Home.FloorDics.Count>0) |
| | | { |
| | | topFrameLayout.AddChidren(floor); |
| | | topFrameLayout.AddChidren(floorBtn); |
| | | } |
| | | |
| | | |
| | | var messageBtn = new Button() |
| | | { |
| | |
| | | }; |
| | | AddChidren(roomPageView); |
| | | //与屏幕边框的边距 |
| | | roomPageView.TCBJ = Application.GetRealWidth(181); |
| | | roomPageView.TCBJ = Application.GetRealWidth(112); |
| | | //两个page之间的间距 |
| | | roomPageView.JMBJ = Application.GetRealWidth(69); |
| | | |
| | |
| | | { |
| | | Y = noFunction.Bottom, |
| | | Height = Application.GetRealHeight(200), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction).Replace("{\\r\\n}", "\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoFunction_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | IsMoreLines = true |
| | | }; |
| | |
| | | { |
| | | Y = noScene.Bottom, |
| | | Height = Application.GetRealHeight(200), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene).Replace("{\\r\\n}", "\r\n"), |
| | | Text = Language.StringByID(R.MyInternationalizationString.NoScene_Tip).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | IsMoreLines = true |
| | | }; |
| | |
| | | /// <summary> |
| | | /// 底部按钮文字的Y值 |
| | | /// </summary> |
| | | private static readonly int tabBarEnumName_Y = 104; |
| | | private static readonly int tabBarEnumName_Y = 98; |
| | | #endregion |
| | | |
| | | #region ◆ 接口____________________________ |
| | |
| | | { |
| | | return await System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | var result = new AddedDeviceBindResponseAllData(); |
| | | AddedDeviceBindResponseAllData result = null; |
| | | var mainGateway = ZbGateway.MainGateWay; |
| | | if (mainGateway == null) |
| | | { |
| | | result.errorMessageBase = "当前没有主网关"; |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = "当前没有主网关" }; |
| | | return result; |
| | | } |
| | | Action<string, string> action = (topic, message) => |
| | |
| | | var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["BindList"].ToString()); |
| | | if (tempBindList == null) |
| | | { |
| | | result.errorMessageBase = "网关返回的数据为空"; |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | if (dataBindRes != null) |
| | | { |
| | | result.addedDeviceBindResponseData = dataBindRes; |
| | | result = new AddedDeviceBindResponseAllData { addedDeviceBindResponseData = dataBindRes }; |
| | | DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | } |
| | | } |
| | | else if (topic == gatewayID + "/" + "Bind/BindResult") |
| | | { |
| | | var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindResultResponseData>(jobject["Data"].ToString()); |
| | | //else if (topic == gatewayID + "/" + "Bind/BindResult") |
| | | //{ |
| | | // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; |
| | | // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddBindResultResponseData>(jobject["Data"].ToString()); |
| | | |
| | | if (tempData != null) |
| | | { |
| | | result.addBindResultResponseData = tempData; |
| | | } |
| | | DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | } |
| | | // if (tempData != null) |
| | | // { |
| | | // result = new AddedDeviceBindResponseAllData { addBindResultResponseData = tempData }; |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{topic}"); |
| | | //} |
| | | }; |
| | | mainGateway.Actions += action; |
| | | DebugPrintLog("Bind/SetBind_Actions 启动" + "_" + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond); |
| | |
| | | { "BindList", bindList } |
| | | }; |
| | | jObject.Add("Data", data); |
| | | //ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID; |
| | | mainGateway.Send("Bind/SetBind", jObject.ToString()); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < 20 * 1000) |
| | | { |
| | | await System.Threading.Tasks.Task.Delay(100); |
| | | if (result == null || result.addedDeviceBindResponseData == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) |
| | | { |
| | | if (result.addBindResultResponseData != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count) |
| | | { |
| | | if (result.addBindResultResponseData != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) |
| | | { |
| | | if (result.addBindResultResponseData != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | await System.Threading.Tasks.Task.Delay(10); |
| | | if (result != null) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) |
| | | { |
| | | result.errorMessageBase = " 回复超时,请重新操作"; |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | | //while ((DateTime.Now - dateTime).TotalMilliseconds < 20*1000) |
| | | //{ |
| | | //await System.Threading.Tasks.Task.Delay(100); |
| | | //if (result == null || result.addedDeviceBindResponseData == null) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | //if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 1).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 2).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else if (0 < result.addedDeviceBindResponseData.BindList.FindAll((obj) => obj.BindType == 0 && obj.Result == 3).Count) |
| | | //{ |
| | | // if (result.addBindResultResponseData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // break; |
| | | //} |
| | | //} |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > 20 * 1000) |
| | | { |
| | | result = new AddedDeviceBindResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | | mainGateway.Actions -= action; |
| | | System.Console.WriteLine($"Bind/SetBind_Actions 退出 { System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond}"); |
| | |
| | | /// <summary> |
| | | ///绑定列表 ,当Status=0时存在 |
| | | /// </summary> |
| | | public List<AddBindListResponseObj> BindList = new List<AddBindListResponseObj>(); |
| | | public List<BindListResponseObj> BindList = new List<BindListResponseObj>(); |
| | | /// <summary> |
| | | /// 0:绑定所有目标成功 |
| | | ///<para>1:绑定目标失败,绑定设备目标有漏掉</para> |
| | | /// </summary> |
| | | public int Result; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | catch { } |
| | | |
| | | var dateTime = DateTime.Now; |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < 25 * 1000) |
| | | { |
| | | await System.Threading.Tasks.Task.Delay(10); |
| | | if (d != null) |
| | |
| | | break; |
| | | } |
| | | } |
| | | //一键清除目标,会因为目标数量多而加长时间,目前暂定10秒 |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > 10 * 1000) |
| | | //一键清除目标,会因为目标数量多而加长时间,目前暂定20秒 |
| | | if ((DateTime.Now - dateTime).TotalMilliseconds > 25 * 1000) |
| | | { |
| | | d = new ClearBindInfoResponseAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 按键模式(私有功能) |
| | | /// </summary> |
| | | public int panelMode = -1; |
| | | public int panelMode = 65535; |
| | | /// <summary> |
| | | ///按键开状态(指示)亮度 |
| | | /// </summary> |
| | |
| | | ///配置面板功能 |
| | | ///<para>value:给面板配置的模式</para> |
| | | /// </summary> |
| | | public async System.Threading.Tasks.Task<SetWritableValueResponAllData> ConfigureHdlKeyValueAsync(KeyMode value) |
| | | public async System.Threading.Tasks.Task<SetWritableValueResponAllData> ConfigureHdlKeyValueAsync(KeyMode value, int clusterID = 6) |
| | | { |
| | | if (Gateway == null) |
| | | { |
| | |
| | | System.Console.WriteLine("SetWritableValue_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | try |
| | | { |
| | | var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 6 }, { "Command", 120 } }; |
| | | var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", clusterID }, { "Command", 120 } }; |
| | | var data = new JObject { { "Undivided", 0 }, { "AttributeId", 6533 }, { "AttributeDataType", 33 }, { "AttributeData", (int)value } }; |
| | | jObject.Add("Data", data);
|
| | | Gateway.Send("SetWritableValue", jObject.ToString()); |
| | |
| | | public static bool IsRemote; |
| | | |
| | | /// <summary> |
| | | /// 是否拥有远程连接的权限
|
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public static bool AllowRemoteCtrl = true; |
| | | |
| | | /// <summary> |
| | | /// 网关保存路径 |
| | | /// </summary> |
| | | /// <value>The file path.</value> |
| | |
| | | /// <returns></returns> |
| | | static async System.Threading.Tasks.Task initGateWayBaseInfomation() |
| | | {
|
| | | if (AllowRemoteCtrl == false)
|
| | | {
|
| | | //没有远程连接的权限
|
| | | return;
|
| | | }
|
| | | string loginToken = Config.Instance.Token;
|
| | | if (Config.Instance.Home.IsOthreShare == true)
|
| | | {
|
| | |
| | | var statuCode = jobject["StateCode"].ToString();
|
| | | if (statuCode != "Success")
|
| | | {
|
| | | //Log出力
|
| | | Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(-1, "接口访问失败★:App/GetSingleHomeGatewayPagger " + statuCode);
|
| | | //序列化对象
|
| | | var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra2);
|
| | | Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(-1, "参数:\r\n" + requestJson);
|
| | | //Log出力
|
| | | string errorMsg = "接口访问失败★:App/GetSingleHomeGatewayPagger " + statuCode + "\r\n";
|
| | | errorMsg += "参数:\r\n" + requestJson;
|
| | | Shared.Phone.UserCenter.HdlLogLogic.Current.WriteLog(-1, errorMsg);
|
| | | return;
|
| | | }
|
| | |
|
| | | var responseData = jobject["ResponseData"];
|
| | |
| | | /// <param name="brokerName">Broker name.</param> |
| | | public static async System.Threading.Tasks.Task StartRemoteMqtt() |
| | | {
|
| | | if (remoteMqttIsConnecting
|
| | | //追加:没有远程连接的权限
|
| | | if (AllowRemoteCtrl == false
|
| | | || remoteMqttIsConnecting
|
| | | || !Shared.Common.Config.Instance.IsLogin
|
| | | || Shared.Common.Config.Instance.HomeId == ""
|
| | | || remoteIsConnected)
|
| | |
| | | if (result != null) |
| | | { |
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(Encoding.UTF8.GetString(result)); |
| | | if (jobject["StateCode"].ToString() == "NotAllowRemoteCtrl")
|
| | | {
|
| | | //没有远程连接的权限
|
| | | AllowRemoteCtrl = false;
|
| | | return;
|
| | | } |
| | | var responseData = jobject["ResponseData"]; |
| | | if (responseData != null) |
| | | { |
| | |
| | | public readonly static int DoorlockPasswordDispear = 220; |
| | | public readonly static int BindUnknownError = 221; |
| | | public readonly static int OffLineScene = 222; |
| | | public readonly static int SureClearKeyModeAndTargets = 223; |
| | | public readonly static int BindDeviceTargetIsEmpty = 224; |
| | | |
| | | public readonly static int RemindSetting = 548; |
| | | public readonly static int AddNewUser = 650; |
| | |
| | | public readonly static int linkageevent = 5366; |
| | | public readonly static int current = 5367; |
| | | public readonly static int selecfoolr = 5368; |
| | | |
| | | public readonly static int delaytip = 5369; |
| | | public readonly static int usertip = 5370; |
| | | public readonly static int scenetip = 5371; |
| | | public readonly static int securitytip = 5372; |
| | | |
| | | #region 登录注册 |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public const int TheSceneIsDelaying = 13149; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 选择摆风 |
| | | /// </summary> |
| | |
| | | /// 请清洁滤网 |
| | | /// </summary> |
| | | public const int NeedCleanAC = 13511; |
| | | |
| | | /// <summary> |
| | | /// 没功能 请先添加 |
| | | /// </summary> |
| | | public const int NoFunction_Tip = 13600; |
| | | /// <summary> |
| | | /// 没场景 请先添加 |
| | | /// </summary> |
| | | public const int NoScene_Tip = 13601; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public const int uPleaseWait = 15052; |
| | | /// <summary> |
| | | /// 请确保网关与网线连接{0}系统灯每秒闪烁一次 |
| | | /// 请确保网关用网线正常连接路由器{0}正常连接则系统指示灯1秒闪烁 |
| | | /// </summary> |
| | | public const int ConfirmLineConnectMsg = 15053; |
| | | /// <summary> |
| | |
| | | /// </summary>
|
| | | public const int uSearchGatewayFailMsg1 = 15779;
|
| | | /// <summary>
|
| | | /// 1.长按ZB/RST键20秒,网关恢复出厂设置,指示灯全部熄灭后,重新入网。
|
| | | /// 1.短按HID/WCFG按键,系统指示灯快闪3秒,网关进入换绑模式,强制网关绑定到当前APP
|
| | | /// </summary>
|
| | | public const int uSearchGatewayFailMsg2 = 15780;
|
| | | /// <summary>
|
| | | /// 2.点按HID/WCFG键,进入网关换绑模式,系统指示灯快闪5秒。
|
| | | /// 2.长按网关ZB/RST按键20秒以上,直到所有指示灯同时灭,即恢复出厂设置并重启
|
| | | /// </summary>
|
| | | public const int uSearchGatewayFailMsg3 = 15781;
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | public const int uWlanConnectHomeWifi = 15906;
|
| | | /// <summary>
|
| | | /// 长按网关HID/WCFG按键20秒{0}系统灯快闪60秒则进入配网状态{0}系统灯每秒闪烁一次{0}则连接成功
|
| | | /// 网关如果正常连接路由器{0}系统指示灯会1秒闪烁
|
| | | /// </summary>
|
| | | public const int uAddUdpWirelessGatewayMsg = 15907;
|
| | | public const int uAddUdpWirelessGatewayMsg1 = 15907;
|
| | | /// <summary>
|
| | | /// 长按网关HID/WCFG按键5秒{0}系统灯常亮60秒后则进入配网状态
|
| | | /// 请先长按HID/WCFG按键大概5秒{0}直到系统指示灯常亮{0}网关进入AP模式热点
|
| | | /// </summary>
|
| | | public const int uAddApWirelessGatewayMsg1 = 15908;
|
| | | /// <summary>
|
| | | /// 跳转到移动设备WLAN设置{0}选择hdlZigbeeGW-xxxx网络
|
| | | /// 手机去设置连接网关热点{0}即hdlZigbeeGW-xxxx,密码hdl123456{0}可查看网关背面标签查看热点名字和密码
|
| | | /// </summary>
|
| | | public const int uAddApWirelessGatewayMsg2 = 15909;
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | public const int uPleaseInputHomeWifiAccount = 15910;
|
| | | /// <summary>
|
| | | /// 请前往移动设备WLAN设置{0}重新连接家庭wiFi
|
| | | /// 手机去设置连接路由器
|
| | | /// </summary>
|
| | | public const int uAddApWirelessGatewayMsg3 = 15911;
|
| | | /// <summary>
|
| | | /// 系统灯每秒闪烁一次{0}则连接成功
|
| | | /// 网关如果正常连接路由器{0}系统指示灯会1秒闪烁
|
| | | /// </summary>
|
| | | public const int uAddApWirelessGatewayMsg4 = 15912;
|
| | | /// <summary>
|
| | |
| | | /// 正在获取分享数据
|
| | | /// </summary>
|
| | | public const int uShardContentGetting = 15983;
|
| | | /// <summary>
|
| | | /// 请先去设置手机连接到路由器{0}然后长按网关HID/WCFG按键大概20秒{0}直到系统指示灯快闪{0}网关进入UDP模式WIFI配网
|
| | | /// </summary>
|
| | | public const int uAddUdpWirelessGatewayMsg2 = 15984;
|
| | | /// <summary>
|
| | | /// 网关添加指引
|
| | | /// </summary>
|
| | | public const int uAddGatewayGuide = 15985;
|
| | | /// <summary>
|
| | | /// 1.请用网线连接网关网口到路由器,并观察网口LED亮并闪烁或观察外壳网口指示灯亮并闪烁
|
| | | /// </summary>
|
| | | public const int uAddWiredGatewayHelp1 = 15986;
|
| | | /// <summary>
|
| | | /// 2.网关重启大约需要1分钟,这时观察外壳系统指示灯,如果1秒闪烁,表示网关连接路由器正常,可以用APP进行添加网关步骤
|
| | | /// </summary>
|
| | | public const int uAddWiredGatewayHelp2 = 15987;
|
| | | /// <summary>
|
| | | /// 网关硬件问题帮助
|
| | | /// </summary>
|
| | | public const int uGatewayHardDeviceHelp = 15988;
|
| | | /// <summary>
|
| | | /// 1.网口指示灯不亮,检查网线或路由器是否正常
|
| | | /// </summary>
|
| | | public const int uWiredGatewayHardDeviceHelp1 = 15989;
|
| | | /// <summary>
|
| | | /// 2.系统启动之后(系统指示灯5秒闪烁,表示系统启动成功),系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP
|
| | | /// </summary>
|
| | | public const int uWiredGatewayHardDeviceHelp2 = 15990;
|
| | | /// <summary>
|
| | | /// 系统启动之后(系统指示灯5秒闪烁,表示系统启动成功)
|
| | | /// </summary>
|
| | | public const int uAddWirelessGatewayHelp1 = 15991;
|
| | | /// <summary>
|
| | | /// 2.根据APP提示进入之后的步骤
|
| | | /// </summary>
|
| | | public const int uAddWirelessGatewayHelp2 = 15992;
|
| | | /// <summary>
|
| | | /// 1.请先长按网关HID/WCFG按键大概20秒,直到系统指示灯快闪,网关进入UDP模式WIFI配网
|
| | | /// </summary>
|
| | | public const int uAddWirelessUdpGatewayHelp1 = 15993;
|
| | | /// <summary>
|
| | | /// 1.请先长按网关HID/WCFG按键大概5秒,直到系统指示灯常亮,网关进入AP模式WIFI配网
|
| | | /// </summary>
|
| | | public const int uAddWirelessApGatewayHelp1 = 15994;
|
| | | /// <summary>
|
| | | /// 1.短按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | /// </summary>
|
| | | public const int uWirelessGatewayHardDeviceHelp1 = 15995;
|
| | | /// <summary>
|
| | | /// 2.长按HID/WCFG按键,查看指示灯是否有变化,可判断按键和指示灯是否损坏
|
| | | /// </summary>
|
| | | public const int uWirelessGatewayHardDeviceHelp2 = 15996;
|
| | | /// <summary>
|
| | | /// 3.系统指示灯不是1秒闪烁,检查路由器是否开启DHCP自动分配IP
|
| | | /// </summary>
|
| | | public const int uWirelessGatewayHardDeviceHelp3 = 15997;
|
| | | /// <summary>
|
| | | /// 请前往住宅管理{0}设置住宅的地理位置
|
| | | /// </summary>
|
| | | public const int uGotoResidenceAndSetLocation = 15998;
|
| | | /// <summary>
|
| | | /// 未知楼层
|
| | | /// </summary>
|
| | | public const int uUnKnownFloor = 15999;
|
| | |
|
| | |
|
| | | //★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | /// <summary>
|
| | |
| | | /// </summary> |
| | | public const int uDeviceModelId1301 = 30005;
|
| | | /// <summary>
|
| | | /// 镜像ID为4100的设备的默认名字:Zigbee微断云控制器
|
| | | /// 镜像ID为4100的设备的默认名字:智能空开
|
| | | /// </summary> |
| | | public const int uDeviceModelId4100 = 30006; |
| | | /// <summary>
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\InformationEditorControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\RoomDeviceGroupMenuControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SceneFunctionSwitchControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\SeekBarControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\CompoundControls\VerificationCodeControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ListViewLayoutControls\VerticalFrameRefreshControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Controls\ListViewLayoutControls\VerticalListRefreshControl.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UnLockMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserDoorLockPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UserManagement.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\AddGatewayHelpForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\WirelessApDirection1Form.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\WirelessApDirection2Form.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Gateway\Add\WirelessApDirection3Form.cs" />
|