This commit is contained in:
13118993771@163.com
2022-04-01 17:03:54 +08:00
commit 5e9d0f1e2d
1528 changed files with 1474439 additions and 0 deletions

61
SRD/CommandContent.cs Normal file
View File

@@ -0,0 +1,61 @@
#region << >>
/*----------------------------------------------------------------
* 创建者13118
* 创建时间2021/12/28 14:29:42
* 版本V1.0.0
* 描述:
*
* ----------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.1
*----------------------------------------------------------------*/
#endregion << >>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace ARI.EAP.HOST.SRD
{
/// <summary>
/// CommandContent 的摘要说明
/// 指令内容实体类
/// </summary>
[Serializable]
public class CommandContent
{
[XmlAttribute]
public string name { get; set; }
public List<string> content;
public CommandContent() => content = new List<string>();
}
[Serializable]
public class CommandContentCollection
{
public List<CommandContent> commandContents { get; set; }
public CommandContentCollection() => commandContents = new List<CommandContent>();
public CommandContent findContent(string sfName)
{
foreach(CommandContent c in commandContents)
{
if (c.name.Equals(sfName))
{
return c;
}
}
return null;
}
}
}

264
SRD/SRDConfiguration.cs Normal file
View File

@@ -0,0 +1,264 @@
#region << >>
/*----------------------------------------------------------------
* 创建者Hupe
* 创建时间2021/12/27 10:01:10
* 版本V1.0.0
* 描述:
*
* ----------------------------------------------------------------
* 修改人:
* 时间:
* 修改说明:
*
* 版本V1.0.1
*----------------------------------------------------------------*/
#endregion << >>
using Glorysoft.SECSwell;
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace ARI.EAP.HOST.SRD
{
/// <summary>
/// SRDConfiguration 的摘要说明
/// </summary>
[Serializable]
public class SRDConfiguration
{
public List<ECV> ecvs;
public List<SV> svs;
public List<DV> dvs;
public List<EVENT> events;
public SRDConfiguration()
{
ecvs = new List<ECV>();
svs = new List<SV>();
dvs = new List<DV>();
events = new List<EVENT>();
}
public SV findSV(string SVName)
{
foreach(SV sv in svs)
{
if (sv.name.Equals(SVName))
{
return sv;
}
}
return null;
}
public DV findDV(uint id)
{
foreach (DV dv in dvs)
{
if (dv.dvid == id)
{
return dv;
}
}
return null;
}
public SV findSV(uint id)
{
foreach (SV sv in svs)
{
if (sv.svid == id)
{
return sv;
}
}
return null;
}
public ECV findEC(string ECName)
{
foreach (ECV ecv in ecvs)
{
if (ecv.name.Equals(ECName))
{
return ecv;
}
}
return null;
}
public ECV findEC(uint ecid)
{
foreach (ECV ecv in ecvs)
{
if (ecv.ecid == ecid)
{
return ecv;
}
}
return null;
}
public EVENT findEvent(uint CEID)
{
foreach (EVENT even in events)
{
if (even.ceid == CEID)
{
return even;
}
}
return null;
}
public string tryGetSVOrDV(uint id)
{
foreach(SV sv in svs)
{
if(sv.svid == id)
{
return sv.name;
}
}
foreach(DV dv in dvs)
{
if(dv.dvid == id)
{
return dv.name;
}
}
return null;
}
public eSECS_FORMAT GetSECS_FORMAT(uint id)
{
string format = null;
foreach (SV sv in svs)
{
if (sv.svid == id)
{
format = sv.format;
break;
}
}
if(format == null)
{
foreach (DV dv in dvs)
{
if (dv.dvid == id)
{
format = dv.format;
break;
}
}
}
switch(format)
{
case ("B"):
return eSECS_FORMAT.BOOLEAN;
case ("U1"):
return eSECS_FORMAT.U1;
case ("I1"):
return eSECS_FORMAT.I1;
case ("U2"):
return eSECS_FORMAT.U2;
case ("I2"):
return eSECS_FORMAT.I2;
case ("U4"):
return eSECS_FORMAT.U4;
case ("I4"):
return eSECS_FORMAT.I4;
case ("U8"):
return eSECS_FORMAT.U8;
case ("I8"):
return eSECS_FORMAT.I8;
case ("F4"):
return eSECS_FORMAT.F4;
case ("F8"):
return eSECS_FORMAT.F8;
case ("A"):
return eSECS_FORMAT.ASCII;
case ("L"):
return eSECS_FORMAT.LIST;
default: return eSECS_FORMAT.ASCII;
}
}
}
[Serializable]
public class ECV
{
[XmlAttribute]
public uint ecid { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public string format { get; set; }
[XmlAttribute]
public string min { get; set; }
[XmlAttribute]
public string max { get; set; }
[XmlAttribute]
public string defaultValue { get; set; }
[XmlAttribute]
public string description { get; set; }
}
[Serializable]
public class SV
{
[XmlAttribute]
public uint svid { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public string format { get; set; }
[XmlAttribute]
public string min { get; set; }
[XmlAttribute]
public string max { get; set; }
[XmlAttribute]
public string defaultValue { get; set; }
[XmlAttribute]
public string description { get; set; }
}
[Serializable]
public class DV
{
[XmlAttribute]
public uint dvid { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public string format { get; set; }
[XmlAttribute]
public string min { get; set; }
[XmlAttribute]
public string max { get; set; }
[XmlAttribute]
public string defaultValue { get; set; }
[XmlAttribute]
public string description { get; set; }
}
[Serializable]
public class EVENT
{
[XmlAttribute]
public uint ceid { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public string description { get; set; }
[XmlAttribute]
public uint reportid { get; set; }
public List<uint> validVariables { get; set; }
public EVENT()
{
validVariables = new List<uint>();
}
}
}