?? scapi.h
字號:
/** \file ScApi.h
* \brief sc的接口函數(shù)導(dǎo)出文件。在此文件中定義了所有導(dǎo)出函數(shù)。
*/
#ifndef __SCAPI_H__
#define __SCAPI_H__
#include <string.h>
#include <stdio.h>
#if defined(SC_EXPORTS) || defined(_LIB)
#include "oslayer.h"
#endif
#ifdef WIN32
#include <windows.h>
// win32
#ifndef SC_API
#if !defined(_LIB) && !defined(USE_SCLIB)
#define SC_API __declspec(dllimport)
#else
#define SC_API
#endif
#endif
#else
#ifdef __SYMBIAN32__
// symbian32
#ifndef SC_API
#define SC_API
#endif
// linux
#else
#ifndef SC_API
#define SC_API
#endif
#endif
#endif
///////////////////類型定義///////////////////////////////////////
#include "sctypes.h"
//前置定義
struct ScRect;
struct ScStartupParams;
struct ScGPSStatusInfo;
class ScDebugWnd;
class ScApObserver;
class ScDevPoint;
class ScLogPoint;
//enum ScTurnType; //for linux:定義提前,所以不需要前置定義
enum
{
SC_ROADNAME_MAXSIZE = 64, ///< 道路名稱長度最大值
SC_WAYPOINT_MAXCOUNT = 11, ///< 航程點(diǎn)個數(shù)(索引)最大值
SC_WAYPOINT_START = 0, ///< 起點(diǎn)索引
SC_WAYPOINT_END = 99, ///< 終點(diǎn)索引
SC_POITYPENAME_MAXSIZE = 64, ///< POI類別名稱的最大長度
SC_OP_POINAME_MAXSIZE = 32 , ///< POI名字長度
SC_OP_DEVICENAME_MAXSIZE = 256, ///< GPS設(shè)備名稱長度
SC_OP_SOUNDNAME_MAXSIZE = 256,
SC_OP_TELE_MAXSIZE = 20, ///< 電話號碼最大長度
SC_OP_ADDR_MAXSIZE = 64, ///< 地址最大長度
SC_OP_DIST_MAXSIZE = 64, ///< 行政區(qū)劃名稱最大長度
SC_MAX_PATH = 256, ///< 路徑最大長度
};
/**
* 窗口坐標(biāo)(設(shè)備坐標(biāo))
*/
class ScDevPoint
{
public:
ScInt x;
ScInt y;
};
/**
* 地圖坐標(biāo)(邏輯坐標(biāo))
*/
class ScLogPoint
{
public:
union {
ScInt longitude;
ScInt m_lLongtitude; //兼容SMG_Point
};
union {
ScInt latitude;
ScInt m_lLatitude; //兼容SMG_Point
};
};
/**
* 矩形
*/
typedef struct ScRect
{
ScLong left;
ScLong top;
ScLong right;
ScLong bottom;
}ScRect;
/**
* 動態(tài)繪制信息
* 這些信息只在本次調(diào)用中有效
* 請不要保存這些信息的值
*/
typedef struct ScDrawInfo
{
/**
* 當(dāng)前道路名
*/
ScWChar szRoadName[64];
/**
* 下一路口接續(xù)道路名稱
*/
ScWChar szNextName[64];
/**
* 窗口范圍,繪制時請確保在此范圍之內(nèi)
*/
ScRect rcWindow;
/**
* 車輛位置(屏幕坐標(biāo))
*/
ScDevPoint ptVehicle;
/**
* 查詢結(jié)果標(biāo)注點(diǎn)(屏幕坐標(biāo))
*/
ScDevPoint ptSearch;
/**
* 是否添加查詢結(jié)果標(biāo)注點(diǎn)(屏幕坐標(biāo))
*/
bool bSearchFlag ;
/**
* 車輛位置是否在當(dāng)前窗口內(nèi)部:0:不在,1:在
*/
ScLong nVehicleFlag;
/**
* 航程點(diǎn)屏幕坐標(biāo)
*/
ScDevPoint ptWayPoint[12];
/**
* 航程點(diǎn)序號
*/
ScLong nWayPointIndex[12];
/**
* 航程點(diǎn)是否在當(dāng)前窗口內(nèi)部 , 0:不在, 1:在
*/
ScLong nWayPointFlag[12];
/**
* 航程點(diǎn)個數(shù)
*/
ScLong nWayPointCount;
/**
* 窗口句柄,即調(diào)用ScInit時傳入之窗口
*/
ScLong hWnd;
/**
* 繪制設(shè)備上下文,繪制時請使用
*/
ScLong hDC;
/**
* 比例尺數(shù)值
*/
ScLong nScale;
/**
* 汽車行駛方向,角度(單位為0.001度)
*/
ScLong nDirection;
/**
* 車速,(單位為1m/s)
*/
ScLong nSpeed;
/**
* 目的地距離 單位為m
*/
ScLong nTargetDis;
/**
* 到達(dá)類型 > 0 有效
*/
ScLong nReachType;
/**
* 下一路口狀態(tài), 1-8有效
*/
ScLong nCrossType;
/**
* 下一路口距離
*/
ScLong nCrossDis;
/**
* 剩余時間(以1s為單位)
*/
ScLong nLeftTime;
/**
* 是否有聲音
*/
ScLong nSoundStatus;
/**
* gps狀態(tài)
*/
ScLong nGpsStatus;
/**
* 消息來源
*/
ScLong nSource;
/**
* 是否TurnByTurn模式
*/
ScBool bTurnByTurn;
/**
* 車頭向上與否
*/
ScBool bNorthUp;
/**
* 白天黑夜
*/
ScInt bDayMode;
/**
* 是否打開路口放大圖
*/
ScInt bCGOn;
} ScDrawInfo;
/**
* 錯誤信息
*/
typedef struct ScErrorInfo
{
/**
* 錯誤代碼
*/
ScInt hrErrorCode;
/**
* 錯誤所在模塊的模塊ID
*/
ScInt moduleid;
/**
* 發(fā)送此消息的線程HANDLE
*/
ScInt threadhandle;
/**
* 錯誤類型
*/
ScInt type;
/**
* 附加信息
*/
ScInt tag;
/**
* 附加信息
*/
ScWChar stag[64];
} ScErrorInfo;
class MessageQueue_out;
/**
* 啟動參數(shù)
* 所有傳入的目錄要求最后帶'\'字符(win32)
* 工作目錄下的內(nèi)容: 配置文件, profile子目錄,voice子目錄。
*/
typedef struct ScStartupParams
{
ScWChar sAppDir[256]; ///< 應(yīng)用程序所在目錄,readonly權(quán)限即可。
ScWChar sWorkDir[256]; ///< 工作目錄,需要readwrite權(quán)限
ScApObserver *pApo; ///< 事件回調(diào)對象,不響應(yīng)事件時可為0
ScDebugWnd *pDebug; ///< 調(diào)試信息對象,不響應(yīng)調(diào)試信息時可為0
ScLong hWnd; ///< 窗口,目前沒有用到,可為0
ScLong reserved; ///< 為0
#ifdef __SYMBIAN32__
MessageQueue_out * m_message;
#endif
}ScStartupParams;
/**
* GPS狀態(tài)數(shù)據(jù)
*/
struct ScGPSStatusInfo
{
/** 定位信息
*/
struct ScGPSPositionInfo
{
ScLogPoint position; ///< 經(jīng)緯度
ScInt status; ///< GPS狀態(tài)
ScInt heading; ///< 方位角
ScInt speed; ///< 速度
ScInt Hei; ///< 海拔
ScInt timestamp;
/*
$GPGSA,<1>,<2>,<3>,<3>,,,,,<3>,<3>,<3>,<4>,<5>,<6>,<7><CR><LF>。
- <1> 模式 2:M = 手動, A = 自動。
- <2> 模式 1:定位型式 1 = 未定位, 2 = 二維定位, 3 = 三維定位。\n
3顆星為2維定位模式。>3顆星為3維定位.
- <3> PRN 數(shù)字:01 至 32 表天空使用中的衛(wèi)星編號,最多可接收12顆衛(wèi)星資訊。
- <4> PDOP-位置精度稀釋 0.5 至 99.9. 。
- <5> HDOP-水平精度稀釋 0.5 to 99.9. 。
- <6> VDOP-垂直精度稀釋 0.5 to 99.9. 。
- <7> Checksum.(檢查位元). 。
*/
ScInt HDOP;
ScInt PosMode; ///< 定位模式
ScInt usableSatNum; ///< 可用衛(wèi)星數(shù)目
ScInt SingnalQuality; ///< 信號質(zhì)量(信噪比平均值)
/** GPS時間定義
*/
struct SUTCTime
{
long year;
long mon;
long day;
long hour;
long min;
long sec;
} UTCTime; ///< GPS時間;
} PositionInfo; ///< GPS位置信息
/**
* 星歷信息
*/
struct ScGPSStarInfo
{
/**
* GPS衛(wèi)星
*/
struct ScGPSStar
{
ScInt sat_no; ///< 衛(wèi)星ID. id范圍[0-32]
ScInt elev; ///< 衛(wèi)星仰角
ScInt azim; ///< 衛(wèi)星水平角
ScInt snr; ///< 信號強(qiáng)度
} stars[12]; ///< GPS衛(wèi)星列表。同時最多可用12個
ScInt starcount; ///< 當(dāng)前可見衛(wèi)星個數(shù)
}StarInfo;
};
/** POI對象ID
*/
typedef struct ObjecteId
{
long LowPart;
long HighPart;
}ScObjecteId;
/**
* POI地理坐標(biāo)
*/
typedef struct ObjPoint
{
/**
* NTU 單位為1/100000度
*/
long m_lLongitude;
/**
* NTU 單位為1/100000度
*/
long m_lLatitude;
}ScObjPoint;
/**
* POI詳細(xì)信息
*/
typedef struct POIDetailItem
{
/** 對象ID
*/
ScObjecteId m_objected;
/** 位置
*/
ScObjPoint m_point;
/** 所在行政區(qū)
*/
ScWChar m_sRegion[64];
/** 對象名稱
*/
ScWChar m_sName[64];
}ScPOIDetailItem;
/**
* 路徑拐彎方向
*/
typedef enum ScTurnType
{
SC_DIRECTION_UP = 0x00, ///< 上方
SC_DIRECTION_RIGHT_UP = 0x20, ///< 右上方
SC_DIRECTION_RIGHT = 0x40, ///< 右
SC_DIRECTION_RIGHT_DOWN = 0x60, ///< 右下
SC_DIRECTION_DOWN = 0x80, ///< 下
SC_DIRECTION_LEFT_DOWN = 0x100, ///< 左下
SC_DIRECTION_LEFT = 0x120, ///< 左
SC_DIRECTION_LEFT_UP = 0x140, ///< 左上
} ScTurnType;
/**
* 路徑規(guī)劃結(jié)果項(xiàng)
*/
typedef struct ScRouteItem
{
ScWChar sRoadName[SC_ROADNAME_MAXSIZE]; ///< 道路名
ScInt nTurnType; ///< 拐彎方向
ScLogPoint point; ///< 位置,用于定位
ScLong distance2next; ///< 到下一機(jī)動的距離
ScLong distance2goal; ///< 到目的地的距離
// 路段 ID。
ScLong idHigh; //高位
ScLong idLow; //低位
}ScRouteItem;
/**
* 注冊信息
*/
typedef struct ScRegisterInfo
{
/** 機(jī)器碼
*/
byte MachineSN[128];
/** 產(chǎn)品碼
*/
byte ProductSN[25];
/** 安裝碼
*/
byte InstallCode[30];
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -