AutoGRAPH.NET Service GetTrips (EN)
Версия от 13:53, 11 февраля 2016; Admin (обсуждение | вклад)
Get trips of device(s) for period.
WCF
Definition:
Dictionary<Guid,RTrips> GetTrips(string schemaName, Guid[] deviceIDs, DateTime SD, DateTime ED)
- schemaName – schema name from EnumSchemas
- 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