SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
LVArray.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 
5 namespace Seci.LabView.Controls
6 {
12  {
18  public LvArray(String name, SerialisableList<int> indices)
19  {
20  _name = name;
21 
22  if (indices != null)
23  {
24  _clusterIndices = (Seci.SerialisableList<int>)indices.Clone();
25  }
26  }
27 
32  public override String GetNameAndType()
33  {
34  return _name + " (Array)";
35  }
36 
37  public override String GetControlType()
38  {
39  return "ARRAY";
40  }
41 
47  public override String[] GetValue(ref strongnameLabview.VirtualInstrument vi)
48  {
49  if (_clusterIndices == null)
50  {
51  object value = vi.GetControlValue(_name);
52 
53  Type arrType = value.GetType();
54  if (arrType.Name == "Double[]")
55  {
56  Double[] vals = value as Double[];
57  string[] array = Array.ConvertAll<Double, string>(vals, delegate(Double obj) { return obj.ToString(); } );
58  return array;
59  }
60 
61  return (String[]) value;
62  }
63  else
64  {
65  return (String[])GetValueFromCluster(vi)[_clusterIndices[_clusterIndices.Count - 1]];
66  }
67  }
68 
74  public override void SetValue(ref strongnameLabview.VirtualInstrument vi, Object value)
75  {
76  if (_clusterIndices == null)
77  {
78  vi.SetControlValue(_name, value);
79  }
80  else
81  {
82  SetValueInCluster(ref vi, value);
83  }
84  }
85  }
86 }
override String[] GetValue(ref strongnameLabview.VirtualInstrument vi)
Overriden method for getting the values in the Array Control.
Definition: LVArray.cs:47
override String GetNameAndType()
Overriden method which return the name and type of the control.
Definition: LVArray.cs:32
This class inherits from LVControl class and is specialised for reading and writing to LabVIEW array ...
Definition: LVArray.cs:11
override String GetControlType()
Definition: LVArray.cs:37
LvArray(String name, SerialisableList< int > indices)
Constructor
Definition: LVArray.cs:18
override void SetValue(ref strongnameLabview.VirtualInstrument vi, Object value)
Overriden method for setting the values in the Array Control.
Definition: LVArray.cs:74
This class is the abstract base class of the objects used to store the VI control information...
Definition: LVControl.cs:12