コード例 #1
0
        private void daq_Click(object sender, RoutedEventArgs e)
        {
            DAQ daq = new DAQ();

            daq.InitializeComponent();
            daq.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            daq.ShowDialog();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: MRodGam/ST3PRJ3-Software
        public Form1()
        {
            BlockingCollection <RawData> rawData = new BlockingCollection <RawData>();
            DAQ daq = new DAQ();

            converter = new ConvertAlgo();
            IDAQ transducerdaq = new TransducerDAQ(daq, rawData);

            dataTreatment = new DataTreatment(rawData, converter);
            Measure       = new UC2M2_UC3M3_Measure(transducerdaq, dataTreatment);
            InitializeComponent();
            dataTreatment.Attach(this); // Lars
            GUIgraphList = new List <ConvertedData>();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: MRodGam/ST3PRJ3-Software
        static void Main(string[] args)
        {
            BlockingCollection <RawData> rawData = new BlockingCollection <RawData>();
            DAQ daq = new DAQ();

            IDAQ transducerdaq = new TransducerDAQ(daq, rawData);
            UC2M2_UC3M3_Measure newMeasurement = new UC2M2_UC3M3_Measure(transducerdaq);
            DataTreatment       dataTreatment  = new DataTreatment(rawData);


            newMeasurement.StartMeasurement();
            dataTreatment.ShowData();

            Console.ReadKey();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: MRodGam/ST3PRJ3-Software
        static void Main(string[] args)
        {
            BlockingCollection <RawData> rawCollection   = new BlockingCollection <RawData>();
            BlockingCollection <RawData> graphCollection = new BlockingCollection <RawData>();
            DAQ         daq         = new DAQ();
            ConvertAlgo convertAlgo = new ConvertAlgo();

            IDAQ          transducerdaq = new TransducerDAQ(daq, rawCollection);
            DataTreatment dataTreatment = new DataTreatment(rawCollection, graphCollection, convertAlgo, );
            IMeasure      measurement   = new UC2M2_UC3M3_Measure(transducerdaq, dataTreatment);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainGUI(dataTreatment));
        }
コード例 #5
0
        static void Main()
        {
            BlockingCollection <double> rawCollection         = new BlockingCollection <double>();
            BlockingCollection <double> graphCollection       = new BlockingCollection <double>();
            BlockingCollection <double> calibrationCollection = new BlockingCollection <double>();
            BlockingCollection <double> alarmCollection       = new BlockingCollection <double>();
            BlockingCollection <double> filterCollection      = new BlockingCollection <double>();

            DAQ               daq         = new DAQ();
            ConvertAlgo       convertAlgo = new ConvertAlgo();
            BloodPressureAlgo bpAlgo      = new BloodPressureAlgo();
            PulseAlgo         pulseAlgo   = new PulseAlgo();

            IDAQ       transducerdaq = new TransducerDAQ(daq, rawCollection, calibrationCollection);
            IData      data          = new Database();
            IAlarmType alarmType     = new HighAlarm();
            ILimits    limits        = new UC9S5_Limits();


            IAlarm  alarm                      = new UC5S1_Alarm(alarmCollection, limits, alarmType, bpAlgo);
            IFilter filter                     = new UC7S3_Filter(filterCollection, data, convertAlgo);
            UC1M1_ZeroAdjustment uc1           = new UC1M1_ZeroAdjustment(calibrationCollection, transducerdaq);
            DataTreatment        dataTreatment = new DataTreatment(rawCollection, graphCollection, filterCollection, alarmCollection, convertAlgo, data, alarm, uc1);
            IMeasure             measurement   = new UC2M2_UC3M3_Measure(transducerdaq, dataTreatment, alarm, filter);
            ICalibrate           calibrate     = new UC6S2_Calibrate(calibrationCollection, transducerdaq, data);
            IZeroAdjustment      zero          = new UC1M1_ZeroAdjustment(calibrationCollection, transducerdaq);
            IPulse pulse = new UC8S4_Pulse(dataTreatment, pulseAlgo);
            ISave  save  = new UC4M4_SaveData(data, dataTreatment);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ZeroAdjustmentGUI   zeroAdjustment = new ZeroAdjustmentGUI(zero);
            CalibrateGUI        calibrateGUI   = new CalibrateGUI(calibrate, measurement);
            LoginToCalibrateGUI login          = new LoginToCalibrateGUI(calibrateGUI);
            SaveDataGUI         saveGUI        = new SaveDataGUI(save);
            ChangeLimitsGUI     limitsGUI      = new ChangeLimitsGUI(limits);
            MainGUI             gui            = new MainGUI(dataTreatment, measurement, login, zeroAdjustment, alarm, pulse, bpAlgo, filter, saveGUI, limitsGUI, calibrateGUI);

            Application.Run(gui);
        }
コード例 #6
0
 public void ApplyBackground()
 {
     DAQ.ApplyStreamBackground(this);
 }
コード例 #7
0
 public static extern Result SetDAQProperties([In] ref DAQ DAQProperties);
コード例 #8
0
 public static extern Result AddDAQ([In, Out] ref DAQ DAQProperties);
コード例 #9
0
 public static extern Result GetDAQProperties([In, Out] ref DAQ DAQProperties);
コード例 #10
0
ファイル: LMMMComm.cs プロジェクト: hnordquist/INCC6
        internal Thread ProcessUserCommand(LMMMLingo.OpDesc cmdt, string tline, DAQ.DAQControl control, ref bool keepgoing)
        {
            Thread t = null;
            // each prompt command might have a '=' followed by a single numeric argument e.g. cmd = 1
            Int32 arg = 0;
            bool hasarg = ParsePrompt(tline, cmdt, ref arg);

            // if we didnt get an arg but one is required for the operation (5 or 6 commands, see the list)
            // then go get the config value from the config state and use it for arg

            if (cmdt.needsArg && !hasarg) // use the lambda to get the config value
                arg = cmdt.cfgInt32.Value;

            keepgoing = true;
            switch (cmdt.tok)
            {
                case LMMMLingo.Tokens.quit: // quit console prompt
                    Console.WriteLine(NC.App.AbbrName + "> Be seeing you . . .");
                    keepgoing = false;
                    break;
                case LMMMLingo.Tokens.lm:  // set or show cur LM #
                    try
                    {
                        CurrentLM = arg;
                        Console.WriteLine(NC.App.AbbrName + ">LM= " + arg);
                    }
                    catch (Exception e)
                    {
                        commlog.TraceEvent(LogLevels.Error, 361, "Current instrument and measurement undefined or incomplete: " + e.Message);
                    }
                    break;
                case LMMMLingo.Tokens.help:
                    //Console.Write(NC.App.AbbrName + ">");
                    foreach (string s in cmdprocessor.CmdPromptHelp) Console.WriteLine(s);
                    break;
                case LMMMLingo.Tokens.config:  //
                    //Console.Write(NC.App.AbbrName + ">");
                    NCCConfig.Config.ShowCfg(NC.App.Config, NC.App.AppContext.Verbose() == System.Diagnostics.TraceEventType.Verbose);
                    break;
                case LMMMLingo.Tokens.stop:  // mostly for stopping an assay, might work for HV Calib too but must test it
                    Console.Write(NC.App.AbbrName + ">");
                    control.StopCurrentAction(); // NEXT: see if this works for HV Calib
                    break;
                case LMMMLingo.Tokens.assay:
                    if (hasarg)
                    {
                        NC.App.Opstate.Measurement.MeasurementId.MeasOption = (AssaySelector.MeasurementOption)arg;
                        Console.WriteLine(NC.App.AbbrName + ">assay type= " + arg + " (" + ((AssaySelector.MeasurementOption)arg).ToString() + ")");
                    }
                    else
                    {
                        t = control.AssayOperation();
                    }
                    break;
                case LMMMLingo.Tokens.hvcalib:
                    t = control.HVCalibOperation();
                    break;
                case LMMMLingo.Tokens.broadcast:  // UDP "NDAC Control"
                    {
                        NCC.NCCAction x = NC.App.Opstate.Action;
                        NC.App.Opstate.Action = NCC.NCCAction.Discover;
                        control.StartLMDAQServer(null);
                        Console.WriteLine(NC.App.AbbrName + "> Broadcasting to LM instruments. . .");
                        PostLMMMCommand(cmdt.tok);
                        Console.WriteLine(NC.App.AbbrName + "> Sent broadcast. Waiting for LM instruments to connect");
                        control.PrepSRDAQHandler();
                        control.ConnectSRInstruments();
                        NC.App.Opstate.Action = x;
                    }
                    break;
                default:
                    try
                    {
                        FormatAndSendLMMMCommand(cmdt.tok, arg, CurrentLM);
                    }
                    catch (Exception e)
                    {
                        commlog.TraceEvent(LogLevels.Error, 360, "Current instrument and measurement undefined or incomplete: " + e.Message);
                    }
                    break;
            }
            return t;
        }
コード例 #11
0
ファイル: LMMMComm.cs プロジェクト: hnordquist/INCC6
 public void SplitHVCalibResponse(string received, ref DAQ.HVControl.HVStatus hvst)
 {
     cmdprocessor.SplitHVCalibResponse(received, ref hvst);
 }
コード例 #12
0
ファイル: Lingo.cs プロジェクト: hnordquist/INCC6
 public void SplitHVCalibResponse(string received, ref DAQ.HVControl.HVStatus hvst)
 {
     try
     {
         hvst.Extract(received);
     }
     catch (Exception e)
     {
         commlog.TraceEvent(LogLevels.Error, 892, "SplitHVCalibResponse barfed on:" + received + "; " + e.Message);
     }
 }