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

Материал из TK
Перейти к: навигация, поиск
 
Строка 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:
<pre>REnumDevices EnumDrivers(string schemaName)</pre>
+
<pre>REnumDevices EnumDrivers(string schemaID)</pre>
   
 
Result:
 
Result:
Строка 25: Строка 25:
 
public string DriverID { get; set; } // driver ID (iButton or wireless card ID)
 
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 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
 
}
 
}
 
</pre>
 
</pre>
   
 
== JSON ==
 
== JSON ==
  +
Calling:
  +
<pre>
  +
http://localhost:8300/EnumDrivers/Demo
  +
http://localhost:8300/EnumDrivers?schemaID=Demo
  +
</pre>
   
  +
Parameter Demo – schema id from [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]].
Calling: <pre>http://localhost:8300/EnumDrivers/Demo</pre>
 
 
Parameter Demo – schema name 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.