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

Материал из TK
Перейти к: навигация, поиск
(WCF)
 
(не показана 1 промежуточная версия этого же участника)
Строка 4: Строка 4:
   
 
Definition:
 
Definition:
<pre>Dictionary<Guid,RTrips> GetTrips(string schemaName, Guid[] deviceIDs, DateTime SD, DateTime ED)</pre>
+
<pre>Dictionary<Guid,RTrips> GetTrips(string schemaID, Guid[] deviceIDs, DateTime SD, DateTime ED)</pre>
   
*schemaName – schema name from EnumSchemas
+
*schemaID – schema ID
*deviceIDs – device ID list (from [[AutoGRAPH.NET Service EnumDevices|EnumDevices]] – ID field in RGroupItem class)
+
*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.
   

Текущая версия на 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:

AutoGRAPHNET_Service_GetTrips_table.png

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

AutoGRAPHNET Service GetTrips.png