コード例 #1
0
ファイル: NodeViewModel.cs プロジェクト: Osceus/Cobra
        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();
        }
コード例 #2
0
ファイル: NodeViewModel.cs プロジェクト: Osceus/Cobra
 private void ViperNode_NewMacAddress(MacAddress mac)
 {
     this.MacAddress = mac;
 }
コード例 #3
0
ファイル: SerialInterface.cs プロジェクト: Osceus/Cobra
 protected void OnNewMacAddress(MacAddress value)
 {
     if (this.NewMacAddress != null)
     {
         Task.Factory.StartNew(new Action(() => 
             this.NewMacAddress(value)
         ));
     }
 }