2 using System.Collections;
3 using System.Collections.Generic;
6 namespace Seci.LabView.Controls
26 public LvRing(String name, String[] items, SerialisableList<int> indices)
34 _clusterIndices = (Seci.SerialisableList<
int>)indices.Clone();
44 return _name +
" (Ring)";
60 public override String[]
GetValue(ref strongnameLabview.VirtualInstrument vi)
64 if (_clusterIndices == null)
68 temp = _items[Convert.ToInt16(vi.GetControlValue(_name))];
72 temp = vi.GetControlValue(_name).ToString();
79 temp = _items[Convert.ToInt16(GetValueFromCluster(vi)[_clusterIndices[_clusterIndices.Count - 1]])];
83 temp = GetValueFromCluster(vi)[_clusterIndices[_clusterIndices.Count - 1]].ToString();
88 String[] result = { temp };
101 public override void SetValue(ref strongnameLabview.VirtualInstrument vi, Object value)
106 if (value.GetType() == typeof(Int16))
108 val = Convert.ToInt16(value);
110 else if (value.GetType() == typeof(String))
112 for (
int i = 0; i < _items.GetLength(0); ++i)
114 if (_items[i] == value.ToString())
124 throw new ArgumentException(
"Value sent to ring was invalid.");
127 if (_clusterIndices == null)
129 vi.SetControlValue(_name, val);
133 SetValueInCluster(ref vi, val);
This class inherits from LVControl class and is specialised for Ring controls. A Ring is like an enum...
override String[] GetValue(ref strongnameLabview.VirtualInstrument vi)
Overriden method for getting the current selected value of the Control. LabVIEW returns an int corres...
override String GetNameAndType()
Overriden method which return the name and type of the control.
override void SetValue(ref strongnameLabview.VirtualInstrument vi, Object value)
Overriden method for setting the selected value in the Control. The value received could be a String ...
override String GetControlType()
String[] _items
Stores the values of the selectable options.
This class is the abstract base class of the objects used to store the VI control information...
LvRing(String name, String[] items, SerialisableList< int > indices)
Constructor