1 Star 0 Fork 0

qinxude/rk3568ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
towercollisionsetting.cpp 29.41 KB
一键复制 编辑 原始数据 按行查看 历史
qinxude 提交于 2024-09-03 09:38 . 3568ui base
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
#include "towercollisionsetting.h"
#include "ui_towercollisionsetting.h"
TowerCollisionSetting::TowerCollisionSetting(QWidget *parent) :
QWidget(parent),
ui(new Ui::TowerCollisionSetting)
{
ui->setupUi(this);
this->hide();
m_DataDictionary = DataDictionary::GetInstance();
for(int i = 0;i < 9;i++)
{
if(i != 0)
{
m_TowerAnalog[i] = new TowerAnalog(ui->Map,true);
}
else
{
m_TowerAnalog[i] = new TowerAnalog(ui->Map);
}
//m_TowerAnalog[i]->SetRadius(125,10);
//m_TowerAnalog[i]->SetLineLen(135,6);
//m_TowerAnalog[i]->move(46,75);
m_TowerAnalog[i]->hide();
memset(&m_CraneInfo[i],0x0,sizeof(m_CraneInfo[i]));
}
m_TowerAnalog[0]->SetScopeEnable(true);
DisplayOverLook();
m_BBListScreen = new BBListScreen(this);
connect(m_DataDictionary,SIGNAL(MultipleParamDataChange(MultipleParamDataIndex_t)),
this,SLOT(MultipleParamDataChange(MultipleParamDataIndex_t)));
connect(m_DataDictionary,SIGNAL(MonitorRtDataChange(MonitorRtDataIndex_t)),
this,SLOT(MonitorRtDataChange(MonitorRtDataIndex_t)));
connect(m_DataDictionary,SIGNAL(DevParamDataChange(DevParamDataIndex_t)),
this,SLOT(DevParamDataChange(DevParamDataIndex_t)));
}
TowerCollisionSetting::~TowerCollisionSetting()
{
delete ui;
}
void TowerCollisionSetting::showEvent(QShowEvent *event)
{
FixAreaNum(1);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::GetMultipCraneInfo()
{
m_CraneInfo[0].auiDevId = m_DataDictionary->GetDevParamData(D_DEV_ID).toUInt();
m_CraneInfo[0].auiTowerId = m_DataDictionary->GetDevParamData(D_CUSTOM_NUMBER).toUInt();
m_CraneInfo[0].afArmLength = m_DataDictionary->GetDevParamData(D_ARM_LENGTH).toDouble();
m_CraneInfo[0].auiRelativeAngle = 0;
m_CraneInfo[0].afRelativeDistance = 0;
m_CraneInfo[0].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_ROTATION).toUInt();
m_CraneInfo[1].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_1).toUInt();
m_CraneInfo[1].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_1).toUInt();
m_CraneInfo[1].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_1).toDouble();
m_CraneInfo[1].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_1).toUInt();
m_CraneInfo[1].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_1).toDouble();
m_CraneInfo[1].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID1_ROTATION).toUInt();
m_CraneInfo[2].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_2).toUInt();
m_CraneInfo[2].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_2).toUInt();
m_CraneInfo[2].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_2).toDouble();
m_CraneInfo[2].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_2).toUInt();
m_CraneInfo[2].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_2).toDouble();
m_CraneInfo[2].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID2_ROTATION).toUInt();
m_CraneInfo[3].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_3).toUInt();
m_CraneInfo[3].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_3).toUInt();
m_CraneInfo[3].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_3).toDouble();
m_CraneInfo[3].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_3).toUInt();
m_CraneInfo[3].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_3).toDouble();
m_CraneInfo[3].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID3_ROTATION).toUInt();
m_CraneInfo[4].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_4).toUInt();
m_CraneInfo[4].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_4).toUInt();
m_CraneInfo[4].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_4).toDouble();
m_CraneInfo[4].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_4).toUInt();
m_CraneInfo[4].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_4).toDouble();
m_CraneInfo[4].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID4_ROTATION).toUInt();
m_CraneInfo[5].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_5).toUInt();
m_CraneInfo[5].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_5).toUInt();
m_CraneInfo[5].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_5).toDouble();
m_CraneInfo[5].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_5).toUInt();
m_CraneInfo[5].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_5).toDouble();
m_CraneInfo[5].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID5_ROTATION).toUInt();
m_CraneInfo[6].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_6).toUInt();
m_CraneInfo[6].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_6).toUInt();
m_CraneInfo[6].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_6).toDouble();
m_CraneInfo[6].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_6).toUInt();
m_CraneInfo[6].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_6).toDouble();
m_CraneInfo[6].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID6_ROTATION).toUInt();
m_CraneInfo[7].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_7).toUInt();
m_CraneInfo[7].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_7).toUInt();
m_CraneInfo[7].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_7).toDouble();
m_CraneInfo[7].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_7).toUInt();
m_CraneInfo[7].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_7).toDouble();
m_CraneInfo[7].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID7_ROTATION).toUInt();
m_CraneInfo[8].auiDevId = m_DataDictionary->GetMultipleParamData(MC_DEVID_8).toUInt();
m_CraneInfo[8].auiTowerId = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_8).toUInt();
m_CraneInfo[8].afArmLength = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_8).toDouble();
m_CraneInfo[8].auiRelativeAngle = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_8).toUInt();
m_CraneInfo[8].afRelativeDistance = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_8).toDouble();
m_CraneInfo[8].auiCurrentAngle = m_DataDictionary->GetMonitorRtData(M_MUL_ID8_ROTATION).toUInt();
}
void TowerCollisionSetting::DisplayOverLook()
{
int ShowScreenW = ui->Map->width()-2;
int ShowScreenH = ui->Map->height()-2;
int ShowMaxSize = (ShowScreenH > ShowScreenW) ? ShowScreenW : ShowScreenH;
double Ratio = ShowMaxSize;
double RatioTmp = 0;
for(int i = 1;i < 9;i++)
{
m_CraneInfo[i].auiShowX = 0;
m_CraneInfo[i].auiShowY = 0;
m_CraneInfo[i].afShowArmLength = 0;
if(m_CraneInfo[i].afRelativeDistance == 0 || \
m_CraneInfo[i].auiDevId == 0 || \
m_CraneInfo[0].afArmLength == 0)
{
continue;
}
else if(m_CraneInfo[i].afRelativeDistance > (m_CraneInfo[0].afArmLength + m_CraneInfo[i].afArmLength))
{
continue;
}
else
{
RatioTmp = ShowMaxSize/2/(m_CraneInfo[i].afRelativeDistance + m_CraneInfo[i].afArmLength);
if(Ratio > RatioTmp)
Ratio = RatioTmp;
}
}
if(Ratio >= ShowMaxSize)
{
m_CraneInfo[0].afShowArmLength = ShowMaxSize/2;
m_CraneInfo[0].auiShowX = ShowScreenW/2 - m_CraneInfo[0].afShowArmLength;
m_CraneInfo[0].auiShowY = ShowScreenH/2 - m_CraneInfo[0].afShowArmLength;
}
else
{
m_CraneInfo[0].auiShowX = ShowScreenW/2 - m_CraneInfo[0].afArmLength*Ratio;
m_CraneInfo[0].auiShowY = ShowScreenH/2 - m_CraneInfo[0].afArmLength*Ratio;
m_CraneInfo[0].afShowArmLength = m_CraneInfo[0].afArmLength*Ratio;
for(int i = 1;i < 9;i++)
{
if(m_CraneInfo[i].afRelativeDistance == 0 || \
m_CraneInfo[i].auiDevId == 0 || \
m_CraneInfo[0].afArmLength == 0)
{
continue;
}
else if(m_CraneInfo[i].afRelativeDistance > (m_CraneInfo[0].afArmLength + m_CraneInfo[i].afArmLength))
{
continue;
}
else
{
m_CraneInfo[i].auiShowX = ShowScreenW/2 + (m_CraneInfo[i].afRelativeDistance*Ratio*qSin(qDegreesToRadians((double)m_CraneInfo[i].auiRelativeAngle))) - m_CraneInfo[i].afArmLength*Ratio;
m_CraneInfo[i].auiShowY = ShowScreenH/2 - (m_CraneInfo[i].afRelativeDistance*Ratio*qCos(qDegreesToRadians((double)m_CraneInfo[i].auiRelativeAngle))) - m_CraneInfo[i].afArmLength*Ratio;
m_CraneInfo[i].afShowArmLength = m_CraneInfo[i].afArmLength*Ratio;
}
}
}
for(int i = 0;i < 9;i++)
{
if(m_CraneInfo[i].afShowArmLength != 0)
{
m_TowerAnalog[i]->SetRadius(m_CraneInfo[i].afShowArmLength,5);
m_TowerAnalog[i]->SetLineLen(m_CraneInfo[i].afShowArmLength,4);
m_TowerAnalog[i]->SetId(QString::number(m_CraneInfo[i].auiTowerId));
m_TowerAnalog[i]->move(m_CraneInfo[i].auiShowX,m_CraneInfo[i].auiShowY);
m_TowerAnalog[i]->show();
}
else
{
m_TowerAnalog[i]->hide();
}
m_TowerAnalog[i]->update();
}
ui->Map->update();
}
void TowerCollisionSetting::FixAreaNum(uint32_t index)
{
m_AreaIndex = index;
SetAllAlias(m_AreaIndex);
SetAreaNum(m_AreaIndex);
ShowTowerId();
ShowDevId();
ShowCurAngle();
ShowCurScope();
ShowArmLength();
ShowCurHeight();
ShowRelativeAngle();
ShowRelativeHeight();
ShowRelativeDistance();
MonitorRtDataChange(M_SCOPE);
MonitorRtDataChange(M_ROTATION);
MonitorRtDataChange(M_HEIGHT);
DevParamDataChange(D_ARM_LENGTH);
DevParamDataChange(D_HEIGHT);
}
void TowerCollisionSetting::SetAllAlias(uint32_t index)
{
ui->TowerId->SetAlias("塔机"+QString().number(index)+"编号");
ui->DevId->SetAlias("塔机"+QString().number(index)+"设备ID");
ui->ArmLength->SetAlias("塔机"+QString().number(index)+"臂长");
ui->RelativeDistance->SetAlias("塔机"+QString().number(index)+"相对距离");
ui->RelativeAngle->SetAlias("塔机"+QString().number(index)+"相对角度");
ui->RelativeHeight->SetAlias("塔机"+QString().number(index)+"相对高度");
}
void TowerCollisionSetting::SetAreaNum(uint32_t index)
{
ui->TowerNum->setText("塔机"+QString().number(index));
}
void TowerCollisionSetting::ShowTowerId()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_TOWER_ID_8);
ui->TowerId->setText(V);
}
void TowerCollisionSetting::ShowDevId()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_DEVID_8);
ui->DevId->setText(V);
}
void TowerCollisionSetting::ShowRelativeDistance()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_DISTANCE_8);
ui->RelativeDistance->setText(V);
}
void TowerCollisionSetting::ShowRelativeAngle()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_ANGLE_8);
ui->RelativeAngle->setText(V);
}
void TowerCollisionSetting::ShowRelativeHeight()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_RELATIVE_HEIGHT_8);
ui->RelativeHeight->setText(V);
}
void TowerCollisionSetting::ShowArmLength()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_1);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_2);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_3);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_4);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_5);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_6);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_7);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMultipleParamData(MC_ARM_LENGTH_8);
ui->ArmLength->setText(V);
}
void TowerCollisionSetting::SetTowerId(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_TOWER_ID_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::SetDevId(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_DEVID_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_DEVID_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_DEVID_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_DEVID_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_DEVID_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_DEVID_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_DEVID_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_DEVID_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::SetRelativeDistance(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_DISTANCE_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::SetRelativeAngle(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_ANGLE_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::SetRelativeHeight(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_RELATIVE_HEIGHT_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::SetArmLength(QString V)
{
if(m_AreaIndex <= 1)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_1,V);
else if(m_AreaIndex <= 2)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_2,V);
else if(m_AreaIndex <= 3)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_3,V);
else if(m_AreaIndex <= 4)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_4,V);
else if(m_AreaIndex <= 5)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_5,V);
else if(m_AreaIndex <= 6)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_6,V);
else if(m_AreaIndex <= 7)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_7,V);
else if(m_AreaIndex <= 8)
m_DataDictionary->SetMultipleParamData(MC_ARM_LENGTH_8,V);
GetMultipCraneInfo();
DisplayOverLook();
}
void TowerCollisionSetting::ShowCurHeight()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID1_HEIGHT);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID2_HEIGHT);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID3_HEIGHT);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID4_HEIGHT);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID5_HEIGHT);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID6_HEIGHT);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID7_HEIGHT);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID8_HEIGHT);
ui->CurHeight->setText(V);
}
void TowerCollisionSetting::ShowCurScope()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID1_SCOPE);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID2_SCOPE);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID3_SCOPE);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID4_SCOPE);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID5_SCOPE);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID6_SCOPE);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID7_SCOPE);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID8_SCOPE);
ui->CurScope->setText(V);
}
void TowerCollisionSetting::ShowCurAngle()
{
QString V;
if(m_AreaIndex <= 1)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID1_ROTATION);
else if(m_AreaIndex <= 2)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID2_ROTATION);
else if(m_AreaIndex <= 3)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID3_ROTATION);
else if(m_AreaIndex <= 4)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID4_ROTATION);
else if(m_AreaIndex <= 5)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID5_ROTATION);
else if(m_AreaIndex <= 6)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID6_ROTATION);
else if(m_AreaIndex <= 7)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID7_ROTATION);
else if(m_AreaIndex <= 8)
V = m_DataDictionary->GetMonitorRtData(M_MUL_ID8_ROTATION);
ui->CurAngle->setText(V);
}
void TowerCollisionSetting::on_QuiteButton_clicked()
{
this->hide();
}
void TowerCollisionSetting::MultipleParamDataChange(MultipleParamDataIndex_t index)
{
switch (index) {
case MC_DEVID_1:
case MC_DEVID_2:
case MC_DEVID_3:
case MC_DEVID_4:
case MC_DEVID_5:
case MC_DEVID_6:
case MC_DEVID_7:
case MC_DEVID_8:
ShowDevId();
break;
case MC_TOWER_ID_1:
case MC_TOWER_ID_2:
case MC_TOWER_ID_3:
case MC_TOWER_ID_4:
case MC_TOWER_ID_5:
case MC_TOWER_ID_6:
case MC_TOWER_ID_7:
case MC_TOWER_ID_8:
ShowTowerId();
break;
case MC_RELATIVE_ANGLE_1:
case MC_RELATIVE_ANGLE_2:
case MC_RELATIVE_ANGLE_3:
case MC_RELATIVE_ANGLE_4:
case MC_RELATIVE_ANGLE_5:
case MC_RELATIVE_ANGLE_6:
case MC_RELATIVE_ANGLE_7:
case MC_RELATIVE_ANGLE_8:
ShowRelativeAngle();
break;
case MC_RELATIVE_HEIGHT_1:
case MC_RELATIVE_HEIGHT_2:
case MC_RELATIVE_HEIGHT_3:
case MC_RELATIVE_HEIGHT_4:
case MC_RELATIVE_HEIGHT_5:
case MC_RELATIVE_HEIGHT_6:
case MC_RELATIVE_HEIGHT_7:
case MC_RELATIVE_HEIGHT_8:
ShowRelativeHeight();
break;
case MC_RELATIVE_DISTANCE_1:
case MC_RELATIVE_DISTANCE_2:
case MC_RELATIVE_DISTANCE_3:
case MC_RELATIVE_DISTANCE_4:
case MC_RELATIVE_DISTANCE_5:
case MC_RELATIVE_DISTANCE_6:
case MC_RELATIVE_DISTANCE_7:
case MC_RELATIVE_DISTANCE_8:
ShowRelativeDistance();
break;
case MC_ARM_LENGTH_1:
case MC_ARM_LENGTH_2:
case MC_ARM_LENGTH_3:
case MC_ARM_LENGTH_4:
case MC_ARM_LENGTH_5:
case MC_ARM_LENGTH_6:
case MC_ARM_LENGTH_7:
case MC_ARM_LENGTH_8:
ShowArmLength();
break;
default:
break;
}
}
void TowerCollisionSetting::MonitorRtDataChange(MonitorRtDataIndex_t index)
{
switch (index) {
case M_MUL_ID1_SCOPE:
case M_MUL_ID2_SCOPE:
case M_MUL_ID3_SCOPE:
case M_MUL_ID4_SCOPE:
case M_MUL_ID5_SCOPE:
case M_MUL_ID6_SCOPE:
case M_MUL_ID7_SCOPE:
case M_MUL_ID8_SCOPE:
ShowCurScope();
break;
case M_MUL_ID1_HEIGHT:
case M_MUL_ID2_HEIGHT:
case M_MUL_ID3_HEIGHT:
case M_MUL_ID4_HEIGHT:
case M_MUL_ID5_HEIGHT:
case M_MUL_ID6_HEIGHT:
case M_MUL_ID7_HEIGHT:
case M_MUL_ID8_HEIGHT:
ShowCurHeight();
break;
case M_MUL_ID1_ROTATION:
case M_MUL_ID2_ROTATION:
case M_MUL_ID3_ROTATION:
case M_MUL_ID4_ROTATION:
case M_MUL_ID5_ROTATION:
case M_MUL_ID6_ROTATION:
case M_MUL_ID7_ROTATION:
case M_MUL_ID8_ROTATION:
m_TowerAnalog[1]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID1_ROTATION).toUInt());
m_TowerAnalog[2]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID2_ROTATION).toUInt());
m_TowerAnalog[3]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID3_ROTATION).toUInt());
m_TowerAnalog[4]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID4_ROTATION).toUInt());
m_TowerAnalog[5]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID5_ROTATION).toUInt());
m_TowerAnalog[6]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID6_ROTATION).toUInt());
m_TowerAnalog[7]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID7_ROTATION).toUInt());
m_TowerAnalog[8]->SetAnagle(m_DataDictionary->GetMonitorRtData(M_MUL_ID8_ROTATION).toUInt());
for(int i = 0;i < 9;i++)
m_TowerAnalog[i]->update();
ShowCurAngle();
break;
case M_SCOPE:
ui->Scope->setText(m_DataDictionary->GetMonitorRtData(index));
break;
case M_ROTATION:
m_TowerAnalog[0]->SetAnagle(m_DataDictionary->GetMonitorRtData(index).toUInt());
m_TowerAnalog[0]->update();
ui->Angle->setText(m_DataDictionary->GetMonitorRtData(index));
break;
case M_HEIGHT:
ui->Height->setText(m_DataDictionary->GetMonitorRtData(index));
break;
default:
break;
}
}
void TowerCollisionSetting::DevParamDataChange(DevParamDataIndex_t index)
{
QString V = m_DataDictionary->GetDevParamData(index);
switch (index) {
case D_ARM_LENGTH:
ui->ArmL->setText(V);
break;
case D_HEIGHT:
ui->ArmH->setText(V);
break;
default:
break;
}
}
void TowerCollisionSetting::on_UpButton_clicked()
{
if(m_AreaIndex <= 1)
return ;
m_AreaIndex--;
FixAreaNum(m_AreaIndex);
}
void TowerCollisionSetting::on_DownButton_clicked()
{
if(m_AreaIndex >= 8)
return ;
m_AreaIndex++;
FixAreaNum(m_AreaIndex);
}
void TowerCollisionSetting::on_TowerId_returnPressed()
{
SetTowerId(ui->TowerId->text());
}
void TowerCollisionSetting::on_DevId_returnPressed()
{
SetDevId(ui->DevId->text());
}
void TowerCollisionSetting::on_RelativeDistance_returnPressed()
{
SetRelativeDistance(ui->RelativeDistance->text());
}
void TowerCollisionSetting::on_RelativeAngle_returnPressed()
{
SetRelativeAngle(ui->RelativeAngle->text());
}
void TowerCollisionSetting::on_RelativeHeight_returnPressed()
{
SetRelativeHeight(ui->RelativeHeight->text());
}
void TowerCollisionSetting::on_ArmLength_returnPressed()
{
SetArmLength(ui->ArmLength->text());
}
void TowerCollisionSetting::on_SearchButton_clicked()
{
m_BBListScreen->show();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qinxude/rk3568ui.git
[email protected]:qinxude/rk3568ui.git
qinxude
rk3568ui
rk3568ui
master

搜索帮助