2 using System.Collections;
3 using System.Collections.Generic;
7 using System.Xml.Serialization;
9 namespace Sample_Environment_Control_Interface
24 private List<Group>
_groups =
new List<Group>();
27 private Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_RunInfo>
_runInfos
28 =
new Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_RunInfo>();
31 private Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_BlockViewer>
_blockViewers
32 =
new Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_BlockViewer>();
35 private Seci.SerialisableList<SECI_Controls.Graph.SECI_Graph>
_graphs
36 =
new Seci.SerialisableList<SECI_Controls.Graph.SECI_Graph>();
40 get {
return _groups.ToArray(); }
41 set { _groups.Clear(); _groups.AddRange(value); }
44 public Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_RunInfo>
RunInfos
47 public Seci.SerialisableList<SECI_Controls.Run_Information.Scaling_BlockViewer>
BlockViewers
50 public Seci.SerialisableList<SECI_Controls.Graph.SECI_Graph>
Graphs
60 public void Save(String fileName)
62 FileInfo fi =
new FileInfo(fileName);
64 if (fi.Exists && fi.IsReadOnly)
66 fi.IsReadOnly =
false;
70 FileStream stream =
new FileStream(fileName, FileMode.Create);
75 XmlSerializer serialize =
new XmlSerializer(typeof(
GUILayout));
76 serialize.Serialize(stream,
this);
82 throw new ArgumentException(e.Message);
89 Seci.SeciInterface.SourceSafe_SaveFile(fileName);
102 FileInfo fi =
new FileInfo(fileName);
107 FileStream stream =
new FileStream(fileName, FileMode.Open, FileAccess.Read);
111 XmlSerializer deserialize =
new XmlSerializer(typeof(
GUILayout));
112 layout = (
GUILayout)deserialize.Deserialize(stream);
118 throw new ArgumentException(e.Message);
159 for (
int i = 0; i < _groups.Count; ++i)
161 if (
_groups[i].GroupName.ToLower() == name.ToLower())
184 for (
int i = 0; i < _groups.Count; ++i)
196 for (
int i = 0; i < _groups.Count; ++i)
198 if (grpName ==
_groups[i].GroupName)
213 for (
int i = 0; i < _groups.Count; ++i)
215 _groups[i].RemoveVIMember(viName);
227 for (
int i = 0; i < _groups.Count; ++i)
229 _groups[i].RemoveVIMember(oldPath);
230 _groups[i].AddVIMember(newPath);
241 String filepath = Seci.SeciInterface.Exe_GetFilePath(progName);
243 for (
int i = 0; i < _groups.Count; ++i)
245 _groups[i].RemoveProgMember(filepath);
258 for (
int i = 0; i < _groups.Count; ++i)
260 _groups[i].RemoveInvalidMembers();
270 for (
int i = 0; i < _graphs.Count; ++i)
275 for (
int i = 0; i < _runInfos.Count; ++i)
280 for (
int i = 0; i < _blockViewers.Count; ++i)
void Save(String fileName)
Boolean GroupExists(String name)
Seci.SerialisableList< SECI_Controls.Run_Information.Scaling_BlockViewer > BlockViewers
Seci.SerialisableList< SECI_Controls.Graph.SECI_Graph > Graphs
List< Group > _groups
Stores the groups that are used to organise the VIs and programmes that are part of the configuration...
Seci.SerialisableList< SECI_Controls.Run_Information.Scaling_RunInfo > _runInfos
Serialisable container for any run information controls that are part of the layout.
void ShowGroup(String grpName)
Seci.SerialisableList< SECI_Controls.Run_Information.Scaling_RunInfo > RunInfos
void RemoveProgFromAllGroups(String progName)
void RemoveGroup(Group grp)
GUILayout Load(String fileName)
void OverWriteGroups(List< Group > newGroups)
Seci.SerialisableList< SECI_Controls.Run_Information.Scaling_BlockViewer > _blockViewers
Serialisable container for any block viewer controls that are part of the layout. ...
void RemoveVIFromAllGroups(String viName)
void ChangeVIPath(String oldPath, String newPath)
Seci.SerialisableList< SECI_Controls.Graph.SECI_Graph > _graphs
Serialisable container for any graph controls that are part of the layout.