COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
testcontainer.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 #ifndef TESTCONTAINER_H
31 #define TESTCONTAINER_H
32 
33 #include <QWidget>
34 #include <QListWidget>
35 #include "convertlib.h"
36 #include "mathlib.h"
37 #include <stdio.h>
38 #include "mainwindow.h"
39 
40 namespace Ui {
41  class TestContainer;
42 }
43 
44 class TestContainer : public QWidget
45 {
46  Q_OBJECT
47 
48 public:
49  explicit TestContainer(MainWindow* parent = 0, int testIndex = 0);
50  ~TestContainer();
51 
52  void toggleHidden(bool show);
53 
54  void setError(double min, double max, double avg);
55 
56  void setSelected(bool selected);
57 
58  void runTest();
59 
60  /*My own little set of file reading functions*/
61  static void skipLines(FILE *fp, int lines);//skips 'lines' many lines, stops at EOF if necessary
62  static int openFileLine(FILE **fp, const char filename[], int startLine);//opens a file for reading and moves the pointer to startLine
63 
64  /*Set of functions to write cosmos datastructures to QListWidgetItems*/
65  static void listWriteRVec(QListWidgetItem *listItem, rvector vect, int *roleIndex);
66  static void listWriteCartpos(QListWidgetItem *listItem, cartpos pos, int *roleIndex);
67  static void listWriteKepstruc(QListWidgetItem *listItem, kepstruc kep, int *roleIndex);
68 
69  static double angleDelta(double angle1, double angle2); //compares the two angles (radians) returns angle1-angle2
70  static kepstruc keplerDelta(kepstruc kep1, kepstruc kep2); //compares two kepstrucs and returns kep1-kep2
71 
72  bool isSelected;
73  bool completed;
74  bool hidden;
75  double MinError;
76  double MaxError;
77  double AvgError;
78  int number;
79 
80 private slots:
81  void on_Expand_clicked();
82 
83  void on_checkBox_stateChanged(int arg1);
84 
85 signals:
86  void selectionChanged();
87 
88 private:
89  Ui::TestContainer *ui;
90 
91  void fadeBanner(bool faded);
92 
93 };
94 
95 #endif // TESTCONTAINER_H
int openFileLine(FILE **fp, const char filename[], int startLine)
Definition: convert_test.cpp:213
bool completed
Definition: testcontainer.h:73
Definition: testcontainer.h:44
3 element generic row vector
Definition: vector.h:53
double AvgError
Definition: testcontainer.h:77
int number
Definition: testcontainer.h:78
Definition: eci2kep_test.h:37
Cartesian full position structure.
Definition: convertdef.h:158
bool isSelected
Definition: testcontainer.h:72
convertlib include file A library providing functions for conversion between the various position and...
Classical elements structure.
Definition: convertdef.h:529
Ui::TestContainer * ui
Definition: testcontainer.h:89
mathlib include file
double MaxError
Definition: testcontainer.h:76
FILE * fp
Definition: rw_test.cpp:38
bool hidden
Definition: testcontainer.h:74
void skipLines(FILE *fp, int lines)
Definition: convert_test.cpp:226
Definition: mainwindow.h:40
double MinError
Definition: testcontainer.h:75