| | |
| | | } |
| | | set |
| | | { |
| | | //if (_GatewayOnline_Local != value) |
| | | if (_GatewayOnline_Local != value) |
| | | { |
| | | _GatewayOnline_Local = value; |
| | | if (value) |
| | |
| | | } |
| | | set |
| | | { |
| | | //if (_GatewayOnline_Cloud != value) |
| | | if (_GatewayOnline_Cloud != value) |
| | | { |
| | | _GatewayOnline_Cloud = value; |
| | | if(GatewayOnline_Local) |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string RoomTemp = "room_temp"; |
| | | /// <summary> |
| | | /// 室内湿度 |
| | | /// </summary> |
| | | public const string RoomHumidity = "room_humidity"; |
| | | /// <summary> |
| | | /// value |
| | | /// </summary> |
| | | public const string Value = "value"; |
| | |
| | | var acPage = new AcControlPage(); |
| | | acPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.HvacCac: |
| | | var cacPage = new CacControlPage(); |
| | | cacPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.IrLearn: |
| | | var irLearinPage = new IrLearnPage(); |
| | | irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | //new FunctionAttributes(){ key = "",curValue = "",state = "" }, |
| | | } |
| | | }); |
| | | FunctionList.List.Functions.Add(new Function |
| | | { |
| | | name = "测试温控器", |
| | | spk = SPK.HvacCac, |
| | | attributes = new List<FunctionAttributes> |
| | | { |
| | | new FunctionAttributes(){ key = "on_off",curValue = "on",state = "on" }, |
| | | new FunctionAttributes(){ key = "cac_valve",curValue = "on",state = "on" },//毛细阀 |
| | | new FunctionAttributes(){ key = "fh_valve",curValue = "on",state = "on" },//地暖阀 |
| | | new FunctionAttributes(){ key = "mode",curValue = "cool",state = "cool", value = new List<string>{ "cool","heat","fan"} }, |
| | | new FunctionAttributes(){ key = "set_temp",curValue = "20",state = "20",min = 16,max = 30 }, |
| | | new FunctionAttributes(){ key = "room_temp",curValue = "20",state = "20" }, |
| | | new FunctionAttributes(){ key = "dew_point_temp",curValue = "20",state = "20" },//露点温度 |
| | | new FunctionAttributes(){ key = "surface_temp",curValue = "20",state = "20" },//表面温度 |
| | | new FunctionAttributes(){ key = "energy_saving",curValue = "true",state = "true" },//节能 |
| | | new FunctionAttributes(){ key = "room_humidity",curValue = "66",state = "66" }, |
| | | //new FunctionAttributes(){ key = "",curValue = "",state = "" }, |
| | | } |
| | | }); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function |
| | | //{ |
| | |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | else if (function.spk == SPK.HvacCac) |
| | | { |
| | | var btnHumidityIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(51), |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetRealWidth(17), |
| | | Height = Application.GetRealWidth(17), |
| | | UnSelectedImagePath = "Public/DeviceInfoIcon/HumidityIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnHumidityIcon); |
| | | var btnHumidityValues = new TextButton() |
| | | { |
| | | X = btnHumidityIcon.Right + Application.GetRealWidth(4), |
| | | Y = Application.GetRealHeight(66), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomHumidity) + "%", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnHumidityValues); |
| | | |
| | | Button btnTempIcon = new Button() |
| | | { |
| | | X = btnHumidityValues.Right + Application.GetRealWidth(20), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(17), |
| | | Height = Application.GetMinRealAverage(17), |
| | | UnSelectedImagePath = "Public/DeviceInfoIcon/TempIcon.png", |
| | | }; |
| | | bodyDiv.AddChidren(btnTempIcon); |
| | | |
| | | var btnTempValues = new TextButton() |
| | | { |
| | | X = btnTempIcon.Right + Application.GetRealWidth(4), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = function.GetAttrState(FunctionAttributeKey.RoomTemp) + "°", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | btnTempValues.Width = btnTempValues.GetTextWidth(); |
| | | bodyDiv.AddChidren(btnTempIcon); |
| | | |
| | | var btnJinMaoIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(238), |
| | | Y = Application.GetRealHeight(64), |
| | | Width = Application.GetRealWidth(102), |
| | | Height = Application.GetRealHeight(29), |
| | | UnSelectedImagePath = "FunctionIcon/CAC/JinMaoIcon.png" |
| | | }; |
| | | bodyDiv.AddChidren(btnJinMaoIcon); |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (function.spk == SPK.ClothesHanger)//晾衣架 |
| | |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | //获取温度值 |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | var setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp); |
| | | var setTempString = setTempTemp.Replace(",", "."); |
| | | var setTempDouble = Convert.ToDouble(setTempString); |
| | | temp = Convert.ToInt32(setTempDouble); |
| | | if (temp <= 0) |
| | | { |
| | | //默认值改成16,2022年06月10日10:03:19 成甫要求的 |
| | |
| | | { |
| | | btnCurtainClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | if (!function.online) |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnCurtainClose.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | function.trait_on_off.curValue = "off"; |
| | | function.SetAttrState(FunctionAttributeKey.Percent, 0); |
| | |
| | | |
| | | btnCurtainStop.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | onCurtainAnimation = false; |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | onCurtainAnimation = false; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | |
| | | btnCurtainOpen.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | new System.Threading.Thread(() => |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | //if (function.online) |
| | | if (function.online) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | onCurtainAnimation = false; |
| | | new System.Threading.Thread(() => |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | CurtainAnimation(100); |
| | | }; |
| | | |
| | | if (!function.online) |
| | | if (function.online) |
| | | { |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | | { |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => { |
| | | System.Threading.Thread.Sleep(2000); |
| | |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | // DriverLayer.Control.Ins.SendWriteCommand(function, d); |
| | | //}; |
| | | |
| | | if (!function.online) |
| | | if (function.online) |
| | | { |
| | | |
| | | btnCurtainStop.MouseDownEventHandler = (sender, e) => |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | if (!function.online) |
| | | if (function.online) |
| | | { |
| | | barGradualChange.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | |
| | | {
|
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
|
| | | {
|
| | | //if (!function.online)
|
| | | //{
|
| | | // new Tip()
|
| | | // {
|
| | | // CloseTime = 1,
|
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
|
| | | // Direction = AMPopTipDirection.None,
|
| | | // }.Show(MainPage.BaseView);
|
| | | // return;
|
| | | //}
|
| | | //onDimmerBar = false;
|
| | | curDimmerStatus = false;
|
| | | if (!function.online)
|
| | | {
|
| | | new Tip()
|
| | | {
|
| | | CloseTime = 1,
|
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
|
| | | Direction = AMPopTipDirection.None,
|
| | | }.Show(MainPage.BaseView);
|
| | | return;
|
| | | } |
| | | //onDimmerBar = false; |
| | | curDimmerStatus = false;
|
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress);
|
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
|
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString());
|
| | |
| | | |
| | | dimmerBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | //if (!function.online) |
| | | //{ |
| | | // new Tip() |
| | | // { |
| | | // CloseTime = 1, |
| | | // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | // Direction = AMPopTipDirection.None, |
| | | // }.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | if (!function.online) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.DeviceOfflineCannotOption), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | curDimmerStatus = false; |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |