本文整理汇总了C#中RubezhAPI.GK.GKDevice.GetGKDescriptorName方法的典型用法代码示例。如果您正苦于以下问题:C# GKDevice.GetGKDescriptorName方法的具体用法?C# GKDevice.GetGKDescriptorName怎么用?C# GKDevice.GetGKDescriptorName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RubezhAPI.GK.GKDevice
的用法示例。
在下文中一共展示了GKDevice.GetGKDescriptorName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Device
public Device(GKDevice device)
: base(device)
{
ParentUID = device.Parent != null ? device.Parent.UID : (Guid?)null;
ParentName = device.Parent != null ? device.Parent.GetGKDescriptorName(GKManager.DeviceConfiguration.GKNameGenerationType) : String.Empty;
ParentImage = device.Parent != null ? device.Parent.ImageSource.Replace("/Controls;component/", "") : String.Empty;
Name = device.GetGKDescriptorName(GKManager.DeviceConfiguration.GKNameGenerationType);
GKDescriptorNo = device.GKDescriptorNo;
Address = device.DottedPresentationAddress;
Description = device.Description;
Logic = GKManager.GetPresentationLogic(device.Logic);
NsLogic = GKManager.GetPresentationLogic(device.NSLogic);
ZoneUID = device.ZoneUIDs.FirstOrDefault();
IsRealDevice = device.IsRealDevice;
Driver = device.Driver;
DriverType = device.DriverType;
State = device.State.StateClass.ToDescription();
StateIcon = device.State.StateClass.ToString();
StateClasses = device.State.StateClasses.Select(x => new StateClass(x)).ToList();
StateColor = "'#" + new XStateClassToColorConverter2().Convert(device.State.StateClass, null, null, null).ToString().Substring(3) + "'";
HasOnDelay = device.State.StateClasses.Contains(XStateClass.TurningOn) && device.State.OnDelay > 0;
OnDelay = device.State.OnDelay;
HoldDelay = device.State.HoldDelay;
HasHoldDelay = device.State.StateClasses.Contains(XStateClass.On) && device.State.HoldDelay > 0;
HasMeasureParameters = device.Driver.MeasureParameters.Where(x => !x.IsDelay && !x.IsNotVisible).Count() > 0 ||
device.DriverType == GKDriverType.RSR2_Valve_DU ||
device.DriverType == GKDriverType.RSR2_Valve_KV || device.DriverType == GKDriverType.RSR2_Valve_KVMV;
IsFireAndGuard = device.Driver.HasZone && device.Driver.HasGuardZone;
var isInPumpStation = (device.DriverType == GKDriverType.RSR2_Bush_Drenazh || device.DriverType == GKDriverType.RSR2_Bush_Fire
|| device.DriverType == GKDriverType.RSR2_Bush_Jokey) && device.OutputDependentElements.Any(x => x as GKPumpStation != null);
var canShowZones = device.Driver.HasZone || device.Driver.HasGuardZone;
var canShowLogic = device.Driver.HasLogic && !device.IsInMPT && !isInPumpStation;
IsZoneOrLogic = !device.IsInMPT && isInPumpStation && (canShowZones || canShowLogic || device.Driver.HasMirror);
PresentationZone = GKManager.GetPresentationZoneAndGuardZoneOrLogic(device);
GuardPresentationZone = GKManager.GetPresentationGuardZone(device);
var controlRegime = device.State.StateClasses.Contains(XStateClass.Ignore)
? DeviceControlRegime.Ignore
: !device.State.StateClasses.Contains(XStateClass.AutoOff) ? DeviceControlRegime.Automatic : DeviceControlRegime.Manual;
ControlRegimeName = controlRegime.ToDescription();
ControlRegimeIcon = (new DeviceControlRegimeToIconConverter()).Convert(controlRegime);
CanSetAutomaticState = (controlRegime != DeviceControlRegime.Automatic) &&
device.State.StateClass != XStateClass.ConnectionLost;
CanSetManualState = (controlRegime != DeviceControlRegime.Manual) && device.State.StateClass != XStateClass.ConnectionLost;
CanSetIgnoreState = (controlRegime != DeviceControlRegime.Ignore) && device.State.StateClass != XStateClass.ConnectionLost;
IsControlRegime = (controlRegime == DeviceControlRegime.Manual);
Properties = device.Properties;
MeasureParameters = device.Driver.MeasureParameters;
IsTriStateControl = device.Driver.IsControlDevice;
IsBiStateControl = device.Driver.IsDeviceOnShleif && !device.Driver.IsControlDevice;
HasReset = device.DriverType == GKDriverType.RSR2_MAP4;
DeviceExecutableCommands = new List<DeviceExecutableCommand>();
foreach (var command in device.Driver.AvailableCommandBits)
{
DeviceExecutableCommands.Add(new DeviceExecutableCommand(device.DriverType, command));
}
Plans = new List<PlanSimpl>();
foreach (var plan in RubezhClient.ClientManager.PlansConfiguration.AllPlans.Where(item => item.ElementGKDevices.Any(element => element.DeviceUID == device.UID)))
{
Plans.Add(new PlanSimpl()
{
Name = plan.Caption,
Uid = plan.UID
});
}
}