| | |
| | | //导轨长度为0时
|
| | | if (curtainData.CurtainLength <= 0)
|
| | | {
|
| | | //电机数据异常,请重置电机
|
| | | //电机数据异常,确认已经安装导轨后,请重置电机
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uCurtainDataIsErrorPleaseResetCurtain));
|
| | | try
|
| | | {
|
| | |
| | | catch (Exception ex)
|
| | | {
|
| | | //Log出力
|
| | | string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
|
| | | string msg = "当前激活的界面[" + HdlFormLogic.Current.NowActionFormID + "]";
|
| | | HdlLogLogic.Current.WriteLog(ex, msg);
|
| | | //电机数据异常,请重置电机
|
| | | //电机数据异常,确认已经安装导轨后,请重置电机
|
| | | this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uCurtainDataIsErrorPleaseResetCurtain));
|
| | | try
|
| | | {
|
| | |
| | | listText.Add(Language.StringByID(R.MyInternationalizationString.uReverseDirection));//反向
|
| | |
|
| | | var form = new BottomItemSelectForm();
|
| | | form.AddForm(Language.StringByID(R.MyInternationalizationString.uDirectionSelect), listText, nowSelectNo);
|
| | | form.AddForm(Language.StringByID(R.MyInternationalizationString.uDirectionSelect), listText, null, nowSelectNo);
|
| | | form.FinishSelectEvent += (index) =>
|
| | | {
|
| | | //变更方向
|
| | |
| | | curtainData.Direction = index == 0 ? false : true;
|
| | | };
|
| | | };
|
| | | //如果当前是展示模板,则不能编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | rowDirection.CanClick = false;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | {
|
| | | //开限位
|
| | | var btnProgressView = new NormalViewControl(200, 50, true);
|
| | | btnProgressView.X = ControlCommonResourse.XXLeft;
|
| | | btnProgressView.X = HdlControlResourse.XXLeft;
|
| | | btnProgressView.Y = Application.GetRealHeight(78);
|
| | | btnProgressView.TextSize = 12;
|
| | | btnProgressView.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | frameBack.AddChidren(openSeekBar);
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 50, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | | btnTemp1.X = HdlControlResourse.XXLeft;
|
| | | btnTemp1.Y = btnProgressView.Bottom + Application.GetRealHeight(115);
|
| | | btnTemp1.TextSize = 12;
|
| | | btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | |
| | | btnTemp2.Text = "100%";
|
| | | frameBack.AddChidren(btnTemp2);
|
| | | //线
|
| | | var btnLine = new NormalViewControl(frameBack.Width - ControlCommonResourse.XXLeft * 2, ControlCommonResourse.BottomLineHeight, false);
|
| | | btnLine.X = ControlCommonResourse.XXLeft;
|
| | | var btnLine = new NormalViewControl(frameBack.Width - HdlControlResourse.XXLeft * 2, HdlControlResourse.BottomLineHeight, false);
|
| | | btnLine.X = HdlControlResourse.XXLeft;
|
| | | btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(156);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | frameBack.AddChidren(btnLine);
|
| | |
| | | //数据变更,百分比
|
| | | curtainData.OpenLimitPersent = value;
|
| | | };
|
| | | //如果当前是展示模板,则不能编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | openSeekBar.Enable = false;
|
| | | btnMinus.CanClick = false;
|
| | | btnPlus.CanClick = false;
|
| | | btnSave.CanClick = false;
|
| | | }
|
| | |
|
| | | //虚拟住宅不需要监听
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | |
| | | {
|
| | | //合限位
|
| | | var btnProgressView = new NormalViewControl(200, 50, true);
|
| | | btnProgressView.X = ControlCommonResourse.XXLeft;
|
| | | btnProgressView.X = HdlControlResourse.XXLeft;
|
| | | btnProgressView.Y = Application.GetRealHeight(536);
|
| | | btnProgressView.TextSize = 12;
|
| | | btnProgressView.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | frameBack.AddChidren(closeSeekBar);
|
| | |
|
| | | var btnTemp1 = new NormalViewControl(200, 50, true);
|
| | | btnTemp1.X = ControlCommonResourse.XXLeft;
|
| | | btnTemp1.X = HdlControlResourse.XXLeft;
|
| | | btnTemp1.Y = btnProgressView.Bottom + Application.GetRealHeight(115);
|
| | | btnTemp1.TextSize = 12;
|
| | | btnTemp1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | |
| | | btnTemp2.Text = "100%";
|
| | | frameBack.AddChidren(btnTemp2);
|
| | | //线
|
| | | var btnLine = new NormalViewControl(frameBack.Width - ControlCommonResourse.XXLeft * 2, ControlCommonResourse.BottomLineHeight, false);
|
| | | btnLine.X = ControlCommonResourse.XXLeft;
|
| | | var btnLine = new NormalViewControl(frameBack.Width - HdlControlResourse.XXLeft * 2, HdlControlResourse.BottomLineHeight, false);
|
| | | btnLine.X = HdlControlResourse.XXLeft;
|
| | | btnLine.Y = btnTemp2.Bottom + Application.GetRealHeight(156);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
|
| | | frameBack.AddChidren(btnLine);
|
| | |
| | | //数据变更,百分比
|
| | | curtainData.CloseLimitPersent = value;
|
| | | };
|
| | | //如果当前是展示模板,则不能编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | closeSeekBar.Enable = false;
|
| | | btnMinus.CanClick = false;
|
| | | btnPlus.CanClick = false;
|
| | | btnSave.CanClick = false;
|
| | | }
|
| | | //虚拟住宅不需要监听
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | |
| | | //如果当前是虚拟住宅
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | var data = ModelData.DeviceModelDataLogic.Current.GetCurtainLimitPoint(curtainDevice);
|
| | | var data = HdlTemplateDeviceDataLogic.Current.GetCurtainLimitPoint(curtainDevice);
|
| | | curtainData.Direction = data.Direction;
|
| | | curtainData.CurtainLength = data.curtainLength;
|
| | | curtainData.OpenLimitValue = data.upLimit;
|
| | |
| | | this.ShowProgressBar();
|
| | |
|
| | | int receiptDataCount = 0;
|
| | | string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
|
| | | string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(curtainDevice);
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("CurtainDeviceAttribute", ReceiveComandDiv.A设备属性上报, (device) =>
|
| | | {
|
| | | string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | string checkKey = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
|
| | | if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
|
| | | {
|
| | | return;
|
| | |
| | | //获取窗帘方向与限位设置失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetCurtainDirectionAndLimitSettionFail);
|
| | | //拼接上【网关回复超时】的Msg
|
| | | msg = UserCenterLogic.CombineGatewayTimeOutMsg(msg, null, "回复超时");
|
| | | msg = HdlCommonLogic.Current.CombineGatewayTimeOutMsg(msg, null, "回复超时");
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | return false;
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void ReceiveLimitData()
|
| | | {
|
| | | //如果当前是展示模板,则需要处理
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (HdlGatewayReceiveLogic.Current.IsEsixt("ReceiveLimitData") == true)
|
| | | {
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("ReceiveLimitData");
|
| | | }
|
| | | string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
|
| | | string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(curtainDevice);
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("ReceiveLimitData", ReceiveComandDiv.A设备属性上报, (device) =>
|
| | | {
|
| | | string checkKey = LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | string checkKey = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
|
| | | if (mainkeys != checkKey || device.DeviceStatusReport.CluterID != 258)
|
| | | {
|
| | | return;
|