Cheetah Software  1.0
SimControlPanel.cpp File Reference
#include "SimControlPanel.h"
#include <ControlParameters/ControlParameters.h>
#include <QFileDialog>
#include <QMessageBox>
#include "ui_SimControlPanel.h"
+ Include dependency graph for SimControlPanel.cpp:

Go to the source code of this file.

Functions

static void createErrorMessage (const std::string &text)
 
static void updateQtableWithParameters (ControlParameters &params, QTableWidget &table)
 

Function Documentation

static void createErrorMessage ( const std::string &  text)
static

Display an error messagebox with the given text

Definition at line 11 of file SimControlPanel.cpp.

11  {
12  QMessageBox mb;
13  mb.setText(QString(text.c_str()));
14  mb.exec();
15 }

+ Here is the caller graph for this function:

static void updateQtableWithParameters ( ControlParameters params,
QTableWidget &  table 
)
static

Display control parameters in a qtable.

Definition at line 20 of file SimControlPanel.cpp.

References ControlParameterCollection::_map, and ControlParameters::collection.

21  {
22  table.setRowCount((s32)params.collection._map.size());
23  table.setColumnCount(2);
24 
25  s32 i = 0;
26  for (auto& kv : params.collection._map) {
27  (void)kv;
28  for (s32 col = 0; col < 2; col++) {
29  QTableWidgetItem* cell = table.item(i, col);
30  if (!cell) {
31  cell = new QTableWidgetItem;
32  table.setItem(i, col, cell);
33  }
34  }
35 
36  table.item(i, 0)->setText(QString(kv.first.c_str()));
37  table.item(i, 1)->setText(QString(kv.second->toString().c_str()));
38  i++;
39  }
40 }
ControlParameterCollection collection
std::map< std::string, ControlParameter * > _map
int32_t s32
Definition: cTypes.h:23

+ Here is the caller graph for this function: