代码拉取完成,页面将自动刷新
#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();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。