示例#1
0
 private void SetConfiguration()
 {
     QualFeatureConfig.InitRegistryFromAppConfig();
     AppFeatureConfig.Configuration.SetKeyState(AppFeatureConfig.Key_ProfinderApp, true);
     Console.WriteLine("Configuration Set");
 }
示例#2
0
        public List <DataTypes.CompoundGroup> GetCompoundGroups(List <string> analysisFiles)
        {
            try
            {
                qualAppLogic.AppExecutionMode = AppExecutionMode.WorkListAutomation;
                CmdInitializeApplication cmdInit = new CmdInitializeApplication(qualAppLogic);
                ExecuteCommand(qualAppLogic, cmdInit);

                QualFeatureConfig.InitRegistryFromAppConfig();
                qualAppLogic.AppProgressEvent += new AppProgressEventHandler(OnAppProgressEvent);
                IAppState appState = qualAppLogic as IAppState;

                //appState.ThreadErrorReporter = m_messageReporter;

                AnalysisMethodLoadOptions loadMethod = GetAnalysisMethodLoadOptions(null);
                //if (analysisFiles.Count > 0)
                //{
                bool loadResults        = false;
                bool runLoadTimeScripts = false;

                CmdOpenAnalysisFile cmdOpenAnalysis = new CmdOpenAnalysisFile
                                                          (qualAppLogic,
                                                          analysisFiles.ToArray(),
                                                          loadMethod,
                                                          loadResults,
                                                          runLoadTimeScripts);

                ExecuteCommand(qualAppLogic, cmdOpenAnalysis);

                RunScript(qualAppLogic, analysisFiles);
                IEnumerable <Agilent.MassSpectrometry.DataAnalysis.ICompoundGroup> cpdGroups = qualAppLogic.DataStore.CompoundGroups;
                List <DataTypes.CompoundGroup> compoundGroups = new List <DataTypes.CompoundGroup>();
                foreach (Agilent.MassSpectrometry.DataAnalysis.ICompoundGroup cpdGroup in cpdGroups)
                {
                    DataTypes.CompoundGroup compoundGroup = getICompoundGroup(cpdGroup, analysisFiles) as DataTypes.CompoundGroup;
                    compoundGroups.Add(compoundGroup);
                }
                Console.ReadKey();
            }
            catch (MSDAApplicationException msdaExep)
            {
                Console.WriteLine(msdaExep.Message);
            }
            catch (Exception e)
            {
                string analysisName = "";
                for (int analysisInd = 0; analysisInd < analysisFiles.Count; analysisInd++)
                {
                    if (analysisName == "")
                    {
                        analysisName = analysisFiles[analysisInd];
                    }
                    else
                    {
                        analysisName = analysisName + " , " + analysisFiles[analysisInd];
                    }
                }

                Console.WriteLine(e.StackTrace);
            }
            return(null);
        }