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

Материал из TK
Перейти к: навигация, поиск
(Новая страница: «Get device list and groups in specified schema (like EnumGeoFences for geofences). You can restore hierarchy by matching I…»)
 
Строка 3: Строка 3:
 
== WCF ==
 
== WCF ==
   
Definition: <syntaxhighlight lang="csharp">
+
Definition:
REnumDevices EnumDevices(string schemaName)
+
<pre>REnumDevices EnumDevices(string schemaName)</pre>
</syntaxhighlight>
 
   
  +
Result:
Result: <syntaxhighlight lang="csharp">
 
  +
<pre>
 
public class REnumDevices
 
public class REnumDevices
 
{
 
{
Строка 28: Строка 28:
 
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
 
}
 
}
  +
</pre>
</syntaxhighlight>
 
   
 
== JSON ==
 
== JSON ==
   
  +
Calling:
Calling: <syntaxhighlight lang="html4strict">
 
http://localhost:8300/EnumDevices/Demo
+
<pre>http://localhost:8300/EnumDevices/Demo</pre>
</syntaxhighlight>
 
   
 
Parameter Demo – schema name [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]].
 
Parameter Demo – schema name [[AutoGRAPH.NET Service EnumSchemas|EnumSchemas]].

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

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

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
}

JSON

Calling:

http://localhost:8300/EnumDevices/Demo

Parameter Demo – schema name EnumSchemas.

Result: download file

AutoGRAPHNET Service EnumDevices.png