HDao_mile1.ice 2.27 KB
module HDaoMile
{
	/*==========================================================
	 *            Mileage Statistics
	 *==========================================================*/
	/******* common  *********/		
	struct GpsPos
	{
		int    gpsTime;
		int    lng;
		int    lat;
		string addr;
	};

	/*--------------------
	   apType: also named as devType, its value defined as below:
	   2: OBD;
	   4: DDbox(DVD)
	   5: Tracker
	   6: rearMirror
	   7: car recorder
	 ---------------------*/
	 	  
	/*--------------------
	 oprResult: 
	   0: OK
	   1: reserved
	   other: operation failed
	 ---------------------*/
	
	
	/******** Start mileage statistics  *************/
	
	struct MileStatBeginRequest
	{
		long userID;
		int  apType;
		int  beginTime;
	};
	
	struct MileStatBeginResponse
	{
		int oprResult;
	};
	
	
	/******* End mileage statistics  *********/
	struct MileStatEndRequest
	{
		long userID;
		int  apType;
		int  beginTime;
		int  endTime;
		bool bRetGpsTime; 
	};

	struct MileStatEndResponse
	{
		int oprResult;
		int mileage;		/* unit: meter */
		GpsPos beginPos;
		GpsPos endPos;
		float  over80Percent;   /* percentage of gpsPoints that are over speed ranging from 80km/h to 120km/h */
		float  over120Percent;  /* percentage of gpsPoints that are over speed above 120km/h */
		int    maxSpeed;        /* unit: km/h */
		int    gpsBgnTime;			/* time of the first gps record of the journey. Maybe filled if bRetGpsTime is true */
		int    gpsEndTime;      /* time of the last gps record of the journey. Maybe filled if bRetGpsTime is true */
	};
	
	/******* mileage statistics  *********/
	struct MileStatRequest
	{
		long userID;
		int  apType;
		int  beginTime;
		int  endTime;
	};

	struct MileStatResponse
	{
		int oprResult;
		int mileage;		/* unit: meter */
		GpsPos beginPos;
		GpsPos endPos;
		float  over80Percent;   /* 超速gps点(80km/h-120km/h) 占行程的百分比 */
		float  over120Percent;  /* 超速gps点(120km/h以上) 占行程的百分比 */
		int    maxSpeed;        /* unit: km/h */
	};
	
	// service interface
	interface DaoMileService
	{		
		/* Mile Stat related */
		bool beginUserMileStat(MileStatBeginRequest req, out MileStatBeginResponse res);
		bool endUserMileStat(MileStatEndRequest req, out MileStatEndResponse res);
		bool JourneyMileStat(MileStatRequest req, out MileStatResponse res);
	};
};