Exemplo n.º 1
0
 public TalkToLMMMM(LMLoggers.LognLM logger)
 {
     cmdprocessor = new LMMMLingo(); // same for cfg copy
     
     commlog = logger;
     cmdprocessor.CommLog = logger;
 }
Exemplo n.º 2
0
 public FileCtrl(bool usingGui)
 {
     ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
     datalog = NC.App.Loggers.Logger(LMLoggers.AppSection.Data);
     NC.App.Opstate.SOH = NCC.OperatingState.Starting;
     gui = usingGui;
 }
Exemplo n.º 3
0
        public IDDManualDataEntry()
        {
            m_refDate = DateTime.Now;

            InitializeComponent();

            ResetGrid();

            m_log = NC.App.Logger(LMLoggers.AppSection.Data);
            ClipboardMonitor.Start();
            ClipboardMonitor.OnClipboardChange += new ClipboardMonitor.OnClipboardChangeEventHandler(ClipboardMonitor_OnClipboardChange);
            cyclesGridView.AutoResizeColumn(0, DataGridViewAutoSizeColumnMode.AllCellsExceptHeader);
        }
Exemplo n.º 4
0
 public static bool ExcelPresent(LMLoggers.LognLM optlog = null)
 {
     try
     {
         if (Type.GetTypeFromProgID("Excel.Application") != null)
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         if (optlog != null)
         {
             optlog.TraceException(e);
         }
     }
     return(false);
 }
Exemplo n.º 5
0
        public DAQControl(bool usingGui)
        {
            gui = usingGui;

            gControl = this;

            applog = NC.App.Loggers.Logger(LMLoggers.AppSection.App);
            collog = NC.App.Loggers.Logger(LMLoggers.AppSection.Collect);
            ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
            datalog = NC.App.Loggers.Logger(LMLoggers.AppSection.Data);

            // The state was set on cmd line prior to exec here, and it still is, so must upcast to an Assay instance
            NC.App.Opstate = new AssayState(NC.App.Opstate);

            LMMMComm = LMMMComm ?? new TalkToLMMMM(collog);  // a singleton, modern syntax just for fun

            CurState.SOH = NCC.OperatingState.Starting;
        }
Exemplo n.º 6
0
 public IDDReviewAssayMeas(string filter = "Verification")
 {
     InitializeComponent();
     this.Text = "Verification Measurements";
     Detector det = Integ.GetCurrentAcquireDetector();
     mlist = NC.App.DB.MeasurementsFor(det,filter);
     mlist.RemoveAll(EmptyFile);
     ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
     foreach (Measurement m in mlist)
     {
         ListViewItem lvi = new ListViewItem(new string[] { String.IsNullOrEmpty(m.MeasurementId.Item.item) ? "Empty" : m.MeasurementId.Item.item, String.IsNullOrEmpty(m.AcquireState.stratum_id.Name) ? "Empty" : m.AcquireState.stratum_id.Name, m.MeasOption.ToString(), m.MeasDate.DateTime.ToString("MM.dd.yy"), m.MeasDate.DateTime.ToString("HH:mm:ss") });
         listView1.Items.Add(lvi);
     }
     if (mlist.Count == 0)
     {
         MessageBox.Show ("There are no Verification Measurements found in the database.","WARNING");
         this.DialogResult = DialogResult.Abort;
     }
 }
Exemplo n.º 7
0
 public IDDMeasurementList(string filter = "")
 {
     InitializeComponent();
     this.Text = filter == ""?"All Measurements":filter + " Measurements";
     Detector det = Integ.GetCurrentAcquireDetector();
     mlist = NC.App.DB.MeasurementsFor(det,filter);
     mlist.RemoveAll(EmptyFile);
     ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
     foreach (Measurement m in mlist)
     {
         string ItemWithNumber = string.IsNullOrEmpty(m.MeasurementId.Item.item) ? "Empty" : m.AcquireState.ItemId.item;
         if (Path.GetFileName(m.MeasurementId.FileName).Contains("_"))
             //Lameness alert to display subsequent reanalysis number...... hn 9.21.2015
             ItemWithNumber += "(" + Path.GetFileName(m.MeasurementId.FileName).Substring(Path.GetFileName(m.MeasurementId.FileName).IndexOf('_') + 1, 2) + ")";
         ListViewItem lvi = new ListViewItem(new string[] { ItemWithNumber, String.IsNullOrEmpty(m.AcquireState.stratum_id.Name) ? "Empty" : m.AcquireState.stratum_id.Name, m.MeasDate.DateTime.ToString("MM.dd.yy"), m.MeasDate.DateTime.ToString("HH:mm:ss") });
         listView1.Items.Add(lvi);
     }
     if (mlist.Count == 0)
     {
         string msg = string.Format("There were no measurements for {0} of type {1} found.", det.Id.DetectorId, filter=="Rates"?"Rates Only": filter);
         MessageBox.Show(msg, "WARNING");
     }
 }
Exemplo n.º 8
0
        public DAQControl(MLMEmulation.IEmulatorDiversion emu, bool usingGui)
        {
            gui = usingGui;

            gControl = this;

            applog = NC.App.Loggers.Logger(LMLoggers.AppSection.App);
            collog = NC.App.Loggers.Logger(LMLoggers.AppSection.Collect);
            ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
            netlog = NC.App.Loggers.Logger(LMLoggers.AppSection.Net);
            datalog = NC.App.Loggers.Logger(LMLoggers.AppSection.Data);

            // JFL was set on cmd line prior to exec here, and it still is, upcast to an Assay instance
            NC.App.Opstate = new AssayState(NC.App.Opstate);

            LMMMComm = LMMMComm ?? new TalkToLMMMM(NC.App.Loggers.Logger(LMLoggers.AppSection.LMComm));  // a singleton

            emu.SetLogger(NC.App.Loggers.Logger(LMLoggers.AppSection.LMComm));
            LMMMComm.EmulatorInstance = emu;

            CurState.SOH = NCC.OperatingState.Starting;

        }
Exemplo n.º 9
0
 public Persistence(LMLoggers.LognLM logger, DBConfig cfg)
 {
     this.cfg = cfg;
     this.logger = logger;
     DBMain.pest = this;
 }
Exemplo n.º 10
0
 void Init()
 {
     IsoIsotopics = new List<AnalysisDefs.Isotopics>();
     CompIsoIsotopics = new List<AnalysisDefs.CompositeIsotopics>();
     ItemIds = new List<ItemId>();
     Facilities = new List<string>();
     MBAs = new List<string>();
     Strata = new List<string>();
     InventoryChangeCodes = new List<string>();
     IOCodes = new List<string>();
     MaterialTypes = new List<string>();
     SourceCodes = new List<string>();
     ItemTypes = new List<string>();
     ItemNames = new List<string>();
     mlogger = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
 }
Exemplo n.º 11
0
        // SemaphoreSlim pendingCompletion;
        #endregion

        #region Constructors

        public SRTakeDataHandler(LMLoggers.LognLM logger)
        {
            this.logger = logger;
            // this.pendingCompletion = new SemaphoreSlim(0, 1);
            threads = new Dictionary<DataSourceIdentifier, SRControlThread>();
        }
Exemplo n.º 12
0
 public virtual void Init(LMLoggers.LognLM datalogger, LMLoggers.LognLM alogger)
 {
     //cfg = config;
     this.logger = datalogger;
     this.analogger = alogger;
     state.logger = datalogger;
 }
Exemplo n.º 13
0
 public INCCFileInfo(LMLoggers.LognLM logger)
 {
     mlogger = logger;
 }
Exemplo n.º 14
0
 public void SetLogger(object logger)
 {
     commlog = (LMLoggers.LognLM)logger;
 }
Exemplo n.º 15
0
 public SimpleReport(LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
 }
Exemplo n.º 16
0
 public INCCSR(ShiftRegisterParameters sr, DataSourceIdentifier id, AcquireParameters acq, TestParameters test, LMLoggers.LognLM log)
 {
     sr_parms = new ShiftRegisterParameters(sr);
     dsid = new DataSourceIdentifier(id);
     dsid.SerialPort -= 1; // serial ports are 0 based at the HW layer
     acquire_parms = new AcquireParameters(acq);
     test_parms = new TestParameters(test);
     this.log = log;
 }
Exemplo n.º 17
0
 public void SetLogger(LMLoggers.LognLM analogger)
 {
     logger = analogger;
 }
Exemplo n.º 18
0
 public HVControl(DAQControl control)
 {
     this.control = control;
     ctrllog = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
 }
Exemplo n.º 19
0
        bool PrepList(AssaySelector.MeasurementOption filter, Detector det)
        {
            if (Goal == EndGoal.Report)
            {
                if (LMOnly)  // LMOnly
                    mlist.RemoveAll(EmptyCSVFile);    // cull those without LM CSV results
                else
                    mlist.RemoveAll(EmptyINCC5File);  // cull those with traditional INCC5 results
            }
            ctrllog = N.App.Loggers.Logger(LMLoggers.AppSection.Control);
            if (mlist.Count == 0)
            {
                string msg = string.Format("No {0}measurements for {1} found.", TypeTextFragment(filter), det == null ? "any" : det.Id.DetectorId);
                MessageBox.Show(msg, "WARNING");
                return false;
            }
            LoadList(filter);
            if (Goal == EndGoal.Report || Goal == EndGoal.Reanalysis || Goal == EndGoal.Transfer)   // it is for a named detector so elide the detector column
                listView1.Columns[1].Width = 0;
            if (!AllMeas)
                listView1.Columns[0].Width = 0;
            if (filter == AssaySelector.MeasurementOption.rates)    // show item id
                listView1.Columns[2].Width = 0;
            if (filter == AssaySelector.MeasurementOption.normalization)
            {
                listView1.Columns[2].Width = 0;
                listView1.Columns[3].Width = 0;
            }
            if (filter == AssaySelector.MeasurementOption.background)     // NEXT: add configuration active or passive column
            {
                listView1.Columns[2].Width = 0;
                listView1.Columns[3].Width = 0;
            }
            if (!AssaySelector.ForMass(filter) && !filter.IsWildCard())
                listView1.Columns[7].Width = 0;		  // material column

            if (Goal == EndGoal.Reanalysis)
            {
                listView1.Columns[0].Text = "Id";
                listView1.Columns[0].Width = 43;
            }

            return true;
        }
Exemplo n.º 20
0
 /*============================================================================
 *
 * function name: SRControl() et al. from takedata.cpp
 *
 * purpose: acquire a set of shift register data (measurement).
 *
 * return value: SUCCESS/FAIL/MEAS_ABORTED/SR_FAIL/CHECKSUM_FAIL/ACC_SNGL_FAIL
 *
 * special notes: 
 *
 * revision history:
 *
 *  date	author		revision
 *  ----	------		--------
 *  12/09/93	Bill Harker	created
 *  03/29/11 Frank Black reimplemented in C#
 *============================================================================*/
 public SRControl(int identifyingNumber, LMLoggers.LognLM log, Measurement meas, Detector det)
 {
     this.log = log;
     this.identifyingNumber = identifyingNumber;
     LastSRStatus = sr_h.SR_SUCCESS;
     LastMeasStatus = SR.SUCCESS;
     SaveOnTerminate = true;
     this.meas = meas;
     this.detector = det;
 }
Exemplo n.º 21
0
 // dev note: pre-define template somewhere, and use it, having the very nice graph already prepared for line by line updating here
 public ExcelPush(string existingWB, LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
 }
Exemplo n.º 22
0
 public ExcelPush(LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
 }
Exemplo n.º 23
0
 public ReportMangler(LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
     INCCResultsReports = new List<List<string>>();
     TestDataFiles = new List<List<string>>();
 }
Exemplo n.º 24
0
 public ExcelPush(LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
 }
Exemplo n.º 25
0
        private TimeSpan ts; // timestamp of last neutron v. requested time

        #endregion Fields

        #region Constructors

        public Cycle(LMLoggers.LognLM logger)
        {
            // Raw counts aka totals
            singles = new VTuple();
            dsid = new DataSourceIdentifier();
            qcstatus = new QCStatusMap();
            countresults = new CountingResults();
            daqStatus = CycleDAQStatus.None;
            this.logger = logger;
            hitsPerChn = new double[NC.ChannelCount];
        }
Exemplo n.º 26
0
 public INCCKnew(LMLoggers.LognLM logger)
 {
     mlogger = logger;
 }
Exemplo n.º 27
0
        // assumes file is created and open, header and footer text is set and rows constructed.
        public virtual void CreateReport(UInt16 logResults)
        {
            lines = new List <string>(2 + rows.Length + 1);

            if (hf != null)
            {
                lines.Add(hf.header);
                lines.Add(hf.GetColumnHeader());
            }

            string s;

            for (int i = 0; i < rows.Length; i++)
            {
                Row r = rows[i];
                if (r != null)
                {
                    s = rows[i].ToLine(separator);
                }
                else
                {
                    s = sepAsString;
                }
                lines.Add(s);
            }

            if (hf != null)
            {
                lines.Add(hf.footer);
            }

            foreach (string ls in lines)
            {
                f.WriteLine(ls);
            }
            bool sendToLogFile = false, logToConsole = false;

            switch (logResults)
            {
            case 1:
                sendToLogFile = true;
                break;

            case 2:
                logToConsole = true;
                break;

            case 3:
                sendToLogFile = logToConsole = true;
                break;
            }

            if (sendToLogFile || logToConsole)
            {
                LMLoggers.LognLM log = loggers.Logger(LMLoggers.AppSection.App);
                TraceEventCache  tec = new TraceEventCache();
                foreach (string ls in lines)
                {
                    if (sendToLogFile && logToConsole)
                    {
                        log.TraceEvent(LogLevels.Verbose, 717, ls);
                    }
                    else if (logToConsole)
                    {
                        log.TraceEventConsole(LogLevels.Verbose, 717, ls, tec);
                    }
                    else
                    {
                        log.TraceEventFileOnly(LogLevels.Verbose, 717, ls, tec);
                    }
                }
            }
        }
Exemplo n.º 28
0
 void UpdateGUIWithNewdata()
 {
     if (lawg == null)
         lawg = NC.App.Logger(LMLoggers.AppSection.App);
     if (lawg.ShouldTrace(LogLevels.Verbose))
         lawg.TS.TraceEvent((System.Diagnostics.TraceEventType)LogLevels.Verbose, 0, "$$$");
 }
Exemplo n.º 29
0
 // dev note: pre-define template somewhere, and use it, having the very nice graph already prepared for line by line updating here
 public ExcelPush(string existingWB, LMLoggers.LognLM ctrllog)
 {
     this.ctrllog = ctrllog;
 }
Exemplo n.º 30
0
 bool PrepList()
 {
     ctrllog = N.App.Loggers.Logger(LMLoggers.AppSection.Control);
     if ((IsIso && ilist.Count == 0) || (!IsIso && cilist.Count == 0))
     {
         string msg = string.Format("No isotopics found.");
         MessageBox.Show(msg, "WARNING");
         return false;
     }
     LoadList();
     return true;
 }
Exemplo n.º 31
0
 void Init()
 {
     IsoIsotopics = new List<Isotopics>();
     CompIsoIsotopics = null;
     mlogger = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
     Output = new CSVFile();
     Output.Log = mlogger;
 }
Exemplo n.º 32
0
        public AnalyzerHandler(double theTicSizeInSeconds, LMLoggers.LognLM logger)
        {

            ticSizeInSeconds = theTicSizeInSeconds;
            log = logger;
            verboseTrace = log.ShouldTrace(LogLevels.Verbose);
            numNeutronEventsReceived = 0;
            numNeutronEventsReceivedWhetherProcessedOrNot = 0;
            numNeutronEventsCompleted = 0;
            numCircuits = 0;
            timeOfLastNeutronEvent = 0;
            if (ticSizeInSeconds == 1e-7)
            {
                timeBaseConversion = 1ul;  // no external to internal conversion
            }
            else if (ticSizeInSeconds == 1e-8)
            {
                timeBaseConversion = 10ul; // shift gate units from tics (1e-7) to shakes (1e-8)
            }

#if USE_SPINTIME
            ResetSpinTime();
#endif
            //create stack of RawAnalysisProperties.circularListBlockIncrement neutron events, as a starting point
            InitializeEventList();

            permissionToUseEndOfEvents = new SemaphoreSlim(1, 1); // LMKV-52 fix: create here with counter set at 1 and only 1 thread

            //set up the AH BackgroundWorker
            AHWorkerStopNow = false;
            AHWorkerHasCompleted = false;
            AHWorkerStopAtEndOfEvents = false;
            AHWorker = new BackgroundWorker();
            AHWorker.WorkerSupportsCancellation = false;  //parent will stop the worker with the boolean flags
            AHWorker.DoWork += new DoWorkEventHandler(AHWorkerDoWork);
            AHWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(AHWorkerRunWorkerCompleted);
            AHWorker.RunWorkerAsync();

            // permissionToUseEndOfEventsRelease();  // LMKV-52 fix: allow 1 thread at a time now that bkg worker started
            //pause until the AHWorker is working...
            while (AHWorker.IsBusy == false)
            {
                //spin
            }

            log.TraceEvent(LogLevels.Verbose, (int)AnalyzerEventCode.AnalyzerHandlerEvent, "AnalyzerHandler constructor started its thread.");
        }
Exemplo n.º 33
0
 public void Init()
 {
     Strata = new List<INCCDB.StratumDescriptor>();
     Facilities_ = new List<INCCDB.Descriptor>();
     mlogger = NC.App.Loggers.Logger(LMLoggers.AppSection.Control);
 }
Exemplo n.º 34
0
 public ResultsOutputFile(LMLoggers.LognLM logger)
 {
     log = logger;
 }
Exemplo n.º 35
0
        public AnalyzerHandler(double theTicSizeInSeconds, LMLoggers.LognLM logger)
        {
            TickSizeInSeconds = theTicSizeInSeconds;
            log = logger;
            verboseTrace = log.ShouldTrace(LogLevels.Verbose);
            InitCounters();

            #if USE_SPINTIME
            ResetSpinTime();
            #endif
            //create stack of RawAnalysisProperties.circularListBlockIncrement neutron events, as a starting point
            //InitializeEventList(RawAnalysisProperties.circularListBlockIncrement);

            permissionToUseEndOfEvents = new SemaphoreSlim(1, 1); // LMKV-52 fix: create here with counter set at 1 and only 1 thread

            //set up the AH BackgroundWorker
            AHWorkerStopNow = false;
            AHWorkerHasCompleted = false;
            AHWorkerStopAtEndOfEvents = false;
            AHWorker = new BackgroundWorker();
            AHWorker.WorkerSupportsCancellation = false;  //parent will stop the worker with the boolean flags
            AHWorker.DoWork += new DoWorkEventHandler(AHWorkerDoWork);
            AHWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(AHWorkerRunWorkerCompleted);
            AHWorker.RunWorkerAsync();

            // permissionToUseEndOfEventsRelease();  // LMKV-52 fix: allow 1 thread at a time now that bkg worker started
            //pause until the AHWorker is working...
            while (AHWorker.IsBusy == false)
            {
                //spin
            }

            log.TraceEvent(LogLevels.Verbose, (int)AnalyzerEventCode.AnalyzerHandlerEvent, "AnalyzerHandler constructor started its thread.");
        }