Loading...
Searching...
No Matches
BALL::VIEW::TestFramework Class Reference
Visualisation » Modular Widgets

`#include <BALL/VIEW/WIDGETS/testFramework.h>`

Inheritance diagram for BALL::VIEW::TestFramework:

## Public Slots

void | startTest ()
void | stopTest ()
void | runTest ()
void | abortTest ()
void | saveFile ()
void | loadFile ()
virtual bool | eventFilter (QObject *, QEvent *e)
virtual void | timeOut ()
void | switchRecordMove ()

## Public Member Functions

| TestFramework (QWidget *parent=0, const char *name=0)
virtual | ~TestFramework ()
virtual void | initializeWidget (MainControl &main_control)
void | setFilename (const String &filename)
void | checkMenu (MainControl &main_control)
virtual bool | canHandle (const String &fileformat) const
virtual bool | openFile (const String &filename)
Public Member Functions inherited from BALL::VIEW::ModularWidget
| ModularWidget (const char *name="<ModularWidget>")
| ModularWidget (const ModularWidget &widget)
virtual | ~ModularWidget ()
virtual void | destroy ()
virtual void | clear ()
QAction * | insertMenuEntry (Position parent_id, const QString &name, const QObject *receiver=0, const char *slot=0, const String &description="", QKeySequence accel=QKeySequence(), const QString &menu_hint=QString(""), UIOperationMode::OperationMode minimal_mode=UIOperationMode::MODE_ALL)
BALL_DEPRECATED void | setMenuHelp (QAction *, const String &)
virtual BALL_DEPRECATED void | registerForHelpSystem (const QObject *, const String &)
virtual void | addToolBarEntries (QToolBar *main_tb)
void | setIcon (QAction *action, const String &filename, bool add_to_main_toolbar=true)
virtual void | initializePreferencesTab (Preferences &preferences)
virtual void | finalizePreferencesTab (Preferences &preferences)
virtual void | applyPreferences ()
virtual void | fetchPreferences (INIFile &inifile)
virtual void | writePreferences (INIFile &inifile)
bool | lockComposites ()
bool | unlockComposites ()
| Unlock the Composites.
MainControl * | getMainControl () const
virtual void | setStatusbarText (const String &text, bool important=false)
virtual void | setStatusbarText (const QString &text, bool important=false)
String | getWorkingDir ()
| Implemented for convenience.
void | setWorkingDir (const String &dir)
| Implemented for convenience.
FragmentDB & | getFragmentDB () const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
void | setWorkingDirFromFilename_ (String filename)
virtual BALL_DEPRECATED void | showHelp (const String &)
virtual void | finalizeWidget (MainControl &main_control)
Public Member Functions inherited from BALL::Embeddable
| Embeddable (const String &identifier="<Embeddable>")
| Embeddable (const Embeddable &embeddable)
virtual | ~Embeddable ()
void | setIdentifier (const String &identifier)
const String & | getIdentifier () const
void | unregisterThis ()
virtual void | registerThis ()
Public Member Functions inherited from BALL::VIEW::ConnectionObject
| ConnectionObject ()
virtual | ~ConnectionObject ()
void | registerConnectionObject (ConnectionObject &object)
void | unregisterConnectionObject (ConnectionObject &object)
bool | isConnectionObjectRegistered (const ConnectionObject &object)
ConnectionObject * | getParent () const
ConnectionObject * | getRoot ()
virtual void | onNotify (Message *message)
virtual bool | isValid () const

## Protected Member Functions

virtual bool | event (QEvent *e)
void | storeEvent (QEvent &e)
void | processEvent_ ()
void | notify_ (Message *message)
void | notify_ (Message &message)
void | onNotify_ (Message *message)

## Protected Attributes

QAction * | start_recording
QAction * | stop_recording
QAction * | run_test
QAction * | abort_test
QAction * | save_file
QAction * | load_file
QAction * | switch_move
QAction * | action_
File | outfile_
File | infile_
String | filename_
Timer | timer_
Timer | runtime_
list< String > | lines_
QWidget * | widget_
QWidget * | last_widget_
float | time_
bool | event_busy_
Index | x_
Index | y_
int | modifiers_
int | type_
int | our_type_
int | button_
int | buttons_
bool | test_running_
bool | recording_
String | last_event_string_
String | last_names_
String | shortcut_
String | python_line_
String | expected_result_
MyEventThread | thread_
Size | errors_
QEvent * | last_event_
bool | is_command_line_
float | max_run_time_
Position | line_nr_
QAction * | window_menu_entry_
bool | show_window_enty_
bool | default_visible_
QList< QAction * > | main_toolbar_actions_

## Friends

class | MyEventThread

## Additional Inherited Members

Public Types inherited from BALL::Embeddable
typedef std::vector< Embeddable * > | EmbeddableVector
static void | registerWidget (ModularWidget *mwidget)
static void | registerInstance_ (const std::type_info &type, const Embeddable *instance)
static void | unregisterInstance_ (const Embeddable *instance)
static Size | countInstances_ (const std::type_info &type)
static Embeddable * | getInstance_ (const std::type_info &type, Position index)
static Embeddable * | getInstance_ (const std::type_info &type, const String &identifier)

## Detailed Description

Class for recording mouse and keyboard inputs, storing them in a line based file and replaying them. This can be used to

- create tests
- record entire presentations in advance
- for debugging (e.g. for recording the cause for a crash)
- storing and playing tutorials

This widget will create it's own menu with the name ''Macros''. The ''Pause'' key can be used to stop the recording or pause the replay of a macro. If a mouse key is pressed in replay mode this will also cause a pause.
The file format is line based and its fields are separated with the degree sign (°). The first field consists of only one letter and defines the line's meaning:

- ''C'' comment lines
- ''F'' for reading project files
- ''I'' for mouse and keyboard inputs
- ''P'' for Python commands
- ''T'' for Python test lines.
- ''R'' set maximum runtime (in seconds) of a test, kills the application after this time
- ''X'' exit the application and return the number of failed tests

The last two lines are only processed if a test is opened through a command line argument. Then comes the time in secs to wait before performing the action.

Definition at line 58 of file testFramework.h.

## Constructor & Destructor Documentation

## TestFramework()

BALL::VIEW::TestFramework::TestFramework | ( | QWidget * | parent = 0,
|  | const char * | name = 0 )

## ~TestFramework()

virtual BALL::VIEW::TestFramework::~TestFramework | ( |  | ) |

virtual

## Member Function Documentation

## abortTest

void BALL::VIEW::TestFramework::abortTest | ( |  | ) |

slot

## canHandle()

virtual bool BALL::VIEW::TestFramework::canHandle | ( | const String & |  | ) | const

virtual

Test if this ModularWidget can handle a given file format

Parameters

  fileform | short string with the file extension (e.g. PDB)

See also
  openFile
  MainControl::openFile

Reimplemented from BALL::VIEW::ModularWidget.

## checkMenu()

void BALL::VIEW::TestFramework::checkMenu | ( | MainControl & | main_control | ) |

virtual

Menu checking method. This method is called MainControl::checkMenus before a popup menu is shown. It should be used to update the state of menu entries (e.g. disable or enable entries).

Parameters

  main_control | the MainControl object whose menus should be checked

Reimplemented from BALL::VIEW::ModularWidget.

## event()

virtual bool BALL::VIEW::TestFramework::event | ( | QEvent * | e | ) |

protected virtual

## eventFilter

virtual bool BALL::VIEW::TestFramework::eventFilter | ( | QObject * | ,
|  | QEvent * | e )

virtual slot

## initializeWidget()

virtual void BALL::VIEW::TestFramework::initializeWidget | ( | MainControl & | main_control | ) |

virtual

Initialize the widget. This method is called automatically immediately before the main application is started. It should add the widget's menu entries and connections (if required). This method will be called by MainControl::show.

Parameters

  main_control | the MainControl object to be initialized with this ModularWidget

See also
  finalizeWidget()

Reimplemented from BALL::VIEW::ModularWidget.

## loadFile

void BALL::VIEW::TestFramework::loadFile | ( |  | ) |

slot

## openFile()

virtual bool BALL::VIEW::TestFramework::openFile | ( | const String & |  | ) |

virtual

Tell this ModularWidget to open a given file.

See also
  canHandle
  MainControl::openFile

Reimplemented from BALL::VIEW::ModularWidget.

## processEvent_()

void BALL::VIEW::TestFramework::processEvent_ | ( |  | ) |

protected

## runTest

void BALL::VIEW::TestFramework::runTest | ( |  | ) |

slot

## saveFile

void BALL::VIEW::TestFramework::saveFile | ( |  | ) |

slot

## setFilename()

void BALL::VIEW::TestFramework::setFilename | ( | const String & | filename | ) |

## startTest

void BALL::VIEW::TestFramework::startTest | ( |  | ) |

slot

## stopTest

void BALL::VIEW::TestFramework::stopTest | ( |  | ) |

slot

## storeEvent()

void BALL::VIEW::TestFramework::storeEvent | ( | QEvent & | e | ) |

protected

## switchRecordMove

void BALL::VIEW::TestFramework::switchRecordMove | ( |  | ) |

slot

## timeOut

virtual void BALL::VIEW::TestFramework::timeOut | ( |  | ) |

virtual slot

## Friends And Related Symbol Documentation

## MyEventThread

friend class MyEventThread

friend

Definition at line 87 of file testFramework.h.

## Member Data Documentation

## abort_test

QAction * BALL::VIEW::TestFramework::abort_test

protected

Definition at line 151 of file testFramework.h.

## action_

QAction* BALL::VIEW::TestFramework::action_

protected

Definition at line 153 of file testFramework.h.

## button_

int BALL::VIEW::TestFramework::button_

protected

Definition at line 164 of file testFramework.h.

## buttons_

int BALL::VIEW::TestFramework::buttons_

protected

Definition at line 164 of file testFramework.h.

## errors_

Size BALL::VIEW::TestFramework::errors_

protected

Definition at line 170 of file testFramework.h.

## event_busy_

bool BALL::VIEW::TestFramework::event_busy_

protected

Definition at line 162 of file testFramework.h.

## expected_result_

String BALL::VIEW::TestFramework::expected_result_

protected

Definition at line 168 of file testFramework.h.

## filename_

String BALL::VIEW::TestFramework::filename_

protected

Definition at line 157 of file testFramework.h.

## infile_

File BALL::VIEW::TestFramework::infile_

protected

Definition at line 156 of file testFramework.h.

## is_command_line_

bool BALL::VIEW::TestFramework::is_command_line_

protected

Definition at line 172 of file testFramework.h.

## last_event_

QEvent* BALL::VIEW::TestFramework::last_event_

protected

Definition at line 171 of file testFramework.h.

## last_event_string_

String BALL::VIEW::TestFramework::last_event_string_

protected

Definition at line 166 of file testFramework.h.

## last_names_

String BALL::VIEW::TestFramework::last_names_

protected

Definition at line 166 of file testFramework.h.

## last_widget_

QWidget * BALL::VIEW::TestFramework::last_widget_

protected

Definition at line 160 of file testFramework.h.

## line_nr_

Position BALL::VIEW::TestFramework::line_nr_

protected

Definition at line 174 of file testFramework.h.

## lines_

list<String> BALL::VIEW::TestFramework::lines_

protected

Definition at line 159 of file testFramework.h.

## load_file

QAction * BALL::VIEW::TestFramework::load_file

protected

Definition at line 152 of file testFramework.h.

## max_run_time_

float BALL::VIEW::TestFramework::max_run_time_

protected

Definition at line 173 of file testFramework.h.

## modifiers_

int BALL::VIEW::TestFramework::modifiers_

protected

Definition at line 164 of file testFramework.h.

## our_type_

int BALL::VIEW::TestFramework::our_type_

protected

Definition at line 164 of file testFramework.h.

## outfile_

File BALL::VIEW::TestFramework::outfile_

protected

Definition at line 155 of file testFramework.h.

## python_line_

String BALL::VIEW::TestFramework::python_line_

protected

Definition at line 167 of file testFramework.h.

## recording_

bool BALL::VIEW::TestFramework::recording_

protected

Definition at line 165 of file testFramework.h.

## run_test

QAction * BALL::VIEW::TestFramework::run_test

protected

Definition at line 151 of file testFramework.h.

## runtime_

Timer BALL::VIEW::TestFramework::runtime_

protected

Definition at line 158 of file testFramework.h.

## save_file

QAction * BALL::VIEW::TestFramework::save_file

protected

Definition at line 152 of file testFramework.h.

## shortcut_

String BALL::VIEW::TestFramework::shortcut_

protected

Definition at line 166 of file testFramework.h.

## start_recording

QAction* BALL::VIEW::TestFramework::start_recording

protected

Definition at line 151 of file testFramework.h.

## stop_recording

QAction * BALL::VIEW::TestFramework::stop_recording

protected

Definition at line 151 of file testFramework.h.

## switch_move

QAction * BALL::VIEW::TestFramework::switch_move

protected

Definition at line 152 of file testFramework.h.

## test_running_

bool BALL::VIEW::TestFramework::test_running_

protected

Definition at line 165 of file testFramework.h.

## thread_

MyEventThread BALL::VIEW::TestFramework::thread_

protected

Definition at line 169 of file testFramework.h.

## time_

float BALL::VIEW::TestFramework::time_

protected

Definition at line 161 of file testFramework.h.

## timer_

Timer BALL::VIEW::TestFramework::timer_

protected

Definition at line 158 of file testFramework.h.

## type_

int BALL::VIEW::TestFramework::type_

protected

Definition at line 164 of file testFramework.h.

## widget_

QWidget* BALL::VIEW::TestFramework::widget_

protected

Definition at line 160 of file testFramework.h.

## x_

Index BALL::VIEW::TestFramework::x_

protected

Definition at line 163 of file testFramework.h.

## y_

Index BALL::VIEW::TestFramework::y_

protected

Definition at line 163 of file testFramework.h.