| | |
| | | frameBack.AddChidren(btnProgressView);
|
| | |
|
| | | int progressValue = (int)(curtainData.OpenLimitValue / (curtainData.CurtainLength * 1.0) * 100);
|
| | | //设置百分比的初始值
|
| | | curtainData.OpenLimitPersent = progressValue;
|
| | | var btnProgress1 = new NormalViewControl(200, 50, true);
|
| | | btnProgress1.X = Application.GetRealWidth(200);
|
| | | btnProgress1.Y = btnProgressView.Y;
|
| | |
| | | frameBack.AddChidren(btnProgressView);
|
| | |
|
| | | int progressValue = (int)(curtainData.CloseLimitValue / (curtainData.CurtainLength * 1.0) * 100);
|
| | | //设置百分比的初始值
|
| | | curtainData.CloseLimitPersent = progressValue;
|
| | | var btnProgress1 = new NormalViewControl(200, 50, true);
|
| | | btnProgress1.X = Application.GetRealWidth(200);
|
| | | btnProgress1.Y = btnProgressView.Y;
|
| | |
| | | this.receiveCloseLimit = false;
|
| | | this.sendDiv = 0;
|
| | |
|
| | | bool receiptData = false;
|
| | | int receiptDataCount = 0;
|
| | | string mainkeys = LocalDevice.Current.GetDeviceMainKeys(curtainDevice);
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("CurtainDeviceAttribute", ReceiveComandDiv.A设备属性上报, (device) =>
|
| | | {
|
| | |
| | | //正向
|
| | | curtainData.Direction = false;
|
| | | }
|
| | | receiptDataCount++;
|
| | | }
|
| | | else if (attriBute.AttributeId == 1)
|
| | | {
|
| | | //窗帘总长
|
| | | curtainData.CurtainLength = attriBute.AttriButeData;
|
| | | receiptDataCount++;
|
| | | }
|
| | | else if (attriBute.AttributeId == 16)
|
| | | {
|
| | | //开限位
|
| | | curtainData.OpenLimitValue = attriBute.AttriButeData;
|
| | | receiptDataCount++;
|
| | | }
|
| | | else if (attriBute.AttributeId == 17)
|
| | | {
|
| | | //合限位
|
| | | curtainData.CloseLimitValue = attriBute.AttriButeData;
|
| | | //数据接收结束
|
| | | receiptData = true;
|
| | | receiptDataCount++;
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | HdlDeviceCurtainLogic.Current.SetGetCurtainLimitSettionComand(curtainDevice);
|
| | |
|
| | | int timeCount = 30;
|
| | | while (receiptData == false && timeCount >= 0)
|
| | | while (receiptDataCount != 4 && timeCount >= 0)
|
| | | {
|
| | | System.Threading.Thread.Sleep(100);
|
| | | timeCount--;
|