public override bool Init() { if (!mIsInitCalled) { mIsInitCalled = true; //TheChartFactory.MyDefaultChartsFactory = new TheC3ChartsFactory(); MyBaseThing.LastMessage = "Service has started"; MyBaseThing.AddCapability(eThingCaps.NMIControls); MyBaseThing.RegisterEvent(eEngineEvents.IncomingMessage, HandleMessage); MyBaseEngine.ProcessInitialized(); MyBaseEngine.SetEngineReadiness(true, null); MyBaseEngine.SetStatusLevel(1); mIsInitialized = true; } return(true); }
public ModbusTCPDevice(TheThing tBaseThing, ICDEPlugin pPluginBase, DeviceDescription pModDeviceDescription) { if (tBaseThing != null) { MyBaseThing = tBaseThing; } else { MyBaseThing = new TheThing(); } MyBaseEngine = pPluginBase.GetBaseEngine(); MyBaseThing.DeviceType = eModbusType.ModbusTCPDevice; MyBaseThing.EngineName = MyBaseEngine.GetEngineName(); MyBaseThing.SetIThingObject(this); MyDevice = pModDeviceDescription; if (MyDevice != null && !String.IsNullOrEmpty(MyDevice.Name)) { MyBaseThing.FriendlyName = MyDevice.Name; } MyBaseThing.AddCapability(eThingCaps.SensorProvider); }