Example #1
0
BOOL OAPIConverter::Converter(VidCamera &from, oapi::OAPICamera &to)
{
	to.strId = from.strid();
	to.strName = from.strname();
	to.nType = from.ntype();
	
	to.strIP = from.strip();
	to.strPort = from.strport();
	to.strUser = from.struser();
	to.strPasswd = from.strpasswd();
	
	to.strONVIFAddress = from.stronvifaddress();
	to.bProfileToken = from.bprofiletoken();
	to.strProfileToken1 = from.strprofiletoken1();
	to.strProfileToken2 = from.strprofiletoken2();

	
	to.strFile = from.strfile();
	to.strRTSPUrl = from.strrtspurl();

	to.bHWaccel = from.bhwaccel();
	to.bServerMotion = from.bservermotion();

	to.nConnectType = from.nconnecttype();
	
	return TRUE;
}
Example #2
0
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));
}
Example #3
0
void VidCamAdd::SetCamUI(VidCamera pCam)
{
	switch(pCam.ntype())
	{
		case VID_FILE:
			ui.radioButtonFile->setChecked(true);
			break;
		case VID_RTSP:
			ui.radioButtonRtsp->setChecked(true);
			break;
		case VID_ONVIF_S:
			ui.radioButtonOnvif->setChecked(true);
			break;
		default:
			return;
	}
	SlotRadioButtonClicked();
	ui.lineEditName->setText(pCam.strname().c_str());
	ui.lineEditIP->setText(pCam.strip().c_str());
	ui.lineEditPort->setText(pCam.strport().c_str());
	ui.lineEditUser->setText(pCam.struser().c_str());
	ui.lineEditPassword->setText(pCam.strpasswd().c_str());
	ui.lineEditFile->setText(pCam.strfile().c_str());
	ui.lineEditRtspAddr->setText(pCam.strrtspurl().c_str());
	ui.pbMotionJPEG->setChecked(pCam.bmotionjpeg());
}
Example #4
0
void VidCamAdd::TreeWidgetUpdate()
{

	VidCameraList camList;
	StorSyncInf syncInf(m_sStor, 5 * 1000);

	VSCLoading loading(NULL);
	loading.show();
	QDesktopWidget *desktop = QApplication::desktop();
	QRect rect = desktop->screenGeometry(0);
	loading.setGeometry(rect.width()/2, rect.height()/2, 64, 64);
	QCoreApplication::processEvents();

	if (syncInf.Connect() == false)
	{
		return;
	}

	camList = syncInf.GetVidCameraList();
	
	
	int storSize = camList.cvidcamera_size();
	int nRowCnt = ui.tableWidget->rowCount();

	for (s32 j = 0; j < nRowCnt; j ++)
	{
		ui.tableWidget->removeRow(j);
	}
	ui.tableWidget->clear();

	
	for (s32 i = 0; i < camList.cvidcamera_size(); i ++)
	{
		VidCamera pCam = camList.cvidcamera(i);
		//int insertRow = ui.tableWidget->rowCount();
		int insertRow = i;
    		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()));
	}

}