88 lines
2.7 KiB
C#
88 lines
2.7 KiB
C#
///
|
|
/// Copyright (c) 2015-2021 Sensus Slovensko a.s.
|
|
///
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
using Config.Entities;
|
|
using TBF.Rig.Generic;
|
|
|
|
namespace TBF.Rig.BridgeComponents.GciBridge
|
|
{
|
|
/// <summary>
|
|
/// Configuration of GCI bridge component.
|
|
/// </summary>
|
|
public class GciBridgeCfg : ComponentCfgBase, IChildComponentCfg
|
|
{
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(GciBridgeCfg) })[0];
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|
|
|
/// <summary>
|
|
/// Linked UniDataStorage reader component name.
|
|
/// </summary>
|
|
public string ReaderName;
|
|
|
|
/// <summary>
|
|
/// Linked UniDataStorage writer component name.
|
|
/// </summary>
|
|
public string WriterName;
|
|
|
|
/// <summary>
|
|
/// Enables access to GCI GUI layer.
|
|
/// </summary>
|
|
public bool EnableGuiAccess;
|
|
|
|
/// <summary>
|
|
/// Enables access to GCI external/public interface.
|
|
/// </summary>
|
|
public bool EnableExternalAccess;
|
|
|
|
/// <summary>
|
|
/// If true, GUI should be shown automatically after initialization.
|
|
/// </summary>
|
|
public bool ShowGuiOnInitialize;
|
|
|
|
/// <summary>
|
|
/// Optional external interface type name or description.
|
|
/// </summary>
|
|
public string ExternalInterfaceTypeName;
|
|
|
|
/// <summary>
|
|
/// Private parameterless constructor used by serializer.
|
|
/// </summary>
|
|
GciBridgeCfg()
|
|
{
|
|
}
|
|
|
|
public GciBridgeCfg(string name, IComponentFactory factory)
|
|
{
|
|
Name = name;
|
|
Factory = factory;
|
|
ParentName = string.Empty;
|
|
|
|
ReaderName = string.Empty;
|
|
WriterName = string.Empty;
|
|
EnableGuiAccess = true;
|
|
EnableExternalAccess = true;
|
|
ShowGuiOnInitialize = false;
|
|
ExternalInterfaceTypeName = string.Empty;
|
|
}
|
|
|
|
public IComponentCfgCtrl GetControl(IList<Component> cmpntEntities)
|
|
{
|
|
return new GciBridgeCfgCtrl();
|
|
}
|
|
|
|
public string ToString(int i)
|
|
{
|
|
return string.Format(
|
|
"Name={0}, Reader={1}, Writer={2}, GuiAccess={3}, ExternalAccess={4}, ShowGuiOnInit={5}, ExternalType={6}",
|
|
Name,
|
|
string.IsNullOrEmpty(ReaderName) ? "-" : ReaderName,
|
|
string.IsNullOrEmpty(WriterName) ? "-" : WriterName,
|
|
EnableGuiAccess,
|
|
EnableExternalAccess,
|
|
ShowGuiOnInitialize,
|
|
string.IsNullOrEmpty(ExternalInterfaceTypeName) ? "-" : ExternalInterfaceTypeName);
|
|
}
|
|
}
|
|
} |