Merge branch 'dev' of http://88.22.24.105:3000/harmony_car/subject-two into dev
This commit is contained in:
commit
a22a8b1b00
@ -74,6 +74,7 @@ typedef int (JUDGE_SDK_METHOD *examJudgeMapSetScalingHandle) (int
|
||||
typedef int (JUDGE_SDK_METHOD *examJudgeMapSetDrawingHandle) (bool drawing);
|
||||
typedef const char* (JUDGE_SDK_METHOD *examJudgeMapImageHandle) ();
|
||||
typedef const char* (JUDGE_SDK_METHOD *examJudgeMapImageSetCallbackHandle) (examJudgeCallbackMapImage callback);
|
||||
typedef double (JUDGE_SDK_METHOD *examCalcGpsDistanceHandle) (double jd1, double wd1, double jd2, double wd2, double h);
|
||||
|
||||
|
||||
/********************************************************************
|
||||
@ -207,7 +208,7 @@ JUDGE_SDK_API int JUDGE_SDK_METHOD examJudgeMapSetScaling(int scaling);
|
||||
JUDGE_SDK_API int JUDGE_SDK_METHOD examJudgeMapSetDrawing(bool drawing);
|
||||
|
||||
/*
|
||||
* 说明: 获取地图轨迹图像
|
||||
* 说明: 同步方式获取地图轨迹图像
|
||||
* 参数: (无)
|
||||
* 返回值: RGB图像,JS返回值类型:napi_uint8_clamped_array
|
||||
*/
|
||||
@ -215,12 +216,19 @@ JUDGE_SDK_DEPRECATED("Use [examJudgeMapImageSetCallback()] instead!")
|
||||
JUDGE_SDK_API const char* JUDGE_SDK_METHOD examJudgeMapImage();
|
||||
|
||||
/*
|
||||
* 说明: 设置地图轨迹图像回调函数
|
||||
* 说明: 异步方式设置地图轨迹图像回调函数
|
||||
* 参数: callback:轨迹图像异步回调函数,注意:回调函数里严禁有耗时操作
|
||||
* 返回值: 调用执行结果错误码 0:成功,其他:失败
|
||||
*/
|
||||
JUDGE_SDK_API int JUDGE_SDK_METHOD examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback);
|
||||
|
||||
/*
|
||||
* 说明: 计算GPS两点之间的距离
|
||||
* 参数: jd1:1点经度,wd1:1点纬度,jd2:2点经度,wd2:2点纬度,h:高层(高度差)
|
||||
* 返回值: 返回距离,单位厘米
|
||||
*/
|
||||
JUDGE_SDK_API double JUDGE_SDK_METHOD examCalcGpsDistance(double jd1, double wd1, double jd2, double wd2, double h);
|
||||
|
||||
|
||||
JUDGE_SDK_EXTERN_C_END
|
||||
|
||||
|
||||
@ -208,6 +208,13 @@ jint JNI_JUDGE_FUN_IMPL(examJudgeMapImageSetCallback)(JNIEnv* env, jobject thiz)
|
||||
return (jint)QE(code);
|
||||
}
|
||||
|
||||
jdouble JNI_JUDGE_FUN_IMPL(examCalcGpsDistance)(JNIEnv* env, jobject thiz, jdouble jd1, jdouble wd1, jdouble jd2, jdouble wd2, jdouble h)
|
||||
{
|
||||
logdebug("call JNI_examCalcGpsDistance");
|
||||
double distance = ExamService::examCalcGpsDistance(jd1, wd1, jd2, wd2, h);
|
||||
return (jdouble)distance;
|
||||
}
|
||||
|
||||
void JNIApiBridge::examJudgeCallbackLogToCaller(int level, const char* info, int len)
|
||||
{
|
||||
if(NULL == m_cbLog || level < LOG_LV_CLOSE || level > LOG_LV_ALL || NULL == info || len <= 0)
|
||||
|
||||
@ -32,13 +32,15 @@ public:
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeRealExam) (JNIEnv* env, jobject thiz, jstring data, jint len);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeSetRealExamCallback) (JNIEnv* env, jobject thiz);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeSetPerformCallback) (JNIEnv* env, jobject thiz);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeArtificialMark) (JNIEnv* env, jobject thiz, jint itemno, jstring seria, jint type);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeArtificialMark) (JNIEnv* env, jobject thiz, jint itemno, jstring serial, jint type);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeArtificialItem) (JNIEnv* env, jobject thiz, jint itemno, jint type);
|
||||
jstring JNI_JUDGE_FUN_DECL(examJudgeTrackFile) (JNIEnv* env, jobject thiz);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeMapSetParam) (JNIEnv* env, jobject thiz, jint width, jint height);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeMapSetScaling) (JNIEnv* env, jobject thiz, jint scaling);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeMapSetDrawing) (JNIEnv* env, jobject thiz, jboolean drawing);
|
||||
jbyteArray JNI_JUDGE_FUN_DECL(examJudgeMapImage) (JNIEnv* env, jobject thiz);
|
||||
jint JNI_JUDGE_FUN_DECL(examJudgeMapImageSetCallback) (JNIEnv* env, jobject thiz);
|
||||
jdouble JNI_JUDGE_FUN_DECL(examCalcGpsDistance) (JNIEnv* env, jobject thiz, jdouble jd1, jdouble wd1, jdouble jd2, jdouble wd2, jdouble h);
|
||||
|
||||
virtual void examJudgeCallbackLogToCaller(int level, const char* info, int len) override;
|
||||
virtual void examJudgeCallbackRealExamToCaller(const char* data, int len) override;
|
||||
|
||||
@ -25,6 +25,7 @@ JNIMethodTable::JNIMethodTable()
|
||||
jniSign(JNI_RET(jint), JNI_FUN(examJudgeMapSetDrawing), JNI_ARG(jboolean)); // "(Z)I"
|
||||
jniSign(JNI_RET(jbyteArray), JNI_FUN(examJudgeMapImage)); // "()[B"
|
||||
jniSign(JNI_RET(jint), JNI_FUN(examJudgeMapImageSetCallback)); // "()I"
|
||||
jniSign(JNI_RET(jdouble), JNI_FUN(examCalcGpsDistance), JNI_ARG(jdouble), JNI_ARG(jdouble), JNI_ARG(jdouble), JNI_ARG(jdouble), JNI_ARG(jdouble)); // "(DDDDD)D"
|
||||
|
||||
jniSign(JNI_RET(jvoid), JNI_FUN(examJudgeCallbackLog), JNI_ARG(jint), JNI_ARG(jstring), JNI_ARG(jint)); // "(ILjava/lang/String;I)V"
|
||||
jniSign(JNI_RET(jvoid), JNI_FUN(examJudgeCallbackRealExam), JNI_ARG(jstring), JNI_ARG(jint)); // "(Ljava/lang/String;I)V"
|
||||
|
||||
@ -33,7 +33,7 @@ JUDGE_C_API void __jni_judge_log_func__(const char* file, int line, const char*
|
||||
|
||||
#define JNI_JUDGE_API_JOIN(ret, func, args, calls) \
|
||||
JNIEXPORT ret JNICALL JNI_JUDGE_CAT_NAME(func) args \
|
||||
{ return FactoryExamApi->JNI_JUDGE_CAT_NAME(func) calls; } \
|
||||
{ return FactoryExamApi->JNI_JUDGE_CAT_NAME(func) calls; } \
|
||||
|
||||
#define JNI_JUDGE_FUN_DECL(func) JNI_JUDGE_CAT_NAME(func)
|
||||
#define JNI_JUDGE_FUN_IMPL(func) JNIApiBridge::JNI_JUDGE_CAT_NAME(func)
|
||||
|
||||
@ -438,6 +438,30 @@ JS_JUDGE_FUN_IMPL(examJudgeMapImageSetCallback)
|
||||
return createErrorCode(env, code);
|
||||
}
|
||||
|
||||
JS_JUDGE_FUN_IMPL(examCalcGpsDistance)
|
||||
{
|
||||
logdebug("call js_examCalcGpsDistance");
|
||||
size_t argc = 5; napi_value args[5] = {nullptr};
|
||||
|
||||
if(!getArg(env, cbinfo, argc, args))
|
||||
{
|
||||
return createErrorCode(env, errorNapiArgCount);
|
||||
}
|
||||
|
||||
double jd1=0.0, wd1=0.0, jd2=0.0, wd2=0.0, h=0.0;
|
||||
if(!getDouble(env, args[0], jd1) ||
|
||||
!getDouble(env, args[1], wd1) ||
|
||||
!getDouble(env, args[2], jd2) ||
|
||||
!getDouble(env, args[3], wd2) ||
|
||||
!getDouble(env, args[4], h) )
|
||||
{
|
||||
return createErrorCode(env, errorNapiArgType);
|
||||
}
|
||||
|
||||
double distance = ExamService::examCalcGpsDistance(jd1,wd1,jd2,wd2,h);
|
||||
return createDouble(env, distance);
|
||||
}
|
||||
|
||||
void JSApiBridge::examJudgeCallbackLogToCaller(int level, const char* info, int len)
|
||||
{
|
||||
if(level < LOG_LV_CLOSE || level > LOG_LV_ALL || nullptr == info || len <= 0) return;
|
||||
@ -589,6 +613,31 @@ bool JSApiBridge::getBool(napi_env env, napi_value nva, bool& value)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JSApiBridge::getDouble(napi_env env, napi_value nva, double& value)
|
||||
{
|
||||
napi_valuetype type;
|
||||
napi_status status = napi_typeof(env, nva, &type);
|
||||
if(napi_ok != status)
|
||||
{
|
||||
logerror("call napi_typeof failed status=%d", status);
|
||||
return false;
|
||||
}
|
||||
if(type != napi_number)
|
||||
{
|
||||
logerror("is not napi_number type=%d", type);
|
||||
return false;
|
||||
}
|
||||
double result;
|
||||
status = napi_get_value_double(env, nva, &result);
|
||||
if(napi_ok != status)
|
||||
{
|
||||
logerror("call napi_get_value_double failed status=%d", status);
|
||||
return false;
|
||||
}
|
||||
value = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JSApiBridge::getRef(napi_env env, napi_value nva, napi_ref& value)
|
||||
{
|
||||
napi_valuetype type = napi_undefined;
|
||||
@ -656,6 +705,18 @@ napi_value JSApiBridge::createString(napi_env env, const std::string& value)
|
||||
return result;
|
||||
}
|
||||
|
||||
napi_value JSApiBridge::createDouble(napi_env env, double value)
|
||||
{
|
||||
napi_value result = nullptr;
|
||||
napi_status status = napi_create_double(env, value, &result);
|
||||
if(napi_ok != status)
|
||||
{
|
||||
logerror("call napi_create_double error, status=%d", status);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
napi_value JSApiBridge::createArrayBuffer(napi_env env, const void* data, size_t size, size_t chunk, napi_typedarray_type type)
|
||||
{
|
||||
const size_t offset = 0; //偏移字节数
|
||||
|
||||
@ -39,6 +39,7 @@ public:
|
||||
JS_JUDGE_FUN_DECL(examJudgeMapSetDrawing);
|
||||
JS_JUDGE_FUN_DECL(examJudgeMapImage);
|
||||
JS_JUDGE_FUN_DECL(examJudgeMapImageSetCallback);
|
||||
JS_JUDGE_FUN_DECL(examCalcGpsDistance);
|
||||
|
||||
virtual void examJudgeCallbackLogToCaller(int level, const char* info, int len) override;
|
||||
virtual void examJudgeCallbackRealExamToCaller(const char* data, int len) override;
|
||||
@ -57,12 +58,14 @@ public:
|
||||
bool getInt64 (napi_env env, napi_value nva, int64& value);
|
||||
bool getString(napi_env env, napi_value nva, std::string& value);
|
||||
bool getBool (napi_env env, napi_value nva, bool& value);
|
||||
bool getDouble(napi_env env, napi_value nva, double& value);
|
||||
bool getRef (napi_env env, napi_value nva, napi_ref& value);
|
||||
|
||||
napi_value createErrorCode(napi_env env, int code, const char* desc = "", const char* file = __FILE__, int line = __LINE__);
|
||||
napi_value createInt (napi_env env, int value);
|
||||
napi_value createInt64 (napi_env env, int64 value);
|
||||
napi_value createString (napi_env env, const std::string& value);
|
||||
napi_value createDouble (napi_env env, double value);
|
||||
//size元素数量 chunk每个元素字节大小
|
||||
napi_value createArrayBuffer(napi_env env, const void* data, size_t size, size_t chunk=sizeof(char), napi_typedarray_type type = napi_uint8_clamped_array);
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ JS_JUDGE_API_JOIN(examJudgeMapSetScaling);
|
||||
JS_JUDGE_API_JOIN(examJudgeMapSetDrawing);
|
||||
JS_JUDGE_API_JOIN(examJudgeMapImage);
|
||||
JS_JUDGE_API_JOIN(examJudgeMapImageSetCallback);
|
||||
JS_JUDGE_API_JOIN(examCalcGpsDistance);
|
||||
|
||||
// EXTERN_C_START
|
||||
|
||||
@ -56,6 +57,7 @@ static napi_value JS_JUDGE_MODULE_EXPORT(napi_env env, napi_value exports)
|
||||
JS_JUDGE_CAT_DESC(examJudgeMapSetDrawing),
|
||||
JS_JUDGE_CAT_DESC(examJudgeMapImage),
|
||||
JS_JUDGE_CAT_DESC(examJudgeMapImageSetCallback),
|
||||
JS_JUDGE_CAT_DESC(examCalcGpsDistance),
|
||||
};
|
||||
//napi_set_named_property
|
||||
napi_define_properties(env, exports, sizeof(desc)/sizeof(desc[0]), desc);
|
||||
@ -115,7 +117,8 @@ JNI_JUDGE_API_JOIN(jint, examJudgeMapSetParam, (JNIEnv* env, jobje
|
||||
JNI_JUDGE_API_JOIN(jint, examJudgeMapSetScaling, (JNIEnv* env, jobject thiz, jint scaling), (env,thiz,scaling));
|
||||
JNI_JUDGE_API_JOIN(jint, examJudgeMapSetDrawing, (JNIEnv* env, jobject thiz, jboolean drawing), (env,thiz,drawing));
|
||||
JNI_JUDGE_API_JOIN(jbyteArray, examJudgeMapImage, (JNIEnv* env, jobject thiz), (env,thiz));
|
||||
JNI_JUDGE_API_JOIN(jint, examJudgeMapImageSetCallback, (JNIEnv* env, jobject thiz), (env,thiz)); \
|
||||
JNI_JUDGE_API_JOIN(jint, examJudgeMapImageSetCallback, (JNIEnv* env, jobject thiz), (env,thiz));
|
||||
JNI_JUDGE_API_JOIN(jdouble, examCalcGpsDistance, (JNIEnv* env, jobject thiz, jdouble jd1, jdouble wd1, jdouble jd2, jdouble wd2, jdouble h), (env,thiz,jd1,wd1,jd2,wd2,h)); \
|
||||
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved)
|
||||
{
|
||||
@ -163,6 +166,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved)
|
||||
JNI_JUDGE_CHECK_METHOD(examJudgeMapSetDrawing);
|
||||
JNI_JUDGE_CHECK_METHOD(examJudgeMapImage);
|
||||
JNI_JUDGE_CHECK_METHOD(examJudgeMapImageSetCallback);
|
||||
JNI_JUDGE_CHECK_METHOD(examCalcGpsDistance);
|
||||
|
||||
static JNINativeMethod methods[] =
|
||||
{
|
||||
@ -185,6 +189,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* jvm, void* reserved)
|
||||
JNI_JUDGE_CAT_DESC(examJudgeMapSetDrawing),
|
||||
JNI_JUDGE_CAT_DESC(examJudgeMapImage),
|
||||
JNI_JUDGE_CAT_DESC(examJudgeMapImageSetCallback),
|
||||
JNI_JUDGE_CAT_DESC(examCalcGpsDistance),
|
||||
};
|
||||
|
||||
ret = env->RegisterNatives(clazz, methods, sizeof(methods)/sizeof(methods[0]));
|
||||
@ -322,11 +327,17 @@ JUDGE_SDK_API const char* JUDGE_SDK_METHOD examJudgeMapImage()
|
||||
return FactoryExamApi->examJudgeMapImage();
|
||||
}
|
||||
|
||||
JUDGE_SDK_API int examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback)
|
||||
JUDGE_SDK_API int JUDGE_SDK_METHOD examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback)
|
||||
{
|
||||
return FactoryExamApi->examJudgeMapImageSetCallback(callback);
|
||||
}
|
||||
|
||||
JUDGE_SDK_API double JUDGE_SDK_METHOD examCalcGpsDistance(double jd1, double wd1, double jd2, double wd2, double h)
|
||||
{
|
||||
return FactoryExamApi->examCalcGpsDistance(jd1, wd1, jd2, wd2, h);
|
||||
}
|
||||
|
||||
|
||||
#endif // JUDGE_OS_OHOS JUDGE_OS_ANDROID
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
* 说明: 一些方便调试编译控制助手
|
||||
*
|
||||
* 作者: 杨海洋
|
||||
* 日期: 2025-05-11
|
||||
* 日期: 2023-05-11
|
||||
*/
|
||||
|
||||
#ifndef CLEVERHELPER_H
|
||||
|
||||
@ -125,21 +125,35 @@
|
||||
#define BUILD_SEC_CH0 (__TIME__[6])
|
||||
#define BUILD_SEC_CH1 (__TIME__[7])
|
||||
|
||||
#define JUDGE_COMPILE_TIME \
|
||||
BUILD_YEAR_CH2, BUILD_YEAR_CH3, \
|
||||
BUILD_MONTH_CH0, BUILD_MONTH_CH1, \
|
||||
BUILD_DAY_CH0, BUILD_DAY_CH1, \
|
||||
BUILD_HOUR_CH0, BUILD_HOUR_CH1, \
|
||||
BUILD_MIN_CH0, BUILD_MIN_CH1, \
|
||||
BUILD_SEC_CH0, BUILD_SEC_CH1 \
|
||||
|
||||
const char JUDGE_VERSION_TIME[] =
|
||||
{
|
||||
BUILD_YEAR_CH2, BUILD_YEAR_CH3,
|
||||
BUILD_MONTH_CH0, BUILD_MONTH_CH1,
|
||||
BUILD_DAY_CH0, BUILD_DAY_CH1,
|
||||
BUILD_HOUR_CH0, BUILD_HOUR_CH1,
|
||||
BUILD_MIN_CH0, BUILD_MIN_CH1,
|
||||
BUILD_SEC_CH0, BUILD_SEC_CH1,
|
||||
'\0'
|
||||
};
|
||||
|
||||
const char _JUDGE_VERSION_INFO_[] =
|
||||
const char JUDGE_VERSION_INFO[] =
|
||||
{
|
||||
JUDGE_CHARS_MAJOR, '.',
|
||||
JUDGE_CHARS_MINOR, '.',
|
||||
JUDGE_CHARS_PATCH, '.',
|
||||
JUDGE_COMPILE_TIME,
|
||||
JUDGE_VERSION_TIME[0],
|
||||
JUDGE_VERSION_TIME[1],
|
||||
JUDGE_VERSION_TIME[2],
|
||||
JUDGE_VERSION_TIME[3],
|
||||
JUDGE_VERSION_TIME[4],
|
||||
JUDGE_VERSION_TIME[5],
|
||||
JUDGE_VERSION_TIME[6],
|
||||
JUDGE_VERSION_TIME[7],
|
||||
JUDGE_VERSION_TIME[8],
|
||||
JUDGE_VERSION_TIME[9],
|
||||
JUDGE_VERSION_TIME[10],
|
||||
JUDGE_VERSION_TIME[11],
|
||||
'\0'
|
||||
};
|
||||
|
||||
|
||||
@ -30,9 +30,12 @@
|
||||
JUDGE_AUX_STR(JUDGE_VERSION_MINOR) "." \
|
||||
JUDGE_AUX_STR(JUDGE_VERSION_PATCH)
|
||||
|
||||
extern const char _JUDGE_VERSION_INFO_[];
|
||||
//版本详细信息[版本号+版本编译时间] 2.0.0.240401131705
|
||||
#define JUDGE_VERSION_INFO _JUDGE_VERSION_INFO_
|
||||
|
||||
//版本编译时间 240401131705
|
||||
extern const char JUDGE_VERSION_TIME[];
|
||||
|
||||
//版本详细信息[版本号+版本编译时间] 1.0.0.240401131705
|
||||
extern const char JUDGE_VERSION_INFO[];
|
||||
|
||||
|
||||
#endif // HVERSION_H
|
||||
|
||||
@ -119,6 +119,8 @@ namespace siteof
|
||||
siteof_declare(zjjh);
|
||||
siteof_declare(hbwhjz);
|
||||
siteof_declare(JXYTSF001);
|
||||
siteof_declare(hnzzkm3);
|
||||
siteof_declare(jswxbz);
|
||||
siteof_declare(tcrx); //无锡所检测地点版本特殊
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ public:
|
||||
inline MapPointTable* getMapPointTable() const noexcept { return m_mapPoint; }
|
||||
inline MapPointItemTable* getMapPointItemsTable() const noexcept { return m_mapPointItem; }
|
||||
private:
|
||||
ItemInfoTable* m_itemInfo = nullptr;
|
||||
ItemInfoTable* m_itemInfo = nullptr;
|
||||
MarkTable* m_mark = nullptr;
|
||||
SysSetTable* m_sysset = nullptr;
|
||||
SysParmTable* m_sysparm = nullptr;
|
||||
|
||||
@ -170,6 +170,7 @@ class JUDGE_API SysSetTable : public IDBTable
|
||||
SYSSET_DECLARE(346); //RTK差分改正数串口(-1-普通GPS,0-共用串口2,>0-额外串口) // 0
|
||||
SYSSET_DECLARE(348); //直线行驶中不进其他考试项目(0-否 1-是) //0
|
||||
SYSSET_DECLARE(349, type_array, ","); //RTK基准站参数 //43.83836419,125.25308285,226.013,1.3,5
|
||||
SYSSET_DECLARE(350, type_int); //采用车速类型(0-GPS 1-PLC 2-脉冲距离计算)
|
||||
SYSSET_DECLARE(355); //差分模式下任何时刻都判变道不打方向灯(0-否 1-以前点车道数变化 2-以基准点车道数发生变化 3-车轮压线) // 0
|
||||
SYSSET_DECLARE(359); //自动搜索差分车道(0-路段号无关,每次都搜索当前车道,>0-根据路段号搜索,如果路段号为空则为搜索时间秒) //0
|
||||
SYSSET_DECLARE(360, type_array, "^"); //起步取消压线评判距离(米) //0
|
||||
@ -269,6 +270,7 @@ class JUDGE_API SysSetTable : public IDBTable
|
||||
SYSSET_ASSIGN(346);
|
||||
SYSSET_ASSIGN(348);
|
||||
SYSSET_ASSIGN(349);
|
||||
SYSSET_ASSIGN(350);
|
||||
SYSSET_ASSIGN(355);
|
||||
SYSSET_ASSIGN(359);
|
||||
SYSSET_ASSIGN(360);
|
||||
|
||||
@ -163,6 +163,12 @@ bool ExamCarSub2::examDrawMap()
|
||||
|
||||
bool ExamCarSub2::examMarkItem(ExamItemCode itemNo, const std::string& serial, bool once, bool force, bool event, MarkType type)
|
||||
{
|
||||
//正式考试 扣分扣到不合格为止
|
||||
if(isExamMode() && !isQualified())
|
||||
{
|
||||
logtrace("is not qualified %s itemNo=%d,serial=%s", target().c_str(), itemNo, serial.c_str());
|
||||
return false;
|
||||
}
|
||||
if(m_examState != examStateIng)
|
||||
{
|
||||
logwarning("mark-warning itemNo=%d, serial=%s,type=%d", itemNo, serial.c_str(), type);
|
||||
@ -176,12 +182,6 @@ bool ExamCarSub2::examMarkItem(ExamItemCode itemNo, const std::string& serial, b
|
||||
|
||||
if(false == force)
|
||||
{
|
||||
//正式考试 扣分扣到不合格为止
|
||||
if(isExamMode() && !isQualified())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(true == once)
|
||||
{
|
||||
const int size = m_marks.size();
|
||||
|
||||
@ -108,12 +108,13 @@ ErrorCode ExamCarSub3::examGoonExam()
|
||||
//断点扣分不要生成任何事件通知,关心的就是本地扣出来即可 //???yhyflag
|
||||
//Mark(markItem.xmdm, markItem.kfdm, false, true, 0, true); //Self.Mark(TempItemNo, Str3, False, True, 0, True);
|
||||
|
||||
TKM3Item* item = findExamItem(markItem.xmdm);
|
||||
TASSERT(item != nullptr, "");
|
||||
if(item)
|
||||
{
|
||||
item->Item_Color = itemStateBhg;
|
||||
}
|
||||
//扣分只记录分数,不需要根据扣分记录项目状态 20240816 在洛阳确认的
|
||||
//TKM3Item* item = findExamItem(markItem.xmdm);
|
||||
//TASSERT(item != nullptr, "");
|
||||
//if(item)
|
||||
//{
|
||||
// item->Item_Color = itemStateBhg;
|
||||
//}
|
||||
|
||||
loginfo("ddxk-mark xmdm=%d,kfdm=%s", markItem.xmdm, markItem.kfdm.c_str());
|
||||
}
|
||||
@ -1244,17 +1245,17 @@ void ExamCarSub3::Deal_KM3_Judge()
|
||||
bool qualified = isQualified();
|
||||
|
||||
//ToDo1:检查当前正在进行的项目状态
|
||||
if(!qualified)
|
||||
{
|
||||
for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++)
|
||||
{
|
||||
const TKM3Item* examItem = it->second->getExamItem();
|
||||
if(examItem->TestPro == ItemProFlagInit || examItem->TestPro == ItemProFlagJudge)
|
||||
{
|
||||
KM3EndItem(examItem->ItemNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
//if(!qualified)
|
||||
//{
|
||||
// for(auto it = m_sub3Items.begin(); it != m_sub3Items.end(); it++)
|
||||
// {
|
||||
// const TKM3Item* examItem = it->second->getExamItem();
|
||||
// if(examItem->TestPro == ItemProFlagInit || examItem->TestPro == ItemProFlagJudge)
|
||||
// {
|
||||
// KM3EndItem(examItem->ItemNo);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
if(finish || !qualified)
|
||||
{
|
||||
@ -2112,11 +2113,24 @@ void ExamCarSub3::Calc_LaneDistance()
|
||||
case 2: RTKKM3.Wheel_RF_ToBaseLine = distance; break;
|
||||
case 3: RTKKM3.Wheel_LB_ToBaseLine = distance; break;
|
||||
case 4: RTKKM3.Wheel_RB_ToBaseLine = distance; break;
|
||||
case 5: RTKKM3.Body_RF_ToBaseLine = distance; break; //20240801
|
||||
case 6: RTKKM3.Body_RB_ToBaseLine = distance; break; //20240801
|
||||
case 5: RTKKM3.Body_RF_ToBaseLine = distance; break; //20240801
|
||||
case 6: RTKKM3.Body_RB_ToBaseLine = distance; break; //20240801
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GpsMath::IsCross(line, L0))
|
||||
{
|
||||
int distance = -GpsMath::PointToSeg(pt, L0);
|
||||
switch(k)
|
||||
{
|
||||
case 5: RTKKM3.Body_RF_ToBaseLine = distance; break; //20240801
|
||||
case 6: RTKKM3.Body_RB_ToBaseLine = distance; break; //20240801
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(p == 3) //3:车身左侧与本车道左侧距离
|
||||
@ -3983,6 +3997,13 @@ void ExamCarSub3::KM3EndItem(int ItemNo)
|
||||
|
||||
bool ExamCarSub3::examMarkItem(int itemNo, const std::string& serial, bool once, bool force, bool event, MarkType type)
|
||||
{
|
||||
//正式考试 扣分扣到不合格为止
|
||||
if(isExamMode() && !isQualified())
|
||||
{
|
||||
logtrace("is not qualified %s itemNo=%d,serial=%s", target().c_str(), itemNo, serial.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
//Kind:0 自动评判 1:考车人工扣分 2:远程下发的考试扣分
|
||||
bool result = false;
|
||||
//*if(Test_Status == 1) return result;
|
||||
@ -4679,11 +4700,19 @@ DriveDirType ExamCarSub3::driveDirection(const TModelLine* lane)
|
||||
{
|
||||
//ptBegin 车道线起始点
|
||||
//ptEnd 车道线起终点点
|
||||
//double angle1 = GpsMath::getAngle(lane->PtBegin, lane->PtEnd);
|
||||
//double angle2 = GpsMath::getAngle(m_cg->body.points_b[II(13)], m_cg->body.points_b[II(1)]);
|
||||
//double a1 = GpsMath::getAngle(lane->PtBegin, lane->PtEnd);
|
||||
//double a2 = GpsMath::getAngle(m_cg->body.points_b[II(13)], m_cg->body.points_b[II(1)]);
|
||||
double a1 = GpsMath::GetAngle_HQ(lane->PtBegin, lane->PtEnd, -1);
|
||||
double a2 = GpsMath::GetAngle_HQ(m_cg->body.points_b[II(13)], m_cg->body.points_b[II(1)], -1);
|
||||
|
||||
//Pointi p1 = m_cg->body.points_b[II(1)];
|
||||
//Pointi p13 = m_cg->body.points_b[II(13)];
|
||||
//logtrace("p1(%d,%d),p13(%d,%d),begin(%d,%d),end(%d,%d)",
|
||||
// p1.x, p1.y,
|
||||
// p13.x, p13.y,
|
||||
// lane->PtBegin.x, lane->PtBegin.y,
|
||||
// lane->PtEnd.x, lane->PtEnd.y);
|
||||
|
||||
DriveDirType dir = DriveDirX;
|
||||
int angle = ((int)std::round(a1 - a2) + 360) % 360;
|
||||
if(angle < 60 || angle > 300)
|
||||
|
||||
@ -28,7 +28,6 @@ bool ExamSensor::pretreatment(TChuanGan* cg)
|
||||
{
|
||||
if(cg == nullptr) return false;
|
||||
|
||||
|
||||
TChuanGan* his = m_car->historyChuanGan();
|
||||
if(his)
|
||||
{
|
||||
@ -109,7 +108,9 @@ bool ExamSensor::pretreatment(TChuanGan* cg)
|
||||
bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
{
|
||||
TSensorInfo& sor = cg->real.sensor;
|
||||
TGpsInfo& gps = cg->real.gps;
|
||||
sor.dw_plc = sor.dw;
|
||||
|
||||
// if(m_car->examSubject() == ExamSubject2)
|
||||
// {
|
||||
// }
|
||||
@ -173,7 +174,6 @@ bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
}
|
||||
}
|
||||
|
||||
TGpsInfo& gps = cg->real.gps;
|
||||
gps.errorFlag = true;
|
||||
|
||||
//测试是否逆向行驶
|
||||
@ -195,7 +195,7 @@ bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
}
|
||||
|
||||
#ifndef JUDGE_USE_INSPECT
|
||||
gps.sd *= 1.852; //无锡所检测不需要乘这个系数,因为我们实际用的时候是gps速度,无锡所是加工后的数据
|
||||
gps.sd *= GPS_VEL_COEFF; //无锡所检测不需要乘这个系数,因为我们实际用的时候是gps速度,无锡所是加工后的数据
|
||||
#endif
|
||||
|
||||
//lognote("jd=%0.14f gps.wd==%0.14f, gps.hxj=%0.14f, gps.gdc=%0.14f, gps.bklx=%d",
|
||||
@ -205,6 +205,16 @@ bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
gps.jd = GpsMath::convertGpsCoord2(gps.jd);
|
||||
gps.wd = GpsMath::convertGpsCoord2(gps.wd);
|
||||
|
||||
int s350 = TableSysSet->asInt350();
|
||||
if(s350 == 1) //采用车速类型(0-GPS 1-PLC 2-脉冲距离计算)
|
||||
{
|
||||
gps.sd = sor.cs;
|
||||
}
|
||||
else
|
||||
{
|
||||
sor.cs = gps.sd;
|
||||
}
|
||||
|
||||
//位置差分, 角度差分
|
||||
if(gps.dwzt == gpsStatusNARROW_INT && gps.jdzt == gpsStatusANGLE)
|
||||
{
|
||||
@ -218,9 +228,7 @@ bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
}
|
||||
|
||||
gps.errorFlag = false;
|
||||
// return gps.rtkEnabled == true && gps.errorFlag == false; //不能如果不在差分,行驶距离什么的计算都不对 yhy 2024-06-18
|
||||
// return true; //yhy 2024-04-30
|
||||
// return !Tools::isZero(gps.jd) && !Tools::isZero(gps.wd);
|
||||
|
||||
ExamSubject sub = m_car->examSubject();
|
||||
if(ExamSubject2 == sub)
|
||||
{
|
||||
@ -228,8 +236,20 @@ bool ExamSensor::convertDatas(TChuanGan* cg)
|
||||
}
|
||||
else if(ExamSubject3 == sub)
|
||||
{
|
||||
if(gps.dwzt > 0 && gps.jdzt > 0 && gps.jd > 1 && gps.wd > 1) //20240811 yhy
|
||||
{
|
||||
//数据是正常的
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_car->historyCount() > 0)
|
||||
{
|
||||
cloneWith(m_car->historyChuanGan(), cg);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -300,18 +320,7 @@ bool ExamSensor::calcCarBody(TChuanGan* cg)
|
||||
GpsMath::calcEastAndNorthDistanceCM(m_basePoint, ps[II(33)], m_basePoint.gc, x, y);
|
||||
|
||||
TGpsInfo& gps = cg->real.gps;
|
||||
if(gps.rtkEnabled && gps.jd > 1 && gps.wd > 1)
|
||||
{
|
||||
gps.ai_gps = Pointi(x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_car->historyCount() > 0)
|
||||
{
|
||||
gps.ai_gps = m_car->historyAiGps(); //20240702 yhy
|
||||
//return false; //这里不能返回false 第一帧数据就是非差分状态?如果做模拟灯光的时候一直没差分进不了项目了
|
||||
}
|
||||
}
|
||||
gps.ai_gps = Pointi(x, y);
|
||||
|
||||
if(ExamSubject2 == subject)
|
||||
{
|
||||
@ -419,12 +428,6 @@ bool ExamSensor::GetCarDirStauts(TChuanGan* cg)
|
||||
}
|
||||
}
|
||||
|
||||
if(cg->real.gps.rtkEnabled == false) //20240702 yhy
|
||||
{
|
||||
cloneWith(m_car->historyChuanGan(), cg);
|
||||
return true;
|
||||
}
|
||||
|
||||
//if(cg.Rtk_Enabled = False) or (Lscg[zj(1)].Rtk_Enabled = False) or (Lscg[zj(2)].Rtk_Enabled = False) then Exit;
|
||||
if(cg->move == moveStop && cg->real.gps.rtkEnabled == false)
|
||||
{
|
||||
@ -826,12 +829,14 @@ bool ExamSensor::GetCarDirStatus_KM2(TChuanGan* cg)
|
||||
|
||||
void ExamSensor::cloneWith(TChuanGan* src, TChuanGan* dest)
|
||||
{
|
||||
dest->move = src->move;
|
||||
dest->real.gps.ai_gps = src->real.gps.ai_gps;
|
||||
dest->ai_ljjl = src->ai_ljjl;
|
||||
dest->ai_dcjl = src->ai_dcjl;
|
||||
dest->ai_ljjl_cm = src->ai_ljjl_cm;
|
||||
dest->ai_dcjl_cm = src->ai_dcjl_cm;
|
||||
dest->real.gps = src->real.gps;
|
||||
dest->real.gps2 = src->real.gps2;
|
||||
//dest->move = src->move;
|
||||
//dest->real.gps.ai_gps = src->real.gps.ai_gps;
|
||||
//dest->ai_ljjl = src->ai_ljjl;
|
||||
//dest->ai_dcjl = src->ai_dcjl;
|
||||
//dest->ai_ljjl_cm = src->ai_ljjl_cm;
|
||||
//dest->ai_dcjl_cm = src->ai_dcjl_cm;
|
||||
//dest->tkCnt = src->tkCnt;
|
||||
|
||||
}
|
||||
|
||||
@ -255,6 +255,19 @@ int ExamService::examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback
|
||||
return QE(codeSuccess);
|
||||
}
|
||||
|
||||
double ExamService::examCalcGpsDistance(double jd1, double wd1, double jd2, double wd2, double h)
|
||||
{
|
||||
logdebug("call examCalcGpsDistance.");
|
||||
//if(!m_init) return QE(errorInitNot);
|
||||
|
||||
double jd1_ = GpsMath::convertGpsCoord2(jd1);
|
||||
double wd1_ = GpsMath::convertGpsCoord2(wd1);
|
||||
double jd2_ = GpsMath::convertGpsCoord2(jd2);
|
||||
double wd2_ = GpsMath::convertGpsCoord2(wd2);
|
||||
|
||||
return GpsMath::calcGpsDistanceCM(jd1_, wd1_, jd2_, wd2_, h);
|
||||
}
|
||||
|
||||
int ExamService::examJudgeMapWidth()
|
||||
{
|
||||
logdebug("call examJudgeMapWidth.");
|
||||
|
||||
@ -37,6 +37,7 @@ public:
|
||||
virtual int examJudgeMapSetDrawing(bool drawing) override;
|
||||
virtual const char* examJudgeMapImage() override;
|
||||
virtual int examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback) override;
|
||||
virtual double examCalcGpsDistance(double jd1, double wd1, double jd2, double wd2, double h) override;
|
||||
|
||||
//暂时未导出给APP端使用
|
||||
virtual int examJudgeMapWidth() override;
|
||||
|
||||
@ -85,7 +85,7 @@ int IExamCar::examJudgeBeginExam(const char* data, int len)
|
||||
ExamCarType cartype = carType();
|
||||
ExamSubject subject = examSubject();
|
||||
m_grade = GRADE_TOTAL_FULL;
|
||||
m_gradePass = examCarType2Pass(subject, cartype); //及格分数
|
||||
if(m_stuInfo.passing <= 0) { m_stuInfo.passing = examCarType2Pass(subject, cartype); } //及格分数
|
||||
m_timeBegin = isReplay() ? 0 : Tools::nowTime();
|
||||
m_timeEnd = 0;
|
||||
m_disForward = 0;
|
||||
|
||||
@ -97,11 +97,11 @@ public:
|
||||
virtual const std::string& carType2() MEANS { return m_carInfo->kscx; }
|
||||
virtual int carID() MEANS { return m_carInfo->kchm; }
|
||||
virtual int grade() MEANS { return m_grade; }
|
||||
virtual int gradePass() MEANS { return m_gradePass; }
|
||||
virtual int gradePass() MEANS { return m_stuInfo.passing; }
|
||||
virtual int disForward() MEANS { return m_disForward; }
|
||||
virtual int disBackward() MEANS { return m_disBackward; }
|
||||
virtual int disTravel() MEANS { return m_disForward - m_disBackward; }
|
||||
virtual bool isQualified() MEANS { return m_grade >= m_gradePass; }
|
||||
virtual bool isQualified() MEANS { return m_grade >= m_stuInfo.passing; }
|
||||
virtual bool isExamMode() MEANS { return m_stuInfo.exam == examModeExam; }
|
||||
virtual bool isExamDrill() MEANS { return m_stuInfo.exam == examModeDrill; }
|
||||
virtual bool canContinueExam() MEANS { return isQualified() || isExamDrill(); }
|
||||
@ -150,7 +150,6 @@ protected:
|
||||
int m_disGears[20]; //档位距离
|
||||
|
||||
int m_grade = 0; //当前得分
|
||||
int m_gradePass = 0; //考试及格分数
|
||||
int64 m_timeBegin = 0; //开始时间(毫秒)
|
||||
int64 m_timeEnd = 0; //结束时间(毫秒)
|
||||
TMarkInfos m_marks = {}; //具体的扣分信息
|
||||
|
||||
@ -25,6 +25,8 @@ public:
|
||||
virtual int examJudgeSetRealExamCallback(examJudgeCallbackRealExam callback) = 0;
|
||||
virtual int examJudgeSetPerformCallback(examJudgeCallbackPerform callback) = 0;
|
||||
virtual int examJudgeMapImageSetCallback(examJudgeCallbackMapImage callback) = 0;
|
||||
virtual double examCalcGpsDistance(double jd1, double wd1, double jd2, double wd2, double h) = 0;
|
||||
|
||||
|
||||
virtual void examJudgeCallbackLogToCaller(int level, const char* info, int len) = 0;
|
||||
virtual void examJudgeCallbackRealExamToCaller(const char* data, int len) = 0;
|
||||
|
||||
@ -456,6 +456,10 @@ struct TSub3Item41Mndg //模拟灯光 41
|
||||
int64 yjjtbeg = 0, yjjtend = 0; //20171031
|
||||
|
||||
int LastSubItemNo = 0;
|
||||
|
||||
int64 endTick = 0;
|
||||
bool endFlag = false;
|
||||
|
||||
};
|
||||
|
||||
struct TSub3Item02Qbxx //起步 2
|
||||
@ -479,8 +483,6 @@ struct TSub3Item02Qbxx //起步 2
|
||||
//以下是溜车评判需要用到的变量
|
||||
int PubMaxLCValue = 0;
|
||||
Pointi PubLCTCPtt;
|
||||
double PubLCTC_GPS_JD = 0.0;
|
||||
double PubLCTC_GPS_WD = 0.0;
|
||||
bool PubCanMarkLC50Flag = true; //注意初始必须是true
|
||||
};
|
||||
|
||||
|
||||
@ -92,12 +92,13 @@ void Sub3Judge02Qbxx::dealJudgeItem()
|
||||
TCar* tcar = m_car->getTCar();
|
||||
|
||||
int fdjds = tcar->FDJDS * tcar->fdjds_cdbl;
|
||||
if( (sor.fdjzs > 10 && sor.fdjzs < fdjds && cg->move == moveForward)
|
||||
&& (sor1.fdjzs > 10 && sor1.fdjzs < fdjds && his1->move == moveForward)
|
||||
&& (sor2.fdjzs > 10 && sor2.fdjzs < fdjds && his2->move == moveForward)
|
||||
&& (sor3.fdjzs > 10 && sor3.fdjzs < fdjds && his3->move == moveForward)
|
||||
&& (sor4.fdjzs > 10 && sor4.fdjzs < fdjds && his4->move == moveForward) &&
|
||||
(m_itemv.Mark_ChuangDong == false) ) //闯动
|
||||
//保持和windows一模一样 原先还叠加了fdjzs>10和前进状态条件
|
||||
if( (sor.fdjzs > 0 && sor.fdjzs < fdjds) // && cg->move == moveForward
|
||||
&& (sor1.fdjzs > 0 && sor1.fdjzs < fdjds) // && his1->move == moveForward
|
||||
&& (sor2.fdjzs > 0 && sor2.fdjzs < fdjds) // && his2->move == moveForward
|
||||
&& (sor3.fdjzs > 0 && sor3.fdjzs < fdjds) // && his3->move == moveForward
|
||||
&& (sor4.fdjzs > 0 && sor4.fdjzs < fdjds) // && his4->move == moveForward
|
||||
&& (m_itemv.Mark_ChuangDong == false) ) //闯动
|
||||
{
|
||||
m_itemv.Mark_ChuangDong = true;
|
||||
JUDGE_MARK_SUB3(2, "08", false);
|
||||
@ -114,8 +115,10 @@ void Sub3Judge02Qbxx::dealJudgeItem()
|
||||
if(sor.fdjzs > ZSMax && sor1.fdjzs > ZSMax && sor2.fdjzs > ZSMax && sor3.fdjzs > ZSMax)
|
||||
{
|
||||
bool bb = true;
|
||||
int count = m_car->historyCount();
|
||||
for(int i = 1; i <= 10; i++)
|
||||
{
|
||||
if(i >= count) break;
|
||||
const TSensorInfo& sori = m_car->historySensor(i);
|
||||
if(sori.dh2 == SYES)
|
||||
{
|
||||
@ -198,9 +201,9 @@ void Sub3Judge02Qbxx::dealJudgeItem()
|
||||
|
||||
//状态提示
|
||||
char buf[128] = {0};
|
||||
SafeSprintf(buf, sizeof(buf), XCharacter("%s->State:%d,项目距离=%d厘米"),
|
||||
SafeSprintf(buf, sizeof(buf), XCharacter("%s->State:%d,项目距离=%d厘米,最大后溜=%dCM"),
|
||||
m_itemv.State == 1 ? XCharacter("起步未到达1米...") : XCharacter("起步超过1米..."),
|
||||
m_itemv.State, cg->ai_ljjl_cm - m_itemv.Temp_JL_CM);
|
||||
m_itemv.State, cg->ai_ljjl_cm - m_itemv.Temp_JL_CM, m_itemv.PubMaxLCValue);
|
||||
|
||||
showStatus(buf);
|
||||
}
|
||||
@ -214,6 +217,7 @@ void Sub3Judge02Qbxx::nogo_timeout()
|
||||
const TChuanGan* his1 = m_car->historyChuanGan(1);
|
||||
const TSensorInfo& sor1 = his1->real.sensor;
|
||||
|
||||
// C2 N空挡是0 R倒车档9 P驻车档10 D前进挡11
|
||||
//档位或者手刹信号发生变化,且变化的结果是前进挡和松手刹状态,开始计时,10秒后扣分
|
||||
if(m_itemv.ZhunBeiQiBuTK == 0)
|
||||
{
|
||||
@ -241,7 +245,7 @@ void Sub3Judge02Qbxx::nogo_timeout()
|
||||
if(cg->move != moveForward)
|
||||
{
|
||||
JUDGE_MARK_SUB3(2, "48", false);
|
||||
m_itemv.ZhunBeiQiBuTK = cg->tkCnt;
|
||||
m_itemv.ZhunBeiQiBuTK = 0; //赋值0就是动作变化才重新扣 如果是循环扣分赋值成cg->tkCnt
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -400,11 +404,11 @@ void Sub3Judge02Qbxx::Judge_LiuChe()
|
||||
const TSensorInfo& sor = cg->real.sensor;
|
||||
const TChuanGan* his1 = m_car->historyChuanGan(1);
|
||||
|
||||
static constexpr int LCValue = 32; //后溜车距离
|
||||
static constexpr int LC30FaZhi = 12;
|
||||
static constexpr int dis30CM = 30; //32 后溜车距离
|
||||
static constexpr int dis10CM = 10; //12
|
||||
if(cg->move == moveForward && his1->move == moveForward) //前进的时候要评判溜车小于30厘米的
|
||||
{
|
||||
if(m_itemv.PubMaxLCValue >= LC30FaZhi && m_itemv.PubMaxLCValue <= LCValue)
|
||||
if(m_itemv.PubMaxLCValue >= dis10CM && m_itemv.PubMaxLCValue <= dis30CM)
|
||||
{
|
||||
//通用或起步项目
|
||||
JUDGE_MARK_SUB3(2, "47", false);
|
||||
@ -418,32 +422,29 @@ void Sub3Judge02Qbxx::Judge_LiuChe()
|
||||
if(sor.dw != 9 && sor.dw != 6 && sor.ssc == SNOT)
|
||||
{
|
||||
//if(m_itemv.PubLCTCPtt.x == 0 && m_itemv.PubLCTCPtt.y == 0 && m_car->rtkEnabled())
|
||||
if(m_car->rtkEnabled())
|
||||
{
|
||||
const TChuanGan* his2 = m_car->historyChuanGan(2);
|
||||
if(cg->move == moveStop && his1->move == moveStop && his2->move == moveStop)
|
||||
{
|
||||
m_itemv.PubLCTCPtt.x = gps.ai_gps.x;
|
||||
m_itemv.PubLCTCPtt.y = gps.ai_gps.y;
|
||||
m_itemv.PubLCTC_GPS_JD = gps.jd;
|
||||
m_itemv.PubLCTC_GPS_WD = gps.wd;
|
||||
m_itemv.PubMaxLCValue = 0;
|
||||
//m_itemv.PubMaxLCValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//ExamSensor* sensor = m_car->sensor(); //sensor->calcMoveState();
|
||||
if(m_itemv.PubLCTCPtt.x != 0 && m_itemv.PubLCTCPtt.y != 0 && cg->move != moveForward) // JudgeKM3Obj.GetMovingState <> 1
|
||||
ExamSensor* sensor = m_car->sensor();
|
||||
if(m_itemv.PubLCTCPtt.x != 0 && m_itemv.PubLCTCPtt.y != 0 && sensor->calcMoveState() != moveForward)
|
||||
{
|
||||
Point Ptt = gps.ai_gps;
|
||||
int b = m_itemv.PubLCTCPtt.x - Ptt.x;
|
||||
int c = m_itemv.PubLCTCPtt.y - Ptt.y;
|
||||
int a = std::round(std::sqrt(b*b + c*c)); //cm
|
||||
int LC = a;
|
||||
if(m_itemv.PubMaxLCValue < LC)
|
||||
int x = m_itemv.PubLCTCPtt.x - Ptt.x;
|
||||
int y = m_itemv.PubLCTCPtt.y - Ptt.y;
|
||||
int a = std::round(std::sqrt(x*x + y*y)); //cm
|
||||
if(m_itemv.PubMaxLCValue < a)
|
||||
{
|
||||
m_itemv.PubMaxLCValue = LC;
|
||||
m_itemv.PubMaxLCValue = a;
|
||||
}
|
||||
//溜车大于30了,直接扣分
|
||||
if(m_itemv.PubCanMarkLC50Flag == true && m_itemv.PubMaxLCValue > LCValue)
|
||||
if(m_itemv.PubCanMarkLC50Flag == true && m_itemv.PubMaxLCValue > dis30CM)
|
||||
{
|
||||
JUDGE_MARK_SUB3(2, "46", false);
|
||||
m_itemv.PubCanMarkLC50Flag = false;
|
||||
|
||||
@ -98,7 +98,7 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
if(!m_car->isQualified())
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
flagEndJudge();
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -223,7 +223,7 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
if(cg->ai_ljjl_cm - m_itemv.StopLine_JLCM >= dis2)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
flagEndJudge();
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -291,21 +291,21 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "" && RTKKM3.BasePointInLaneDir != "0000")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(1, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_Z] != TURN_1)
|
||||
{
|
||||
JUDGE_MARK_SUB3(5, "45", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(m_itemv.Check_CheDao == false)
|
||||
//if(m_itemv.Check_CheDao == false)
|
||||
{
|
||||
m_itemv.Check_CheDao = true;
|
||||
//m_itemv.Check_CheDao = true;
|
||||
//路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(1, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_Z] != TURN_1)
|
||||
{
|
||||
JUDGE_MARK_SUB3(5, "45", true);
|
||||
}
|
||||
@ -359,7 +359,7 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
if(cg->ai_ljjl_cm - m_itemv.Start_JL_CM > m_itemv.XMJL_Mi * 100)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
flagEndJudge();
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -437,7 +437,7 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
if(OKFlag == true)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
flagEndJudge();
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -473,13 +473,13 @@ void Sub3Judge05Lkzx::dealJudgeItem()
|
||||
str += buf;
|
||||
}
|
||||
|
||||
//替换为 flagEndJudge();
|
||||
//替换为 JudgeFlagEnd();
|
||||
|
||||
str += msg;
|
||||
showStatus(str);
|
||||
}
|
||||
|
||||
void Sub3Judge05Lkzx::flagEndJudge()
|
||||
void Sub3Judge05Lkzx::JudgeFlagEnd()
|
||||
{
|
||||
if(m_exam->TestPro == ItemProFlagEnd)
|
||||
{
|
||||
|
||||
@ -21,7 +21,7 @@ public:
|
||||
|
||||
protected:
|
||||
void JudgeFXD();
|
||||
void flagEndJudge();
|
||||
void JudgeFlagEnd();
|
||||
private:
|
||||
ISub3Item05Lkzx m_itemv;
|
||||
};
|
||||
|
||||
@ -35,28 +35,34 @@ bool Sub3Judge10Ccxx::dealJudgeEnter()
|
||||
m_itemv.Temp_XMJL = s504.size() > 0 && s504[0] != "" ? std::atoi(s504[0].c_str()) : 150; //StrToIntDef(getdotstr(1, sysset[504], ','), 150); //20170718
|
||||
//超车时在超车道上需驶离超车道 (0-否 1-是 2-不进项目)
|
||||
bool CSCCDFlag = false; //超车时是否在超车车道
|
||||
if(TableSysSet->get405() == "1")
|
||||
std::string s405 = TableSysSet->get405();
|
||||
if(s405 == "0" || s405 == "1")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneNo == RTKKM3.BaseLaneCount) //表示在最左侧 20140623
|
||||
{
|
||||
//Itmv10.In_CCD_Kind := 1;
|
||||
if(RTKKM3.BaseLaneCount >= 2)
|
||||
{
|
||||
//在超车道上的距离限制 (在这个距离内要离开超车道)
|
||||
m_itemv.CS_CCD_Max_XSJL = s504.size() > 2 && s504[2] != "" ? std::atoi(s504[2].c_str()) : 30; //StrToIntDef(getdotstr(3, sysset[504], ','), 30); //20170718
|
||||
//初始超车道上至少需要行驶的距离,行驶完这个距离才能到普通车道(否则不按规定考试)
|
||||
if(s405 == "1")
|
||||
{
|
||||
|
||||
//初始超车道,二次超车最小行驶距离(如果初始在超车道上,需要驶离超车道,
|
||||
//然后行驶规定的距离后,再次进入超车道超车)
|
||||
m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL = s504.size() > 3 && s504[3] != "" ? std::atoi(s504[3].c_str()) : 30; //StrToIntDef(getdotstr(4, sysset[504], ','), 30); //20170718
|
||||
//在超车道上的距离限制 (在这个距离内要离开超车道)
|
||||
m_itemv.CS_CCD_Max_XSJL = s504.size() > 2 && s504[2] != "" ? std::atoi(s504[2].c_str()) : 30; //StrToIntDef(getdotstr(3, sysset[504], ','), 30); //20170718
|
||||
//初始超车道上至少需要行驶的距离,行驶完这个距离才能到普通车道(否则不按规定考试)
|
||||
|
||||
//初始超车道,二次超车最小行驶距离(如果初始在超车道上,需要驶离超车道,
|
||||
//然后行驶规定的距离后,再次进入超车道超车)
|
||||
m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL = s504.size() > 3 && s504[3] != "" ? std::atoi(s504[3].c_str()) : 30; //StrToIntDef(getdotstr(4, sysset[504], ','), 30); //20170718
|
||||
|
||||
//1:初始超车道阶段 2:初始普通车道阶段 3:左侧超车阶段
|
||||
//4:超车道行驶阶段 5:回原车道阶段 6:结束项目阶段
|
||||
//语音提示:请驶离超车道??? yhyflag
|
||||
m_car->createEventSound({itemNo(), sound::sub3_414003});
|
||||
}
|
||||
|
||||
m_itemv.CS_CCD_Flag = true;
|
||||
CSCCDFlag = true;
|
||||
//1:初始超车道阶段 2:初始普通车道阶段 3:左侧超车阶段
|
||||
//4:超车道行驶阶段 5:回原车道阶段 6:结束项目阶段
|
||||
m_itemv.CS_CCD_Flag = true;
|
||||
m_itemv.Status = 1;
|
||||
//语音提示:请驶离超车道??? yhyflag
|
||||
m_car->createEventSound({itemNo(), sound::sub3_414003});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -358,45 +364,53 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
|
||||
//1:初始超车道阶段 2:初始普通车道阶段 3:左侧超车阶段 4:完成左侧超车阶段
|
||||
//5:回原车道阶段 6:完成回原车道阶段
|
||||
if(m_itemv.Status == 1)
|
||||
//取消项目 军华说的378等于2打双跳就取消项目不需要判断其他条件 20240802 洛阳
|
||||
if(m_exam->ItemEnterCancelID == false && TableSysSet->get378() == "2" && sor.shtd == SYES)
|
||||
{
|
||||
//405:超车时在超车道上需驶离超车道
|
||||
//378:变更车道和超车:取消第1个项目 (0-不能 1-不变道也不开转向灯 2-开双跳)
|
||||
|
||||
if(TableSysSet->get405() == "1") //初始行驶在超车道上,在超车道上需驶离超车道
|
||||
{
|
||||
//取消项目
|
||||
if(m_exam->ItemEnterCancelID == false && TableSysSet->get378() == "1" && sor.shtd == SYES)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagIdle;
|
||||
m_exam->Item_Color = itemStateWk;
|
||||
m_exam->ItemEnterCancelID = true;
|
||||
m_car->setPUB_JDCC_ZT(0); //借道超车
|
||||
m_car->setChaoChe_Start_TM(0);
|
||||
//ToDo:语音播报:取消变更车道或者取消超车
|
||||
m_car->createEventCancelItem({m_exam->ItemNo, ""});
|
||||
//m_car->createEventSound({itemNo(), sound::sub3_414004});
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_exam->TestPro = ItemProFlagIdle;
|
||||
m_exam->Item_Color = itemStateWk;
|
||||
m_exam->ItemEnterCancelID = true;
|
||||
m_car->setPUB_JDCC_ZT(0); //借道超车
|
||||
m_car->setChaoChe_Start_TM(0);
|
||||
//ToDo:语音播报:取消变更车道或者取消超车
|
||||
m_car->createEventCancelItem({m_exam->ItemNo, ""});
|
||||
//m_car->createEventSound({itemNo(), sound::sub3_414004});
|
||||
return;
|
||||
}
|
||||
|
||||
if(cg->ai_ljjl - m_itemv.Start_LJJL >= m_itemv.Temp_XMJL) //出项目距离,结束
|
||||
if(m_itemv.Temp_XMJL > 0)
|
||||
{
|
||||
//到达这个距离,还没有完成项目,肯定要扣分的(除非你取消了项目)
|
||||
//SysSet[378]:变更车道和超车:取消第1个项目 (0-不能 1-不变道也不开转向灯 2-开双跳)
|
||||
if(TableSysSet->get378() == "1") //如果你正常完成了,不可能直行到项目距离这里
|
||||
if(cg->ai_ljjl - m_itemv.Start_LJJL >= m_itemv.Temp_XMJL) //出项目距离,结束
|
||||
{
|
||||
if(m_exam->ItemEnterCancelID == false)
|
||||
//到达这个距离,还没有完成项目,肯定要扣分的(除非你取消了项目)
|
||||
//SysSet[378]:变更车道和超车:取消第1个项目 (0-不能 1-不变道也不开转向灯 2-开双跳)
|
||||
if(TableSysSet->get378() == "1") //如果你正常完成了,不可能直行到项目距离这里
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagIdle;
|
||||
m_exam->Item_Color = itemStateWk;
|
||||
m_exam->ItemEnterCancelID = true;
|
||||
m_car->setPUB_JDCC_ZT(0); //借道超车
|
||||
m_car->setChaoChe_Start_TM(0);
|
||||
//ToDo:语音播报:取消变更车道或者取消超车
|
||||
m_car->createEventCancelItem({m_exam->ItemNo, ""});
|
||||
//m_car->createEventSound({itemNo(), sound::sub3_414004});
|
||||
if(m_exam->ItemEnterCancelID == false &&
|
||||
(m_itemv.Status == 1 || (m_itemv.Status == 2 && !m_itemv.CS_CCD_Flag)))
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagIdle;
|
||||
m_exam->Item_Color = itemStateWk;
|
||||
m_exam->ItemEnterCancelID = true;
|
||||
m_car->setPUB_JDCC_ZT(0); //借道超车
|
||||
m_car->setChaoChe_Start_TM(0);
|
||||
//ToDo:语音播报:取消变更车道或者取消超车
|
||||
m_car->createEventCancelItem({m_exam->ItemNo, ""});
|
||||
//m_car->createEventSound({itemNo(), sound::sub3_414004});
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_itemv.Status < 6)
|
||||
{
|
||||
if(!m_itemv.Mark_10_41_Flag)
|
||||
{
|
||||
m_itemv.Mark_10_41_Flag = true;
|
||||
JUDGE_MARK_SUB3(10, "41", false);
|
||||
}
|
||||
}
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -412,7 +426,19 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
//项目距离设置等于0的:读到下一个项目点时,结束项目,未完成完整动作的,扣分后结束项目
|
||||
if(m_car->itemsSomeExaming2(Sub3ItemType06Rxhd) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType07Xxqy) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType08Gjzt) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType11Kbtc) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType12Dtxx) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType03Zxxs) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType05Lkzx) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType15Lkzz) ||
|
||||
m_car->itemsSomeExaming2(Sub3ItemType16Lkyz))
|
||||
{
|
||||
if(m_itemv.Status < 6)
|
||||
{
|
||||
@ -425,9 +451,9 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//借道超车状态 0:非借道 1:表示超车 2:表示正在返回原车道 3:回原车道道完成
|
||||
//以下是借道超车相关的业务逻辑
|
||||
if(RTKKM3.TouchLineType == TRTKResult::TouchLineType6 && RTKKM3_1.TouchLineType == TRTKResult::TouchLineType6 && m_car->getPUB_JDCC_ZT() == 1)
|
||||
@ -454,6 +480,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
}
|
||||
}
|
||||
|
||||
std::string s405 = TableSysSet->get405();
|
||||
//特殊地方需求1 ,临沂
|
||||
if(LinYiFlag == true)
|
||||
{
|
||||
@ -484,34 +511,32 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
//如果初始在超车到
|
||||
if(m_itemv.Status == 1) //初始在超车道阶段
|
||||
{
|
||||
if(cg->ai_ljjl - m_itemv.Start_LJJL > m_itemv.CS_CCD_Max_XSJL)
|
||||
if(RTKKM3.BasePointInLaneNo > 0 && RTKKM3.BasePointInLaneNo != RTKKM3.BaseLaneCount)
|
||||
{
|
||||
m_itemv.Status = 2; //已经从超车到-->非超车道
|
||||
m_itemv.Temp_BasePointInLaneNo = RTKKM3.BasePointInLaneNo;
|
||||
m_itemv.Temp_BaseLaneCount = RTKKM3.BaseLaneCount;
|
||||
m_itemv.Temp_LJJL_CCD_PTCD = cg->ai_ljjl; //记下此时的距离
|
||||
|
||||
m_itemv.Temp_St2_CheDaoHao = RTKKM3.BasePointInLaneNo; //初始在普通车道的车道号
|
||||
m_itemv.Temp_St2_CheDaoCount = RTKKM3.BaseLaneCount; //初始在普通车道的车道数
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(s405 == "1" && cg->ai_ljjl - m_itemv.Start_LJJL > m_itemv.CS_CCD_Max_XSJL)
|
||||
{
|
||||
JUDGE_MARK_SUB3(10, "41", false); //20160928
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneNo > 0 && RTKKM3.BasePointInLaneNo != RTKKM3.BaseLaneCount)
|
||||
{
|
||||
m_itemv.Status = 2; //已经从超车到-->非超车道
|
||||
m_itemv.Temp_BasePointInLaneNo = RTKKM3.BasePointInLaneNo;
|
||||
m_itemv.Temp_BaseLaneCount = RTKKM3.BaseLaneCount;
|
||||
m_itemv.Temp_LJJL_CCD_PTCD = cg->ai_ljjl; //记下此时的距离
|
||||
|
||||
m_itemv.Temp_St2_CheDaoHao = RTKKM3.BasePointInLaneNo; //初始在普通车道的车道号
|
||||
m_itemv.Temp_St2_CheDaoCount = RTKKM3.BaseLaneCount; //初始在普通车道的车道数
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//在普通车道上,开始超车距离
|
||||
if(m_itemv.Status == 2) //普通车道上,准备超车
|
||||
{
|
||||
//如果初始在超车道,行驶到普通车道,要行驶一段距离504参数才能在进超车道
|
||||
if(m_itemv.CS_CCD_Flag == true && m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL_OK == false)
|
||||
if(m_itemv.CS_CCD_Flag == true && s405 == "1" && m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL_OK == false)
|
||||
{
|
||||
//初始超车道,二次超车最小行驶距离(如果初始在超车道上,需要驶离超车道,
|
||||
//然后行驶规定的距离后,再次进入超车道超车)
|
||||
@ -542,7 +567,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
|
||||
if(BianDaoKind != 0)
|
||||
{
|
||||
if(m_itemv.CS_CCD_Flag == true && m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL_OK == false)
|
||||
if(m_itemv.CS_CCD_Flag == true && s405 == "1" && m_itemv.CS_CCD_ErCiChaoChe_Min_XSJL_OK == false)
|
||||
{
|
||||
JUDGE_MARK_SUB3(10, "41", false); //20160928
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
@ -556,7 +581,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
if(!m_itemv.Mark_10_42_Flag)
|
||||
{
|
||||
m_itemv.Mark_10_42_Flag = true;
|
||||
JUDGE_MARK_SUB3(10, "42", false);
|
||||
//JUDGE_MARK_SUB3(10, "42", false); //在通用评判里了
|
||||
}
|
||||
}
|
||||
else if(!m_itemv.Temp_ZFXD3s)
|
||||
@ -564,7 +589,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
if(!m_itemv.Mark_10_43_Flag)
|
||||
{
|
||||
m_itemv.Mark_10_43_Flag = true;
|
||||
JUDGE_MARK_SUB3(10, "43", false);
|
||||
//JUDGE_MARK_SUB3(10, "43", false); //在通用评判里了
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -589,7 +614,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
//m_itemv.In_CCD_Must_JL
|
||||
//SysSet[414]:变道、超车以前后轮都过线(0-否 1-是)
|
||||
bool OKFlag = true;
|
||||
if(TableSysSet->get414() == "1" && RTKKM3.TouchLineType != 0)
|
||||
if(TableSysSet->get414() == "1" && RTKKM3.TouchLineType != TRTKResult::TouchLineType0)
|
||||
{
|
||||
OKFlag = false;
|
||||
}
|
||||
@ -622,7 +647,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
{
|
||||
if(gps.sj - m_itemv.St4_HuiYuanCheDao_TM > m_itemv.St4_HuiYuanCheDao_Miao*SECOND)
|
||||
{
|
||||
if(m_itemv.Mark_10_41_Flag)
|
||||
if(!m_itemv.Mark_10_41_Flag)
|
||||
{
|
||||
m_itemv.Mark_10_41_Flag = true;
|
||||
JUDGE_MARK_SUB3(10, "41", false);
|
||||
@ -665,7 +690,7 @@ void Sub3Judge10Ccxx::dealJudgeItem()
|
||||
//SysSet[414]:变道、超车以前后轮都过线(0-否 1-是)
|
||||
if(TableSysSet->get414() == "1")
|
||||
{
|
||||
if(RTKKM3.TouchLineType == 0)
|
||||
if(RTKKM3.TouchLineType == TRTKResult::TouchLineType0)
|
||||
{
|
||||
m_itemv.Status = 6;
|
||||
return;
|
||||
|
||||
@ -112,6 +112,14 @@
|
||||
*
|
||||
* 2338帧后,步进跟踪超车项目。
|
||||
*
|
||||
* 超车结束和取消规则:
|
||||
* 1、项目只能取消一次;
|
||||
* 2、做完一套完整动作的,结束项目
|
||||
* 3、378=2,开启双挑灯,立即取消
|
||||
* 3、项目距离设置等于0的:读到下一个项目点时,未完成完整动作的,扣分后结束项目
|
||||
* 4、项目距离设置大于0,距离达到项目距离的,且378=1:从未变过道的,取消项目;有过变道但未完成完整动作的,扣分后结束项目
|
||||
* 5、项目距离设置大于0,距离达到项目距离的,且378!=1:扣分后结束项目
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SUB3JUDGE10CCXX_H
|
||||
|
||||
@ -19,7 +19,7 @@ bool Sub3Judge11Kbtc::dealJudgeEnter()
|
||||
const TChuanGan* cg = m_car->historyChuanGan();
|
||||
const std::string& ksdd = TableSysSet->get211();
|
||||
|
||||
m_car->setPubCanJudge_XiHuoFlag(false);
|
||||
m_car->setPubCanJudge_XiHuoFlag(true);
|
||||
m_car->setPubKaoBianTCFinish_LJJL(0);
|
||||
m_itemv = TSub3Item11Kbtc();
|
||||
|
||||
@ -148,6 +148,8 @@ void Sub3Judge11Kbtc::dealJudgeItem()
|
||||
const TSensorInfo& sor = cg->real.sensor;
|
||||
const std::string& ksdd = TableSysSet->get211();
|
||||
|
||||
m_car->setPubCanJudge_XiHuoFlag(m_itemv.Status < 3);
|
||||
|
||||
//特殊地区功能1
|
||||
if(ksdd == siteof::nj || ksdd == siteof::njdckm3)
|
||||
{
|
||||
@ -469,7 +471,8 @@ void Sub3Judge11Kbtc::DoStatus_2()
|
||||
const TChuanGan* his5 = m_car->historyChuanGan(5);
|
||||
const TChuanGan* his6 = m_car->historyChuanGan(6);
|
||||
if(cg->move == moveBackward && (sor.dw < 1 || sor.dw > 5) &&
|
||||
his1->move == moveBackward && his2->move == moveBackward && his3->move == moveBackward && his4->move == moveBackward &&
|
||||
his1->move == moveBackward && his2->move == moveBackward &&
|
||||
his3->move == moveBackward && his4->move == moveBackward &&
|
||||
his5->move != moveBackward && his6->move != moveBackward)
|
||||
{
|
||||
JUDGE_MARK_SUB3(11, "45", false);
|
||||
@ -533,7 +536,7 @@ void Sub3Judge11Kbtc::DoStatus_2()
|
||||
}
|
||||
|
||||
//靠边停车确认停车条件(0-拉手刹放空挡或拉手刹动作或开车门或解开安全带 1-拉手刹同时置空档 2-停车就判 3-开车门才判)
|
||||
if(s430 == "3") //拉手刹放空挡
|
||||
if(s430 == "3") //开车门
|
||||
{
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
const TSensorInfo& sor3 = m_car->historySensor(3);
|
||||
@ -556,12 +559,10 @@ void Sub3Judge11Kbtc::DoStatus_2()
|
||||
{
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
const TSensorInfo& sor3 = m_car->historySensor(3);
|
||||
const TSensorInfo& sor4 = m_car->historySensor(4);
|
||||
const TSensorInfo& sor5 = m_car->historySensor(5);
|
||||
const TSensorInfo& sor6 = m_car->historySensor(6);
|
||||
//拉手刹放空挡 或 拉手刹动作 或 开车门 或 解开安全带 进入下一阶段
|
||||
if((sor.ssc == SYES && sor.dw == SNOT) || (sor.ssc == SYES && sor1.ssc == SYES && sor2.ssc == SYES) ||
|
||||
(sor.mkg == SYES && sor1.mkg == SYES && sor2.mkg == SYES && sor3.mkg == SYES && sor4.mkg == SYES && sor5.mkg == SNOT && sor6.mkg == SNOT) ||
|
||||
if((sor.ssc == SYES && sor.dw == SNOT) ||
|
||||
(sor.ssc == SYES && sor1.ssc == SYES && sor2.ssc == SYES && sor3.ssc == SNOT) ||
|
||||
(sor.mkg == SYES && sor1.mkg == SYES && sor2.mkg == SYES && sor3.mkg == SNOT) ||
|
||||
(sor.aqd == SNOT && sor1.aqd == SNOT && sor2.aqd == SNOT && sor3.aqd == SYES)) //20180130
|
||||
{
|
||||
m_itemv.Status = 3;
|
||||
@ -1053,9 +1054,10 @@ void Sub3Judge11Kbtc::DoStatus_4()
|
||||
JUDGE_MARK_SUB3(11, "45", true);
|
||||
}
|
||||
}
|
||||
if(ksdd == siteof::nmgcfkm3 || ksdd == siteof::nmgtlkm3)
|
||||
if(ksdd == siteof::nmgcfkm3 || ksdd == siteof::nmgtlkm3 || ksdd == siteof::hnzzkm3)
|
||||
{
|
||||
if(sor.dw > 0 && sor1.dw > 0 && sor2.dw > 0)
|
||||
if(sor.dw > 0 && sor1.dw > 0 && sor2.dw > 0 &&
|
||||
sor.dw < 10 && sor1.dw < 10 && sor2.dw < 10)
|
||||
{
|
||||
//不按考试员指令驾驶
|
||||
JUDGE_MARK_SUB3(11, "45", true);
|
||||
@ -1332,7 +1334,9 @@ void Sub3Judge11Kbtc::Judge_KBTC_YaXian()
|
||||
{
|
||||
FindFlag = true;
|
||||
}
|
||||
if(RTKKM3_0.TouchLineTypeCS == 3 && RTKKM3_1.TouchLineTypeCS == 3 && RTKKM3_2.TouchLineTypeCS == 3)
|
||||
if(RTKKM3_0.TouchLineTypeCS == TRTKResult::TouchLineTypeCS3 &&
|
||||
RTKKM3_1.TouchLineTypeCS == TRTKResult::TouchLineTypeCS3 &&
|
||||
RTKKM3_2.TouchLineTypeCS == TRTKResult::TouchLineTypeCS3)
|
||||
{
|
||||
FindFlag = true;
|
||||
}
|
||||
@ -1342,8 +1346,12 @@ void Sub3Judge11Kbtc::Judge_KBTC_YaXian()
|
||||
// 20150415 出线,边缘线为负值
|
||||
if(FindFlag == true)
|
||||
{
|
||||
int JL0 = std::min(RTKKM3_0.Body_RF_ToBaseLine, RTKKM3_0.Body_RB_ToBaseLine);
|
||||
int JL1 = std::min(RTKKM3_1.Body_RF_ToBaseLine, RTKKM3_1.Body_RB_ToBaseLine);
|
||||
int JL2 = std::min(RTKKM3_2.Body_RF_ToBaseLine, RTKKM3_2.Body_RB_ToBaseLine);
|
||||
|
||||
int s481 = TableSysSet->asInt481();
|
||||
if((Max_JL0 + s481) < 0 && Max_JL1 + s481 < 0 && Max_JL2 + s481 < 0 && !m_itemv.Kf03)
|
||||
if(JL0 + s481 < 0 && JL1 + s481 < 0 && JL2 + s481 < 0 && !m_itemv.Kf03)
|
||||
{
|
||||
CheShenChuXian = true;
|
||||
}
|
||||
|
||||
@ -200,19 +200,19 @@ void Sub3Judge12Lkdt::dealJudgeItem()
|
||||
}
|
||||
|
||||
//如果设置了路口掉头的方向灯立刻判(打错立刻判)
|
||||
const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
{
|
||||
const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
if(sor.yfxd == SYES && sor1.yfxd == SYES && sor2.yfxd == SYES)
|
||||
{
|
||||
if(!m_itemv.Mark_12_42_Flag)
|
||||
{
|
||||
JUDGE_MARK_SUB3(12, "42", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
//const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
//if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
//{
|
||||
// const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
// const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
// if(sor.yfxd == SYES && sor1.yfxd == SYES && sor2.yfxd == SYES)
|
||||
// {
|
||||
// if(!m_itemv.Mark_12_42_Flag)
|
||||
// {
|
||||
// JUDGE_MARK_SUB3(12, "42", false);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//方向灯评判
|
||||
//方向灯标志
|
||||
@ -292,21 +292,21 @@ void Sub3Judge12Lkdt::dealJudgeItem()
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(1, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_Z] != TURN_1)
|
||||
{
|
||||
JUDGE_MARK_SUB3(12, "45", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(m_itemv.Check_CheDao == false)
|
||||
//if(m_itemv.Check_CheDao == false)
|
||||
{
|
||||
m_itemv.Check_CheDao = true;
|
||||
//m_itemv.Check_CheDao = true;
|
||||
//路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(3, 1) != "1") //if(Copy(RTKKM3.BasePointInLaneDir, 2, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_D] != TURN_1) //if(Copy(RTKKM3.BasePointInLaneDir, 2, 1) != "1")
|
||||
{
|
||||
JUDGE_MARK_SUB3(12, "45", true);
|
||||
}
|
||||
|
||||
@ -223,6 +223,20 @@ void Sub3Judge12Ptdt::dealJudgeItem()
|
||||
//掉头角度变化
|
||||
double a = std::abs(gps.hxj - m_itemv.CS_GPS_D);
|
||||
double b = std::abs(gps5.hxj- m_itemv.CS_GPS_D);
|
||||
|
||||
//if(Tools::greater(gps.hxj, m_itemv.CS_GPS_D))
|
||||
//{
|
||||
// a = std::abs(360 - gps.hxj + m_itemv.CS_GPS_D);
|
||||
//}
|
||||
//
|
||||
//if(Tools::greater(gps5.hxj, m_itemv.CS_GPS_D))
|
||||
//{
|
||||
// b = std::abs(360 - gps5.hxj + m_itemv.CS_GPS_D);
|
||||
//}
|
||||
//
|
||||
//logdebug("CS_GPS_D=%0.2f,hxj=%0.2f,hxj5=%0.2f, a=%0.2f,b=%0.2f",
|
||||
// m_itemv.CS_GPS_D, gps.hxj, gps5.hxj, a, b);
|
||||
|
||||
//528:掉头N米内不判连续变道和方向灯
|
||||
if(m_car->getNJ_DiaoTou_JL() == 0 && TableSysSet->asInt528() > 0)
|
||||
{
|
||||
|
||||
@ -216,17 +216,21 @@ void Sub3Judge15Lkzz::dealJudgeItem()
|
||||
//fxdcc:方向灯错误评判,如左转开右方向灯立即扣分
|
||||
//大车右转必停时长(毫秒,默认为0不用停车)
|
||||
//方向灯必须持续到路口停止线
|
||||
const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
|
||||
if(!m_itemv.Step3Flag)
|
||||
{
|
||||
const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
if(sor.yfxd == SYES && sor1.yfxd == SYES && sor2.yfxd == SYES)
|
||||
const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
{
|
||||
if(!m_itemv.Mark_20_73_Flag)
|
||||
const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
if(sor.yfxd == SYES && sor1.yfxd == SYES && sor2.yfxd == SYES)
|
||||
{
|
||||
m_itemv.Mark_20_73_Flag = true;
|
||||
JUDGE_MARK_SUB3(20, "73", false);
|
||||
if(!m_itemv.Mark_20_73_Flag)
|
||||
{
|
||||
m_itemv.Mark_20_73_Flag = true;
|
||||
JUDGE_MARK_SUB3(20, "73", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -318,14 +322,14 @@ void Sub3Judge15Lkzz::dealJudgeItem()
|
||||
//检查车道是否正确
|
||||
if(RTKKM3.CrossLineAttr == TRTKResult::CrossLineAttr1 || m_exam->Gps_Itemno1 == 2 || m_exam->Gps_Itemno1 == 3)
|
||||
{
|
||||
if(m_itemv.Check_CheDao == false)
|
||||
//if(m_itemv.Check_CheDao == false)
|
||||
{
|
||||
m_itemv.Check_CheDao = true;
|
||||
//m_itemv.Check_CheDao = true;
|
||||
//路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(2, 1) != "1") //if(Copy(RTKKM3.BasePointInLaneDir, 3, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_L] != TURN_1) //if(Copy(RTKKM3.BasePointInLaneDir, 3, 1) != "1")
|
||||
{
|
||||
JUDGE_MARK_SUB3(15, "45", true);
|
||||
}
|
||||
|
||||
@ -93,6 +93,7 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
if(!m_car->isQualified())
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -213,17 +214,20 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
//fxdcc:方向灯错误评判,如左转开右方向灯立即扣分
|
||||
//大车右转必停时长(毫秒,默认为0不用停车)
|
||||
//方向灯必须持续到路口停止线
|
||||
const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
if(!m_itemv.Step3Flag)
|
||||
{
|
||||
const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
if(sor.zfxd == SYES && sor1.zfxd == SYES && sor2.zfxd == SYES)
|
||||
const std::vector<std::string>& s508 = TableSysSet->asArray508();
|
||||
if(s508.size() > 2 && std::atoi(s508[2].c_str()) == 1)
|
||||
{
|
||||
if(!m_itemv.Mark_20_73_Flag )
|
||||
const TSensorInfo& sor1 = m_car->historySensor(1);
|
||||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||||
if(sor.zfxd == SYES && sor1.zfxd == SYES && sor2.zfxd == SYES)
|
||||
{
|
||||
m_itemv.Mark_20_73_Flag = true;
|
||||
JUDGE_MARK_SUB3(20, "73", false);
|
||||
if(!m_itemv.Mark_20_73_Flag)
|
||||
{
|
||||
m_itemv.Mark_20_73_Flag = true;
|
||||
JUDGE_MARK_SUB3(20, "73", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,6 +245,7 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
if(cg->ai_ljjl_cm - m_itemv.StopLine_JLCM >= dis2)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -310,14 +315,14 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
//检查车道是否正确
|
||||
if(RTKKM3.CrossLineAttr == TRTKResult::CrossLineAttr1 || m_exam->Gps_Itemno1 == 2 || m_exam->Gps_Itemno1 == 3)
|
||||
{
|
||||
if(m_itemv.Check_CheDao == false)
|
||||
//if(m_itemv.Check_CheDao == false)
|
||||
{
|
||||
m_itemv.Check_CheDao = true;
|
||||
//m_itemv.Check_CheDao = true;
|
||||
//路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头
|
||||
//1000 0100 0010 0001
|
||||
if(RTKKM3.BasePointInLaneDir != "")
|
||||
{
|
||||
if(RTKKM3.BasePointInLaneDir.substr(0, 1) != "1") //if(Copy(RTKKM3.BasePointInLaneDir, 1, 1) != "1")
|
||||
if(RTKKM3.BasePointInLaneDir[TURN_R] != TURN_1) //if(Copy(RTKKM3.BasePointInLaneDir, 1, 1) != "1")
|
||||
{
|
||||
JUDGE_MARK_SUB3(16, "45", true);
|
||||
}
|
||||
@ -362,6 +367,7 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
if(cg->ai_ljjl_cm - m_itemv.Start_JL_CM > m_itemv.XMJL_Mi * 100)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -439,6 +445,7 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
if(OKFlag == true)
|
||||
{
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
JudgeFlagEnd();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -475,16 +482,6 @@ void Sub3Judge16Lkyz::dealJudgeItem()
|
||||
str += buf;
|
||||
}
|
||||
|
||||
if(m_exam->TestPro == ItemProFlagEnd)
|
||||
{
|
||||
if(m_itemv.LuK_Fx_PointNo > 0)
|
||||
{
|
||||
if(m_itemv.OKFangXiangPt_SuccessFlag == false && m_itemv.ReadNextLuDuanFlag == true)
|
||||
{
|
||||
JUDGE_MARK_SUB3(16, "41", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
str += msg;
|
||||
showStatus(str);
|
||||
@ -529,3 +526,17 @@ void Sub3Judge16Lkyz::JudgeFXD()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Sub3Judge16Lkyz::JudgeFlagEnd()
|
||||
{
|
||||
if(m_exam->TestPro == ItemProFlagEnd)
|
||||
{
|
||||
if(m_itemv.LuK_Fx_PointNo > 0)
|
||||
{
|
||||
if(m_itemv.OKFangXiangPt_SuccessFlag == false && m_itemv.ReadNextLuDuanFlag == true)
|
||||
{
|
||||
JUDGE_MARK_SUB3(16, "41", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ public:
|
||||
|
||||
protected:
|
||||
void JudgeFXD();
|
||||
void JudgeFlagEnd();
|
||||
|
||||
private:
|
||||
TSub3Item16Lkyz m_itemv;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include "Sub3Judge20Comm.h"
|
||||
#include "HFactory.h"
|
||||
#include "Sub3Judge14Jjdw.h"
|
||||
#include "Sub3Judge41Mndg.h"
|
||||
|
||||
Sub3Judge20Comm::Sub3Judge20Comm()
|
||||
{
|
||||
@ -139,6 +140,8 @@ void Sub3Judge20Comm::dealJudgeItem()
|
||||
//24、全程必须达到次高挡位 、全程必须次高挡达到5秒
|
||||
Judge_CiGaoDang();
|
||||
|
||||
//逆向行驶评判
|
||||
//JudgeDriveDirection();
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//附加评判(比如:非法掉头、超速SystemParm8、夜间行驶)
|
||||
Judge_Extra();
|
||||
@ -755,27 +758,42 @@ void Sub3Judge20Comm::CallMoNiDengGuang()
|
||||
return; //屏蔽模拟灯光
|
||||
#endif
|
||||
|
||||
const std::string& s386 = TableSysSet->get386();
|
||||
//模拟灯光:参数386=0,开始考试后,就触发模拟灯光
|
||||
if(s386 != "0")
|
||||
{
|
||||
TKM3Item* item01 = m_car->findExamItem(Sub3ItemType01Sczb); //上车准备
|
||||
if(item01 && item01->Item_Color != itemStateHg && item01->Item_Color != itemStateBhg)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
TKM3Item* item41 = m_car->findExamItem(Sub3ItemType41Mndg);
|
||||
if(item41 == nullptr) //有可能免考,可能没这个项目
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(item41->FinishFlag == true) //考结束了
|
||||
{
|
||||
ISub3JudgeItem* item = m_car->findJudgeItem(Sub3ItemType41Mndg);
|
||||
if(item)
|
||||
{
|
||||
Sub3Judge41Mndg* item41mndg = dynamic_cast<Sub3Judge41Mndg*>(item);
|
||||
if(item41mndg)
|
||||
{
|
||||
item41mndg->JudgeEndCloseLight();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(item41->Item_Color != itemStateWk) //正在考或者已经考过了
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string& s386 = TableSysSet->get386();
|
||||
//模拟灯光:参数386=0,开始考试后,就触发模拟灯光
|
||||
if(s386 != "0")
|
||||
{
|
||||
TKM3Item* item01 = m_car->findExamItem(Sub3ItemType01Sczb); //上车准备
|
||||
if(item01 && item01->FinishFlag == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const TChuanGan* cg = m_car->historyChuanGan();
|
||||
const TSensorInfo& sor = cg->real.sensor;
|
||||
const TChuanGan* his1 = m_car->historyChuanGan(1);
|
||||
@ -786,13 +804,16 @@ void Sub3Judge20Comm::CallMoNiDengGuang()
|
||||
const TSensorInfo& sor3 = his3->real.sensor;
|
||||
|
||||
const std::string& ksdd = TableSysSet->get211();
|
||||
|
||||
//322参数0:模拟灯光开始和结束都要检查 1:只检查结束 2:只检查开始 默认不配置都检查
|
||||
//501第10个参数时间毫秒、如果不配置那就是2米检查,如果过程中关闭再打开也算关闭
|
||||
const std::string& s322 = TableSysSet->get322();
|
||||
|
||||
TCar* tcar = m_car->getTCar();
|
||||
if((sor.fdjzs > 100 && sor1.fdjzs > 100 && sor2.fdjzs > 100 && sor3.fdjzs > 100) ||
|
||||
(Tools::pos(XCharacter("江淮电动"), tcar->CarTypeName) && sor.dh1 == SYES) ||
|
||||
(s386 == "5" && sor.dh1 == SYES) ||
|
||||
(sor.aqd == SYES && sor1.aqd == SYES && s386 == "6") ) //20170314 训练模式 只要有dh1就可以进行模拟灯光
|
||||
(s386 == "6" && sor.aqd == SYES && sor1.aqd == SYES) ) //20170314 训练模式 只要有dh1就可以进行模拟灯光
|
||||
{
|
||||
//关闭灯光 20180809
|
||||
if((s322 != "1") && (sor.shtd + sor.skd + sor.ygd + sor.jgd + sor.zfxd + sor.yfxd > 0 || ksdd == siteof::nj))
|
||||
@ -843,12 +864,15 @@ void Sub3Judge20Comm::CallMoNiDengGuang()
|
||||
JUDGE_MARK_SUB3(41, "42", true);
|
||||
}
|
||||
|
||||
//开始模拟灯光
|
||||
if(item41 && item41->Item_Color == itemStateWk) //有可能免考,可能没这个项目
|
||||
if(m_car->isExamDrill())
|
||||
{
|
||||
item41->Item_Color = itemStateZk;
|
||||
item41->TestPro = ItemProFlagInit;
|
||||
item41->FinishFlag = false;
|
||||
//开始模拟灯光
|
||||
if(item41 && item41->Item_Color == itemStateWk) //有可能免考,可能没这个项目
|
||||
{
|
||||
item41->Item_Color = itemStateZk;
|
||||
item41->TestPro = ItemProFlagInit;
|
||||
item41->FinishFlag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1083,6 +1107,7 @@ void Sub3Judge20Comm::Judge_GuaDangBuJin()
|
||||
int j = 0;
|
||||
int k = sor2.dw; //最近的一个前进档
|
||||
int itc = 0;
|
||||
//SysSet[507]>5: 2次挂挡不进在停车状态下也判
|
||||
const std::vector<std::string>& s507 = TableSysSet->asArray507();
|
||||
if(s507.size() > 4 && s507[4] == "1") //getdotstr(5, sysset[507], ',') = '1'
|
||||
{
|
||||
@ -1090,7 +1115,7 @@ void Sub3Judge20Comm::Judge_GuaDangBuJin()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cg->move== moveForward)
|
||||
if(cg->move == moveForward)
|
||||
itc = 1;
|
||||
}
|
||||
if(itc == 1 && k > 0 && k != 9)
|
||||
@ -1104,7 +1129,6 @@ void Sub3Judge20Comm::Judge_GuaDangBuJin()
|
||||
{
|
||||
if(i >= count) break;
|
||||
const TSensorInfo& sori = m_car->historySensor(i);
|
||||
|
||||
int Temp = sori.dw;
|
||||
//挂过其他档,不算两次换档不进
|
||||
if(k != Temp && Temp > 0)
|
||||
@ -1754,7 +1778,7 @@ void Sub3Judge20Comm::Judge_YaXian_30120()
|
||||
(RTKKM3.TouchLineType == 7 && RTKKM3_1.TouchLineType == 7 && RTKKM3_2.TouchLineType == 7 && RTKKM3_3.TouchLineType == 7 &&
|
||||
Tools::greater(gps.sd, 0)) ||
|
||||
(RTKKM3.TouchLineType == 5 && RTKKM3_1.TouchLineType == 5 && RTKKM3_2.TouchLineType == 5 && RTKKM3_3.TouchLineType == 5 &&
|
||||
ItemFlag2 == true && ItemFlag11 == true))
|
||||
ItemFlag2 == true && ksdd == siteof::jswxbz))
|
||||
{
|
||||
int TempZT = 0;
|
||||
|
||||
@ -1766,7 +1790,8 @@ void Sub3Judge20Comm::Judge_YaXian_30120()
|
||||
|
||||
const std::string s325 = TableSysSet->get325();
|
||||
//SysSet[325] 靠边停车压线条件(0-停车压线才判;1-压线立即判)
|
||||
if(TempZT == ItemProFlagIdle || (TempZT > ItemProFlagInit && cg->move == moveForward && s325 == "1")) //不在靠边停车 或在靠边停车非停车状态 20150807
|
||||
//if(TempZT == ItemProFlagIdle || (TempZT > ItemProFlagInit && ((cg->move == moveForward && s325 == "1") || (cg->move == moveStop && s325 != "1")))) //不在靠边停车 或在靠边停车非停车状态 20150807
|
||||
if(TempZT == ItemProFlagIdle || (TempZT > ItemProFlagInit && Tools::greater(gps.sd, 0)))
|
||||
{
|
||||
//20190115
|
||||
if(ksdd == siteof::heb)
|
||||
@ -3320,7 +3345,7 @@ void Sub3Judge20Comm::Judge_BianDaoFangXiangDeng2()
|
||||
{
|
||||
OKFlag = true;
|
||||
}
|
||||
if(s355 == "2" || s355 == "1" || (s355 == "1" && OKFlag == true))
|
||||
if(s355 == "2" || s355 == "1" || (s355 == "0" && OKFlag == true))
|
||||
{
|
||||
if(m_itemvCJH.BeforeBgcd_LaneNo > 0)
|
||||
{
|
||||
@ -4296,30 +4321,38 @@ void Sub3Judge20Comm::Judge_XiHuo()
|
||||
const TChuanGan* his2 = m_car->historyChuanGan(2);
|
||||
const TSensorInfo& sor2 = his2->real.sensor;
|
||||
|
||||
if(m_car->getPubCanJudge_XiHuoFlag() == false)
|
||||
{
|
||||
if(m_car->getPubKaoBianTCFinish_LJJL() == 0) return;
|
||||
if(cg->ai_ljjl - m_car->getPubKaoBianTCFinish_LJJL() >= 10)
|
||||
{
|
||||
m_car->setPubCanJudge_XiHuoFlag(true);
|
||||
}
|
||||
}
|
||||
if(m_car->getPubCanJudge_XiHuoFlag() == false) return;
|
||||
//ToDo:目前先按发动机转速评判
|
||||
//靠边停车项目中不判熄火
|
||||
if(sor.fdjzs > 20 && sor1.fdjzs > 20 && sor2.fdjzs > 20)
|
||||
{
|
||||
m_itemvXLG.XH_Enabled = true;
|
||||
}
|
||||
bool KBTCFlag = false;
|
||||
|
||||
KBTCFlag = m_car->itemsSomeExaming2(Sub3ItemType11Kbtc);
|
||||
bool JudgeXiHuo = true;
|
||||
if(m_car->itemsSomeExaming2(Sub3ItemType11Kbtc)) //如果是靠边停车确认停车之前要判
|
||||
{
|
||||
JudgeXiHuo = m_car->getPubCanJudge_XiHuoFlag();
|
||||
}
|
||||
int dis = m_car->getPubKaoBianTCFinish_LJJL();
|
||||
if(dis != 0 && cg->ai_ljjl - dis < 5) //防止在考完所有项目这个时候还没点结束考试,这个时候熄火
|
||||
{
|
||||
JudgeXiHuo = false;
|
||||
//if(m_car->itemsSomeExaming())
|
||||
//{
|
||||
// JudgeXiHuo = true; //中途做靠边停车,如果进了别的项目或者有项目还没做也判
|
||||
//}
|
||||
}
|
||||
|
||||
if(JudgeXiHuo == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_itemvCJH.zdxhkf == 2) //点火2评判熄火
|
||||
{
|
||||
if(sor.dh2 == SYES && sor1.dh2 == SNOT && Tools::lessequal(gps.sd, 1.001))
|
||||
{
|
||||
if(!KBTCFlag)
|
||||
if(JudgeXiHuo)
|
||||
{
|
||||
JUDGE_MARK_SUB3(20, "36", false);
|
||||
}
|
||||
@ -4332,15 +4365,13 @@ void Sub3Judge20Comm::Judge_XiHuo()
|
||||
//发动机转速
|
||||
if(sor.fdjzs == 0 && sor1.fdjzs == 0 && sor2.fdjzs == 0 && sor3.fdjzs == 0)
|
||||
{
|
||||
if(Tools::lessequal(gps.sd, 1.001)) //加上车速过滤
|
||||
//发动机转速模式判熄火的没有速度条件。如果是点火2判熄火的有速度条件。
|
||||
if(m_itemvXLG.XH_Enabled == true)
|
||||
{
|
||||
if(m_itemvXLG.XH_Enabled == true)
|
||||
m_itemvXLG.XH_Enabled = false;
|
||||
if(JudgeXiHuo)
|
||||
{
|
||||
m_itemvXLG.XH_Enabled = false;
|
||||
if(!KBTCFlag)
|
||||
{
|
||||
JUDGE_MARK_SUB3(20, "36", false);
|
||||
}
|
||||
JUDGE_MARK_SUB3(20, "36", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4676,7 +4707,6 @@ void Sub3Judge20Comm::Judge_DangWei_CS_ZS()
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4698,15 +4728,15 @@ void Sub3Judge20Comm::Judge_DangWei_CS_ZS()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_itemvCJH.DW_CS_High_Flag == true) //低档高速
|
||||
if(m_itemvCJH.DW_CS_High_Flag == true)
|
||||
{
|
||||
constexpr int jskf = 2000; // 20170712m_itemvCJH.dw_cs_err_sj;
|
||||
//低档高速
|
||||
static constexpr int jskf = 2*SECOND;
|
||||
if(cg->tkCnt - m_itemvCJH.DW_CS_ERROR_TK > jskf)
|
||||
{
|
||||
int TempDW = m_itemvCJH.DW_CS_ERROR_DW;
|
||||
if(TempDW >= 1 && TempDW <= 5)
|
||||
{
|
||||
|
||||
TDWErrorRec& dwerr = m_itemvCJH.DWErrArr[TempDW];
|
||||
if(dwerr.djtkCnt != m_itemvCJH.DW_CS_ERROR_TK)
|
||||
{
|
||||
@ -4761,7 +4791,8 @@ void Sub3Judge20Comm::Judge_DangWei_CS_ZS()
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //高档低速,发动机转速低
|
||||
{
|
||||
//高档低速,发动机转速低
|
||||
constexpr int jskf = 2000;
|
||||
if(cg->tkCnt - m_itemvCJH.DW_CS_ERROR_TK >= jskf)
|
||||
{
|
||||
@ -5406,3 +5437,28 @@ bool Sub3Judge20Comm::Check_Diaotou(int jl, int dtjd)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Sub3Judge20Comm::JudgeDriveDirection()
|
||||
{
|
||||
if(m_car->historyCount() > 25)
|
||||
{
|
||||
const TRTKResult& RTK0 = m_car->historyRtkKM3(0);
|
||||
const TRTKResult& RTK1 = m_car->historyRtkKM3(1);
|
||||
if(RTK0.DirInverse == DriveDirN &&
|
||||
RTK1.DirInverse == DriveDirN &&
|
||||
m_car->historyRtkKM3(5).DirInverse == DriveDirN &&
|
||||
m_car->historyRtkKM3(10).DirInverse == DriveDirN &&
|
||||
m_car->historyRtkKM3(15).DirInverse == DriveDirN &&
|
||||
m_car->historyRtkKM3(20).DirInverse == DriveDirN &&
|
||||
m_car->historyRtkKM3(25).DirInverse == DriveDirN )
|
||||
{
|
||||
|
||||
//连续5秒逆向行驶,并且在测绘道路上
|
||||
if(RTK0.BasePointInLaneNo > 0 && RTK0.BaseLaneCount > 0 &&
|
||||
RTK1.BasePointInLaneNo > 0 && RTK1.BaseLaneCount > 0)
|
||||
{
|
||||
JUDGE_MARK_SUB3(20, "88", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +194,9 @@ protected:
|
||||
//25、自动靠边停车(重点)
|
||||
void Call_Auto_KBTC();
|
||||
|
||||
//逆向行驶评判
|
||||
void JudgeDriveDirection();
|
||||
|
||||
//26、夜间行驶及其他业务逻辑
|
||||
void Judge_Extra();
|
||||
bool Check_Diaotou(int jl, int dtjd);
|
||||
|
||||
@ -272,6 +272,7 @@ void Sub3Judge41Mndg::dealJudgeItem()
|
||||
{
|
||||
logtrace("mndg-item-end");
|
||||
m_exam->TestPro = ItemProFlagEnd;
|
||||
m_itemv.endTick = gps.sj;
|
||||
if(m_car->isExamDrill()) //训练模式
|
||||
{
|
||||
//Windows语音
|
||||
@ -3034,3 +3035,60 @@ void Sub3Judge41Mndg::playSoundEnd(const std::string& code)
|
||||
|
||||
}
|
||||
|
||||
void Sub3Judge41Mndg::JudgeEndCloseLight()
|
||||
{
|
||||
if(!m_exam->FinishFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//322参数0:模拟灯光开始和结束都要检查 1:只检查结束 2:只检查开始 默认不配置都检查
|
||||
//501第10个参数时间毫秒、如果不配置那就是2米检查,如果过程中关闭再打开也算关闭
|
||||
const std::string& s322 = TableSysSet->get322();
|
||||
if(s322 == "2") //只检查开始
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_itemv.endFlag)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
const TSensorInfo& sor = m_car->historySensor();
|
||||
//检查双跳 示宽灯关闭,如果有远近光灯,示宽灯必然打开
|
||||
if(sor.shtd == SNOT && sor.skd == SNOT)
|
||||
{
|
||||
m_itemv.endFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::string>& s501 = TableSysSet->asArray501();
|
||||
int ms = s501.size() > 9 && s501[9] != "" ? std::atoi(s501[9].c_str()) : 0;
|
||||
if(ms > 0)
|
||||
{
|
||||
const TGpsInfo& gps = m_car->historyGps();
|
||||
if(gps.sj - m_itemv.endTick > ms)
|
||||
{
|
||||
//模拟灯光结束没关灯要扣这个分,做模拟灯光之前没关闭灯光扣的是41,"42" 20240817在洛阳军华确认
|
||||
if(m_itemv.endFlag == false)
|
||||
{
|
||||
m_itemv.endFlag = true;
|
||||
JUDGE_MARK_SUB3(20, "93", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_car->disForward() > 200) //前进2米
|
||||
{
|
||||
if(m_itemv.endFlag == false)
|
||||
{
|
||||
m_itemv.endFlag = true;
|
||||
JUDGE_MARK_SUB3(20, "93", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -179,6 +179,7 @@ public:
|
||||
|
||||
//语音播报结束
|
||||
void playSoundEnd(const std::string& code);
|
||||
void JudgeEndCloseLight();
|
||||
protected:
|
||||
//更新灯光变化
|
||||
void UpdateDengGuangChange();
|
||||
|
||||
@ -65,6 +65,7 @@ bool XParser::parseBeginExam(const std::string& data, TStuInfo& info)
|
||||
CHECK_GET_PARAM(object, "exam", info.exam);
|
||||
CHECK_GET_PARAM(object, "replay", info.replay);
|
||||
CHECK_GET_PARAM(object, "track", info.track);
|
||||
CHECK_GET_PARAM(object, "passing", info.passing);
|
||||
CHECK_GET_PARAM(object, "xm", info.xm);
|
||||
CHECK_GET_PARAM(object, "sex", info.sex);
|
||||
CHECK_GET_PARAM(object, "kslsh", info.kslsh);
|
||||
@ -462,6 +463,7 @@ std::string XParser::toDataString(const TStuInfo& data)
|
||||
set(root, "exam", data.exam);
|
||||
set(root, "replay", data.replay);
|
||||
set(root, "track", data.track);
|
||||
set(root, "passing", data.passing);
|
||||
set(root, "xm", data.xm);
|
||||
set(root, "sex", data.sex);
|
||||
set(root, "kslsh", data.kslsh);
|
||||
|
||||
@ -104,7 +104,7 @@ bool XParser2::getCGDatas(const std::vector<std::string>& array, T2ChuanGan::Ptr
|
||||
}
|
||||
|
||||
//16: GPS速度
|
||||
cg->ai_gps_v = Tools::atof(array[II(98)]) * 1.852;
|
||||
cg->ai_gps_v = Tools::atof(array[II(98)]) * GPS_VEL_COEFF;
|
||||
//17: 纬度 Gps_N
|
||||
cg->ai_gps_nk = getGPSZuoBiao2(array[II(97)]);
|
||||
//25: 精度 Gps_E
|
||||
|
||||
@ -54,6 +54,7 @@ enum TTrackType
|
||||
TTrackTypeArtificialMark,
|
||||
TTrackTypeArtificialItem,
|
||||
TTrackTypeSoundEnd,
|
||||
TTrackTypeEndExam,
|
||||
};
|
||||
|
||||
//轨迹文件数据头定义
|
||||
|
||||
@ -13,23 +13,25 @@ TrackReader::TrackReader(const std::string& filename)
|
||||
using isbi = std::istreambuf_iterator<char>;
|
||||
m_content = std::string(isbi(m_file), (isbi()));
|
||||
m_stream = std::stringstream(m_content);
|
||||
m_file.close();
|
||||
}
|
||||
}
|
||||
|
||||
TrackReader::~TrackReader()
|
||||
{
|
||||
if(m_file.is_open())
|
||||
{
|
||||
m_file.close();
|
||||
}
|
||||
}
|
||||
|
||||
bool TrackReader::failed()
|
||||
{
|
||||
return !m_file.is_open() || m_content.empty();
|
||||
return m_content.empty();
|
||||
}
|
||||
|
||||
bool TrackReader::read(TTrackDataList& datas)
|
||||
{
|
||||
TASSERT_BOOL(m_file.is_open(), "file %s not open", m_filename.c_str());
|
||||
TTrackData::Ptr data = nullptr;
|
||||
while(read(data))
|
||||
{
|
||||
@ -90,6 +92,10 @@ bool TrackReader::read(TTrackData::Ptr& data)
|
||||
{
|
||||
data->type = TTrackTypeSoundEnd;
|
||||
}
|
||||
else if(root.isMember("method") && (root["method"].asString() == "examjudgeEndExam" || root["method"].asString() == "examJudgeEndExam"))
|
||||
{
|
||||
data->type = TTrackTypeEndExam;
|
||||
}
|
||||
else
|
||||
{
|
||||
TASSERT_BOOL(false, "");
|
||||
|
||||
@ -6,9 +6,9 @@ double GpsMath::calcGpsAngle(const TGPSPoint& p1, const TGPSPoint& p2) noexcept
|
||||
return bearing(p1.wd, p1.jd, p2.wd, p2.jd);
|
||||
}
|
||||
|
||||
inline double GpsMath::calcGpsDistanceCM(const double& E1, const double& N1,
|
||||
const double& E2, const double& N2,
|
||||
const double& H) noexcept
|
||||
double GpsMath::calcGpsDistanceCM(const double& E1, const double& N1,
|
||||
const double& E2, const double& N2,
|
||||
const double& H) noexcept
|
||||
{
|
||||
double XCoor = 0.0, YCoor = 0.0;
|
||||
getDimensionalCoordinate(E1, N1, E2, N2, H, XCoor, YCoor);
|
||||
@ -28,7 +28,7 @@ double GpsMath::calcGpsDistanceMI(const TGPSPoint& p1, const TGPSPoint& p2, cons
|
||||
return calcGpsDistanceCM(p1.jd, p1.wd, p2.jd, p2.wd, H) / 100.0;
|
||||
}
|
||||
|
||||
inline double GpsMath::calcGpsDistanceMI(const double& E1, const double& N1, const double& E2, const double& N2, const double& H) noexcept
|
||||
double GpsMath::calcGpsDistanceMI(const double& E1, const double& N1, const double& E2, const double& N2, const double& H) noexcept
|
||||
{
|
||||
return calcGpsDistanceCM(E1, N1, E2, N2, H) / 100.0;
|
||||
}
|
||||
|
||||
@ -32,9 +32,9 @@ public:
|
||||
|
||||
//***计算距离, 输入第一点的经纬度坐标、第二点的经纬度坐标、椭圆高,输出相对坐标,以厘米为单位,偏东为正,偏北为正
|
||||
static double calcGpsDistanceCM(const TGPSPoint& p1, const TGPSPoint& p2, const double& H = 0) noexcept;
|
||||
static inline double calcGpsDistanceCM(const double& E1, const double& N1, const double& E2, const double& N2, const double& H = 0) noexcept;
|
||||
static double calcGpsDistanceCM(const double& E1, const double& N1, const double& E2, const double& N2, const double& H = 0) noexcept;
|
||||
static double calcGpsDistanceMI(const TGPSPoint& p1, const TGPSPoint& p2, const double& H = 0) noexcept;
|
||||
static inline double calcGpsDistanceMI(const double& E1, const double& N1, const double& E2, const double& N2, const double& H = 0) noexcept;
|
||||
static double calcGpsDistanceMI(const double& E1, const double& N1, const double& E2, const double& N2, const double& H = 0) noexcept;
|
||||
|
||||
//***经纬度距离计算(在这个经纬度上,旋转到某个角度,并且长度扩展distMi(单位米))
|
||||
static TGPSPoint calcThatLonLat(const TGPSPoint& p, const double& angle,const double& distMI) noexcept;
|
||||
|
||||
@ -28,6 +28,9 @@
|
||||
//科目三除以这个数才得到经纬度
|
||||
#define GPS_DIV double(1000000.0)
|
||||
|
||||
//GPS速度要乘这个系数
|
||||
#define GPS_VEL_COEFF (1.852)
|
||||
|
||||
#define DEAL_API virtual
|
||||
#define DEAL_METHOD override
|
||||
#define PURE_API
|
||||
|
||||
@ -318,6 +318,7 @@ struct TStuInfo
|
||||
int8 exam = 0; //考试模式(0-训练 1-考试) ExamMode
|
||||
int8 replay = 0; //是否是回放,0-否 1-是,app端全部填0,正常考试和训练时必须填0,如果是轨迹回放才会填1
|
||||
std::string track = ""; //要生成的轨迹文件 空字符串("")不生成 //2023-11-02修改 杨 //是否轨迹(回放)(0-否 1-是)
|
||||
int32 passing = 0; //合格分数
|
||||
std::string xm = ""; //考生姓名
|
||||
int8 sex = 0; //考生性别 0:女 1:男 2023-04-24 杨海洋增加
|
||||
std::string kslsh = ""; //流水号(考生号)
|
||||
@ -782,6 +783,19 @@ struct TJudgeData
|
||||
//std::string lxxx = {}; //录像信息(录像文件名)扣分项目_扣分序号_录像倒退时长_录像顺延时长_是否扣分@关键数据2_03_10_5_1@-13_9
|
||||
};
|
||||
|
||||
|
||||
//路段状况:基准天线所在车道方向: 1-右转 2-直行 3-左转 4-掉头
|
||||
//1000 0100 0010 0001
|
||||
enum
|
||||
{
|
||||
TURN_R = 0,
|
||||
TURN_Z = 1,
|
||||
TURN_L = 2,
|
||||
TURN_D = 3,
|
||||
};
|
||||
|
||||
#define TURN_1 ('1')
|
||||
|
||||
struct TRTKResult
|
||||
{
|
||||
std::string MapRoad_Name; //路段名字
|
||||
|
||||
@ -9,6 +9,7 @@ export default class GetDistance {
|
||||
public folderPath: string
|
||||
public timeStr: string
|
||||
public totalDistance: number
|
||||
public totalTime:number
|
||||
public date: string
|
||||
|
||||
constructor(context) {
|
||||
@ -27,9 +28,10 @@ export default class GetDistance {
|
||||
this.timeStr = timeStr
|
||||
this.folderPath = folderPath;
|
||||
this.totalDistance = 0;
|
||||
this.totalTime = 0;
|
||||
this.date = date;
|
||||
await fileUtil.editFile(
|
||||
`${folderPath}/${date}.txt`,`程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m`
|
||||
`${folderPath}/${date}.txt`,`程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m 累计运行时常:${this.totalTime}min`
|
||||
);
|
||||
return folderPath
|
||||
}
|
||||
@ -38,11 +40,11 @@ export default class GetDistance {
|
||||
public setTimeData = async (str:number) => {
|
||||
const {fileUtil,folderPath,timeStr,date,totalDistance} = this;
|
||||
const content = await fileUtil.readFile(`${folderPath}/${date}.txt`) || '';
|
||||
console.info('surenjun',str)
|
||||
const contentArr = content.split('\n').filter(item => item)
|
||||
console.info('surenjun contentArr',JSON.stringify(contentArr))
|
||||
this.totalDistance += str * 1
|
||||
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m`+ '\n'
|
||||
this.totalTime += 1;
|
||||
contentArr[contentArr.length - 1] = `程序启动时间:${timeStr} 累计行驶距离:${(this.totalDistance).toFixed(2)}m 累计运行时常:${Math.ceil(this.totalTime/60)}min`+ '\n'
|
||||
console.info('surenjun',contentArr.join('\n'))
|
||||
await fileUtil.addFile(
|
||||
`${folderPath}/${date}.txt`,contentArr.join('\n')
|
||||
|
||||
@ -14,7 +14,6 @@ import { judgeConfig } from './utils/judgeConfig';
|
||||
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
|
||||
import UsbService from '../../common/service/usbService';
|
||||
import { LANE,KF } from '../judgeSDK/api/judgeSDK.d';
|
||||
|
||||
import {
|
||||
Array2Byte,
|
||||
convertGpsCoord2,
|
||||
@ -49,7 +48,8 @@ import {
|
||||
examJudgeRealExam,
|
||||
examJudgeSetLogCallback,
|
||||
examJudgeSetPerformCallback,
|
||||
examJudgeSetRealExamCallback
|
||||
examJudgeSetRealExamCallback,
|
||||
examCalcGpsDistance
|
||||
} from './api/index';
|
||||
|
||||
const judgeTag = 'SURENJUN_JUDGE'
|
||||
@ -109,7 +109,7 @@ export default class Judge {
|
||||
this.fileLog = fileLog;
|
||||
this.filePath = filePath;
|
||||
|
||||
const {getJudgeBeginData,handleUdp,fileUtil,handleTrajectoryUdp,isTrajectoryOpen,trajectoryPath,avPlayer} = this;
|
||||
const {getJudgeBeginData,handleUdp,handDistance,fileUtil,handleTrajectoryUdp,isTrajectoryOpen,trajectoryPath,avPlayer} = this;
|
||||
const isJudgeInitBool = globalThis.isJudgeInitBool;
|
||||
let strArr = [];
|
||||
if (isTrajectoryOpen) {
|
||||
@ -174,13 +174,44 @@ export default class Judge {
|
||||
globalThis.udpClient.onMessage_1(async (msg) => {
|
||||
console.info('socketTag[PLC.UdpClient]', '收到udp回调数据')
|
||||
handleUdp(msg)
|
||||
const udpIndex = globalThis.udpIndex;
|
||||
if (udpIndex % 5 === 0) {
|
||||
handDistance();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
//TODO 监听远程扣分
|
||||
}
|
||||
|
||||
|
||||
handDistance= async ()=>{
|
||||
const {jd,wd,hxj,dwzt} = this.tempData.gps;
|
||||
const tJD = convertGpsCoord2(jd)
|
||||
const tWD = convertGpsCoord2(wd)
|
||||
const {prevJd,prevWd} = this
|
||||
console.info('surenjun =>prevJd',prevJd)
|
||||
console.info('surenjun =>dwzt',dwzt)
|
||||
if(prevJd && dwzt == 4){
|
||||
console.info('surenjun =>tJD',tJD)
|
||||
console.info('surenjun =>tWD',tWD)
|
||||
console.info('surenjun =>prevJd',prevJd)
|
||||
console.info('surenjun =>preWd',prevWd)
|
||||
console.info('surenjun =>hxj',hxj)
|
||||
const distance = await examCalcGpsDistance({
|
||||
jd1:prevJd,
|
||||
wd1:prevWd,
|
||||
jd2:tJD,
|
||||
wd2:tWD,
|
||||
h:hxj || 1,
|
||||
})
|
||||
console.info('surenjun =>distance',distance)
|
||||
//@ts-ignore
|
||||
globalThis.distanceClass.setTimeData(((distance / 100).toFixed(2)) * 1)
|
||||
}
|
||||
this.prevJd = tJD;
|
||||
this.prevWd = tWD;
|
||||
}
|
||||
|
||||
// 获取评判初始化数据
|
||||
getJudgeInitData = async () => {
|
||||
const {getModelData,getKm3JudgeInitConfig} = this
|
||||
@ -1343,16 +1374,16 @@ export default class Judge {
|
||||
//@ts-ignore
|
||||
this.judgeUI.sd = ((param350 == 0? plcData.gps.sd :plcData.sensor.cs) as number * 1.852).toFixed(0) + ''
|
||||
this.judgeUI.dw = (Math.floor(plcData.sensor.dw as number) || 0) + ''
|
||||
|
||||
await this.checkDwzt(plcData.gps.dwzt);
|
||||
//TODO 暂时关闭差分检测异常
|
||||
// await this.checkDwzt(plcData.gps.dwzt);
|
||||
if(!isExamEnd){
|
||||
await examJudgeRealExam(plcData)
|
||||
}
|
||||
const udpIndex = globalThis.udpIndex;
|
||||
let [prevJd,preWd] = [0,0]
|
||||
if (udpIndex % 5 === 0 && !isUdpEnd) {
|
||||
const judgeUdp = globalThis.judgeUdp
|
||||
const bytes = await this.getMessageHeartbeat(isExamEnd);
|
||||
console.info(judgeTag+'UDP',JSON.stringify(bytes))
|
||||
judgeUdp.send(bytes)
|
||||
}
|
||||
globalThis.udpIndex += 1
|
||||
@ -1482,6 +1513,7 @@ export default class Judge {
|
||||
this.dwztNum += 1
|
||||
}else{
|
||||
this.dwztNum = 0;
|
||||
this.judgeUI.dwztErrorVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1490,6 +1522,8 @@ export default class Judge {
|
||||
private fileLog
|
||||
private filePath
|
||||
private totalScore: number
|
||||
private prevJd: number = 0
|
||||
private prevWd: number = 0
|
||||
private dwztNum:number = 0
|
||||
private folderPath: string
|
||||
private modelPath: string
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user