AutoGRAPH.NET Service EnumDrivers (EN) — различия между версиями

Материал из TK
Перейти к: навигация, поиск
(Новая страница: «Get drivers and driver groups in specified schema (like EnumDevices or[AutoGRAPH.NET Service EnumGeoFences(EN)|EnumGeoFe…»)
 
Строка 3: Строка 3:
 
== WCF ==
 
== WCF ==
   
Definition: <syntaxhighlight lang="csharp">
+
Definition:
REnumDevices EnumDrivers(string schemaName)
+
<pre>REnumDevices EnumDrivers(string schemaName)</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)
 
}
 
}
  +
</pre>
</syntaxhighlight>
 
   
 
== JSON ==
 
== JSON ==
   
  +
Calling: <pre>http://localhost:8300/EnumDrivers/Demo</pre>
Calling: <syntaxhighlight lang="html4strict">
 
http://localhost:8300/EnumDrivers/Demo
 
</syntaxhighlight>
 
   
 
Parameter Demo – schema name from [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]].
 
Parameter Demo – schema name from [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]].

Версия 22:12, 27 сентября 2015

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 schemaName)

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)
}

JSON

Calling:

http://localhost:8300/EnumDrivers/Demo

Parameter Demo – schema name from EnumSchemas.