public static string applySequenceMode(SequenceData sequence, SequenceMode genre) { string ans = ""; foreach (TimeStep step in sequence.TimeSteps) { if (!genre.TimestepEntries.ContainsKey(step)) { ans += "No mode entry for [" + step.StepName + "]. "; } else { step.StepHidden = genre.TimestepEntries[step].StepHidden; step.StepEnabled = genre.TimestepEntries[step].StepEnabled; } } if (ans == "") { return(null); } else { return(ans); } }
private static bool CompareSequenceModes(string preString, SequenceMode a, SequenceMode b, List <SequenceDifference> ans) { bool diffs = false; diffs |= CompareStrings(preString + "mode name ", a.ModeName, b.ModeName, ans); diffs |= CompareDictionaries <TimeStep, SequenceMode.ModeEntry>(preString + "mode entries ", a.TimestepEntries, b.TimestepEntries, ans, CompareSequenceModeEntry); return(diffs); }
public static SequenceMode createSequenceMode(SequenceData sequence) { SequenceMode ans = new SequenceMode(); foreach (TimeStep step in sequence.TimeSteps) { ans.TimestepEntries.Add(step, new ModeEntry(step.StepEnabled, step.StepHidden)); } return(ans); }
public static string applySequenceMode(SequenceData sequence, SequenceMode genre) { string ans = ""; foreach (TimeStep step in sequence.TimeSteps) { if (!genre.TimestepEntries.ContainsKey(step)) { ans += "No mode entry for [" + step.StepName + "]. "; } else { step.StepHidden = genre.TimestepEntries[step].StepHidden; step.StepEnabled = genre.TimestepEntries[step].StepEnabled; } } if (ans == "") return null; else return ans; }
/// <summary> /// Used for thread safe changing of selected mode. Called from RunForm. /// </summary> /// <param name="mode"></param> public void setMode(SequenceMode mode) { if (this.InvokeRequired) { this.Invoke(new voidMode(setMode), new object[] { mode }); } else { modeBox.SelectedItem = mode; } }
/// <summary> /// Used for thread safe changing of selected mode. Called from RunForm. /// </summary> /// <param name="mode"></param> public void setMode(SequenceMode mode) { Action setItem = () => modeBox.SelectedItem = mode; Invoke(setItem); }
public static SequenceMode createSequenceMode(SequenceData sequence) { SequenceMode ans = new SequenceMode(); foreach (TimeStep step in sequence.TimeSteps) { ans.TimestepEntries.Add(step, new ModeEntry(step.StepEnabled, step.StepHidden)); } return ans; }
public ModeControl(int newModeID) { Mode = new SequenceMode(newModeID); Selected = false; Delay = new DimensionedParameter(Units.s, 0); }