大车逻辑优化

This commit is contained in:
lixiao 2025-03-28 17:17:29 +08:00
parent 6a0ad1e7f1
commit 92cb906cee
6 changed files with 48 additions and 35 deletions

View File

@ -27,7 +27,7 @@
#define JUDGE_VERSION_MAJOR 1 #define JUDGE_VERSION_MAJOR 1
#define JUDGE_VERSION_MINOR 0 #define JUDGE_VERSION_MINOR 0
#define JUDGE_VERSION_PATCH 3 #define JUDGE_VERSION_PATCH 3
#define JUDGE_VERSION_STAMP "2503270900b" #define JUDGE_VERSION_STAMP "2503281110b"
#if JUDGE_USE_OLD #if JUDGE_USE_OLD
# undef JUDGE_VERSION_STAMP # undef JUDGE_VERSION_STAMP
# define JUDGE_VERSION_STAMP "2411121010b.old" # define JUDGE_VERSION_STAMP "2411121010b.old"

View File

@ -624,7 +624,10 @@ bool ExamCarSub3::Init_KM3_Global()
std::string ss = "," + m_car.DC_YK_Must + ","; std::string ss = "," + m_car.DC_YK_Must + ",";
if(Tools::pos(s, ss) == false) if(Tools::pos(s, ss) == false)
{ {
examItem->Item_Color = itemStateHg; //examItem->Item_Color = itemStateHg;
//examItem->TestPro = ItemProFlagIdle;
//examItem->FinishFlag = true;
KM3EndItem(itemNo,true,false);
} }
} }
} }
@ -4127,20 +4130,23 @@ void ExamCarSub3::KM3EndItem(int ItemNo, bool event, bool sound)
ItemNo == Sub3ItemType15Lkzz || ItemNo == Sub3ItemType15Lkzz ||
ItemNo == Sub3ItemType16Lkyz) ItemNo == Sub3ItemType16Lkyz)
{ {
bool b = true; if(m_cg) //2025-03-27
if(m_cg->ai_ljjl > 15 && ItemNo == Sub3ItemType02Qbxx) b = false; //15米
if(m_ctl.ZXD_GuanBi) b = false;
if(b)
{ {
const TSensorInfo& sor0 = historySensor(0); bool b = true;
const TSensorInfo& sor1 = historySensor(1); if(m_cg->ai_ljjl > 15 && ItemNo == Sub3ItemType02Qbxx) b = false; //15米
const TSensorInfo& sor2 = historySensor(2); if(m_ctl.ZXD_GuanBi) b = false;
if(sor0.zfxd+sor0.yfxd==SYES && sor1.zfxd+sor1.yfxd==SYES && sor2.zfxd+sor2.yfxd==SYES) if(b)
{ {
m_ctl.ZXD_KSSJ_TK = m_cg->tkCnt; const TSensorInfo& sor0 = historySensor(0);
const TSensorInfo& sor1 = historySensor(1);
const TSensorInfo& sor2 = historySensor(2);
if(sor0.zfxd+sor0.yfxd==SYES && sor1.zfxd+sor1.yfxd==SYES && sor2.zfxd+sor2.yfxd==SYES)
{
m_ctl.ZXD_KSSJ_TK = m_cg->tkCnt;
}
} }
m_ctl.ZXD_GuanBi = false;
} }
m_ctl.ZXD_GuanBi = false;
} }
TKM3Item* examItem = findExamItem(ItemNo); TKM3Item* examItem = findExamItem(ItemNo);

View File

@ -3762,7 +3762,6 @@ void Sub3Judge20Comm::Judge_BianDaoFangXiangDeng2()
if(sor.zfxd + sor.yfxd == SYES && sor1.zfxd + sor1.yfxd == SYES && sor2.zfxd + sor2.yfxd == SYES) if(sor.zfxd + sor.yfxd == SYES && sor1.zfxd + sor1.yfxd == SYES && sor2.zfxd + sor2.yfxd == SYES)
{ {
ctl->ZXD_KSSJ_TK = cg->tkCnt; ctl->ZXD_KSSJ_TK = cg->tkCnt;
if(ksdd == siteof::chongqingkm3) if(ksdd == siteof::chongqingkm3)
{ {
m_itemvCJH.ZXD_Open_TempJL = cg->ai_ljjl; m_itemvCJH.ZXD_Open_TempJL = cg->ai_ljjl;

View File

@ -309,13 +309,18 @@ struct Index {
} }
if (no1 == 6) { if (no1 == 6) {
const name = decodeURI(systemParm.txt1) const name = decodeURI(systemParm.txt1)
if (this.mode !== 2 && name === '夜间行驶') { // 夜间行驶
if (this.mode !== 2 && no2 == 13) {
return return
} }
if (this.mode !== 3 && name === '模拟夜间驾驶') { // 模拟夜间驾驶
if (this.mode !== 3 && no2 == 41) {
return return
} }
let isRequired = allItems.includes(no2 + '') let isRequired = allItems.includes(no2 + '')
if (this.mode === 2 && no2 == 11) {
isRequired = false
}
console.log("lixiao allItems", no2, JSON.stringify(allItems)) console.log("lixiao allItems", no2, JSON.stringify(allItems))
if (no2 == 14) { if (no2 == 14) {
isRequired = false isRequired = false
@ -329,21 +334,21 @@ struct Index {
projectCode: no2 + '', projectCode: no2 + '',
projectCodeCenter: txt2, projectCodeCenter: txt2,
// 白考夜间行驶非必考 // 白考夜间行驶非必考
isRequired: (this.mode === 2 && no2 == 11) ? false : isRequired, isRequired,
//是否考过了 //是否考过了
isEnd: !(this.mode === 2 && no2 == 13 && this.kssycs != '1'), isEnd: !(this.mode === 2 && no2 == 13 && this.kssycs != '1'),
//项目开始数据是否上传过 //项目开始数据是否上传过
isUpload: !(this.mode === 2 && no2 == 13 && this.kssycs != '1'), isUpload: !(this.mode === 2 && no2 == 13 && this.kssycs != '1'),
} }
if (this.mode === 2) { // if (this.mode === 2) {
let type: '1' | '2' | '3' // let type: '1' | '2' | '3'
if (no2 == 13) { // if (no2 == 13) {
type = '2' // type = '2'
} else { // } else {
type = isRequired ? '1' : '3' // type = isRequired ? '1' : '3'
} // }
currentProject.ykType = type // currentProject.ykType = type
} // }
this.projectsObj[no2*1] = currentProject this.projectsObj[no2*1] = currentProject
this.projectsCenterObj[txt2] = currentProject this.projectsCenterObj[txt2] = currentProject
this.projects.push(currentProject); this.projects.push(currentProject);
@ -458,7 +463,7 @@ struct Index {
}) })
const currentProject = this.projectsObj[xmdm] || { name: '通用评判' } const currentProject = this.projectsObj[xmdm] || { name: '通用评判' }
if (this.projectsObj[xmdm]) { if (this.projectsObj[xmdm]) {
this.projectsObj[xmdm].type = '4' this.projectsObj[xmdm].ykType = '4'
} }
this.kfArr.push({ this.kfArr.push({
//扣分项目名称 //扣分项目名称
@ -1118,7 +1123,7 @@ struct Index {
} }
//项目进行中不能人工触发 //项目进行中不能人工触发
if (this.isProjectIn) { if (this.isProjectIn && this.projectsObj['13']?.type != '2') {
console.log("lixiao getIsExitManualProject 项目进行中不能人工触发") console.log("lixiao getIsExitManualProject 项目进行中不能人工触发")
if (param340 == 1) { if (param340 == 1) {
if (this.isManualProjectIn && (this.projectsObj[projectCode].type == '2')) { if (this.isManualProjectIn && (this.projectsObj[projectCode].type == '2')) {
@ -1136,16 +1141,18 @@ struct Index {
return false return false
} }
//@ts-ignore 直线行驶中不进其他考试项目(0-否 1-是) // 直线行驶中不进其他考试项目(0-否 1-是)
if (param348 == '0' && projectsObj['9']?.type == 2) { if (param348 == '0' && this.projectsObj['9']?.type == '2') {
console.log("lixiao getIsExitManualProject 直线行驶中不进其他考试项目", index) console.log("lixiao getIsExitManualProject 直线行驶中不进其他考试项目", index)
return index === 0 ? true : false return index === 0 ? true : false
} }
//项目已经做过,后续不能人工触发 //项目已经做过,后续不能人工触发
if (param307.includes(projectCode) && (projectType == '3' || projectType == '4')) { if (this.mode !== 2) {
console.log("lixiao getIsExitManualProject 项目已经做过", index) if (param307.includes(projectCode) && (projectType == '3' || projectType == '4')) {
return false console.log("lixiao getIsExitManualProject 项目已经做过", index)
return false
}
} }
//319不为0或者387不为1里程不够时靠边停车项目不能触发 //319不为0或者387不为1里程不够时靠边停车项目不能触发

View File

@ -83,6 +83,7 @@ export default class Judge {
}) })
console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`) console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`)
} }
//人工扣分 //人工扣分
public setJudgeMark = async (itemno, serial, type = 1) => { public setJudgeMark = async (itemno, serial, type = 1) => {
const {fileLog} = this const {fileLog} = this
@ -846,7 +847,7 @@ export default class Judge {
this.xmmcEndCode = xmmcCode this.xmmcEndCode = xmmcCode
this.xmdm = xmdm; this.xmdm = xmdm;
this.xmxh = xmxh; this.xmxh = xmxh;
if(xmdm != 13) { if (xmdm != 13) {
this.judgeUI.isProjectIn = true this.judgeUI.isProjectIn = true
} }
break; break;
@ -1674,12 +1675,12 @@ export default class Judge {
console.info(judgeTag, '项目状态projectsObj:' + JSON.stringify(projectsObj[projectKey])); console.info(judgeTag, '项目状态projectsObj:' + JSON.stringify(projectsObj[projectKey]));
const {type,isRequired,ykType} = projectsObj[projectKey]; const {type,isRequired,ykType} = projectsObj[projectKey];
allProjectNum += 1; allProjectNum += 1;
if (type == 3 || type == 4 || ykType == 3 || ykType == 4) { if (type == 3 || type == 4) {
allEndProjectsNum += 1; allEndProjectsNum += 1;
} }
if (isRequired) { if (isRequired) {
projectNum += 1; projectNum += 1;
if (type == 3 || type == 4 || ykType == 3 || ykType == 4) { if (type == 3 || type == 4) {
endProjectsNum += 1; endProjectsNum += 1;
} }
} }