Esempio n. 1
0
        private void PopulateAnalysisPanels(AnalysisAction action, EventGenerator eg)
        {
            TreeNode node = SitesTreeView.SelectedNode;

            DataSourceTabControl.TabPages.Clear();
            for (int i = 0; i < action.GetDataCompilers().Count; ++i)
            {
                PopulateDataSourceTab(action, i);
            }

            selectedActionChannel = action.GetChannels()[0];
            DataCompilerPanel1.ChannelComboBox.Text     = action.GetChannels()[0].Name;
            AnalysisCommandTextBox.Text                 = action.GetAnalysis().GetCommand();
            DataCompilerPanel1.CompiledFileTextBox.Text = action.GetCompiledFileName();
            ResultFileTextBox.Text = action.GetAnalysis().GetResultsFile();
            if (action.GetAnalysis().GetResultParser() is FRAMPlutoniumResultParser)
            {
                ResultParserComboBox.Text = "FRAM-Pu";
            }
            else if (action.GetAnalysis().GetResultParser() is FRAMUraniumResultParser)
            {
                ResultParserComboBox.Text = "FRAM-U";
            }
        }
Esempio n. 2
0
        private void PopulateDataSourceTab(AnalysisAction action, int compiler)
        {
            DetectionSystem sys = (DetectionSystem)action.GetEventGenerator().GetEventWatcher();

            DataSourceTabControl.TabPages.Add("Data Source " + (compiler + 1).ToString());
            DataCompilerPanel compilerPanel = new DataCompilerPanel();

            compilerPanel.Dock = DockStyle.Fill;
            DataSourceTabControl.TabPages[compiler].Controls.Add(compilerPanel);

            compilerPanel.ChannelComboBox.Items.Clear();
            foreach (Instrument inst in sys.GetInstruments())
            {
                foreach (Channel ch in inst.GetChannels())
                {
                    compilerPanel.ChannelComboBox.Items.Add(ch.Name);
                }
            }
            compilerPanel.ChannelComboBox.Text = action.GetChannels()[compiler].Name;
        }
Esempio n. 3
0
        private void SaveAction(EventGenerator eg, Action action)
        {
            TreeNode        node         = SitesTreeView.SelectedNode;
            DetectionSystem eventWatcher = (DetectionSystem)node.Parent.Tag;
            DetectionSystem sys          = (DetectionSystem)eventWatcher;

            if (action.Name != ActionsComboBox.Text && siteMan.ContainsName(ActionsComboBox.Text))
            {
                MessageBox.Show("All items in the Site Manager require a unique name!");
                return;
            }
            action.Name = ActionNameTextBox.Text;
            switch (ActionTypeComboBox.Text)
            {
            case "Analysis":
                AnalysisAction analysisAction = (AnalysisAction)action;
                analysisAction.GetChannels().Clear();
                foreach (Instrument inst in sys.GetInstruments())
                {
                    foreach (Channel ch in inst.GetChannels())
                    {
                        if (ch.Name == DataCompilerPanel1.ChannelComboBox.Text)
                        {
                            analysisAction.AddChannel(ch);
                            break;
                        }
                    }
                }
                analysisAction.GetDataCompilers().Clear();
                switch (DataCompilerPanel1.DataCompilersComboBox.Text)
                {
                case "Spectrum Compiler":
                    analysisAction.GetDataCompilers().Add(new SpectrumCompiler("", new CHNParser(), new CHNWriter()));
                    break;

                case "File List":
                    analysisAction.GetDataCompilers().Add(new FileListCompiler(""));
                    break;

                default:
                    MessageBox.Show("Invalid data compiler type!");
                    return;
                }
                analysisAction.GetAnalysis().SetCommand(AnalysisCommandTextBox.Text);
                analysisAction.SetCompiledFileName(DataCompilerPanel1.CompiledFileTextBox.Text);
                switch (ResultParserComboBox.Text)
                {
                case "FRAM-Pu":
                    analysisAction.GetAnalysis().SetResultParser(new FRAMPlutoniumResultParser());
                    break;

                case "FRAM-U":
                    analysisAction.GetAnalysis().SetResultParser(new FRAMUraniumResultParser());
                    break;

                default:
                    MessageBox.Show("Invalid result parser type!");
                    return;
                }
                analysisAction.GetAnalysis().SetResultsFile(ResultFileTextBox.Text);
                break;

            case "Command":
                ((CommandAction)action).SetCommand(ActionCommandTextBox.Text);
                break;

            default:
                MessageBox.Show("Invalid action type!");
                return;
            }
        }