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"; } }
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"; } }
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; } }
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; } }
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; } }