public ConfigureAntenna( LakeChabotReader reader ) { if ( null == reader ) { throw new ArgumentNullException( "reader", "Null reader passed to ConfigureAntenna CTOR()" ); } if ( reader.Mode != rfidReader.OperationMode.BoundToReader ) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureAntenna()" ); } InitializeComponent( ); //applyAtStartupCheckBox.Checked = !String.IsNullOrEmpty( RFID_Explorer.Properties.Settings.Default.antennaSettings ); this.reader = reader; this.timer = new Timer( ); this.timer.Interval = 5000; this.timer.Tick += new EventHandler( timer_Tick ); //clark not sure. Wait firmware support this function. #if (LBT) //RfPowerThreshold Clark 2011.2.10 Cpoied from R1000 Tracer UInt32 oem_Data = 0; reader.MacReadOemData ( (ushort)enumOEM_ADDR.ENUM_OEM_ADDR_RF_REVPWR_THRESHOLD,//0x000000AE, ref oem_Data ); numericUpDownRfPowerThreshold.Value = oem_Data; #endif }
public RFChannelEditForm( LakeChabotReader reader, Source_FrequencyBand channel ) { this.reader = reader; this.channelMaster = channel; this.channelActive = new Source_FrequencyBand( channel ); InitializeComponent( ); channelSlotNumber.Text = String.Format( "RF Channel Slot {0}", this.channelActive.Band ); foreach (Source_FrequencyBand.BandState item in Enum.GetValues(typeof(Source_FrequencyBand.BandState))) { this.state.Items.Add(item); } this.state.Items.Remove(Source_FrequencyBand.BandState.UNKNOWN); state.SelectedIndex = channelActive.State == Source_FrequencyBand.BandState.DISABLED ? 0 : 1; state.SelectedValueChanged += state_SelectedValueChanged; this.multiplyRatio.DataBindings.Add( "Value", this.channelActive, "MultiplyRatio" ); this.divideRatio.DataBindings.Add( "Value", this.channelActive, "DivideRatio" ); this.minimumDAC.DataBindings.Add( "Value", this.channelActive, "MinimumDACBand" ); this.affinityBand.DataBindings.Add( "Value", this.channelActive, "AffinityBand" ); this.maximumDAC.DataBindings.Add( "Value", this.channelActive, "MaximumDACBand" ); this.guardBand.DataBindings.Add( "Value", this.channelActive, "GuardBand" ); }
public ConfigureForm(LakeChabotReader reader) { _reader = reader; InitializeComponent(); //Clark 2011.7.25. Clear Memory data. Avoid many invenory or //other to full in memory and can't catch corrent packet. LakeChabotReader.MANAGED_ACCESS.API_RadioEnterConfigMenu(); this.Text = String.Format("{0} Module Configuration", AssemblyTitle); _generalControl = new ConfigureSettingsControl(Reader); _generalControl.Visible = true; _generalControl.Name = "_generalControl"; configureToolStripContainer.ContentPanel.Controls.Add(_generalControl); _antennaControl = new ConfigureAntenna(Reader); _antennaControl.Visible = false; _antennaControl.Name = "_antennaControl"; configureToolStripContainer.ContentPanel.Controls.Add(_antennaControl); _selectCriteriaControl = new ConfigureSelect_Display( Reader ); _selectCriteriaControl.Visible = false; _selectCriteriaControl.Name = "_selectCriteriaControl"; configureToolStripContainer.ContentPanel.Controls.Add(_selectCriteriaControl); _algorithmControl = new ConfigureAlgorithm_Display(Reader); _algorithmControl.Visible = false; _algorithmControl.Name = "_algorithmControl"; configureToolStripContainer.ContentPanel.Controls.Add(_algorithmControl); _postSingulationControl = new ConfigurePostSingulation_Display(Reader); _postSingulationControl.Visible = false; _postSingulationControl.Name = "_postSingulationControl"; configureToolStripContainer.ContentPanel.Controls.Add(_postSingulationControl); _gpioControl = new ConfigureGPIO(Reader); _gpioControl.Visible = false; _gpioControl.Name = "_gpioControl"; configureToolStripContainer.ContentPanel.Controls.Add(_gpioControl); _rfControl = new ConfigureRFBandForm(Reader); _rfControl.Visible = false; _rfControl.Name = "_rfControl"; configureToolStripContainer.ContentPanel.Controls.Add(_rfControl); _aboutReaderControl = new AboutReaderControl(Reader); _aboutReaderControl.Visible = false; _aboutReaderControl.Name = "_aboutReaderControl"; configureToolStripContainer.ContentPanel.Controls.Add(_aboutReaderControl); _troubleshootControl = new ConfigureTroubleControl(Reader); _troubleshootControl.Visible = false; _troubleshootControl.Name = "_troubleshootControl"; configureToolStripContainer.ContentPanel.Controls.Add(_troubleshootControl); //Clark 2011.2.10 Cpoied from R1000 Tracer. RFBandsToolStripButton.Visible = false; }
public ConfigureSelect_Edit( LakeChabotReader reader, SelectCriteria criteria ) { InitializeComponent( ); configureSelect_Display.setReader( reader ); configureSelect_Display.setSource( criteria ); configureSelect_Display.Mode = ConfigureSelect_Display.EDIT_MODE; // edit on }
public ConfigurePostSingulation_Edit( LakeChabotReader reader, SingulationCriteria criteria ) { InitializeComponent( ); configurePostSingulation_Display.setReader( reader ); configurePostSingulation_Display.setSource( criteria ); configurePostSingulation_Display.Mode = ConfigurePostSingulation_Display.EDIT_MODE; // edit on }
public ConfigureAlgorithm_Edit( LakeChabotReader reader, Source_QueryParms parms ) { InitializeComponent( ); // The algorithmDisplay is the obj that needs the zero arg constructor // so it works via the gui builder in VS... and so needs secondary // calls to set the reader and parms... algorithmDisplay.setReader( reader ); algorithmDisplay.setSource( parms ); algorithmDisplay.MasterEnabled = true; // edit on algorithmDisplay.displayData( ); }
public AntennaSenseThresholdEdit( LakeChabotReader reader, uint activeThresholdValue ) { this.reader = reader; this.activeThresholdValue = activeThresholdValue; InitializeComponent( ); activeThreshold.Text = activeThresholdValue.ToString( ); activeThreshold.Enabled = false; newThreshold.Minimum = 0; newThreshold.Maximum = 0x000FFFFF; newThreshold.Value = activeThresholdValue; }
public AboutReaderControl( LakeChabotReader reader ) { if ( null == reader ) { throw new ArgumentNullException( "reader", "Null reader passed to ConfigureGeneral CTOR()" ); } if (reader.Mode != rfidReader.OperationMode.BoundToReader) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureGeneral()" ); } InitializeComponent( ); this.reader = reader; }
public AntennaEditForm( LakeChabotReader reader, Source_Antenna antenna ) { this.reader = reader; this.antennaMaster = antenna; this.antennaActive = new Source_Antenna( antenna ); InitializeComponent( ); //Logic Port antennaNumberLabel.Text = String.Format( "Antenna {0}", antennaActive.Port ); //Status foreach (rfid.Constants.AntennaPortState item in Enum.GetValues( typeof( rfid.Constants.AntennaPortState ) )) { state.Items.Add(item); } state.Items.Remove(rfid.Constants.AntennaPortState.UNKNOWN); state.SelectedIndex = antennaActive.State == rfid.Constants.AntennaPortState.DISABLED ? 0 : 1; state.SelectedValueChanged += state_SelectedValueChanged; //clark. Set the limit of port number Aotomatically PhysicalPort.Minimum = Source_Antenna.PHY_MINIMUM; PhysicalPort.Maximum = Source_Antenna.PHY_MAXIMUM; PhysicalPort.DataBindings.Add( "Value", this.antennaActive, "PhysicalPort" ); dwellTime.Minimum = 0; dwellTime.Maximum = 1000000; dwellTime.DataBindings.Add( "Value", this.antennaActive, "DwellTime" ); inventoryCycles.Minimum = 0; inventoryCycles.Maximum = 1000000; inventoryCycles.DataBindings.Add( "Value", this.antennaActive, "NumberInventoryCycles" ); //Clark 2011.2.21 Cpoied from R1000 Tracer powerLevel.Minimum = Source_Antenna.POWER_MINIMUM; powerLevel.Maximum = Source_Antenna.POWER_MAXIMUM; powerLevel.DataBindings.Add( "Value", this.antennaActive, "PowerLevel" ); }
public ConfigureGPIO( LakeChabotReader reader ) { if ( null == reader ) { throw new ArgumentNullException( "reader", "Null reader passed to ConfigureGeneral CTOR()" ); } if ( reader.Mode != rfidReader.OperationMode.BoundToReader ) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureGeneral()" ); } InitializeComponent( ); _reader = reader; _timer = new Timer(); _timer.Interval = 5000; _timer.Tick += new EventHandler(timer_Tick); errorTextBox.Visible = false; }
public ConfigureTroubleControl( LakeChabotReader reader ) { if ( reader == null ) throw new ArgumentNullException( "reader", "Null reader passed to ConfigureGeneral CTOR()" ); if ( reader.Mode != rfidReader.OperationMode.BoundToReader ) throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureGeneral()" ); InitializeComponent( ); _reader = reader; _timer = new Timer( ); _timer.Interval = 5000; _timer.Tick += new EventHandler( timer_Tick ); _errorList = new MacErrorList( ); // errorPanel errorPanel.BackColor = System.Drawing.Color.Silver; errorPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; errorPanel.Name = "errorPanel"; errorPanel.Size = new System.Drawing.Size( 227, 114 ); errorPanel.TabIndex = 15; errorPanel.Visible = false; // errorTextBox errorTextBox.BackColor = System.Drawing.SystemColors.Info; errorTextBox.Location = new System.Drawing.Point( -1, -1 ); errorTextBox.Multiline = true; errorTextBox.Name = "errorTextBox"; errorTextBox.Size = new System.Drawing.Size( 226, 113 ); errorTextBox.TabIndex = 0; errorPanel.Controls.Add( this.errorTextBox ); this.Controls.Add( this.errorPanel ); }
public RFTest(RFID_Explorer.mainForm r_form, LakeChabotReader rm_reader) { InitializeComponent(); m_mainForm = r_form; m_reader = rm_reader; //Initial value ckboxErrorKeepRunning.Checked = m_mainForm.bErrorKeepRunning; //Read Data from module m_reader.API_TestGetAntennaPortConfiguration(ref m_btPhysicalPort, ref m_usPowerLevel); m_reader.API_TestGetFrequencyConfiguration(ref m_btChannelFlag, ref m_uiExactFrequecny); m_reader.API_TestGetRandomDataPulseTime(ref m_uiPulseOnTime, ref m_uiPulseOffTime); //regionComboBox try { m_macRegion = m_reader.RegulatoryRegion; } catch (rfidReaderException exp) { cmbBoxRegion.Text = exp.Message; } cmbBoxRegion.Items.Add(m_macRegion); cmbBoxRegion.SelectedIndex = 0; //Frequency switch(m_macRegion) { case MacRegion.US: foreach ( ENUM_RF_US item in Enum.GetValues(typeof(ENUM_RF_US)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.EU: foreach ( ENUM_RF_EU item in Enum.GetValues(typeof(ENUM_RF_EU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.JP: foreach ( ENUM_RF_JP item in Enum.GetValues(typeof(ENUM_RF_JP)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.EU2: foreach ( ENUM_RF_EU2 item in Enum.GetValues(typeof(ENUM_RF_EU2)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.TW: foreach ( ENUM_RF_TW item in Enum.GetValues(typeof(ENUM_RF_TW)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.CN: foreach ( ENUM_RF_CN item in Enum.GetValues(typeof(ENUM_RF_CN)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.KR: foreach ( ENUM_RF_KR item in Enum.GetValues(typeof(ENUM_RF_KR)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.AU: foreach ( ENUM_RF_AU item in Enum.GetValues(typeof(ENUM_RF_AU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.BR: foreach ( ENUM_RF_BR item in Enum.GetValues(typeof(ENUM_RF_BR)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.HK: foreach ( ENUM_RF_HK item in Enum.GetValues(typeof(ENUM_RF_HK)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.MY: foreach ( ENUM_RF_MY item in Enum.GetValues(typeof(ENUM_RF_MY)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.SG: foreach ( ENUM_RF_SG item in Enum.GetValues(typeof(ENUM_RF_SG)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.TH: foreach ( ENUM_RF_TH item in Enum.GetValues(typeof(ENUM_RF_TH)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.IL: foreach ( ENUM_RF_IL item in Enum.GetValues(typeof(ENUM_RF_IL)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.RU: foreach ( ENUM_RF_RU item in Enum.GetValues(typeof(ENUM_RF_RU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.IN: foreach ( ENUM_RF_IN item in Enum.GetValues(typeof(ENUM_RF_IN)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.SA: foreach ( ENUM_RF_SA item in Enum.GetValues(typeof(ENUM_RF_SA)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.JO: foreach ( ENUM_RF_JO item in Enum.GetValues(typeof(ENUM_RF_JO)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; case MacRegion.MX: foreach ( ENUM_RF_MX item in Enum.GetValues(typeof(ENUM_RF_MX)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } break; //clark 2011.9.13 case MacRegion.CUSTOMER: //Set cmbBoxFreq's type to Non-ReadOnly. cmbBoxFreq.DropDownStyle = ComboBoxStyle.DropDown; cmbBoxFreq.Items.Add( "000.000" ); string strCustomerRegion = ""; Result result = m_reader.API_MacGetCustomerRegion( ref strCustomerRegion ); cmbBoxRegion.Items.Clear(); switch(result) { case Result.OK: //Show customer config name cmbBoxRegion.Items.Add(strCustomerRegion); break; case Result.NOT_SUPPORTED: cmbBoxRegion.Items.Add("Not support customer"); btnRfOn.Enabled = false; btnRfOff.Enabled = false; btnRF.Enabled = false;//btnRF Combine btnInventory.Enabled = false; btnPulse.Enabled = false; btnClear.Enabled = false; break; case Result.FAILURE: default: cmbBoxRegion.Items.Add("Get customer fail"); btnRfOn.Enabled = false; btnRfOff.Enabled = false; btnRF.Enabled = false;//btnRF Combine btnInventory.Enabled = false; btnPulse.Enabled = false; btnClear.Enabled = false; break; } cmbBoxRegion.SelectedIndex = 0; break; case MacRegion.UNKNOWN: default: cmbBoxFreq.Items.Add(MacRegion.UNKNOWN); btnRfOn.Enabled = false; btnRfOff.Enabled = false; btnRF.Enabled = false;//btnRF Combine btnInventory.Enabled = false; btnPulse.Enabled = false; btnClear.Enabled = false; break; } cmbBoxFreq.SelectedIndex = 0; //RF Channel Radio Button if (m_btChannelFlag == 0) rdoBtnMultiChannel.Checked = true; else rdoBtnSingleChannel.Checked = true; //Port Radio Button if (AddAntPort() == false) { cmbBoxFreq.Items.Add(MacRegion.UNKNOWN); btnRfOn.Enabled = false; btnRfOff.Enabled = false; btnRF.Enabled = false;//btnRF Combine btnInventory.Enabled = false; btnPulse.Enabled = false; cmbAntPort.Items.Add(ENUM_ANT_PORT.UNKNOWN); cmbAntPort.SelectedIndex = cmbAntPort.Items.IndexOf(ENUM_ANT_PORT.UNKNOWN); return; } //Pulse Time numPulseOnTime.Maximum = PULSE_TIME_MAX/1000; numPulseOnTime.Minimum = PULSE_TIME_MIN/1000; numPulseOffTime.Maximum = PULSE_TIME_MAX/1000; numPulseOffTime.Minimum = PULSE_TIME_MIN/1000; numPulseOnTime.Value = (m_uiPulseOnTime > 0) ? m_uiPulseOnTime/ 1000 : numPulseOnTime.Minimum; //us to ms numPulseOffTime.Value = (m_uiPulseOffTime > 0) ? m_uiPulseOffTime/ 1000 : numPulseOffTime.Minimum; //us to ms //Set Event m_mainForm.CurrentContextChanged += new EventHandler(CurrentContextChanged); m_mainForm.BindAllFunctionControlers(FunctionStateChanged, true); }
public static CarrierWaveObject GetCarrierWaveObject( LakeChabotReader.CarrierWaveValue state ) { foreach ( CarrierWaveObject s in States ) { if ( s.State == state ) return s; } return null; }
public CarrierWaveObject( LakeChabotReader.CarrierWaveValue state ) { _state = state; }
public FORM_RegisterAccess(LakeChabotReader Reader) { InitializeComponent(); _reader = Reader; InitializeComponent_RegisterAccess(); }
public ConfigurePostSingulation_Display( LakeChabotReader reader ) : this() { this.setReader( reader ); this.loadButton_Click( this.loadButton, null ); }
public FORM_TagAccess( LakeChabotReader reader, TagAccessData r_tagAccessData) { Init(reader); _tagAccessData = r_tagAccessData; if (!_tagAccessData.initialized) { _tagAccessData.accessPasswordPermissions = PasswordPermission.NO_CHANGE; _tagAccessData.killPasswordPermissions = PasswordPermission.NO_CHANGE; _tagAccessData.epcMemoryBankPermissions = MemoryPermission.NO_CHANGE; _tagAccessData.tidMemoryBankPermissions = MemoryPermission.NO_CHANGE; _tagAccessData.userMemoryBankPermissions = MemoryPermission.NO_CHANGE; _tagAccessData.offset_text = "0"; _tagAccessData.value1_text = "0"; _tagAccessData.value2_text = "0"; _tagAccessData.accessPassword_text = "0"; _tagAccessData.killPassword_text = "0"; _tagAccessData.count = 1; _tagAccessData.bank = MemoryBank.EPC; _tagAccessReads.ReadWords = 8; _tagAccessReads.ReadWords_text = "8"; _tagAccessReads.TotalReadWords = 3840; _tagAccessReads.TotalReadWords_text = "3840"; _tagAccessData.strcTagFlag.PostMatchFlag = 0; _tagAccessData.strcTagFlag.SelectOpsFlag = 0; _tagAccessData.strcTagFlag.RetryCount = 0; _tagAccessData.strcTagFlag.bErrorKeepRunning = false; _tagAccessData.initialized = true; } //Get Access Password in modeule's buffer. UInt32 Password = 0; if ( Result.OK == reader.API_l8K6CTagGetAccessPassword(ref Password) ) { _tagAccessData.accessPassword_text = String.Format("{0:X}",Password); _tagAccessData.accessPassword = Password; } this.COMBOBOX_TagAccess.SelectedIndex = (int)_tagAccessData.type; this.COMBOBOX_TagAccessMemoryBank.SelectedIndex = (int)_tagAccessData.bank; this.TEXTBOX_TagAccessOffset.Text = _tagAccessData.offset_text; this.TEXTBOX_TagAccessTotalReadWords.Text = _tagAccessReads.TotalReadWords_text; this.COMBOBOX_TagAccessReadWords.Text = _tagAccessReads.ReadWords_text; this.TEXTBOX_TagAccessValue1.Text = _tagAccessData.value1_text; this.TEXTBOX_TagAccessValue2.Text = _tagAccessData.value2_text; this.NUMERICUPDOWN_TagAccessCount.Value = _tagAccessData.count; this.TEXTBOX_TagAccessAccessPassword.Text = _tagAccessData.accessPassword_text; this.TEXTBOX_TagAccessKillPassword.Text = _tagAccessData.killPassword_text; this.COMBOBOX_AccessPasswordPermissions.SelectedIndex = (int)_tagAccessData.accessPasswordPermissions; this.COMBOBOX_KillPasswordPermissions.SelectedIndex = (int)_tagAccessData.killPasswordPermissions; this.COMBOBOX_EPCBankPermissions.SelectedIndex = (int)_tagAccessData.epcMemoryBankPermissions; this.COMBOBOX_TIDBankPermissions.SelectedIndex = (int)_tagAccessData.tidMemoryBankPermissions; this.COMBOBOX_UserBankPermissions.SelectedIndex = (int)_tagAccessData.userMemoryBankPermissions; this.COMBOBOX_QTCtrlType.SelectedIndex = (int)_tagAccessData.qtReadWrite; this.COMBOBOX_QTPersistence.SelectedIndex = (int)_tagAccessData.qtPersistence; this.COMBOBOX_QTShortRange.SelectedIndex = (int)_tagAccessData.qtShortRange; this.COMBOBOX_QTMemMap.SelectedIndex = (int)_tagAccessData.qtMemoryMap; if( _tagAccessData.strcTagFlag.SelectOpsFlag == 1) chkPerformSelectOps.Checked = true; if( _tagAccessData.strcTagFlag.PostMatchFlag == 1) chkPerformPostMatch.Checked = true; if (flag == true) { this.TEXTBOX_TagAccessTotalReadWords.Text = SaveTotalReadWords; this.COMBOBOX_TagAccessMemoryBank.SelectedIndex = 3; } if (flag == true && ReadWordsFlag == true) { this.COMBOBOX_TagAccessMemoryBank.SelectedIndex = 3; typenote = 3; //this.TEXTBOX_TagAccessTotalReadWords.Text=SaveTotalReadWords2; } }
public ConfigureAlgorithm_Display( LakeChabotReader reader ) : this() { this.setReader( reader ); this.setSource( new Source_QueryParms( ) ); this.retrieveData( ); }
public void setReader( LakeChabotReader reader ) { this.reader = reader; }
public ConfigureSettingsControl( LakeChabotReader reader ) { if ( reader == null ) { throw new ArgumentNullException( "reader", "Null reader passed to ConfigureGeneral CTOR()" ); } if ( reader.Mode != rfidReader.OperationMode.BoundToReader ) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureGeneral()" ); } InitializeComponent( ); this.reader = reader; _timer = new Timer( ); _timer.Interval = 5000; _timer.Tick += new EventHandler( timer_Tick ); string startupPowerState = Properties.Settings.Default.startupPowerState; string startupOpMode = Properties.Settings.Default.startupOperationalMode; int startupAlgorithmNumber = Properties.Settings.Default.startupInventoryAlgorithm; rfid.Constants.Result result = rfid.Constants.Result.OK; //Interface radiobutton============================================================= UInt32 oemData = 0; rfid.Constants.Result status = reader.MacReadOemData( (ushort) enumOEM_ADDR.HOST_IF_SEL, ref oemData ); if (oemData == (uint)enumPORT.ENUM_PORT_USB) { rBtn_USB.Checked = true; rBtn_UART.Checked = false; } else { rBtn_USB.Checked = false; rBtn_UART.Checked = true; } // regionComboBox============================================================= ENUM_REGION_RESULT enumMatch = ENUM_REGION_RESULT.FAIL; this.macRegion = new Source_MacRegion(); result = macRegion.load(LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle); do { if (rfid.Constants.Result.OK != result) { enumMatch = ENUM_REGION_RESULT.FAIL; break; } UInt32 shift = 1; foreach (rfid.Constants.MacRegion item in Enum.GetValues(typeof(rfid.Constants.MacRegion))) { do { if ((this.macRegion.MacRegionSupport & shift) <= 0) break; //Add support region to regionComboBox. if (item == rfid.Constants.MacRegion.CUSTOMER)//Customer region uses string. { result = reader.API_MacGetCustomerRegion( ref strCustomerRegion ); switch (result) { case rfid.Constants.Result.OK: regionComboBox.Items.Add(strCustomerRegion); if (item == this.macRegion.MacRegion) { enumMatch = ENUM_REGION_RESULT.CUSTOMER_OK; } break; case rfid.Constants.Result.NOT_SUPPORTED: //Only hide the option. if (item == this.macRegion.MacRegion) { enumMatch = ENUM_REGION_RESULT.CUSTOMER_NON_SUPPORTED; } break; case rfid.Constants.Result.FAILURE: default: enumMatch = ENUM_REGION_RESULT.CUSTOMER_FAIL; break; } } else { //Other region uses enum. regionComboBox.Items.Add(item); //Check match region between support and current region setting. if (item == this.macRegion.MacRegion) { enumMatch = ENUM_REGION_RESULT.OK; } } }while(false); shift <<= 0x01; } }while(false); switch (enumMatch) { case ENUM_REGION_RESULT.OK: regionComboBox.SelectedIndex = regionComboBox.Items.IndexOf(this.macRegion.MacRegion); break; case ENUM_REGION_RESULT.FAIL: RegionError("Read region unsuccessfully"); break; case ENUM_REGION_RESULT.CUSTOMER_OK: //Customer region uses string. regionComboBox.SelectedIndex = regionComboBox.Items.IndexOf(strCustomerRegion); break; case ENUM_REGION_RESULT.CUSTOMER_NON_SUPPORTED: RegionError("Not support customer region"); break; case ENUM_REGION_RESULT.CUSTOMER_FAIL: RegionError("Get customer region fail"); break; case ENUM_REGION_RESULT.NOT_MATCH: RegionError("Region deosn't match \"RegionSupport\"."); break; } // profileComboBox============================================================= this.profileList = new Source_LinkProfileList ( LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle ); this.profileList.load( ); int count = 0; foreach ( Source_LinkProfile linkProfile in profileList ) { profileComboBox.Items.Add( count + " : " + linkProfile.ToString( ) ); ++ count; } profileComboBox.SelectedIndex = ( int ) profileList.getActiveProfileIndex( ); this.profileComboBox.SelectedIndexChanged += new System.EventHandler( this.profileComboBox_SelectedIndexChanged ); // Currently out of sync with 'new' model ~ no explicit read done // here or source provided ~ done via reader call... foreach ( rfid.Constants.SingulationAlgorithm item in Enum.GetValues( typeof( rfid.Constants.SingulationAlgorithm ) ) ) { algorithmComboBox.Items.Add( item ); } algorithmComboBox.Items.Remove(rfid.Constants.SingulationAlgorithm.UNKNOWN); // skipping err checking on these shortcut methods... Source_QueryParms queryParms = new Source_QueryParms( ); queryParms.load( LakeChabotReader.MANAGED_ACCESS, reader.ReaderHandle ); algorithmComboBox.SelectedIndex = algorithmComboBox.Items.IndexOf ( queryParms.SingulationAlgorithm ); algorithmComboBox.SelectedIndexChanged += new System.EventHandler( this.algorithmComboBox_SelectedIndexChanged ); }
/// <summary> /// /// </summary> public static ReportBase LoadFileIntoStaticReader( Object context, BackgroundWorker worker, int refreshMS, string zipFileName ) { Debug.WriteLine( String.Format( "{0}() ThreadID = {1}", System.Reflection.MethodInfo.GetCurrentMethod( ).Name, Thread.CurrentThread.ManagedThreadId ) ); if ( null == worker ) return new rfidSimpleReport( context, OperationOutcome.FailByApplicationError, new ArgumentNullException( "worker", "BackgroundWorker is required" ) ); if ( refreshMS < MIN_REFRESH_MS || refreshMS > MAX_REFRESH_MS ) return new rfidSimpleReport( context, OperationOutcome.FailByApplicationError, new ArgumentOutOfRangeException( "refreshMS", refreshMS, string.Format( "Value must be between {0} and {1}", MIN_REFRESH_MS, MAX_REFRESH_MS ) ) ); if ( zipFileName == null ) return new rfidSimpleReport( context, OperationOutcome.FailByApplicationError, new ArgumentNullException( "zipFileName" ) ); if ( !File.Exists( zipFileName ) ) return new rfidSimpleReport( context, OperationOutcome.FailByApplicationError, new ArgumentOutOfRangeException( "ziFileName", zipFileName, "File does not exit." ) ); try { rfidSimpleReport report = new rfidSimpleReport( context, 0 ); LakeChabotReader reader = new LakeChabotReader( false ); reader._staticReaderDir = Directory.CreateDirectory( Path.Combine( Path.GetTempPath( ), Path.GetFileNameWithoutExtension( Path.GetRandomFileName( ) ) ) ).FullName; worker.ReportProgress( 10, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); FileCompressor.Decompress( zipFileName, reader._staticReaderDir ); worker.ReportProgress( 20, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._propertyBagData = new DataFile<PropertyBag>( RFID.RFIDInterface.Properties.Settings.Default.PropertyBagPageSize, Path.Combine( reader._staticReaderDir, "PropertyBagData.df" ) ); reader._antennaCycleData = new SequentialDataFile<AntennaPacket>( RFID.RFIDInterface.Properties.Settings.Default.AntennaCyclePageSize, Path.Combine( reader._staticReaderDir, "AntennaCycleData.df" ) ); worker.ReportProgress( 30, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._inventoryRoundData = new SequentialDataFile<InventoryRound>( RFID.RFIDInterface.Properties.Settings.Default.InventoryRoundPageSize, Path.Combine( reader._staticReaderDir, "InventoryRoundData.df" ) ); worker.ReportProgress( 40, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._packetStreamData = new SequentialDataFile<PacketStream>( RFID.RFIDInterface.Properties.Settings.Default.PacketStreamPageSize, Path.Combine( reader._staticReaderDir, "PacketStreamData.df" ) ); worker.ReportProgress( 50, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._readerCommandData = new SequentialDataFile<ReaderCommand>( RFID.RFIDInterface.Properties.Settings.Default.ReaderCommandPageSize, Path.Combine( reader._staticReaderDir, "ReaderCommandData.df" ) ); reader._readerAntennaCycleData = new SequentialDataFile<ReaderAntennaCycle>( RFID.RFIDInterface.Properties.Settings.Default.ReaderCyclePageSize, Path.Combine( reader._staticReaderDir, "ReaderCycleData.df" ) ); worker.ReportProgress( 60, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._readerRequestData = new SequentialDataFile<ReaderRequest>( RFID.RFIDInterface.Properties.Settings.Default.ReaderRequestPageSize, Path.Combine( reader._staticReaderDir, "ReaderRequestData.df" ) ); worker.ReportProgress( 70, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._tagInventoryData = new DataFile<TagInventory>( RFID.RFIDInterface.Properties.Settings.Default.TagInventoryPageSize, Path.Combine( reader._staticReaderDir, "TagInventoryData.df" ) ); reader._tagReadData = new SequentialDataFile<TagRead>( RFID.RFIDInterface.Properties.Settings.Default.TagReadPageSize, Path.Combine( reader._staticReaderDir, "TagReadData.df" ) ); worker.ReportProgress( 80, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._readRateData = new SequentialDataFile<ReadRate>( RFID.RFIDInterface.Properties.Settings.Default.ReadRatePageSize, Path.Combine( reader._staticReaderDir, "ReadRateData.df" ) ); reader._badPacketData = new SequentialDataFile<BadPacket>( RFID.RFIDInterface.Properties.Settings.Default.BadPacketPageSize, Path.Combine( reader._staticReaderDir, "BadPacketData.df" ) ); reader._inventoryCycleData = new SequentialDataFile<InventoryCycle>( RFID.RFIDInterface.Properties.Settings.Default.InventoryCyclePageSize, Path.Combine( reader._staticReaderDir, "InventoryCycleData.df" ) ); worker.ReportProgress( 90, report.GetProgressReport( HighResolutionTimer.Milliseconds ) ); reader._theReaderID = new rfidReaderID(rfidReaderID.ReaderType.MTI, zipFileName); reader._recentPacketList = new PacketArrayListGlue( reader ); report.NewReader = reader; report.OperationCompleted( OperationOutcome.Success, HighResolutionTimer.Milliseconds ); return report; } catch ( Exception e ) { return new rfidSimpleReport( context, OperationOutcome.FailByApplicationError, e ); } }
public ConfigureSelect_Display( LakeChabotReader reader ) : this() { this.setReader( reader ); this.loadButton_Click( this.loadButton, null ); }
public FORM_TagAccess(LakeChabotReader reader) { Init(reader); }
// This MUST be called prior to any accessors etc. and // each and every call here will reset all data causing // a re-read of info from the radio... public void setReader( LakeChabotReader reader ) { if ( null == reader ) { throw new ArgumentNullException( "reader", "Null reader passed to Algorithm_Display( )" ); } if ( rfidReader.OperationMode.BoundToReader != reader.Mode ) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to Algorithm_Display( )" ); } this.reader = reader; }
public void Init(LakeChabotReader reader) { InitializeComponent(); //clark 2011.5.9 Get this point to get Access Password in module's buffer. _reader = reader; //clark not sure. Hide QT function. Wait FW team to support. //this.COMBOBOX_TagAccess.DataSource = System.Enum.GetValues(typeof(TagAccessType)); foreach (TagAccessType item in Enum.GetValues(typeof(TagAccessType))) { this.COMBOBOX_TagAccess.Items.Add(item); } COMBOBOX_TagAccess.Items.Remove(TagAccessType.QT_None); COMBOBOX_TagAccess.Items.Remove(TagAccessType.QT_Read); COMBOBOX_TagAccess.Items.Remove(TagAccessType.QT_Write); foreach (MemoryBank item in Enum.GetValues(typeof(MemoryBank))) { this.COMBOBOX_TagAccessMemoryBank.Items.Add(item); } this.COMBOBOX_TagAccessMemoryBank.Items.Remove(rfid.Constants.MemoryBank.UNKNOWN); this.COMBOBOX_TagAccessMemoryBank.SelectedIndex = 0; foreach (PasswordPermission item in Enum.GetValues(typeof(PasswordPermission))) { this.COMBOBOX_AccessPasswordPermissions.Items.Add(item); this.COMBOBOX_KillPasswordPermissions.Items.Add(item); } this.COMBOBOX_AccessPasswordPermissions.Items.Remove(PasswordPermission.UNKNOWN); this.COMBOBOX_KillPasswordPermissions.Items.Remove(PasswordPermission.UNKNOWN); this.COMBOBOX_AccessPasswordPermissions.SelectedIndex = 0; this.COMBOBOX_KillPasswordPermissions.SelectedIndex = 0; foreach (MemoryPermission item in Enum.GetValues(typeof(MemoryPermission))) { this.COMBOBOX_EPCBankPermissions.Items.Add(item); this.COMBOBOX_TIDBankPermissions.Items.Add(item); this.COMBOBOX_UserBankPermissions.Items.Add(item); } this.COMBOBOX_EPCBankPermissions.Items.Remove(MemoryPermission.UNKNOWN); this.COMBOBOX_TIDBankPermissions.Items.Remove(MemoryPermission.UNKNOWN); this.COMBOBOX_UserBankPermissions.Items.Remove(MemoryPermission.UNKNOWN); this.COMBOBOX_EPCBankPermissions.SelectedIndex = 0; this.COMBOBOX_TIDBankPermissions.SelectedIndex = 0; this.COMBOBOX_UserBankPermissions.SelectedIndex = 0; foreach (QTCtrlType item in Enum.GetValues(typeof(QTCtrlType))) { this.COMBOBOX_QTCtrlType.Items.Add(item); } this.COMBOBOX_QTCtrlType.Items.Remove(QTCtrlType.UNKNOWN); this.COMBOBOX_QTCtrlType.SelectedIndex = 0; foreach (QTPersistenceType item in Enum.GetValues(typeof(QTPersistenceType))) { this.COMBOBOX_QTPersistence.Items.Add(item); } this.COMBOBOX_QTPersistence.Items.Remove(QTPersistenceType.UNKNOWN); this.COMBOBOX_QTPersistence.SelectedIndex = 0; foreach (QTShortRangeType item in Enum.GetValues(typeof(QTShortRangeType))) { this.COMBOBOX_QTShortRange.Items.Add(item); } this.COMBOBOX_QTShortRange.Items.Remove(QTShortRangeType.UNKNOWN); this.COMBOBOX_QTShortRange.SelectedIndex = 0; foreach (QTMemMapType item in Enum.GetValues(typeof(QTMemMapType))) { this.COMBOBOX_QTMemMap.Items.Add(item); } this.COMBOBOX_QTMemMap.Items.Remove(QTMemMapType.UNKNOWN); this.COMBOBOX_QTMemMap.SelectedIndex = 0; }
public ConfigureSettingsControl( LakeChabotReader reader ) { if ( reader == null ) { throw new ArgumentNullException( "reader", "Null reader passed to ConfigureGeneral CTOR()" ); } if ( reader.Mode != rfidReader.OperationMode.BoundToReader ) { throw new ArgumentOutOfRangeException( "reader", "Unbound reader passed to ConfigureGeneral()" ); } InitializeComponent( ); this.reader = reader; _timer = new Timer( ); _timer.Interval = 5000; _timer.Tick += new EventHandler( timer_Tick ); string startupPowerState = Properties.Settings.Default.startupPowerState; string startupOpMode = Properties.Settings.Default.startupOperationalMode; int startupAlgorithmNumber = Properties.Settings.Default.startupInventoryAlgorithm; //Interface radiobutton============================================================= do { UInt32 uiModelNameMajor = 0; string strModule = string.Empty; rfid.Constants.Result result = rfid.Constants.Result.OK; //Get Model Name result = reader.MacReadOemData((ushort)((int)enumOEM_ADDR.MODEL_NAME_MAIN), ref uiModelNameMajor); if (rfid.Constants.Result.OK != result) { btn_Update.Enabled = false; break; } strModule= String.Format( "RU-{0}{1}{2}", (char)((uiModelNameMajor >> 16) & 0xFF), (char)((uiModelNameMajor >> 8) & 0xFF), (char)( uiModelNameMajor & 0xFF) ); if (strModule == "RU-824") { rBtn_USB.Checked = true; btn_Update.Enabled = false; rBtn_UART.Enabled = false; break; } if (uiModelNameMajor == 0x4D303258)//0x4D303258==M02X { rBtn_UART.Checked = true; btn_Update.Enabled = false; rBtn_USB.Enabled = false; break; } UInt32 oemData = 0; result = reader.MacReadOemData( (ushort) enumOEM_ADDR.HOST_IF_SEL, ref oemData); if (rfid.Constants.Result.OK != result) { btn_Update.Enabled = false; break; } if (oemData == (uint)enumPORT.ENUM_PORT_USB) { rBtn_USB.Checked = true; rBtn_UART.Checked = false; } else { rBtn_USB.Checked = false; rBtn_UART.Checked = true; } }while(false); //regionComboBox============================================================= LoadRegion(); // profileComboBox============================================================= this.profileList = new Source_LinkProfileList ( LakeChabotReader.MANAGED_ACCESS, this.reader.ReaderHandle ); this.profileList.load( ); int count = 0; foreach ( Source_LinkProfile linkProfile in profileList ) { profileComboBox.Items.Add( count + " : " + linkProfile.ToString( ) ); ++ count; } profileComboBox.SelectedIndex = ( int ) profileList.getActiveProfileIndex( ); this.profileComboBox.SelectedIndexChanged += new System.EventHandler( this.profileComboBox_SelectedIndexChanged ); // Currently out of sync with 'new' model ~ no explicit read done // here or source provided ~ done via reader call... foreach ( rfid.Constants.SingulationAlgorithm item in Enum.GetValues( typeof( rfid.Constants.SingulationAlgorithm ) ) ) { algorithmComboBox.Items.Add( item ); } algorithmComboBox.Items.Remove(rfid.Constants.SingulationAlgorithm.UNKNOWN); // skipping err checking on these shortcut methods... Source_QueryParms queryParms = new Source_QueryParms( ); queryParms.load( LakeChabotReader.MANAGED_ACCESS, reader.ReaderHandle ); algorithmComboBox.SelectedIndex = algorithmComboBox.Items.IndexOf ( queryParms.SingulationAlgorithm ); algorithmComboBox.SelectedIndexChanged += new System.EventHandler( this.algorithmComboBox_SelectedIndexChanged ); }
public ReturnLoss(RFID_Explorer.mainForm r_form, LakeChabotReader rm_reader) { InitializeComponent(); string strBmpPath = Path.Combine( Application.CommonAppDataPath, BMP_NAME); //string strBmpPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData), // Application.CommonAppDataPath ); //; //Path.GetTempFileName\ // string strBmpPath = Path.Combine( Application.CommonAppDataPath, BMP_NAME); m_mainForm = r_form; m_reader = rm_reader; //Read Data from module m_reader.API_TestGetAntennaPortConfiguration(ref m_btPhysicalPort, ref m_usPowerLevel); m_reader.API_TestGetFrequencyConfiguration(ref m_btChannelFlag, ref m_uiExactFrequecny); //Thread function dlgSetComboFreq = new SET_COMBO_FREQ( SetComboFreq ); dlgShowErrMsg = new SHOW_ERR_MSG( ShowErrMsg ); dlgShowPaint = new SHOW_PAINT( ShowPaint ); dlgSetCurValueToText = new SET_CUR_VALUE_TO_TEXT( SetCurValueToText ); dlgDrawString = new DRAW_STRING(DrawString); //Graphic PaintPanel.Controls.Add(picPaint); m_Graphics = picPaint.CreateGraphics(); //Link between Graphics and panel m_PaintBmp = new Bitmap(picPaint.Width, picPaint.Height); //Create BMP File m_PaintBmp.Save(strBmpPath); m_PaintBmp.Dispose(); m_PaintImage = Image.FromFile(strBmpPath); //Open BMP File m_GraphicsBmp = Graphics.FromImage(m_PaintImage); //Link BMP File to Graphics Object //m_GraphicsBmp = Graphics.FromImage(m_PaintBmp); //regionComboBox try { m_macRegion = m_reader.RegulatoryRegion; } catch (rfidReaderException exp) { cmbBoxRegion.Text = exp.Message; } cmbBoxRegion.Items.Add(m_macRegion); cmbBoxRegion.SelectedIndex = 0; //Frequency switch(m_macRegion) { case MacRegion.US: foreach ( ENUM_RF_US item in Enum.GetValues(typeof(ENUM_RF_US)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.EU: foreach ( ENUM_RF_EU item in Enum.GetValues(typeof(ENUM_RF_EU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.JP: foreach ( ENUM_RF_JP item in Enum.GetValues(typeof(ENUM_RF_JP)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.EU2: foreach ( ENUM_RF_EU2 item in Enum.GetValues(typeof(ENUM_RF_EU2)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.TW: foreach ( ENUM_RF_TW item in Enum.GetValues(typeof(ENUM_RF_TW)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.CN: foreach ( ENUM_RF_CN item in Enum.GetValues(typeof(ENUM_RF_CN)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.KR: foreach ( ENUM_RF_KR item in Enum.GetValues(typeof(ENUM_RF_KR)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.AU: foreach ( ENUM_RF_AU item in Enum.GetValues(typeof(ENUM_RF_AU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.BR: foreach ( ENUM_RF_BR item in Enum.GetValues(typeof(ENUM_RF_BR)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.HK: foreach ( ENUM_RF_HK item in Enum.GetValues(typeof(ENUM_RF_HK)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.MY: foreach ( ENUM_RF_MY item in Enum.GetValues(typeof(ENUM_RF_MY)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.SG: foreach ( ENUM_RF_SG item in Enum.GetValues(typeof(ENUM_RF_SG)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.TH: foreach ( ENUM_RF_TH item in Enum.GetValues(typeof(ENUM_RF_TH)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.IL: foreach ( ENUM_RF_IL item in Enum.GetValues(typeof(ENUM_RF_IL)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.RU: foreach ( ENUM_RF_RU item in Enum.GetValues(typeof(ENUM_RF_RU)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.IN: foreach ( ENUM_RF_IN item in Enum.GetValues(typeof(ENUM_RF_IN)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.SA: foreach ( ENUM_RF_SA item in Enum.GetValues(typeof(ENUM_RF_SA)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.JO: foreach ( ENUM_RF_JO item in Enum.GetValues(typeof(ENUM_RF_JO)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; case MacRegion.MX: foreach ( ENUM_RF_MX item in Enum.GetValues(typeof(ENUM_RF_MX)) ) { cmbBoxFreq.Items.Add( String.Format("{0:000.000}", (float)item/1000) ); } cmbBoxFreq.Items.Add( ENUM_RF_COMMON.CHANNEL_ALL ); break; //clark 2011.9.13 case MacRegion.CUSTOMER: //Set cmbBoxFreq's type to Non-ReadOnly. cmbBoxFreq.DropDownStyle = ComboBoxStyle.DropDown; cmbBoxFreq.Items.Add( "000.000" ); string strCustomerRegion = null; Result result = m_reader.API_MacGetCustomerRegion( ref strCustomerRegion ); cmbBoxRegion.Items.Clear(); switch(result) { case Result.OK: //Show customer config name cmbBoxRegion.Items.Add(strCustomerRegion); break; case Result.NOT_SUPPORTED: cmbBoxRegion.Items.Add("Not support customer"); btnRun.Enabled = false; break; case Result.FAILURE: default: cmbBoxRegion.Items.Add("Get customer fail"); btnRun.Enabled = false; break; } cmbBoxRegion.SelectedIndex = 0; break; case MacRegion.UNKNOWN: default: cmbBoxFreq.Items.Add(MacRegion.UNKNOWN); btnRun.Enabled = false; break; } //clark 2011.9.13 if (m_macRegion != MacRegion.UNKNOWN) { //Customer doesn't support ENUM_RF_COMMON.CHANNEL_ALL if( m_macRegion == MacRegion.CUSTOMER) cmbBoxFreq.SelectedIndex = 0; else cmbBoxFreq.SelectedItem = ENUM_RF_COMMON.CHANNEL_ALL; } //Port Radio Button if (AddAntPort() == false) { cmbBoxFreq.Items.Add(MacRegion.UNKNOWN); btnRun.Enabled = false; cmbAntPort.Items.Add(ENUM_ANT_PORT.UNKNOWN); cmbAntPort.SelectedIndex = cmbAntPort.Items.IndexOf(ENUM_ANT_PORT.UNKNOWN); return; } }