コード例 #1
0
ファイル: Excel.cs プロジェクト: tempbottle/INCC6
 public void ShowWB()
 {
     try
     {
         //if (target == null)
         //{
         //    target = new Excel.Application();
         //    target.Workbooks.Add(); // add a new empty WB
         //    target.Visible = true;  // pop it up to the front, really annoying, in the traditional Windows way!
         //}
     }
     catch (Exception e)
     {
         ctrllog.TraceException(e);
     }
 }
コード例 #2
0
ファイル: Excel.cs プロジェクト: tempbottle/INCC6
 public static bool ExcelPresent(NCCReporter.LMLoggers.LognLM optlog = null)
 {
     try
     {
         //Excel.Application nitz;
         //nitz = new Excel.Application();
         return(true);
     }
     catch (Exception e)
     {
         if (optlog != null)
         {
             optlog.TraceException(e);
         }
     }
     return(false);
 }
コード例 #3
0
        public void GenerateReport(LMDAQ.HVControl.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();
            }
        }
コード例 #4
0
        void LoadtheMCACombobox()
        {
            Device.MCADeviceInfo[] deviceInfos = null;
            int indexOfMyDesire = -1;

            try
            {
                deviceInfos = Device.MCADevice.QueryDevices();
                MCAComboBox.Items.Clear();
                if (deviceInfos.Length > 0)
                {
                    MCAComboBox.Visible = true;
                    // Populate the combobox in the selector panel
                    foreach (Device.MCADeviceInfo d in deviceInfos)
                    {
                        string id = d.Serial.ToString("D5");
                        string s  = string.Format("{0}{1}  FW# {2}  HW# {3} on {4}", MCAPrefix, id, d.FirmwareVersion, d.HardwareVersion, d.Address);
                        int    i  = MCAComboBox.Items.Add(s);
                        object o  = MCAComboBox.Items[i];
                        if (string.Equals(id, det.Id.ElectronicsId, StringComparison.OrdinalIgnoreCase))
                        {
                            indexOfMyDesire = i;
                        }
                    }
                    if (indexOfMyDesire >= 0)
                    {
                        MCAComboBox.SelectedIndex = indexOfMyDesire;
                    }
                }
                else
                {
                    MCAComboBox.Visible = false;
                }
            } catch (Exception e)
            {
                NCCReporter.LMLoggers.LognLM log = NC.App.Loggers.Logger(NCCReporter.LMLoggers.AppSection.Control);
                log.TraceException(e);
            }
        }