| | |
| | | { |
| | | #region 窗帘更新 |
| | | var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); |
| | | //if (onoffString == "stop") |
| | | //{ |
| | | // return; |
| | | //} |
| | | var percentAttr = updataFunction.GetAttribute(FunctionAttributeKey.Percent); |
| | | if(percentAttr != null) |
| | | { |
| | | onoffString = percentAttr.curValue.ToString() == "0" ? "off" : "on"; |
| | | } |
| | | |
| | | if (onoffString == "stop") |
| | | { |
| | | return; |
| | | } |
| | | var percent = onoffString == "off" ? 0 : 100; |
| | | if (updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) |
| | | { |
| | |
| | | switch (tempStatus.state) |
| | | {//0空,1走,2跑,3坐,4跌倒,5站 |
| | | case "0": |
| | | btnStatus.TextID = StringId.SensorNormalState; |
| | | btnStatus.TextID = StringId.wuren; |
| | | btnStatus.TextColor = CSS_Color.MainColor; |
| | | break; |
| | | case "1": |
| | |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 3 : {ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | else if (SPK.ArmSensorSpkList().Contains(updataFunction.spk)) |
| | | { |
| | | if (cTag == updataFunction.sid + "_Sensor_Status") |
| | | { |
| | | Button btnStatus = (fcView.GetChildren(j) as Button); |
| | | |
| | | var alarm_status = updataFunction.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); |
| | | if (alarm_status != null) |
| | | { |
| | | if (alarm_status.curValue.ToString() == "normal") |
| | | { |
| | | btnStatus.TextID = StringId.SensorNormalState; |
| | | btnStatus.TextColor = CSS_Color.MainColor; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.InAlarm; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | alarm_status = updataFunction.attributes.Find((sta) => sta.key == "contact_status"); |
| | | if (alarm_status != null) |
| | | { |
| | | if (alarm_status.curValue.ToString() == "close") |
| | | { |
| | | btnStatus.TextID = StringId.Shut; |
| | | btnStatus.TextColor = CSS_Color.MainColor; |
| | | } |
| | | else |
| | | { |
| | | if (updataFunction.spk == SPK.SensorDryContact || updataFunction.spk == SPK.SensorDryContact2) |
| | | { |
| | | btnStatus.TextID = StringId.DryBreak; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.Open; |
| | | } |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | alarm_status = updataFunction.attributes.Find((sta) => sta.key == "people_status"); |
| | | if (alarm_status != null) |
| | | { |
| | | if (alarm_status.curValue.ToString() == "false") |
| | | { |
| | | btnStatus.TextID = StringId.wuren; |
| | | btnStatus.TextColor = CSS_Color.MainColor; |
| | | } |
| | | else |
| | | { |
| | | btnStatus.TextID = StringId.youren; |
| | | btnStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (scrolView.GetChildren(i).GetType() == typeof(FunctionControlZone)) { |
| | | var fcView = scrolView.GetChildren(i) as FunctionControlZone; |
| | | fcView.UpdataOnline(updataFunction.online); |
| | | fcView.UpdataOnline(updataFunction.isOnline()); |
| | | } |
| | | } |
| | | } |