public void runExperiments() { if (m_shepherdViewModel.herdAgentList.Count == 0) { CaliburnUtility.showWarningDialog("No Herd agents were detected, so experiments cannot be sent. Consider starting the local agent: \"net start HerdAgent\"", "No agents detected"); return; } string batchFilename = ""; List <Experiment> experiments = new List <Experiment>(); experiments = SimionFileData.saveExperimentBatchFile(tabControlExperiments, ref batchFilename, logToFile); if (experiments != null && experiments.Count > 0) { List <HerdAgentViewModel> freeHerdAgents = new List <HerdAgentViewModel>(); logToFile("Running experiment queue remotely: " + experiments.Count + " experiments"); //get available herd agents list. Inside the loop to update the list shepherdViewModel.getAvailableHerdAgents(ref freeHerdAgents); logToFile("Using " + freeHerdAgents.Count + " agents"); MonitorWindowViewModel monitorVM = new MonitorWindowViewModel(freeHerdAgents, experiments, logToFile, batchFilename); monitorVM.runExperiments(true, true); CaliburnUtility.showVMDialog(monitorVM, "Experiment execution monitor"); } }
public void saveExperimentInEditor() { if (selectedTabControlExperiment == null || !selectedTabControlExperiment.validate()) { CaliburnUtility.showWarningDialog("The app can't be validated. See error log.", "Error"); return; } SimionFileData.saveExperiment(selectedTabControlExperiment); }
//BADGER files public void loadExperiments() { SimionFileData.loadExperiments(this, ref m_appViewModels, appDefinitions, logToFile); NotifyOfPropertyChange(() => tabControlExperiments); NotifyOfPropertyChange(() => listControlExperiments); if (m_appViewModels.Count > 0) { selectedTabControlExperiment = m_appViewModels[0]; } checkEmptyExperimentList(); }
public void loadExperiment() { AppViewModel newApp = SimionFileData.loadExperiment(this, appDefinitions); if (newApp != null) { tabControlExperiments.Add(newApp); checkEmptyExperimentList(); selectedTabControlExperiment = newApp; } }
private void batchNodeLoadFunction(XmlNode node) { string experimentName = node.Attributes[XMLConfig.nameAttribute].Value; string experimentFilePath = node.Attributes[XMLConfig.pathAttribute].Value; string logDescFile = SimionFileData.getLogDescriptorsFilePath(experimentFilePath); string logFile = SimionFileData.getLogFilePath(experimentFilePath); if (File.Exists(logDescFile) && File.Exists(logFile)) { ExperimentLogViewModel newLog = new ExperimentLogViewModel(experimentName, logDescFile, logFile, this); experimentLogs.Add(newLog); newLog.bIsSelected = true; } }
/// <summary> /// Load an experiment from a batch file. If <paramref name="batchFileName"/> is either /// null or empty, a dialog window will be opened to let the user select a batch file. /// </summary> /// <param name="batchFileName">The name of the file to load</param> public void LoadExperimentBatch(string batchFileName) { //Ask the user for the name of the batch if (string.IsNullOrEmpty(batchFileName)) { bool bSuccess = SimionFileData.OpenFileDialog(ref batchFileName , SimionFileData.ExperimentBatchDescription, SimionFileData.ExperimentBatchFilter); if (!bSuccess) { return; } } //reset the view and the query if a batch was succesfully selected ClearReportViewer(); Query.OnExperimentBatchLoaded(); //Inefficient but not so much as to care //First we load the batch file to cout how many experimental units we have StartLongOperation(); LoadedBatch = "Reading batch file"; m_numExperimentalUnits = SimionFileData.LoadExperimentBatchFile(batchFileName , SimionFileData.CountExperimentalUnitsInBatch); Task.Run(() => { //load the batch LoadedBatch = "Reading experiment files"; SimionFileData.LoadExperimentBatchFile(batchFileName, LoadLoggedExperiment, OnExperimentalUnitProcessed); //Update flags use to enable/disable parts of the report generation menu NotifyOfPropertyChange(() => ForksLoaded); NotifyOfPropertyChange(() => VariablesLoaded); LoadedBatch = batchFileName; LogsLoaded = true; EndLongOperation(); }); }
public void loadExperimentBatch(string batchFileName) { SimionFileData.loadExperimentBatch(batchNodeLoadFunction, batchFileName); }
public void loadExperimentBatch() { SimionFileData.loadExperimentBatch(batchNodeLoadFunction); }
public void saveExperiments() { SimionFileData.saveExperiments(m_appViewModels); }