AutoGRAPH.NET Service EnumDrivers (EN) — различия между версиями
Admin (обсуждение | вклад) (Новая страница: «Get drivers and driver groups in specified schema (like EnumDevices or[AutoGRAPH.NET Service EnumGeoFences(EN)|EnumGeoFe…») |
Admin (обсуждение | вклад) |
||
| (не показана 1 промежуточная версия этого же участника) | |||
| Строка 1: | Строка 1: | ||
| − | Get drivers and driver groups in specified schema (like [[AutoGRAPH.NET Service EnumDevices(EN)|EnumDevices]] or[AutoGRAPH.NET Service EnumGeoFences(EN)|EnumGeoFences]]). You can restore hierarchy by matching ID ⇔ ParentID, starting from top level (root node have ParentID=null). |
+ | Get drivers and driver groups in specified schema (like [[AutoGRAPH.NET Service EnumDevices (EN)|EnumDevices]] or[AutoGRAPH.NET Service EnumGeoFences (EN)|EnumGeoFences]]). You can restore hierarchy by matching ID ⇔ ParentID, starting from top level (root node have ParentID==null). |
== WCF == |
== WCF == |
||
| − | Definition: |
+ | Definition: |
| − | REnumDevices EnumDrivers(string |
+ | <pre>REnumDevices EnumDrivers(string schemaID)</pre> |
| − | </syntaxhighlight> |
||
| + | Result: |
||
| − | Result: <syntaxhighlight lang="csharp"> |
||
| + | <pre> |
||
public class REnumDrivers |
public class REnumDrivers |
||
{ |
{ |
||
| Строка 26: | Строка 26: | ||
public RProperty[] Properties { get; set; } // driver properties (all inherited properties also included) |
public RProperty[] Properties { get; set; } // driver properties (all inherited properties also included) |
||
} |
} |
||
| − | </syntaxhighlight> |
||
| + | public class RProperty |
||
| − | == JSON == |
||
| + | { |
||
| + | public bool Inherited { get; set; } // if true - property inherited from parent |
||
| + | public RPropType Type { get; set; } // property type |
||
| + | public string Name { get; set; } // property name |
||
| + | public object Value { get; set; } // property value (depend from Type field) |
||
| + | } |
||
| + | public enum RPropType : int // property types |
||
| − | Calling: <syntaxhighlight lang="html4strict"> |
||
| + | { |
||
| + | String = 0, |
||
| + | Number = 1, |
||
| + | Date = 2, |
||
| + | TareTable = 3, |
||
| + | Time = 4, |
||
| + | Memo = 5, |
||
| + | Color = 6, |
||
| + | Bool = 7, |
||
| + | Radio = 8, |
||
| + | Image = 9, |
||
| + | File = 10, |
||
| + | ProgressBar = 11, |
||
| + | Combobox = 12, |
||
| + | FileLink = 13, |
||
| + | Device = 14, |
||
| + | GeoFence = 15 |
||
| + | } |
||
| + | </pre> |
||
| + | |||
| + | == JSON == |
||
| + | Calling: |
||
| + | <pre> |
||
http://localhost:8300/EnumDrivers/Demo |
http://localhost:8300/EnumDrivers/Demo |
||
| + | http://localhost:8300/EnumDrivers?schemaID=Demo |
||
| − | </syntaxhighlight> |
||
| + | </pre> |
||
| − | Parameter Demo – schema |
+ | Parameter Demo – schema id from [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]]. |
Текущая версия на 11:47, 11 февраля 2016
Get drivers and driver groups in specified schema (like EnumDevices or[AutoGRAPH.NET Service EnumGeoFences (EN)|EnumGeoFences]]). You can restore hierarchy by matching ID ⇔ ParentID, starting from top level (root node have ParentID==null).
WCF
Definition:
REnumDevices EnumDrivers(string schemaID)
Result:
public class REnumDrivers
{
public RGroupItem[] Groups { get; set; } // driver groups
public RDriverItem[] Items { get; set; } // drivers
}
public class RGroupItem
{
public Guid ID { get; set; } // unique ID of object in schema
public Guid? ParentID { get; set; } // ID of parent group
public string Name { get; set; } // group name
}
public class RDriverItem : RGroupItem
{
public string DriverID { get; set; } // driver ID (iButton or wireless card ID)
public RProperty[] Properties { get; set; } // driver properties (all inherited properties also included)
}
public class RProperty
{
public bool Inherited { get; set; } // if true - property inherited from parent
public RPropType Type { get; set; } // property type
public string Name { get; set; } // property name
public object Value { get; set; } // property value (depend from Type field)
}
public enum RPropType : int // property types
{
String = 0,
Number = 1,
Date = 2,
TareTable = 3,
Time = 4,
Memo = 5,
Color = 6,
Bool = 7,
Radio = 8,
Image = 9,
File = 10,
ProgressBar = 11,
Combobox = 12,
FileLink = 13,
Device = 14,
GeoFence = 15
}
JSON
Calling:
http://localhost:8300/EnumDrivers/Demo http://localhost:8300/EnumDrivers?schemaID=Demo
Parameter Demo – schema id from EnumSchemas.