private CTraceStation getStationData(long id) { CTraceStation stn = new CTraceStation(); if (id < 0) { return(stn); } try { string InternalID = jbc.GetStationInternalUID(id); // info.InternalID stn.ID = id; stn.UID = InternalID; stn.COM = jbc.GetStationCOM(id); stn.Name = jbc.GetStationName(id); // settings.Name stn.Model = jbc.GetStationModel(id); // info.Model stn.ModelType = jbc.GetStationModelType(id); // info.ModelType stn.ModelVersion = System.Convert.ToString(jbc.GetStationModelVersion(id)); // info.ModelVersion.ToString stn.Software = jbc.GetStationSWversion(id); // info.Version_Software stn.Hardware = jbc.GetStationHWversion(id); // info.Version_Hardware } catch (Exception) { } return(stn); }
public void GetStationModel() { String modelName = jbc_api.GetStationModel(station_id); Trace.WriteLine("STATION: " + station_id + " MODEL: " + modelName); Assert.AreNotEqual("", modelName); }
public void Connected(long stationID) { m_stationID = stationID; m_stationModel = m_jbc.GetStationModel(m_stationID); m_connectedStations++; //Get control m_jbc.SetControlMode(m_stationID, ControlModeConnection.CONTROL); bool supportedStation = m_jbc.GetStationFeatures(m_stationID).DisplaySettings; if (supportedStation) { m_jbc.SetStationTempUnits(m_stationID, m_selectedUnits); int maxRetries = 15; uint transactionID = m_jbc.SetTransaction(m_stationID); while (maxRetries > 0) { if (m_jbc.QueryTransaction(m_stationID, transactionID)) { break; } maxRetries--; System.Threading.Thread.Sleep(100); } m_stationUnits = m_jbc.GetStationTempUnits(m_stationID); if (m_selectedUnits == m_stationUnits) { m_configuredStations++; } } //Refresh UI RefreshUI(supportedStation); }
private void JBC_NewStationConnected(long stationID) { //new station connected, adding to the list and updating the combo box stations.Add(stationID); cbxStations.Items.Add(stationID); //allowing the combobox selection as long as at least one station is present and selecting the detected station if (!cbxStations.Enabled) { cbxStations.Enabled = true; } if (!gbxStationParams.Enabled) { gbxStationParams.Enabled = true; } if (!gbxStationData.Enabled) { gbxStationData.Enabled = true; } if (JBC.GetStationType(stationID) != eStationType.SOLD) { curStation = long.MaxValue; string stationModel = JBC.GetStationModel(stationID); MessageBox.Show(string.Format("Detected station ID {0} model '{1}' but not a soldering station.", stationID, stationModel)); return; } else { cbxStations.SelectedItem = stationID; curStation = stationID; //updating the comboboxes updateParams(); if (curFeatures.DisplaySettings) { if (lblUnits.Text != cbxUnits.SelectedItem.ToString()) { cbxUnits.SelectedItem = lblUnits.Text; } if (lblN2.Text != cbxN2.SelectedItem.ToString()) { cbxN2.SelectedItem = lblN2.Text; } if (lblHelp.Text != cbxHelp.SelectedItem.ToString()) { cbxHelp.SelectedItem = lblHelp.Text; } if (lblBeep.Text != cbxBeep.SelectedItem.ToString()) { cbxBeep.SelectedItem = lblBeep.Text; } } //setting the control mode to ON JBC.SetControlMode(curStation, ControlModeConnection.CONTROL); //starting the timer if it's not running tmr.Start(); } }