3036 lines
122 KiB
C++
3036 lines
122 KiB
C++
#include "Sub3Judge41Mndg.h"
|
||
#include "HFactory.h"
|
||
|
||
Sub3Judge41Mndg::Sub3Judge41Mndg()
|
||
{
|
||
m_exam = __NEW__(TKM3Item);
|
||
}
|
||
|
||
Sub3Judge41Mndg::~Sub3Judge41Mndg()
|
||
{
|
||
__DELETE__(m_exam);
|
||
}
|
||
|
||
bool Sub3Judge41Mndg::dealJudgeEnter()
|
||
{
|
||
if(m_exam->TestPro != ItemProFlagInit) return false;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_car->isReplay() && m_itemv.Op_Rd_str == "")
|
||
{
|
||
const TSensorInfo& sor = m_car->historySensor();
|
||
if(sor.mndg != "")
|
||
{
|
||
m_itemv.Op_Rd_str = sor.mndg;
|
||
}
|
||
}
|
||
|
||
const TGpsInfo& gps = m_car->historyGps();
|
||
setSeed(gps.sj); //240709 gps.sj
|
||
|
||
//加载合法的灯光 //参考头文件注释说明[灯光类型]
|
||
// m_lights =
|
||
// {
|
||
// "111", /*打开灯光*/
|
||
// "211", "212", "213", "214", "215", "221", /*交替使用远近光灯*/
|
||
// "311", "321", "331", "332", "333", "341", "342", "351", /*开近光灯*/
|
||
// "411", "412", "421", /*开远光灯*/
|
||
// "511", "512", /*车辆发生故障(关大灯、开双跳)*/
|
||
// "611", /*故障解除*/
|
||
// "711", /*关闭灯光*/
|
||
// "811", "812", /*双跳灯+雾灯*/
|
||
// "911" /*雨刮器*/
|
||
// };
|
||
m_lights.clear();
|
||
m_lights =
|
||
{
|
||
/*打开灯光*/
|
||
{"yj111", sound::sub3_417002}, //打开灯光 *下面将进行模拟夜间行驶场景灯光使用的考试,请按语音指令,在5秒内做出相应的灯光操作,请开启前照灯
|
||
|
||
/*交替使用远近光灯 (不允许出现除“交替”之外的其他灯光变化)*/
|
||
{"yj211", sound::sub3_417007}, //夜间通过急弯
|
||
{"yj212", sound::sub3_417008}, //夜间通过坡路
|
||
{"yj213", sound::sub3_417009}, //夜间通过拱桥
|
||
{"yj214", sound::sub3_4170010}, //夜间通过人行横道
|
||
{"yj215", sound::sub3_4170011}, //夜间通过没有交通信号灯控制的路口
|
||
{"yj221", sound::sub3_4170012}, //夜间超越前方车辆
|
||
|
||
/*开近光灯*/
|
||
{"yj311", sound::sub3_417003}, //夜间同方向近距离跟车行驶
|
||
{"yj321", sound::sub3_417004}, //夜间与机动车会车
|
||
{"yj331", sound::sub3_417005}, //夜间直行通过路口(在有交通信号灯控制的路口直行)
|
||
{"yj332", sound::sub3_4170017}, //夜间路口左转弯
|
||
{"yj333", sound::sub3_4170018}, //夜间路口右转弯
|
||
{"yj341", sound::sub3_4170019}, //夜间在有路灯的道路上行驶 xxxx
|
||
{"yj342", sound::sub3_417006}, //夜间在照明良好的道路上行驶
|
||
{"yj351", ""}, //请打开近光灯, !!!石家庄*删除
|
||
|
||
/*开远光灯*/
|
||
{"yj411", sound::sub3_4170014}, //夜间在没有照明的道路上行驶 !!!语音不对 4170014和4170016重复了声音一模一样
|
||
{"yj412", sound::sub3_4170016}, //夜间在照明不良的道路上行驶 !!!语音不对 4170014和4170016重复了声音一模一样
|
||
{"yj421", ""}, //请打开远光灯, !!!石家庄*删除
|
||
|
||
/*车辆发生故障(关大灯、开双跳)*/
|
||
{"yj511", sound::sub3_4170013}, //车辆发生故障(关大灯、开双跳)(改成路边临时停车,需改语音)
|
||
{"yj512", ""}, //车辆发生交通事故 !!!取消
|
||
|
||
/*故障解除*/
|
||
{"yj611", ""}, //故障解除、继续夜间行驶 !!!取消
|
||
|
||
/*关闭灯光*/
|
||
{"yj711", sound::sub3_417001}, //请关闭所有灯光
|
||
|
||
/*双跳灯+雾灯*/
|
||
{"yj811", ""}, //雾天行驶 20150126 石家庄
|
||
{"yj812", ""}, //大雨中行驶 guizhou
|
||
|
||
/*雨刮器*/
|
||
{"yj911", ""}, //雨天行驶 20150514
|
||
|
||
/* 用不到?? ? */
|
||
{XCharacter("关灯"), sound::sub3_417001}, //请关闭所有灯光
|
||
{XCharacter("照明不良"), sound::sub3_417002}, //下面将进行模拟夜间行驶场景灯光使用的考试,请按语音指令,在5秒内做出相应的灯光操作,请开启前照灯
|
||
{XCharacter("模拟完成"), sound::sub3_4170015} //模拟夜间考试完成
|
||
};
|
||
|
||
//Pub_Log('开始模拟夜间New');
|
||
//灯光初始化
|
||
m_itemv = TSub3Item41Mndg();
|
||
m_itemv.Lt_Change.resize(7, N0);
|
||
//m_exam->TestPro = ItemProFlagJudge;
|
||
//ToDo2:生成进项目事件
|
||
|
||
//1、得到灯光的总用时毫秒,到达这个时间必须做完。
|
||
const std::vector<std::string>& s501 = TableSysSet->asArray501();
|
||
m_itemv.P_zys = s501.size() > 0 && s501[0] != "" ? std::atoi(s501[0].c_str()) : 8000;
|
||
|
||
if(ksdd == siteof::shandong)
|
||
{
|
||
if(m_itemv.P_zys < 6000)
|
||
{
|
||
m_itemv.P_zys = m_itemv.P_zys + 800;
|
||
}
|
||
}
|
||
//2、灯光对的,不操作 等待时间
|
||
m_itemv.P_CSOK_YanShi = s501.size() > 1 && s501[1] != "" ? std::atoi(s501[1].c_str()) : 4000; // 灯光对的,不操作 等待时间
|
||
//3、远近灯光交替操作延时
|
||
m_itemv.P_YJGD_JT_YS = s501.size() > 2 && s501[2] != "" ? std::atoi(s501[2].c_str()) : 1800; //远近交替最大时间
|
||
//4、超车灯光时间(指的是需要打方向灯的超车模式)(特定项目的超时设定)
|
||
m_itemv.P_Ccopys = s501.size() > 3 && s501[3] != "" ? std::atoi(s501[3].c_str()) : 20000;
|
||
//5、有车速是否扣分
|
||
m_itemv.CheSu_KouFen = s501.size() > 4 && s501[4] != "" ? s501[4] == "1" : false; //20151023
|
||
//6、语音间隔时间
|
||
m_itemv.P_yyjgsj = s501.size() > 5 && s501[5] != "" ? std::atoi(s501[5].c_str()) : 0; //20170606 语音等待时间
|
||
//7、临时停车打灯方式 0:不要求双跳灯 1:要求双跳灯 2:标准(关闭前照灯,开启示廓灯)
|
||
m_itemv.lstcstd = s501.size() > 6 && s501[6] != "" ? std::atoi(s501[6].c_str()) : 1;
|
||
//8、模拟灯光路口是否加入左转和右转,默认0不加入,1加入。
|
||
m_itemv.mndg_add_lukou = s501.size() > 7 && s501[7] != "" ? std::atoi(s501[7].c_str()) : 0;
|
||
|
||
//灯光错了是否扣分
|
||
const std::vector<std::string>& s383 = TableSysSet->asArray383();
|
||
m_itemv.P_IF_Err_Kf = s383.size() > 1 && s383[1] != "" ? s383[1] == "1" : true; //(StrToIntDef(getdotstr(2, sysset[383], '^'), 1) = 1);
|
||
//20170807
|
||
|
||
//默认第一个操作是:打开灯光 然后才是打开灯光后,随机抽到的5个灯光题目
|
||
m_itemv.ItemNo = 1;
|
||
m_itemv.ItemStatus = 1;
|
||
|
||
m_exam->TestPro = ItemProFlagJudge;
|
||
return true;
|
||
}
|
||
|
||
void Sub3Judge41Mndg::dealJudgeItem()
|
||
{
|
||
HELP_COST_TIME("");
|
||
if(m_exam->TestPro != ItemProFlagJudge) return;
|
||
|
||
//回放模式 这里要从轨迹文件加载灯光项目
|
||
if(m_car->isReplay() && m_itemv.Op_Rd_str == "")
|
||
{
|
||
const TSensorInfo& sor = m_car->historySensor();
|
||
if(sor.mndg != "")
|
||
{
|
||
m_itemv.Op_Rd_str = sor.mndg;
|
||
}
|
||
}
|
||
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* his1 = m_car->historyChuanGan(1);
|
||
const TGpsInfo& gps1 = his1->real.gps;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
//调试代码
|
||
if(gps.sj - m_lastDealTick > 5*SECOND)
|
||
{
|
||
m_lastDealTick = gps.sj;
|
||
|
||
logtrace("mndg-tick-Op_Step=%d,ItemStatus=%d,Item=%d%d%d", m_itemv.Op_Step,m_itemv.ItemStatus,
|
||
m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2);
|
||
}
|
||
|
||
if(ksdd == siteof::zjnb)
|
||
{
|
||
if(cg->move == moveStop && sor.ssc == SNOT)
|
||
{
|
||
JUDGE_MARK_SUB3(20, "41", true);
|
||
}
|
||
}
|
||
|
||
const TGpsInfo& gps2 = m_car->historyGps(2);
|
||
//20151023
|
||
if(gps.sd > 5 && gps1.sd > 5 && gps2.sd > 5 &&
|
||
MilliSecondsBetween(m_car->timeBegin(), gps.sj) > 10*SECOND &&
|
||
m_car->rtkEnabled())
|
||
{
|
||
if(m_itemv.CheSu_KouFen == true)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "42", true);
|
||
}
|
||
}
|
||
|
||
//更新灯光变化
|
||
UpdateDengGuangChange();
|
||
if(m_itemv.ItemNo == 0) //统一调度
|
||
{
|
||
CallItemProc();
|
||
}
|
||
else if(m_itemv.ItemNo == 1) //打开灯光题目
|
||
{
|
||
Open_DengGuang();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 1;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 2) //交替使用远近光灯
|
||
{
|
||
JiaoTi_DengGuang();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 2;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 3) //开近光灯
|
||
{
|
||
Open_JinGuangDeng();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 3;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 4) //开远光灯
|
||
{
|
||
Open_YuanGuangDeng();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 4;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 5) //车辆故障
|
||
{
|
||
CheLiangGuZhang();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 5;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 6) //故障解除
|
||
{
|
||
GuZhangJieChu();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 6;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 7) //关闭所有灯光
|
||
{
|
||
CloseAllDengGuang();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 7;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 8) //雾天行驶
|
||
{
|
||
WuTianXingShi();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 8;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 9) //雨天行驶
|
||
{
|
||
YuTianXingShi();
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
m_itemv.LastSubItemNo = 9;
|
||
}
|
||
}
|
||
else if(m_itemv.ItemNo == 100) //灯光结束
|
||
{
|
||
logtrace("mndg-item-end");
|
||
m_exam->TestPro = ItemProFlagEnd;
|
||
if(m_car->isExamDrill()) //训练模式
|
||
{
|
||
//Windows语音
|
||
//WavFile = ExtractFilePath(Application.ExeName) + 'Sound\模拟完成.Wav';
|
||
m_car->createEventSound({itemNo(), sound::sub3_4170015});
|
||
//WavFile = ExtractFilePath(Application.ExeName) + 'Sound\停车起步.Wav';
|
||
m_car->createEventSound({itemNo(), sound::sub3_402001});
|
||
|
||
//鸿蒙
|
||
//ToDo1:播报语音"模拟夜间灯光使用考试结束,请关闭所有灯光';
|
||
//ToDo2:播报语音“请起步,继续完成考试';
|
||
}
|
||
else
|
||
{
|
||
if(m_car->isQualified()) //(Tds.Grade >= 90)
|
||
{
|
||
//Windows语音
|
||
//WavFile = ExtractFilePath(Application.ExeName) + 'Sound\模拟完成.Wav';
|
||
m_car->createEventSound({itemNo(), sound::sub3_4170015});
|
||
//WavFile = ExtractFilePath(Application.ExeName) + 'Sound\停车起步.Wav';
|
||
m_car->createEventSound({itemNo(), sound::sub3_402001});
|
||
|
||
//鸿蒙
|
||
//ToDo1:播报语音"模拟夜间灯光使用考试结束,请关闭所有灯光';
|
||
//ToDo2:播报语音“请起步,继续完成考试';
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
logerror("mndg-error-Op_Step=%d,ItemNo=%d,Status=%d",m_itemv.Op_Step, m_itemv.ItemNo, m_itemv.ItemStatus);
|
||
}
|
||
|
||
char buf[128] = {0};
|
||
SafeSprintf(buf, sizeof(buf), "Step=%d,Status=%d,Data=%s,Wav=%d%d%d.wav",
|
||
m_itemv.Op_Step,m_itemv.ItemStatus,m_itemv.Op_Rd_str.c_str(),m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2);
|
||
showStatus(buf);
|
||
}
|
||
|
||
//更新灯光变化
|
||
void Sub3Judge41Mndg::UpdateDengGuangChange()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* his1 = m_car->historyChuanGan(1);
|
||
const TSensorInfo& sor1 = his1->real.sensor;
|
||
const TChuanGan* his2 = m_car->historyChuanGan(2);
|
||
const TSensorInfo& sor2 = his2->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
//灯光变化时间
|
||
if(sor.ygd != sor1.ygd || sor.jgd != sor1.jgd || sor.skd != sor1.skd || sor.shtd != sor1.shtd || sor.wd != sor1.wd)
|
||
{
|
||
m_itemv.Lt_LastChange_TM = gps.sj;
|
||
}
|
||
//判断灯光有变化Lt_Change,用于判断打错灯光。 (Ctl.ksdd = 'hebeihskm3') and
|
||
if(m_itemv.ItemNo > 0 && m_itemv.ItemNo < 100)
|
||
{
|
||
if(m_itemv.ItemStatus == 3 || (m_itemv.ItemNo == 2 && m_itemv.ItemStatus == 2))
|
||
{
|
||
//交替,//20180911
|
||
//Lt_Change: array[0..6] of string; //0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,
|
||
//注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(ksdd == siteof::sxhzkm3 && m_itemv.ItemNo != 2)
|
||
{
|
||
bool Flag1 = false;
|
||
bool Flag2 = false;
|
||
bool Flag3 = false;
|
||
bool Flag4 = false;
|
||
//特殊地方,按特殊的规则翻译即可
|
||
if(sor.ygd == SYES && sor.jgd == SNOT && sor1.ygd == SYES && sor1.jgd == SNOT && sor2.ygd == SNOT && sor2.jgd == SYES)
|
||
{
|
||
Flag1 = true;
|
||
}
|
||
|
||
if(sor.ygd == SNOT && sor.jgd == SYES && sor1.ygd == SNOT && sor1.jgd == SYES && sor2.ygd == SYES && sor2.jgd == SNOT)
|
||
{
|
||
Flag2 = true;
|
||
}
|
||
|
||
if(sor.ygd == SYES && sor.jgd == SNOT && sor1.ygd == SNOT && sor1.jgd == SNOT)
|
||
{
|
||
Flag3 = true;
|
||
}
|
||
|
||
if(sor.ygd == SNOT && sor.jgd == SYES && sor1.ygd == SNOT && sor1.jgd == SNOT)
|
||
{
|
||
Flag4 = true;
|
||
}
|
||
|
||
if(Flag1 == true || Flag2 == true || Flag3 == true || Flag4 == true)
|
||
{
|
||
if(m_itemv.Lt_YJ_TM == 0)
|
||
{
|
||
m_itemv.Lt_YJ_TM = gps.sj;
|
||
}
|
||
else
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Lt_YJ_TM) < m_itemv.P_YJGD_JT_YS)
|
||
{
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
m_itemv.Lt_YJ_TM = 0;
|
||
m_itemv.Lt_YJ_cs++; //Inc(m_itemv.Lt_YJ_cs); //20150327
|
||
if(ksdd == siteof::shijiazhuang1001)
|
||
{
|
||
if(m_itemv.Lt_YJ_cs >= 2)
|
||
{
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_Change[6] = N0;
|
||
}
|
||
}
|
||
|
||
//20171029 20180326
|
||
if(ksdd == siteof::gdjykm3 || ksdd == siteof::jiuquan)
|
||
{
|
||
if(m_itemv.Lt_YJ_cs == 2)
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
else
|
||
m_itemv.Lt_Change[6] = N0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//Lt_Change: array[0..6] of string; //0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替,
|
||
// 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
//远近远 近远近 (这个过程稍微讲一下)
|
||
//这个跟车的灯光原理有点关系,咨询过谭林生,当车载的灯控系统打开的时候,你要不就在远光灯上,要么就在近光灯上
|
||
bool Flag1 = false;
|
||
bool Flag2 = false;
|
||
//1.1、灯光变化(远光灯)
|
||
if(sor.ygd == SYES && sor.jgd == SNOT && sor1.ygd == SNOT)
|
||
{
|
||
Flag1 = true;
|
||
}
|
||
//1.2、灯光变化(近光灯)
|
||
if(sor.jgd == SYES && sor.ygd == SNOT && sor1.jgd == SNOT)
|
||
{
|
||
Flag2 = true;
|
||
}
|
||
|
||
//2、远近关灯交替(闪灯)处理。
|
||
if(Flag1 == true || Flag2 == true)
|
||
{
|
||
if(m_itemv.Lt_YJ_TM == 0)
|
||
{
|
||
m_itemv.Lt_YJ_TM = gps.sj;
|
||
}
|
||
else
|
||
{
|
||
int64 tm = MilliSecondsBetween(gps.sj, m_itemv.Lt_YJ_TM);
|
||
if(tm <= m_itemv.P_YJGD_JT_YS)
|
||
{
|
||
//(m_itemv.Snd_No = 2) and (m_itemv.Snd_No1 = 1) and (m_itemv.St=1) 超车
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
m_itemv.Lt_YJ_TM = 0; //成功闪灯一次,远近关灯时间清空
|
||
m_itemv.Lt_YJ_cs++; //Inc(m_itemv.Lt_YJ_cs);
|
||
if(ksdd == siteof::shijiazhuang1001)
|
||
{
|
||
if(m_itemv.Lt_YJ_cs >= 2)
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
else
|
||
m_itemv.Lt_Change[6] = N0;
|
||
}
|
||
|
||
if(ksdd == siteof::gdjykm3 || ksdd == siteof::jiuquan)
|
||
{
|
||
if(m_itemv.Lt_YJ_cs == 2)
|
||
{
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_Change[6] = N0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//如果有闪灯信号,直接赋值就可以了(前提是要有硬件支持)
|
||
if(sor.sde == SYES && sor1.sde == SNOT)
|
||
{
|
||
m_itemv.Lt_Change[6] = Y1;
|
||
}
|
||
|
||
//远光,近光,
|
||
if(m_itemv.Lt_YJ_TM > 0)
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Lt_YJ_TM) > m_itemv.P_YJGD_JT_YS)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
m_itemv.Lt_Change[4] = Y1;
|
||
m_itemv.Lt_YJ_TM = 0;
|
||
}
|
||
else
|
||
{
|
||
if(sor.jgd == SYES)
|
||
{
|
||
m_itemv.Lt_Change[5] = Y1;
|
||
m_itemv.Lt_YJ_TM = 0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//示宽灯变化
|
||
bool Flag1 = false;
|
||
bool Flag2 = false;
|
||
bool Flag3 = false;
|
||
bool Flag4 = false;
|
||
|
||
if(sor.skd == SYES && sor1.skd == SNOT)
|
||
{
|
||
Flag1 = true;
|
||
}
|
||
if(sor.skd == SNOT && sor1.skd == SYES)
|
||
{
|
||
Flag2 = true;
|
||
}
|
||
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd > 0 && sor1.ygd + sor1.jgd == SNOT)
|
||
{
|
||
Flag3 = true;
|
||
}
|
||
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd == SNOT && sor1.ygd + sor1.jgd > 0)
|
||
{
|
||
Flag4 = true;
|
||
}
|
||
if(Flag1 == true || Flag2 == true || Flag3 == true || Flag4 == true)
|
||
{
|
||
m_itemv.Lt_Change[1] = Y1;
|
||
}
|
||
//双跳,
|
||
if(sor.shtd == SYES && sor1.shtd == SNOT)
|
||
{
|
||
m_itemv.Lt_Change[2] = Y1;
|
||
}
|
||
|
||
//雾灯, 20181015
|
||
if(ksdd != siteof::nj)
|
||
{
|
||
if(sor.wd == SYES && sor1.wd == SNOT)
|
||
{
|
||
m_itemv.Lt_Change[3] = Y1;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_Change[3] = N0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//0、统一调度
|
||
void Sub3Judge41Mndg::CallItemProc()
|
||
{
|
||
logtrace("mndg-Op_Step CallItemProc");
|
||
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
//统一调度
|
||
if(m_itemv.Op_Step == 0)
|
||
{
|
||
if(ksdd == siteof::guizhou)
|
||
{
|
||
if(sor.wd == SYES || sor.zfxd == SYES || sor.yfxd == SYES || sor.shtd == SYES /* || sor.shtd == SYES*/)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill())
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
bool bKs = true;
|
||
//如果语音间隔时间大于0
|
||
if(m_itemv.P_yyjgsj > 0)
|
||
{
|
||
bKs = false;
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_yyjgsj)
|
||
{
|
||
bKs = true;
|
||
}
|
||
}
|
||
|
||
if(bKs == true)
|
||
{
|
||
if(m_itemv.Op_Rd_str != "")
|
||
{
|
||
std::vector<std::vector<std::string>> m = Tools::split(m_itemv.Op_Rd_str, ";", ",");
|
||
std::vector<std::string> s = (int)m.size() > m_itemv.Op_Step ? m[m_itemv.Op_Step] : std::vector<std::string>(); // GetDotStr(m_itemv.Op_Step, m_itemv.Op_Rd_str, ';');
|
||
|
||
m_itemv.ItemStatus = 1; //播报项目语音
|
||
m_itemv.Op_Step = m_itemv.Op_Step + 1; //注意这里:Op_Step从1开始的,所以上面那行代码如果要拿下来执行要-1,数组是从0开始的
|
||
if(!s.empty())
|
||
{
|
||
m_itemv.ItemNo = s.size() > 0 ? std::atoi(s[0].c_str()) : 0;
|
||
m_itemv.SubWav1 = s.size() > 1 ? std::atoi(s[1].c_str()) : 0;
|
||
m_itemv.SubWav2 = s.size() > 2 ? std::atoi(s[2].c_str()) : 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
|
||
logtrace("mndg-item-Op_Step=%d,ItemStatus=%d,Item=%d%d%d", m_itemv.Op_Step,m_itemv.ItemStatus,
|
||
m_itemv.ItemNo,m_itemv.SubWav1,m_itemv.SubWav2);
|
||
}
|
||
}
|
||
}
|
||
|
||
//1、打开灯光
|
||
void Sub3Judge41Mndg::Open_DengGuang()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//下面将进行模拟夜间灯光的考试,请根据播报的驾驶场景,在播报后5秒内做出相应的灯光操作,请开启前照灯
|
||
//Windows
|
||
//sd_str = ExtractFilePath(Application.ExeName) + 'Sound\照明不良.wav';
|
||
m_car->createEventSound({itemNo(), sound::sub3_417002, PlaySoundEndNotify});
|
||
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//鸿蒙:语音播报"下面将进行模拟夜间灯光的考试,请根据播报的驾驶场景,在播报后5秒内做出相应的灯光操作,请开启前照灯"
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
const std::string& s383 = TableSysSet->get383();
|
||
if(s383 == m_s383arg) //20150126 石家庄
|
||
{
|
||
//判断是否打开远光灯
|
||
if(sor.ygd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//检查灯光正确
|
||
//20171017
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd > 0)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
//20180726
|
||
if(ksdd == siteof::shandongyt && sor.ygd + sor.jgd > 0)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
//20171017
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
//20180324
|
||
if(s383 == m_s383arg) //20150126 石家庄
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill())
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd > 0)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill()) //20140722
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if(m_itemv.ItemNo == 0)
|
||
{
|
||
//生成操作顺序
|
||
//if(not Data_Replay.ID) or (paramstr(2) <> '') then
|
||
////0:多伦Net数据(CarEx3传过来的) 1:鸿蒙的日志数据 2:正常的考试模式(杨海洋考试的场景,这个赋值为2)
|
||
if(m_car->isReplay()) // (Data_Replay.Kind = 0) or (Data_Replay.Kind = 1)
|
||
{
|
||
//ToDo:回放的特定处理
|
||
//1、拿到回放日志中记录的模拟灯光字符串
|
||
//m_itemv.Op_Rd_str = "2,1,3;4,1,2;3,4,2;2,2,1;3,1,1;";
|
||
//m_itemv.Op_Rd_str = m_mndg;
|
||
if(m_itemv.Op_Rd_str != "")
|
||
{
|
||
//m_itemv.Op_Rd_str := '4,1,2;2,1,2;3,1,1;2,2,1;3,3,1;';
|
||
//m_itemv.P_Op_Cnt := 5;
|
||
m_itemv.P_Op_Cnt = 0;
|
||
std::vector<std::string> s = Tools::split(m_itemv.Op_Rd_str, ";");
|
||
for(size_t i = 0; i < 20; i++)
|
||
{
|
||
std::string ss = s.size() > i && s[i] != "" ? s[i] : "";
|
||
if(ss == "") //(GetDotStr(I, m_itemv.Op_Rd_str + ';', ';') == "")
|
||
break;
|
||
m_itemv.P_Op_Cnt = m_itemv.P_Op_Cnt + 1;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
const std::vector<std::string>& s383a = TableSysSet->asArray383();
|
||
//非回放模式
|
||
m_itemv.P_Op_Cnt = s383a.size() > 0 && s383a[0] != "" ? std::atoi(s383a[0].c_str()) : 5; //StrToIntDef(getdotstr(1, sysset[383], '^'), 5);
|
||
//20180324
|
||
if(s383 == m_s383arg) //20150126 石家庄
|
||
{
|
||
// 2015-01-26 石家庄需要将383参数设置为0^1^4^
|
||
// 四套灯光语音,随机播放任意一套作为考试题目
|
||
int b = random2(1, 4); //random(4) + 1;
|
||
m_itemv.P_Op_Cnt = 8;
|
||
if(b == 1)
|
||
{
|
||
//5,1,1; //路边临时停车 (关大灯,开双跳)
|
||
//4,2,1; //请打开远光灯
|
||
//2,1,5; //夜间通过没有交通信号灯控制的路口 (交替使用远近光灯)
|
||
//3,1,1; //夜间同方向近距离跟车行驶 (近光灯)
|
||
//2,1,2; //夜间通过坡路(交替使用远近光灯)
|
||
m_itemv.Op_Rd_str = "5,1,1;4,2,1;2,1,5;4,2,1;3,1,1;4,2,1;2,1,2;4,2,1;";
|
||
}
|
||
else if(b == 2)
|
||
{
|
||
//2,1,1; 夜间通过急弯 (交替使用远近光灯)
|
||
//4,2,1; //请打开远光灯
|
||
//5,1,1; //路边临时停车 (关大灯,开双跳)
|
||
//3,4,2; 夜间在照明良好的道路上行驶(近光灯)
|
||
//2,1,4; 夜间通过人行横道(交替使用远近光灯)
|
||
m_itemv.Op_Rd_str = "2,1,1;4,2,1;5,1,1;4,2,1;3,4,2;4,2,1;2,1,4;4,2,1;";
|
||
}
|
||
else if(b == 3)
|
||
{
|
||
//2,1,5; //夜间通过没有交通信号灯控制的路口 (交替使用远近光灯)
|
||
//4,2,1; //请打开远光灯
|
||
//3,5,1; 请打开近光灯
|
||
//5,1,1; //路边临时停车 (关大灯,开双跳)
|
||
//2,1,2; //夜间通过坡路(交替使用远近光灯)
|
||
m_itemv.Op_Rd_str = "2,1,5;4,2,1;3,5,1;4,2,1;5,1,1;4,2,1;2,1,2;4,2,1;";
|
||
}
|
||
else
|
||
{
|
||
//2,1,1; 夜间通过急弯 (交替使用远近光灯)
|
||
//4,2,1; //请打开远光灯
|
||
//3,1,1; //夜间同方向近距离跟车行驶 (近光灯)
|
||
//5,1,1; //路边临时停车 (关大灯,开双跳)
|
||
//2,1,4; 夜间通过人行横道(交替使用远近光灯)
|
||
m_itemv.Op_Rd_str = "2,1,1;4,2,1;3,1,1;4,2,1;5,1,1;4,2,1;2,1,4;4,2,1;";
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(ksdd == siteof::hn)
|
||
{
|
||
if(m_itemv.P_Op_Cnt < 4)
|
||
{
|
||
m_itemv.P_Op_Cnt = 4;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.P_Op_Cnt < 5)
|
||
{
|
||
m_itemv.P_Op_Cnt = 5; //20170713
|
||
}
|
||
}
|
||
|
||
//20170607
|
||
if(ksdd == siteof::lfgakm3)
|
||
{
|
||
//第一种4,2,1;3,2,1;2,1,1;5,1,1;3,1,1;2,1,2;4,1,1;3,3,1;2,2,1;
|
||
//第二种2,1,3;4,2,1;3,1,1;2,1,5;5,1,1;3,4,1;2,2,1;4,1,1;3,2,1;
|
||
//第三种2,1,1;4,1,1;3,1,1;2,2,1;5,1,1;3,2,1;2,1,2;4,2,1;3,4,1;
|
||
int b = random2(1, 3); //random(3) + 1;
|
||
m_itemv.P_Op_Cnt = 9;
|
||
if(b == 1)
|
||
{
|
||
m_itemv.Op_Rd_str = "3,2,1;2,1,1;5,1,1;3,1,1;2,1,2;4,1,1;3,3,1;2,2,1;";
|
||
}
|
||
else if(b == 2)
|
||
{
|
||
m_itemv.Op_Rd_str = "2,1,3;3,1,1;2,1,5;5,1,1;3,4,1;2,2,1;4,1,1;3,2,1;";
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Op_Rd_str = "2,1,1;4,1,1;3,1,1;2,2,1;5,1,1;3,2,1;2,1,2;3,4,1;";
|
||
}
|
||
}
|
||
else
|
||
{
|
||
std::array<int, 8> Array7; //Array7: array[1..7] of integer;
|
||
//20171020
|
||
if(ksdd == siteof::shanghaikm3)
|
||
{
|
||
std::string str1 = "";
|
||
for(int GG = 1; GG <= 7; GG++)
|
||
{
|
||
Array7[GG] = GG;
|
||
}
|
||
//randomize;
|
||
for(int GG = 1; GG <= 7; GG++)
|
||
{
|
||
int JJ = random2(1, 7); //1 + random(7);
|
||
int x = Array7[GG];
|
||
Array7[GG] = Array7[JJ];
|
||
Array7[JJ] = x;
|
||
}
|
||
for(int GG = 1; GG <= 7; GG++)
|
||
{
|
||
int i = Array7[GG] + 1;
|
||
if(i == 3)
|
||
{
|
||
int r = random2(0, 4);
|
||
switch(r)
|
||
{
|
||
case 0: str1 = str1 + "2,1,1;"; break;
|
||
case 1: str1 = str1 + "2,1,2;"; break;
|
||
case 2: str1 = str1 + "2,1,3;"; break;
|
||
case 3: str1 = str1 + "2,1,4;"; break;
|
||
case 4: str1 = str1 + "2,1,5;"; break;
|
||
default: break;
|
||
}
|
||
}
|
||
else if(i == 7)
|
||
{
|
||
int r = random2(0, 1);
|
||
switch(r)
|
||
{
|
||
case 0: str1 = str1 + "4,1,1;"; break;
|
||
case 1: str1 = str1 + "4,1,2;"; break;
|
||
default: break;
|
||
}
|
||
}
|
||
else if(i == 2)
|
||
{
|
||
str1 = str1 + "3,1,1;";
|
||
}
|
||
else if(i == 4)
|
||
{
|
||
str1 = str1 + "3,2,1;";
|
||
}
|
||
else if(i == 5)
|
||
{
|
||
str1 = str1 + "3,3,1;";
|
||
}
|
||
else if(i == 6)
|
||
{
|
||
str1 = str1 + "2,2,1;";
|
||
}
|
||
else if(i == 8)
|
||
{
|
||
str1 = str1 + "3,4,2;";
|
||
}
|
||
}
|
||
m_itemv.Op_Rd_str = str1 + "5,1,1;";
|
||
}
|
||
else if(ksdd == siteof::guizhou)
|
||
{
|
||
std::string str1 = s383a.size() > 2 && s383a[2] != "" ? s383a[2] : ""; // getdotstr(3, sysset[383], '^');
|
||
std::vector<std::string> s = Tools::split(str1, ";");
|
||
size_t i = 0;
|
||
for(i = 0; i < 20; i++)
|
||
{
|
||
std::string ss = s.size() > i && s[i] != "" ? s[i] : "";
|
||
if(ss == "") //GetDotStr(I, Str1, ';') = ''
|
||
break;
|
||
}
|
||
int len = i; //i - 1;
|
||
if(len >= 5)
|
||
{
|
||
std::vector<int> ArrayMndg(len, 0); //ArrayMndg: array of integer;
|
||
for(int g = 0; g < len; g++)
|
||
{
|
||
ArrayMndg[g] = g + 1;
|
||
}
|
||
for(int g = 0; g < len; g++)
|
||
{
|
||
int r = random2(0, len-1); // random(len);
|
||
int i = ArrayMndg[g];
|
||
ArrayMndg[g] = ArrayMndg[r];
|
||
ArrayMndg[r] = i;
|
||
}
|
||
std::string str = "";
|
||
for(int g = 0; g < m_itemv.P_Op_Cnt; g++)
|
||
{
|
||
size_t idx = ArrayMndg[g];
|
||
str = str + (s.size() > idx ? s[idx] : "") + ";"; // getdotstr(ArrayMndg[GG], Str1, ';') + ';';
|
||
}
|
||
m_itemv.Op_Rd_str = str;
|
||
}
|
||
}
|
||
else if(ksdd == siteof::scyb || ksdd == siteof::heb)
|
||
{
|
||
m_itemv.Op_Rd_str = s383a.size() > 2 ? s383a[2] : "";
|
||
}
|
||
else
|
||
{
|
||
//通用模拟灯光
|
||
m_itemv.Op_Rd_str = ""; //getdotstr(3, sysset[383], '^'); //3,1,1;4,1,1;3,2,1;7,1,1;5,1,1;
|
||
}
|
||
|
||
std::array<int8, 6> dgarr_1; //dgarr_1: array[2..5] of Byte;
|
||
std::array<std::string, 6> dgarr_2; //dgarr_2: array[2..5] of string;
|
||
|
||
//Str1 := getdotstr(4, sysset[383], '^');
|
||
//(*
|
||
// (2)交替使用远近光灯 (不允许出现除"交替"外的其他灯光变化)
|
||
// <1.1>夜间通过急弯
|
||
// <1.2>夜间通过坡路
|
||
// <1.3>夜间通过拱桥
|
||
// <1.4>夜间通过人行横道
|
||
// <1.5>夜间通过没有交通信号灯控制的路口
|
||
// <2.1>夜间超车
|
||
//*)
|
||
dgarr_1[2] = 2; //2 2,2,1,1;12,23,1,1;
|
||
//(*
|
||
//(3)开近光灯
|
||
// //<1.1>夜间同方向近距离跟车行驶
|
||
// //<2.1>夜间发生会车
|
||
// //<3.1>夜间直行通过路口
|
||
// //<3.2>夜间路口左转弯
|
||
// //<3.3>夜间路口右转弯
|
||
// //<4.1>夜间在有路灯的道路上行驶
|
||
// //<4.2>夜间在照明良好的道路上行驶
|
||
//*)
|
||
dgarr_1[3] = 4; //2
|
||
// (*
|
||
// (4)开远光灯
|
||
// <1.1>夜间在没有照明的道路上行驶
|
||
// <1.2>夜间在照明不良的道路上行驶
|
||
// <2.1>请打远光灯 20150126 石家庄 删除
|
||
// *)
|
||
|
||
dgarr_1[4] = 1; //1
|
||
|
||
// (*
|
||
// (5)车辆发生故障(关大灯,开双跳)
|
||
// <1.1>车辆发生故障(关大灯,开双跳) 改成路边临时停车 需改语音
|
||
// <1.2>车辆发生交通事故 取消
|
||
// *)
|
||
dgarr_1[5] = 1; //1
|
||
//////////////////////////////////////////////////////////////////
|
||
dgarr_2[2] = "12"; //12
|
||
dgarr_2[3] = "1234"; //23
|
||
dgarr_2[4] = "1"; //1
|
||
dgarr_2[5] = "1"; //1
|
||
|
||
//20171017
|
||
if(m_itemv.Op_Rd_str != "")
|
||
{
|
||
//下面这句按规则翻译即可,检查是不是&分隔的字符串(特殊地区需求)
|
||
std::vector<std::string> s = Tools::split(m_itemv.Op_Rd_str, "&");
|
||
std::string str = s.size() > 0 && s[0] != "" ? s[0] : ""; //getdotstr(1, m_itemv.Op_Rd_str, '&');
|
||
if(str == "")
|
||
{
|
||
str = m_itemv.Op_Rd_str;
|
||
}
|
||
int a = 0;
|
||
std::vector<std::string> sx = Tools::split(str, ";");
|
||
for(size_t i = 0; i < 100; i++)
|
||
{
|
||
std::string tmp = sx.size() > i ? sx[i] : "";
|
||
if(tmp != "")
|
||
{
|
||
a++; //inc(a);
|
||
}
|
||
else
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
if(a < 5) //5 20171017
|
||
{
|
||
m_itemv.Op_Rd_str = "";
|
||
}
|
||
}
|
||
|
||
if(m_itemv.Op_Rd_str == "")
|
||
{
|
||
int8 CurrYJ = 0; //1-远光 2-近光
|
||
//生成一二级操作顺序
|
||
if(sor.ygd == SYES)
|
||
CurrYJ = 1;
|
||
else
|
||
CurrYJ = 2;
|
||
|
||
//std::string dgstr1 = "";
|
||
//std::string dgstr2 = "";
|
||
//std::string dgstr3 = "";
|
||
std::string dgstr1, dgstr2, dgstr3; //这里需要重点讲解这块与C++的差异,我们从dgstr1[1] 开始计算的。这块翻译特别关键。
|
||
|
||
//1、生成1级灯光代码
|
||
for(int i = 1; i <= m_itemv.P_Op_Cnt; i++)
|
||
{
|
||
int a = 0;
|
||
if(CurrYJ == 1) //当前是远光灯
|
||
{
|
||
// Randomize;
|
||
// (*
|
||
// 501:模拟灯光参数:yyys,zqys,czys, ccczys, xskf, yyjgsj,lstcstd,
|
||
// (1)yyys:灯光操作允许总延时(毫秒) (2)zqys: 一开始灯光就是正确的评判延时(毫秒)
|
||
// (3)czys:远近光交替操作延时时间 (4)ccczys: 超车灯光时间(指的是需要打方向灯的超车模式)
|
||
// (5)xskf:有车速是否扣分 (6)yyjgsj:每个语音至少间隔时间(毫秒)
|
||
// (7)lstcstd:临时停车打灯方式0:不要求双跳灯 1:要求双跳灯 2:标准(关闭前照灯,开启示廓灯)
|
||
//(8)模拟灯光路口是否加入左转和右转,默认0不加入,1加入。
|
||
// (9)模拟灯光在模拟结束后统一播报扣分信息。
|
||
// (10)模拟结束检查关灯的触发时间(毫秒):不设置或设置为0时按以前的项目距离触发评判
|
||
//(11)远关灯后面不随机闪灯项目
|
||
//(12)操作正确也要等时间到才进行下一个
|
||
// *)
|
||
|
||
int ErrorNum = 0;
|
||
const std::vector<std::string>& s501 = TableSysSet->asArray501();
|
||
int tmp = s501.size() > 10 && s501[10] != "" ? std::atoi(s501[10].c_str()) : 0;
|
||
if(ksdd == siteof::hunankm3 || tmp == 1)
|
||
{
|
||
ErrorNum = 2;
|
||
}
|
||
else
|
||
{
|
||
ErrorNum = -1; //相当于不控制闪灯,因为内部灯光编码不可能是负数
|
||
}
|
||
|
||
while(true)
|
||
{
|
||
if(i == m_itemv.P_Op_Cnt)
|
||
{
|
||
a = random2(2, 5); //random(4) + 2;
|
||
}
|
||
else
|
||
{
|
||
a = random2(2, 4); //random(3) + 2;
|
||
}
|
||
if(a == ErrorNum)
|
||
continue;
|
||
if(a != 4 && dgarr_1[a] > 0)
|
||
break; //当前是远光灯,只要非远光灯,就可以
|
||
if(a == 4) //如果当前抽中的是远光灯,但是其他灯光项目都用完了,那这个时候远光灯项目也是可以用的
|
||
{
|
||
if(dgarr_1[2] == 0 && dgarr_1[3] == 0 && dgarr_1[5] == 0 && dgarr_1[a] > 0)
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
dgarr_1[a] = dgarr_1[a] - 1;
|
||
if(a == 3)
|
||
{
|
||
CurrYJ = 2; //已经抽了近关灯题目
|
||
}
|
||
if(a == 2 || a == 5)
|
||
{
|
||
CurrYJ = 3; //按规则翻译即可,类似等价于当前已经抽取了远近光交替
|
||
}
|
||
}
|
||
else if(CurrYJ == 2) //近光
|
||
{
|
||
while(true)
|
||
{
|
||
if(i == m_itemv.P_Op_Cnt)
|
||
{
|
||
a = random2(2, 5); //random(4) + 2;
|
||
}
|
||
else
|
||
{
|
||
a = random2(2, 4); //random(3) + 2;
|
||
}
|
||
if(a != 3 && dgarr_1[a] > 0)
|
||
break; //非近光灯的题目都可以
|
||
if(a == 3) //如果当前抽中的是近光灯,但是其他灯光项目都用完了,那这个时候远光灯项目也是可以用的
|
||
{
|
||
if(dgarr_1[2] == 0 && dgarr_1[4] == 0 && dgarr_1[5] == 0 && dgarr_1[a] > 0)
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
dgarr_1[a] = dgarr_1[a] - 1;
|
||
if(a == 4)
|
||
{
|
||
CurrYJ = 1; //抽取了远光灯题目
|
||
}
|
||
if(a == 2 || a == 5)
|
||
{
|
||
CurrYJ = 3; //按规则翻译即可,类似等价于当前已经抽取了远近光交替
|
||
}
|
||
}
|
||
else if(CurrYJ == 3) //远近光交替
|
||
{
|
||
while(true)
|
||
{
|
||
if(i == m_itemv.P_Op_Cnt)
|
||
{
|
||
a = random2(2, 5); //random(4) + 2;
|
||
}
|
||
else
|
||
{
|
||
a = random2(2, 4); //random(3) + 2;
|
||
}
|
||
if(a != 2 && dgarr_1[a] > 0)
|
||
break; //非交替光灯的题目都可以
|
||
if(a == 2) //如果当前抽中的是交替灯光,但是其他灯光项目都用完了,那这个时候远光灯项目也是可以用的
|
||
{
|
||
if(dgarr_1[3] == 0 && dgarr_1[4] == 0 && dgarr_1[5] == 0 && dgarr_1[a] > 0)
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
dgarr_1[a] = dgarr_1[a] - 1;
|
||
if(a == 4 || a == 5)
|
||
CurrYJ = 1;
|
||
if(a == 3)
|
||
CurrYJ = 2;
|
||
}
|
||
//1、生成灯光1级代码
|
||
dgstr1 = dgstr1 + std::to_string(a);
|
||
//这个需要讲解一下,比如:1234,那么生成的随机数是1-4,
|
||
//Delphi的字符串是从1开始编号的(这块特别提醒一下)
|
||
int b = random2(0, dgarr_2[a].length()-1); //Random(Length(dgarr_2[a])) + 1;
|
||
dgstr2 = dgstr2 + dgarr_2[a][b];
|
||
//排除已选中的二级操作
|
||
std::string str = "";
|
||
for(size_t JJ = 0; JJ < dgarr_2[a].size(); JJ++)
|
||
{
|
||
if(JJ != (size_t)b)
|
||
{
|
||
str = str + dgarr_2[a][JJ];
|
||
}
|
||
}
|
||
dgarr_2[a] = str;
|
||
}
|
||
|
||
//3 、生成三级操作顺序
|
||
for(size_t i = 0; i < dgstr1.length(); i++)
|
||
{
|
||
int a = 0;
|
||
int k = 10;
|
||
if(dgstr1[i] == '5')
|
||
k = 1;
|
||
if(dgstr1[i] == '3' && dgstr2[i] == '3')
|
||
{
|
||
k = 1;
|
||
//模拟灯光路口是否加入左转和右转,默认0不加入,1加入
|
||
if(m_itemv.mndg_add_lukou == 1)
|
||
k = 3;
|
||
}
|
||
|
||
for(int j = 1; j <= k; j++)
|
||
{
|
||
std::string TempData = "";
|
||
TempData.append(1, dgstr1[i]).append(1, dgstr2[i]).append(std::to_string(j));
|
||
if(m_lights.find(TempData) != m_lights.end())
|
||
{
|
||
a = a + 1;
|
||
}
|
||
else
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
int b = random2(1, a > 0 ? a : 1); //yhytest b := random(a) + 1;
|
||
dgstr3 = dgstr3 + std::to_string(b);
|
||
}
|
||
|
||
for(int i = 0; i < (int)dgstr1.length(); i++)
|
||
{
|
||
m_itemv.Op_Rd_str.append(1,dgstr1[i]).append(",").append(1,dgstr2[i]).append(",").append(1,dgstr3[i]).append(";");
|
||
}
|
||
if(ksdd == siteof::guizhou)
|
||
{
|
||
int i = random2(0, 2); //random(3);
|
||
if(i == 1)
|
||
{
|
||
i = random2(1, 5); //random(5) + 1;
|
||
std::vector<std::string> s = Tools::split(m_itemv.Op_Rd_str, ";");
|
||
dgstr1 = (int)s.size() > i ? s[i] : ""; //GetDotStr(I, m_itemv.Op_Rd_str, ';');
|
||
i = random2(1, 2); //random(2) + 1;
|
||
if(i == 1)
|
||
m_itemv.Op_Rd_str = Tools::replace(m_itemv.Op_Rd_str, dgstr1, "8,1,1");
|
||
else
|
||
m_itemv.Op_Rd_str = Tools::replace(m_itemv.Op_Rd_str, dgstr1, "8,1,2");
|
||
//rfReplaceAll,
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//固定模拟项目,但打乱顺序(&) //cjh20190611
|
||
//特定地区的需求,照葫芦画瓢,翻译即可。
|
||
if(Tools::pos("&", m_itemv.Op_Rd_str))
|
||
{
|
||
std::vector<std::string> s = Tools::split(m_itemv.Op_Rd_str, "&");
|
||
std::string str = (int)s.size() > 0 ? s[0] : "";
|
||
//必须打乱
|
||
if(str == "")
|
||
{
|
||
str = m_itemv.Op_Rd_str;
|
||
}
|
||
int a = 0;
|
||
std::vector<std::string> sstr = Tools::split(str, ";");
|
||
for(int i = 0; i < 100; i++)
|
||
{
|
||
std::string tmp = (int)sstr.size() > i ? sstr[i] : "";
|
||
if(tmp != "")
|
||
{
|
||
a++; // inc(a);
|
||
}
|
||
else
|
||
{
|
||
break;
|
||
}
|
||
}
|
||
m_itemv.P_Op_Cnt = a;
|
||
m_itemv.Op_Rd_str = "";
|
||
for(int i = 0; i < m_itemv.P_Op_Cnt; i++)
|
||
{
|
||
std::string str1;
|
||
do
|
||
{
|
||
int a = random2(0, m_itemv.P_Op_Cnt-1); // random(ItmNight.P_Op_Cnt) + 1;
|
||
str1 = std::string((int)sstr.size() > a ? sstr[a] : "") + ";";
|
||
}while(Tools::pos(str1, m_itemv.Op_Rd_str) == true);
|
||
|
||
m_itemv.Op_Rd_str = m_itemv.Op_Rd_str + str1;
|
||
}
|
||
}
|
||
}
|
||
} //20170607
|
||
} //20180324
|
||
|
||
const std::vector<std::string>& s524 = TableSysSet->asArray524();
|
||
int tmp = s524.size() > 2 && s524[2] != "" ? std::atoi(s524[2].c_str()) : 1;
|
||
if(ksdd == siteof::shanghaikm3 || tmp == 1)
|
||
{
|
||
static const std::string x511= "5,1,1;";
|
||
std::string::size_type xh = m_itemv.Op_Rd_str.find(x511);
|
||
if(xh != std::string::npos)
|
||
{
|
||
//std::string str = m_itemv.Op_Rd_str.substr(0, xh) + Tools::trim(m_itemv.Op_Rd_str.substr(xh + x511.length()));
|
||
//m_itemv.Op_Rd_str = str + x511;
|
||
m_itemv.Op_Rd_str.erase(xh, x511.length());
|
||
m_itemv.Op_Rd_str += x511;
|
||
}
|
||
}
|
||
//ToDo:保存模拟灯光字符串到JSON文件
|
||
//下次回放的时候,把这个模拟灯光字符串取出来
|
||
storageLightItem(m_itemv.Op_Rd_str);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//2、交替使用远近光灯
|
||
void Sub3Judge41Mndg::JiaoTi_DengGuang()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* cg1 = m_car->historyChuanGan(1);
|
||
const TSensorInfo& sor1 = cg1->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
//“超车”操作要求调整为“先向左打方向灯,再交替使用远近光灯,再向右打方向灯,最后将方向灯回归原位”
|
||
//(整套动作时间不得超过20秒),其余7项灯光使用项目用时要求不变
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
for(size_t i = 0; i < m_itemv.Lt_Change.size(); i++)
|
||
{
|
||
m_itemv.Lt_Change[i] = N0;
|
||
}
|
||
|
||
m_itemv.Lt_YJ_TM = 0;
|
||
m_itemv.Lt_YJ_cs = 0;
|
||
//播报语音(Windows)
|
||
//sd_str = ExtractFilePath(Application.ExeName) + 'Sound\YJ2' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj2", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
if(m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1) //假如是夜间超车,记录当前的方向灯 20140812
|
||
{
|
||
m_itemv.Cc_beforeYfd[0] = sor.yfxd;
|
||
m_itemv.Cc_beforeYfd[1] = sor.shtd;
|
||
m_itemv.Cc_beforeYfd[2] = sor.wd;
|
||
}
|
||
|
||
m_itemv.Cc_Jd = 0;
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2) //等待语音播报完成
|
||
{
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3) //操作结果
|
||
{
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
//检查上一个灯光题目:是不是 “车辆发生故障”
|
||
bool b5 = (m_itemv.LastSubItemNo == 5);
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
//如果是车辆发生故障
|
||
if(b5)
|
||
{
|
||
|
||
}
|
||
else
|
||
{
|
||
if(i == 2 || i == 3)
|
||
{
|
||
// //0:未定义 1:示宽, 2:双跳, 3:雾灯,4:远光,5:近光,6:交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
if(m_itemv.SubWav1 == 2 || m_itemv.SubWav1 == 3) //按规则翻译,夜间超车相关的
|
||
{
|
||
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "03", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if(Tools::pos(siteof::guizhou, ksdd) == true)
|
||
{
|
||
//20190308 超车
|
||
if(m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1)
|
||
{
|
||
if((sor.yfxd == SYES && sor1.yfxd == SNOT) || (sor.wd == SYES && sor1.wd == SNOT) || (sor.shtd == SYES && sor1.shtd == SNOT))
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if((sor.zfxd == SYES && sor1.zfxd == SNOT) || (sor.yfxd == SYES && sor1.yfxd == SNOT) ||
|
||
(sor.wd == SYES && sor1.wd == SNOT) || (sor.shtd == SYES && sor1.shtd == SNOT))
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
}
|
||
}
|
||
}
|
||
//20150803
|
||
/////////超车 贵州
|
||
if(m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1 && Tools::pos(siteof::guizhou, ksdd) && !m_itemv.b3szfxd)
|
||
{
|
||
if(sor.zfxd == SYES)
|
||
{
|
||
m_itemv.b3szfxd = true;
|
||
for( int i = 1; i <= 14; i++)
|
||
{
|
||
const TSensorInfo& sori = m_car->historySensor(i);
|
||
if(sori.zfxd == SNOT)
|
||
{
|
||
m_itemv.b3szfxd = false;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
/////////超车 20140812 贵州毕节 20171118
|
||
if(m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1 && (ksdd == siteof::shanghaikm3 || ksdd == siteof::guizhoubj))
|
||
{
|
||
if(m_itemv.Cc_Jd == 0)
|
||
{
|
||
if(sor.zfxd == SYES && sor1.zfxd == SYES)
|
||
{
|
||
m_itemv.Cc_Jd = 1;
|
||
m_itemv.Lt_Change[6] = N0;
|
||
}
|
||
//20171123
|
||
if(ksdd == siteof::guizhoubj && MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
JUDGE_MARK_SUB3(20, "73", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
|
||
if( (sor.yfxd == SYES && sor1.yfxd == SYES && m_itemv.Cc_beforeYfd[0] == 0 && m_itemv.Cc_beforeYfd[1] == 0) ||
|
||
(sor.shtd == SYES && sor1.shtd == SYES && m_itemv.Cc_beforeYfd[1] == 0) ||
|
||
(sor.wd == SYES && sor1.wd == SYES && m_itemv.Cc_beforeYfd[2] == 0))
|
||
{
|
||
//20171118
|
||
if(ksdd == siteof::guizhoubj)
|
||
{
|
||
JUDGE_MARK_SUB3(20, "73", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
else if(m_itemv.Cc_Jd == 1)
|
||
{
|
||
if(m_itemv.Lt_Change[6] == Y1)
|
||
{
|
||
m_itemv.Cc_Jd = 2;
|
||
}
|
||
else
|
||
{
|
||
if((sor.yfxd == SYES && sor1.yfxd == SYES) || (sor.shtd == SYES && sor1.shtd == SYES) || (sor.wd == SYES && sor1.wd == SYES))
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else if(m_itemv.Cc_Jd == 2)
|
||
{
|
||
if(sor.yfxd == 1) //右方向灯
|
||
{
|
||
m_itemv.Cc_Jd = 3;
|
||
}
|
||
else
|
||
{
|
||
if((sor.shtd == SYES && sor1.shtd == SYES) || (sor.wd == SYES && sor1.wd == SYES))
|
||
{
|
||
//20171118
|
||
if(ksdd == siteof::guizhoubj)
|
||
{
|
||
JUDGE_MARK_SUB3(20, "73", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else if(m_itemv.Cc_Jd == 3)
|
||
{
|
||
if(sor.zfxd == SNOT && sor.yfxd == SNOT)
|
||
{
|
||
m_itemv.Cc_Jd = 4;
|
||
}
|
||
else
|
||
{
|
||
if((sor.zfxd == SYES && sor1.zfxd == SYES) || (sor.shtd == SYES && sor.shtd == SYES) || (sor.wd == SYES && sor1.wd == SYES))
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
|
||
if(m_itemv.Cc_Jd == 4 && MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) <= m_itemv.P_Ccopys) //完成操作的
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
return;
|
||
}
|
||
|
||
if(m_itemv.Cc_Jd != 4 && MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_Ccopys) //超时,未完成操作的
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//雾天行驶 要判断双跳灯+雾灯
|
||
//检查灯光正确
|
||
//非特殊地点版本
|
||
if(m_itemv.Lt_Change[6] == Y1)
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //灯光正确了
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
//20150803 20180205
|
||
if(Tools::pos(siteof::guizhou, ksdd) && m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1)
|
||
{
|
||
//20190311
|
||
if(!m_itemv.b3szfxd)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
m_itemv.Lt_YesID = m_itemv.b3szfxd;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
//20150803 20180205
|
||
if(Tools::pos(siteof::guizhou, ksdd) && m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1)
|
||
{
|
||
//20190311
|
||
if(!m_itemv.b3szfxd)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
m_itemv.Lt_YesID = m_itemv.b3szfxd;
|
||
}
|
||
}
|
||
}
|
||
|
||
//20171009 检查双跳灯
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
if((m_itemv.stdjs > 0 && MilliSecondsBetween(gps.sj, m_itemv.stdjs) > 8000) || m_itemv.stdjs == 0)
|
||
{
|
||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||
if(sor.shtd == SYES && sor1.shtd == SYES && sor2.shtd == SYES)
|
||
{
|
||
//Pub_Log('jt std:' + m_itemv.Lt_Change);
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//总时间到 或 灯光操作正确
|
||
//20190311
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
//20150803 20180205
|
||
if(Tools::pos(siteof::guizhou, ksdd) && m_itemv.SubWav1 == 2 && m_itemv.SubWav2 == 1)
|
||
{
|
||
if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "03", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.Lt_Change[6] == Y1)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "08", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "03", false);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//3、打开近光灯
|
||
void Sub3Judge41Mndg::Open_JinGuangDeng()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* cg1 = m_car->historyChuanGan(1);
|
||
const TSensorInfo& sor1 = cg1->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ3' + inttostr(m_itemv.SubWav1) +inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj3", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
//检查上一个灯光题目:是不是 “车辆发生故障”
|
||
bool b5 = (m_itemv.LastSubItemNo == 5);
|
||
/////////////////////////////////////////////////////////////////////////
|
||
|
||
if(ksdd == siteof::guizhou)
|
||
{
|
||
if((sor.wd == SYES && sor1.wd == SNOT) || (sor.shtd == SYES && sor1.shtd == SNOT)) //(cg.di_zfxd = 1) or (cg.di_yfxd = 1) or
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
}
|
||
}
|
||
////示宽,双跳,雾灯,远光,近光,交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
//0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(i == 4 || (b5 == false && i == 6)) //20170527 20171009
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
if(ksdd == siteof::shanghaikm3 || ksdd == siteof::jiuquan)
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "02", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 3)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "05", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 4)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "07", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 5)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//打错灯了
|
||
if(i == 4)
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "02", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 3)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "05", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 4)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "07", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 5)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
//20180129
|
||
if(i == 6)
|
||
{
|
||
if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
}
|
||
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//检查灯光正确
|
||
//20140812 20190124
|
||
if(m_itemv.SubWav1 == 3 && m_itemv.SubWav2 == 2 && (ksdd == siteof::shanghaikm3 || ksdd == siteof::lygkm3 || m_itemv.mndg_add_lukou == 1)) //(stuinfo.Stu_Type = 12) then //左方向灯
|
||
{
|
||
if(sor.jgd == SYES && sor.zfxd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
if(m_itemv.SubWav1 == 3 && m_itemv.SubWav2 == 2 && ksdd == siteof::guizhou) //(stuinfo.Stu_Type = 12) then //左方向灯
|
||
{
|
||
if(sor.jgd == SYES && sor.zfxd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
|
||
if(m_itemv.SubWav1 == 3 && m_itemv.SubWav2 == 3 && (ksdd == siteof::shanghaikm3 || ksdd == siteof::lygkm3 || m_itemv.mndg_add_lukou == 1)) //(stuinfo.Stu_Type = 12) then //右方向灯
|
||
{
|
||
if(sor.jgd == SYES && sor.yfxd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
|
||
if(ksdd == siteof::shanghaikm3 || ksdd == siteof::lygkm3 || ksdd == siteof::guizhou || m_itemv.mndg_add_lukou == 1) //(stuinfo.Stu_Type = 12) then
|
||
{
|
||
if(sor.jgd == SYES && !(m_itemv.SubWav1 == 3 && m_itemv.SubWav2 > 1)) //20140812
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.Lt_Change[5] == Y1) //相当于近光灯持续了一段时间
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//检查灯光正确
|
||
//非特殊地点版本
|
||
if(sor.jgd == SYES)
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作(之前就是近光灯,不需要重新打近光灯)
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.Lt_Change[5] == Y1) //相当于近光灯持续了一段时间
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
}
|
||
//20171009 检查双跳灯
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
if((m_itemv.stdjs > 0 && MilliSecondsBetween(gps.sj, m_itemv.stdjs) > 8000) || m_itemv.stdjs == 0)
|
||
{
|
||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||
if(sor.shtd == SYES && sor1.shtd == SYES && sor2.shtd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(ksdd == siteof::shanghaikm3 || ksdd == siteof::lygkm3 || ksdd == siteof::guizhou) //(stuinfo.Stu_Type = 12) then
|
||
{
|
||
if(sor.jgd == SYES) // 左转 332 右转333
|
||
{
|
||
if(!(m_itemv.SubWav1 = 3 && m_itemv.SubWav2 > 1))
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 3 && m_itemv.SubWav2 > 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill())
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(ksdd == siteof::shanghaikm3)
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "02", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 3)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "05", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 4)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "07", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 5)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "02", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 3)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "05", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 4)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "07", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 5)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill())
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//标准
|
||
//非特殊地点版本
|
||
if(sor.jgd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "02", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 2)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "04", true);
|
||
}
|
||
else if(m_itemv.SubWav1 == 3)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "05", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 4)
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "07", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
}
|
||
else if(m_itemv.SubWav1 == 5)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill())
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//4、打开远光灯
|
||
void Sub3Judge41Mndg::Open_YuanGuangDeng()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* cg1 = m_car->historyChuanGan(1);
|
||
const TSensorInfo& sor1 = cg1->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ4' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj4", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
//检查上一个灯光题目:是不是 “车辆发生故障”
|
||
bool b5 = (m_itemv.LastSubItemNo == 5);
|
||
/////////////////////////////////////////////////////////////////////////
|
||
//示宽,双跳,雾灯,远光,近光,交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
if(b5)
|
||
{ //20171010
|
||
if(i != 4 && i != 1 && i != 6 && i != 5) //20140812
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
if(m_itemv.SubWav1 == 2) //远光灯 20150126
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
else
|
||
{
|
||
//打错灯了
|
||
JUDGE_MARK_SUB3(41, "09", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(i != 4 && i != 1) //20140812
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
if(m_itemv.SubWav1 == 2) //远光灯 20150126
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
else
|
||
{
|
||
//打错灯了
|
||
JUDGE_MARK_SUB3(41, "09", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//检查灯光正确
|
||
if(sor.ygd == SYES)
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作(当前的灯光就是正确的,无需打对应的灯光)0
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.Lt_Change[4] == Y1) //相当于远光灯持续了一段时间
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
}
|
||
//20190308
|
||
if(ksdd == siteof::guizhou)
|
||
{
|
||
if((sor.zfxd == SYES && sor1.zfxd == SNOT) || (sor.yfxd == SYES && sor1.yfxd == SNOT) ||
|
||
(sor.wd == SYES && sor1.wd == SNOT) || (sor.shtd == SYES && sor1.shtd == SNOT))
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
}
|
||
}
|
||
//20171009 检查双跳灯
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
if((m_itemv.stdjs > 0 && MilliSecondsBetween(gps.sj, m_itemv.stdjs) > 8000) || m_itemv.stdjs == 0)
|
||
{
|
||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||
if(sor.shtd == SYES && sor1.shtd == SYES && sor2.shtd == SYES)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(sor.ygd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 2) //远光灯 20150126
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "09", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//5、车辆发生故障 临时停车
|
||
void Sub3Judge41Mndg::CheLiangGuZhang()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const TChuanGan* cg1 = m_car->historyChuanGan(1);
|
||
const TSensorInfo& sor1 = cg1->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ5' + inttostr(m_itemv.SubWav1) +inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj5", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus ==3)
|
||
{
|
||
const std::string& s421 = TableSysSet->get421();
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
//、临时停车打灯方式 0:不要求双跳灯 1:要求双跳灯 2:标准(关闭前照灯,开启示廓灯)
|
||
if(m_itemv.lstcstd == 2)
|
||
{
|
||
////0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(i == 3)
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//SysSet[421]:模拟夜间:车辆发生故障,按近光灯和双跳进行评判(0-是 1-否)
|
||
if(s421 != "0") //20140923
|
||
{
|
||
if(Tools::pos(siteof::guizhou, ksdd)) //20150304
|
||
{
|
||
if(i != 1 && i != 2 && i != 6)
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
if(ksdd == siteof::guizhouzy)
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93 ", true);
|
||
}
|
||
else
|
||
{
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06 ", true);
|
||
}
|
||
}
|
||
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if((ksdd == siteof::jiuquan && i != 1 && i != 5) || (ksdd != siteof::jiuquan && i != 1 && i != 2 && i != 5)) //之前判断方法 //20170809
|
||
{
|
||
////0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//非特殊地点版本
|
||
if(i != 1 && i!= 2 && i != 5) //20140923 新增不判远光灯
|
||
{
|
||
////0:未定义 1:示宽,2:双跳,3:雾灯,4:远光,5:近光,6:交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
if(m_itemv.SubWav1 == 1)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
}
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
int a = 0;
|
||
//检查灯光正确
|
||
if(ksdd == siteof::weinancgs)
|
||
{
|
||
a = 1;
|
||
}
|
||
else
|
||
{
|
||
a = sor.skd + sor.ygd + sor.jgd;
|
||
}
|
||
|
||
//SysSet[421]:模拟夜间:车辆发生故障,按近光灯和双跳进行评判(0-是 1-否)
|
||
if(s421 == "0") //20141008
|
||
{
|
||
a = sor.jgd;
|
||
}
|
||
if(Tools::pos(siteof::guizhou, ksdd)) //20150304 20180809
|
||
{
|
||
a = sor.skd;
|
||
}
|
||
if(ksdd == siteof::shandongyt)
|
||
{
|
||
a = 1;
|
||
}
|
||
//20180809
|
||
if(m_itemv.lstcstd == 2)
|
||
{
|
||
if(sor.skd == SYES && (sor.ygd + sor.jgd) == SNOT)
|
||
{
|
||
a = 1;
|
||
}
|
||
}
|
||
if((a == 1) && ((ksdd != siteof::nj && sor.wd == SNOT) || ksdd == siteof::nj) && ((m_itemv.lstcstd == 1 && sor.shtd == SYES) || m_itemv.lstcstd != 1))
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Lt_LastChange_TM) >= m_itemv.P_YJGD_JT_YS) //正确的灯光持续了一段时间
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
}
|
||
//20190308
|
||
if(ksdd == siteof::guizhou)
|
||
{
|
||
const TSensorInfo& sor2 = m_car->historySensor(2);
|
||
if((sor.zfxd == SYES && sor1.zfxd == SYES && sor2.zfxd == SNOT) ||
|
||
(sor.yfxd == SYES && sor1.yfxd == SYES && sor2.yfxd == SNOT) ||
|
||
(sor.wd == SYES && sor2.wd == SYES && sor1.wd == SNOT) ||
|
||
(m_itemv.lstcstd != 1 && sor.shtd == SYES && sor2.shtd == SYES && sor1.shtd == SNOT))
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
}
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
m_itemv.stdjs = gps.sj; //20171018
|
||
if(Tools::pos(siteof::guizhou, ksdd))
|
||
{
|
||
if(sor.ygd + sor.jgd > 0)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
m_itemv.stdjs = gps.sj;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(a == 1 && ((ksdd != siteof::nj && sor.wd == 0) || ksdd == siteof::nj) && ((m_itemv.lstcstd == 1 && sor.shtd == SYES) || m_itemv.lstcstd != 1))
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
m_itemv.stdjs = gps.sj; //20171018
|
||
if(Tools::pos(siteof::guizhou, ksdd))
|
||
{
|
||
if(sor.ygd + sor.jgd > 0)
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
m_itemv.stdjs = gps.sj;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "06", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
m_itemv.stdjs = gps.sj;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//6、故障解除
|
||
void Sub3Judge41Mndg::GuZhangJieChu()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ6' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj6", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
//示宽,双跳,雾灯,远光,近光,交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
if(i == 3)
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//检查灯光正确
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd > 0 && sor.shtd == SNOT)
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(sor.skd == SYES && sor.ygd + sor.jgd > 0 && sor.shtd == SNOT)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//7、关闭灯光
|
||
void Sub3Judge41Mndg::CloseAllDengGuang()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ7' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj7", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
//检查灯光错误
|
||
if(m_itemv.P_IF_Err_Kf && m_itemv.Lt_Change != m_itemv.Lt_Change_Last)
|
||
{
|
||
for(int i = 1; i <= 6; i++)
|
||
{
|
||
//示宽,双跳,雾灯,远光,近光,交替, 注意:记录灯光的变化,示宽是从有到无,其他是从无到有
|
||
if(i == 3)
|
||
{
|
||
if(m_itemv.Lt_Change[i] == Y1)
|
||
{
|
||
//打错灯了
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//检查灯光正确
|
||
if(sor.skd == SNOT && sor.shtd == SNOT && sor.wd == SNOT)
|
||
{
|
||
if(m_itemv.Lt_LastChange_TM == 0) //表示没有灯光动作
|
||
{
|
||
if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_CSOK_YanShi)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(sor.skd == SNOT && sor.shtd == SNOT && sor.wd == SNOT)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//8、雾天行驶
|
||
void Sub3Judge41Mndg::WuTianXingShi()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ8' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj8", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
if(ksdd == siteof::lygkm3)
|
||
{
|
||
if(sor.ygd == SYES && sor.wd == SYES && sor.shtd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else if(ksdd == siteof::guizhou)
|
||
{
|
||
if(sor.ygd + sor.jgd > 0 && sor.wd == SYES && sor.shtd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(sor.wd == SYES && sor.shtd == SYES && sor.skd == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
}
|
||
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(ksdd == siteof::lygkm3)
|
||
{
|
||
if(sor.ygd == SYES && sor.wd == SYES && sor.shtd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
else if(ksdd == siteof::guizhou)
|
||
{
|
||
if(sor.ygd + sor.jgd > 0 && sor.wd == SYES && sor.shtd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(sor.wd == SYES && sor.shtd == SYES && sor.skd == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(41, "01", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//9、雨天行驶
|
||
void Sub3Judge41Mndg::YuTianXingShi()
|
||
{
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
const std::string& ksdd = TableSysSet->get211();
|
||
|
||
if(m_itemv.ItemStatus == 1)
|
||
{
|
||
//播报语音(Windows)
|
||
//Sd_Str = ExtractFilePath(Application.ExeName) + 'Sound\YJ9' + inttostr(m_itemv.SubWav1) + inttostr(m_itemv.SubWav2) + '.wav';
|
||
playSound("yj9", m_itemv.SubWav1, m_itemv.SubWav2); //PlaySound1(sd_str);
|
||
m_itemv.Snd_Wav_Start_TM = gps.sj;
|
||
//ToDo:播报语音(鸿蒙)
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
else if(m_itemv.ItemStatus == 2)
|
||
{
|
||
//等待语音完成
|
||
Wait_Snd_End();
|
||
}
|
||
else if(m_itemv.ItemStatus == 3)
|
||
{
|
||
//检查灯光错误
|
||
//检查雨刷器正确
|
||
if(sor.ygq == SYES)
|
||
{
|
||
m_itemv.Lt_YesID = true;
|
||
}
|
||
//总时间到 或 灯光操作正确
|
||
if(m_itemv.Lt_YesID == true || MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_End_TM) > m_itemv.P_zys)
|
||
{
|
||
if(m_itemv.Lt_YesID)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
if(sor.ygq == SYES)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
JUDGE_MARK_SUB3(20, "93", true);
|
||
if(m_car->isQualified() || m_car->isExamDrill() || ksdd == siteof::hebtest)
|
||
{
|
||
m_itemv.ItemNo = 0;
|
||
}
|
||
else
|
||
{
|
||
m_itemv.ItemNo = 100;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
void Sub3Judge41Mndg::Wait_Snd_End()
|
||
{
|
||
return;
|
||
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
const TSensorInfo& sor = cg->real.sensor;
|
||
|
||
//等待语音完成
|
||
//if(sor.wav == SYES) //语音结束信号
|
||
{
|
||
m_itemv.Snd_Wav_End_TM = gps.sj;
|
||
CSH_DengGuangSubItem();
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
}
|
||
|
||
//等待语音完成
|
||
// if(!m_car->isReplay()) //杨海洋实际考试模式(就是说非回放模式的)
|
||
// {
|
||
// if(MilliSecondsBetween(gps.sj, m_itemv.Snd_Wav_Start_TM) >= 1000)
|
||
// {
|
||
// //下面是Windows的控制语音是否播报完的代码
|
||
// //Windows条件: if(PlaySnd_ID = False) and (PlaySnd_Cnt = PlaySnd_Cnt1) then
|
||
// //鸿蒙条件:XXX
|
||
// bool WavFinishFlag = false;
|
||
// if(PlaySnd_ID == false && PlaySnd_Cnt == PlaySnd_Cnt1)
|
||
// {
|
||
// WavFinishFlag = true;
|
||
// }
|
||
// if(WavFinishFlag == true)
|
||
// {
|
||
// m_itemv.Snd_Wav_End_TM = gps.sj;
|
||
// CSH_DengGuangSubItem();
|
||
// m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
// }
|
||
// }
|
||
// }
|
||
// else
|
||
// {
|
||
// //如果是回放模式的,比如:读取杨海洋的日志文件
|
||
// if(sor.wav == SYES) //语音结束信号
|
||
// {
|
||
// m_itemv.Snd_Wav_End_TM = gps.sj;
|
||
// CSH_DengGuangSubItem();
|
||
// m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
// }
|
||
// }
|
||
}
|
||
|
||
void Sub3Judge41Mndg::CSH_DengGuangSubItem()
|
||
{
|
||
if(m_itemv.ItemNo != 2)
|
||
{
|
||
for(size_t i = 0; i < m_itemv.Lt_Change.size(); i++)
|
||
{
|
||
m_itemv.Lt_Change[i] = N0;
|
||
}
|
||
|
||
m_itemv.Lt_Change_Last = m_itemv.Lt_Change;
|
||
|
||
m_itemv.Lt_YJ_TM = 0;
|
||
m_itemv.Lt_YJ_cs = 0; //20150327
|
||
}
|
||
m_itemv.Lt_LastChange_TM = 0;
|
||
m_itemv.Lt_YesID = false;
|
||
m_itemv.b3szfxd = false; //20150803
|
||
}
|
||
|
||
void Sub3Judge41Mndg::storageLightItem(const std::string& item)
|
||
{
|
||
m_car->createEventLight(item);
|
||
}
|
||
|
||
void Sub3Judge41Mndg::playSound(const std::string& kind, int subWav1, int subWav2)
|
||
{
|
||
std::string id = kind + std::to_string(subWav1) + std::to_string(subWav2);
|
||
|
||
std::string code = "";
|
||
const auto it = m_lights.find(id);
|
||
if(it != m_lights.end())
|
||
{
|
||
code = it->second;
|
||
}
|
||
else
|
||
{
|
||
//没找到这个灯光项目
|
||
logerror("mndg-sound-no-item id=%s, code=%s", id.c_str(), code.c_str());
|
||
}
|
||
|
||
if(code.empty())
|
||
{
|
||
//有可能没这个灯光项目 或者 这个灯光项目没有对应的语音码
|
||
logerror("mndg-sound-empty id=%s, code=%s", id.c_str(), code.c_str());
|
||
}
|
||
|
||
logtrace("mndg-sound id=%s code=%s", id.c_str(), code.c_str());
|
||
m_car->createEventSound({itemNo(), code, PlaySoundEndNotify});
|
||
|
||
}
|
||
|
||
void Sub3Judge41Mndg::playSoundEnd(const std::string& code)
|
||
{
|
||
//语音结束信号
|
||
const TChuanGan* cg = m_car->historyChuanGan();
|
||
const TGpsInfo& gps = cg->real.gps;
|
||
//const TSensorInfo& sor = cg->real.sensor;
|
||
//等待语音完成
|
||
//if(sor.wav == SYES) //语音结束信号
|
||
{
|
||
m_itemv.Snd_Wav_End_TM = gps.sj;
|
||
CSH_DengGuangSubItem();
|
||
m_itemv.ItemStatus = m_itemv.ItemStatus + 1;
|
||
logtrace("mndg-sound-end code=%s", code.c_str());
|
||
}
|
||
|
||
}
|
||
|