Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
 private void ViperNode_NewMacAddress(MacAddress mac)
 {
     this.MacAddress = mac;
 }
Exemplo n.º 3
0
 protected void OnNewMacAddress(MacAddress value)
 {
     if (this.NewMacAddress != null)
     {
         Task.Factory.StartNew(new Action(() => 
             this.NewMacAddress(value)
         ));
     }
 }