Beispiel #1
0
 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);
 }
Beispiel #2
0
 private void ViperNode_NewSingleNodeStatus(NodeStatus status)
 {
     this.Status = status;
 }
Beispiel #3
0
 protected virtual void handleNodeStatusReporting(byte[] statusArray)
 {
     if (statusArray.Length > 0)
     {
         NodeStatus stat = new NodeStatus(statusArray[0]);
         OnNewSingleNodeStatus(stat);
     }
     else
     {
     }
 }
Beispiel #4
0
        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();
        }
Beispiel #5
0
 protected void OnNewSingleNodeStatus(NodeStatus value)
 {
     if (this.NewSingleNodeStatus != null)
     {
         Task.Factory.StartNew(new Action(() => 
             this.NewSingleNodeStatus(value)
              ));
     }
 }