#include <engine.h>
Public Slots | |
| void | stop () |
| void | restart () |
| void | askForDelete () |
Signals | |
| void | stateChanged () |
| void | clicked () |
| Emitted if the user right clicked on the engine. | |
Public Member Functions | |
| Engine (QString decoder="", int address=0, QString imagePath="", QString name="", QWidget *parent=0) | |
| ~Engine () | |
| QString | name () |
| void | setName (QString name) |
| int | address () |
| void | setAddress (int address) |
| QString | imagePath () |
| void | setImage (QString path) |
| void | setDecoder (QString decoder) |
| QString | decoder () |
| int | speed () |
| bool | light () |
| bool | f2 () |
| bool | f3 () |
| bool | f4 () |
| bool | isReversed () |
Protected Member Functions | |
| void | mousePressEvent (QMouseEvent *event) |
| Reimplemented form QObject for drag and drop. | |
| void | mouseMoveEvent (QMouseEvent *event) |
| Reimplemented form QObject for drag and drop. | |
Private Slots | |
| void | setColor (int speed) |
Private Attributes | |
| int | _address |
| Engine address. | |
| QString | _decoder |
| Engine decoder type. | |
| QString | _imagePath |
| Path to the engine picture. | |
| QLabel * | _image |
| Engine picture widget. | |
| QPixmap * | _picture |
| Engine picture pixmap. | |
| QPushButton * | _btnLight |
| QPushButton * | _btnReverse |
| QPushButton * | _btnStop |
| QPushButton * | _btnF2 |
| QPushButton * | _btnF3 |
| QPushButton * | _btnF4 |
| User input buttons. | |
| QSlider * | _speedSlider |
| Slider to set the engine speed. | |
| QProgressBar * | _speedBar |
| Speed status bar. | |
| QPalette | _palette |
| Handle the speed status bar color. | |
| QPoint | _dragStartPosition |
| Drag start position, for drag and drop. | |
| int | _oldSpeed |
| Store the actual speed after stop. | |
Definition at line 33 of file engine.h.
| Engine::Engine | ( | QString | decoder = "", |
|
| int | address = 0, |
|||
| QString | imagePath = "", |
|||
| QString | name = "", |
|||
| QWidget * | parent = 0 | |||
| ) |
Create an engine widget for OrK
| decoder | Decoder name according to SRCP | |
| address | Engine address | |
| imagePath | Path to the engine picture | |
| name | The engine name |
Definition at line 5 of file engine.cpp.
References _address, _btnF2, _btnF3, _btnF4, _btnLight, _btnReverse, _btnStop, _decoder, _image, _imagePath, _oldSpeed, _palette, _picture, _speedBar, _speedSlider, clicked(), setColor(), stateChanged(), and stop().
| Engine::~Engine | ( | ) |
Destroy the engine after stopping it
Definition at line 87 of file engine.cpp.
References stop().
| QString Engine::name | ( | ) |
Definition at line 100 of file engine.cpp.
Referenced by EngineEditor::deleteEngine(), Win::save(), and EngineEditor::setEngine().
| void Engine::setName | ( | QString | name | ) |
Set the engine name
| name | Engine name |
Definition at line 105 of file engine.cpp.
Referenced by EngineEditor::applyChanges().
| int Engine::address | ( | ) |
Definition at line 111 of file engine.cpp.
References _address.
Referenced by Win::addEngine(), Win::removeEngine(), Win::save(), EngineEditor::setEngine(), and Srcp083Client::setNewEngineState().
| void Engine::setAddress | ( | int | address | ) |
Set the engine address
| address | The engine address |
Definition at line 116 of file engine.cpp.
References _address.
Referenced by EngineEditor::applyChanges().
| QString Engine::imagePath | ( | ) |
Definition at line 121 of file engine.cpp.
References _imagePath.
Referenced by Win::save(), and EngineEditor::setEngine().
| void Engine::setImage | ( | QString | path | ) |
Set the engine image
| path | The path to the engine picture |
Definition at line 126 of file engine.cpp.
References _image, _imagePath, and _picture.
Referenced by EngineEditor::applyChanges().
| void Engine::setDecoder | ( | QString | decoder | ) |
Set the engine decoder
| decoder | The engine decoder according to SRCP |
Definition at line 136 of file engine.cpp.
References _decoder.
Referenced by EngineEditor::applyChanges().
| QString Engine::decoder | ( | ) |
Definition at line 141 of file engine.cpp.
References _decoder.
Referenced by Win::save(), EngineEditor::setEngine(), and Srcp083Client::setNewEngineState().
| int Engine::speed | ( | ) |
Definition at line 146 of file engine.cpp.
References _speedSlider.
Referenced by Srcp083Client::setNewEngineState().
| bool Engine::light | ( | ) |
Definition at line 151 of file engine.cpp.
References _btnLight.
Referenced by Srcp083Client::setNewEngineState().
| bool Engine::f2 | ( | ) |
Definition at line 156 of file engine.cpp.
References _btnF2.
Referenced by Srcp083Client::setNewEngineState().
| bool Engine::f3 | ( | ) |
Definition at line 161 of file engine.cpp.
References _btnF3.
Referenced by Srcp083Client::setNewEngineState().
| bool Engine::f4 | ( | ) |
Definition at line 166 of file engine.cpp.
References _btnF4.
Referenced by Srcp083Client::setNewEngineState().
| bool Engine::isReversed | ( | ) |
Definition at line 171 of file engine.cpp.
References _btnReverse.
Referenced by Srcp083Client::setNewEngineState().
| void Engine::stateChanged | ( | ) | [signal] |
stateChanged() is emitted if the user change a value on the engine widget
Referenced by Engine().
| void Engine::clicked | ( | ) | [signal] |
| void Engine::stop | ( | ) | [slot] |
Set the speed to zero and store the actual speed
Definition at line 182 of file engine.cpp.
References _oldSpeed, and _speedSlider.
| void Engine::restart | ( | ) | [slot] |
Reset the speed stored after stop was called
Definition at line 188 of file engine.cpp.
References _oldSpeed, and _speedSlider.
| void Engine::askForDelete | ( | ) | [slot] |
Ask the user if he want really to delete engine.
Definition at line 176 of file engine.cpp.
| void Engine::mousePressEvent | ( | QMouseEvent * | event | ) | [protected] |
Reimplemented form QObject for drag and drop.
Definition at line 194 of file engine.cpp.
References _dragStartPosition, and clicked().
| void Engine::mouseMoveEvent | ( | QMouseEvent * | event | ) | [protected] |
Reimplemented form QObject for drag and drop.
Definition at line 203 of file engine.cpp.
References _dragStartPosition, and OrKEngine::MimeType.
| void Engine::setColor | ( | int | speed | ) | [private, slot] |
int Engine::_address [private] |
QString Engine::_decoder [private] |
QString Engine::_imagePath [private] |
Path to the engine picture.
Definition at line 150 of file engine.h.
Referenced by Engine(), imagePath(), and setImage().
QLabel* Engine::_image [private] |
Engine picture widget.
Definition at line 152 of file engine.h.
Referenced by Engine(), and setImage().
QPixmap* Engine::_picture [private] |
Engine picture pixmap.
Definition at line 153 of file engine.h.
Referenced by Engine(), and setImage().
QPushButton* Engine::_btnLight [private] |
QPushButton * Engine::_btnReverse [private] |
QPushButton * Engine::_btnStop [private] |
QPushButton * Engine::_btnF2 [private] |
QPushButton * Engine::_btnF3 [private] |
QPushButton * Engine::_btnF4 [private] |
QSlider* Engine::_speedSlider [private] |
QProgressBar* Engine::_speedBar [private] |
QPalette Engine::_palette [private] |
Handle the speed status bar color.
Definition at line 159 of file engine.h.
Referenced by Engine(), and setColor().
QPoint Engine::_dragStartPosition [private] |
Drag start position, for drag and drop.
Definition at line 161 of file engine.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
int Engine::_oldSpeed [private] |
1.5.6