723 lines
18 KiB
C++
723 lines
18 KiB
C++
#include "GlobalSetting.h"
|
|
#include "ui_GlobalSetting.h"
|
|
|
|
GlobalSetting::GlobalSetting(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::GlobalSetting)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
bingmap.insert("数字地图","BingMap");
|
|
bingmap.insert("卫星地图","BingSatellite");
|
|
bingmap.insert("混合地图","BingHybrid");
|
|
//bingmap.insert("中国地图","BingChina");
|
|
|
|
ui->label_mapcache_info->hide();
|
|
ui->progressBar_mapcache->hide();
|
|
ui->label_Map_Provider->hide();
|
|
|
|
for(int i = 1;i <= 20;i++)
|
|
{
|
|
ui->comboBox_map_level->addItem(tr("level %1").arg(i),i);
|
|
}
|
|
ui->comboBox_map_level->setCurrentIndex(17);
|
|
|
|
//地图缓存相关UI
|
|
|
|
ui->doubleSpinBox_left_lat->setValue(52);
|
|
ui->doubleSpinBox_left_lng->setValue(74);
|
|
|
|
ui->doubleSpinBox_right_lat->setValue(18);
|
|
ui->doubleSpinBox_right_lng->setValue(135);
|
|
|
|
|
|
ui->comboBox_Beep->addItem(tr("开"),true);
|
|
ui->comboBox_Beep->addItem(tr("关"),false);
|
|
|
|
ui->comboBox_TTS->addItem(tr("开"),true);
|
|
ui->comboBox_TTS->addItem(tr("关"),false);
|
|
|
|
ui->comboBox_export_state->addItem(tr("输出开启"),true);
|
|
ui->comboBox_export_state->addItem(tr("输出关闭"),false);
|
|
|
|
|
|
|
|
|
|
ui->comboBox_ID->addItem(tr("250"),250);
|
|
ui->comboBox_ID->addItem(tr("251"),251);
|
|
ui->comboBox_ID->addItem(tr("252"),252);
|
|
ui->comboBox_ID->addItem(tr("253"),253);
|
|
ui->comboBox_ID->addItem(tr("254"),254);
|
|
ui->comboBox_ID->addItem(tr("255"),255);
|
|
|
|
Config *cfg = new Config();
|
|
|
|
QVariant id;
|
|
|
|
cfg->get_GCS_ID(&id);
|
|
|
|
qDebug() << id;
|
|
|
|
ui->comboBox_ID->setCurrentIndex(ui->comboBox_ID->findData(id.toInt()));
|
|
|
|
|
|
emit setGCSID(id.toInt());//设置全局ID
|
|
|
|
|
|
QVariant beep;
|
|
cfg->getBeep(&beep);
|
|
ui->comboBox_Beep->setCurrentIndex(ui->comboBox_Beep->findData(beep.toBool()));
|
|
|
|
getBeep();
|
|
|
|
QVariant tts;
|
|
cfg->getTTS(&tts);
|
|
ui->comboBox_TTS->setCurrentIndex(ui->comboBox_TTS->findData(tts.toBool()));
|
|
|
|
emit setTTS(tts.toBool());
|
|
|
|
|
|
ui->comboBox_dir_la->addItem("1",1);
|
|
ui->comboBox_dir_la->addItem("-1",-1);
|
|
ui->comboBox_dir_la->setCurrentIndex(0);
|
|
|
|
ui->comboBox_dir_ra->addItem("1",1);
|
|
ui->comboBox_dir_ra->addItem("-1",-1);
|
|
ui->comboBox_dir_ra->setCurrentIndex(0);
|
|
|
|
ui->comboBox_dir_le->addItem("1",1);
|
|
ui->comboBox_dir_le->addItem("-1",-1);
|
|
ui->comboBox_dir_le->setCurrentIndex(0);
|
|
|
|
ui->comboBox_dir_re->addItem("1",1);
|
|
ui->comboBox_dir_re->addItem("-1",-1);
|
|
ui->comboBox_dir_re->setCurrentIndex(0);
|
|
|
|
ui->comboBox_dir_ru->addItem("1",1);
|
|
ui->comboBox_dir_ru->addItem("-1",-1);
|
|
ui->comboBox_dir_ru->setCurrentIndex(0);
|
|
|
|
|
|
|
|
|
|
on_pushButton_getServoOffset_clicked();
|
|
|
|
|
|
|
|
QVariant frq;
|
|
QVariant state;
|
|
cfg->getHeartBeat(&state,&frq);
|
|
|
|
ui->comboBox_HeartBeat_Frq->addItem(tr("1.0Hz"),1.0);
|
|
ui->comboBox_HeartBeat_Frq->addItem(tr("2.0Hz"),2.0);
|
|
ui->comboBox_HeartBeat_Frq->addItem(tr("5.0Hz"),5.0);
|
|
ui->comboBox_HeartBeat_Frq->addItem(tr("10Hz"),10);
|
|
ui->comboBox_HeartBeat_Frq->setCurrentIndex(ui->comboBox_HeartBeat_Frq->findData(frq));
|
|
|
|
|
|
ui->comboBox_HeartBeat_State->addItem(tr("发送心跳包"),true);
|
|
ui->comboBox_HeartBeat_State->addItem(tr("关闭心跳包"),false);
|
|
ui->comboBox_HeartBeat_State->setCurrentIndex(ui->comboBox_HeartBeat_State->findData(state));
|
|
|
|
on_pushButton_getHeartBeat_clicked();
|
|
|
|
|
|
QVariant flag;
|
|
QHostAddress addr;
|
|
QVariant port;
|
|
QString manufactorId;
|
|
|
|
cfg->get_ExportInfo(&state, &flag, &addr, &port, manufactorId);
|
|
|
|
ui->comboBox_export_state->setCurrentIndex(ui->comboBox_export_state->findData(state));
|
|
ui->lineEdit_identifying->setText(manufactorId);
|
|
|
|
bool ss = false;
|
|
ui->lineEdit_export_flag->setText(QString::number(flag.toUInt()));
|
|
ui->lineEdit_export_addr->setText(addr.toString());
|
|
ui->lineEdit_export_port->setText(QString::number(port.toInt()));
|
|
|
|
emit setExportInfo(state,flag,addr,port.toInt());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QVariant maptype;
|
|
cfg->getMapType(&maptype);
|
|
|
|
if(!maptype.toString().isNull())
|
|
{
|
|
ui->pushButton_MapProvider->setText(maptype.toString());
|
|
}
|
|
else
|
|
{
|
|
ui->pushButton_MapProvider->setText("混合地图");
|
|
}
|
|
|
|
emit setMapTypes(bingmap.value(maptype.toString()));
|
|
|
|
|
|
double lon, lat, hight;
|
|
cfg->getReferencePoint(lon, lat, hight);
|
|
emit ReferencePointChanged(lon, lat, hight);
|
|
ui->dsbRefLon->setValue(lon);
|
|
ui->dsbRefLat->setValue(lat);
|
|
ui->dsbRefH->setValue(hight);
|
|
}
|
|
|
|
GlobalSetting::~GlobalSetting()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_setGCSID_clicked()
|
|
{
|
|
int id = 0;
|
|
|
|
id = ui->comboBox_ID->currentData(Qt::DisplayRole).toInt();
|
|
|
|
qDebug() << id;
|
|
|
|
emit setGCSID(id);
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->set_GCS_ID(id);
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
emit showMessage(tr("设置本机ID成功,ID:%1").arg(QString::number(id)));
|
|
|
|
}
|
|
|
|
void GlobalSetting::getGCSID(void)
|
|
{
|
|
Config *cfg = new Config();
|
|
|
|
QVariant id;
|
|
cfg->get_GCS_ID(&id);
|
|
emit setGCSID(id.toInt());//设置全局ID
|
|
|
|
delete cfg;
|
|
|
|
emit showMessage(tr("设置本机ID成功,ID:%1").arg(QString::number(id.toInt())));
|
|
}
|
|
|
|
|
|
void GlobalSetting::getServo(void)
|
|
{
|
|
on_pushButton_getServoOffset_clicked();
|
|
}
|
|
|
|
|
|
void GlobalSetting::ServoParameter(QString type,QVariant data)
|
|
{
|
|
|
|
Config *cfg = new Config();
|
|
|
|
QVariant dir_la;
|
|
QVariant dir_ra;
|
|
QVariant dir_le;
|
|
QVariant dir_re;
|
|
QVariant dir_ru;
|
|
|
|
QVariant max_la;
|
|
QVariant max_ra;
|
|
QVariant max_le;
|
|
QVariant max_re;
|
|
QVariant max_ru;
|
|
|
|
QVariant scale_la;
|
|
QVariant scale_ra;
|
|
QVariant scale_le;
|
|
QVariant scale_re;
|
|
QVariant scale_ru;
|
|
|
|
QVariant bias_la;
|
|
QVariant bias_ra;
|
|
QVariant bias_le;
|
|
QVariant bias_re;
|
|
QVariant bias_ru;
|
|
|
|
cfg->getServoOffset(&dir_la,&dir_ra,&dir_le,&dir_re,&dir_ru,
|
|
&max_la,&max_ra,&max_le,&max_re,&max_ru,
|
|
&scale_la,&scale_ra,&scale_le,&scale_re,&scale_ru,
|
|
&bias_la,&bias_ra,&bias_le,&bias_re,&bias_ru);
|
|
|
|
dir_la = 1;
|
|
dir_ra = 1;
|
|
dir_le = 1;
|
|
dir_re = 1;
|
|
dir_ru = 1;
|
|
|
|
|
|
if(type == "dal0")
|
|
{
|
|
bias_la = data;
|
|
}
|
|
else if(type == "dar0")
|
|
{
|
|
bias_ra = data;
|
|
}
|
|
else if(type == "del0")
|
|
{
|
|
bias_le = data;
|
|
}
|
|
else if(type == "der0")
|
|
{
|
|
bias_re = data;
|
|
}
|
|
else if(type == "dr0")
|
|
{
|
|
bias_ru = data;
|
|
}
|
|
else if(type == "k_dal")
|
|
{
|
|
scale_la = data;
|
|
}
|
|
else if(type == "k_dar")
|
|
{
|
|
scale_ra = data;
|
|
}
|
|
else if(type == "k_del")
|
|
{
|
|
scale_le = data;
|
|
}
|
|
else if(type == "k_der")
|
|
{
|
|
scale_re = data;
|
|
}
|
|
else if(type == "k_dr")
|
|
{
|
|
scale_ru = data;
|
|
}
|
|
|
|
cfg->setServoOffset(dir_la,dir_ra,dir_le,dir_re,dir_ru,
|
|
max_la,max_ra,max_le,max_re,max_ru,
|
|
scale_la,scale_ra,scale_le,scale_re,scale_ru,
|
|
bias_la,bias_ra,bias_le,bias_re,bias_ru);
|
|
|
|
on_pushButton_getServoOffset_clicked();
|
|
|
|
}
|
|
|
|
|
|
void GlobalSetting::on_pushButton_getServoOffset_clicked()
|
|
{
|
|
Config *cfg = new Config();
|
|
|
|
QVariant dir_la;
|
|
QVariant dir_ra;
|
|
QVariant dir_le;
|
|
QVariant dir_re;
|
|
QVariant dir_ru;
|
|
|
|
QVariant max_la;
|
|
QVariant max_ra;
|
|
QVariant max_le;
|
|
QVariant max_re;
|
|
QVariant max_ru;
|
|
|
|
QVariant scale_la;
|
|
QVariant scale_ra;
|
|
QVariant scale_le;
|
|
QVariant scale_re;
|
|
QVariant scale_ru;
|
|
|
|
QVariant bias_la;
|
|
QVariant bias_ra;
|
|
QVariant bias_le;
|
|
QVariant bias_re;
|
|
QVariant bias_ru;
|
|
|
|
cfg->getServoOffset(&dir_la,&dir_ra,&dir_le,&dir_re,&dir_ru,
|
|
&max_la,&max_ra,&max_le,&max_re,&max_ru,
|
|
&scale_la,&scale_ra,&scale_le,&scale_re,&scale_ru,
|
|
&bias_la,&bias_ra,&bias_le,&bias_re,&bias_ru);
|
|
|
|
|
|
ui->comboBox_dir_la->setCurrentIndex(ui->comboBox_dir_la->findData(dir_la));
|
|
ui->comboBox_dir_ra->setCurrentIndex(ui->comboBox_dir_ra->findData(dir_ra));
|
|
ui->comboBox_dir_le->setCurrentIndex(ui->comboBox_dir_le->findData(dir_le));
|
|
ui->comboBox_dir_re->setCurrentIndex(ui->comboBox_dir_re->findData(dir_re));
|
|
ui->comboBox_dir_ru->setCurrentIndex(ui->comboBox_dir_ru->findData(dir_ru));
|
|
|
|
ui->doubleSpinBox_max_la->setValue(max_la.toDouble());
|
|
ui->doubleSpinBox_max_ra->setValue(max_ra.toDouble());
|
|
ui->doubleSpinBox_max_le->setValue(max_le.toDouble());
|
|
ui->doubleSpinBox_max_re->setValue(max_re.toDouble());
|
|
ui->doubleSpinBox_max_ru->setValue(max_ru.toDouble());
|
|
|
|
ui->doubleSpinBox_scale_la->setValue(scale_la.toDouble());
|
|
ui->doubleSpinBox_scale_ra->setValue(scale_ra.toDouble());
|
|
ui->doubleSpinBox_scale_le->setValue(scale_le.toDouble());
|
|
ui->doubleSpinBox_scale_re->setValue(scale_re.toDouble());
|
|
ui->doubleSpinBox_scale_ru->setValue(scale_ru.toDouble());
|
|
|
|
|
|
ui->doubleSpinBox_bias_la->setValue(bias_la.toDouble());
|
|
ui->doubleSpinBox_bias_ra->setValue(bias_ra.toDouble());
|
|
ui->doubleSpinBox_bias_le->setValue(bias_le.toDouble());
|
|
ui->doubleSpinBox_bias_re->setValue(bias_re.toDouble());
|
|
ui->doubleSpinBox_bias_ru->setValue(bias_ru.toDouble());
|
|
|
|
|
|
|
|
|
|
|
|
emit setServo(dir_la,dir_ra,dir_le,dir_re,dir_ru,
|
|
max_la,max_ra,max_le,max_re,max_ru,
|
|
scale_la,scale_ra,scale_le,scale_re,scale_ru,
|
|
bias_la,bias_ra,bias_le,bias_re,bias_ru);
|
|
|
|
delete cfg;
|
|
|
|
emit showMessage(tr("舵面偏差读取成功"));
|
|
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_setServoOffset_clicked()
|
|
{
|
|
QVariant dir_la;
|
|
QVariant dir_ra;
|
|
QVariant dir_le;
|
|
QVariant dir_re;
|
|
QVariant dir_ru;
|
|
|
|
QVariant max_la;
|
|
QVariant max_ra;
|
|
QVariant max_le;
|
|
QVariant max_re;
|
|
QVariant max_ru;
|
|
|
|
QVariant scale_la;
|
|
QVariant scale_ra;
|
|
QVariant scale_le;
|
|
QVariant scale_re;
|
|
QVariant scale_ru;
|
|
|
|
QVariant bias_la;
|
|
QVariant bias_ra;
|
|
QVariant bias_le;
|
|
QVariant bias_re;
|
|
QVariant bias_ru;
|
|
|
|
|
|
dir_la = ui->comboBox_dir_la->currentData();
|
|
dir_ra = ui->comboBox_dir_ra->currentData();
|
|
dir_le = ui->comboBox_dir_le->currentData();
|
|
dir_re = ui->comboBox_dir_re->currentData();
|
|
dir_ru = ui->comboBox_dir_ru->currentData();
|
|
|
|
max_la = ui->doubleSpinBox_max_la->value();
|
|
max_ra = ui->doubleSpinBox_max_ra->value();
|
|
max_le = ui->doubleSpinBox_max_le->value();
|
|
max_re = ui->doubleSpinBox_max_re->value();
|
|
max_ru = ui->doubleSpinBox_max_ru->value();
|
|
|
|
scale_la = ui->doubleSpinBox_scale_la->value();
|
|
scale_ra = ui->doubleSpinBox_scale_ra->value();
|
|
scale_le = ui->doubleSpinBox_scale_le->value();
|
|
scale_re = ui->doubleSpinBox_scale_re->value();
|
|
scale_ru = ui->doubleSpinBox_scale_ru->value();
|
|
|
|
bias_la = ui->doubleSpinBox_bias_la->value();
|
|
bias_ra = ui->doubleSpinBox_bias_ra->value();
|
|
bias_le = ui->doubleSpinBox_bias_le->value();
|
|
bias_re = ui->doubleSpinBox_bias_re->value();
|
|
bias_ru = ui->doubleSpinBox_bias_ru->value();
|
|
|
|
|
|
emit setServo(dir_la,dir_ra,dir_le,dir_re,dir_ru,
|
|
max_la,max_ra,max_le,max_re,max_ru,
|
|
scale_la,scale_ra,scale_le,scale_re,scale_ru,
|
|
bias_la,bias_ra,bias_le,bias_re,bias_ru);
|
|
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->setServoOffset(dir_la,dir_ra,dir_le,dir_re,dir_ru,
|
|
max_la,max_ra,max_le,max_re,max_ru,
|
|
scale_la,scale_ra,scale_le,scale_re,scale_ru,
|
|
bias_la,bias_ra,bias_le,bias_re,bias_ru);
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
|
|
emit showMessage(tr("舵面偏差设置成功"));
|
|
|
|
}
|
|
|
|
|
|
void GlobalSetting::getHeartBeat(void)
|
|
{
|
|
on_pushButton_getHeartBeat_clicked();
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_getHeartBeat_clicked()
|
|
{
|
|
Config *cfg = new Config();
|
|
|
|
QVariant state;
|
|
QVariant frq;
|
|
|
|
cfg->getHeartBeat(&state,&frq);
|
|
|
|
ui->comboBox_HeartBeat_Frq->setCurrentIndex(ui->comboBox_HeartBeat_Frq->findData(frq));
|
|
ui->comboBox_HeartBeat_State->setCurrentIndex(ui->comboBox_HeartBeat_State->findData(state));
|
|
|
|
delete cfg;
|
|
|
|
emit setHeartBeat(state,frq);
|
|
|
|
emit showMessage(tr("心跳读取成功"));
|
|
}
|
|
|
|
|
|
void GlobalSetting::on_pushButton_setHeartBeat_clicked()
|
|
{
|
|
QVariant state;
|
|
QVariant frq;
|
|
|
|
state = ui->comboBox_HeartBeat_State->currentData();
|
|
frq = ui->comboBox_HeartBeat_Frq->currentData();
|
|
|
|
emit setHeartBeat(state,frq);
|
|
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->setHeartBeat(state,frq);
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
|
|
emit showMessage(tr("心跳设置成功"));
|
|
}
|
|
|
|
void GlobalSetting::setMapProvider(QVariant key)
|
|
{
|
|
ui->pushButton_MapProvider->setText(key.toString());
|
|
|
|
Config *config = new Config();
|
|
config->setMapType(key);
|
|
delete config;
|
|
|
|
emit setMapTypes(bingmap.value(key.toString()));
|
|
}
|
|
|
|
void GlobalSetting::MapTypes(QStringList list)
|
|
{
|
|
//QStringList map;
|
|
|
|
Selector *selector = new Selector(this);
|
|
selector->setGeometry(0,0,this->width(),this->height());
|
|
|
|
selector->setList(bingmap.keys(),ui->pushButton_MapProvider->text());
|
|
|
|
connect(selector,SIGNAL(confirmValue(QVariant)),
|
|
this,SLOT(setMapProvider(QVariant)));
|
|
|
|
selector->show();
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_MapProvider_clicked()
|
|
{
|
|
emit getMapTypes();
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_map_cache_clicked()
|
|
{
|
|
if(isMapCaching == false)
|
|
{
|
|
//检测左上和右下的坐标
|
|
qreal lat_l = ui->doubleSpinBox_left_lat->value();
|
|
qreal lng_l = ui->doubleSpinBox_left_lng->value();
|
|
|
|
qreal lat_r = ui->doubleSpinBox_right_lat->value();
|
|
qreal lng_r = ui->doubleSpinBox_right_lng->value();
|
|
|
|
qint8 zoom = ui->comboBox_map_level->currentData().toInt();
|
|
|
|
qDebug() << lat_l << lng_l << lat_r << lng_r << zoom;
|
|
|
|
|
|
|
|
if((lat_l == lat_r) &&(lng_l == lng_r))//如果值一样,说明就是一个点,不开启缓存
|
|
{
|
|
return;
|
|
}
|
|
|
|
|
|
//修改当前的名字
|
|
ui->pushButton_map_cache->setText(tr("stop cache"));
|
|
|
|
//状态改为正在换成
|
|
isMapCaching = true;
|
|
|
|
//显示隐藏的进度条
|
|
|
|
ui->progressBar_mapcache->show();
|
|
ui->label_mapcache_info->show();
|
|
ui->label_Map_Provider->show();
|
|
|
|
ui->doubleSpinBox_left_lat->setEnabled(false);
|
|
ui->doubleSpinBox_left_lng->setEnabled(false);
|
|
ui->doubleSpinBox_right_lat->setEnabled(false);
|
|
ui->doubleSpinBox_right_lng->setEnabled(false);
|
|
ui->comboBox_map_level->setEditable(false);
|
|
|
|
//发送缓存指令
|
|
|
|
emit mapCache(isMapCaching,lat_l,lng_l,lat_r,lng_r,zoom);
|
|
}
|
|
else
|
|
{
|
|
setripfinished();
|
|
}
|
|
}
|
|
|
|
void GlobalSetting::setripfinished()
|
|
{
|
|
//修改名字
|
|
ui->pushButton_map_cache->setText(tr("start cache"));
|
|
|
|
//修改状态
|
|
isMapCaching = false;
|
|
|
|
|
|
ui->progressBar_mapcache->hide();
|
|
ui->label_mapcache_info->hide();
|
|
ui->label_Map_Provider->hide();
|
|
|
|
ui->doubleSpinBox_left_lat->setEnabled(true);
|
|
ui->doubleSpinBox_left_lng->setEnabled(true);
|
|
ui->doubleSpinBox_right_lat->setEnabled(true);
|
|
ui->doubleSpinBox_right_lng->setEnabled(true);
|
|
ui->comboBox_map_level->setEditable(true);
|
|
|
|
//发送停止指令
|
|
emit mapCache(isMapCaching,0,0,0,0,0);
|
|
|
|
//emit mapCacheCancel();
|
|
}
|
|
|
|
|
|
|
|
|
|
void GlobalSetting::SetPercentage(const int &perc)
|
|
{
|
|
ui->progressBar_mapcache->setValue(perc);
|
|
}
|
|
void GlobalSetting::SetProvider(const QString &prov, const int &zoom)
|
|
{
|
|
ui->label_Map_Provider->setText(QString(tr("Currently ripping from:%1 at Zoom level %2")).arg(prov).arg(zoom));
|
|
}
|
|
void GlobalSetting::SetNumberOfTiles(const int &total, const int &actual)
|
|
{
|
|
ui->label_mapcache_info->setText(QString(tr("Downloading tile %1 of %2")).arg(actual).arg(total));
|
|
}
|
|
|
|
void GlobalSetting::getExportInfo(void)
|
|
{
|
|
on_pushButton_setExport_clicked();
|
|
}
|
|
|
|
|
|
void GlobalSetting::on_pushButton_setExport_clicked()
|
|
{
|
|
QVariant state,flag;
|
|
QHostAddress addr;
|
|
qint32 port;
|
|
|
|
state = ui->comboBox_export_state->currentData();
|
|
flag = ui->lineEdit_export_flag->text().toInt();
|
|
addr = ui->lineEdit_export_addr->text();
|
|
port = ui->lineEdit_export_port->text().toInt();
|
|
|
|
emit setExportInfo(state,flag,addr,port);
|
|
bool ok;
|
|
quint16 id = ui->lineEdit_identifying->text().toUInt(&ok, 16);
|
|
emit ManufacturerID(id);
|
|
|
|
qDebug() << "lineEdit_identifying" << ui->lineEdit_identifying->text();
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->set_ExportInfo(state, flag, addr, port, ui->lineEdit_identifying->text() );
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
|
|
|
|
emit showMessage((state.toBool())?(tr("入网输出开启")):(tr("入网输出关闭")));
|
|
}
|
|
|
|
void GlobalSetting::getBeep(void)
|
|
{
|
|
on_pushButton_Beep_clicked();
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_Beep_clicked()
|
|
{
|
|
QVariant state;
|
|
|
|
state = ui->comboBox_Beep->currentData();
|
|
|
|
emit setBeep(state.toBool());
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->setBeep(state);
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
|
|
emit showMessage((state.toBool())?(tr("心跳声音开启")):(tr("心跳声音关闭")));
|
|
}
|
|
|
|
void GlobalSetting::getTTS(void)
|
|
{
|
|
on_pushButton_TTS_clicked();
|
|
}
|
|
|
|
void GlobalSetting::on_pushButton_TTS_clicked()
|
|
{
|
|
QVariant state;
|
|
|
|
state = ui->comboBox_TTS->currentData();
|
|
|
|
emit setTTS(state.toBool());
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->setTTS(state);
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
|
|
|
|
emit showMessage((state.toBool())?(tr("语音提示开启")):(tr("语音提示关闭")));
|
|
}
|
|
|
|
|
|
void GlobalSetting::on_pushButton_clicked()
|
|
{
|
|
emit ReferencePointChanged(ui->dsbRefLon->value(), ui->dsbRefLat->value(), ui->dsbRefH->value() );
|
|
|
|
Config *cfg = new Config();
|
|
|
|
cfg->setReferencePoint(ui->dsbRefLon->value(), ui->dsbRefLat->value(), ui->dsbRefH->value() );
|
|
|
|
cfg->deleteLater();
|
|
delete cfg;
|
|
}
|
|
|