AutoGRAPH.NET Service GetTrips (EN) — различия между версиями
Admin (обсуждение | вклад) (Новая страница: «Get trips of device(s) for period. == WCF == Definition: <syntaxhighlight lang="csharp"> Dictionary<Guid,RTrips> GetTrips(string schemaName, Guid[] deviceI…») |
Admin (обсуждение | вклад) (→WCF) |
||
(не показаны 3 промежуточные версии этого же участника) | |||
Строка 3: | Строка 3: | ||
== WCF == |
== WCF == |
||
− | Definition: |
+ | Definition: |
− | Dictionary<Guid,RTrips> GetTrips(string |
+ | <pre>Dictionary<Guid,RTrips> GetTrips(string schemaID, Guid[] deviceIDs, DateTime SD, DateTime ED)</pre> |
− | </syntaxhighlight> |
||
− | * |
+ | *schemaID – schema ID |
− | *deviceIDs – device ID list (from |
+ | *deviceIDs – device ID list (from [[AutoGRAPH.NET Service EnumDevices (EN)|EnumDevices]] – ID field in RGroupItem class) |
*SD / ED – date/time of start and end period. Date/time must be local. |
*SD / ED – date/time of start and end period. Date/time must be local. |
||
+ | Result: |
||
− | Result: <syntaxhighlight lang="csharp"> |
||
+ | <pre> |
||
public class RTrips |
public class RTrips |
||
{ |
{ |
||
Строка 51: | Строка 51: | ||
public object[] Values { get; set; } // values for columns (count and order of columns is same of RTripStage.Params) |
public object[] Values { get; set; } // values for columns (count and order of columns is same of RTripStage.Params) |
||
} |
} |
||
+ | </pre> |
||
− | </syntaxhighlight> |
||
− | Returned data matching |
+ | Returned data matching with [[AutoGRAPH.NET]]: |
{| border="0" cellspacing="0" cellpadding="0" style="width: 100%;" |
{| border="0" cellspacing="0" cellpadding="0" style="width: 100%;" |
||
Строка 65: | Строка 65: | ||
http://localhost:8300/GetTrips/Demo/25f86189-adc9-445d-940c-abf860874622,d090286c-1fd6-4ef2-ae44-8091d04408d1/20150413-0000/20150413-2359</pre> |
http://localhost:8300/GetTrips/Demo/25f86189-adc9-445d-940c-abf860874622,d090286c-1fd6-4ef2-ae44-8091d04408d1/20150413-0000/20150413-2359</pre> |
||
− | Date/time must be passed |
+ | Date/time must be passed in '''yyyyMMdd-HHmm''' format<br/>If you want pass many device IDs - you must pass this ID's as comma-separated. |
Result: [[Media:GetTrips-result.json.txt|download file]] |
Result: [[Media:GetTrips-result.json.txt|download file]] |
Текущая версия на 13:56, 11 февраля 2016
Get trips of device(s) for period.
WCF
Definition:
Dictionary<Guid,RTrips> GetTrips(string schemaID, Guid[] deviceIDs, DateTime SD, DateTime ED)
- schemaID – schema ID
- deviceIDs – device ID list (from EnumDevices – ID field in RGroupItem class)
- SD / ED – date/time of start and end period. Date/time must be local.
Result:
public class RTrips { public Guid ID { get; set; } // device ID public string Name { get; set; } // device name public RTrip[] Trips { get; set; } // trips public Dictionary<string,object> Total { get; set; } // final data } public class RTrip { public int Index { get; set; } // trip index, starting from 0 public DateTime SD { get; set; } // UTC date/time of trip start public DateTime ED { get; set; } // UTC date/time of trip end public RPoint PointStart { get; set; } // location of trip start public RPoint PointEnd { get; set; } // location of trip end public RTripStage[] Stages { get; set; } // trip stages (fuel, geofeofences, sensors switching, etc) public Dictionary<string,object> Total { get; set; } // trips parameters (=columns) } public class RTripStage // trip stage (fuel pumping, stops, geofences, etc) { public string Name { get; set; } // internal stage name (for example, Stops for stops and GeoFence1 for geofences) public string[] Params { get; set; } // list of columns in stage - for example "Motion", "Daylight", "Speed", "Speed Avg" public RTripStageItem[] Items { get; set; } // rows(=items) of stage public RParameterStatus[] Statuses { get; set; } // list of available statuses for this stage ("Flight", "Stopped", "Motion" for "Motion" stage for example) public Dictionary<string,object> Total { get; set; } // final data for stage (=summary data for all items) } public class RTripStageItem { public int Index { get; set; } // stage item index, starting from 0 public DateTime SD { get; set; } // UTC date/time of item start public DateTime ED { get; set; } // UTC date/time of item end public int Status { get; set; } // status ID (0 = of status (or between switchings), >0 = index of status in Statuses RTripStage.field) public Guid StatusID { get; set; } // ID of geofence (if stage for geofence) public Guid[] StatusIDs { get; set; } // ID of additional geofences (if schema has overlapped geofences and device in some geofences in one time) public string Caption { get; set; } // UI friendly status name (Move, Park, ...), geofence name, driver first/last name, ... public object[] Values { get; set; } // values for columns (count and order of columns is same of RTripStage.Params) }
Returned data matching with AutoGRAPH.NET:
JSON
Calling:
http://localhost:8300/GetTrips/Demo/25f86189-adc9-445d-940c-abf860874622/20150413-0000/20150413-2359 http://localhost:8300/GetTrips/Demo/25f86189-adc9-445d-940c-abf860874622,d090286c-1fd6-4ef2-ae44-8091d04408d1/20150413-0000/20150413-2359
Date/time must be passed in yyyyMMdd-HHmm format
If you want pass many device IDs - you must pass this ID's as comma-separated.
Result: download file