コード例 #1
0
        public void generateBasicInfo()
        {
            singleHeader[] basicInfo = new singleHeader[5];

            //File Type
            basicInfo[0].fillContent("File Type", "CSV001");

            //Experiment Type
            basicInfo[1].fillContent("Experiment", "Spectral Response");

            //Software version

            try
            {
                System.Reflection.Assembly assem = System.Reflection.Assembly.GetExecutingAssembly();
                System.Reflection.AssemblyName assemName = assem.GetName();
                Version ver = assemName.Version;

                System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                Version pubVer = ad.CurrentVersion;
                basicInfo[2].fillContent("Software Version", pubVer.ToString());
            }
            catch (Exception)
            {

                basicInfo[2].fillContent("Software Version", "Software version unavailable");
            }

            //Date
            DateTime currentTime = DateTime.Now;
            basicInfo[3].fillContent("Time", currentTime.ToString());

            //Experiement ID
            basicInfo[4].fillContent("Experiment ID", System.Environment.MachineName);

            fileHeader = basicInfo;
        }
コード例 #2
0
ファイル: QErig.cs プロジェクト: kanhua/Spectral-Response-AQ
        internal singleHeader[] generateQESettingHeader()
        {
            singleHeader[] QESettingHeader = new singleHeader[8];
            QESettingHeader[0].fillContent("Load resistor", Convert.ToString(loadResistor));
            QESettingHeader[1].fillContent("Monochromator", activeMC.deviceName);

            string inputModeStr = "";
            if (throughDevBox == false)
            {
                inputModeStr = "Measure directly through channel B";
            }
            else
            {
                inputModeStr = "Measure through device bias box and voltage channel";
            }
            QESettingHeader[2].fillContent("Input Mode", inputModeStr);

            QESettingHeader[3].fillContent("device bias:", Convert.ToString(deviceBiasVoltage));
            QESettingHeader[4].fillContent("light bias 1:", Convert.ToString(lightBiasVoltage[0])+" V");
            QESettingHeader[5].fillContent("light bias 2:", Convert.ToString(lightBiasVoltage[1])+" V");
            QESettingHeader[6].fillContent("light bias 3:", Convert.ToString(lightBiasVoltage[2]) + " V");

            if (activeMC.deviceName.Contains("TMc300") == true)
            {
                int start = QESettingHeader.Length;
                Array.Resize(ref QESettingHeader, start + 4);
                QESettingHeader[start].fillContent("light state 0:", "Halogen");
                QESettingHeader[start+1].fillContent("light state 1:", "Xenon");
                QESettingHeader[start+2].fillContent("grating state 0:", "1200L/mm");
                QESettingHeader[start+3].fillContent("grating state 1:", "600L/mm");
            }

            else if (activeMC.deviceName.Contains("M300") == true)
            {
                int start = QESettingHeader.Length;
                Array.Resize(ref QESettingHeader, start + 2);
                QESettingHeader[start].fillContent("grating factor", Convert.ToString(activeMC.gratingSlope));
                QESettingHeader[start + 1].fillContent("grating slope", Convert.ToString(activeMC.gratingOffset));
            }

            return QESettingHeader;
        }
コード例 #3
0
 internal void addHeaderLine(singleHeader[] headers)
 {
     foreach (singleHeader item in headers)
     {
         addHeaderLine(item.tag, item.content);
     }
 }