void VSCMainWindows::Search() { if (VSCSearch::m_bStarted == TRUE) { QMessageBox msgBox; //Set text msgBox.setText("Search is In Processing ..."); //Set predefined icon, icon is show on left side of text. //msgBox.setIcon(QMessageBox::Information); //set inforative text //msgBox.setInformativeText("Just show infornation."); //Add ok and cancel button. msgBox.setStandardButtons(QMessageBox::Ok); //Set focus of ok button msgBox.setDefaultButton(QMessageBox::Ok); //execute message box. method exec() return the button value of cliecke button int ret = msgBox.exec(); return; } VSCSearch *pSearch = new VSCSearch(this); m_pMainArea->addTab(pSearch, tr("Search")); m_pMainArea->setCurrentWidget(pSearch); connect(pSearch, SIGNAL(CameraTreeUpdated()), m_pDeviceList, SLOT(CameraTreeUpdated())); }
void VSCMainWindows::AddCamera() { DeviceParam mParam; VSCCameraAdd *pCameraadd = new VSCCameraAdd(mParam, this); //VSCView *pView2 = new VSCView(this); m_pMainArea->addTab(pCameraadd,tr("Camera")); m_pMainArea->setCurrentWidget(pCameraadd); connect(pCameraadd, SIGNAL(CameraTreeUpdated()), m_pDeviceList, SLOT(CameraTreeUpdated())); }
void VSCMainWindows::EditCamera(s32 nId) { VDC_DEBUG( "%s %d\n",__FUNCTION__, nId); DeviceParam mParam; gFactory->GetDeviceParamById(mParam, nId); VSCCameraAdd *pCameraadd = new VSCCameraAdd(mParam, this); //VSCView *pView2 = new VSCView(this); m_pMainArea->addTab(pCameraadd,tr("Camera")); m_pMainArea->setCurrentWidget(pCameraadd); connect(pCameraadd, SIGNAL(CameraTreeUpdated()), m_pDeviceList, SLOT(CameraTreeUpdated())); }
void VSCSearch::AddAll() { DeviceParam Param; int nId = 0; int insertRow = ui.tableWidget->rowCount(); VDC_DEBUG( "[ONVIF]: Searched %d", insertRow); /* Loop to add device */ for (int i = 0; i < insertRow; i ++) { if(ui.tableWidget->item(i, 0)->checkState() != Qt::Checked) { continue; } /* Update from UI */ updateParamValue(ui.tableWidget->item(i, 1), Param.m_Conf.data.conf.Name); updateParamValue(ui.tableWidget->item(i, 1), Param.m_Conf.data.conf.IP); updateParamValue(ui.tableWidget->item(i, 2), Param.m_Conf.data.conf.Port); updateParamValue(ui.tableWidget->item(i, 6), Param.m_Conf.data.conf.OnvifAddress); Param.m_Conf.data.conf.UseProfileToken = 0; Param.m_Conf.data.conf.nSubType = VSC_SUB_DEVICE_ONVIF; nId = gFactory->AddDevice(Param); VDC_DEBUG( "%s ID %d\n",__FUNCTION__, nId); } emit CameraTreeUpdated(); }
void VSCMainWindows::SetupConnections() { connect(m_pMainArea, SIGNAL(tabCloseRequested(int)), this, SLOT(MainCloseTab(int))); connect(m_pDeviceList, SIGNAL(SurveillanceClicked()), this, SLOT(AddSurveillance())); connect(m_pDeviceList, SIGNAL(CameraAddClicked()), this, SLOT(AddCamera())); connect(m_pDeviceList, SIGNAL(SearchClicked()), this, SLOT(Search())); connect(m_pDeviceList, SIGNAL(CameraEditClicked(int)), this, SLOT(EditCamera(int))); connect(m_pDeviceList, SIGNAL(CameraDeleteClicked(int)), this, SLOT(DeleteCamera(int))); connect(this, SIGNAL(CameraDeleted()), m_pDeviceList, SLOT(CameraTreeUpdated())); }
void VSCDeviceList::SetupConnections() { connect(ui.pbSurveillance, SIGNAL(clicked()), this, SLOT(SurveillanceClick())); connect(ui.pbCamera, SIGNAL(clicked()), this, SLOT(CameraAddClick())); connect(ui.pbEmap, SIGNAL(clicked()), this, SLOT(EmapClick())); connect(ui.pbDmining, SIGNAL(clicked()), this, SLOT(DminingClick())); connect(ui.pbSearch, SIGNAL(clicked()), this, SLOT(SearchClick())); connect(ui.pbRecorder, SIGNAL(clicked()), this, SLOT(RecorderClick())); connect(ui.pbVIPC, SIGNAL(clicked()), this, SLOT(VIPCAddClick())); connect(ui.treeWidget, SIGNAL(CameraAddClicked()), this, SIGNAL(CameraAddClicked())); connect(ui.treeWidget, SIGNAL(CameraEditClicked(int)), this, SIGNAL(CameraEditClicked(int))); connect(ui.treeWidget, SIGNAL(CameraDeleteClicked(int)), this, SIGNAL(CameraDeleteClicked(int))); connect(ui.treeWidget, SIGNAL(StartRecordAllClicked()), this, SLOT(StartRecordAll())); connect(ui.treeWidget, SIGNAL(StopRecordAllClicked()), this, SLOT(StopRecordAll())); connect(ui.treeWidget, SIGNAL(StartHdfsRecordAllClicked()), this, SLOT(StartHdfsRecordAll())); connect(ui.treeWidget, SIGNAL(StopHdfsRecordAllClicked()), this, SLOT(StopHdfsRecordAll())); /* VIPC */ connect(ui.treeWidget, SIGNAL(VIPCAddClicked()), this, SIGNAL(VIPCAddClicked())); connect(ui.treeWidget, SIGNAL(VIPCEditClicked(int)), this, SIGNAL(VIPCEditClicked(int))); connect(ui.treeWidget, SIGNAL(VIPCDeleteClicked(int)), this, SIGNAL(VIPCDeleteClicked(int))); /* View */ connect(ui.treeWidget, SIGNAL(ViewDeleteClicked(int)), this, SIGNAL(ViewDeleteClicked(int))); connect(ui.treeWidget, SIGNAL(DiskEditClicked()), this, SIGNAL(DiskEditClicked())); connect(ui.pbTrash, SIGNAL(CameraDeleted()), this, SLOT(CameraTreeUpdated())); /* Group */ connect(ui.treeWidget, SIGNAL(VGroupAddClicked()), this, SIGNAL(VGroupAddClicked())); connect(ui.treeWidget, SIGNAL(VGroupEditClicked(int)), this, SIGNAL(VGroupEditClicked(int))); connect(ui.treeWidget, SIGNAL(VGroupDeleteClicked(int)), this, SIGNAL(VGroupDeleteClicked(int))); connect(ui.treeWidget, SIGNAL(VGroupMapClicked()), this, SIGNAL(VGroupMapClicked())); /* VMS */ connect(ui.treeWidget, SIGNAL(VMSDeleteClicked(int)), this, SIGNAL(VMSDeleteClicked(int))); }
VSCDeviceList::VSCDeviceList(QWidget *parent) : QWidget(parent) { ui.setupUi(this); /* Add Group first */ VGroupTreeUpdated(); CameraTreeUpdated(); DiskTreeUpdated(); VmsTreeUpdated(); ViewTreeUpdated(); VIPCTreeUpdated(); SetupConnections(); m_Timer = new QTimer(this); //connect(m_Timer,SIGNAL(timeout()),this,SLOT(UpdateOnline())); //m_Timer->start(1000 * 3); m_TimerDisk = new QTimer(this); connect(m_TimerDisk,SIGNAL(timeout()),this,SLOT(DiskTreeUpdated())); /* Disk 60s update */ m_TimerDisk->start(1000 * 15); gFactory->RegDeviceChangeNotify((void *)this, (FactoryDeviceChangeNotify)(VSCDeviceList::DeviceChangeCallbackFunc)); //ui.pbRecorder->hide(); //ui.lbRecorder->hide(); //ui.pbDmining->hide(); //ui.lbMining->hide(); //ui.pbEmap->hide(); //ui.lbEmap->hide(); }