예제 #1
0
파일: HV.cs 프로젝트: radtek/INCC6
        public static Row CreateRow(AnalysisDefs.HVCalibrationParameters h, int i)
        {
            Row row = new Row();

            row.Add((int)HVCalibVals.MinHV, h.MinHV.ToString());
            row.Add((int)HVCalibVals.MaxHV, h.MaxHV.ToString());
            row.Add((int)HVCalibVals.DurationSeconds, h.HVDuration.ToString());
            row.Add((int)HVCalibVals.StepVolts, h.Step.ToString());
            row.Add((int)HVCalibVals.DelaySeconds, (h.DelayMS / 1000).ToString());
            return(row);
        }
예제 #2
0
 public void ResetControlVars()
 {
     HVSteps         = new List <HVStatus>();
     xp              = null;
     hvp             = IntegrationHelpers.GetCurrentHVCalibrationParams(NC.App.Opstate.Measurement.Detectors[0]);
     hvCalibPoint    = hvMinCalibPoint = hvp.MinHV; // starting point for stepping
     hvMaxCalibPoint = hvp.MaxHV;
     hvStep          = hvp.Step;
     hvDelayms       = hvp.DelayMS;
     if (hvp.HVDuration <= hvp.DelayMS / 1000) // seconds to milliseconds
     {
         hvp.DelayMS = (hvp.HVDuration / 1000) + 1000;
         hvDelayms   = hvp.DelayMS;
         ctrllog.TraceEvent(LogLevels.Warning, 604, "HV delay modified to {0} seconds because the HV cycle duration ({1} sec) must be less than HV command delay", hvp.DelayMS * 1000, hvp.HVDuration);
     }
     hvx = false; // excel monitor flag
 }
예제 #3
0
파일: HV.cs 프로젝트: tempbottle/INCC6
 public void ResetControlVars()
 {
     HVSteps = new List<HVStatus>();
     xp = null;
     hvp = IntegrationHelpers.GetCurrentHVCalibrationParams(NC.App.Opstate.Measurement.Detectors[0]);
     hvCalibPoint = hvMinCalibPoint = hvp.MinHV;  // starting point for stepping
     hvMaxCalibPoint = hvp.MaxHV;
     hvStep = hvp.Step;
     hvDelayms = hvp.DelayMS;
     if (hvp.HVDuration <= hvp.DelayMS / 1000) // seconds to milliseconds
     {
         hvp.DelayMS = (hvp.HVDuration/1000) + 1000;
         hvDelayms = hvp.DelayMS;
         ctrllog.TraceEvent(LogLevels.Warning, 604, "HV delay modified to {0} seconds because the HV cycle duration ({1} sec) must be less than HV command delay", hvp.DelayMS * 1000, hvp.HVDuration); 
     }
     hvx = false; // excel monitor flag
 }
예제 #4
0
파일: HV.cs 프로젝트: radtek/INCC6
        public void GenerateReport(AnalysisDefs.HVCalibrationParameters hvc, List <HVControl.HVStatus> HVSteps, DateTime time, String instId)
        {
            TabularReport t = new TabularReport(typeof(HVVals), NC.App.Loggers);  // default file output type is CSV

            try
            {
                t.CreateOutputFile(NC.App.Opstate.Measurement.AcquireState.lm.Results, instId + " HV " + time.ToString("yyyyMMddHHmmss"), null);

                t.rows = new Row[HVSteps.Count + 4 + 2];  // header, steps, space, header, current params, space, header, config
                // first, the column header
                int cols = System.Enum.GetValues(typeof(HVVals)).Length;
                int i    = 0;

                // now for each hvcalib row
                for (i = 0; i < HVSteps.Count; i++)
                {
                    HVControl.HVStatus h = HVSteps[i];
                    Row row = CreateRow(h, i);
                    t.rows[i] = row;
                }

                // then do the current parameters
                t.rows[i++] = new Row();
                t.rows[i]   = new Row(); t.rows[i++].GenFromEnum(typeof(HVCalibVals));
                t.rows[i++] = CreateRow(hvc, i);
                t.rows[i++] = new Row();

                // lastly, add the full software version state
                t.rows[i] = new Row(); t.rows[i++].Add(0, "Software application configuration details");
                Row[] temp = AnalysisDefs.SimpleReport.GenSoftwareConfigRows();
                Array.Resize(ref t.rows, temp.Length + t.rows.Length + 2);
                Array.Copy(temp, 0, t.rows, i, temp.Length);

                t.CreateReport(3);
            }
            catch (Exception e)
            {
                ctrllog.TraceException(e);
            }
            finally
            {
                t.CloseOutputFile();
            }
        }