示例#1
0
        private void UpdateUx()
        {
            ThePropertyBag.MergeUXBagFromProperties(CountBar?.PropertyBag, MyBaseThing);
            SetCtrlType();

            if (TimestampField != null)
            {
                TimestampField?.SetUXProperty(Guid.Empty, $"Visibility={ShowTimestamp}");
                ChangeTimestampField?.SetUXProperty(Guid.Empty, $"Visibility={ShowChangeTimestamp}");
            }

            TheThingRegistry.UnmapPropertyMapper(MapperGuid);
            if (!string.IsNullOrEmpty(MyBaseThing.Address))
            {
                MapperGuid = TheThingRegistry.PropertyMapper(TheCommonUtils.CGuid(MyBaseThing.Address), TheThing.GetSafePropertyString(MyBaseThing, "SourceProp"), MyBaseThing.cdeMID, "Value", true);
                if (MapperGuid != Guid.Empty)
                {
                    MyBaseThing.StatusLevel = 1;
                    MyBaseThing.LastMessage = "Mapper engaged";
                }
                else
                {
                    MyBaseThing.StatusLevel = 2;
                    MyBaseThing.LastMessage = "Mapper failed to engaged";
                }
            }
            else
            {
                MyBaseThing.StatusLevel = 0;
                MyBaseThing.LastMessage = "Mapper not engaged";
            }
        }
示例#2
0
        private void UpdateUx(TheThing pThing)
        {
            ThePropertyBag.MergeUXBagFromProperties(MySampleControl?.PropertyBag, pThing);
            SetCtrlType();

            TheThingRegistry.UnmapPropertyMapper(MapperGuid);
            if (!string.IsNullOrEmpty(pThing.Address))
            {
                MapperGuid = TheThingRegistry.PropertyMapper(TheCommonUtils.CGuid(pThing.Address), TheThing.GetSafePropertyString(pThing, "SourceProp"), pThing.cdeMID, "Value", true);
                if (MapperGuid != Guid.Empty)
                {
                    pThing.StatusLevel = 1;
                    pThing.LastMessage = "Mapper engaged";
                }
                else
                {
                    pThing.StatusLevel = 2;
                    pThing.LastMessage = "Mapper failed to engaged";
                }
            }
            else
            {
                pThing.StatusLevel = 0;
                pThing.LastMessage = "Mapper not engaged";
            }
        }
示例#3
0
 private void EngageMapper()
 {
     TheThingRegistry.UnmapPropertyMapper(mRealThingGuid);
     mRealThingGuid = TheThingRegistry.PropertyMapper(TheThing.GetSafePropertyGuid(MyBaseThing, "ValueGuid"), TheThing.GetSafePropertyString(MyBaseThing, "ValueProp"), MyBaseThing.cdeMID, "ValueStr", false);
     if (mRealThingGuid == Guid.Empty)
     {
         MyBaseThing.StatusLevel = 0;
         MyBaseThing.LastMessage = "Mapper not active";
     }
     else
     {
         MyBaseThing.LastMessage = "Mapper engaged";
         MyBaseThing.StatusLevel = 1;
     }
 }
示例#4
0
 private void EngageMapper()
 {
     TheThingRegistry.UnmapPropertyMapper(mRealThingGuid);
     mRealThingGuid = TheThingRegistry.PropertyMapper(TheThing.GetSafePropertyGuid(MyBaseThing, "RealSensorThing"), TheThing.GetSafePropertyString(MyBaseThing, "RealSensorProperty"), MyBaseThing.cdeMID, "Value", false);
     if (mRealThingGuid == Guid.Empty)
     {
         MyBaseThing.StatusLevel = 0;
         MyBaseThing.LastMessage = "Mapper not active";
         IsActive = false;
     }
     else
     {
         MyBaseThing.LastMessage = "Mapper engaged";
         MyBaseThing.StatusLevel = 1;
         CopyStateSensorInfo(MyBaseThing);
         IsActive = true;
     }
 }
示例#5
0
 private void EngageMapper()
 {
     TheThingRegistry.UnmapPropertyMapper(mRealThingGuid);
     mRealThingGuid = TheThingRegistry.PropertyMapper(TheThing.GetSafePropertyGuid(MyBaseThing, "RealSensorThing"), TheThing.GetSafePropertyString(MyBaseThing, "RealSensorProperty"), MyBaseThing.cdeMID, "RawValue", false);
     if (mRealThingGuid == Guid.Empty)
     {
         MyBaseThing.StatusLevel = 0;
         MyBaseThing.LastMessage = "Mapper not active";
         IsActive = false;
     }
     else
     {
         MyBaseThing.LastMessage = "Mapper engaged";
         MyBaseThing.StatusLevel = 1;
         TheDefaultSensor.CopyStateSensorInfo(MyBaseThing);
         SummaryForm?.SetUXProperty(Guid.Empty, string.Format("Background={0}", TheNMIEngine.GetStatusColor(MyBaseThing.StatusLevel)));
         IsActive = true;
     }
 }