void VidCamAdd::SlotNewCam() { VidCamera pCam; UUIDGenerator uuidCreator; astring strId = uuidCreator.createRandom().toString(); pCam.set_strid(strId); pCam.set_strname("New Camera"); pCam.set_strip("192.168.0.1"); pCam.set_strport("80"); pCam.set_struser("admin"); pCam.set_strpasswd("admin"); pCam.set_ntype(VID_ONVIF_S); pCam.set_stronvifaddress("/onvif/device_service"); pCam.set_bmotionjpeg(false); pCam.set_strrtspurl("rtsp://192.168.0.1:554/Streaming"); astring filePath = "camera.mp4"; pCam.set_strfile(filePath.c_str()); astring *pSched = pCam.add_crecsched(); *pSched = REC_SCHED_ALL_DAY; int insertRow = ui.tableWidget->rowCount(); ui.tableWidget->insertRow(insertRow); QTableWidgetItem *firstCheck = new VidCamTableItem(pCam, false); firstCheck->setCheckState(Qt::Checked); ui.tableWidget->setItem(insertRow, 0, firstCheck); ui.tableWidget->setItem(insertRow, 1, new QTableWidgetItem(pCam.strname().c_str())); ui.tableWidget->setItem(insertRow, 2, new QTableWidgetItem(pCam.strip().c_str())); ui.tableWidget->setItem(insertRow, 3, new QTableWidgetItem(pCam.struser().c_str())); ui.tableWidget->selectRow(insertRow); emit(SignalSectionClicked(insertRow, 0)); }
void VidCamAdd::GetCamUI(VidCamera &pCam) { if (ui.radioButtonRtsp->isChecked() == true) { pCam.set_ntype(VID_RTSP); }else if (ui.radioButtonOnvif->isChecked() == true) { pCam.set_ntype(VID_ONVIF_S); }else if (ui.radioButtonFile->isChecked() == true) { pCam.set_ntype(VID_FILE); } pCam.set_stronvifaddress("/onvif/device_service"); pCam.set_strname(ui.lineEditName->text().toStdString()); pCam.set_strip(ui.lineEditIP->text().toStdString()); pCam.set_strport(ui.lineEditPort->text().toStdString()); pCam.set_struser(ui.lineEditUser->text().toStdString()); pCam.set_strpasswd(ui.lineEditPassword->text().toStdString()); pCam.set_strfile(ui.lineEditFile->text().toStdString()); pCam.set_strrtspurl(ui.lineEditRtspAddr->text().toStdString()); pCam.set_bmotionjpeg(ui.pbMotionJPEG->isChecked()); }