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

Материал из TK
Перейти к: навигация, поиск
(Новая страница: «Get information about device last position. == WCF == Definition: <syntaxhighlight lang="csharp">Dictionary<Guid, ROnlineInfo> GetOnlineInfo(string schemaName,…»)
 
Строка 3: Строка 3:
 
== WCF ==
 
== WCF ==
   
  +
Definition:
Definition: <syntaxhighlight lang="csharp">Dictionary<Guid, ROnlineInfo> GetOnlineInfo(string schemaName, Guid[] deviceIDs)</syntaxhighlight>
 
  +
<pre>Dictionary<Guid, ROnlineInfo> GetOnlineInfo(string schemaName, Guid[] deviceIDs)</pre>
   
 
deviceGuids – list of device ID's (from [[AutoGRAPH.NET Service EnumDevices|EnumDevices]]&nbsp;list – ID field in RGroupItem)
 
deviceGuids – list of device ID's (from [[AutoGRAPH.NET Service EnumDevices|EnumDevices]]&nbsp;list – ID field in RGroupItem)
   
  +
Result:
Result: <syntaxhighlight lang="csharp">
 
  +
<pre>
 
public class ROnlineInfo
 
public class ROnlineInfo
 
{
 
{
Строка 33: Строка 35:
 
public double Lng { get; set; } // longitude
 
public double Lng { get; set; } // longitude
 
}
 
}
  +
</pre>
</syntaxhighlight>
 
   
 
== JSON ==
 
== JSON ==

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

Get information about device last position.

WCF

Definition:

Dictionary<Guid, ROnlineInfo> GetOnlineInfo(string schemaName, Guid[] deviceIDs)

deviceGuids – list of device ID's (from EnumDevices list – ID field in RGroupItem)

Result:

public class ROnlineInfo
{
   public Guid ID { get; set; }                // device ID
   public string Name { get; set; }            // device name
   public RPoint LastPosition { get; set; }    // point of last position or null if no data or last position unknown
   public DateTime DT { get; set; }            // UTC date and time of last position
   public ROnlineState State { get; set; }     // device state
   public double Speed { get; set; }           // speed (in KM/H)
   public double Course { get; set; }          // direction of moving  in degrees (Nord is 0 degrees) or -1 if no coordinates
   public string Address { get; set; }         // address as string of last position or null if no coordinates
   public Dictionary<string,object> Final {get; set; } // final parameters
}

public enum ROnlineState
{
   Park = 0,     // stopped
   Move = 1,     // moving
   Flight = 2    // flying
}

public class RPoint
{
   public double Lat { get; set; }     // latitude
   public double Lng { get; set; }     // longitude
}

JSON

Calling:

http://localhost:8300/GetOnlineInfo/Demo/2682e6d3-5055-4a3b-b9c8-0b723c57512a,25f86189-adc9-445d-940c-abf860874622

If you want to pass many ID's in call - you must pass this identifiers as comma-separated.

Result: download file

AutoGRAPHNET Service GetOnlineInfo.png