/// <summary> /// Method called from the view. This clear every list and field. Should be called when /// we load a new experiment if one is already loaded or when we hit the delete button /// from the view. /// </summary> public void ClearReportViewer() { ExperimentalUnits.Clear(); LoggedExperiments.Clear(); Reports.Clear(); NotifyOfPropertyChange(() => VariablesLoaded); NotifyOfPropertyChange(() => ForksLoaded); Query.Reset(); CanSaveReports = false; LogsLoaded = false; ForksLoaded = false; }
/// <summary> /// Method called from the view. This clear every list and field. Should be called when /// we load a new experiment if one is already loaded or when we hit the delete button /// from the view. /// </summary> public void ClearReportViewer() { ExperimentalUnits.Clear(); LoggedExperiments.Clear(); LogQueryResults.Clear(); NotifyOfPropertyChange(() => VariablesLoaded); NotifyOfPropertyChange(() => ForksLoaded); Query = new LogQueryViewModel(); //Add the listening function to the LogQuery object with all the parameters Query.PropertyChanged += OnChildPropertyChanged; LogsLoaded = false; ForksLoaded = false; }
/// <summary> /// Initializes the experiments to be monitored through a batch file that /// contains all required data for the task. /// </summary> /// <param name="batchFileName">The batch file with experiment data</param> public bool LoadExperimentBatch(string batchFileName) { //Load unfinished experiments LoadOptions loadOptionsUnfinished = new LoadOptions() { Selection = LoadOptions.ExpUnitSelection.OnlyUnfinished, LoadVariablesInLog = false }; ExperimentBatch batchUnfinished = new ExperimentBatch(); batchUnfinished.Load(batchFileName, loadOptionsUnfinished); LoggedExperiments.Clear(); foreach (Experiment experiment in batchUnfinished.Experiments) { LoggedExperimentViewModel newExperiment = new LoggedExperimentViewModel(experiment); LoggedExperiments.Add(newExperiment); } //count unfinished experiments int numUnfinishedExperimentalUnits = batchUnfinished.CountExperimentalUnits(); //load all experimental units and count them LoadOptions loadOptionsFinished = new LoadOptions() { Selection = LoadOptions.ExpUnitSelection.OnlyFinished, LoadVariablesInLog = false }; //we use a temp variable first to get the count of finished units so that setting the value of NumFinishedExperimentalUnitsBeforeStart triggers the progress update //AFTER setting the value of NumExperimentalUnits NumFinishedExperimentalUnitsBeforeStart = ExperimentBatch.CountExperimentalUnits(batchFileName, LoadOptions.ExpUnitSelection.OnlyFinished); NumExperimentalUnits = numUnfinishedExperimentalUnits + NumFinishedExperimentalUnitsBeforeStart; NumFinishedExperimentalUnitsAfterStart = 0; //Initialize pending experiment list m_pendingExperiments.Clear(); foreach (var experiment in LoggedExperiments) { foreach (AppVersion version in experiment.AppVersions) { if (!ExistsRequiredFile(version.ExeFile)) { CaliburnUtility.ShowWarningDialog("Cannot find required file: " + version.ExeFile + ". Check the app definition file in /config/apps", "ERROR"); return(false); } foreach (string pre in version.Requirements.InputFiles) { if (!ExistsRequiredFile(pre)) { CaliburnUtility.ShowWarningDialog("Cannot find required file: " + pre + ". Check the app definition file in /config/apps", "ERROR"); return(false); } } } foreach (LoggedExperimentalUnitViewModel unit in experiment.ExperimentalUnits) { m_pendingExperiments.Add(unit.Model); } } BatchFileName = batchFileName; Plot.ClearLineSeries(); AllMonitoredJobs.Clear(); IsBatchLoaded = true; IsRunning = false; return(true); }