32 #include <QApplication>
43 ImageMonitorPropertiesWidget::ImageMonitorPropertiesWidget()
47 proxyFinder->setSearchMask(
"*Provider|*Result");
48 ui.horizontalLayout->addWidget(proxyFinder);
50 connect(proxyFinder, SIGNAL(validProxySelected(QString)),
this, SLOT(onValidProxySelected(QString)));
51 connect(ui.spinBoxDepthImageIndex, SIGNAL(valueChanged(
int)),
this, SLOT(refreshRecordingWidgets()));
52 connect(ui.comboBoxCompressionType, SIGNAL(currentIndexChanged(
int)),
this, SLOT(compressionTypeChanged(
int)));
55 this->ui.comboBoxFrameRate->addItem(
"Source framerate", -1);
56 for (
unsigned int i = 30; i > 0; i -= 5)
58 this->ui.comboBoxFrameRate->addItem(QString::number(i) +
" fps",
static_cast<int>(i));
60 this->ui.comboBoxFrameRate->addItem(
"1 fps", 1);
62 QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
63 this->setSizePolicy(sizePolicy);
66 ImageMonitorPropertiesWidget::~ImageMonitorPropertiesWidget()
73 this->iceManager = iceManager;
74 proxyFinder->setIceManager(iceManager, proxyFinder->getSelectedProxyName().isEmpty());
75 proxyFinder->setDefaultSelectedProxy(QString::fromStdString(properties.
providerName));
78 this->ui.comboBoxFrameRate->setCurrentIndex(this->ui.comboBoxFrameRate->findData(properties.
frameRate));
80 ui.doubleSpinBoxBufferFps->setValue(
static_cast<double>(properties.
bufferFps));
86 l << QString::number(number);
88 ui.lineEditImagesToShow->setText(l.join(
","));
90 ui.spinBoxMaxDepth->setValue(properties.
maxDepthmm);
93 ui.comboBoxCompressionType->setCurrentIndex((
int)properties.
compressionType);
103 QString text = proxyFinder->getSelectedProxyName();
104 std::string providerName = text.toStdString();
108 properties.
frameRate = this->ui.comboBoxFrameRate->itemData(this->ui.comboBoxFrameRate->currentIndex()).toInt();
112 properties.
bufferFps =
static_cast<float>(ui.doubleSpinBoxBufferFps->value());
113 QStringList
list = ui.lineEditImagesToShow->text().split(
",");
115 for (QString&
s :
list)
129 properties.
maxDepthmm = ui.spinBoxMaxDepth->value();
131 properties.
compressionType =
static_cast<CompressionType
>(ui.comboBoxCompressionType->currentIndex());
138 ImageMonitorPropertiesWidget::onValidProxySelected(
const QString& proxyName)
143 IceGrid::AdminPrx admin = this->iceManager->getIceGridSession()->getAdmin();
144 Ice::Identity objectIceId = Ice::stringToIdentity(proxyName.toStdString());
145 visionx::ImageProviderInterfacePrx imageProviderPrx = visionx::ImageProviderInterfacePrx::checkedCast(admin->getObjectInfo(objectIceId).proxy);
146 unsigned int numImages =
static_cast<unsigned int>(imageProviderPrx->getNumberImages());
147 this->numImageSources = numImages;
155 void ImageMonitorPropertiesWidget::compressionTypeChanged(
int index)
157 ui.spinBoxCompressionQuality->setEnabled(
index != 0);
160 ui.spinBoxCompressionQuality->setValue(9);
164 ui.spinBoxCompressionQuality->setValue(95);