コード例 #1
0
 public TheLoggerBase(TheThing tBaseThing, ICDEPlugin pPluginBase)
 {
     MyBaseThing            = tBaseThing ?? new TheThing();
     MyBaseEngine           = pPluginBase.GetBaseEngine();
     MyBaseThing.EngineName = MyBaseEngine.GetEngineName();
     MyBaseThing.SetIThingObject(this);
 }
コード例 #2
0
        public TheVTimer(TheThing pThing, IBaseEngine pEngine)
            : base(pThing)
        {
            if (pThing != null)
            {
                MyBaseThing = pThing;
            }
            else
            {
                MyBaseThing = new TheThing();
            }

            cdeP tfirstTrigger = MyBaseThing.DeclareNMIProperty("MsToTrigger", ePropertyTypes.TNumber);

            tfirstTrigger.RegisterEvent(eThingEvents.PropertySet, sinkLoopChanged);

            cdeP tLoop = MyBaseThing.DeclareNMIProperty("LoopPeriod", ePropertyTypes.TNumber);

            tLoop.RegisterEvent(eThingEvents.PropertySet, sinkLoopChanged);
            cdeP tTrigger = MyBaseThing.DeclareNMIProperty("TriggerTimer", ePropertyTypes.TString);

            tTrigger.RegisterEvent(eThingEvents.PropertySet, sinkTriggered);

            MyBaseEngine           = pEngine;
            MyBaseThing.DeviceType = eVThings.eVTimer;
            MyBaseThing.EngineName = pEngine.GetEngineName();
            MyBaseThing.SetIThingObject(this);
        }
コード例 #3
0
        private void CreateRule(string pFriendlyName, TheThing pTriggerThing, string pTriggerProperty, eRuleTrigger pTriggerCondition, string pTriggerValue, bool pDoLogRule, bool bIsRuleActive)
        {
            TriggerStartTime = DateTimeOffset.MinValue;
            TriggerEndTime   = DateTimeOffset.MaxValue;

            //TriggerObjectType = "CDE_THING";
            TriggerObject = pTriggerThing.cdeMID.ToString();
            if (!TheCommonUtils.IsNullOrWhiteSpace(pTriggerProperty))
            {
                TriggerProperty = pTriggerProperty;
            }
            else
            {
                pTriggerProperty = "Value";
            }
            TriggerCondition = pTriggerCondition;
            TriggerValue     = pTriggerValue;


            FriendlyName = pFriendlyName;
            IsRuleLogged = pDoLogRule;
            IsRuleActive = bIsRuleActive;

            if (string.IsNullOrEmpty(MyBaseThing.EngineName))
            {
                MyBaseThing.EngineName = eEngineName.ThingService;
            }
            MyBaseThing.DeviceType = eKnownDeviceTypes.TheThingRule;
            MyBaseThing.ID         = MyBaseThing.cdeMID.ToString();
            RegisterEvent("RuleFired", null);
            MyBaseThing.SetIThingObject(this);
        }
コード例 #4
0
 public TheVStateSensor(TheThing pThing, IBaseEngine pEngine)
     : base(pThing)
 {
     MyBaseThing            = pThing ?? new TheThing();
     MyBaseThing.DeviceType = eVThings.eVStateSensor;
     MyBaseThing.EngineName = pEngine.GetEngineName();
     MyBaseThing.SetIThingObject(this);
 }
コード例 #5
0
 public TheSineWave(TheThing pThing, IBaseEngine pEngine) : base(pThing)
 {
     MyBaseThing            = pThing ?? new TheThing();
     MyBaseEngine           = pEngine;
     MyBaseThing.DeviceType = eVThings.eSineWave;
     MyBaseThing.EngineName = pEngine.GetEngineName();
     MyBaseThing.SetIThingObject(this);
 }
コード例 #6
0
 public TheOPCUATagThing(TheThing pThing, TheOPCTag pTag)
     : base(pThing)
 {
     MyBaseThing.DeviceType = eOPCDeviceTypes.OPCLiveTag;
     Reset();
     MyBaseThing.RegisterEvent("OnInitialized", sinkInit);
     MyBaseThing.SetIThingObject(this);
 }
コード例 #7
0
 public TheOPCUAMethodThing(TheThing pThing, string pEngineName)
     : base(pThing)
 {
     MyBaseThing.DeviceType = eOPCDeviceTypes.OPCMethod;
     MyBaseThing.EngineName = pEngineName;
     Reset();
     MyBaseThing.RegisterEvent("OnInitialized", sinkInit);
     MyBaseThing.SetIThingObject(this);
 }
コード例 #8
0
 public TheBitmapImage(TheThing tBaseThing, ICDEPlugin pPluginBase)
 {
     MyBaseThing            = tBaseThing ?? new TheThing();
     MyBaseEngine           = pPluginBase.GetBaseEngine();
     MyBaseThing.EngineName = MyBaseEngine.GetEngineName();
     MyBaseThing.SetIThingObject(this);
     MyBaseThing.DeviceType = eImageTypes.Bitmap;
     TheThing.SetSafePropertyBool(MyBaseThing, "IsCamera", true);
 }
コード例 #9
0
        public TheNMIElement(TheThing pThing, IBaseEngine pEngine)
            : base(pThing)
        {
            MyBaseThing            = pThing ?? new TheThing();
            MyBaseEngine           = pEngine;
            MyBaseThing.DeviceType = eVThings.eNMIElement;
            MyBaseThing.EngineName = pEngine.GetEngineName();
            MyBaseThing.SetIThingObject(this);

            TheBaseEngine.WaitForEnginesStarted(sinkUpdateControls);
        }
コード例 #10
0
 public TheSMSMessage(TheThing tBaseThing, ICDEPlugin pPluginBase)
 {
     if (tBaseThing != null)
     {
         MyBaseThing = tBaseThing;
     }
     else
     {
         MyBaseThing = new TheThing();
     }
     MyBaseEngine = pPluginBase.GetBaseEngine();
     MyBaseThing.SetIThingObject(this);
 }
コード例 #11
0
 public TheISOlaterKPIs(TheThing tBaseThing, ICDEPlugin pPluginBase, string pEngineName)
 {
     MyBaseThing            = tBaseThing ?? new TheThing();
     MyBaseEngine           = pPluginBase.GetBaseEngine();
     MyPlugin               = pPluginBase;
     MyBaseThing.EngineName = MyBaseEngine.GetEngineName();
     MyBaseThing.DeviceType = eDeviceType;
     TheThing.SetSafePropertyString(MyBaseThing, "ISOLaterName", pEngineName);
     if (string.IsNullOrEmpty(MyBaseThing.FriendlyName))
     {
         MyBaseThing.FriendlyName = pEngineName;
     }
     MyBaseThing.SetIThingObject(this);
 }
コード例 #12
0
        /// <summary>
        /// Constructor of the LiveTag
        /// </summary>
        /// <param name="pThing"></param>
        public TheNMILiveTag(TheThing pThing)
        {
            if (pThing == null)
            {
                MyBaseThing = new TheThing();
            }
            else
            {
                MyBaseThing = pThing;
            }

            MyBaseThing.DeclareNMIProperty("ControlType", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("FormTitle", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Caption", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("TileLeft", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("TileTop", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("TileWidth", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("TileHeight", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("Flags", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("FldOrder", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("ClassName", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Style", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("IsAbsolute", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("IsVertical", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("IsInverted", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("MinValue", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("MaxValue", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("SeriesNames", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Title", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("NoTE", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("Units", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Format", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Options", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("MainBackground", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Background", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Foreground", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("ForegroundOpacity", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Opacity", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Disabled", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("Visibility", ePropertyTypes.TBoolean);
            MyBaseThing.DeclareNMIProperty("Speed", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("Delay", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("Throttle", ePropertyTypes.TNumber);
            MyBaseThing.DeclareNMIProperty("Group", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("NUITags", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("Label", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("LabelClassName", ePropertyTypes.TString);
            MyBaseThing.DeclareNMIProperty("LabelForeground", ePropertyTypes.TString);
            MyBaseThing.SetIThingObject(this);
        }
コード例 #13
0
        public TheVCountdown(TheThing pThing, IBaseEngine pEngine)
            : base(pThing)
        {
            if (pThing != null)
            {
                MyBaseThing = pThing;
            }
            else
            {
                MyBaseThing = new TheThing();
            }

            MyBaseThing.DeviceType = eVThings.eVCountdown;
            MyBaseThing.EngineName = pEngine.GetEngineName();
            MyBaseThing.SetIThingObject(this);
            IsActive = false;
        }
コード例 #14
0
 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);
 }
コード例 #15
0
        public TheNetworkServiceBase(TheThing tBaseThing, ICDEPlugin pPluginBase)
        {
            if (tBaseThing != null)
            {
                MyBaseThing = tBaseThing;

                // If we are changing objects due to DeviceType change, move the UX state over as we can't easily re-create it
                TheNetworkServiceBase previousInstance = MyBaseThing.GetObject() as TheNetworkServiceBase;
                if (previousInstance != null)
                {
                    mIsUXInitialized = previousInstance.mIsUXInitialized;
                    mIsInitialized   = previousInstance.mIsInitialized;
                    previousInstance.CloseServer();
                }
            }
            else
            {
                MyBaseThing = new TheThing();
            }
            MyBaseEngine = pPluginBase.GetBaseEngine();
            MyBaseThing.SetIThingObject(this);
        }
コード例 #16
0
        public TheNodeHost(TheThing tBaseThing)
        {
            if (tBaseThing != null)
            {
                MyBaseThing = tBaseThing;
            }
            else
            {
                MyBaseThing = new TheThing();
            }

            // CODE REVIEW: This normally happens in InitEngineAssets: should we adhere to this pattern even for this "special" host?
            MyBaseThing.ID           = TheBaseAssets.MyAppInfo.cdeMID.ToString();
            MyBaseThing.DeviceType   = eKnownDeviceTypes.ApplicationHost;
            MyBaseThing.FriendlyName = TheBaseAssets.MyAppInfo.ServiceName;
            MyBaseThing.EngineName   = string.Format("{0} on {1} V{2}", TheBaseAssets.MyAppInfo.ServiceName, TheBaseAssets.MyAppInfo.Platform, TheBaseAssets.MyAppInfo.CurrentVersion);
            MyBaseThing.MyBaseEngine = new TheBaseEngine();
            MyBaseThing.MyBaseEngine.SetEngineID(new Guid("af7b3917-3030-46ff-8c88-260554e1aa80"));
            MyBaseThing.MyBaseEngine.SetEngineName(MyBaseThing.EngineName);
            MyBaseThing.MyBaseEngine.SetVersion(TheBaseAssets.MyAppInfo.CurrentVersion);

            MyBaseThing.SetIThingObject(this);
        }