protected override void handleNodeStatusReporting(byte[] statusArray) { List<NodeStatus> statuses = new List<NodeStatus>(statusArray.Length); foreach (byte statusByte in statusArray) { NodeStatus status = new NodeStatus(statusByte); statuses.Add(status); } OnNewStatuses(statuses); }
private void ViperNode_NewSingleNodeStatus(NodeStatus status) { this.Status = status; }
protected virtual void handleNodeStatusReporting(byte[] statusArray) { if (statusArray.Length > 0) { NodeStatus stat = new NodeStatus(statusArray[0]); OnNewSingleNodeStatus(stat); } else { } }
public NodeViewModel(SerialInterface node) { this.ViperNode = node; this.User = new CalibrationUtilityUser(); this.m_softwareRevision = new SoftwareRevision(0, 0); this.m_nodeNumber = NODE_NUMBER_MIN; this.m_partNumber = PART_NUMBER_DEFAULT; this.m_voltage = 0; this.m_commandNibble = new CommandNibble(0); this.m_serialNumber = SERIAL_NUMBER_DEFAULT; this.m_packNumber = PACK_NUMBER_MIN; this.m_macAddress = new MacAddress(new byte[0]); this.m_filterValue = FILTER_VALUE_MIN; this.m_communicationChannel = COMMUNICATION_CHANNEL_MIN; this.m_cellOffset = CELL_OFFSET_DEFAULT; this.m_cellGain = CELL_GAIN_DEFAULT; this.m_cellCalibrated = 0; this.m_masterScaler = MASTER_SCALER_MIN; this.m_status = new NodeStatus(0); try { setupViperNode(); } catch (Exception ex) { if (this.ViperNode != null) { this.ViperNode.Dispose(); } throw ex; } setDefaultParamValues(); configureValidationRules(); startUpdateThread(); }
protected void OnNewSingleNodeStatus(NodeStatus value) { if (this.NewSingleNodeStatus != null) { Task.Factory.StartNew(new Action(() => this.NewSingleNodeStatus(value) )); } }