-
Notifications
You must be signed in to change notification settings - Fork 0
0919yunhuan_UI总结
2.pro配置结束后,系统会提示mainwindow_slot_rnaread.cpp报错,错误存在于对于mapService字典的录入环节,请进行代码替换,安全起见需要rebuild或者删除gcc文件,没有需要动脑的地方,唯一需要注意的是3030e空调,制冷状态需要一次二次调用
3.接下来程序会跑起来,但是要沿着mapService向外层寻找流向,可以找到mainwindow_timerslot_changeltddate.cpp中的MyLTDDataWidget->serviceLtdDataWidget_newupdate(),其作为了函数参数,函数的本地存在于ltddatawidgetservice.cpp。
3.1从中可以发现,kt会分为两个(kt1,kt2),是因为有些显示的值为float,有些为字符串,这次只保留了回风温度,要注意,只保留了回风温度,但是需要把删除的那两个变量注释掉,有助于下一步修改,运行后,才会提示datawidget中的painEvent的错误
5.datawidget中发现了slot_resetonline,是一个很“遥远的函数”设置页面的clickbox发生改变时,会触发这个函数,但是却很整洁干净的完成了修改当前设置,以及setting.ini的所有功能
connect(myLtdsettingPage,SIGNAL(sig_toltdwidgetforresetallonline(QString)),MyLTDDataWidget,SLOT(slot_resetonline(QString))); connect(myLtdsettingPage,SIGNAL(sig_toltdwidgetforresetallonline(QString)),this,SLOT(slot_ResetMSGfactory(QString)));
setting_page.cpp 175-180: connect(mySetting_Detail,SIGNAL(sig_toltdwidgetforresetallonline(QString)),this,SIGNAL(sig_toltdwidgetforresetallonline(QString))); setting_detail.cpp 1165-1170: void Setting_Detail::slot_ResetALLCBOX(){ sig_toltdwidgetforresetallonline(sender()->objectName()); }
引出了void Setting_Detail::slot_ResetALLCBOX(),但是到这里其实也不需要担心了,因为settingdetail和settingpage都是最新替换的,所以只有mainwindow.cpp 155-160需要添加 这个和setting.cpp的移植同步做
(mainwindow155-160) setting.cpp已经移植过了
将slot_resetonline(QString)与信号cao链接后 运行会出现myltddatawidget.h中 bool onlinewsd =true; bool onlinesj =true; bool onlineyg =true; bool onlinetc =true; bool onlinezndb =true; bool onlineups =true; bool onlinekt =true; bool onlinedoor =true; bool onlinebjsz =true; bool onlinejksz =true; 未定义,添加即可
QSettings st("/yunhuan/setting.conf",QSettings::IniFormat); QString s;
if(st.contains(tr("AboutWSD/myQtonlineWSD"))){
s =st.value("AboutWSD/myQtonlineWSD").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinewsd =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinewsd =false;
}
if(st.contains(tr("AboutSJ/myQtonlineSJ"))){
s =st.value("AboutSJ/myQtonlineSJ").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinesj =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinesj =false;
}
if(st.contains(tr("AboutYG/myQtonlineYG"))){
s =st.value("AboutYG/myQtonlineYG").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlineyg =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlineyg =false;
}
if(st.contains(tr("AboutTC/myQtonlineTC"))){
s =st.value("AboutTC/myQtonlineTC").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinetc =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinetc =false;
}
if(st.contains(tr("AboutZNDB/myQtonlineZNDB"))){
s =st.value("AboutZNDB/myQtonlineZNDB").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinezndb =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinezndb =false;
}
if(st.contains(tr("AboutUPS/myQtonlineUPS"))){
s =st.value("AboutUPS/myQtonlineUPS").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlineups =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlineups =false;
}
if(st.contains(tr("AboutKT/myQtonlineKT"))){
s =st.value("AboutKT/myQtonlineKT").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinekt =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinekt =false;
}
if(st.contains(tr("AboutBJSZ/myQtonlineBJSZ"))){
s =st.value("AboutBJSZ/myQtonlineBJSZ").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinebjsz =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinebjsz =false;
}
if(st.contains(tr("AboutJKSZ/myQtonlineJKSZ"))){
s =st.value("AboutJKSZ/myQtonlineJKSZ").toString();
if(s.compare("open")==0||s.compare("openlock")==0)
onlinejksz =true;
if(s.compare("close")==0||s.compare("closelock")==0)
onlinejksz =false;
}
painter.setPen(Qt::white);
foreImg.load("/root/basic_cricle_green_simple.png");
foreImg =foreImg.scaled(basic_size/*,Qt::IgnoreAspectRatio,Qt::SmoothTransformation*/);
painter.drawPixmap(1024+1024-40-120,40,foreImg);
}else if(maxwsdsd<coreFlSd[2]||minwsdsd>=coreFlSd[2]){
painter.setPen(Qt::red);
foreImg.load("/root/basic_cricle_red_simple.png");
foreImg =foreImg.scaled(basic_size/*,Qt::IgnoreAspectRatio,Qt::SmoothTransformation*/);
painter.drawPixmap(1024+1024-40-120,40,foreImg);
}else{
painter.setPen(Qt::white);
foreImg.load("/root/basic_cricle_green_simple.png");
foreImg =foreImg.scaled(basic_size/*,Qt::IgnoreAspectRatio,Qt::SmoothTransformation*/);
painter.drawPixmap(1024+1024-40-120,40,foreImg);
}
painter.setFont(fontheiti);
if(!onlinewsd){
painter.drawText(1024+85+270+270+270,110,"--");
}else if(coreStrSd[2].compare("9999") !=0){
painter.drawText(1024+85+270+270+270,110,coreStrSd[2]+"%");
}
painter.setFont(fontheitismall);
painter.drawText(1024+1024-50-90,200,"后门湿度");
foreImg.load("/root/basic_cricle_green_simple.png");
foreImg =foreImg.scaled(basic_size/*,Qt::IgnoreAspectRatio,Qt::SmoothTransformation*/);
painter.drawPixmap(1024+1024-40-120,40,foreImg)
复制这个即可,里面包涵文字是白还是红,下面的drawtext写好if(!onlinewsd)即可
在修改第一个临时情况时,发现了datawidget中的MyLTDDataWidget->slot_resetonline(QString)中存在两个if(id.compare("ups") ==0)造成了ups的相关设置失效,删除一个后一切正常。好消息是,设置也的锁定是通过修改setting.ini实现的,所以修改起来容易很多很多
1.沿着datawidget中的sig_selftimerWARN向上寻找,在mainwindow中找到:connect(MyLTDDataWidget,SIGNAL(sig_selftimerWARN(QString)),MyLTDYibiaoWidget,SLOT(slot_formSelfTimerWARN(QString)));
沿着slot_formSelfTimerWARN往上寻找,存在着一个分支,一个是通过: mainwindow_warningservice.cpp里void MainWindow::slot_formSelfTimerWARN(QString str)对数据库的0->1的预警操作, 另一个是LTDYibiaoWidget.cpp里void LtdYibiaoWidget::slot_formSelfTimerWARN(QString str)对yibiaowidget的红绿显示操作
if(nodename.compare("kt") ==0){
nodename ="494f3031210304";
}else if(nodename.compare("wsd") ==0){
nodename ="494f3031010304";
}else if(nodename.compare("zndb") ==0){
nodename ="494f3031310308";
}else if(nodename.compare("ups") ==0){
nodename ="494f3031110418";
}else if(nodename.compare("io") ==0){
nodename ="494f3031f10201";
}
将空调的210308改成ek3030e专属的210304
这些都是干嘛的,不太会
test2