GPSAdapter::~GPSAdapter() { if(_GPS.get() != nullptr) { disconnect(_GPS.get(), SIGNAL(onNewData(GPSData)), this, SLOT(onNewData(GPSData))); _GPS.reset(); } delete ui; }
void MapBuilder::ChangeLidar(std::shared_ptr<Lidar> device) { if(_lidar.get() != nullptr) { disconnect(_lidar.get(), SIGNAL(onNewData(LidarState)), this, SLOT(onLidarData(lidarState))); } _lidar = device; if(_lidar.get() != nullptr) { connect(_lidar.get(), SIGNAL(onNewData(LidarState)), this, SLOT(onLidarData(lidarState))); } }
NetScanningController::NetScanningController(QObject *parent) : QObject(parent), m_customDataCacheMap(0), m_poolNumber(-1), m_curAdpterId(-1), m_isDataValid(false) #ifdef POWERLINE_REVISION ,m_curStartIdx(-1), m_curTotalPowerLineInSubDevsList(0), m_curTotalPowerLine(0) #endif { qRegisterMetaType<Device>("Device"); connect(&m_scp,SIGNAL(signal_nodeDataReturned(SVT_NotifyType)), this,SLOT(onNewData(SVT_NotifyType))); connect(&m_scp,SIGNAL(signal_ifaceDataReturned(SVT_NotifyType)), this,SLOT(onInfInformation(SVT_NotifyType))); connect(&m_scp,SIGNAL(signal_countChanged(int)), this,SLOT(onCountChanged(int))); connect(&m_scp,SIGNAL(signal_newDeviceAdded(SVT_NotifyType)), this,SIGNAL(newDeviceNotify(SVT_NotifyType))); // connect(&m_scp,SIGNAL(signal_NetgearInfo(QMap<int,QString>)), // this,SLOT(onNetgearInfo(QMap<int,QString>))); connect(&m_scp,SIGNAL(signal_gatewayChanged(QString)),this,SIGNAL(gatewayChanged(QString))); if(sMapFlags&MF_IN_DBG_MOD) { GENIE2_REGISTER_DBG_UI(m_scp.getDbgUi()); } }
void StereoPlayback::Run() { int waitTime = 1000000/_framesPerSecond; bool lsuccess, rsuccess; while(Running()) { usleep(waitTime); //TODO Ensure this function call is non-blocking(gives up the processor during sleep) or replace it with something that is Mat left, right; lsuccess = _leftVid.grab(); _leftVid.retrieve(left); rsuccess = _rightVid.grab(); if (lsuccess && rsuccess) { _rightVid.retrieve(right); if (_undistort) { left = correctImage(left); right = correctImage(right); } _images = StereoImageData(left, right); onNewData(_images); } else { LockRunning(); Running(false); UnlockRunning(); } } }
InterpolatingGraph::InterpolatingGraph(QCustomPlot *plot, const DoubleSeries &d, PlotSettings::ScalingMode scalingMode, PlotSettings::ScaleType scaleType) : Graph(plot), series(d), plot(plot), lastUpdate(-1), currentMin(std::numeric_limits<double>::max()), currentMax(std::numeric_limits<double>::min()), currentScalingMode(PlotSettings::NOSCALING), currentScaleType(PlotSettings::LINSCALE) { setObjectName("InterpolatingGraph"); connect(&series, SIGNAL(newData(qint64)), this, SLOT(onNewData(qint64))); connect(&series, SIGNAL(offsetChanged()), this, SLOT(onOffsetChanged())); graph = plot->addGraph(); // Ensure value axis is visible. plot->yAxis->setVisible(true); plot->yAxis->setGrid(true); configureAppearance(graph); initialize(graph, series); rescale(scalingMode, scaleType); updatePlot(scalingMode); }
int NetScanningController::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: newData((*reinterpret_cast< const QList<Device*>(*)>(_a[1]))); break; case 1: infInformation((*reinterpret_cast< SVT_NotifyType(*)>(_a[1]))); break; case 2: deviceCountChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: newDeviceNotify((*reinterpret_cast< SVT_NotifyType(*)>(_a[1]))); break; case 4: routerTypeChanged(); break; case 5: gatewayChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break; case 6: onNewData((*reinterpret_cast< SVT_NotifyType(*)>(_a[1]))); break; case 7: onInfInformation((*reinterpret_cast< SVT_NotifyType(*)>(_a[1]))); break; case 8: onCountChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 9: onNode2Device((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< Device*(*)>(_a[2]))); break; case 10: onDeviceDataChanged((*reinterpret_cast< const Device(*)>(_a[1]))); break; case 11: onRefresh(); break; case 12: onSubscribeData((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break; case 13: startScan(); break; default: ; } _id -= 14; } return _id; }
void SimulatedGPS::threadRun() { while(_running) { if(_data.size() > 0) { onNewData(GetState()); } usleep(_delay); } }
GPSAdapter::GPSAdapter(std::shared_ptr<GPS> gps, QWidget *parent) : QWidget(parent), ui(new Ui::GPSAdapter), minLat(-5), maxLat(5), minLong(-5), maxLong(5) { ui->setupUi(this); for (int i = 0;i<5;i++) { coordinates[i][0] = 0; coordinates[i][1] = 0; } _GPS = gps; if(_GPS.get() != nullptr) connect(_GPS.get(), SIGNAL(onNewData(GPSData)), this, SLOT(onNewData(GPSData))); ui->user_Top->setPlainText(QString::number(maxLat)); ui->user_Right->setPlainText(QString::number(maxLong)); ui->user_Bottom->setPlainText(QString::number(minLat)); ui->user_Left->setPlainText(QString::number(minLong)); connect(this, SIGNAL(updateBecauseNewData()), this, SLOT(update())); }
int DeviceDetailViewManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: viewDetailsOver((*reinterpret_cast< const Device(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 1: translateText((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< QString*(*)>(_a[2]))); break; case 2: requestRouterImagePath((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< QString*(*)>(_a[3]))); break; case 3: onNewData((*reinterpret_cast< const QList<Device*>(*)>(_a[1]))); break; case 4: raise(); break; default: ; } _id -= 5; } return _id; }
MapBuilder::MapBuilder(std::shared_ptr<Lidar> lidar, std::shared_ptr<BasicPositionTracker> poseTracker) { pcl::PointCloud<pcl::PointXYZ>::Ptr _cloud(new pcl::PointCloud<pcl::PointXYZ>); _cloud->height = 1; _cloud->width = 1024; _cloud->is_dense = false; _cloud->points.resize(_cloud->width*_cloud->height); if(lidar.get()) { _lidar = lidar; connect(_lidar.get(), SIGNAL(onNewData(LidarState)), this, SLOT(onLidarData(LidarState))); } this->poseTracker = poseTracker; cloud = _cloud; }
MapBuilder::~MapBuilder() { if(_lidar.get()) disconnect(_lidar.get(), SIGNAL(onNewData(LidarState)), this, SLOT(onLidarData(LidarState))); poseTracker = nullptr; }
PowerlineMapView::PowerlineMapView(QWidget *parent) :QWidget(parent) ,m_topologyview(0) //,m_prevPageBtnState(BTNSTATE_NORMAL) //,m_nextPageBtnState(BTNSTATE_NORMAL) //,m_firstPageBtnState(BTNSTATE_NORMAL) //,m_lastPageBtnState(BTNSTATE_NORMAL) ,m_layOut(0) ,m_devTotalCount(0) ,m_pageTotalCount(0) ,m_currentPageIndex(1) ,m_bUpdateUi(false) ,m_nOperRetCode(-1) ,m_nWhosOper(-1) ,m_nShowState(SS_HIDE) ,m_TipShowState(SDW_NO_SHOW) ,m_WirelessShowState(SDW_NO_SHOW) ,m_hubView(NULL) ,m_isRouterOk(false) ,m_bAnimateStop(false) ,m_bHaveIp(false) { #ifdef ENABLE_SMARTWIFIWIZARD m_dlgMgr.setWiFiWizardParentWidget(this); #endif #ifdef TEST_PL_CODE m_isHubView = false; #endif m_topologyview = new PowerlineView(this); m_topologyview->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); m_waittingPanel = new WaitPanel(this); m_waittingPanel->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); m_hubView = new Powerline_HubMapView(this); m_hubView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_topWaittingLayout = new QStackedLayout(); m_topWaittingLayout->addWidget(m_topologyview); m_topWaittingLayout->addWidget(m_waittingPanel); m_topWaittingLayout->addWidget(m_hubView); connect(m_hubView, SIGNAL(pageTotal(int)), this, SIGNAL(pageChange(int))); m_devNumberLabel = new QLabel(this); // m_netcardPanel = new NetcardsPanel(this); // m_notifyNewDevCB = new QCheckBox(this); m_devNumberLabel->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); // m_notifyNewDevCB->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); // m_notifyNewDevCB->setFocusPolicy(Qt::NoFocus); m_refreshBtn = new QPushButton(this); m_refreshBtn->setText("Refresh"); #ifndef TEST_PL_CODE m_refreshBtn->setVisible(false); #else m_refreshBtn->setVisible(true); #endif connect(m_refreshBtn, SIGNAL(clicked()), this, SLOT(slot_btn_refresh())); QHBoxLayout *horLayout = new QHBoxLayout(); horLayout->addWidget(m_devNumberLabel); #ifdef TEST_PL_CODE horLayout->addWidget(m_refreshBtn); #endif //////◊Û”“º˝Õ∑ m_prevPageBtn = new QPushButton(this); m_nextPageBtn = new QPushButton(this); m_prevPageBtn->setObjectName("prevPageBtn"); m_nextPageBtn->setObjectName("nextPageBtn"); m_prevPageBtn->setAttribute(Qt::WA_TranslucentBackground); m_nextPageBtn->setAttribute(Qt::WA_TranslucentBackground); m_prevPageBtn->setVisible(false); m_nextPageBtn->setVisible(false); connect(m_prevPageBtn, SIGNAL(clicked()), this, SLOT(btnClicked())); connect(m_nextPageBtn, SIGNAL(clicked()), this, SLOT(btnClicked())); QHBoxLayout *horLayout2 = new QHBoxLayout(); horLayout2->addWidget(m_prevPageBtn); horLayout2->addLayout(m_topWaittingLayout); horLayout2->addWidget(m_nextPageBtn); QFile f(/*GENIE2_RES(*/":styles/powerlineview.qss")/*)*/; bool btemp=f.open(QIODevice::ReadOnly); Q_ASSERT(btemp); QString stemp; stemp=f.readAll(); f.close(); //m_prevPageBtn->setStyleSheet(stemp); //m_nextPageBtn->setStyleSheet(stemp); m_prevPageBtn->setStyleSheet(stemp); m_nextPageBtn->setStyleSheet(stemp); //////end m_layOut = new QVBoxLayout(this); #ifdef TEST_PL_CODE m_layOut->addLayout(horLayout); #endif m_layOut->addLayout(horLayout2); updateUiElements(); //setLayout(m_layOut); // QHBoxLayout *layout = new QHBoxLayout(); // layout->addWidget(m_topologyview); // setLayout(layout); /**********END******************/ connect(m_topologyview, SIGNAL(nodeClicked(int)), this, SLOT(onNodeClicked(int))); connect(m_topologyview, SIGNAL(nodeContextMenu(int ,QPoint)), this, SLOT(onNodeContextMenu(int, QPoint))); //connect(m_waittingPanel, SIGNAL(translateText(int,QString*)), this, SIGNAL(translateText(int, QString*))); connect(&m_dlgMgr, SIGNAL(onNewData(TopologyDataTransfer)), this, SLOT(slot_onNewData(TopologyDataTransfer))); connect(&m_dlgMgr, SIGNAL(commitOper(int)), this, SLOT(slot_dataFinish(int))); connect(&m_dlgMgr, SIGNAL(operRet(int,bool)), this, SLOT(slot_operRet(int,bool))); connect(&m_dlgMgr, SIGNAL(timeLineDlgOver(int)), this, SLOT(slot_timelineDlgOver(int))); //connect(m_topologyview, SIGNAL(btnClicked(int)), this, SLOT(slot_Btn_Click(int))); m_dlgMgr.setDlgParent(this); //slot_btn_refresh(); }
CMainWindow::CMainWindow(int argc, char *argv[], QWidget *parent) : QMainWindow(parent) { //====================================================================================================================================== QStringList arguments; for (int i = 0; i < argc; i++) { arguments.append(argv[i]); arguments[i].remove("-"); } //====================================================================================================================================== qSetMessagePattern("[%{time h:mm:ss:zzz} %{if-category}%{category}%{endif} %{type}] %{function}: - %{message}"); //====================================================================================================================================== ui.setupUi(this); QSettings settings; m_EventFilter = CEventFilter::Signleton(); m_Data = new CData; //====================================================================================================================================== if (arguments.contains("ip")) { m_WebSocketClient = new CWebSocketClient(QUrl(QString("ws://%1").arg((arguments.at(arguments.indexOf("ip") + 1)))), m_Data); settings.setValue("IPAdress", arguments.at(arguments.indexOf("ip") + 1).split(":").first()); settings.setValue("Port", arguments.at(arguments.indexOf("ip") + 1).split(":").last()); } else m_WebSocketClient = new CWebSocketClient(QUrl(QString("ws://%1:%2").arg(settings.value("IPAdress").toString()).arg(settings.value("Port").toString())), m_Data); //====================================================================================================================================== ////Actions //QAction *action_Close = new QAction(QIcon(QString::fromUtf8(":/Resources/cancel.png")), "Close", this); //QAction *action_FullScreen = new QAction(QIcon(QString::fromUtf8(":/Resources/slideshow_full_screen.png")), "Fullsreen", this); //QAction *action_HomePage = new QAction(QIcon(QString::fromUtf8(":/Resources/home_page.png")), "Home Page", this); //QAction *action_Plotter = new QAction(QIcon(QString::fromUtf8(":/Resources/chart_curve.png")), "Plotter", this); ////====================================================================================================================================== ////Toolbar //ui.toolBar->addAction(action_Close); //ui.toolBar->addAction(action_FullScreen); //ui.toolBar->addSeparator(); //ui.toolBar->setIconSize(QSize(20, 20)); //ui.toolBar->addAction(action_HomePage); //ui.toolBar->addAction(action_Plotter); //====================================================================================================================================== //StartPage m_StartPage = new CStartPage(this); ui.stackedWidget->addWidget(m_StartPage->getView()); //====================================================================================================================================== //Plotter m_Plotter = new CPlotter(this); ui.stackedWidget->addWidget(m_Plotter->getView()); //====================================================================================================================================== //Settings m_Settings = new CSettings(this); ui.stackedWidget->addWidget(m_Settings); //====================================================================================================================================== //====================================================================================================================================== connect(m_EventFilter, SIGNAL(reciveClick()), this, SLOT(showNextPage())); connect(m_EventFilter, SIGNAL(reciveDoubleClick()), this, SLOT(showSettings())); connect(m_Data, SIGNAL(NewDataRecieved()), this, SLOT(onNewData())); connect(m_Settings, SIGNAL(reciveNewURL(QString)), this, SLOT(onNewURL(QString))); connect(m_Settings, SIGNAL(ready()), this, SLOT(showStartpage())); connect(m_WebSocketClient, SIGNAL(serverConnected(QString)), m_Settings, SLOT(onServerConnected(QString))); connect(m_WebSocketClient, SIGNAL(serverDisconnected()), m_Settings, SLOT(onServerDisconnected())); connect(m_WebSocketClient, SIGNAL(recievedInitialScript(QJsonObject)), m_Data, SLOT(recievedInitialScript(QJsonObject))); connect(m_WebSocketClient, SIGNAL(recievedDataScript(QJsonObject)), m_Data, SLOT(recievedDataScript(QJsonObject))); //====================================================================================================================================== //====================================================================================================================================== resize(480, 320); ui.stackedWidget->setCurrentIndex(0); }