/// <summary> /// Runs when the application starts. /// </summary> public FormGasMixer() { // Initialize the form. InitializeComponent(); // Add version string to title bar. if (ApplicationDeployment.IsNetworkDeployed) { Text += " " + ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(); } // This has to be created in the constructor, because it references // non-static objects. _gasMixer = new GasMixingDevice( _mfcDiluent, _mfcDiluent, _mfcAnalyte, _mfcAnalyte); // Find all available serial ports. foreach (string s in SerialPort.GetPortNames()) { comboBoxAnalytePort.Items.Add(s); comboBoxDiluentPort.Items.Add(s); } // Select the most recently used port. // The most recently used port is fetched from application settings. comboBoxAnalytePort.Text = Properties.Settings.Default.PortAnalyte; comboBoxDiluentPort.Text = Properties.Settings.Default.PortDiluent; // Populate the Gas combo box. foreach (Gas gas in Enum.GetValues(typeof(Gas))) { comboBoxAnalyteGas.Items.Add(gas); comboBoxDiluentGas.Items.Add(gas); } }
/// <summary> /// Constructor; creates equipment objects. /// </summary> public Equipment(EquipmentSettings settings) { _settings = settings; // Create test equipment objects. // Only the ones chosen by the user will end up being used. _mfcAnalyte = new ColeParmerMFC(); _mfcDiluent = new ColeParmerMFC(); _gasMixer = new GasMixingDevice(_mfcDiluent, _mfcDiluent, _mfcAnalyte, _mfcAnalyte); _datalogger = new Keysight_34972A(); _manual = new Manual(); _powerSupply = new GPDX303S(); Controllers = new Dictionary <VariableType, IControlDevice> { { VariableType.GasConcentration, _gasMixer }, { VariableType.MassFlow, _gasMixer }, //{ VariableType.Current, _powerSupply }, //{ VariableType.Voltage, _powerSupply } }; References = new Dictionary <VariableType, IReferenceDevice> { { VariableType.GasConcentration, _gasMixer }, { VariableType.MassFlow, _gasMixer }, //{ VariableType.Current, _powerSupply }, //{ VariableType.Voltage, _powerSupply } }; }