COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
MainWindow Class Reference

#include <mainwindow.h>

Inheritance diagram for MainWindow:
Collaboration diagram for MainWindow:

Public Member Functions

 MainWindow (QWidget *parent=0)
 
 ~MainWindow ()
 

Static Public Attributes

static char names [3][11] = {"rearth", "eci2kep", "tl;dr"}
 

Private Slots

void on_ChangeFolder_clicked ()
 
void on_CollapseAll_clicked ()
 
void on_SelectAll_clicked ()
 
void on_DeselectAll_clicked ()
 
void recountTests ()
 
void on_RunAll_clicked ()
 
void on_RunSelected_clicked ()
 

Private Attributes

Ui::MainWindow * ui
 

Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0)
explicit
42  :
43  QMainWindow(parent),
44  ui(new Ui::MainWindow)
45 {
46  ui->setupUi(this);
47  setCentralWidget(ui->scrollArea);
48  QVBoxLayout* testzone = new QVBoxLayout;
49  for (int i=0; i<NUM_TESTS; i++) {
50  tests[i] = new TestContainer(this, i);
51  testzone->addWidget(tests[i]);
52  connect(tests[i], SIGNAL(selectionChanged()), this, SLOT(recountTests()));
53  }
54  testzone->setContentsMargins(0, 0, 0, 0);
55  ui->frame->setLayout(testzone);
56  recountTests();
57 }
Definition: testcontainer.h:44
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
void recountTests()
Definition: mainwindow.cpp:94
Ui::MainWindow * ui
Definition: mainwindow.h:67
#define NUM_TESTS
Definition: mainwindow.h:34
MainWindow::~MainWindow ( )
60 {
61  delete ui;
62 }
Ui::MainWindow * ui
Definition: mainwindow.h:67

Member Function Documentation

void MainWindow::on_ChangeFolder_clicked ( )
privateslot
65 {
66  FilepathDialog inputPath;
67  inputPath.setModal(true);
68 
69  if(inputPath.exec()) {
70  QString fpNew = inputPath.getFilepath();
71  if (fpNew.size()<=DATFOLD_SIZE-1) strcpy(dataFolder, fpNew.toAscii().constData());
72  //need a function to sanitize user input and add extra backslashes.
73  //(also need a function to get rid of extra backslashes so the filepath can be displayed properly)
74  QString newfp = QString(QLatin1String(dataFolder));
75  ui->fpLabel->setText(newfp);
76  }
77 }
char dataFolder[256]
Definition: mainwindow.cpp:37
Ui::MainWindow * ui
Definition: mainwindow.h:67
#define DATFOLD_SIZE
Definition: mainwindow.cpp:35
QString getFilepath()
Definition: filepathdialog.cpp:45
Definition: filepathdialog.h:39
void MainWindow::on_CollapseAll_clicked ( )
privateslot
80 {
81  for (int i=0; i<NUM_TESTS; i++) tests[i]->toggleHidden(false);
82 }
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
#define NUM_TESTS
Definition: mainwindow.h:34
void MainWindow::on_SelectAll_clicked ( )
privateslot
85 {
86  for (int i=0; i<NUM_TESTS; i++) tests[i]->setSelected(true);
87 }
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
#define NUM_TESTS
Definition: mainwindow.h:34
void MainWindow::on_DeselectAll_clicked ( )
privateslot
90 {
91  for (int i=0; i<NUM_TESTS; i++) tests[i]->setSelected(false);
92 }
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
#define NUM_TESTS
Definition: mainwindow.h:34
void MainWindow::recountTests ( )
privateslot
94  {
95  totalSelected = totalRun = 0;
96  for (int i=0; i<NUM_TESTS; i++) {
97  if (tests[i]->isSelected) totalSelected++;
98  if (tests[i]->completed) totalRun++;
99  }
100  QString readout = QString("%1 functions total, %2 selected, %3 tested.").arg(NUM_TESTS).arg(totalSelected).arg(totalRun);
101  ui->testCounter->setText(readout);
102 }
int totalRun
Definition: mainwindow.cpp:39
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
int totalSelected
Definition: mainwindow.cpp:38
Ui::MainWindow * ui
Definition: mainwindow.h:67
#define NUM_TESTS
Definition: mainwindow.h:34
void MainWindow::on_RunAll_clicked ( )
privateslot
105 {
106  for (int i=0; i<NUM_TESTS; i++) tests[i]->runTest();
107 }
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
#define NUM_TESTS
Definition: mainwindow.h:34
void MainWindow::on_RunSelected_clicked ( )
privateslot
110 {
111  for (int i=0; i<NUM_TESTS; i++) if (tests[i]->isSelected) tests[i]->runTest();
112 }
int i
Definition: rw_test.cpp:37
TestContainer * tests[3]
Definition: mainwindow.cpp:36
void runTest()
Definition: testcontainer.cpp:59
#define NUM_TESTS
Definition: mainwindow.h:34

Member Data Documentation

char MainWindow::names = {"rearth", "eci2kep", "tl;dr"}
static
Ui::MainWindow* MainWindow::ui
private

The documentation for this class was generated from the following files: