1 Star 0 Fork 0

qinxude/rk3568ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
datadictionary.cpp 86.15 KB
一键复制 编辑 原始数据 按行查看 历史
qinxude 提交于 2024-09-06 09:05 . for real 3 camera
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875
#include "datadictionary.h"
QString getIPAddress()
{
QString ipAddress;
QList<QHostAddress> ipAddressesList = QNetworkInterface::allAddresses();
for (int i = 0; i < ipAddressesList.size(); ++i) {
if (ipAddressesList.at(i) != QHostAddress::LocalHost &&
ipAddressesList.at(i).toIPv4Address()) {
ipAddress = ipAddressesList.at(i).toString();
break;
}
}
if (ipAddress.isEmpty())
ipAddress = QHostAddress(QHostAddress::LocalHost).toString();
return ipAddress;
}
uint32_t AlarmIndexToOldAlarm(uint AlarmValue)
{
}
QString GetAlarmSound(int AlarmValue)
{
/**
0-正常;1-力矩报警;2-幅度向内报警;
3-幅度向外报警;4-高度向上报警;5-高度向下报警;
6-回转左限位报警;7-回转右限位报警;8-单机区预防碰撞报警;
9-多机防碰撞报警;10-起重量传感器故障;11-幅度传感器故障;
12-高度传感器故障;13-回转传感器故障;14-风速报警;
15-倾角报警;16-力矩预警;17-幅度向外预警;
18-幅度向内预警;19-高度向上预警;20-高度向下预警;
21-回转左限位预警;22-回转右限位预警;23-单机防碰撞预警;
24-多机防碰撞预警;25-风速预警;26-倾角预警;
27-重量设置错误;28-幅度设置错误;
29-高度设置错误;30-回转设置错误;
31-力矩曲线设置错误;
*/
QString Result = "";
switch (AlarmValue) {
case 1:
Result = "qrc:/Sng/MomentAlarm.wav";
break;
case 16:
Result = "qrc:/Sng/MomentPreAlarm.wav";
break;
case 8:
Result = "qrc:/Sng/SingleCollisionAlarm.wav";
break;
case 23:
Result = "qrc:/Sng/SingleCollisionPreAlarm.wav";
break;
case 2:
Result = "qrc:/Sng/ScopeInsideAlarm.wav";
break;
case 3:
Result = "qrc:/Sng/ScopeOutsideAlarm.wav";
break;
case 17:
Result = "qrc:/Sng/ScopeInsidePreAlarm.wav";
break;
case 18:
Result = "qrc:/Sng/ScopeOutsidePreAlarm.wav";
break;
case 9:
Result = "qrc:/Sng/ManyCollisionAlarm.wav";
break;
case 24:
Result = "qrc:/Sng/ManyCollisionPreAlarm.wav";
break;
case 4:
Result = "qrc:/Sng/HeightUpAlarm.wav";
break;
case 19:
Result = "qrc:/Sng/HeightUpPreAlarm.wav";
break;
case 5:
Result = "qrc:/Sng/HeightDownAlarm.wav";
break;
case 20:
Result = "qrc:/Sng/HeightDownPreAlarm.wav";
break;
case 14:
Result = "qrc:/Sng/WindSpeedAlarm.wav";
break;
case 25:
Result = "qrc:/Sng/WindSpeedPreAlarm.wav";
break;
case 15:
Result = "qrc:/Sng/AngleAlarm.wav";
break;
case 26:
Result = "qrc:/Sng/AnglePreAlarm.wav";
break;
default:
break;
}
return Result;
}
struct Alarm {
uint32_t AlarmIndex;
QString Info;
};
struct Alarm CAlarmSound[] = {
{0xFF000003 ,"qrc:/Sng/FSnd1.wav"},
{0xFF000004 ,"qrc:/Sng/FSnd2.wav"},
{0xFF000005 ,"qrc:/Sng/FSnd3.wav"},
};
struct Alarm AlarmSound[] = {
{0x1 ,"qrc:/Sng/1.wav"},
{0x100 ,"qrc:/Sng/100.wav"},
{0x1000 ,"qrc:/Sng/1000.wav"},
{0x10000 ,"qrc:/Sng/10000.wav"},
{0x1000000 ,"qrc:/Sng/1000000.wav"},
{0x10000000 ,"qrc:/Sng/10000000.wav"},
{0x2 ,"qrc:/Sng/2.wav"},
{0x20 ,"qrc:/Sng/20.wav"},
{0x200 ,"qrc:/Sng/200.wav"},
{0x2000 ,"qrc:/Sng/2000.wav"},
{0x20000 ,"qrc:/Sng/20000.wav"},
{0x2000000 ,"qrc:/Sng/2000000.wav"},
{0x4 ,"qrc:/Sng/4.wav"},
{0x40 ,"qrc:/Sng/40.wav"},
{0x400 ,"qrc:/Sng/400.wav"},
{0x4000 ,"qrc:/Sng/4000.wav"},
{0x40000 ,"qrc:/Sng/40000.wav"},
{0x4000000 ,"qrc:/Sng/4000000.wav"},
{0x40000000 ,"qrc:/Sng/40000000.wav"},
{0x8 ,"qrc:/Sng/8.wav"},
{0x8000 ,"qrc:/Sng/8000.wav"},
{0x8000000 ,"qrc:/Sng/8000000.wav"},
};
QString GetNewAlarmSound(uint32_t AlarmValue)
{
QString Result = "";
for(int i = 0;i < sizeof (CAlarmSound)/sizeof (CAlarmSound[0]);i++)
{
if(AlarmValue == CAlarmSound[i].AlarmIndex)
{
Result = CAlarmSound[i].Info;
}
}
return Result;
}
QString GetNewAlarmSound(uint32_t AlarmValue,QStringList &list)
{
/**
UInt32,每种类型占用1bit 可表示同一时间存在多种报警
0x0:正常
0x00000002:防碰撞报警;
0x02000000:起重量报警;
0x01000000:力矩报警;
0x00000100:最大幅度限位报警;
0x00000200:最小幅度限位报警;
0x00000400:高度上限报警;
0x00001000:回转左限位报警;
0x00002000:回转右限位报警;
0x00000020:风速报警;
0x10000000:倾角报警;;
0x00000004:防碰撞预警;
0x08000000:起重量预警;
0x04000000:力矩预警;
0x00010000:最大幅度限位预警;
0x00020000:最小幅度限位预警;
0x00040000:高度上限预警;
0x00004000:回转左限位预警;
0x00008000:回转右限位预警;
0x00000040:风速预警;
0x20000000:倾角预警;;
*/
QString Result = "";
QString Delete = "";
for(int i = 0;i < sizeof (AlarmSound)/sizeof (AlarmSound[0]);i++)
{
if(AlarmValue & AlarmSound[i].AlarmIndex)
{
Result = AlarmSound[i].Info;
if(list.indexOf(Result) == -1)
list.push_back(Result);
}
else
{
Delete = AlarmSound[i].Info;
int index;
if((index = list.indexOf(Delete)) != -1)
list.removeAt(index);
}
}
if(list.isEmpty())
Result = "";
else
Result = list.takeFirst();
return Result;
}
struct Alarm AlarmString[] = {
{0x00000001 ,"群塔碰撞提醒,注意驾驶"},
{0x00000002 ,"区域防碰撞提醒,注意驾驶"},
{0x02000000 ,"起重量报警"},
{0x01000000 ,"起重力矩报警"},
{0x00000100 ,"幅度达到最大限位,注意驾驶"},
{0x00000200 ,"幅度达到最小限位,注意驾驶"},
{0x00000400 ,"高度达到限位,注意驾驶"},
{0x00001000 ,"发现电缆向左缠绕"},
{0x00002000 ,"发现电缆向右缠绕"},
{0x00000020 ,"风速报警"},
{0x10000000 ,"发现倾斜达到限位"},
{0x00000008 ,"群塔接近"},
{0x00000004 ,"接近禁行区域"},
{0x08000000 ,"起重量预警"},
{0x04000000 ,"力矩预警"},
{0x00010000 ,"幅度接近最大限位"},
{0x00020000 ,"幅度接近最小限位"},
{0x00040000 ,"高度接近限位"},
{0x00004000 ,"注意电缆向左缠绕"},
{0x00008000 ,"注意电缆向右缠绕"},
{0x00000040 ,"风速预警"},
{0x40000000 ,"发现倾斜接近限位"},
};
QString GetNewAlarmString(uint32_t AlarmValue,QStringList &list)
{
/**
0x00000001:多机防碰撞报警;----文字提醒:群塔碰撞提醒,注意驾驶
0x00000002:防碰撞报警;----文字提醒:区域防碰撞提醒,注意驾驶
0x02000000:起重量报警;----文字提醒:起重量报警
0x01000000:力矩报警;----文字提醒: 起重力矩报警
0x00000100:最大幅度限位报警;----文字提醒:幅度达到最大限位,注意驾驶
0x00000200:最小幅度限位报警;----文字提醒:幅度达到最小限位,注意驾驶
0x00000400:高度上限报警;----文字提醒:高度达到限位,注意驾驶
0x00001000:回转左限位报警;(左扭度)----文字提醒:发现电缆向左缠绕
0x00002000:回转右限位报警;(右扭度)----文字提醒:发现电缆向右缠绕
0x00000020:风速报警;----文字提醒:风速报警
0x10000000:倾角报警;;----文字提醒:发现倾斜达到限位
0x00000008:多机防碰撞预警;----文字提醒:群塔接近
0x00000004:防碰撞预警;----文字提醒:接近禁行区域
0x08000000:起重量预警;----文字提醒:起重量预警
0x04000000:力矩预警;----文字提醒:力矩预警
0x00010000:最大幅度限位预警;----文字提醒:幅度接近最大限位
0x00020000:最小幅度限位预警;----文字提醒:幅度接近最小限位
0x00040000:高度上限预警;----文字提醒:高度接近限位
0x00004000:回转左限位预警;(左扭度)----文字提醒:注意电缆向左缠绕
0x00008000:回转右限位预警;(右扭度)----文字提醒:注意电缆向右缠绕
0x00000040:风速预警;----文字提醒:风速预警
0x40000000:倾角预警----文字提醒:发现倾斜接近限位
*/
QString Result = "";
QString Delete = "";
for(int i = 0;i < sizeof (AlarmString)/sizeof (AlarmString[0]);i++)
{
if(AlarmValue & AlarmString[i].AlarmIndex)
{
Result = AlarmString[i].Info;
if(list.indexOf(Result) == -1)
list.push_back(Result);
}
else
{
Delete = AlarmString[i].Info;
int index;
if((index = list.indexOf(Delete)) != -1)
list.removeAt(index);
}
}
if(list.isEmpty())
Result = "暂无最新信息";
else
Result = list.takeFirst();
return Result;
}
DataDictionary* DataDictionary::m_DataDictionary = nullptr;
DataDictionary::DataDictionary()
{
memset(&m_MonitorRtData,0x0,sizeof(m_MonitorRtData));
memset(&m_DevParamData,0x0,sizeof(m_DevParamData));
//m_DevParamData.aFaceIdSet = 1;
m_PersonInfoList.clear();
m_SystemData.sCameraPassWord1.append(tr("w1234567"));
m_SystemData.sCameraUserName1.append(tr("admin"));
m_SystemData.sCameraIp1.append(tr("192.168.12.34"));
m_SystemData.sCameraPort1.append(tr("554"));
m_SystemData.sCameraUrl1.append(tr("rtsp://admin:[email protected]:554/stream1"));
m_SystemData.sCameraPassWord2.append(tr("w1234567"));
m_SystemData.sCameraUserName2.append(tr("admin"));
m_SystemData.sCameraIp2.append(tr("192.168.12.35"));
m_SystemData.sCameraPort2.append(tr("554"));
m_SystemData.sCameraUrl2.append(tr("rtsp://admin:[email protected]:554/stream1"));
m_SystemData.sCameraPassWord3.append(tr("w1234567"));
m_SystemData.sCameraUserName3.append(tr("admin"));
m_SystemData.sCameraIp3.append(tr("192.168.12.36"));
m_SystemData.sCameraPort3.append(tr("554"));
m_SystemData.sCameraUrl3.append(tr("rtsp://admin:[email protected]:554/stream1"));
m_SystemData.sCameraPassWord4.append(tr("w1234567"));
m_SystemData.sCameraUserName4.append(tr("admin"));
m_SystemData.sCameraIp4.append(tr("192.168.10.4"));
m_SystemData.sCameraPort4.append(tr("554"));
#ifdef __x86_64__
m_SystemData.sSerialCom.append(tr("ttyS0"));
#else
m_SystemData.sSerialCom.append(tr("ttyS5"));
#endif
m_SystemData.sBaudRate.append(tr("115200"));
m_SystemData.auiDebug = 0;
m_SystemData.auiLogSavDay = 1;
m_SystemData.auiDataSavDay = 1;
m_SystemData.sPassWord.append("123456");
m_SystemData.sPassWordMd5 = QCryptographicHash::hash(m_SystemData.sPassWord.toLatin1()
,QCryptographicHash::Md5).toHex();
m_SystemData.sSuperPassWord.append("523425");
m_SystemData.sCameraPath.clear();
m_SystemData.auiOSDDevice = LOCAL_DEVICE;
m_SystemData.auiOSDPort = 8100;
m_SystemData.aiOSDXPos = 750;
m_SystemData.aiOSDYPos = 220;
m_SystemData.aiOnDispay = 1;
m_SystemData.aiSplitDisplay = 1;
m_SystemData.aiLogoShow = 1;
m_SystemData.aiFaceIdEnable = 1;
m_SystemData.aiFaceIdRun = 1;
m_SystemData.aiFaceIdJump = 1;
m_SystemData.aiFaceIdPowerUpEnable = 1;
m_SystemData.aiLimitSettingSta = 0;
m_SystemData.aiSpeedSettingSta = 0;
m_SystemData.aiAngleSettingSta = 0;
m_SystemData.aiMomentSettingSta = 0;
m_SystemData.aiTowerDevSettingSta = 0;
m_SystemData.aRegTime = 0;
m_SystemData.aSyncTime = 0;
m_SystemData.sSyncFaceidHost = "faceapi.dltengyi.cn";
m_SystemData.sSyncFaceidPost = "3000";
m_SystemData.sSyncFaceidStatePath = "/faceapi/v1/stat";
m_SystemData.sSyncFaceidInfoPath = "/faceapi/v1/person/info";
m_SystemData.sSyncFaceidFacePath = "/faceapi/v1/person/face";
m_SystemData.sSyncFaceidUploadPath = "/faceapi/v1/person/upload/face";
m_SystemData.sSyncFaceidCmdPath = "/faceapi/v1/callback/cmd";
m_SystemData.sSyncFaceidRecognizePath = "/faceapi/v1/callback/recognize";
m_SystemData.sModle = "TJG-15VL-1G0";
m_MisData.aCameraSta1 = CAMERA_OFFLINE;
m_MisData.aCameraSta2 = CAMERA_OFFLINE;
m_MisData.aCameraSta3 = CAMERA_OFFLINE;
m_MisData.aServiceConSta = MIS_OFFLINE;
m_MisData.aSerialSta = MIS_OFFLINE;
m_MisData.fCameraStep = 1;
m_MisData.fCameraStepCal = 0.01;
m_MisData.fCameraMaxZoom = 50;
m_MisData.fCameraMaxDistance = 20.00;
m_MisData.fAlignVHeight = 0.0;
m_MisData.fAlignVAngle = 0.0;
m_MisData.fAlignVHeightRatio = 1.0;
m_MisData.auiAlignSta = ALIGN_ENABLE;
m_MisData.fHAngleInit = 0.0;
m_MisData.aHeightZeroPos = ARM_ZERO_POS;
m_MisData.aiFHookFrq = 1;
m_MisData.aiLockScreen = 1;
m_MisData.aiFaceIdSta = 0;
m_MisData.sSaveTime = "";
m_MisData.aiFaceTimeout = 0;
m_MisData.aVolume = 0;
m_MisData.aiDateClockType = CLOCK_BB_TYPE;
m_MisData.aiFaceIdCmpValue = 75;
m_MisData.aiDisplayInterval1 = 0;
m_MisData.aiDisplayInterval2 = 0;
m_MisData.aiDisplayInterval3 = 0;
m_MisData.aiCustomAlmTimer = 0;
m_CameraCtlData.fCurHAngle = 0.0;
m_CameraCtlData.fCurHValue = 0.0;
m_CameraCtlData.fCurVAngle = 0.0;
m_CameraCtlData.fCurVValue = 0.0;
m_CameraCtlData.fReqHAngle = 0.0;
m_CameraCtlData.fReqHValue = 0.0;
m_CameraCtlData.fReqVAngle = 0.0;
m_CameraCtlData.fReqVValue = 0.0;
m_CameraCtlData.fCurZoomValue = 0.0;
m_CameraCtlData.fReqZoomValue = 0.0;
m_ResteData.fResetAlignVHeightRatio = 1;
m_ResteData.fResetAlignVAngle = 0;
m_ResteData.fResetAlignVHeight = 0;
memset(&m_DevParamData,0,sizeof(m_DevParamData));
memset(&m_SignalParamData,0x0,sizeof(m_SignalParamData));
memset(&m_MultipleParamData,0x0,sizeof(m_MultipleParamData));
m_DevParamData.auiTowerRatio = TOWER_MIN_RATIO;
m_DevParamData.auiTowerId = 0;
m_DevParamData.auiFaceIdCtl = 1;
m_DevParamData.auiEncoderAddr = 0;
m_DevParamData.auiExportProgress = 0;
m_MonitorRtData.auiSensorSta = 0xffffffff;
}
DataDictionary *DataDictionary::GetInstance()
{
if(m_DataDictionary == nullptr){
m_DataDictionary = new DataDictionary;
}
return m_DataDictionary;
}
void DataDictionary::SetMisData(MisDataIndex_t index,QString Data)
{
bool Result = true;
switch (index) {
case MIS_CAMERA_STA1:
m_MisData.aCameraSta1 = Data.toInt();
break;
case MIS_CAMERA_STA2:
m_MisData.aCameraSta2 = Data.toInt();
break;
case MIS_CAMERA_STA3:
m_MisData.aCameraSta3 = Data.toInt();
break;
case MIS_CAMERA_STA4:
m_MisData.aCameraSta4 = Data.toInt();
break;
case MIS_SERIAL_STA:
m_MisData.aSerialSta = Data.toInt();
break;
case MIS_SERVICE_CON_STA:
m_MisData.aServiceConSta = Data.toInt();
break;
case MIS_CAMERA_STEP:
m_MisData.fCameraStep = Data.toInt();
m_MisData.fCameraStepCal = (double)(Data.toInt())/(double)100;
break;
case MIS_CAMERA_MAX_ZOOM:
m_MisData.fCameraMaxZoom = Data.toInt();
break;
case MIS_CAMERA_MAX_DISTANCE:
m_MisData.fCameraMaxDistance = Data.toDouble();
break;
case MIS_ALIGN_V_HEIGHT:
m_MisData.fAlignVHeight = Data.toDouble();
break;
case MIS_ALIGN_V_ANGLE:
m_MisData.fAlignVAngle = Data.toDouble();
m_CameraCtlData.fReqVAngle = Data.toDouble();
break;
case MIS_ALIGN_V_HEIGHT_RATIO:
m_MisData.fAlignVHeightRatio = Data.toDouble();
break;
case MIS_H_ANGLE_INIT:
m_MisData.fHAngleInit = Data.toDouble();
m_CameraCtlData.fReqHAngle = Data.toDouble();
break;
case MIS_ALIGN_STA:
m_MisData.auiAlignSta = Data.toInt();
break;
case MIS_HEIGHT_ZERO_POS:
m_MisData.aHeightZeroPos = Data.toInt();
m_DevParamData.auiHeightZero = Data.toInt();
emit DevParamDataChange(D_HEIGHT_ZERO);
break;
case MIS_VOLUME:
m_MisData.aVolume = Data.toInt();
break;
case MIS_CAMERA_GUN_STA:
m_MisData.aCameraGunSta = Data.toInt();
break;
case MIS_BLKBOX_SYNCSTA:
m_MisData.aBlkBoxSyncSta = Data.toInt();
break;
case MIS_BLKBOX_FACEIDSTA:
m_MisData.aBlkBoxFaceIdSta = Data.toInt();
break;
case MIS_BLKBOX_CMDSTA:
m_MisData.aBlkBoxCmdSta = Data.toInt();
break;
case MIS_BLKBOX_DTUSTA:
m_MisData.aBlkBoxDTUSta = Data.toInt();
break;
case MIS_BLKBOX_SYNCREQ:
m_MisData.aBlkBoxSyncReq = Data.toInt();
break;
case MIS_BLKBOX_FACEID_INFO:
m_MisData.aBlkBoxFaceIdInfo = Data.toInt();
break;
case MIS_NEW_OR_OLD_BLKBOX:
m_MisData.aiNewOrOldBB = Data.toInt();
break;
case MIS_FOLLOW_HOOK_FRQ:
m_MisData.aiFHookFrq = Data.toInt();
break;
case MIS_LOCK_SCREEN:
m_MisData.aiLockScreen = Data.toInt();
break;
case MIS_FACEID_STA:
m_MisData.aiFaceIdSta = Data.toInt();
break;
case MIS_FACEID_INFO:
m_MisData.sFaceIdInfo = Data;
break;
case MIS_BB_CMD:
m_MisData.aiBBCmd = Data.toInt();
break;
case MIS_DTU1_ADDR:
m_MisData.sDTU1Addr = Data;
Result = false;
break;
case MIS_DTU1_PORT:
m_MisData.aiDTU1Port = Data.toUInt();
Result = false;
break;
case MIS_DTU2_ADDR:
m_MisData.sDTU2Addr = Data;
Result = false;
break;
case MIS_DTU2_PORT:
m_MisData.aiDTU2Port = Data.toUInt();
Result = false;
break;
case MIS_DTU3_ADDR:
m_MisData.sDTU3Addr = Data;
Result = false;
break;
case MIS_DTU3_PORT:
m_MisData.aiDTU3Port = Data.toUInt();
Result = false;
break;
case MIS_DTU4_ADDR:
m_MisData.sDTU4Addr = Data;
Result = false;
break;
case MIS_DTU4_PORT:
m_MisData.aiDTU4Port = Data.toUInt();
Result = false;
break;
case MIS_DTU1_UP:
break;
case MIS_DTU2_UP:
break;
case MIS_DTU3_UP:
break;
case MIS_DTU4_UP:
break;
case MIS_SAVE_CONF:
m_MisData.aiSaveConf = Data.toInt();
break;
case MIS_SAVE_TIME:
m_MisData.sSaveTime = Data;
break;
case MIS_RECOVERY_CONF:
m_MisData.aiRecovery = Data.toInt();
break;
case MIS_FACEID_START:
break;
case MIS_FACEID_QUITE:
break;
case MIS_FACEID_TIMEOUT:
m_MisData.aiFaceTimeout = Data.toInt();
break;
case MIS_DATE_CLOCK_TYPE:
m_MisData.aiDateClockType = Data.toInt();
break;
case MIS_FACEID_CMP_VALUE:
m_MisData.aiFaceIdCmpValue = Data.toInt();
break;
case MIS_DISPLAY_INTERVAL1:
m_MisData.aiDisplayInterval1 = Data.toInt();
break;
case MIS_DISPLAY_INTERVAL2:
m_MisData.aiDisplayInterval2 = Data.toInt();
break;
case MIS_DISPLAY_INTERVAL3:
m_MisData.aiDisplayInterval3 = Data.toInt();
break;
case MIS_DISPLAY_INTERVAL4:
m_MisData.aiDisplayInterval4 = Data.toInt();
break;
case MIS_BLKBOX_SEARCH_TOWER:
m_MisData.aiBlkBoxSearchTower = Data.toInt();
break;
case MIS_CUSTOM_ALM_MSG:
m_MisData.sCustomAlmMsg = Data;
break;
case MIS_CUSTOM_ALM_TIMER:
m_MisData.aiCustomAlmTimer = Data.toInt();
break;
case MIS_NET_DEV:
m_MisData.sNetDev = Data;
break;
case MIS_NET_TYPE:
m_MisData.aiNetType = Data.toInt();
break;
case MIS_NET_IP:
m_MisData.sNetIp = Data;
break;
case MIS_NET_MASK:
m_MisData.sNetMask = Data;
break;
case MIS_NET_GATEWAY:
m_MisData.sNetGateway = Data;
break;
case MIS_NET_DNS:
m_MisData.sNetDns = Data;
break;
// case MIS_FACEID_SUCCESS_UUID:
// m_MisData.sFaceIdSuccessUuid = Data;
// break;
default:
Result = false;
break;
}
if(Result){
emit MisDataChange(index);
}
}
void DataDictionary::SetMisData(MisDataIndex_t index,QStringList Data)
{
switch (index) {
case MIS_SERIALPORTLIST:
m_MisData.lSerialPortList = Data;
break;
case MIS_BAUDRATELIST:
m_MisData.lBaudRateList = Data;
break;
default:
break;
}
}
void DataDictionary::SetMisData(MisDataIndex_t index,PersonInfo_t Data)
{
bool Result = true;
switch (index) {
case MIS_FACEID_SUCCESS_UUID:
m_MisData.sFaceIdSuccessUuid = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit MisDataChange(index);
}
}
void DataDictionary::SetMisData(MisDataIndex_t index, QList<SearchData> Data)
{
bool Result = true;
switch (index) {
case MIS_BLKBOX_SEARCH_TOWER_RES:
m_MisData.alBlkBoxSearchTowerRes = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit MisDataChange(index);
}
}
void DataDictionary::SetMisData(MisDataIndex_t index, QImage Data)
{
bool Result = true;
switch (index) {
case MIS_SHOT_NET_CAM1_RES:
m_MisData.iCam1Image = Data;
break;
case MIS_SHOT_NET_CAM2_RES:
m_MisData.iCam2Image = Data;
break;
case MIS_SHOT_NET_CAM3_RES:
m_MisData.iCam3Image = Data;
break;
case MIS_SHOT_NET_CAM4_RES:
m_MisData.iCam4Image = Data;
break;
case MIS_SHOT_LOCAL_CAM_RES:
m_MisData.iCamLocalImage = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit MisDataChange(index);
}
}
void DataDictionary::SetResetData(ResetDataIndex_t index,QString Data)
{
switch (index) {
case RESET_ALIGN_V_ANGLE:
m_ResteData.fResetAlignVAngle = Data.toDouble();
break;
case RESET_ALIGN_V_HEIGHT:
m_ResteData.fResetAlignVHeight = Data.toDouble();
break;
case RESET_ALIGN_V_HEIGHT_RATIO:
m_ResteData.fResetAlignVHeightRatio = Data.toDouble();
break;
default:
break;
}
}
void DataDictionary::SetSystemData(SystemDataIndex_t index,QString Data)
{
bool Result = true;
switch (index) {
case SYS_CAMERA_PASSWORD1:
m_SystemData.sCameraPassWord1 = Data;
break;
case SYS_CAMERA_USERNAME1:
m_SystemData.sCameraUserName1 = Data;
break;
case SYS_CAMERA_IP1:
m_SystemData.sCameraIp1 = Data;
break;
case SYS_CAMERA_PORT1:
m_SystemData.sCameraPort1 = Data;
break;
case SYS_CAMERA_PASSWORD2:
m_SystemData.sCameraPassWord2 = Data;
break;
case SYS_CAMERA_USERNAME2:
m_SystemData.sCameraUserName2 = Data;
break;
case SYS_CAMERA_IP2:
m_SystemData.sCameraIp2 = Data;
break;
case SYS_CAMERA_PORT2:
m_SystemData.sCameraPort2 = Data;
break;
case SYS_CAMERA_PASSWORD3:
m_SystemData.sCameraPassWord3 = Data;
break;
case SYS_CAMERA_USERNAME3:
m_SystemData.sCameraUserName3 = Data;
break;
case SYS_CAMERA_IP3:
m_SystemData.sCameraIp3 = Data;
break;
case SYS_CAMERA_PORT3:
m_SystemData.sCameraPort3 = Data;
break;
case SYS_CAMERA_PASSWORD4:
m_SystemData.sCameraPassWord4 = Data;
break;
case SYS_CAMERA_USERNAME4:
m_SystemData.sCameraUserName4 = Data;
break;
case SYS_CAMERA_IP4:
m_SystemData.sCameraIp4 = Data;
break;
case SYS_CAMERA_PORT4:
m_SystemData.sCameraPort4 = Data;
break;
case SYS_CAMERA_PATH:
m_SystemData.sCameraPath = Data;
break;
case SYS_CAMERA_URL1:
m_SystemData.sCameraUrl1 = Data;
break;
case SYS_CAMERA_URL2:
m_SystemData.sCameraUrl2 = Data;
break;
case SYS_CAMERA_URL3:
m_SystemData.sCameraUrl3 = Data;
break;
case SYS_CAMERA_URL4:
m_SystemData.sCameraUrl4 = Data;
break;
case SYS_PTZ_ADDR:
m_SystemData.sPtzAddr = Data;
break;
case SYS_PTZ_PORT:
m_SystemData.sPtzPort = Data;
break;
case SYS_SERIAL_COM:
m_SystemData.sSerialCom = Data;
break;
case SYS_BAUD_RATE:
m_SystemData.sBaudRate = Data;
break;
case SYS_DATA_SAV_DAY:
m_SystemData.auiDataSavDay = Data.toUInt();
break;
case SYS_LOG_SAV_DAY:
m_SystemData.auiLogSavDay = Data.toUInt();
break;
case SYS_DEBUG:
m_SystemData.auiDebug = Data.toUInt();
break;
case SYS_PASSWORD_MD5:
m_SystemData.sPassWordMd5 = Data;
break;
case SYS_OSD_DEVICE:
m_SystemData.auiOSDDevice = Data.toUInt();
break;
case SYS_OSD_PORT:
m_SystemData.auiOSDPort = Data.toUShort();
break;
case SYS_OSD_X_POS:
m_SystemData.aiOSDXPos = Data.toInt();
break;
case SYS_OSD_Y_POS:
m_SystemData.aiOSDYPos = Data.toInt();
break;
case SYS_ON_DISPLAY:
m_SystemData.aiOnDispay = Data.toInt();
break;
case SYS_SPLIT_DISPLAY:
m_SystemData.aiSplitDisplay = Data.toInt();
break;
case SYS_LOGO_SHOW:
m_SystemData.aiLogoShow = Data.toInt();
break;
case SYS_FACEID_ENABLE:
m_SystemData.aiFaceIdEnable = Data.toInt();
break;
case SYS_FACEID_RUN:
m_SystemData.aiFaceIdRun = Data.toInt();
break;
case SYS_FACEID_JUMP:
m_SystemData.aiFaceIdJump = Data.toInt();
break;
case SYS_FACEID_POWER_UP_ENABLE:
m_SystemData.aiFaceIdPowerUpEnable = Data.toInt();
break;
case SYS_MODLE:
m_SystemData.sModle = Data;
break;
case SYS_LIMIT_SETTING_STA:
m_SystemData.aiLimitSettingSta = Data.toInt();
break;
case SYS_SPEED_SETTING_STA:
m_SystemData.aiSpeedSettingSta = Data.toInt();
break;
case SYS_MOMENT_SETTING_STA:
m_SystemData.aiMomentSettingSta = Data.toInt();
break;
case SYS_ANGLE_SETTING_STA:
m_SystemData.aiAngleSettingSta = Data.toInt();
break;
case SYS_TOWER_DEV_SETTING_STA:
m_SystemData.aiTowerDevSettingSta = Data.toInt();
break;
case SYS_LAST_REG_TIME:
m_SystemData.aRegTime = Data.toLongLong();
break;
case SYS_HTTP_SYNC_TIME:
m_SystemData.aSyncTime = Data.toLongLong();
break;
case SYS_SYNC_FACEID_HOST:
m_SystemData.sSyncFaceidHost = Data;
break;
case SYS_SYNC_FACEID_POST:
m_SystemData.sSyncFaceidPost = Data;
break;
case SYS_SYNC_FACEID_STATE_PATH:
m_SystemData.sSyncFaceidStatePath = Data;
break;
case SYS_SYNC_FACEID_INFO_PATH:
m_SystemData.sSyncFaceidInfoPath = Data;
break;
case SYS_SYNC_FACEID_FACE_PATH:
m_SystemData.sSyncFaceidFacePath = Data;
break;
case SYS_SYNC_FACEID_UPLOAD_PATH:
m_SystemData.sSyncFaceidUploadPath = Data;
break;
case SYS_SYNC_FACEID_CMD_PATH:
m_SystemData.sSyncFaceidCmdPath = Data;
break;
case SYS_SYNC_FACEID_RECOGNIZE_PATH:
m_SystemData.sSyncFaceidRecognizePath = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit SystemDataChange(index);
}
}
void DataDictionary::SetCameraCtlData(CameraCtlIndex_t index,QString Data)
{
bool Result = true;
switch (index) {
case CAM_REQ_H_ANGLE:
m_CameraCtlData.fReqHAngle = Data.toDouble();
break;
case CAM_REQ_H_VALUE:
m_CameraCtlData.fReqHValue = Data.toDouble();
break;
case CAM_CUR_H_ANGLE:
m_CameraCtlData.fCurHAngle = Data.toDouble();
break;
case CAM_CUR_H_VALUE:
m_CameraCtlData.fCurHValue = Data.toDouble();
break;
case CAM_REQ_V_ANGLE:
m_CameraCtlData.fReqVAngle = Data.toDouble();
break;
case CAM_REQ_V_VALUE:
m_CameraCtlData.fReqVValue = Data.toDouble();
break;
case CAM_CUR_V_ANGLE:
m_CameraCtlData.fCurVAngle = Data.toDouble();
break;
case CAM_CUR_V_VALUE:
m_CameraCtlData.fCurVValue = Data.toDouble();
break;
case CAM_REQ_ZOOM_VALUE:
m_CameraCtlData.fReqZoomValue = Data.toDouble();
break;
case CAM_REQ_ZOOM_FROCE:
m_CameraCtlData.fReqZoomFroce = Data.toDouble();
break;
case CAM_CUR_ZOOM_VALUE:
m_CameraCtlData.fCurZoomValue = Data.toDouble();
break;
case CAM_DISCOVER:
m_CameraCtlData.aiCamDiscover = Data.toInt();
break;
case CAM_SET_NET_RES:
m_CameraCtlData.sSetCamNetRes = Data;
break;
case CAM_SET_CONF_RES:
m_CameraCtlData.sSetCamConfRes = Data;
break;
case CAM_SYSTEM_REBOOT:
m_CameraCtlData.sSystemRebootRes = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit CameraCtlDataChange(index);
}
}
void DataDictionary::SetCameraCtlData(CameraCtlIndex_t index,GetCameraInfoSt_t Data)
{
bool Result = true;
switch (index) {
case CAM_GET_NETWORK_INFO:
m_CameraCtlData.sCamGetNetWorkInfo = Data;
break;
case CAM_GET_CONF_INFO:
m_CameraCtlData.sCamGetConfigInfo = Data;
break;
case CAM_SYSTEM_REBOOT:
m_CameraCtlData.sCamSystemReboot = Data;
break;
default:
Result = false;
break;
}
if(Result){
emit CameraCtlDataChange(index);
}
}
void DataDictionary::SetCameraList(QList<CameraInfo_t> &list)
{
m_CameraCtlData.aCamList = list;
emit CameraCtlDataChange(CAM_DISCOVER_LIST);
}
void DataDictionary::SetCameraNetworkList(CameraCtlIndex_t index,QList<CameraNetworkInfo_t> &list)
{
m_CameraCtlData.aCamNetworkList = list;
emit CameraCtlDataChange(index);
}
void DataDictionary::SetCameraConfigList(CameraCtlIndex_t index,QList<CameraConfigInfo_t> &list)
{
m_CameraCtlData.aCamConfList = list;
emit CameraCtlDataChange(index);
}
void DataDictionary::SetDevParamData(DevParamDataIndex_t index,QString Data)
{
QDate Date = QDate::currentDate();
QTime Time = QTime::currentTime();
bool Result = true;
switch (index) {
case D_CURRENT_TIME:
m_DevParamData.aCurYear = Date.year();
m_DevParamData.aCurMon = Date.month();
m_DevParamData.aCurDay = Date.day();
m_DevParamData.aCurHour = Time.hour();
m_DevParamData.aCurMin = Time.minute();
m_DevParamData.aCurSec = Time.second();
break;
case D_WEIGHT_LL:
m_DevParamData.afWeightLL = Data.toDouble();
break;
case D_WEIGHT_LL_SIG:
m_DevParamData.auiWeightLLSig = Data.toUInt();
break;
case D_WEIGHT_UL:
m_DevParamData.afWeightUL = Data.toDouble();
break;
case D_WEIGHT_UL_SIG:
m_DevParamData.auiWeightULSig = Data.toUInt();
break;
case D_SCOPE_LL:
m_DevParamData.afScopeLL = Data.toDouble();
break;
case D_SCOPE_LL_SIG:
m_DevParamData.auiScopeLLSig = Data.toUInt();
break;
case D_SCOPE_UL:
m_DevParamData.afScopeUL = Data.toDouble();
break;
case D_SCOPE_UL_SIG:
m_DevParamData.auiScopeULSig = Data.toUInt();
break;
case D_HEIGHT_LL:
m_DevParamData.afHeightLL = Data.toDouble();
break;
case D_HEIGHT_LL_SIG:
m_DevParamData.auiHeightLLSig = Data.toUInt();
break;
case D_HEIGHT_UL:
m_DevParamData.afHeightUL = Data.toDouble();
break;
case D_HEIGHT_UL_SIG:
m_DevParamData.auiHeightULSig = Data.toUInt();
break;
case D_ROTATION_LL:
m_DevParamData.afRotationLL = Data.toUInt();
break;
case D_ROTATION_LL_SIG:
m_DevParamData.auiRotationLLSig = Data.toUInt();
break;
case D_ROTATION_UL:
m_DevParamData.afRotationUL = Data.toUInt();
break;
case D_ROTATION_UL_SIG:
m_DevParamData.auiRotationULSig = Data.toUInt();
break;
case D_WIND_ZERO:
m_DevParamData.auiWindZero = Data.toUInt();
break;
case D_WIND_RATIO:
m_DevParamData.afWindRatio = Data.toDouble();
break;
case D_ANGLE_X_ZERO:
m_DevParamData.auiAngleXZero = Data.toUInt();
break;
case D_ANGLE_Y_ZERO:
m_DevParamData.auiAngleYZero = Data.toUInt();
break;
case D_START_WEIGHT:
m_DevParamData.afStartWeight = Data.toDouble();
break;
case D_START_SCOPE:
m_DevParamData.afStartScope = Data.toDouble();
break;
case D_MID_WEIGHT:
m_DevParamData.afMidWeight = Data.toDouble();
break;
case D_MID_SCOPE:
m_DevParamData.afMidScope = Data.toDouble();
break;
case D_END_WEIGHT:
m_DevParamData.afEndWeight = Data.toDouble();
break;
case D_END_SCOPE:
m_DevParamData.afEndScope = Data.toDouble();
break;
case D_DEV_ID:
m_DevParamData.auiDevId = Data.toUInt();
break;
case D_ARM_LENGTH:
m_DevParamData.afArmLength = Data.toDouble();
break;
case D_HEIGHT: /** 高度 */
m_DevParamData.afHeight = Data.toDouble();
break;
case D_BALARM_LENGHT: /** 塔机平衡臂长 */
m_DevParamData.afBalArmLenght = Data.toDouble();
break;
case D_TOWER_CAP_HEIGHT: /** 塔帽高度 */
m_DevParamData.afTowerCapHeight = Data.toDouble();
break;
case D_TOWER_RATIO: /** 塔机倍率 */
m_DevParamData.auiTowerRatio = Data.toUInt();
break;
case D_TOWER_CTL_FUNC: /** 塔机控制功能 */
m_DevParamData.auiTowerCtlFunc = Data.toUInt();
break;
case D_TOWER_CAR_FRONT: /** 塔机小车前进测试 */
m_DevParamData.auiTowerCarFront = Data.toUInt();
break;
case D_TOWER_CAR_BACK: /** 塔机小车后退测试 */
m_DevParamData.auiTowerCarBack = Data.toUInt();
break;
case D_TOWER_CAR_UP: /** 塔机高度向上测试 */
m_DevParamData.auiTowerCarUp = Data.toUInt();
break;
case D_TOWER_CAR_DOWN: /** 塔机高度向下测试 */
m_DevParamData.auiTowerCarDown = Data.toUInt();
break;
case D_TOWER_CAR_LEFT: /** 塔机左转测试 */
m_DevParamData.auiTowerCarLeft = Data.toUInt();
break;
case D_TOWER_CAR_RIGHT: /** 塔机右转测试 */
m_DevParamData.auiTowerCarRight = Data.toUInt();
break;
case D_TOWER_SYS_DEBUG: /** 系统调试状态 */
m_DevParamData.auiTowerSysDebug = Data.toUInt();
break;
// case D_TOWER_ID: /** 塔机编号,仅做显示不设置到设备 */
// m_DevParamData.auiTowerId = Data.toUInt();
// break;
case D_SENSOR_TYPE:
m_DevParamData.auiSensorType = Data.toUInt();
break;
case D_ALARM_ENABLE:
m_DevParamData.auiAlarmEnable = Data.toUInt();
break;
case D_HEIGHT_ZERO:
m_DevParamData.auiHeightZero = Data.toUInt();
m_MisData.aHeightZeroPos = Data.toUInt();
emit MisDataChange(MIS_HEIGHT_ZERO_POS);
break;
case D_ANGLE_PREALARM_V:
m_DevParamData.afAnglePreAlarmV = Data.toDouble();
break;
case D_ANGLE_ALARM_V:
m_DevParamData.afAngleAlarmV = Data.toDouble();
break;
case D_WIND_PREALARM_V:
m_DevParamData.afWindPreAlarmV = Data.toDouble();
break;
case D_WIND_ALARM_V:
m_DevParamData.afWindAlarmV = Data.toDouble();
break;
case D_SCOPE_PREALARM_V:
m_DevParamData.afScopePreAlarmV = Data.toDouble();
break;
case D_SCOPE_ALARM_V:
m_DevParamData.afScopeAlarmV = Data.toDouble();
break;
case D_HEIGHT_PREALARM_V:
m_DevParamData.afHeightPreAlarmV = Data.toDouble();
break;
case D_HEIGHT_ALARM_V:
m_DevParamData.afHeightAlarmV = Data.toDouble();
break;
case D_CB_ID:
m_DevParamData.auiCbId = Data.toUInt();
break;
case D_CB_CON:
m_DevParamData.auiCbCon = Data.toUInt();
break;
case D_CB_MODE:
m_DevParamData.auiCbMode = Data.toUInt();
break;
case D_CB_POWER_CTL:
m_DevParamData.auiCbPowerCtl = Data.toUInt();
break;
case D_LASER_MODE:
m_DevParamData.auiLaserMode = Data.toUInt();
break;
case D_CB_ENALBE:
m_DevParamData.auiCbEnable = Data.toUInt();
break;
case D_LASER_ENABLE:
m_DevParamData.auiLaserEnable = Data.toUInt();
break;
case D_SITE_NUMBER:
m_DevParamData.auiSiteNumber = Data.toUInt();
break;
case D_SCOPE_TYPE:
m_DevParamData.auiScopeType = Data.toUInt();
break;
case D_HEIGHT_TYPE:
m_DevParamData.auiHeightType = Data.toUInt();
break;
case D_ROTATION_TYPE:
m_DevParamData.auiRotationType = Data.toUInt();
break;
case D_CUSTOM_NUMBER:
m_DevParamData.auiCustomNumber = Data.toUInt();
break;
case D_BB_HARDWARE_VER_MAIN:
m_DevParamData.auiBBHardVerMain = Data.toUInt();
break;
case D_BB_HARDWARE_VER_SUB:
m_DevParamData.auiBBHardVerSub = Data.toUInt();
break;
case D_BB_HARDWARE_VER_ITER:
m_DevParamData.auiBBHardVerIter = Data.toUInt();
break;
case D_BB_SOFTWARE_VER_MAIN:
m_DevParamData.auiBBSoftVerMain = Data.toUInt();
break;
case D_BB_SOFTWARE_VER_SUB:
m_DevParamData.auiBBSoftVerSub = Data.toUInt();
break;
case D_BB_SOFTWARE_VER_ITER:
m_DevParamData.auiBBSoftVerIter = Data.toUInt();
break;
case D_CABLE_TORSION:
m_DevParamData.aiCableTorsion = Data.toInt();
break;
case D_ANGLE_Z_ZERO:
m_DevParamData.auiAngleZZero = Data.toUInt();
break;
case D_FACEID_CTL:
m_DevParamData.auiFaceIdCtl = Data.toUInt();
break;
case D_MODIFY_PW:
m_DevParamData.auiPassWord = Data.toUInt();
break;
case D_TIME_STAMP:
m_DevParamData.auiTimeStamp = Data.toUInt();
break;
case D_ENCODER_ADDR:
m_DevParamData.auiEncoderAddr = Data.toUInt();
break;
case D_EXPORT_PROGRESS:
m_DevParamData.auiExportProgress = Data.toUInt();
break;
case D_SCOPE_SENSOR_RESET:
m_DevParamData.auiScopeSensorReset = Data.toUInt();
break;
case D_HIGHT_SENSOR_RESET:
m_DevParamData.auiHightSensorReset = Data.toUInt();
break;
case D_ALL_DATA:
case D_DATA_UPDATE_FINISH:
break;
default:
Result = false;
break;
}
if(Result){
emit DevParamDataChange(index);
}
}
void DataDictionary::SetSignalParamData(SignalParamDataIndex_t index,QString Data)
{
int DevIndex = ((index & ~SC_PARAM_INDEX_BASE) >> 4);
int DataIndex = (index & 0xF);
if(DevIndex <= SIGNAL_DEV_CNT && DevIndex > 0 \
&& DataIndex >= 0 && DataIndex < SIGNAL_DATA_CNT)
{
switch(DataIndex)
{
case 0:
m_SignalParamData.afStartScope[DevIndex-1] = Data.toDouble();
break;
case 1:
m_SignalParamData.afEndScope[DevIndex-1] = Data.toDouble();
break;
case 2:
m_SignalParamData.afStartHeight[DevIndex-1] = Data.toDouble();
break;
case 3:
m_SignalParamData.afEndHeight[DevIndex-1] = Data.toDouble();
break;
case 4:
m_SignalParamData.auiStartAngle[DevIndex-1] = Data.toUInt();
break;
case 5:
m_SignalParamData.auiEndAngle[DevIndex-1] = Data.toUInt();
break;
}
emit SignalParamDataChange(index);
}
}
void DataDictionary::SetMultipleParamData(MultipleParamDataIndex_t index,QString Data)
{
int DevIndex = ((index & ~MC_PARAM_INDEX_BASE) >> 4);
int DataIndex = (index & 0xF);
if(DevIndex <= MULTIPLE_DEV_CNT && DevIndex > 0 \
&& DataIndex >= 0 && DataIndex < MULTIPLE_DATA_CNT)
{
switch(DataIndex)
{
case 0:
m_MultipleParamData.auiDevId[DevIndex-1] = Data.toUInt();
break;
case 1:
m_MultipleParamData.afArmLength[DevIndex-1] = Data.toDouble();
break;
case 2:
m_MultipleParamData.afRelativeDistance[DevIndex-1] = Data.toDouble();
break;
case 3:
m_MultipleParamData.auiRelativeAngle[DevIndex-1] = Data.toUInt();
break;
case 4:
m_MultipleParamData.afRelativeHeight[DevIndex-1] = Data.toDouble();
break;
case 5:
m_MultipleParamData.auiTowerId[DevIndex-1] = Data.toUInt();
break;
}
emit MultipleParamDataChange(index);
}else if(index == MC_DATA_UPDATE_FINISH){
emit MultipleParamDataChange(MC_DATA_UPDATE_FINISH);
}
}
void DataDictionary::CleanPersonInfo()
{
bool Flag = false;
while(!m_PersonInfoJson.isEmpty()){
QJsonValue ValueL = m_PersonInfoJson[0];
QJsonObject ObjectL = ValueL.toObject();
PersonInfoDelete(ObjectL["person_id"].toString());
m_PersonInfoJson.removeFirst();
Flag = true;
}
m_PersonInfoList.clear();
if(Flag){
emit PersonInfoDeleteAll();
PersonInfoChange();
}
}
void DataDictionary::CleanPersonInfo(QString uuid)
{
qDebug() << __func__ << ":" << __LINE__;
bool Flag = false;
for (int32_t j = 0;j < m_PersonInfoJson.count();j++) {
QJsonValue ValueL = m_PersonInfoJson[j];
QJsonObject ObjectL = ValueL.toObject();
if(ObjectL["person_id"].toString() == uuid ){
m_PersonInfoJson.removeAt(j);
PersonInfoDelete(ObjectL["person_id"].toString());
Flag = true;
break;
}
}
for (int32_t j = 0;j < m_PersonInfoList.count();j++) {
if(m_PersonInfoList[j].Uuid == uuid ){
m_PersonInfoList.removeAt(j);
break;
}
}
if(Flag){
emit PersonInfoChange(PERSON_INFO_LOCAL_REG);
PersonInfoChange();
}
}
PersonInfo_t DataDictionary::UuidSearchPersonInfo(QString Uuid)
{
PersonInfo_t Tmp;
Tmp.Name.clear();
Tmp.Uuid.clear();
Tmp.Pic.clear();
Tmp.IsReg.clear();
Tmp.Time.clear();
for(int32_t i = 0;i < m_PersonInfoList.count();i++){
Tmp = m_PersonInfoList.at(i);
if(Tmp.Uuid == Uuid){
break;
}
}
return Tmp;
}
QList<PersonInfo_t> DataDictionary::GetPersonList()
{
return m_PersonInfoList;
}
int32_t DataDictionary::GetPersonCnt()
{
return m_PersonInfoList.size();
}
void DataDictionary::SetPersonInfoToList(QJsonArray Data)
{
for (int32_t i = 0;i < Data.count();i++) {
QJsonValue Value = Data[i];
QJsonObject Object = Value.toObject();
SetPersonInfoToList(Object);
}
}
void DataDictionary::SetPersonInfoToList(QJsonObject Data)
{
PersonInfo_t Tmp;
if(Data.contains("person_id")){
Tmp.Uuid = Data["person_id"].toString();
}else {
return ;
}
if(Data.contains("person_code")){
Tmp.Id = Data["person_code"].toString();
}else {
return ;
}
if(Data.contains("person_name")){
Tmp.Name = Data["person_name"].toString();
}else {
return ;
}
if(Data.contains("img")){
Tmp.Pic = Data["img"].toString();
}else {
return ;
}
qDebug() << __func__ << ":" << Data["Reg"].toString();
if(Data.contains("Reg")){
Tmp.IsReg = Data["Reg"].toString();
}else {
return ;
}
if(Data.contains("person_timestamp")){
Tmp.Time = Data["person_timestamp"].toString();
}else {
return ;
}
m_PersonInfoList.push_back(Tmp);
}
QString DataDictionary::GetMonitorRtData(MonitorRtDataIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case M_WEIGHT:
Result.setNum(m_MonitorRtData.afWeight);
Result = QString::number(m_MonitorRtData.afWeight, 'f', 2);
break;
case M_SCOPE:
Result.setNum(m_MonitorRtData.afScope);
Result = QString::number(m_MonitorRtData.afScope, 'f', 2);
break;
case M_HEIGHT:
Result.setNum(m_MonitorRtData.afHeight);
Result = QString::number(m_MonitorRtData.afHeight, 'f', 2);
break;
case M_ROTATION:
Result.setNum(m_MonitorRtData.auiRotation);
break;
case M_MOMENT:
Result.setNum(m_MonitorRtData.afMoment);
Result = QString::number(m_MonitorRtData.afMoment, 'f', 1);
break;
case M_MOMENTFORCE:
Result.setNum(m_MonitorRtData.afMomentForce);
break;
case M_WINDSPEED:
Result.setNum(m_MonitorRtData.afWindSpeed);
Result = QString::number(m_MonitorRtData.afWindSpeed, 'f', 2);
break;
case M_ANGLEX:
Result.setNum(m_MonitorRtData.afAngleX);
Result = QString::number(m_MonitorRtData.afAngleX, 'f', 2);
break;
case M_ANGLEY:
Result.setNum(m_MonitorRtData.afAngleY);
Result = QString::number(m_MonitorRtData.afAngleY, 'f', 2);
break;
case M_RATEDWEIGHT:
Result.setNum(m_MonitorRtData.afRatedWeight);
Result = QString::number(m_MonitorRtData.afRatedWeight, 'f', 2);
break;
case M_WEIGHT_SIG:
Result.setNum(m_MonitorRtData.auiWeightSig);
break;
case M_SCOPE_SIG:
Result.setNum(m_MonitorRtData.auiScopeSig);
break;
case M_HEIGHT_SIG:
Result.setNum(m_MonitorRtData.auiHeightSig);
break;
case M_ROTATION_SIG:
Result.setNum(m_MonitorRtData.auiRotationSig);
break;
case M_WINDSPEED_SIG:
Result.setNum(m_MonitorRtData.auWindSpeedSig);
break;
case M_ANGLEX_SIG:
Result.setNum(m_MonitorRtData.auAngleXSig);
break;
case M_ANGLEY_SIG:
Result.setNum(m_MonitorRtData.auAngleYSig);
break;
case M_TOWERCRANE_STA:
Result.setNum(m_MonitorRtData.auiTowerCraneSta);
break;
case M_MUL_ID1_ROTATION:
Result.setNum(m_MonitorRtData.auMulId1Rotation);
break;
case M_MUL_ID1_SCOPE:
Result.setNum(m_MonitorRtData.afMulId1Scope);
break;
case M_MUL_ID1_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId1Height);
break;
case M_MUL_ID2_ROTATION:
Result.setNum(m_MonitorRtData.auMulId2Rotation);
break;
case M_MUL_ID2_SCOPE:
Result.setNum(m_MonitorRtData.afMulId2Scope);
break;
case M_MUL_ID2_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId2Height);
break;
case M_MUL_ID3_ROTATION:
Result.setNum(m_MonitorRtData.auMulId3Rotation);
break;
case M_MUL_ID3_SCOPE:
Result.setNum(m_MonitorRtData.afMulId3Scope);
break;
case M_MUL_ID3_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId3Height);
break;
case M_MUL_ID4_ROTATION:
Result.setNum(m_MonitorRtData.auMulId4Rotation);
break;
case M_MUL_ID4_SCOPE:
Result.setNum(m_MonitorRtData.afMulId4Scope);
break;
case M_MUL_ID4_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId4Height);
break;
case M_MUL_ID5_ROTATION:
Result.setNum(m_MonitorRtData.auMulId5Rotation);
break;
case M_MUL_ID5_SCOPE:
Result.setNum(m_MonitorRtData.afMulId5Scope);
break;
case M_MUL_ID5_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId5Height);
break;
case M_MUL_ID6_ROTATION:
Result.setNum(m_MonitorRtData.auMulId6Rotation);
break;
case M_MUL_ID6_SCOPE:
Result.setNum(m_MonitorRtData.afMulId6Scope);
break;
case M_MUL_ID6_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId6Height);
break;
case M_MUL_ID7_ROTATION:
Result.setNum(m_MonitorRtData.auMulId7Rotation);
break;
case M_MUL_ID7_SCOPE:
Result.setNum(m_MonitorRtData.afMulId7Scope);
break;
case M_MUL_ID7_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId7Height);
break;
case M_MUL_ID8_ROTATION:
Result.setNum(m_MonitorRtData.auMulId8Rotation);
break;
case M_MUL_ID8_SCOPE:
Result.setNum(m_MonitorRtData.afMulId8Scope);
break;
case M_MUL_ID8_HEIGHT:
Result.setNum(m_MonitorRtData.afMulId8Height);
break;
case M_ALARM_STA:
Result.setNum(m_MonitorRtData.auiRtAlarm);
break;
case M_NETWORK_STA:
Result.setNum(m_MonitorRtData.auiNetworkSta);
break;
case M_SENSOR_STA:
Result.setNum(m_MonitorRtData.auiSensorSta );
break;
case M_CB_COLTAGE:
Result.setNum(m_MonitorRtData.afCbColtage );
break;
case M_CB_STA:
Result.setNum(m_MonitorRtData.auiCbSta );
break;
case M_EL_QUANTITY:
Result.setNum(m_MonitorRtData.afELQuantity );
break;
case M_CB_CON_STA:
Result.setNum(m_MonitorRtData.auiCbConSta );
break;
case M_LASER_STA:
Result.setNum(m_MonitorRtData.auiLaserSta );
break;
case M_EME_BATT_STA:
Result.setNum(m_MonitorRtData.auiEmeBattSta );
break;
case M_EME_BATT_QUANTITY:
Result.setNum(m_MonitorRtData.afEmeBattQuantity );
break;
case M_LONGITUDE:
Result.setNum(m_MonitorRtData.afLongtitude );
break;
case M_LATITUDE:
Result.setNum(m_MonitorRtData.afLatitude );
break;
case M_CABLE_TORSION:
Result.setNum(m_MonitorRtData.aiCableTorsion );
break;
case M_ANGLEZ:
Result.setNum(m_MonitorRtData.afAngleZ);
Result = QString::number(m_MonitorRtData.afAngleZ, 'f', 2);
break;
case M_ANGLEZ_SIG:
Result.setNum(m_MonitorRtData.auiAngleZSig);
break;
case M_CTL_STA:
Result.setNum(m_MonitorRtData.auiCtlSta);
break;
default:
break;
}
return Result;
}
QString DataDictionary::GetDevParamData(DevParamDataIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case D_WEIGHT_LL:
Result.setNum(m_DevParamData.afWeightLL);
break;
case D_WEIGHT_LL_SIG:
Result.setNum(m_DevParamData.auiWeightLLSig);
break;
case D_WEIGHT_UL:
Result.setNum(m_DevParamData.afWeightUL);
break;
case D_WEIGHT_UL_SIG:
Result.setNum(m_DevParamData.auiWeightULSig);
break;
case D_SCOPE_LL:
Result.setNum(m_DevParamData.afScopeLL);
break;
case D_SCOPE_LL_SIG:
Result.setNum(m_DevParamData.auiScopeLLSig);
break;
case D_SCOPE_UL:
Result.setNum(m_DevParamData.afScopeUL);
break;
case D_SCOPE_UL_SIG:
Result.setNum(m_DevParamData.auiScopeULSig);
break;
case D_HEIGHT_LL:
Result.setNum(m_DevParamData.afHeightLL);
break;
case D_HEIGHT_LL_SIG:
Result.setNum(m_DevParamData.auiHeightLLSig);
break;
case D_HEIGHT_UL:
Result.setNum(m_DevParamData.afHeightUL);
break;
case D_HEIGHT_UL_SIG:
Result.setNum(m_DevParamData.auiHeightULSig);
break;
case D_ROTATION_LL:
Result.setNum(m_DevParamData.afRotationLL);
break;
case D_ROTATION_LL_SIG:
Result.setNum(m_DevParamData.auiRotationLLSig);
break;
case D_ROTATION_UL:
Result.setNum(m_DevParamData.afRotationUL);
break;
case D_ROTATION_UL_SIG:
Result.setNum(m_DevParamData.auiRotationULSig);
break;
case D_WIND_ZERO:
Result.setNum(m_DevParamData.auiWindZero);
break;
case D_WIND_RATIO:
Result.setNum(m_DevParamData.afWindRatio);
break;
case D_ANGLE_X_ZERO:
Result.setNum(m_DevParamData.auiAngleXZero);
break;
case D_ANGLE_Y_ZERO:
Result.setNum(m_DevParamData.auiAngleYZero);
break;
case D_START_WEIGHT:
Result.setNum(m_DevParamData.afStartWeight);
break;
case D_START_SCOPE:
Result.setNum(m_DevParamData.afStartScope);
break;
case D_MID_WEIGHT:
Result.setNum(m_DevParamData.afMidWeight);
break;
case D_MID_SCOPE:
Result.setNum(m_DevParamData.afMidScope);
break;
case D_END_WEIGHT:
Result.setNum(m_DevParamData.afEndWeight);
break;
case D_END_SCOPE:
Result.setNum(m_DevParamData.afEndScope );
break;
case D_DEV_ID:
Result.setNum(m_DevParamData.auiDevId);
break;
case D_ARM_LENGTH:
Result.setNum(m_DevParamData.afArmLength);
break;
case D_HEIGHT: /** 高度 */
Result.setNum(m_DevParamData.afHeight);
break;
case D_BALARM_LENGHT: /** 塔机平衡臂长 */
Result.setNum(m_DevParamData.afBalArmLenght);
break;
case D_TOWER_CAP_HEIGHT: /** 塔帽高度 */
Result.setNum(m_DevParamData.afTowerCapHeight);
break;
case D_TOWER_RATIO: /** 塔机倍率 */
Result.setNum(m_DevParamData.auiTowerRatio);
break;
case D_TOWER_CTL_FUNC: /** 塔机控制功能 */
Result.setNum(m_DevParamData.auiTowerCtlFunc);
break;
case D_TOWER_CAR_FRONT: /** 塔机小车前进测试 */
Result.setNum(m_DevParamData.auiTowerCarFront);
break;
case D_TOWER_CAR_BACK: /** 塔机小车后退测试 */
Result.setNum(m_DevParamData.auiTowerCarBack);
break;
case D_TOWER_CAR_UP: /** 塔机高度向上测试 */
Result.setNum(m_DevParamData.auiTowerCarUp);
break;
case D_TOWER_CAR_DOWN: /** 塔机高度向下测试 */
Result.setNum(m_DevParamData.auiTowerCarDown);
break;
case D_TOWER_CAR_LEFT: /** 塔机左转测试 */
Result.setNum(m_DevParamData.auiTowerCarLeft);
break;
case D_TOWER_CAR_RIGHT: /** 塔机右转测试 */
Result.setNum(m_DevParamData.auiTowerCarRight);
break;
case D_TOWER_SYS_DEBUG: /** 系统调试状态 */
Result.setNum(m_DevParamData.auiTowerSysDebug);
break;
// case D_TOWER_ID: /** 塔机编号,仅做显示不设置到设备 */
// Result.setNum(m_DevParamData.auiTowerId);
// break;
case D_SENSOR_TYPE:
Result.setNum(m_DevParamData.auiSensorType);
break;
case D_ALARM_ENABLE:
Result.setNum(m_DevParamData.auiAlarmEnable);
break;
case D_HEIGHT_ZERO:
Result.setNum(m_DevParamData.auiHeightZero);
break;
case D_ANGLE_PREALARM_V:
Result.setNum(m_DevParamData.afAnglePreAlarmV);
break;
case D_ANGLE_ALARM_V:
Result.setNum(m_DevParamData.afAngleAlarmV);
break;
case D_WIND_PREALARM_V:
Result.setNum(m_DevParamData.afWindPreAlarmV);
break;
case D_WIND_ALARM_V:
Result.setNum(m_DevParamData.afWindAlarmV);
break;
case D_SCOPE_PREALARM_V:
Result.setNum(m_DevParamData.afScopePreAlarmV);
break;
case D_SCOPE_ALARM_V:
Result.setNum(m_DevParamData.afScopeAlarmV);
break;
case D_HEIGHT_PREALARM_V:
Result.setNum(m_DevParamData.afHeightPreAlarmV);
break;
case D_HEIGHT_ALARM_V:
Result.setNum(m_DevParamData.afHeightAlarmV);
break;
case D_CB_ID:
Result.setNum(m_DevParamData.auiCbId);
break;
case D_CB_CON:
Result.setNum(m_DevParamData.auiCbCon);
break;
case D_CB_MODE:
Result.setNum(m_DevParamData.auiCbMode);
break;
case D_CB_POWER_CTL:
Result.setNum(m_DevParamData.auiCbPowerCtl);
break;
case D_LASER_MODE:
Result.setNum(m_DevParamData.auiLaserMode);
break;
case D_CB_ENALBE:
Result.setNum(m_DevParamData.auiCbEnable);
break;
case D_LASER_ENABLE:
Result.setNum(m_DevParamData.auiLaserEnable);
break;
case D_SITE_NUMBER:
Result.setNum(m_DevParamData.auiSiteNumber);
break;
case D_SCOPE_TYPE:
Result.setNum(m_DevParamData.auiScopeType);
break;
case D_HEIGHT_TYPE:
Result.setNum(m_DevParamData.auiHeightType);
break;
case D_ROTATION_TYPE:
Result.setNum(m_DevParamData.auiRotationType);
break;
case D_CUSTOM_NUMBER:
Result.setNum(m_DevParamData.auiCustomNumber);
break;
case D_BB_HARDWARE_VER_MAIN:
Result.setNum(m_DevParamData.auiBBHardVerMain);
break;
case D_BB_HARDWARE_VER_SUB:
Result.setNum(m_DevParamData.auiBBHardVerSub);
break;
case D_BB_HARDWARE_VER_ITER:
Result.setNum(m_DevParamData.auiBBHardVerIter);
break;
case D_BB_SOFTWARE_VER_MAIN:
Result.setNum(m_DevParamData.auiBBSoftVerMain);
break;
case D_BB_SOFTWARE_VER_SUB:
Result.setNum(m_DevParamData.auiBBSoftVerSub);
break;
case D_BB_SOFTWARE_VER_ITER:
Result.setNum(m_DevParamData.auiBBSoftVerIter);
break;
case D_CABLE_TORSION:
Result.setNum(m_DevParamData.aiCableTorsion);
break;
case D_ANGLE_Z_ZERO:
Result.setNum(m_DevParamData.auiAngleZZero);
break;
case D_FACEID_CTL:
Result.setNum(m_DevParamData.auiFaceIdCtl);
break;
case D_MODIFY_PW:
Result.setNum(m_DevParamData.auiPassWord);
break;
case D_TIME_STAMP:
Result.setNum(m_DevParamData.auiTimeStamp );
break;
case D_ENCODER_ADDR:
Result.setNum(m_DevParamData.auiEncoderAddr );
break;
case D_EXPORT_PROGRESS:
Result.setNum(m_DevParamData.auiExportProgress );
break;
case D_SCOPE_SENSOR_RESET:
Result.setNum(m_DevParamData.auiScopeSensorReset);
break;
case D_HIGHT_SENSOR_RESET:
Result.setNum(m_DevParamData.auiHightSensorReset);
break;
default:
break;
}
return Result;
}
QString DataDictionary::GetMisData(MisDataIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case MIS_SOFT_VER:
Result = m_MisData.sSoftVer;
break;
case MIS_CAMERA_STA1:
Result.setNum( m_MisData.aCameraSta1);
break;
case MIS_CAMERA_STA2:
Result.setNum( m_MisData.aCameraSta2);
break;
case MIS_CAMERA_STA3:
Result.setNum( m_MisData.aCameraSta3);
break;
case MIS_CAMERA_STA4:
Result.setNum( m_MisData.aCameraSta4);
break;
case MIS_SERIAL_STA:
Result.setNum( m_MisData.aSerialSta);
break;
case MIS_SERVICE_CON_STA:
Result.setNum( m_MisData.aServiceConSta);
break;
case MIS_CAMERA_STEP:
Result.setNum( m_MisData.fCameraStep);
break;
case MIS_CAMERA_STEP_CAL:
Result.setNum( m_MisData.fCameraStepCal);
break;
case MIS_CAMERA_MAX_ZOOM:
Result.setNum( m_MisData.fCameraMaxZoom);
break;
case MIS_CAMERA_MAX_DISTANCE:
Result.setNum( m_MisData.fCameraMaxDistance);
break;
case MIS_ALIGN_V_HEIGHT:
Result.setNum( m_MisData.fAlignVHeight);
break;
case MIS_ALIGN_V_ANGLE:
Result.setNum( m_MisData.fAlignVAngle);
break;
case MIS_ALIGN_V_HEIGHT_RATIO:
Result.setNum( m_MisData.fAlignVHeightRatio);
break;
case MIS_H_ANGLE_INIT:
Result.setNum( m_MisData.fHAngleInit);
break;
case MIS_ALIGN_STA:
Result.setNum( m_MisData.auiAlignSta);
break;
case MIS_HEIGHT_ZERO_POS:
Result.setNum(m_MisData.aHeightZeroPos);
break;
case MIS_VOLUME:
Result.setNum(m_MisData.aVolume);
break;
case MIS_CAMERA_GUN_STA:
Result.setNum(m_MisData.aCameraGunSta);
break;
case MIS_BLKBOX_SYNCSTA:
Result.setNum(m_MisData.aBlkBoxSyncSta);
break;
case MIS_BLKBOX_FACEIDSTA:
Result.setNum(m_MisData.aBlkBoxFaceIdSta);
break;
case MIS_BLKBOX_CMDSTA:
Result.setNum(m_MisData.aBlkBoxCmdSta);
break;
case MIS_BLKBOX_DTUSTA:
Result.setNum(m_MisData.aBlkBoxDTUSta);
break;
case MIS_BLKBOX_SYNCREQ:
Result.setNum(m_MisData.aBlkBoxSyncReq);
break;
case MIS_BLKBOX_FACEID_INFO:
Result.setNum(m_MisData.aBlkBoxFaceIdInfo);
break;
case MIS_NEW_OR_OLD_BLKBOX:
Result.setNum(m_MisData.aiNewOrOldBB);
break;
case MIS_FOLLOW_HOOK_FRQ:
Result.setNum(m_MisData.aiFHookFrq);
break;
case MIS_LOCK_SCREEN:
Result.setNum(m_MisData.aiLockScreen);
break;
case MIS_FACEID_STA:
Result.setNum(m_MisData.aiFaceIdSta);
break;
case MIS_FACEID_INFO:
Result = m_MisData.sFaceIdInfo;
break;
case MIS_BB_CMD:
Result.setNum(m_MisData.aiBBCmd);
break;
case MIS_DTU1_ADDR:
Result = m_MisData.sDTU1Addr;
break;
case MIS_DTU1_PORT:
Result.setNum(m_MisData.aiDTU1Port );
break;
case MIS_DTU2_ADDR:
Result = m_MisData.sDTU2Addr;
break;
case MIS_DTU2_PORT:
Result.setNum(m_MisData.aiDTU2Port);
break;
case MIS_DTU3_ADDR:
Result = m_MisData.sDTU3Addr;
break;
case MIS_DTU3_PORT:
Result.setNum(m_MisData.aiDTU3Port );
break;
case MIS_DTU4_ADDR:
Result = m_MisData.sDTU4Addr;
break;
case MIS_DTU4_PORT:
Result.setNum(m_MisData.aiDTU4Port);
break;
case MIS_SAVE_TIME:
Result = m_MisData.sSaveTime;
break;
case MIS_FACEID_TIMEOUT:
Result.setNum(m_MisData.aiFaceTimeout);
break;
case MIS_DATE_CLOCK_TYPE:
Result.setNum(m_MisData.aiDateClockType);
break;
case MIS_FACEID_CMP_VALUE:
Result.setNum(m_MisData.aiFaceIdCmpValue);
break;
case MIS_DISPLAY_INTERVAL1:
Result.setNum(m_MisData.aiDisplayInterval1);
break;
case MIS_DISPLAY_INTERVAL2:
Result.setNum(m_MisData.aiDisplayInterval2);
break;
case MIS_DISPLAY_INTERVAL3:
Result.setNum(m_MisData.aiDisplayInterval3);
break;
case MIS_DISPLAY_INTERVAL4:
Result.setNum(m_MisData.aiDisplayInterval4);
break;
case MIS_BLKBOX_SEARCH_TOWER:
Result.setNum(m_MisData.aiBlkBoxSearchTower);
break;
case MIS_CUSTOM_ALM_MSG:
Result = m_MisData.sCustomAlmMsg;
break;
case MIS_CUSTOM_ALM_TIMER:
Result.setNum(m_MisData.aiCustomAlmTimer);
break;
case MIS_NET_DEV:
Result = m_MisData.sNetDev;
break;
case MIS_NET_TYPE:
Result.setNum(m_MisData.aiNetType);
break;
case MIS_NET_IP:
Result = m_MisData.sNetIp;
break;
case MIS_NET_MASK:
Result = m_MisData.sNetMask;
break;
case MIS_NET_GATEWAY:
Result = m_MisData.sNetGateway ;
break;
case MIS_NET_DNS:
Result = m_MisData.sNetDns;
break;
// case MIS_FACEID_SUCCESS_UUID:
// Result = m_MisData.sFaceIdSuccessUuid;
// break;
default:
break;
}
return Result;
}
void DataDictionary::GetMisData(MisDataIndex_t index, QStringList &List)
{
switch (index) {
case MIS_SERIALPORTLIST:
List = m_MisData.lSerialPortList;
break;
case MIS_BAUDRATELIST:
List = m_MisData.lBaudRateList;
break;
default:
break;
}
}
void DataDictionary::GetMisData(MisDataIndex_t index, PersonInfo_t &List)
{
switch (index) {
case MIS_FACEID_SUCCESS_UUID:
List = m_MisData.sFaceIdSuccessUuid;
break;
default:
break;
}
}
void DataDictionary::GetMisData(MisDataIndex_t index,QList<struct SearchData> &List)
{
switch (index) {
case MIS_BLKBOX_SEARCH_TOWER_RES:
List = m_MisData.alBlkBoxSearchTowerRes;
break;
default:
break;
}
}
void DataDictionary::GetMisData(MisDataIndex_t index,QImage &Img)
{
switch (index) {
case MIS_SHOT_NET_CAM1_RES:
Img = m_MisData.iCam1Image;
break;
case MIS_SHOT_NET_CAM2_RES:
Img = m_MisData.iCam2Image;
break;
case MIS_SHOT_NET_CAM3_RES:
Img = m_MisData.iCam3Image;
break;
case MIS_SHOT_NET_CAM4_RES:
Img = m_MisData.iCam4Image;
break;
case MIS_SHOT_LOCAL_CAM_RES:
Img = m_MisData.iCamLocalImage;
break;
default:
break;
}
}
QString DataDictionary::GetResetData(ResetDataIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case RESET_ALIGN_V_ANGLE:
Result.setNum(m_ResteData.fResetAlignVAngle);
break;
case RESET_ALIGN_V_HEIGHT:
Result.setNum( m_ResteData.fResetAlignVHeight);
break;
case RESET_ALIGN_V_HEIGHT_RATIO:
Result.setNum(m_ResteData.fResetAlignVHeightRatio);
break;
default:
break;
}
return Result;
}
QString DataDictionary::GetCameraCtlData(CameraCtlIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case CAM_REQ_H_ANGLE:
Result.setNum(m_CameraCtlData.fReqHAngle);
break;
case CAM_REQ_H_VALUE:
Result.setNum(m_CameraCtlData.fReqHValue);
break;
case CAM_CUR_H_ANGLE:
Result.setNum(m_CameraCtlData.fCurHAngle);
break;
case CAM_CUR_H_VALUE:
Result.setNum(m_CameraCtlData.fCurHValue);
break;
case CAM_REQ_V_ANGLE:
Result.setNum(m_CameraCtlData.fReqVAngle);
break;
case CAM_REQ_V_VALUE:
Result.setNum(m_CameraCtlData.fReqVValue);
break;
case CAM_CUR_V_ANGLE:
Result.setNum(m_CameraCtlData.fCurVAngle);
break;
case CAM_CUR_V_VALUE:
Result.setNum(m_CameraCtlData.fCurVValue);
break;
case CAM_REQ_ZOOM_VALUE:
Result.setNum(m_CameraCtlData.fReqZoomValue);
break;
case CAM_REQ_ZOOM_FROCE:
Result.setNum(m_CameraCtlData.fReqZoomFroce);
break;
case CAM_CUR_ZOOM_VALUE:
Result.setNum(m_CameraCtlData.fCurZoomValue);
break;
case CAM_SET_NET_RES:
Result = m_CameraCtlData.sSetCamNetRes;
break;
case CAM_SET_CONF_RES:
Result = m_CameraCtlData.sSetCamConfRes;
break;
case CAM_SYSTEM_REBOOT_RES:
Result = m_CameraCtlData.sSystemRebootRes;
break;
default:
break;
}
return Result;
}
bool DataDictionary::GetCameraCtlData(CameraCtlIndex_t index, GetCameraInfoSt_t &Result)
{
switch (index) {
case CAM_GET_NETWORK_INFO:
Result = m_CameraCtlData.sCamGetNetWorkInfo;
break;
case CAM_GET_CONF_INFO:
Result = m_CameraCtlData.sCamGetConfigInfo;
break;
case CAM_SYSTEM_REBOOT:
Result = m_CameraCtlData.sCamSystemReboot;
break;
default:
break;
}
}
void DataDictionary::GetCameraList(QList<CameraInfo_t> &list)
{
list = m_CameraCtlData.aCamList;
}
void DataDictionary::GetCameraNetworkList(QList<CameraNetworkInfo_t> &list)
{
list = m_CameraCtlData.aCamNetworkList;
}
void DataDictionary::GetCameraConfigList(QList<CameraConfigInfo_t> &list)
{
list = m_CameraCtlData.aCamConfList;
}
QString DataDictionary::GetSystemData(SystemDataIndex_t index)
{
QString Result;
Result.clear();
switch (index) {
case SYS_CAMERA_PASSWORD1:
Result = m_SystemData.sCameraPassWord1 ;
break;
case SYS_CAMERA_USERNAME1:
Result = m_SystemData.sCameraUserName1;
break;
case SYS_CAMERA_IP1:
Result = m_SystemData.sCameraIp1;
break;
case SYS_CAMERA_PORT1:
Result = m_SystemData.sCameraPort1;
break;
case SYS_CAMERA_PASSWORD2:
Result = m_SystemData.sCameraPassWord2 ;
break;
case SYS_CAMERA_USERNAME2:
Result = m_SystemData.sCameraUserName2;
break;
case SYS_CAMERA_IP2:
Result = m_SystemData.sCameraIp2;
break;
case SYS_CAMERA_PORT2:
Result = m_SystemData.sCameraPort2;
break;
case SYS_CAMERA_PASSWORD3:
Result = m_SystemData.sCameraPassWord3 ;
break;
case SYS_CAMERA_USERNAME3:
Result = m_SystemData.sCameraUserName3;
break;
case SYS_CAMERA_IP3:
Result = m_SystemData.sCameraIp3;
break;
case SYS_CAMERA_PORT3:
Result = m_SystemData.sCameraPort3;
break;
case SYS_CAMERA_PASSWORD4:
Result = m_SystemData.sCameraPassWord4;
break;
case SYS_CAMERA_USERNAME4:
Result = m_SystemData.sCameraUserName4;
break;
case SYS_CAMERA_IP4:
Result = m_SystemData.sCameraIp4;
break;
case SYS_CAMERA_PORT4:
Result = m_SystemData.sCameraPort4;
break;
case SYS_CAMERA_PATH:
Result = m_SystemData.sCameraPath;
break;
case SYS_PTZ_ADDR:
Result = m_SystemData.sPtzAddr;
break;
case SYS_PTZ_PORT:
Result = m_SystemData.sPtzPort;
break;
case SYS_CAMERA_URL1:
Result = m_SystemData.sCameraUrl1;
break;
case SYS_CAMERA_URL2:
Result = m_SystemData.sCameraUrl2;
break;
case SYS_CAMERA_URL3:
Result = m_SystemData.sCameraUrl3;
break;
case SYS_CAMERA_URL4:
Result = m_SystemData.sCameraUrl4;
break;
case SYS_SERIAL_COM:
Result = m_SystemData.sSerialCom;
break;
case SYS_BAUD_RATE:
Result = m_SystemData.sBaudRate;
break;
case SYS_LOG_SAV_DAY:
Result.setNum( m_SystemData.auiLogSavDay);
break;
case SYS_DATA_SAV_DAY:
Result.setNum( m_SystemData.auiDataSavDay);
break;
case SYS_DEBUG:
Result.setNum( m_SystemData.auiDebug);
break;
case SYS_PASSWORD:
Result = m_SystemData.sPassWord;
break;
case SYS_PASSWORD_MD5:
Result = m_SystemData.sPassWordMd5;
break;
case SYS_SUPER_PASSWORD:
Result = m_SystemData.sSuperPassWord;
break;
case SYS_OSD_DEVICE:
Result.setNum(m_SystemData.auiOSDDevice);
break;
case SYS_OSD_PORT:
Result.setNum(m_SystemData.auiOSDPort);
break;
case SYS_OSD_X_POS:
Result.setNum(m_SystemData.aiOSDXPos);
break;
case SYS_OSD_Y_POS:
Result.setNum(m_SystemData.aiOSDYPos);
break;
case SYS_ON_DISPLAY:
Result.setNum(m_SystemData.aiOnDispay);
break;
case SYS_SPLIT_DISPLAY:
Result.setNum(m_SystemData.aiSplitDisplay);
break;
case SYS_LOGO_SHOW:
Result.setNum(m_SystemData.aiLogoShow);
break;
case SYS_FACEID_ENABLE:
Result.setNum(m_SystemData.aiFaceIdEnable);
break;
case SYS_FACEID_RUN:
Result.setNum(m_SystemData.aiFaceIdRun);
break;
case SYS_FACEID_JUMP:
Result.setNum(m_SystemData.aiFaceIdJump );
break;
case SYS_FACEID_POWER_UP_ENABLE:
Result.setNum(m_SystemData.aiFaceIdPowerUpEnable );
break;
case SYS_MODLE:
Result = m_SystemData.sModle;
break;
case SYS_LIMIT_SETTING_STA:
Result.setNum(m_SystemData.aiLimitSettingSta);
break;
case SYS_SPEED_SETTING_STA:
Result.setNum(m_SystemData.aiSpeedSettingSta);
break;
case SYS_MOMENT_SETTING_STA:
Result.setNum(m_SystemData.aiMomentSettingSta);
break;
case SYS_ANGLE_SETTING_STA:
Result.setNum(m_SystemData.aiAngleSettingSta);
break;
case SYS_TOWER_DEV_SETTING_STA:
Result.setNum(m_SystemData.aiTowerDevSettingSta);
break;
case SYS_LAST_REG_TIME:
Result.setNum(m_SystemData.aRegTime);
break;
case SYS_HTTP_SYNC_TIME:
Result.setNum(m_SystemData.aSyncTime);
break;
case SYS_SYNC_FACEID_HOST:
Result = m_SystemData.sSyncFaceidHost;
break;
case SYS_SYNC_FACEID_POST:
Result = m_SystemData.sSyncFaceidPost;
break;
case SYS_SYNC_FACEID_STATE_PATH:
Result = m_SystemData.sSyncFaceidStatePath;
break;
case SYS_SYNC_FACEID_INFO_PATH:
Result = m_SystemData.sSyncFaceidInfoPath;
break;
case SYS_SYNC_FACEID_FACE_PATH:
Result = m_SystemData.sSyncFaceidFacePath;
break;
case SYS_SYNC_FACEID_UPLOAD_PATH:
Result = m_SystemData.sSyncFaceidUploadPath;
break;
case SYS_SYNC_FACEID_CMD_PATH:
Result = m_SystemData.sSyncFaceidCmdPath;
break;
case SYS_SYNC_FACEID_RECOGNIZE_PATH:
Result = m_SystemData.sSyncFaceidRecognizePath;
break;
default:
break;
}
return Result;
}
QString DataDictionary::GetSignalParamData(SignalParamDataIndex_t index)
{
int DevIndex = ((index & ~SC_PARAM_INDEX_BASE) >> 4);
int DataIndex = (index & 0xF);
QString Result;
Result.clear();
if(DevIndex <= SIGNAL_DEV_CNT && DevIndex > 0 \
&& DataIndex >= 0 && DataIndex < SIGNAL_DATA_CNT)
{
switch(DataIndex)
{
case 0:
Result.setNum(m_SignalParamData.afStartScope[DevIndex-1]);
break;
case 1:
Result.setNum(m_SignalParamData.afEndScope[DevIndex-1]);
break;
case 2:
Result.setNum(m_SignalParamData.afStartHeight[DevIndex-1]);
break;
case 3:
Result.setNum(m_SignalParamData.afEndHeight[DevIndex-1]);
break;
case 4:
Result.setNum(m_SignalParamData.auiStartAngle[DevIndex-1]);
break;
case 5:
Result.setNum(m_SignalParamData.auiEndAngle[DevIndex-1]);
break;
}
}
return Result;
}
QString DataDictionary::GetMultipleParamData(MultipleParamDataIndex_t index)
{
int DevIndex = ((index & ~MC_PARAM_INDEX_BASE) >> 4);
int DataIndex = (index & 0xF);
QString Result;
Result.clear();
if(DevIndex <= MULTIPLE_DEV_CNT && DevIndex > 0 \
&& DataIndex >= 0 && DataIndex < MULTIPLE_DATA_CNT)
{
switch(DataIndex)
{
case 0:
Result.setNum(m_MultipleParamData.auiDevId[DevIndex-1]);
break;
case 1:
Result.setNum(m_MultipleParamData.afArmLength[DevIndex-1]);
break;
case 2:
Result.setNum(m_MultipleParamData.afRelativeDistance[DevIndex-1]);
break;
case 3:
Result.setNum(m_MultipleParamData.auiRelativeAngle[DevIndex-1]);
break;
case 4:
Result.setNum(m_MultipleParamData.afRelativeHeight[DevIndex-1]);
break;
case 5:
Result.setNum(m_MultipleParamData.auiTowerId[DevIndex-1]);
break;
}
}
return Result;
}
QJsonArray DataDictionary::GetPersonInfo(PersonInfoIndex_t index)
{
if(index == PERSON_INFO_SYNC){
return m_PersonInfoJson;
}
return QJsonArray();
}
QByteArray DataDictionary::GetMonitorRtDataAllToBigEndian()
{
QByteArray Result;
QByteArray Tmp;
Result.clear();
Tmp.clear();
Tmp.append((char*)&m_MonitorRtData.aYear,sizeof(m_MonitorRtData.aYear));
Result += ByteArrayToBigEndian(Tmp);
Result.append(m_MonitorRtData.aMon);
Result.append(m_MonitorRtData.aDay);
Result.append(m_MonitorRtData.aHour);
Result.append(m_MonitorRtData.aMin);
Result.append(m_MonitorRtData.aSec);
Tmp.clear();
Tmp.append((char*)&m_MonitorRtData.afWeight,sizeof(m_MonitorRtData.afWeight));
Result += ByteArrayToBigEndian(Tmp);
return Result;
}
QByteArray DataDictionary::GetMonitorRtDataAllToLitEndian()
{
QByteArray Result;
Result.clear();
Result.append((char*)&m_MonitorRtData,sizeof (m_MonitorRtData));
return Result;
}
QByteArray DataDictionary::GetDevParamDataAllToBigEndian()
{
QByteArray Result;
QByteArray Tmp;
Result.clear();
Tmp.clear();
Tmp.append((char*)&m_DevParamData.aCurYear,sizeof(m_DevParamData.aCurYear));
Result += ByteArrayToBigEndian(Tmp);
Result.append(m_DevParamData.aCurMon);
Result.append(m_DevParamData.aCurDay);
Result.append(m_DevParamData.aCurHour);
Result.append(m_DevParamData.aCurMin);
Result.append(m_DevParamData.aCurSec);
return Result;
}
QByteArray DataDictionary::GetDevParamDataAllToLitEndian()
{
QByteArray Result;
Result.clear();
Result.append((char*)&m_DevParamData,sizeof(m_DevParamData));
return Result;
}
QByteArray DataDictionary::GetUpdateInfoToBigEndian()
{
QByteArray Result;
QByteArray Tmp;
QDate Date = QDate::currentDate();
QTime Time = QTime::currentTime();
quint16 Year;
quint8 Mon;
quint8 Day;
quint8 Hour;
quint8 Min;
quint8 Sec;
Result.clear();
Tmp.clear();
Year = Date.year();
Tmp.append((char*)&Year,sizeof(Year));
Result += ByteArrayToBigEndian(Tmp);
Mon = Date.month();
Result.append(Mon);
Day = Date.day();
Result.append(Day);
Hour = Time.hour();
Result.append(Hour);
Min = Time.minute();
Result.append(Min);
Sec = Time.second();
Result.append(Sec);
return Result;
}
QString DataDictionary::GetRtAlarmInfo(qint32 AlarmNum)
{
QString Result;
Result.clear();
// if(AlarmNum & RT_BEARING_ALARM){
// Result += tr("重量报警");
// }
// if(AlarmNum & RT_BEARING_PRE_ALARM){
// Result += tr("重量预警");
// }
// if(AlarmNum & RT_FRONT_DOOR_ALARM){
// Result += tr("前门报警");
// }
// if(AlarmNum & RT_SPEED_ALARM){
// Result += tr("速度报警");
// }
// if(AlarmNum & RT_PEOPLE_CNT_ALARM){
// Result += tr("人数报警");
// }
// if(AlarmNum & RT_SENSOR_ALARM){
// Result += tr("传感器故障");
// }
// if(AlarmNum & RT_FALL_ALARM){
// Result += tr("坠落报警");
// }
// if(AlarmNum & RT_RUSH_TOP_ALARM){
// Result += tr("冲顶报警");
// }
return Result;
}
QByteArray DataDictionary::ByteArrayToBigEndian(QByteArray Data)
{
QByteArray Result;
Result.clear();
for(int32_t i = 0;i < Data.size();i++){
Result[i] = Data[Data.size()-i-1];
}
return Result;
}
void DataDictionary::SetSensorSta(bool Sta,quint32 Bit)
{
if(Sta)
{
m_DevParamData.auiSensorType |= (1 << Bit);
}
else
{
m_DevParamData.auiSensorType &= ~(1 << Bit);
}
emit DevParamDataChange(D_SENSOR_TYPE);
}
bool DataDictionary::GetSensorSta(quint32 Bit)
{
return ((m_DevParamData.auiSensorType & (1 << Bit)) ? true : false);
}
void DataDictionary::SetAlarmSta(bool Sta,quint32 Bit)
{
if(Sta)
{
m_DevParamData.auiAlarmEnable |= (1 << Bit);
}
else
{
m_DevParamData.auiAlarmEnable &= ~(1 << Bit);
}
emit DevParamDataChange(D_ALARM_ENABLE);
}
bool DataDictionary::GetAlarmSta(quint32 Bit)
{
return m_DevParamData.auiAlarmEnable & (1 << Bit) ? true : false;
}
void DataDictionary::RegisterPersonToSys(QString Uuid, QString Name, QString B64Pic)
{
emit RegisterPerson(Uuid,Name,B64Pic);
}
void DataDictionary::RegisterPersonToSys(PersonInfo_t Per)
{
emit RegisterPerson(Per);
}
void DataDictionary::SetPersonInfo(PersonInfoIndex_t index,QJsonArray Data)
{
qDebug() << __func__ << ":" << index;
bool Result = true;
bool Flag = false;
switch (index) {
case PERSON_INFO_INIT:
m_PersonInfoList.clear();
m_PersonInfoJson = Data;
SetPersonInfoToList(Data);
break;
case PERSON_INFO_SYNC:
{
CleanPersonInfo();
m_PersonInfoJson = Data;
for (int32_t j = 0;j < m_PersonInfoJson.count();j++) {
QJsonValue ValueL = m_PersonInfoJson[j];
QJsonObject ObjectL = ValueL.toObject();
if(ObjectL["sync_sta"].toString() == tr("NoSync"))
ObjectL.insert("Reg","0");
else
ObjectL.insert("Reg","1");
m_PersonInfoJson.removeAt(j);
m_PersonInfoJson.push_front(ObjectL);
PersonInfoAdd(ObjectL["person_id"].toString(),JsonToString(ObjectL));
}
// if(m_PersonInfoJson.isEmpty()){
// m_PersonInfoList.clear();
// m_PersonInfoJson = Data;
// for (int32_t j = 0;j < m_PersonInfoJson.count();j++) {
// QJsonValue ValueL = m_PersonInfoJson[j];
// QJsonObject ObjectL = ValueL.toObject();
// ObjectL.insert("Reg","1");
// m_PersonInfoJson.removeAt(j);
// m_PersonInfoJson.push_front(ObjectL);
// PersonInfoAdd(ObjectL["person_id"].toString(),JsonToString(ObjectL));
// }
// SetPersonInfoToList(m_PersonInfoJson);
// qDebug() << __func__ << ":" << index;
// }else {
// for (int32_t i = 0;i < Data.count();i++) {
// Flag = false;
// QJsonValue Value = Data[i];
// QJsonObject Object = Value.toObject();
// for (int32_t j = 0;j < m_PersonInfoJson.count();j++) {
// QJsonValue ValueL = m_PersonInfoJson[j];
// QJsonObject ObjectL = ValueL.toObject();
// if(ObjectL["person_id"].toString() == Object["person_id"].toString()){
// Flag = true;
// qDebug() << __func__ << ObjectL["person_id"].toString();
// if(ObjectL == Object){
// break;
// }
// Object.insert("Reg",ObjectL["Reg"].toString());
// m_PersonInfoJson.removeAt(j);
// m_PersonInfoJson.push_front(Object);
// PersonInfoUpdate(Object["person_id"].toString(),JsonToString(Object));
// break;
// }
// }
// if(Flag == false){
// Object.insert("Reg","1");
// m_PersonInfoJson.push_back(Object);
// SetPersonInfoToList(Object);
// PersonInfoAdd(Object["person_id"].toString(),JsonToString(Object));
// }
// }
m_PersonInfoList.clear();
SetPersonInfoToList(m_PersonInfoJson);
qDebug() << __func__ << ":" << index;
}
break;
case PERSON_INFO_LOCAL_REG:
for (int32_t i = 0;i < Data.count();i++) {
Flag = false;
QJsonValue Value = Data[i];
QJsonObject Object = Value.toObject();
for (int32_t j = 0;j < m_PersonInfoJson.count();j++) {
QJsonValue ValueL = m_PersonInfoJson[j];
QJsonObject ObjectL = ValueL.toObject();
if(ObjectL["person_id"].toString() == Object["person_id"].toString()){
if(ObjectL.contains("Reg")){
ObjectL.remove("Reg");
}
ObjectL.insert("Reg","0");
m_PersonInfoJson.removeAt(j);
m_PersonInfoJson.push_front(ObjectL);
PersonInfoUpdate(Object["person_id"].toString(),JsonToString(Object));
Flag = true;
break;
}
}
if(Flag == false){
Object.insert("Reg","0");
m_PersonInfoJson.push_back(Object);
SetPersonInfoToList(Object);
PersonInfoAdd(Object["person_id"].toString(),JsonToString(Object));
}
}
qDebug() << __func__ << ":" << index;
break;
case PERSON_INFO_UPDATE:
break;
default:
Result = false;
break;
}
if(Result){
emit PersonInfoChange(index);
PersonInfoChange();
}
}
QString JsonToString(const QJsonObject& json)
{
return QString(QJsonDocument(json).toJson(QJsonDocument::Compact));
}
QJsonObject StringToJson(const QString& str)
{
QJsonObject l_ret;
QJsonParseError l_err;
QJsonDocument l_doc = QJsonDocument::fromJson(str.toUtf8(), &l_err);
if (l_err.error == QJsonParseError::NoError)
{
if (l_doc.isObject())
{
l_ret = l_doc.object();
}
}
return l_ret;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qinxude/rk3568ui.git
[email protected]:qinxude/rk3568ui.git
qinxude
rk3568ui
rk3568ui
master

搜索帮助