| | |
| | | { |
| | | if (data.Dio == DIOType.DI) |
| | | { |
| | | return new LightBall |
| | | if (data.ControlType == ControlType.BOOL) |
| | | { |
| | | Size = 40, |
| | | DataContext = data |
| | | }; |
| | | return new LightBall |
| | | { |
| | | Size = 40, |
| | | DataContext = data |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new TextBox |
| | | { |
| | | IsReadOnly = true |
| | | }; |
| | | } |
| | | } |
| | | Style btnStyle = this.FindResource("PrimaryButton") as Style; |
| | | var btn = new Button |
| | |
| | | case ControlType.LREAL: |
| | | case ControlType.STRING: |
| | | case ControlType.WSTRING: |
| | | ((Button)ui).Content = value; |
| | | ((TextBox)ui).Text = value; |
| | | break; |
| | | default: |
| | | ((TextBox)ui).Text = value; |
| | | break; |
| | | } |
| | | }); |
| | |
| | | value = null; |
| | | return false; |
| | | } |
| | | string msg; |
| | | switch (data.ControlType) |
| | | { |
| | | case ControlType.BOOL: |
| | |
| | | bool res = false; |
| | | if (data.Dio == DIOType.DI) |
| | | { |
| | | res = controller.ReadDIBool(data.Address, out val, out string msg); |
| | | res = controller.ReadDIBool(data.Address, out val, out msg); |
| | | } |
| | | else |
| | | { |
| | | res = controller.ReadDOBool(data.Address, out val, out string msg); |
| | | res = controller.ReadDOBool(data.Address, out val, out msg); |
| | | } |
| | | if (res == true) |
| | | { |
| | |
| | | value = null; |
| | | return false; |
| | | default: |
| | | if (controller.ReadDIDouble(data.Address, out double? dVal, out msg)) |
| | | { |
| | | value = dVal.ToString(); |
| | | } |
| | | value = null; |
| | | return true; |
| | | } |