2 using System.Collections.Generic;
4 using Seci.Definitions;
6 namespace Seci.Standard
21 internal static String FilePath {
get {
return _filePath; } }
26 internal static void Initialise()
28 _filePath = Status.DaeMonitorVI;
31 LabView.LabViewApp.LoadVI(_filePath,
true);
32 LabView.LabViewApp.StartVI(_filePath);
39 internal static void ShowVi()
41 LabView.LabViewApp.ShowVI(_filePath);
47 internal static void HideVi()
49 LabView.LabViewApp.HideVI(_filePath);
60 for (
int i = 0; i < Managers.BlockMgr.Blocks.Count; ++i)
62 if (!String.IsNullOrEmpty(Managers.BlockMgr.Blocks[i].Alias))
68 String[,] values1 =
new String[Managers.BlockMgr.Blocks.Count + nAlias, 15];
72 for (
int i = 0; i < Managers.BlockMgr.Blocks.Count; ++i)
74 createEntry(Managers.BlockMgr.Blocks[i], entryIndex, ref values1,
false);
77 if (!String.IsNullOrEmpty(Managers.BlockMgr.Blocks[i].Alias))
79 createEntry(Managers.BlockMgr.Blocks[i], entryIndex, ref values1,
true);
86 LabView.LabViewApp.SetRawValue(_filePath,
"Parameter details", values1);
97 array[i, 0] = block.BlockName;
101 array[i, 0] = block.Alias;
104 array[i, 1] = block.ParentVI;
108 array[i, 2] = block.ReadControl.Substring(0, block.ReadControl.LastIndexOf(
" ("));
112 array[i, 2] = block.ReadControl;
119 array[i, 3] = block.WriteControl.Substring(0, block.WriteControl.LastIndexOf(
" ("));
123 array[i, 3] = block.WriteControl;
128 array[i, 3] =
"none";
135 array[i, 4] = block.GoButton.Substring(0, block.GoButton.LastIndexOf(
" ("));
139 array[i, 4] = block.GoButton;
144 array[i, 4] =
"none";
149 array[i, 7] = Convert.ToInt16(block.UnderRunControl).ToString();
153 array[i, 8] = block.RunControlValue;
158 array[i, 8] = block.LowerLimit.ToString();
159 array[i, 9] = block.UpperLimit.ToString();
165 array[i, 11] = block.BlockName;
168 array[i, 13] = block.BlockUnits;
169 array[i, 14] = block.WaitForControl;
176 internal static void UpdateBlockValues()
178 String[,] values1 =
new String[Managers.BlockMgr.Blocks.Count, 2];
180 for (
int i = 0; i < Managers.BlockMgr.Blocks.Count; ++i)
182 values1[i, 0] = Managers.BlockMgr.Blocks[i].BlockName;
183 values1[i, 1] = Managers.BlockMgr.Blocks[i].CurrentValue;
188 LabView.LabViewApp.SetRawValue(_filePath,
"Control values", values1);
205 Low = Double.NegativeInfinity;
206 High = Double.PositiveInfinity;
215 rb.UnderRC = Convert.ToBoolean(Convert.ToInt16(vals[i, 7]));
217 if (isNumeric ==
true)
219 Double low = Double.NegativeInfinity;
220 Double high = Double.PositiveInfinity;
221 if (Double.TryParse(vals[i, 8].ToString(), out low))
228 rb.Low = Double.NegativeInfinity;
231 if (Double.TryParse(vals[i, 9].ToString(), out high))
238 rb.High = Double.PositiveInfinity;
241 else if (isNumeric ==
false)
243 rb.StringLimit = vals[i, 8].ToString();
248 Double low = Double.NegativeInfinity;
249 Double high = Double.PositiveInfinity;
250 if (Double.TryParse(vals[i, 8].ToString(), out low) && Double.TryParse(vals[i, 9].ToString(), out high))
258 rb.StringLimit = vals[i, 8].ToString();
270 internal static void GetRunControlSettings()
274 Object[,] vals = (Object[,])LabView.LabViewApp.GetRawValue(_filePath,
"Parameter details");
275 bool? isNumeric = null;
276 Boolean updateTable =
false;
280 for (
int i = 0; i < vals.GetLength(0); ++i)
282 if (blocks.
Contains(vals[i, 0].ToString()))
284 BlockInfo block = blocks[vals[i, 0].ToString()];
285 bool blockChanged =
false;
286 ReadbackValues rb =
new ReadbackValues();
291 rb = extractInformation(vals, i,
true);
295 block.UnderRunControl = rb.UnderRC;
301 block.LowerLimit = rb.Low;
307 block.UpperLimit = rb.High;
315 rb = extractInformation(vals, i,
false);
319 block.UnderRunControl = rb.UnderRC;
325 block.RunControlValue = rb.StringLimit;
331 rb = extractInformation(vals, i, null);
335 block.UnderRunControl = rb.UnderRC;
339 if (!String.IsNullOrEmpty(rb.StringLimit) && block.RunControlValue != rb.StringLimit)
341 block.RunControlValue = rb.StringLimit;
348 block.LowerLimit = rb.Low;
349 block.UpperLimit = rb.High;
360 if (!String.IsNullOrEmpty(blocks[vals[i, 0].ToString()].Alias))
364 bool aliasChanged =
false;
367 if (i < vals.GetLength(0))
369 ReadbackValues rba = extractInformation(vals, i, isNumeric);
373 block.UnderRunControl = rba.UnderRC;
377 if (isNumeric ==
true)
381 block.LowerLimit = rba.Low;
387 block.UpperLimit = rba.High;
391 else if (isNumeric ==
false)
395 block.RunControlValue = rba.StringLimit;
401 if (!String.IsNullOrEmpty(rba.StringLimit) && block.RunControlValue != rba.StringLimit)
403 block.RunControlValue = rba.StringLimit;
410 block.LowerLimit = rba.Low;
411 block.UpperLimit = rba.High;
Boolean Contains(String blockName)
Wrapper for standard Dictionary "Contains" All keys are lowercase.
static void WriteBlockList()
Method for writing the relevant block settings to the VI. This is for Open GENIE's GetBlocks command...
This class is used for storing the information for any blocks that are created and provides methods f...
static void createEntry(BlockInfo block, int i, ref String[,] array, Boolean isAlias)
static ReadbackValues extractInformation(Object[,] vals, int i, bool?isNumeric)
Specialised version of the Dictionary class which can be converted to XML. Also has some additional s...
This class is a wrapper for the DAE Monitor VI. The DAE Monitor VI is where SECI puts the block setti...