问题修改
This commit is contained in:
parent
7b5e773567
commit
9b92456f94
Binary file not shown.
@ -27,7 +27,7 @@
|
||||
#define JUDGE_VERSION_MAJOR 1
|
||||
#define JUDGE_VERSION_MINOR 0
|
||||
#define JUDGE_VERSION_PATCH 3
|
||||
#define JUDGE_VERSION_STAMP "2504191100b"
|
||||
#define JUDGE_VERSION_STAMP "2504241045b"
|
||||
#if JUDGE_USE_OLD
|
||||
# undef JUDGE_VERSION_STAMP
|
||||
# define JUDGE_VERSION_STAMP "2411121010b.old"
|
||||
|
||||
@ -261,6 +261,7 @@ class JUDGE_API SysSetTable : public IDBTable
|
||||
SYSSET_DECLARE(615); //侧方停车读卡前进时碰6线不合格 0
|
||||
SYSSET_DECLARE(617, type_int); //参数617:语音实时播报项目是否合格(0-否 1-是)语音码:xmhg,xmbhg
|
||||
SYSSET_DECLARE(624); //考试评判车门模式
|
||||
SYSSET_DECLARE(629); //默认的在车辆进入坡道区域才评判停车定点,坡道中停立刻评判,默认的在车辆进入定点10米区域才评判停车定点
|
||||
SYSSET_DECLARE(641, type_int); //641=1 是车尾过5-6延长线结束
|
||||
SYSSET_DECLARE(660); //侧方停车项目 停车距离判断阈值控制参数
|
||||
SYSSET_DECLARE(668); //安全带评判模式
|
||||
@ -407,6 +408,7 @@ class JUDGE_API SysSetTable : public IDBTable
|
||||
SYSSET_ASSIGN(615);
|
||||
SYSSET_ASSIGN(617);
|
||||
SYSSET_ASSIGN(624);
|
||||
SYSSET_ASSIGN(629);
|
||||
SYSSET_ASSIGN(641);
|
||||
SYSSET_ASSIGN(660);
|
||||
SYSSET_ASSIGN(668);
|
||||
|
||||
@ -91,17 +91,6 @@ ErrorCode ExamCarSub2::examBeginExam()
|
||||
}
|
||||
}
|
||||
|
||||
return QE(codeSuccess);
|
||||
}
|
||||
|
||||
ErrorCode ExamCarSub2::examGoonExam()
|
||||
{
|
||||
if(m_stuInfo.ddxk)
|
||||
{
|
||||
m_disForward = m_stuInfo.yklc;
|
||||
|
||||
//1、处理已考项目
|
||||
|
||||
//2、执行扣分
|
||||
int grade = 0;
|
||||
for(size_t i = 0; i < m_stuInfo.kfxm.size(); i++)
|
||||
@ -131,6 +120,11 @@ ErrorCode ExamCarSub2::examGoonExam()
|
||||
{
|
||||
m_grade = 0;
|
||||
}
|
||||
|
||||
//3、处理断点续考
|
||||
if(m_stuInfo.ddxk)
|
||||
{
|
||||
m_disForward = m_stuInfo.yklc;
|
||||
//m_timeBegin = m_stuInfo.ddkssj;
|
||||
}
|
||||
|
||||
@ -141,7 +135,6 @@ ErrorCode ExamCarSub2::examGoonExam()
|
||||
//createEventExamFinish(ExamFinishAuto); //杨 20240724 都由苏那边控制
|
||||
return QE(errorBeginNotQual); //已经不合格了
|
||||
}
|
||||
|
||||
return QE(codeSuccess);
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ public:
|
||||
public: //for IExamCar override
|
||||
virtual ErrorCode examCarInitInfo(TInitInfo* info) override;
|
||||
virtual ErrorCode examBeginExam() override;
|
||||
virtual ErrorCode examGoonExam() override;
|
||||
virtual ErrorCode examEndExam() override;
|
||||
virtual ErrorCode examJudgeExam() override;
|
||||
virtual ErrorCode examArtifMark(ExamItemCode itemno, const std::string& serial, MarkType type) override;
|
||||
|
||||
@ -66,7 +66,7 @@ ErrorCode ExamCarSub3::examBeginExam()
|
||||
TKM3Item* item = findExamItem(itemNo);
|
||||
if(item != nullptr)
|
||||
{
|
||||
KM3EndItem(itemNo, false);
|
||||
KM3EndItem(itemNo, false, false);
|
||||
//item->Item_Color = itemStateHg;
|
||||
//item->TestPro = ItemProFlagEnd;
|
||||
//item->FinishFlag = true; //防止已考发项目结束事件
|
||||
@ -83,19 +83,6 @@ ErrorCode ExamCarSub3::examBeginExam()
|
||||
{
|
||||
m_newSub3->examBegin();
|
||||
}
|
||||
return QE(codeSuccess);
|
||||
}
|
||||
|
||||
ErrorCode ExamCarSub3::examGoonExam()
|
||||
{
|
||||
//4、执行扣分(如果StuInfo.CSH_Marks 不为空)
|
||||
//这个时候,Tds的Grade会被重新赋值
|
||||
|
||||
if(m_stuInfo.ddxk)
|
||||
{
|
||||
m_disForward = m_stuInfo.yklc;
|
||||
|
||||
//1、处理已考项目
|
||||
|
||||
//2、执行扣分
|
||||
int grade = 0;
|
||||
@ -114,7 +101,6 @@ ErrorCode ExamCarSub3::examGoonExam()
|
||||
|
||||
//断点扣分不要生成任何事件通知,关心的就是本地扣出来即可 //???yhyflag
|
||||
//Mark(markItem.xmdm, markItem.kfdm, false, true, 0, true); //Self.Mark(TempItemNo, Str3, False, True, 0, True);
|
||||
|
||||
//扣分只记录分数,不需要根据扣分记录项目状态 20240816 在洛阳确认的
|
||||
//TKM3Item* item = findExamItem(markItem.xmdm);
|
||||
//TASSERT(item != nullptr, "");
|
||||
@ -122,7 +108,6 @@ ErrorCode ExamCarSub3::examGoonExam()
|
||||
//{
|
||||
// item->Item_Color = itemStateBhg;
|
||||
//}
|
||||
|
||||
loginfo("ddxk-mark xmdm=%d,kfdm=%s", markItem.xmdm, markItem.kfdm.c_str());
|
||||
}
|
||||
m_grade -= grade;
|
||||
@ -131,6 +116,10 @@ ErrorCode ExamCarSub3::examGoonExam()
|
||||
m_grade = 0;
|
||||
}
|
||||
|
||||
//3、处理断点续考
|
||||
if(m_stuInfo.ddxk)
|
||||
{
|
||||
m_disForward = m_stuInfo.yklc;
|
||||
//3、更新开始时间
|
||||
//m_timeBegin = m_stuInfo.ddkssj != 0 ? m_stuInfo.ddkssj : Tools::nowTime();
|
||||
//m_StartTime = GetCurrentTime2();
|
||||
@ -667,7 +656,7 @@ bool ExamCarSub3::Init_KM3_Global()
|
||||
//examItem->TestPro = ItemProFlagIdle;
|
||||
//examItem->FinishFlag = true;
|
||||
examItem->NoID = true;
|
||||
KM3EndItem(itemNo,true,false);
|
||||
KM3EndItem(itemNo,false,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,6 @@ public:
|
||||
public: //for IExamCar override
|
||||
virtual ErrorCode examCarInitInfo(TInitInfo* info) override;
|
||||
virtual ErrorCode examBeginExam() override;
|
||||
virtual ErrorCode examGoonExam() override;
|
||||
virtual ErrorCode examEndExam() override;
|
||||
virtual ErrorCode examJudgeExam() override;
|
||||
virtual ErrorCode examArtifMark(ExamItemCode itemno, const std::string& serial, MarkType type) override;
|
||||
|
||||
@ -107,12 +107,6 @@ int IExamCar::examJudgeBeginExam(const char* data, int len)
|
||||
{
|
||||
return QE((ErrorCode)errCode);
|
||||
}
|
||||
//处理断点续考
|
||||
errCode = examGoonExam();
|
||||
if(errCode != codeSuccess)
|
||||
{
|
||||
return QE((ErrorCode)errCode);
|
||||
}
|
||||
|
||||
m_examState = examStateIng;
|
||||
logtrace("begin-exam success %s", target().c_str());
|
||||
|
||||
@ -122,7 +122,6 @@ public:
|
||||
public:
|
||||
virtual ErrorCode examCarInitInfo(TInitInfo* info) = 0;
|
||||
virtual ErrorCode examBeginExam() = 0;
|
||||
virtual ErrorCode examGoonExam() = 0;
|
||||
virtual ErrorCode examEndExam() = 0;
|
||||
virtual ErrorCode examJudgeExam() = 0;
|
||||
virtual ErrorCode examArtifMark(ExamItemCode itemno, const std::string& serial, MarkType type) = 0;
|
||||
|
||||
@ -325,7 +325,8 @@ void Sub2Judge00Dcrk::divorcedItemArea()
|
||||
bool out = ((!in0 && in1) || !pureCarInItemArea()); //阶段10,后轮先不在项目区域结束项目,然后才会走道这里
|
||||
#else
|
||||
//bool out = (!pureCarInItemArea());
|
||||
bool out = pureCarTouchSoloLine(m_model->L12_10(), II(13), 5);
|
||||
bool out = pureCarTouchSoloLines({m_model->L12_10(), m_model->L78_11()}, II(13), 5) &&
|
||||
!pureCarPointInPoly(II(1), m_model->poly1278());
|
||||
#endif
|
||||
if(out)
|
||||
{
|
||||
|
||||
@ -166,10 +166,19 @@ JUDGE_STAGE_IMPL(Sub2Judge02Pdqb, Sub2PdqbStage0)
|
||||
TGPSPoint pt2 = GpsMath::calcCenterPoint(m_model->P4(), m_model->P7());
|
||||
double gc = FactorySub2Survey->baseGc();
|
||||
int distance = GpsMath::DianXianJL_GPS_CM(p1, pt1, pt2, gc);
|
||||
if(distance < m_800CM)
|
||||
|
||||
const std::string& s629 = TableSysSet->get629();
|
||||
if(s629 == "1")
|
||||
{
|
||||
m_stage = Sub2PdqbStage1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(distance < m_1000CM)
|
||||
{
|
||||
m_stage = Sub2PdqbStage1;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_endLineFlag == true)
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ private:
|
||||
const int m_15CM = 15; //15厘米
|
||||
const int m_30CM = 30; //30厘米
|
||||
const int m_50CM = 50; //50厘米
|
||||
const int m_800CM = 800; //800厘米
|
||||
const int m_1000CM = 1000; //1000厘米
|
||||
};
|
||||
|
||||
#endif // SUB2JUDGE02PDQB_H
|
||||
|
||||
@ -84,11 +84,12 @@ void Sub2Judge05Qxxs::judgeTouchLine()
|
||||
const TGPSPoints& right = m_model->right();
|
||||
if(IS_C1C2C5(m_carType))
|
||||
{
|
||||
//1、车轮压线(存粹车轮) //只用车轮子计算
|
||||
static constexpr int history = 2;
|
||||
const PointSets& wheels = m_car->carModel()->wheelAll();
|
||||
JUDGE_MARK_ITEM_EASY_ONCE(pureCarTouchSomePoints(left, wheels, history), MARK_SUB2_QXXS_61);
|
||||
JUDGE_MARK_ITEM_EASY_ONCE(pureCarTouchSomePoints(right, wheels, history), MARK_SUB2_QXXS_62);
|
||||
//1、车轮压线(纯粹车轮)只用车轮子计算
|
||||
//注意:由于GPS可能漂移不能用这种方式计算,用历史车轮点判断会误判,无锡就出现这种情况 yhy 2025-04-23
|
||||
//static constexpr int history = 2;
|
||||
//const PointSets& wheels = m_car->carModel()->wheelAll();
|
||||
//JUDGE_MARK_ITEM_EASY_ONCE(pureCarTouchSomePoints(left, wheels, history), MARK_SUB2_QXXS_61);
|
||||
//JUDGE_MARK_ITEM_EASY_ONCE(pureCarTouchSomePoints(right, wheels, history), MARK_SUB2_QXXS_62);
|
||||
|
||||
//2、排线和边线相交,也算压线
|
||||
const PointPairs& wind = m_car->carModel()->wheelWindAll();
|
||||
|
||||
@ -558,8 +558,8 @@ JUDGE_CXX_API const char* stage2Describe(Sub2CftcStage code);
|
||||
#define MARK_SUB2_PDQB_203 "203"
|
||||
#define MARK_SUB2_PDQB_41 "41"
|
||||
#define EnumMakeSub2PdqbStage(declare) \
|
||||
declare(Sub2PdqbStage0, "", JUDGE_UTF8S("距离停车标杆大于8米")) \
|
||||
declare(Sub2PdqbStage1, "", JUDGE_UTF8S("到达标杆8米处,未停车")) \
|
||||
declare(Sub2PdqbStage0, "", JUDGE_UTF8S("距离停车标杆大于10米")) \
|
||||
declare(Sub2PdqbStage1, "", JUDGE_UTF8S("到达标杆10米处,未停车")) \
|
||||
declare(Sub2PdqbStage2, "", JUDGE_UTF8S("停车未起步阶段")) \
|
||||
declare(Sub2PdqbStage3, "", JUDGE_UTF8S("坡道起步阶段(后轮到达8,9位置结束)"))
|
||||
enum Sub2PdqbStage{ EnumMakeSub2PdqbStage(ENUM_SELECT_1_CMD_3) Sub2PdqbStageUnknown };
|
||||
|
||||
@ -457,9 +457,9 @@ struct TStuInfo
|
||||
int64 kskssj = 0; //考试开始时间 1970年到现在的毫秒数 "2023-03-21 10:05:23"
|
||||
std::vector<TItemExam> ksxm = {}; //监管返回本次考试所需项目 2023-04-24 杨海洋修改
|
||||
std::vector<int32> ykxm = {}; //已考项目 "1,3" 对应枚举 ExamItemCode DuanDian_FinishItems
|
||||
std::vector<TKfXm> kfxm = {}; //扣分项目 "20,01;" 对应枚举 ExamItemCode DuanDian_Marks
|
||||
int8 ddxk = 0; //是否断点续考,(0-否 1-是)
|
||||
int64 ddkssj = 0; //考试中断那次考试开始考试时间 1970年到现在的毫秒数
|
||||
std::vector<TKfXm> kfxm = {}; //扣分项目 "20,01;" 对应枚举 ExamItemCode DuanDian_Marks
|
||||
int32 yklc = 0; //已考里程,单位厘米
|
||||
|
||||
int8 sczb = 0; //CS_Finish_SCZB_Flag:Boolan; //考前绕车一周(初始完成上车准备标志)(外壳传递的)Boolan
|
||||
|
||||
13
entry/src/main/cpp/svngit.bat
Normal file
13
entry/src/main/cpp/svngit.bat
Normal file
@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
REM 设置控制台代码页为UTF-8
|
||||
chcp 65001
|
||||
@REM 先svn拉取
|
||||
@echo 正在拉取svn代码...
|
||||
svn update
|
||||
@REM git提交
|
||||
@echo 正在提交git代码...
|
||||
git add .
|
||||
git commit -m "脚本提交的代码"
|
||||
git push
|
||||
@echo 操作完成
|
||||
pause
|
||||
@ -19,7 +19,7 @@
|
||||
#define KIT_VERSION_MAJOR 1
|
||||
#define KIT_VERSION_MINOR 0
|
||||
#define KIT_VERSION_PATCH 2
|
||||
#define KIT_VERSION_STAMP "2504191102b"
|
||||
#define KIT_VERSION_STAMP "2504241048b"
|
||||
|
||||
#define KIT_VERSION_STR JUDGE_STR(KIT_VERSION_MAJOR.KIT_VERSION_MINOR.KIT_VERSION_PATCH)
|
||||
|
||||
|
||||
@ -114,8 +114,18 @@ QString addContent(QString& out, const QString& name, const QString& info)
|
||||
}
|
||||
|
||||
void setStyleComboBox(QComboBox* combo, int count, int width)
|
||||
{
|
||||
constexpr static bool Fusion = true;
|
||||
if(Fusion)
|
||||
{
|
||||
combo->setStyle(QStyleFactory::create("Fusion"));
|
||||
combo->setStyleSheet("QComboBox { combobox-popup: 0; }");
|
||||
combo->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
}
|
||||
else
|
||||
{
|
||||
combo->setStyle(QStyleFactory::create("Windows"));
|
||||
}
|
||||
combo->setMaxVisibleItems(count);
|
||||
combo->view()->setMinimumWidth(width);
|
||||
}
|
||||
|
||||
@ -45,6 +45,10 @@
|
||||
#include <QListWidgetItem>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QStandardItem>
|
||||
#include <QStandardItemModel>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QStyleOptionViewItem>
|
||||
#include <QQueue>
|
||||
#include <QScrollArea>
|
||||
#include <QScrollBar>
|
||||
|
||||
@ -71,15 +71,7 @@ void MainWindow::init()
|
||||
KIT_CONNECT(updateNextDoing());
|
||||
KIT_CONNECT(updateCheckVersion(int, const QString&));
|
||||
|
||||
//connect(&m_audio, SIGNAL(QMediaPlayer::error(QMediaPlayer::Error)),
|
||||
// SLOT([&](QMediaPlayer::Error error)
|
||||
// {
|
||||
// QMediaPlayer::Error err = m_audio.error();
|
||||
// QString errStr = m_audio.errorString();
|
||||
//
|
||||
// logwarning("paly-audio file:%s, err:%d-%s ",
|
||||
// filepath.toUtf8().data(), err, errStr.toUtf8().data());
|
||||
// }));
|
||||
connect(&m_audio, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(slot_soundError(QMediaPlayer::Error)));
|
||||
|
||||
m_ui->loop->clear();
|
||||
m_ui->loop->addItem(CL8("否"), false);
|
||||
@ -148,8 +140,9 @@ void MainWindow::init()
|
||||
//QString addr = kit::getMacAddress();
|
||||
//std::string md5s = Tools::md5sum(addr.toLocal8Bit().data());
|
||||
//logtrace("uuid=[%s][%s]", addr.toUtf8().data(), md5s.data());
|
||||
logtrace("version-sdk=[%s][%s][%s]", JUDGE_VERSION_STR, JUDGE_VERSION_INFO, examJudgeVersion());
|
||||
logtrace("version-kit=[%s]", KIT_VERSION_INFO);
|
||||
logtrace("version-sdk=[%s][%s][%s],version-toolkit=[%s]",
|
||||
JUDGE_VERSION_STR, JUDGE_VERSION_INFO, examJudgeVersion(),
|
||||
KIT_VERSION_INFO);
|
||||
|
||||
}
|
||||
|
||||
@ -638,6 +631,13 @@ void MainWindow::updateCheckVersion(int state, const QString& info)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slot_soundError(QMediaPlayer::Error error)
|
||||
{
|
||||
QMediaPlayer::Error err = m_audio.error();
|
||||
QString errStr = m_audio.errorString();
|
||||
logwarning("play-audio err:%d-%d-%s", err, error, errStr.toUtf8().data());
|
||||
}
|
||||
|
||||
void MainWindow::on_btnClearLog_clicked()
|
||||
{
|
||||
m_logInfo->resetLog();
|
||||
@ -851,19 +851,12 @@ void MainWindow::on_displaySwitch_clicked()
|
||||
{
|
||||
m_realExam->switchDisplay();
|
||||
|
||||
//CpuOccupyInfo occ;
|
||||
//
|
||||
//bool usage = Tools::peerOccupyCpu(occ);
|
||||
//int cores = Tools::getCpuProcessors();
|
||||
//logtrace("CPU Usage:%0.4f cores=%d ", usage, cores);
|
||||
|
||||
const char* data = examPeerOccupy();
|
||||
TOccupyInfo occ;
|
||||
if(!XParser::fromAny(data, occ))
|
||||
{
|
||||
return;
|
||||
}
|
||||
logtrace("occupy=%s", data);
|
||||
examFreeMemory(data);
|
||||
return;
|
||||
//const char* data = examPeerOccupy();
|
||||
//TOccupyInfo occ;
|
||||
//if(!XParser::fromAny(data, occ))
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
//logtrace("occupy=%s", data);
|
||||
//examFreeMemory(data);
|
||||
}
|
||||
|
||||
@ -86,7 +86,8 @@ private slots: //Q_SLOTS
|
||||
void updateNextDoing();
|
||||
void updateCheckVersion(int state, const QString& info);
|
||||
|
||||
private slots:
|
||||
void slot_soundError(QMediaPlayer::Error error);
|
||||
|
||||
void on_btnClearLog_clicked();
|
||||
void on_btnSelectTrackFile_clicked();
|
||||
void on_btnRunning_clicked();
|
||||
|
||||
@ -68,10 +68,10 @@ background-color: rgb(255, 255, 255);</string>
|
||||
<widget class="QPushButton" name="btnSelectTrackFile">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1530</x>
|
||||
<x>1534</x>
|
||||
<y>790</y>
|
||||
<width>44</width>
|
||||
<height>26</height>
|
||||
<width>42</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -81,10 +81,10 @@ background-color: rgb(255, 255, 255);</string>
|
||||
<widget class="QTextEdit" name="outputLog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>932</x>
|
||||
<x>933</x>
|
||||
<y>644</y>
|
||||
<width>642</width>
|
||||
<height>143</height>
|
||||
<height>144</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
@ -106,7 +106,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QPushButton" name="btnClearLog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1500</x>
|
||||
<x>1502</x>
|
||||
<y>616</y>
|
||||
<width>73</width>
|
||||
<height>26</height>
|
||||
@ -413,7 +413,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>180</y>
|
||||
<width>111</width>
|
||||
<width>121</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -426,7 +426,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>163</y>
|
||||
<width>111</width>
|
||||
<width>121</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -580,7 +580,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QPushButton" name="btnRunning">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1500</x>
|
||||
<x>1502</x>
|
||||
<y>495</y>
|
||||
<width>73</width>
|
||||
<height>28</height>
|
||||
@ -635,9 +635,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>4</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -660,9 +660,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>38</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -685,9 +685,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>38</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -710,9 +710,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>72</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -735,9 +735,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>72</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -760,9 +760,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>106</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -785,9 +785,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>106</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -810,9 +810,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>140</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -835,9 +835,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>140</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -860,9 +860,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>174</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -885,9 +885,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>174</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -913,9 +913,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>208</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -938,9 +938,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>208</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -963,9 +963,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>242</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -988,9 +988,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>276</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1013,9 +1013,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>310</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1038,9 +1038,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>242</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1063,9 +1063,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>276</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1088,9 +1088,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>310</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1115,7 +1115,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>2</x>
|
||||
<y>644</y>
|
||||
<width>710</width>
|
||||
<width>717</width>
|
||||
<height>174</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1144,9 +1144,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>344</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1169,9 +1169,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>344</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1194,9 +1194,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>377</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1219,9 +1219,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>824</x>
|
||||
<x>827</x>
|
||||
<y>377</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1244,9 +1244,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>780</x>
|
||||
<x>786</x>
|
||||
<y>416</y>
|
||||
<width>51</width>
|
||||
<width>48</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1263,7 +1263,7 @@ p, li { white-space: pre-wrap; }
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Arial'; font-size:10pt; font-weight:600; font-style:normal;">
|
||||
<p align="center" dir='rtl' style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="item00">
|
||||
@ -1272,9 +1272,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>4</y>
|
||||
<width>101</width>
|
||||
<width>98</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1474,9 +1474,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="Line" name="borderBottom_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>715</x>
|
||||
<x>722</x>
|
||||
<y>402</y>
|
||||
<width>215</width>
|
||||
<width>206</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1529,7 +1529,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLineEdit" name="playTimes">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1500</x>
|
||||
<x>1502</x>
|
||||
<y>526</y>
|
||||
<width>73</width>
|
||||
<height>28</height>
|
||||
@ -1542,7 +1542,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="cg_dcj_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1448</x>
|
||||
<x>1450</x>
|
||||
<y>527</y>
|
||||
<width>51</width>
|
||||
<height>30</height>
|
||||
@ -1555,7 +1555,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="cg_dcj_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>420</y>
|
||||
<width>61</width>
|
||||
<height>21</height>
|
||||
@ -1570,7 +1570,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>933</x>
|
||||
<y>790</y>
|
||||
<width>592</width>
|
||||
<width>596</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1597,7 +1597,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="cg_dcj_9">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1448</x>
|
||||
<x>1450</x>
|
||||
<y>557</y>
|
||||
<width>51</width>
|
||||
<height>26</height>
|
||||
@ -1610,7 +1610,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QComboBox" name="loop">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1500</x>
|
||||
<x>1502</x>
|
||||
<y>557</y>
|
||||
<width>73</width>
|
||||
<height>26</height>
|
||||
@ -1635,7 +1635,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>277</y>
|
||||
<width>315</width>
|
||||
<width>322</width>
|
||||
<height>2</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1646,7 +1646,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="Line" name="borderRight_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>705</x>
|
||||
<x>712</x>
|
||||
<y>2</y>
|
||||
<width>20</width>
|
||||
<height>810</height>
|
||||
@ -1662,9 +1662,9 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>714</x>
|
||||
<x>721</x>
|
||||
<y>644</y>
|
||||
<width>216</width>
|
||||
<width>209</width>
|
||||
<height>174</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1699,9 +1699,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="pe_markGrade">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>450</y>
|
||||
<width>161</width>
|
||||
<width>171</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1712,9 +1712,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QSlider" name="playSlider">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>939</x>
|
||||
<y>592</y>
|
||||
<width>550</width>
|
||||
<x>934</x>
|
||||
<y>590</y>
|
||||
<width>562</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1877,9 +1877,9 @@ QSlider::sub-page:horizontal
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>835</x>
|
||||
<x>838</x>
|
||||
<y>416</y>
|
||||
<width>88</width>
|
||||
<width>86</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -2051,7 +2051,7 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>536</x>
|
||||
<y>286</y>
|
||||
<width>171</width>
|
||||
<width>176</width>
|
||||
<height>334</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -2068,9 +2068,9 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="Line" name="borderRight_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>520</x>
|
||||
<x>526</x>
|
||||
<y>278</y>
|
||||
<width>20</width>
|
||||
<width>10</width>
|
||||
<height>366</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -2119,7 +2119,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QLabel" name="perform">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>720</x>
|
||||
<x>726</x>
|
||||
<y>472</y>
|
||||
<width>201</width>
|
||||
<height>106</height>
|
||||
@ -2158,10 +2158,10 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QTableWidget" name="radarTable">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>4</x>
|
||||
<x>2</x>
|
||||
<y>428</y>
|
||||
<width>392</width>
|
||||
<height>212</height>
|
||||
<width>394</width>
|
||||
<height>214</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
@ -2232,7 +2232,7 @@ p, li { white-space: pre-wrap; }
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>显示切换</string>
|
||||
<string>切换显示</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
@ -7,6 +7,25 @@ ChoiceTrackFile::ChoiceTrackFile(MainWindow* mWindow)
|
||||
m_replay = mWindow->getReplay();
|
||||
m_ui = mWindow->getUI();
|
||||
kit::setStyleComboBox(m_ui->trackFiles, 20, m_ui->trackFiles->width());
|
||||
|
||||
if(kit::authAllowable())
|
||||
{
|
||||
bool delegate = false;
|
||||
#ifndef JUDGE_OS_WIN
|
||||
delegate = true;
|
||||
#endif
|
||||
if(delegate)
|
||||
{
|
||||
// 设置自定义委托
|
||||
m_delegate = __KIT_NEW__(ChoiceDelegate, m_ui->trackFiles);
|
||||
m_ui->trackFiles->setItemDelegate(m_delegate);
|
||||
// 连接按钮点击信号到槽函数
|
||||
QObject::connect(m_delegate, &ChoiceDelegate::buttonClicked, [&](const QModelIndex& index)
|
||||
{
|
||||
this->operateItem(index); // 此处可执行删除项或其他操作
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChoiceTrackFile::~ChoiceTrackFile()
|
||||
@ -14,16 +33,16 @@ ChoiceTrackFile::~ChoiceTrackFile()
|
||||
m_mWindow = nullptr;
|
||||
m_replay = nullptr;
|
||||
m_ui = nullptr;
|
||||
|
||||
__KIT_DEL__(m_delegate);
|
||||
}
|
||||
|
||||
void ChoiceTrackFile::selectTrackFile()
|
||||
{
|
||||
QString filter = CL8("轨迹文件1(%1.*);;轨迹文件2(*%2);;全部文件(*.*)").arg(KIT_TRACK_FILE).arg( TRACK_SUFFIX);
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(m_mWindow, CL8("选择轨迹文件"),
|
||||
QCoreApplication::applicationDirPath(),
|
||||
filter);
|
||||
|
||||
if(!filename.isEmpty() && QFile::exists(filename))
|
||||
{
|
||||
addTrackFile(filename);
|
||||
@ -88,7 +107,7 @@ void ChoiceTrackFile::addTrackFile(const QString& filepath)
|
||||
static int s_width = 0;
|
||||
s_width = std::max(s_width, font.width(filepath));
|
||||
int w = m_ui->trackFiles->width();
|
||||
trackView->setMinimumWidth(std::max(s_width, w) + 40);
|
||||
trackView->setMinimumWidth(std::max(s_width, w) + 60);
|
||||
}
|
||||
|
||||
void ChoiceTrackFile::loadTrackFiles(const QString& dirpath)
|
||||
@ -139,3 +158,55 @@ QString ChoiceTrackFile::trackFiles_highlighted(int index)
|
||||
QString data = m_ui->trackFiles->itemData(index).toString();
|
||||
return data;
|
||||
}
|
||||
|
||||
void ChoiceTrackFile::operateItem(const QModelIndex& index)
|
||||
{
|
||||
int idx = index.row();
|
||||
TASSERT_VOID(idx >= 0 && idx < m_ui->trackFiles->count(), "");
|
||||
|
||||
QString text = m_ui->trackFiles->itemText(idx);
|
||||
QString data = m_ui->trackFiles->itemData(idx).toString();
|
||||
|
||||
QDir dir = QFileInfo(text).absoluteDir();
|
||||
QDir dirPrev = QFileInfo(dir.path()).absoluteDir();
|
||||
QString affirm = CL8("确定删除轨迹:") + dir.path() + CL8("/???");
|
||||
int id = QMessageBox::question(m_mWindow, CL8("提示"), affirm, CL8("删除当前"), CL8("删除上一层"), CL8("取消删除"));
|
||||
//int id = 0;
|
||||
if(0 == id)
|
||||
{
|
||||
m_ui->trackFiles->removeItem(idx);
|
||||
dir.removeRecursively();
|
||||
logdebug("remove current path=%s", dir.path().toUtf8().data());
|
||||
|
||||
if(dirPrev.isEmpty(QDir::AllEntries | QDir::NoDotAndDotDot))
|
||||
{
|
||||
dirPrev.removeRecursively();
|
||||
logtrace("remove prev path=%s", dirPrev.path().toUtf8().data());
|
||||
}
|
||||
}
|
||||
else if(1 == id)
|
||||
{
|
||||
for(int i = 0; i < m_ui->trackFiles->count(); i++)
|
||||
{
|
||||
QString text_ = m_ui->trackFiles->itemText(i);
|
||||
QString data_ = m_ui->trackFiles->itemData(i).toString();
|
||||
|
||||
QDir dir_ = QFileInfo(text_).absoluteDir();
|
||||
QDir dirPrev_ = QFileInfo(dir_.path()).absoluteDir();
|
||||
if(dirPrev_.path() == dirPrev.path())
|
||||
{
|
||||
m_ui->trackFiles->removeItem(i);
|
||||
dir_.removeRecursively();
|
||||
logdebug("remove current path=%s", dir_.path().toUtf8().data());
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
if(dirPrev.isEmpty(QDir::AllEntries | QDir::NoDotAndDotDot))
|
||||
{
|
||||
dirPrev.removeRecursively();
|
||||
logtrace("remove prev path=%s", dirPrev.path().toUtf8().data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef CHOICETRACKFILE_H
|
||||
#define CHOICETRACKFILE_H
|
||||
|
||||
|
||||
#include "HToolkit.h"
|
||||
#include "IToolkit.h"
|
||||
#include "ReplayWrapper.h"
|
||||
@ -9,6 +8,7 @@
|
||||
class MainWindow;
|
||||
namespace Ui { class MainWindow; }
|
||||
|
||||
class ChoiceDelegate;
|
||||
class ChoiceTrackFile
|
||||
{
|
||||
public:
|
||||
@ -24,10 +24,56 @@ public:
|
||||
QString trackFiles_currentIndexChanged(int index);
|
||||
QString trackFiles_highlighted(int index);
|
||||
|
||||
void operateItem(const QModelIndex& index);
|
||||
private:
|
||||
ReplayWrapper* m_replay = nullptr;
|
||||
Ui::MainWindow* m_ui = nullptr;
|
||||
MainWindow* m_mWindow = nullptr;
|
||||
ChoiceDelegate* m_delegate = nullptr;
|
||||
};
|
||||
|
||||
class ChoiceDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ChoiceDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent)
|
||||
{
|
||||
|
||||
}
|
||||
virtual ~ChoiceDelegate()
|
||||
{
|
||||
|
||||
}
|
||||
// 重写绘制方法
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override
|
||||
{
|
||||
QStyledItemDelegate::paint(painter, option, index); // 绘制默认内容(文本/图标)
|
||||
QRect btnRect = option.rect.adjusted(option.rect.width() - 35, 1, -1, -1); // 定义按钮区域(右侧 20x20 区域)
|
||||
QStyleOptionButton button; // 绘制按钮样式
|
||||
button.rect = btnRect;
|
||||
button.text = CL8("删除"); // 按钮显示为关闭符号
|
||||
button.state = QStyle::State_Enabled;
|
||||
QApplication::style()->drawControl(QStyle::CE_PushButton, &button, painter); //渲染按钮
|
||||
}
|
||||
// 重写事件处理
|
||||
bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index) override
|
||||
{
|
||||
if(event->type() == QEvent::MouseButtonPress)
|
||||
{
|
||||
QMouseEvent* mev = static_cast<QMouseEvent*>(event);
|
||||
QRect btnRect = option.rect.adjusted(option.rect.width() - 35, 1, -1, -1);
|
||||
if(btnRect.contains(mev->pos())) // 判断是否点击了按钮区域
|
||||
{
|
||||
emit buttonClicked(index); // 触发自定义信号
|
||||
return true; // 事件已处理
|
||||
}
|
||||
}
|
||||
return QStyledItemDelegate::editorEvent(event, model, option, index);
|
||||
}
|
||||
|
||||
signals:
|
||||
// 自定义信号:按钮被点击时触发,传递项的索引
|
||||
void buttonClicked(const QModelIndex& index);
|
||||
};
|
||||
|
||||
#endif // CHOICETRACKFILE_H
|
||||
|
||||
@ -12,6 +12,7 @@ ShowBeginExam::ShowBeginExam(MainWindow* mWindow)
|
||||
m_ui->item06,m_ui->item07,m_ui->item08,m_ui->item09,m_ui->item10,m_ui->item11,
|
||||
m_ui->item12,m_ui->item13,m_ui->item14,m_ui->item15,m_ui->item16,m_ui->item17,
|
||||
m_ui->item18,m_ui->item19,m_ui->item20,m_ui->item21,m_ui->item22,m_ui->item23};
|
||||
|
||||
}
|
||||
|
||||
ShowBeginExam::~ShowBeginExam()
|
||||
@ -115,7 +116,7 @@ void ShowBeginExam::updateBeginExam(const QString& info)
|
||||
}
|
||||
else
|
||||
{
|
||||
TASSERT(value.ddkssj == 0 && value.yklc == 0 && value.kfxm.empty(), "");
|
||||
TASSERT(value.ddkssj == 0 && value.yklc == 0, "");
|
||||
}
|
||||
|
||||
if(value.sczb)
|
||||
|
||||
@ -25,8 +25,8 @@ void ShowInitExam::updateInitExam(const QString& info)
|
||||
|
||||
m_ui->initData->clear();
|
||||
TASSERT(m_ui->initData->count() == 0, "");
|
||||
m_ui->initData->addItem(CL8("评判版本号:") + value.sdkver.c_str(), JUDGE_STR(sdkver));
|
||||
m_ui->initData->addItem(CL8("外壳版本号:") + value.appver.c_str(), JUDGE_STR(appver));
|
||||
m_ui->initData->addItem(CL8("评判版本:") + value.sdkver.c_str(), JUDGE_STR(sdkver));
|
||||
m_ui->initData->addItem(CL8("外壳版本:") + value.appver.c_str(), JUDGE_STR(appver));
|
||||
m_ui->initData->addItem(CL8("考试科目:") + subject, JUDGE_STR(subject));
|
||||
m_ui->initData->addItem(CL8("考车号码:") + kit::toString(value.kchm) + CL8("号车"), JUDGE_STR(kchm));
|
||||
m_ui->initData->addItem(CL8("考试车型:") + value.kscx.c_str(), JUDGE_STR(kscx));
|
||||
|
||||
@ -26,7 +26,7 @@ import { examJudgeVersion } from './judgeSDK/api';
|
||||
@Component
|
||||
struct Index {
|
||||
@State carNum: string = ''
|
||||
@State version: string = '2025.04.23.01'
|
||||
@State version: string = '2025.04.24.01'
|
||||
@State judgeVersion: string = ''
|
||||
@State url: string = ''
|
||||
@State hasAuth: boolean = false;
|
||||
|
||||
@ -352,12 +352,17 @@ struct Index {
|
||||
//项目开始数据是否上传过
|
||||
isUpload,
|
||||
}
|
||||
// 夜考时
|
||||
if (this.mode === 2 && no2 != 13) {
|
||||
currentProject.ykType = isRequired ? "1" : "3"
|
||||
currentProject.isEnd = !allItems.includes(no2 + '')
|
||||
}
|
||||
this.projectsObj[no2*1] = currentProject
|
||||
this.projectsCenterObj[txt2] = currentProject
|
||||
this.projects.push(currentProject);
|
||||
|
||||
//真实监管下发考试项目
|
||||
if (isInExam && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) {
|
||||
// 真实监管下发考试项目, 夜考模式、满分学习不进此逻辑
|
||||
if (isInExam && this.mode !== 2 && this.mode !== 5 && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) {
|
||||
this.projectsObj[no2*1].type = '3'
|
||||
this.projectsObj[no2*1].isUpload = true
|
||||
this.projectsObj[no2*1].isEnd = true
|
||||
@ -1039,19 +1044,14 @@ struct Index {
|
||||
switch (type) {
|
||||
case '1':
|
||||
return '#E6DECF';
|
||||
break;
|
||||
case '2':
|
||||
return '#FFAD33';
|
||||
break;
|
||||
case '3':
|
||||
return '#ff109d0a';
|
||||
break;
|
||||
case '4':
|
||||
return '#FF7566';
|
||||
break;
|
||||
case '5':
|
||||
return '#FF7566'
|
||||
break;
|
||||
default:
|
||||
return '#E6DECF';
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user