SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Seci.LabView.LabViewPanel Class Reference

This class contains the reference to the LabVIEW VI and keeps a list of all the front panel controls. There are methods for getting and setting control values on the panel. More...

Collaboration diagram for Seci.LabView.LabViewPanel:
Collaboration graph

Public Member Functions

String GetControlType (String name)
 
String[] getControlValue (String controlName)
 Method for retrieving a value from a control. Only returns values for controls inside the dictionary. If the control is in a cluster the name of the control is of the form: "clustername:controlname". More...
 
void GetFrontPanelTitle (strongnameLabview.VirtualInstrument exporter, String fileName)
 Gets the title of the front panel More...
 
List< String > getListOfControls ()
 Method for requesting a list of the controls on the front panel of this VI. More...
 
Object getRawControlValue (String controlName)
 Method for return a control value straight from DCOM with no clean-up. The control does not have to be present inside the controls dictionary. More...
 
void getVIControls (strongnameLabview.VirtualInstrument exporter, String fileName, Boolean includeClusters)
 The method that initialises the finding of the controls on the front panel. The controls are read from an XML file which is outputted by a VI designed for this purpose. In versions of LabVIEW before 8.0 it was possible to produce this file via a DCOM call, but this functionality was removed. More...
 
Object[] getWholeCluster (string clusterName)
 Method for grabbing a whole cluster directly from LabVIEW. No formatting or checking applied. Cluster are not stored in the dictionary as they are not required for blocks. More...
 
 LabViewPanel (strongnameLabview.VirtualInstrument VI)
 Constructor More...
 
void setControlValue (String controlName, Object value)
 Method for setting a control value. Only sets values for controls inside the dictionary. If the control is in a cluster the name of the control is of the form: "clustername:controlname". More...
 
void setRawControlValue (String controlName, Object value)
 Method for setting a control value via DCOM with no checks from SECI. The control does not have to be present inside the controls dictionary. More...
 
void setWholeCluster (string clusterName, Object[] values)
 Method for setting a whole cluster directly. No formatting or checking applied. Cluster are not stored in the dictionary as they are not required for blocks. More...
 

Properties

String FrontPanelTitle [get]
 
strongnameLabview.VirtualInstrument VI [get]
 

Private Member Functions

void AddControlToDictionary (Controls.LvControl newControl)
 Method for adding controls to the control dictionary More...
 
void addListbox (StreamReader sr, String boxName, SerialisableList< int > clusterIndices)
 Method for adding a Listbox control to the dictionary. A Listbox is like a enum; however the enum data is present in the XML, so it can be stored as a ring. This control is rarely used. More...
 
void addRadioButton (StreamReader sr, String radioName, SerialisableList< int > clusterIndices)
 Method for adding a Radio Button control to the dictionary. Radio buttons only return the index of the selected option, so it is necessary to keep a list of the possible options. More...
 
void addRing (StreamReader sr, String ringName, SerialisableList< int > clusterIndices)
 Method for adding a Ring control to the dictionary. A Ring is like an enum, but it does not have to return a number value. More...
 
void addSimpleControl (StreamReader sr, String name, String type, SerialisableList< int > clusterIndices)
 Method for adding simple controls to the controls dictionary. Used for Numerics, Booleans, Strings, Enums and Arrays. More...
 
void extractVIControls (String fileName, Boolean includeClusters)
 Main method for extracting the control information from the XML file that was produced by the exportVIControls method. The XML produced contains a lot of information that is not required by SECI and it is quite hard to read. It was felt that simplest way to extract the required information was to read the file in line by line. The controls start with CONTROL ID and it is possible for them to be nested. Warning: this code is quite hard to follow and it contains some nasty workrounds. More...
 
void getClusterInfo (StreamReader sr, String clusterName, SerialisableList< int > clusterList, Boolean includeClusters)
 Method for getting the information from a cluster. A cluster is a container for other types of control and can be nested inside another cluster. The controls inside a cluster are referred to by their index number, not their names. There is a recursive call to this function for clusters within clusters. More...
 

Static Private Member Functions

static void exportVIControls (strongnameLabview.VirtualInstrument exporter, String fileName, String saveFile)
 Method for extracting the control information from the VI. Uses an intermediate VI for saving the information as XML. More...
 
static String findControlName (String line)
 Method for extracting the control name. More...
 
static String findControlType (String line)
 Method for determining the control type and what it should be treated as. More...
 

Private Attributes

Dictionary< String,
Controls.LvControl
_controls
 Dictionary for containing the VI's control information. The control's name is the key. More...
 
String _frontPanelTitle
 
strongnameLabview.VirtualInstrument _VI
 The reference to the actual VI More...
 

Detailed Description

This class contains the reference to the LabVIEW VI and keeps a list of all the front panel controls. There are methods for getting and setting control values on the panel.

Definition at line 13 of file LabViewPanel.cs.

Constructor & Destructor Documentation

Seci.LabView.LabViewPanel.LabViewPanel ( strongnameLabview.VirtualInstrument  VI)
inline

Constructor

Parameters
VIThe VI

Definition at line 35 of file LabViewPanel.cs.

Member Function Documentation

void Seci.LabView.LabViewPanel.AddControlToDictionary ( Controls.LvControl  newControl)
inlineprivate

Method for adding controls to the control dictionary

Parameters
newControlThe control to add

Definition at line 559 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.addListbox ( StreamReader  sr,
String  boxName,
SerialisableList< int >  clusterIndices 
)
inlineprivate

Method for adding a Listbox control to the dictionary. A Listbox is like a enum; however the enum data is present in the XML, so it can be stored as a ring. This control is rarely used.

Parameters
srThe stream reader used to read the xml file
boxNameThe name of the Listbox
clusterIndicesThe control may be part of a cluster or clusters, these indices indicate where in the cluster this control occurs

Definition at line 512 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.addRadioButton ( StreamReader  sr,
String  radioName,
SerialisableList< int >  clusterIndices 
)
inlineprivate

Method for adding a Radio Button control to the dictionary. Radio buttons only return the index of the selected option, so it is necessary to keep a list of the possible options.

Parameters
srThe stream reader used to read the xml file
radioNameThe name of the Radio Button control
clusterIndicesThe control may be part of a cluster or clusters, these indices indicate where in the cluster this control occurs.

Definition at line 584 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.addRing ( StreamReader  sr,
String  ringName,
SerialisableList< int >  clusterIndices 
)
inlineprivate

Method for adding a Ring control to the dictionary. A Ring is like an enum, but it does not have to return a number value.

Parameters
srThe stream reader used to read the xml file
ringNameThe name of the Ring
clusterIndicesThe control may be part of a cluster or clusters, these indices indicate where in the cluster this control occurs

Definition at line 459 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.addSimpleControl ( StreamReader  sr,
String  name,
String  type,
SerialisableList< int >  clusterIndices 
)
inlineprivate

Method for adding simple controls to the controls dictionary. Used for Numerics, Booleans, Strings, Enums and Arrays.

Parameters
srThe stream reader used to read the xml file
nameThe name of the control
typeThe type of the control
clusterIndicesThe control may be part of a cluster or clusters, these indices indicate where in the cluster this control occurs.

Definition at line 375 of file LabViewPanel.cs.

static void Seci.LabView.LabViewPanel.exportVIControls ( strongnameLabview.VirtualInstrument  exporter,
String  fileName,
String  saveFile 
)
inlinestaticprivate

Method for extracting the control information from the VI. Uses an intermediate VI for saving the information as XML.

Parameters
exporterThe VI that is used to export the controls on a VI
fileNameThe full filepath of the VI
saveFileThe file to save the XML to

Definition at line 95 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.extractVIControls ( String  fileName,
Boolean  includeClusters 
)
inlineprivate

Main method for extracting the control information from the XML file that was produced by the exportVIControls method. The XML produced contains a lot of information that is not required by SECI and it is quite hard to read. It was felt that simplest way to extract the required information was to read the file in line by line. The controls start with CONTROL ID and it is possible for them to be nested. Warning: this code is quite hard to follow and it contains some nasty workrounds.

Parameters
fileNameThe full filepath of the XML file
includeClustersWhether to include clusters

Definition at line 122 of file LabViewPanel.cs.

static String Seci.LabView.LabViewPanel.findControlName ( String  line)
inlinestaticprivate

Method for extracting the control name.

Parameters
lineThe line of text extracted from the file
Returns
String listing the control type - returns null if name not found

Definition at line 350 of file LabViewPanel.cs.

static String Seci.LabView.LabViewPanel.findControlType ( String  line)
inlinestaticprivate

Method for determining the control type and what it should be treated as.

Parameters
lineThe line of text extracted from the file
Returns
String listing the control type - returns null if it does not recognise the type

Definition at line 264 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.getClusterInfo ( StreamReader  sr,
String  clusterName,
SerialisableList< int >  clusterList,
Boolean  includeClusters 
)
inlineprivate

Method for getting the information from a cluster. A cluster is a container for other types of control and can be nested inside another cluster. The controls inside a cluster are referred to by their index number, not their names. There is a recursive call to this function for clusters within clusters.

Parameters
srThe stream reader used to read the xml file
clusterNameThe name of the cluster
clusterListThe cluster may be part of another cluster or clusters, these indices
Parameters
includeClustersSets whether to include clusters
indicate where in the cluster this cluster occurs.

Definition at line 631 of file LabViewPanel.cs.

String Seci.LabView.LabViewPanel.GetControlType ( String  name)
inline

Definition at line 764 of file LabViewPanel.cs.

String [] Seci.LabView.LabViewPanel.getControlValue ( String  controlName)
inline

Method for retrieving a value from a control. Only returns values for controls inside the dictionary. If the control is in a cluster the name of the control is of the form: "clustername:controlname".

Parameters
controlNameThe name of the control
Returns
String array because the control may be an array

Definition at line 786 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.GetFrontPanelTitle ( strongnameLabview.VirtualInstrument  exporter,
String  fileName 
)
inline

Gets the title of the front panel

Parameters
exporterThe VI used to get the title
fileNameThe filepath of the VI to get the title of

Definition at line 49 of file LabViewPanel.cs.

List<String> Seci.LabView.LabViewPanel.getListOfControls ( )
inline

Method for requesting a list of the controls on the front panel of this VI.

Returns
List of Strings.

Definition at line 743 of file LabViewPanel.cs.

Object Seci.LabView.LabViewPanel.getRawControlValue ( String  controlName)
inline

Method for return a control value straight from DCOM with no clean-up. The control does not have to be present inside the controls dictionary.

Parameters
controlNameThe name of the control
Returns
An Object

Definition at line 808 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.getVIControls ( strongnameLabview.VirtualInstrument  exporter,
String  fileName,
Boolean  includeClusters 
)
inline

The method that initialises the finding of the controls on the front panel. The controls are read from an XML file which is outputted by a VI designed for this purpose. In versions of LabVIEW before 8.0 it was possible to produce this file via a DCOM call, but this functionality was removed.

Parameters
exporterThe VI that is used to export the controls on a VI
fileNameThe full filepath of the VI
includeClustersWhether to include clusters

Definition at line 68 of file LabViewPanel.cs.

Object [] Seci.LabView.LabViewPanel.getWholeCluster ( string  clusterName)
inline

Method for grabbing a whole cluster directly from LabVIEW. No formatting or checking applied. Cluster are not stored in the dictionary as they are not required for blocks.

Parameters
clusterNameThe name of the cluster
Returns
Object array

Definition at line 830 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.setControlValue ( String  controlName,
Object  value 
)
inline

Method for setting a control value. Only sets values for controls inside the dictionary. If the control is in a cluster the name of the control is of the form: "clustername:controlname".

Parameters
controlNameThe name of the control
valueThe value to set

Definition at line 857 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.setRawControlValue ( String  controlName,
Object  value 
)
inline

Method for setting a control value via DCOM with no checks from SECI. The control does not have to be present inside the controls dictionary.

Parameters
controlNameThe name of the control
valueThe value to set

Definition at line 871 of file LabViewPanel.cs.

void Seci.LabView.LabViewPanel.setWholeCluster ( string  clusterName,
Object[]  values 
)
inline

Method for setting a whole cluster directly. No formatting or checking applied. Cluster are not stored in the dictionary as they are not required for blocks.

Parameters
clusterNameThe name of the cluster
valuesThe cluster values

Definition at line 884 of file LabViewPanel.cs.

Member Data Documentation

Dictionary<String, Controls.LvControl> Seci.LabView.LabViewPanel._controls
private

Dictionary for containing the VI's control information. The control's name is the key.

Definition at line 23 of file LabViewPanel.cs.

String Seci.LabView.LabViewPanel._frontPanelTitle
private

Definition at line 25 of file LabViewPanel.cs.

strongnameLabview.VirtualInstrument Seci.LabView.LabViewPanel._VI
private

The reference to the actual VI

Definition at line 18 of file LabViewPanel.cs.

Property Documentation

String Seci.LabView.LabViewPanel.FrontPanelTitle
get

Definition at line 29 of file LabViewPanel.cs.

strongnameLabview.VirtualInstrument Seci.LabView.LabViewPanel.VI
get

Definition at line 28 of file LabViewPanel.cs.


The documentation for this class was generated from the following file: