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

Материал из TK
Перейти к: навигация, поиск
 
Строка 27: Строка 27:
 
public RProperty[] Properties { get; set; } // list of device property (inherited properties also included)
 
public RProperty[] Properties { get; set; } // list of device property (inherited properties also included)
 
public RPoint FixedLocation { get; set; } // if this device is stationary, this field contain coordinates
 
public RPoint FixedLocation { get; set; } // if this device is stationary, this field contain coordinates
public string Imge { get;set; } // image file name with device image (.png)
+
public string Img { get;set; } // image file name with device image (.png)
 
public RTripSplitter[] TripSplitters { get; set; } // configured trip splitters for this device
 
public RTripSplitter[] TripSplitters { get; set; } // configured trip splitters for this device
 
}
 
}

Текущая версия на 11:47, 11 февраля 2016

Get device list and groups in specified schema (like EnumGeoFences for geofences). You can restore hierarchy by matching ID ⇔ ParentID, starting from top level (root node have ParentID==null).

WCF

Definition:

REnumDevices EnumDevices(string schemaID)

Result:

public class REnumDevices
{
   public RGroupItem[] Groups { get; set; } // groups
   public RDeviceItem[] Items { get; set; } // devices
}

public class RGroupItem
{
   public Guid ID { get; set; }             // unique device ID in schema
   public Guid? ParentID { get; set; }      // ID of parent group
   public string Name { get; set; }         // group name
}

public class RDeviceItem : RGroupItem
{
   public int Serial { get; set; }          // device serial number
   public bool Allowed { get; set; }        // allowed or not ( = included this device in .agkey file)
   public RProperty[] Properties { get; set; } // list of device property (inherited properties also included)
   public RPoint FixedLocation { get; set; }   // if this device is stationary, this field contain coordinates
   public string Img { get;set; }             // image file name with device image (.png)
   public RTripSplitter[] TripSplitters { get; set; } // configured trip splitters for this device
}

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/EnumDevices/Demo
http://localhost:8300/EnumDevices?schemaID=Demo

Parameter Demo – schema name EnumSchemas.

Result: download file

AutoGRAPHNET Service EnumDevices.png