ImageMonitorStatisticsWidget.cpp
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Kai Welke ( welke at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
24
26
27using namespace armarx;
28
29namespace visionx
30{
35
39
40 void
41 ImageMonitorStatisticsWidget::update(std::string providerName,
42 ImageProviderInfo providerInfo,
43 ImageTransferStats transferStats)
44 {
45 // provider info
46 ui.providerNameLabel->setText(QString(providerName.c_str()));
47 QString numberImages = QString("%1").arg(providerInfo.numberImages);
48 ui.numberImagesLabel->setText(numberImages);
49 QString imageSize = QString("%1x%2")
50 .arg(providerInfo.imageFormat.dimension.width)
51 .arg(providerInfo.imageFormat.dimension.height);
52 ui.imageSizeLabel->setText(imageSize);
53
54 std::string imageTypeName =
56 ui.imageFormatLabel->setText(QString(imageTypeName.c_str()));
57
58 // broadcast statistics
59 ui.bcFpsLabel->setText(QString("%1").arg(transferStats.imageProviderFPS.getFPS()));
60 ui.bcCycleMeanLabel->setText(
61 QString("%1").arg(transferStats.imageProviderFPS.getMeanCycleTimeMS()));
62 ui.bcCycleMinLabel->setText(
63 QString("%1").arg(transferStats.imageProviderFPS.getMinCycleTimeMS()));
64 ui.bcCycleMaxLabel->setText(
65 QString("%1").arg(transferStats.imageProviderFPS.getMaxCycleTimeMS()));
66
67 // polling statistics
68 ui.plFpsLabel->setText(QString("%1").arg(transferStats.pollingFPS.getFPS()));
69 ui.plCycleMeanLabel->setText(
70 QString("%1").arg(transferStats.pollingFPS.getMeanCycleTimeMS()));
71 ui.plCycleMinLabel->setText(
72 QString("%1").arg(transferStats.pollingFPS.getMinCycleTimeMS()));
73 ui.plCycleMaxLabel->setText(
74 QString("%1").arg(transferStats.pollingFPS.getMaxCycleTimeMS()));
75 }
76} // namespace visionx
float getMeanCycleTimeMS()
Get mean cycle time over last 10 frames.
float getMinCycleTimeMS()
Get minimum cycle time since start.
float getFPS()
Get frames per second.
float getMaxCycleTimeMS()
Get maximum cycle time since start.
void update(std::string providerName, ImageProviderInfo providerInfo, ImageTransferStats transferStats)
int numberImages
Number of images.
ImageFormatInfo imageFormat
Image format struct that contains all necessary image information.
The ImageTransferStats class provides information on the connection between ImageProvider and ImagePr...
FPSCounter pollingFPS
Statistics for the images polled by the ImageProcessor.
FPSCounter imageProviderFPS
Statistics for the images announced by the ImageProvider.
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::string imageTypeToTypeName(const ImageType imageType)
Converts an image type into a string integer.
ArmarX headers.