📄 dsform.cpp
字号:
}void dsForm::dsMinorRecordSet(bool on){ int ChannelNum = CBChannelL -> currentItem(); int index = CBMinorEncoderL -> currentItem(); PictureFormat_t pictureFormat = ENC_CIF_FORMAT; if (index == 0) pictureFormat = ENC_4CIF_FORMAT; else if (index == 1) pictureFormat = ENC_2CIF_FORMAT; else if (index == 2) pictureFormat = ENC_DCIF_FORMAT; else if (index == 3) pictureFormat = ENC_CIF_FORMAT; else if (index == 4) pictureFormat = ENC_QCIF_FORMAT; if (ChannelNum == 1) { if ( on ) { CBMinorEncoderL -> setEnabled(FALSE); CBMinorStreamL -> setEnabled(FALSE); w_full_area -> StreamTypeSubAllSet(CBMinorStreamL -> currentItem() +1); w_full_area -> EncoderSubAllSet(pictureFormat); } else { CBMinorEncoderL -> setEnabled(TRUE); CBMinorStreamL -> setEnabled(TRUE); } w_full_area->RecordSubAllSet(on); } else if (ChannelNum >= 2) { if ( on ) { CBMinorEncoderL -> setEnabled(FALSE); CBMinorStreamL -> setEnabled(FALSE); w_full_area -> EncoderSubSet(pictureFormat); w_full_area -> StreamTypeSubSet(CBMinorStreamL -> currentItem() +1); } else { CBMinorEncoderL -> setEnabled(TRUE); CBMinorStreamL -> setEnabled(TRUE); } w_full_area -> RecordSubSet(on); }}void dsForm::dsMajorRecordSet(bool on){ int ChannelNum = CBChannelL -> currentItem(); int index = CBMajorEncoderL -> currentItem(); PictureFormat_t pictureFormat = ENC_CIF_FORMAT; if (index == 0) pictureFormat = ENC_4CIF_FORMAT; else if (index == 1) pictureFormat = ENC_2CIF_FORMAT; else if (index == 2) pictureFormat = ENC_DCIF_FORMAT; else if (index == 3) pictureFormat = ENC_CIF_FORMAT; else if (index == 4) pictureFormat = ENC_QCIF_FORMAT; if (ChannelNum == 1) { if ( on ) { CBMajorEncoderL -> setEnabled(FALSE); CBMajorStreamL -> setEnabled(FALSE); w_full_area -> EncoderAllSet(pictureFormat); w_full_area -> StreamTypeAllSet(CBMajorStreamL -> currentItem() +1); } else { CBMajorEncoderL -> setEnabled(TRUE); CBMajorStreamL -> setEnabled(TRUE); } w_full_area->RecordAllSet(on); } else if (ChannelNum >= 2) { if ( on ) { CBMajorEncoderL -> setEnabled(FALSE); CBMajorStreamL -> setEnabled(FALSE); w_full_area -> EncoderSet(pictureFormat); w_full_area -> StreamTypeSet(CBMajorStreamL -> currentItem() +1); } else { CBMajorEncoderL -> setEnabled(TRUE); CBMajorStreamL -> setEnabled(TRUE); } w_full_area -> RecordSet(on); }}void dsForm::areaClick(int click){ static int fullflag = 1; int port; QString qS; port = w_full_area->GetSelectPort(); w_channel->setText(qS.sprintf("%9d", port)); if(click == RIGHTCLICKED) { if(fullflag) { disconnect(tabWidget3, 0, 0, 0); TitleEdit->hide(); tabWidget3->hide(); showFullScreen(); w_full_area->resize(1024, 768); fullflag = 0; } else { w_full_area->resize(800, 700); showNormal(); TitleEdit->show(); tabWidget3->show(); fullflag = 1; connect(tabWidget3, SIGNAL(currentChanged (QWidget *)), SLOT(PageChange(QWidget *))); } }}void dsForm::audioChangeSet(int Select, float data){ QString qS; if (Select == atoi(w_channel -> text())) w_audio_frame->setText(qS.sprintf("%10.1f", data));}void dsForm::videoChangeSet(int Select, float data){ QString qS; if (Select == atoi(w_channel -> text())) w_video_frame->setText(qS.sprintf("%10.1f", data));}void dsForm::totalChangeSet(int Select, int data){ QString qS; if (Select == atoi(w_channel -> text())) w_totalframe->setText(qS.sprintf("%9d", data)); }void dsForm::bitRateChangeSet(int Select, int data){ QString qS; if (Select == atoi(w_channel -> text())) w_bit_rate->setText(qS.sprintf("%9d", data));}void dsForm::countChangeSet(int data){ QString qS; w_netusercount->setText(qS.sprintf("%9d", data));}void dsForm::fullSpaceSet(){ static int run = 0; FormInfo *forminf; pthread_mutex_lock(&mutex); if ( !run ) { forminf = new FormInfo(this, "Information", Qt::WType_TopLevel); forminf -> setGeometry(QRect(300, 300, 200, 120)); forminf -> show(); run = 1; } pthread_mutex_unlock(&mutex);}void dsForm::noNetSet(){ QMessageBox::warning ( this, "MessageBox", "The net transfer setting isn't opened!", QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);}void dsForm::netChangeSet(bool on){ OutputDebugString("In netChangeSet \n"); w_full_area -> NetTransferSet(on);}void dsForm::checkspace(){ char savepath[10]="."; int freespace; struct statfs bbuf; if(statfs(savepath, &bbuf) < 0) { OutputErrorString("statsfs() faied, error: %d\n", errno); } else { freespace = bbuf.f_bavail * (bbuf.f_bsize/1024); if (freespace < RunQuest) { OutputErrorString("The Space of Disk isn't enough!! So you'd better stop Recording\n"); CheckMajorRecordL->setEnabled(FALSE); CheckMinorRecordL->setEnabled(FALSE); CheckImageCaptureL->setEnabled(FALSE); } }}void dsForm::changeEdit(){ char savepath[10]="."; char tmp = '%'; int freespace; struct statfs bbuf; QDateTime Dtchange = QDateTime::currentDateTime(); QString Qschange; DateEdit->setText(Dtchange.date().toString("yyyy-MM-dd")); TimeEdit->setText(Dtchange.time().toString("hh:mm:ss")); if(statfs(savepath, &bbuf) < 0) { OutputErrorString("statsfs() faied, error: %d\n", errno); } else { freespace = (100*bbuf.f_bavail)/bbuf.f_blocks; Qschange.sprintf(" %3d%c", freespace, tmp); } FreespaceEdit->setText(Qschange);}void dsForm::PageChange(QWidget *CurrentPage) //状态切换的时候,注意以前的状态{ static int index = 0; static int index_before = 0; int tempindex; bool tempfull; if (!strcmp(CurrentPage -> name(), "tab")) { if (index == 2 && index_before == 0) { index = 0; return; } tempindex = CBChannelL -> currentItem(); tempfull = w_full_area -> GetFullState(); if (GFullArea) { w_full_area -> SetSelectPort(GSelectPort); if (tempfull) w_full_area -> ChangeFullPort(); else w_full_area -> SetFullEnable(TRUE); } else { if(tempfull) w_full_area->SetFullEnable(FALSE); w_full_area -> SetSelectPort(GSelectPort); } disconnect(w_preview, 0, 0, 0); w_preview->setChecked(TRUE); connect(w_preview, SIGNAL(toggled(bool)), w_full_area, SLOT(PreviewAllSet(bool))); disconnect(w_record, 0, 0, 0); w_record->setChecked(bool(w_full_area -> AllRecordStatus())); connect(w_record, SIGNAL(toggled(bool)), w_full_area, SLOT(RecordAllSet(bool))); GSelectPort = tempindex; GFullArea = tempfull; index = 0; } else if (!strcmp(CurrentPage -> name(), "tab_2")) { fprintf(stderr, "Enter Page Two\n"); if (index == 2 && index_before == 1) { index = 1; return; } w_full_area -> PreviewAllSet(TRUE); //保证切换到Localsetting时是正确的 //disconnect(CheckMajorRecordL, 0, 0,0); //CheckMajorRecordL->setChecked(w_record->isChecked()); //connect(CheckMajorRecordL, SIGNAL(toggled(bool)), SLOT(dsMajorRecordSet(bool))); tempindex = w_full_area -> GetSelectPort(); tempfull = w_full_area -> GetFullState(); if(GFullArea) { if(GSelectPort == 0) { SetAllEnabled(FALSE); w_full_area -> SetSelectPort(w_full_area -> GetLastPort()); w_full_area -> SetFullEnable(TRUE); } else { w_full_area -> SetSelectPort(GSelectPort-2); w_full_area -> SetFullEnable(TRUE); } } else { if(tempfull) w_full_area -> SetFullEnable(FALSE); if(GSelectPort == 0) SetAllEnabled(FALSE); w_full_area -> SetSelectPort(w_full_area -> GetLastPort()); } GSelectPort = tempindex; GFullArea = tempfull; index = 1; } else { if (index == 0) index_before = 0; else if (index == 1) index_before = 1; index = 2; } }bool dsForm::eventFilter( QObject *o, QEvent *e ){ int index = tabWidget3 -> currentPageIndex(); if((o == w_full_area) && (index == 1 || index == 2)) { if (((e -> type() == QEvent::MouseButtonPress) || (e -> type() == QEvent::MouseButtonRelease) || (e -> type() == QEvent::MouseButtonDblClick))) { OutputDebugString("eventFilter 1\n"); return TRUE; } } return QWidget::eventFilter( o, e );}void dsForm::SetComBox(){ int temp, num; QString Qs; DSDEMO* dstemp = w_full_area -> GetDsinfo(0); num = GetTotalChannels(); CBChannelL->insertItem("NoSet"); CBChannelL->insertItem("All"); for( temp = 0; temp < num; temp++) { Qs.sprintf("Channel %2d", temp); CBChannelL->insertItem(Qs); } CBMajorStreamL->insertItem("VIDEO"); CBMajorStreamL->insertItem("SOUND"); CBMajorStreamL->insertItem("AVSYNC"); CBMinorStreamL->insertItem("VIDEO"); CBMinorStreamL->insertItem("SOUND"); CBMinorStreamL->insertItem("AVSYNC"); //CBMajorEncoderL->insertItem("No Set"); CBMajorEncoderL->insertItem("4CIF"); CBMajorEncoderL->insertItem("2CIF"); CBMajorEncoderL->insertItem("DCIF"); CBMajorEncoderL->insertItem("CIF"); CBMajorEncoderL->insertItem("QCIF"); //CBMinorEncoderL->insertItem("No Set"); CBMinorEncoderL->insertItem("4CIF"); CBMinorEncoderL->insertItem("2CIF"); CBMinorEncoderL->insertItem("DCIF"); CBMinorEncoderL->insertItem("CIF"); CBMinorEncoderL->insertItem("QCIF"); CBModeL->insertItem("Constant"); CBModeL->insertItem("Varied"); SliderBrightnessL->setMinValue(0); SliderBrightnessL->setMaxValue(255); SliderBrightnessL->setLineStep(1); SliderBrightnessL->setPageStep(10); SliderContrastL->setMinValue(0); SliderContrastL->setMaxValue(127); SliderContrastL->setLineStep(1); SliderContrastL->setPageStep(10); SliderSaturationL->setMinValue(0); SliderSaturationL->setMaxValue(127); SliderSaturationL->setLineStep(1); SliderSaturationL->setPageStep(10); SliderHueL->setMinValue(0); SliderHueL->setMaxValue(255); SliderHueL->setLineStep(1); SliderHueL->setPageStep(10); SliderOsdBrightnessL->setMinValue(0); SliderOsdBrightnessL->setMaxValue(255); SliderOsdBrightnessL->setLineStep(1); SliderOsdBrightnessL->setPageStep(10); SliderOsdPosXL->setMinValue(0); SliderOsdPosXL->setMaxValue(351); SliderOsdPosXL->setLineStep(8); SliderOsdPosXL->setPageStep(32); SliderOsdPosYL->setMinValue(0); SliderOsdPosYL->setLineStep(1); SliderOsdPosYL->setPageStep(10); SliderLogoPosXL->setMinValue(0); SliderLogoPosXL->setMaxValue(703); SliderLogoPosXL->setLineStep(1); SliderLogoPosXL->setPageStep(10); SliderLogoPosYL->setMinValue(0); SliderLogoPosYL->setLineStep(1); SliderLogoPosYL->setPageStep(10); if(dstemp-> videostandard == StandardNTSC) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -