AutoGRAPH.NET Service EnumDrivers (EN)

Материал из TK
Перейти к: навигация, поиск

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.