/// Connect to selected client /** Parameter "URL" must be either "DEVICE" or "SIMULATOR". No other inputs supported for now. * Simulator and device URLs hard-coded into controller. Support for other URLs can be added later. * <param name="URL">"SIMULATOR" or "DEVICE"</param> */ public void connectClient(string URL) { // Physical device if selected if (URL == "DEVICE") { this.URL = DEVICE_URL; } // Simulator by default else { this.URL = SIMULATOR_URL; } // Try connecting to client try { simulatorParams = new Tut.MppOpcUaClientLib.MppClient.MppClientCtorParams(this.URL); client = new Tut.MppOpcUaClientLib.MppClient(simulatorParams); startListener(); assignUnits(); //Handle exception if failed } catch (Exception e) { Console.WriteLine("------- ERROR CONNECTING--------"); Console.WriteLine(e); Console.WriteLine("------- --------"); throw; } }
/// Constructor /// <param name="name">Name (code) of the device</param> /// <param name="client">Reference to MppClient object</param> /// <param name="listener">Reference to Listener object</param> public Heater(String name, ref Tut.MppOpcUaClientLib.MppClient client, ref Listener listener) { this.name = name; isOn = false; this.client = client; this.listener = listener; }
/// <summary> /// Constructor /// </summary> /// <param name="name">Name (code) of the corresponding device. Example: V104</param> /// <param name="client">Reference to MppClient object</param> /// <param name="listener">Reference to Listener object</param> public FlowControlValve(String name, ref Tut.MppOpcUaClientLib.MppClient client, ref Listener listener) { this.name = name; this.client = client; this.listener = listener; //Some default values this.pValue = 0; this.iValue = 0; this.targetValue = 0; this.piThread = new Thread(() => {}); }
/// Constructor /** Takes the main window as a parameter. Window is used to send update calls for GUI */ public Controller(MainWindow window) { this.window = window; client = null; listener = new Listener(window); URL = SIMULATOR_URL; parameters = null; ImpregnationThread = new Thread(() => {}); BlackLiquorThread = new Thread(() => {}); WhiteLiquorThread = new Thread(() => {}); CookingThread = new Thread(() => {}); DischargeThread = new Thread(() => {}); }
/// <summary> /// Constructor /// </summary> /// <param name="name">Name (code) of the corresponding device. Example: "P100"</param> /// <param name="client">Reference to MppClient object</param> public Pump(String name, ref Tut.MppOpcUaClientLib.MppClient client) { this.name = name; this.client = client; }
/// <summary> /// Constructor /// </summary> /// <param name="name">Name of the corresponding device. Example: "V302"</param> /// <param name="client">Reference to MppClient object</param> public OnOffValve(String name, ref Tut.MppOpcUaClientLib.MppClient client) { this.name = name; this.client = client; }