2 using System.Collections;
3 using System.Collections.Generic;
5 using System.Runtime.Remoting;
6 using System.Runtime.Remoting.Channels;
7 using System.Runtime.Remoting.Channels.Tcp;
8 using System.Runtime.Remoting.Channels.Http;
9 using System.Runtime.InteropServices;
11 namespace Seci.Remoting
19 [GuidAttribute(
"EF9F3E43-AE19-40ea-B7DE-F21813975B8E"), ComVisible(
true)]
20 [ClassInterface(ClassInterfaceType.None)]
38 _regServices =
new RegistrationServices();
39 _cookie = _regServices.RegisterTypeForComClients(typeof(
ComInterface),
40 RegistrationClassContext.LocalServer | RegistrationClassContext.RemoteServer,
41 RegistrationConnectionType.MultipleUse);
49 _regServices.UnregisterTypeForComClients(_cookie);
53 #region IComInterface Members
59 int IComInterface.AreYouThere()
69 String IComInterface.GetBlockValueString(String blockName)
71 return Bridge.GetBlockValue(blockName);
79 String[] IComInterface.GetBlockNames(Boolean includeHidden)
81 return Bridge.GetBlockNames(includeHidden,
true);
89 object IComInterface.GetRawBlockValue(String blockname)
91 return Bridge.GetRawBlockValue(blockname);
99 object IComInterface.GetRawSetpoint(String blockname)
101 return Bridge.GetRawSetpoint(blockname);
110 Boolean IComInterface.SetRawBlockValue(String blockName, Object value)
112 return Bridge.SetRawBlockValue(blockName, value);
115 Boolean IComInterface.UnderRunControl(
string blockName)
117 return Bridge.UnderRunControl(blockName);
120 Boolean IComInterface.SetRunControl(
string blockName,
bool value)
123 Object[,] vals = (Object[,])
Bridge.
GetLabViewValue(Seci.Standard.DaeMonitor.FilePath,
"Parameter details");
126 for (
int i = 0; i < vals.GetLength(0); ++i)
128 if (vals[i, 0].ToString().ToLower() == blockName.ToLower())
130 vals[i, 7] = Convert.ToInt16(value).ToString();
131 Bridge.SetLabViewValue(Seci.Standard.DaeMonitor.FilePath,
"Parameter details", vals);
140 void IComInterface.ClearGraphs()
142 Bridge.ClearGraphs();
145 int IComInterface.ChangeConfiguration(String configName)
147 return Bridge.ChangeConfig(configName);
150 String[] IComInterface.GetVIsFullpath()
152 return Bridge.GetVIsFullpath();
155 String[] IComInterface.GetConfigurations()
157 return Bridge.GetListOfConfigs();
160 Boolean IComInterface.IsSeciBusy()
162 return Bridge.IsBusy();
165 void IComInterface.EnableBlocksLogging(Boolean enable)
167 Bridge.EnableBlocksLogging(enable);
170 Boolean IComInterface.BlocksLoggingStatus()
172 return Bridge.BlocksLoggingStatus();
182 [InterfaceType(ComInterfaceType.InterfaceIsDual)]
186 String GetBlockValueString(String blockName);
187 String[] GetBlockNames(Boolean includeHidden);
188 object GetRawBlockValue(String blockname);
189 object GetRawSetpoint(String blockname);
190 Boolean SetRawBlockValue(String blockName, Object value);
191 Boolean UnderRunControl(String blockName);
192 Boolean SetRunControl(String blockName, Boolean value);
194 int ChangeConfiguration(String configName);
195 Boolean IsSeciBusy();
196 String[] GetConfigurations();
197 String[] GetVIsFullpath();
198 void EnableBlocksLogging(Boolean enable);
199 Boolean BlocksLoggingStatus();
static Object GetLabViewValue(String vi, String control)
Get value directly from LabVIEW with no checks or conversions.
ComInterface()
The constructor
This class is for accessing Seci from an external source. All the COM and Remoting calls go through t...
void InitialiseCom()
Registers the interface with COM.
RegistrationServices _regServices
The exposed COM interface
void DisposeCom()
Unregisters the interface from COM.
This class is for accessing Seci via COM. The COM interface is registered when Seci starts and unregi...