📄 scapi.h
字号:
/** \file ScApi.h
* \brief sc的接口函数导出文件。在此文件中定义了所有导出函数。
*/
#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, ///< 航程点个数(索引)最大值
SC_WAYPOINT_START = 0, ///< 起点索引
SC_WAYPOINT_END = 99, ///< 终点索引
SC_POITYPENAME_MAXSIZE = 64, ///< POI类别名称的最大长度
SC_OP_POINAME_MAXSIZE = 32 , ///< POI名字长度
SC_OP_DEVICENAME_MAXSIZE = 256, ///< GPS设备名称长度
SC_OP_SOUNDNAME_MAXSIZE = 256,
SC_OP_TELE_MAXSIZE = 20, ///< 电话号码最大长度
SC_OP_ADDR_MAXSIZE = 64, ///< 地址最大长度
SC_OP_DIST_MAXSIZE = 64, ///< 行政区划名称最大长度
SC_MAX_PATH = 256, ///< 路径最大长度
};
/**
* 窗口坐标(设备坐标)
*/
class ScDevPoint
{
public:
ScInt x;
ScInt y;
};
/**
* 地图坐标(逻辑坐标)
*/
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;
/**
* 动态绘制信息
* 这些信息只在本次调用中有效
* 请不要保存这些信息的值
*/
typedef struct ScDrawInfo
{
/**
* 当前道路名
*/
ScWChar szRoadName[64];
/**
* 下一路口接续道路名称
*/
ScWChar szNextName[64];
/**
* 窗口范围,绘制时请确保在此范围之内
*/
ScRect rcWindow;
/**
* 车辆位置(屏幕坐标)
*/
ScDevPoint ptVehicle;
/**
* 查询结果标注点(屏幕坐标)
*/
ScDevPoint ptSearch;
/**
* 是否添加查询结果标注点(屏幕坐标)
*/
bool bSearchFlag ;
/**
* 车辆位置是否在当前窗口内部:0:不在,1:在
*/
ScLong nVehicleFlag;
/**
* 航程点屏幕坐标
*/
ScDevPoint ptWayPoint[12];
/**
* 航程点序号
*/
ScLong nWayPointIndex[12];
/**
* 航程点是否在当前窗口内部 , 0:不在, 1:在
*/
ScLong nWayPointFlag[12];
/**
* 航程点个数
*/
ScLong nWayPointCount;
/**
* 窗口句柄,即调用ScInit时传入之窗口
*/
ScLong hWnd;
/**
* 绘制设备上下文,绘制时请使用
*/
ScLong hDC;
/**
* 比例尺数值
*/
ScLong nScale;
/**
* 汽车行驶方向,角度(单位为0.001度)
*/
ScLong nDirection;
/**
* 车速,(单位为1m/s)
*/
ScLong nSpeed;
/**
* 目的地距离 单位为m
*/
ScLong nTargetDis;
/**
* 到达类型 > 0 有效
*/
ScLong nReachType;
/**
* 下一路口状态, 1-8有效
*/
ScLong nCrossType;
/**
* 下一路口距离
*/
ScLong nCrossDis;
/**
* 剩余时间(以1s为单位)
*/
ScLong nLeftTime;
/**
* 是否有声音
*/
ScLong nSoundStatus;
/**
* gps状态
*/
ScLong nGpsStatus;
/**
* 消息来源
*/
ScLong nSource;
/**
* 是否TurnByTurn模式
*/
ScBool bTurnByTurn;
/**
* 车头向上与否
*/
ScBool bNorthUp;
/**
* 白天黑夜
*/
ScInt bDayMode;
/**
* 是否打开路口放大图
*/
ScInt bCGOn;
} ScDrawInfo;
/**
* 错误信息
*/
typedef struct ScErrorInfo
{
/**
* 错误代码
*/
ScInt hrErrorCode;
/**
* 错误所在模块的模块ID
*/
ScInt moduleid;
/**
* 发送此消息的线程HANDLE
*/
ScInt threadhandle;
/**
* 错误类型
*/
ScInt type;
/**
* 附加信息
*/
ScInt tag;
/**
* 附加信息
*/
ScWChar stag[64];
} ScErrorInfo;
class MessageQueue_out;
/**
* 启动参数
* 所有传入的目录要求最后带'\'字符(win32)
* 工作目录下的内容: 配置文件, profile子目录,voice子目录。
*/
typedef struct ScStartupParams
{
ScWChar sAppDir[256]; ///< 应用程序所在目录,readonly权限即可。
ScWChar sWorkDir[256]; ///< 工作目录,需要readwrite权限
ScApObserver *pApo; ///< 事件回调对象,不响应事件时可为0
ScDebugWnd *pDebug; ///< 调试信息对象,不响应调试信息时可为0
ScLong hWnd; ///< 窗口,目前没有用到,可为0
ScLong reserved; ///< 为0
#ifdef __SYMBIAN32__
MessageQueue_out * m_message;
#endif
}ScStartupParams;
/**
* GPS状态数据
*/
struct ScGPSStatusInfo
{
/** 定位信息
*/
struct ScGPSPositionInfo
{
ScLogPoint position; ///< 经纬度
ScInt status; ///< GPS状态
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 數字:01 至 32 表天空使用中的衛星編號,最多可接收12顆衛星資訊。
- <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; ///< 可用卫星数目
ScInt SingnalQuality; ///< 信号质量(信噪比平均值)
/** GPS时间定义
*/
struct SUTCTime
{
long year;
long mon;
long day;
long hour;
long min;
long sec;
} UTCTime; ///< GPS时间;
} PositionInfo; ///< GPS位置信息
/**
* 星历信息
*/
struct ScGPSStarInfo
{
/**
* GPS卫星
*/
struct ScGPSStar
{
ScInt sat_no; ///< 卫星ID. id范围[0-32]
ScInt elev; ///< 卫星仰角
ScInt azim; ///< 卫星水平角
ScInt snr; ///< 信号强度
} stars[12]; ///< GPS卫星列表。同时最多可用12个
ScInt starcount; ///< 当前可见卫星个数
}StarInfo;
};
/** POI对象ID
*/
typedef struct ObjecteId
{
long LowPart;
long HighPart;
}ScObjecteId;
/**
* POI地理坐标
*/
typedef struct ObjPoint
{
/**
* NTU 单位为1/100000度
*/
long m_lLongitude;
/**
* NTU 单位为1/100000度
*/
long m_lLatitude;
}ScObjPoint;
/**
* POI详细信息
*/
typedef struct POIDetailItem
{
/** 对象ID
*/
ScObjecteId m_objected;
/** 位置
*/
ScObjPoint m_point;
/** 所在行政区
*/
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;
/**
* 路径规划结果项
*/
typedef struct ScRouteItem
{
ScWChar sRoadName[SC_ROADNAME_MAXSIZE]; ///< 道路名
ScInt nTurnType; ///< 拐弯方向
ScLogPoint point; ///< 位置,用于定位
ScLong distance2next; ///< 到下一机动的距离
ScLong distance2goal; ///< 到目的地的距离
// 路段 ID。
ScLong idHigh; //高位
ScLong idLow; //低位
}ScRouteItem;
/**
* 注册信息
*/
typedef struct ScRegisterInfo
{
/** 机器码
*/
byte MachineSN[128];
/** 产品码
*/
byte ProductSN[25];
/** 安装码
*/
byte InstallCode[30];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -