代码拉取完成,页面将自动刷新
#include "Setting.h"
#include <QDataStream>
#include <QApplication>
#include <QFile>
QDataStream &operator << (QDataStream &s, const Setting ¶m)
{
s << param.dllType;
s << param.ICDLL_dbtype;
s << param.ICDLL_dbpath;
s << param.V9RF_coid;
s << param.cardType;
s << param.CVR100UD_type;
s << param.CVR100UD_usb;
s << param.CVR100UD_uart;
s << param.RFV42DLL_com;
s << param.RFV42DLL_sysNo;
s << param.ProUSb_coID;
return s;
}
QDataStream &operator >> (QDataStream &s, Setting ¶m)
{
s >> param.dllType;
s >> param.ICDLL_dbtype;
s >> param.ICDLL_dbpath;
s >> param.V9RF_coid;
s >> param.cardType;
s >> param.CVR100UD_type;
s >> param.CVR100UD_usb;
s >> param.CVR100UD_uart;
s >> param.RFV42DLL_com;
s >> param.RFV42DLL_sysNo;
s >> param.ProUSb_coID;
return s;
}
Setting g_setting;
Setting::Setting()
{
dllType = 0;
ICDLL_dbtype = 0;
TPDLL_type = 1;
cardType = 0;
CVR100UD_type = 0;
CVR100UD_usb = 0;
CVR100UD_uart = 0;
RFV42DLL_com = 0;
RFV42DLL_sysNo = 0;
ProUSb_coID = 0;
}
void Setting::save()
{
QString filename = QApplication::applicationDirPath() + "/setting.dat";
QFile file(filename);
if (file.open(QFile::WriteOnly | QFile::Truncate))
{
QDataStream s(&file);
s << *this;
file.close();
}
}
void Setting::load()
{
QString filename = QApplication::applicationDirPath() + "/setting.dat";
QFile file(filename);
if (file.open(QFile::ReadOnly))
{
QDataStream s(&file);
s >> *this;
file.close();
}
if(dllType < 0)
dllType = 0;
if(cardType < 0)
cardType = 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。