コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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;
 }
コード例 #5
0
 /// <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;
     }
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 public ModeControl(int newModeID)
 {
     Mode     = new SequenceMode(newModeID);
     Selected = false;
     Delay    = new DimensionedParameter(Units.s, 0);
 }