AutoGRAPH.NET Service EnumGeoFences (EN)

Материал из TK
Версия от 11:51, 11 февраля 2016; Admin (обсуждение | вклад) (Новая страница: «Get geofence list and groups in specified schema (like EnumDevices for geofences). You can restore hierarchy by matchin…»)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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

WCF

Definition:

REnumGeofences EnumGeoFences(string schemaID)

Result:

public class REnumGeofences {
  public RGroupItem[] Groups { get; set; }   // groups
  public RGeofenceItem[] Items { get; set; } // geofences
}

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

public class RGeofenceItem : RGroupItem {
  public RProperty[] Properties { get; set; } // list of geofence property (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

Вызов:

http://localhost:8300/EnumGeoFences/Demo
http://localhost:8300/EnumGeoFences?schemaID=Demo

Результат: скачать файл

AutoGRAPHNET Service EnumGeoFences.png