Esempio n. 1
0
        private void _instAccessContainer_ServiceConnectionChanged(object sender, EventArgs e)
        {
            notifyIcon1.ShowBalloonTip(2000, "Connected to Instrument API", "Connection made to instrument API service", ToolTipIcon.Info);

            _instAccess          = _instAccessContainer.Get(1);
            _instMSScanContainer = _instAccess.GetMsScanContainer(0);
            _instMSScanContainer.MsScanArrived += _instMSScanContainer_MsScanArrived;
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Use the Factory creation method to create a Fusion Access Container
            IFusionInstrumentAccessContainer fusionContainer = Factory <IFusionInstrumentAccessContainer> .Create();

            // Connect to the service by going 'online'
            fusionContainer.StartOnlineAccess();

            // Wait until the service is connected
            // (better through the event, but this is nice and simple)
            while (!fusionContainer.ServiceConnected)
            {
                ;
            }

            // From the instrument container, get access to a particular instrument
            IFusionInstrumentAccess fusionAccess = fusionContainer.Get(1);

            // Get the MS Scan Container from the fusion
            IFusionMsScanContainer fusionScanContainer = fusionAccess.GetMsScanContainer(0);

            // Run forever until the user Escapes
            ConsoleKeyInfo cki;

            while ((cki = Console.ReadKey()).Key != ConsoleKey.Escape)
            {
                switch (cki.Key)
                {
                case ConsoleKey.S:
                    // Subscribe to whenever a new MS scan arrives
                    fusionScanContainer.MsScanArrived += FusionScanContainer_MsScanArrived;
                    break;

                case ConsoleKey.U:
                    // Unsubscribe
                    fusionScanContainer.MsScanArrived -= FusionScanContainer_MsScanArrived;
                    break;

                default:
                    Console.WriteLine("Unsupported Key: {0}", cki.Key);
                    break;
                }
            }
        }
Esempio n. 3
0
File: Form1.cs Progetto: 5ggg/vimms
        private void button3_Click(object sender, EventArgs e)
        {
            _instAccess = _instAccessContainer.Get(1);

            instrumentIdTB.Text        = _instAccess.InstrumentId.ToString();
            instrumentNameTB.Text      = _instAccess.InstrumentName;
            instrumentConnectedTB.Text = _instAccess.Connected.ToString();

            _instControl = _instAccess.Control;
            _instAccess.ConnectionChanged     += _instAccess_ConnectionChanged;
            _instAccess.ContactClosureChanged += _instAccess_ContactClosureChanged;


            _instAcq = _instControl.Acquisition;
            _instAcq.StateChanged             += Acquisition_StateChanged;
            _instAcq.AcquisitionStreamClosing += _instAcq_AcquisitionStreamClosing;
            _instAcq.AcquisitionStreamOpening += _instAcq_AcquisitionStreamOpening;

            UpdateState(_instAcq.State);

            _instValues = _instControl.InstrumentValues;
            _scans      = _instControl.GetScans(false);
            _scans.CanAcceptNextCustomScan   += _scans_CanAcceptNextCustomScan;
            _scans.PossibleParametersChanged += _scans_PossibleParametersChanged;

            scanProperties = new DataTable();
            var propColumn = scanProperties.Columns.Add("Property", typeof(string));

            propColumn.ReadOnly = true;
            scanProperties.Columns.Add("Value", typeof(string));
            scanProperties.Columns.Add("Selection", typeof(string)).ReadOnly = true;
            scanProperties.Columns.Add("Help", typeof(string)).ReadOnly      = true;

            BindingSource source = new BindingSource();

            source.DataSource = scanProperties;

            dataGridView1.DataSource = source;

            UpdateScanProperties();

            _syringe = _instControl.SyringePumpControl;
            _syringe.ParameterValueChanged += _syringe_ParameterValueChanged;
            _syringe.StatusChanged         += _syringe_StatusChanged;
            updateSyringeReadbacks(true);

            _instMSScanContainer = _instAccess.GetMsScanContainer(0);


            // Analog Values
            int numOfAnalogs = _instAccess.CountAnalogChannels;

            _analogTrace = new IAnalogTraceContainer[numOfAnalogs];
            for (int i = 0; i < numOfAnalogs; i++)
            {
                var trace = _analogTrace[i] = _instAccess.GetAnalogTraceContainer(i);
                if (trace != null)
                {
                    analogGroupBoxes[i].Text = trace.DetectorClass;
                }
            }
        }