|
|
@ -62,7 +62,7 @@ DialogSetup::DialogSetup(QWidget* parent) : QDialog(parent) {
|
|
|
|
if (!dirinfo->exists()) {
|
|
|
|
if (!dirinfo->exists()) {
|
|
|
|
// 如果文件夹信息不存在
|
|
|
|
// 如果文件夹信息不存在
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
|
g_conf_path.config_path = "D:/conf";
|
|
|
|
g_conf_path.config_path = DEFAULT_CONFPATH_PATH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dirinfo->setNameFilters(QStringList("conf.txt"));
|
|
|
|
dirinfo->setNameFilters(QStringList("conf.txt"));
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
@ -72,7 +72,7 @@ DialogSetup::DialogSetup(QWidget* parent) : QDialog(parent) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// 如果路径空
|
|
|
|
// 如果路径空
|
|
|
|
g_conf_path.config_path = "D:/conf";
|
|
|
|
g_conf_path.config_path = DEFAULT_CONFPATH_PATH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ui.comboBox_config_path->addItem(g_conf_path.config_path);
|
|
|
|
ui.comboBox_config_path->addItem(g_conf_path.config_path);
|
|
|
|
// 更换选择文件
|
|
|
|
// 更换选择文件
|
|
|
@ -119,7 +119,7 @@ DialogSetup::DialogSetup(QWidget* parent) : QDialog(parent) {
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
QString dirPath = "D:/image";
|
|
|
|
QString dirPath = DEFAULT_PIC_SAVE_PATH;
|
|
|
|
QDir* dirinfo = new QDir(dirPath);
|
|
|
|
QDir* dirinfo = new QDir(dirPath);
|
|
|
|
if (!dirinfo->exists())
|
|
|
|
if (!dirinfo->exists())
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
|
delete dirinfo, dirinfo = nullptr;
|
|
|
@ -354,7 +354,7 @@ void DialogSetup::on_toolButton_choose_config_path_released() {
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
// 点击取消按钮
|
|
|
|
// 点击取消按钮
|
|
|
|
if (g_conf_path.config_path.isEmpty())
|
|
|
|
if (g_conf_path.config_path.isEmpty())
|
|
|
|
dirName = "D:/conf";
|
|
|
|
dirName = DEFAULT_CONFPATH_PATH;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dirName = g_conf_path.config_path;
|
|
|
|
dirName = g_conf_path.config_path;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -367,7 +367,7 @@ void DialogSetup::on_toolButton_choose_config_path_released() {
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
|
|
|
|
|
|
|
|
|
if (fileList.count() == 0) {
|
|
|
|
if (fileList.count() == 0) {
|
|
|
|
dirName = "D:/conf";
|
|
|
|
dirName = DEFAULT_CONFPATH_PATH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//fileList.removeOne(".");
|
|
|
|
//fileList.removeOne(".");
|
|
|
@ -395,7 +395,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
|
|
|
|
|
|
|
|
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
if (g_sys_conf.model_path.isEmpty())
|
|
|
|
if (g_sys_conf.model_path.isEmpty())
|
|
|
|
dirName = "D:/model";
|
|
|
|
dirName = DEFAULT_MODEL_PATH;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dirName = g_sys_conf.model_path;
|
|
|
|
dirName = g_sys_conf.model_path;
|
|
|
|
|
|
|
|
|
|
|
@ -409,7 +409,7 @@ void DialogSetup::on_toolButton_choose_model_path_released() {
|
|
|
|
dirinfo->setNameFilters(QStringList("*.weights"));
|
|
|
|
dirinfo->setNameFilters(QStringList("*.weights"));
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
|
QStringList fileList = dirinfo->entryList(QDir::Files);
|
|
|
|
if (fileList.count() == 0) {
|
|
|
|
if (fileList.count() == 0) {
|
|
|
|
g_sys_conf.model_path = "D:/model";
|
|
|
|
g_sys_conf.model_path = DEFAULT_MODEL_PATH;
|
|
|
|
g_sys_conf.model_name = "jd.weights";
|
|
|
|
g_sys_conf.model_name = "jd.weights";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -432,7 +432,7 @@ void DialogSetup::on_toolButton_choose_save_pics_path_released() {
|
|
|
|
// 如果没有选择路径
|
|
|
|
// 如果没有选择路径
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
if (dirName.isEmpty()) {
|
|
|
|
if (g_conf_path.save_pics_path.isEmpty())
|
|
|
|
if (g_conf_path.save_pics_path.isEmpty())
|
|
|
|
dirName = "D:/image";
|
|
|
|
dirName = DEFAULT_PIC_SAVE_PATH;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
dirName = g_conf_path.save_pics_path;
|
|
|
|
dirName = g_conf_path.save_pics_path;
|
|
|
|
//ui.comboBox_save_pics_path->addItem(dirName);
|
|
|
|
//ui.comboBox_save_pics_path->addItem(dirName);
|
|
|
@ -472,7 +472,7 @@ void DialogSetup::on_toolButton_choose_path_jpg_released() {
|
|
|
|
void DialogSetup::write_pswd()
|
|
|
|
void DialogSetup::write_pswd()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::fstream cfg_file;
|
|
|
|
std::fstream cfg_file;
|
|
|
|
cfg_file.open("D:/Release/pswd.txt", std::ios::out | std::ios::trunc);
|
|
|
|
cfg_file.open("pswd.txt", std::ios::out | std::ios::trunc);
|
|
|
|
if (cfg_file.good())
|
|
|
|
if (cfg_file.good())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
char buf[256];
|
|
|
@ -485,7 +485,7 @@ void DialogSetup::write_pswd()
|
|
|
|
void DialogSetup::write_pswd_op()
|
|
|
|
void DialogSetup::write_pswd_op()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::fstream cfg_file;
|
|
|
|
std::fstream cfg_file;
|
|
|
|
cfg_file.open("D:/Release/pswd_op.txt", std::ios::out | std::ios::trunc);
|
|
|
|
cfg_file.open("pswd_op.txt", std::ios::out | std::ios::trunc);
|
|
|
|
if (cfg_file.good())
|
|
|
|
if (cfg_file.good())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
char buf[256];
|
|
|
|