├── .gitignore ├── LICENSE ├── README.md ├── S5WDial.cpp ├── S5WDial.h ├── accelerationtestwidget.cpp ├── accelerationtestwidget.h ├── automon.cpp ├── automon.h ├── automonapp.cpp ├── automonapp.h ├── automonapp.qrc ├── automonkernel ├── automonkernel.pro ├── cardetailswidget.cpp ├── cardetailswidget.h ├── codes ├── command.cpp ├── command.h ├── commandedegr.cpp ├── commandedegr.h ├── coolanttempsensor.cpp ├── coolanttempsensor.h ├── dashboardwidget.cpp ├── dashboardwidget.h ├── diagnosticswidget.cpp ├── diagnosticswidget.h ├── dtc.cpp ├── dtc.h ├── dtchelper.cpp ├── dtchelper.h ├── enginerpm.cpp ├── enginerpm.h ├── engineruntime.cpp ├── engineruntime.h ├── errorhandler.cpp ├── errorhandler.h ├── exceptionhandler.cpp ├── exceptions.h ├── files ├── add.png ├── applicationbackground.png ├── automon.qss ├── automonold.qss ├── blue.qss ├── dialogbg.png ├── enginemil.png ├── enginemiloff.png ├── khaki.qss ├── nature_1.jpg ├── nostyle.qss ├── pushbutton.png ├── pushbuttondown.png ├── remove.png ├── splashscreen.png └── transparent.qss ├── fuellevelinput.cpp ├── fuellevelinput.h ├── fuelpressure.cpp ├── fuelpressure.h ├── icons ├── accelerationtesticon.png ├── accellerationtesticon.png ├── automonsettingsicon.png ├── back │ ├── accellerationtest.png │ ├── accellerationtesticon.png │ ├── automonsettingsicon.png │ ├── cardetailsicon.png │ ├── dashboardicon.png │ ├── diagnosticsicon.png │ └── monitoringicon.png ├── cardetailsicon.png ├── dashboardicon.png ├── diagnosticsicon.png └── monitoringicon.png ├── mafairflowrate.cpp ├── mafairflowrate.h ├── main.cpp ├── math-support.h ├── menuitem.cpp ├── menuitem.h ├── menuwidget.cpp ├── menuwidget.h ├── monitoringwidget.cpp ├── monitoringwidget.h ├── o2voltage.cpp ├── o2voltage.h ├── qrc_automonapp.cpp ├── qtanimation ├── QtAbstractAnimation ├── QtAbstractState ├── QtAbstractTransition ├── QtActionState ├── QtAnimationGroup ├── QtAnimationState ├── QtEasingCurve ├── QtEventTransition ├── QtFinalState ├── QtGraphicsWidget ├── QtHistoryState ├── QtKeyEventTransition ├── QtMouseEventTransition ├── QtParallelAnimationGroup ├── QtPauseAnimation ├── QtPropertyAnimation ├── QtSequentialAnimationGroup ├── QtSignalEvent ├── QtSignalTransition ├── QtState ├── QtStateAction ├── QtStateFinishedEvent ├── QtStateFinishedTransition ├── QtStateInvokeMethodAction ├── QtStateMachine ├── QtStateSetPropertyAction ├── QtTransition ├── QtVariantAnimation ├── animation.h ├── animation.pri ├── corelib_statemachine.pri ├── easing.cpp ├── gui_statemachine.pri ├── qtabstractanimation.cpp ├── qtabstractanimation.h ├── qtabstractanimation_p.h ├── qtabstractstate.cpp ├── qtabstractstate.h ├── qtabstractstate_p.h ├── qtabstracttransition.cpp ├── qtabstracttransition.h ├── qtabstracttransition_p.h ├── qtactionstate.cpp ├── qtactionstate.h ├── qtactionstate_p.h ├── qtanimationframework.pri ├── qtanimationgroup.cpp ├── qtanimationgroup.h ├── qtanimationgroup_p.h ├── qtanimationstate.cpp ├── qtanimationstate.h ├── qtbasickeyeventtransition.cpp ├── qtbasickeyeventtransition_p.h ├── qtbasicmouseeventtransition.cpp ├── qtbasicmouseeventtransition_p.h ├── qtboundevent_p.h ├── qteasingcurve.cpp ├── qteasingcurve.h ├── qteventtransition.cpp ├── qteventtransition.h ├── qteventtransition_p.h ├── qtfinalstate.cpp ├── qtfinalstate.h ├── qtgraphicswidget.cpp ├── qtgraphicswidget.h ├── qtguistatemachine.cpp ├── qthistorystate.cpp ├── qthistorystate.h ├── qthistorystate_p.h ├── qtkeyeventtransition.cpp ├── qtkeyeventtransition.h ├── qtmouseeventtransition.cpp ├── qtmouseeventtransition.h ├── qtparallelanimationgroup.cpp ├── qtparallelanimationgroup.h ├── qtparallelanimationgroup_p.h ├── qtpauseanimation.cpp ├── qtpauseanimation.h ├── qtpropertyanimation.cpp ├── qtpropertyanimation.h ├── qtpropertyanimation_p.h ├── qtsequentialanimationgroup.cpp ├── qtsequentialanimationgroup.h ├── qtsequentialanimationgroup_p.h ├── qtsignalevent.h ├── qtsignaleventgenerator_p.h ├── qtsignaltransition.cpp ├── qtsignaltransition.h ├── qtsignaltransition_p.h ├── qtstate.cpp ├── qtstate.h ├── qtstate_p.h ├── qtstateaction.cpp ├── qtstateaction.h ├── qtstateaction_p.h ├── qtstatefinishedevent.h ├── qtstatefinishedtransition.cpp ├── qtstatefinishedtransition.h ├── qtstatemachine.cpp ├── qtstatemachine.h ├── qtstatemachine_p.h ├── qttransition.cpp ├── qttransition.h ├── qttransition_p.h ├── qtvariantanimation.cpp ├── qtvariantanimation.h └── qtvariantanimation_p.h ├── qtc-gdbmacros ├── LGPL_EXCEPTION.TXT ├── LICENSE.LGPL ├── gdbmacros.cpp └── gdbmacros.pro ├── rule.cpp ├── rule.h ├── ruleeditorwidget.cpp ├── ruleeditorwidget.h ├── rules ├── sensor.cpp ├── sensor.h ├── serialhelper.cpp ├── serialhelper.h ├── slides ├── item1.jpg └── item2.jpg ├── stackblur.cpp ├── stackblur.h ├── throttleposition.cpp ├── throttleposition.h ├── vehiclespeed.cpp └── vehiclespeed.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | Makefile 3 | 4 | *.Debug 5 | 6 | *.Release 7 | 8 | automonkernel.pro.user.1.3 9 | qrc_automonapp.cpp -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This license applies to all parts of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 2 | Source Repository: https://github.com/donaloconnor/automon/ 3 | 4 | Copyright (c) 2015, Donal O'Connor 5 | 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | automon 2 | ======= 3 | 4 | OBD Vehicle Diagnostics 5 | -------------------------------------------------------------------------------- /accelerationtestwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef ACCELERATIONTESTWIDGET_H 34 | #define ACCELERATIONTESTWIDGET_H 35 | 36 | #include 37 | 38 | #include "automon.h" 39 | 40 | class QLabel; 41 | class QVBoxLayout; 42 | class QHBoxLayout; 43 | class QLCDNumber; 44 | class QPushButton; 45 | class QSpinBox; 46 | class QTime; 47 | 48 | using namespace AutomonKernel; 49 | 50 | class AccelerationTestWidget : public QWidget 51 | { 52 | Q_OBJECT 53 | 54 | public: 55 | AccelerationTestWidget(Automon * kernel, QWidget * parent = 0); 56 | ~AccelerationTestWidget(); 57 | 58 | public slots: 59 | void startTest(); 60 | void display(double speed); 61 | 62 | signals: 63 | void changeStatus(const QString & status); 64 | 65 | private: 66 | void setUpSensor(); 67 | void removeSensor(); 68 | QLabel * m_header; 69 | QHBoxLayout * m_mainLayout; 70 | QVBoxLayout * m_verticalLayout; 71 | QLCDNumber * m_speed; 72 | QLCDNumber * m_accelerationTimeDisplay; 73 | Automon * m_kernel; 74 | QPushButton * m_startTest; 75 | QSpinBox * m_destinationSpeed; 76 | QTime * m_time; 77 | bool m_carMoving; 78 | int m_accelerationTime; 79 | bool m_testFinished; 80 | int m_parkThreshold; 81 | bool m_testStarted; 82 | bool m_startButtonClicked; 83 | }; 84 | 85 | #endif // ACCELERATIONTESTWIDGET_H 86 | -------------------------------------------------------------------------------- /automonapp.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef AUTOMONAPP_H 34 | #define AUTOMONAPP_H 35 | 36 | #include 37 | #include "automon.h" 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | class QLabel; 44 | class QHBoxLayout; 45 | class QVBoxLayout; 46 | class QSplashScreen; 47 | class QStackedWidget; 48 | 49 | 50 | #include "menuwidget.h" 51 | #include "monitoringwidget.h" 52 | #include "diagnosticswidget.h" 53 | #include "dashboardwidget.h" 54 | #include "accelerationtestwidget.h" 55 | #include "cardetailswidget.h" 56 | #include "ruleeditorwidget.h" 57 | #include "errorhandler.h" 58 | 59 | using namespace AutomonKernel; /* Need to use the AutomonKernel namespace to access Automon Kernel */ 60 | 61 | 62 | class AutomonApp : public QFrame 63 | { 64 | Q_OBJECT 65 | 66 | public: 67 | AutomonApp(QSplashScreen * splashScreen); 68 | 69 | public slots: 70 | void changePanel(int panelID); /* Used by the Menu items to change the current Widget shown */ 71 | void setStatus(const QString & statusText); /* Used to update the status text */ 72 | 73 | protected: 74 | void closeEvent(QCloseEvent *event); 75 | 76 | private: 77 | void init(); /* Set up Automon Kernel */ 78 | Automon * m_automonKernel; /* Pointer to the Automon Kernel */ 79 | 80 | QVBoxLayout * m_mainLayout; 81 | QVBoxLayout * m_centerLayout; 82 | QHBoxLayout * m_bottomLayout; 83 | QHBoxLayout * m_topLayout; 84 | QSplashScreen * m_splashScreen; 85 | QStackedWidget * m_panes; 86 | QLabel * m_status; 87 | 88 | 89 | /* All the widgets/views in Automon */ 90 | MenuWidget * m_menu; 91 | AccelerationTestWidget * m_acellerationTestWidget; 92 | DiagnosticsWidget * m_diagnosticsWidget; 93 | MonitoringWidget * m_monitoringWidget; 94 | DashboardWidget * m_dashboardWidget; 95 | CarDetailsWidget * m_carDetailsWidget; 96 | RuleEditorWidget * m_ruleEditorWidget; 97 | 98 | ErrorHandler * m_errorHandler; 99 | }; 100 | 101 | #endif // AUTOMONAPP_H 102 | -------------------------------------------------------------------------------- /automonapp.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | files/nature_1.jpg 4 | files/splashscreen.png 5 | slides/item1.jpg 6 | slides/item2.jpg 7 | icons/diagnosticsicon.png 8 | icons/dashboardicon.png 9 | icons/automonsettingsicon.png 10 | files/applicationbackground.png 11 | icons/accelerationtesticon.png 12 | icons/cardetailsicon.png 13 | icons/monitoringicon.png 14 | files/dialogbg.png 15 | files/pushbutton.png 16 | files/add.png 17 | files/remove.png 18 | files/enginemil.png 19 | files/enginemiloff.png 20 | files/automon.qss 21 | files/pushbuttondown.png 22 | 23 | 24 | codes 25 | rules 26 | 27 | 28 | -------------------------------------------------------------------------------- /automonkernel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/automonkernel -------------------------------------------------------------------------------- /automonkernel.pro: -------------------------------------------------------------------------------- 1 | # ##################################################################### 2 | # Automatically generated by qmake (1.07a) Thu Mar 5 10:31:40 2009 3 | # ##################################################################### 4 | TEMPLATE = app 5 | DEPENDPATH += qtc-gdbmacros 6 | INCLUDEPATH += . 7 | QT += core gui widgets 8 | QT += script xml printsupport 9 | !android: QT += serialport 10 | 11 | TARGET = automonkernel 12 | CONFIG -= app_bundle 13 | #unix:OBJECTS_DIR = tmpobjects 14 | #TEMPL = appATE 15 | 16 | #INCLUDEPATH += /home/donal/project/libs/qextserialport 17 | #QMAKE_LIBDIR += /home/donal/project/libs/qextserialport/build 18 | #LIBS += -L/home/donal/project/libs/qextserialport/build/ \ 19 | # -lqextserialport 20 | 21 | # Input 22 | HEADERS += automon.h \ 23 | command.h \ 24 | commandedegr.h \ 25 | coolanttempsensor.h \ 26 | dtc.h \ 27 | dtchelper.h \ 28 | enginerpm.h \ 29 | engineruntime.h \ 30 | fuellevelinput.h \ 31 | fuelpressure.h \ 32 | mafairflowrate.h \ 33 | o2voltage.h \ 34 | sensor.h \ 35 | serialhelper.h \ 36 | throttleposition.h \ 37 | vehiclespeed.h \ 38 | errorhandler.h \ 39 | rule.h \ 40 | S5WDial.h \ 41 | stackblur.h \ 42 | math-support.h \ 43 | exceptions.h \ 44 | automonapp.h \ 45 | monitoringwidget.h \ 46 | dashboardwidget.h \ 47 | diagnosticswidget.h \ 48 | cardetailswidget.h \ 49 | menuwidget.h \ 50 | menuitem.h \ 51 | accelerationtestwidget.h \ 52 | ruleeditorwidget.h \ 53 | lib/QtSerialPort/qringbuffer_p.h 54 | SOURCES += automon.cpp \ 55 | command.cpp \ 56 | commandedegr.cpp \ 57 | coolanttempsensor.cpp \ 58 | dtc.cpp \ 59 | dtchelper.cpp \ 60 | enginerpm.cpp \ 61 | engineruntime.cpp \ 62 | fuellevelinput.cpp \ 63 | fuelpressure.cpp \ 64 | mafairflowrate.cpp \ 65 | main.cpp \ 66 | o2voltage.cpp \ 67 | sensor.cpp \ 68 | serialhelper.cpp \ 69 | throttleposition.cpp \ 70 | vehiclespeed.cpp \ 71 | errorhandler.cpp \ 72 | rule.cpp \ 73 | S5WDial.cpp \ 74 | stackblur.cpp \ 75 | automonapp.cpp \ 76 | monitoringwidget.cpp \ 77 | dashboardwidget.cpp \ 78 | diagnosticswidget.cpp \ 79 | cardetailswidget.cpp \ 80 | menuwidget.cpp \ 81 | menuitem.cpp \ 82 | accelerationtestwidget.cpp \ 83 | ruleeditorwidget.cpp 84 | #FORMS += 85 | RESOURCES += automonapp.qrc 86 | 87 | unix!mac { 88 | DEFINES += _TTY_POSIX_ 89 | HEADERS += lib/QtSerialPort/qserialport_unix_p.h \ 90 | lib/QtSerialPort/qtudev_p.h \ 91 | lib/QtSerialPort/qserialport_p.h \ 92 | lib/QtSerialPort/qserialport.h \ 93 | lib/QtSerialPort/qserialportglobal.h \ 94 | lib/QtSerialPort/qserialportinfo_p.h \ 95 | lib/QtSerialPort/qserialportinfo.h 96 | 97 | SOURCES += lib/QtSerialPort/qserialport_unix.cpp \ 98 | lib/QtSerialPort/qserialportinfo_unix.cpp \ 99 | lib/QtSerialPort/qserialport.cpp \ 100 | lib/QtSerialPort/qserialportinfo.cpp 101 | } 102 | 103 | win32 { 104 | DEFINES = _TTY_WIN_ \ 105 | QWT_DLL \ 106 | QT_DLL 107 | QT += serialport 108 | } 109 | 110 | -------------------------------------------------------------------------------- /cardetailswidget.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "cardetailswidget.h" 38 | 39 | CarDetailsWidget::CarDetailsWidget(Automon * kernel, QWidget * parent) 40 | : QWidget(parent), m_kernel(kernel) 41 | { 42 | 43 | /* Create Layouts */ 44 | m_mainLayout = new QHBoxLayout(this); 45 | m_verticalLayout = new QVBoxLayout(); 46 | 47 | /* Create the labels that the user will see, including the tr() function for easy translation in future */ 48 | m_header = new QLabel(tr("Car Details")); 49 | QLabel * carVin = new QLabel(tr("Vehicle ID: ") + kernel->getVin()); 50 | QLabel * obdStandard = new QLabel(tr("Car's OBD Standard: ") + kernel->getOBDStandardType()); 51 | QLabel * obdProtocol = new QLabel(tr("Car's OBD Protocol: ") + kernel->getOBDProtocol()); 52 | QLabel * elmVersion = new QLabel(tr("ELM Interface Version: ") + kernel->getElmVersion()); 53 | QLabel * voltage = new QLabel(tr("Current Battery Voltage: ") + kernel->getVoltage()); 54 | QLabel * introduction = new QLabel(tr("This widget displays some very simple car details.")); 55 | 56 | /* Set style of header */ 57 | m_header->setStyleSheet("color: #ace413; font-size:25px"); 58 | 59 | /* Organise layouts and add widgets to layouts */ 60 | m_mainLayout->addLayout(m_verticalLayout); 61 | m_verticalLayout->addWidget(m_header); 62 | m_verticalLayout->addWidget(introduction); 63 | m_verticalLayout->addSpacing(10); 64 | m_verticalLayout->addWidget(carVin); 65 | m_verticalLayout->addWidget(obdStandard); 66 | m_verticalLayout->addWidget(obdProtocol); 67 | m_verticalLayout->addWidget(elmVersion); 68 | m_verticalLayout->addWidget(voltage); 69 | m_verticalLayout->setAlignment(Qt::AlignTop); 70 | m_mainLayout->setAlignment(Qt::AlignTop); 71 | 72 | /* Set the main layout */ 73 | setLayout(m_mainLayout); 74 | } 75 | -------------------------------------------------------------------------------- /cardetailswidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef CARDETAILSWIDGET_H 34 | #define CARDETAILSWIDGET_H 35 | 36 | #include 37 | 38 | #include "automon.h" 39 | 40 | class QLabel; 41 | class QVBoxLayout; 42 | class QHBoxLayout; 43 | 44 | using namespace AutomonKernel; 45 | 46 | class CarDetailsWidget : public QWidget 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | CarDetailsWidget(Automon * kernel, QWidget * parent = 0); 52 | 53 | signals: 54 | void changeStatus(const QString & status); 55 | 56 | private: 57 | QLabel * m_header; 58 | QHBoxLayout * m_mainLayout; 59 | QVBoxLayout * m_verticalLayout; 60 | Automon * m_kernel; 61 | }; 62 | 63 | #endif // CARDETAILSWIDGET_H 64 | -------------------------------------------------------------------------------- /command.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef COMMAND_H 34 | #define COMMAND_H 35 | 36 | #include 37 | 38 | namespace AutomonKernel 39 | { 40 | class Command : public QObject 41 | { 42 | 43 | public: 44 | Command(); 45 | Command(QString command, QString englishMeaning); 46 | virtual ~Command() { } 47 | virtual void setBuffer(QString bufferResponse); 48 | void setEnglishMeaning(QString englishMeaning); 49 | void setCommand(QString command); 50 | void setExpectedBytes(int expectedBytes); 51 | int getExpectedBytes(); 52 | QString getBuffer() const; 53 | QString getEnglishMeaning() const; 54 | QString getCommand() const; 55 | 56 | protected: 57 | QString m_command; 58 | QString m_englishMeaning; 59 | QString m_bufferResponse; 60 | 61 | private: 62 | int m_expectedBytes; 63 | 64 | }; 65 | } 66 | 67 | #endif // COMMAND_H 68 | -------------------------------------------------------------------------------- /commandedegr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | CommandedEgr::CommandedEgr(QString command, QString englishMeaning) 38 | { 39 | /* Set the member variables */ 40 | m_command = command; 41 | m_englishMeaning = englishMeaning; 42 | } 43 | 44 | CommandedEgr::CommandedEgr() 45 | { 46 | /* Set properties of this sensor */ 47 | m_command = "012C"; 48 | m_englishMeaning = "Commanded EGR"; 49 | setUnits(MPH); 50 | setExpectedBytes(1); 51 | setMin(0); 52 | setMax(100); 53 | } 54 | 55 | 56 | double CommandedEgr::convertResult() 57 | { 58 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 59 | 60 | QList bytes = Automon::getBytes(*this); 61 | 62 | double value = (bytes[2]*100/255); 63 | 64 | return value; 65 | 66 | } 67 | -------------------------------------------------------------------------------- /commandedegr.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef COMMANDEDEGRSENSOR_H 34 | #define COMMANDEDEGRSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class CommandedEgr : public Sensor 41 | { 42 | public: 43 | CommandedEgr(QString command, QString englishMeaning); 44 | CommandedEgr(); 45 | double convertResult(); 46 | ~CommandedEgr() { } 47 | }; 48 | } 49 | #endif // COMMANDEDEGRSENSOR_H 50 | -------------------------------------------------------------------------------- /coolanttempsensor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | CoolantTempSensor::CoolantTempSensor(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | CoolantTempSensor::CoolantTempSensor() 44 | { 45 | m_command = "0105"; 46 | m_englishMeaning = "Engine coolant temperature"; 47 | setUnits(DEGREES); 48 | setExpectedBytes(1); 49 | setMin(-40); 50 | setMax(215); 51 | } 52 | 53 | double CoolantTempSensor::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]-40); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /coolanttempsensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef COOLANTTEMPSENSOR_H 34 | #define COOLANTTEMPSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class CoolantTempSensor : public Sensor 41 | { 42 | public: 43 | CoolantTempSensor(QString command, QString englishMeaning); 44 | CoolantTempSensor(); 45 | double convertResult(); 46 | ~CoolantTempSensor() { } 47 | }; 48 | } 49 | #endif // COOLANTTEMPSENSOR_H 50 | -------------------------------------------------------------------------------- /dashboardwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef DASHBOARDWIDGET_H 34 | #define DASHBOARDWIDGET_H 35 | 36 | #include 37 | #include "automon.h" 38 | 39 | class QLabel; 40 | class QVBoxLayout; 41 | class QHBoxLayout; 42 | class QPushButton; 43 | class S5WDial; 44 | 45 | using namespace AutomonKernel; 46 | 47 | class DashboardWidget : public QWidget 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | DashboardWidget(Automon * kernel, QWidget * parent = 0); 53 | 54 | signals: 55 | void changeStatus(const QString & status); 56 | 57 | public slots: 58 | void startStopDashboard(); 59 | 60 | 61 | private: 62 | QLabel * m_header; 63 | QHBoxLayout * m_mainLayout; 64 | QVBoxLayout * m_verticalLayout; 65 | QHBoxLayout * m_dialLayouts; 66 | QPushButton * m_startStopButton; 67 | QHBoxLayout * m_buttonLayout; 68 | S5WDial * m_revDial; 69 | S5WDial * m_speedDial; 70 | Automon * m_kernel; 71 | bool m_started; 72 | }; 73 | 74 | #endif // DASHBOARDWIDGET_H 75 | -------------------------------------------------------------------------------- /diagnosticswidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef DIAGNOSTICSWIDGET_H 34 | #define DIAGNOSTICSWIDGET_H 35 | 36 | #include 37 | #include "automon.h" 38 | 39 | class QLabel; 40 | class QVBoxLayout; 41 | class QHBoxLayout; 42 | class QTableWidget; 43 | class QPushButton; 44 | class QMessageBox; 45 | 46 | using namespace AutomonKernel; 47 | 48 | class DiagnosticsWidget : public QWidget 49 | { 50 | Q_OBJECT 51 | 52 | public: 53 | DiagnosticsWidget(Automon * kernel, QWidget * parent = 0); 54 | 55 | signals: 56 | void changeStatus(const QString & status); 57 | 58 | public slots: 59 | void resetMIL(); /* Slot for the reset MIL button */ 60 | void checkECU(); /* Slot for the CheckECU button */ 61 | 62 | private: 63 | void setupDTCTable(); 64 | void displayNoDTCs(); 65 | void displayMilResetMsg(); 66 | void setMilPicOn(); 67 | void setMilPicOff(); 68 | QLabel * m_header; 69 | QLabel * m_noDTCMsg; 70 | QHBoxLayout * m_mainLayout; 71 | QVBoxLayout * m_verticalLayout; 72 | QHBoxLayout * m_contentArea; 73 | QHBoxLayout * m_buttonsTop; 74 | QVBoxLayout * m_leftSide; 75 | QVBoxLayout * m_rightSide; 76 | Automon * m_kernel; 77 | QTableWidget * m_tableList; 78 | QPushButton * m_resetMilButton; 79 | QPushButton * m_checkButton; 80 | QLabel * m_milResetMsg; 81 | QString engineMilOnPic; 82 | QString engineMilOffPic; 83 | QLabel * engineMilPic; 84 | QMessageBox * m_resetMilPromptBox; 85 | 86 | 87 | }; 88 | 89 | #endif // DIAGNOSTICSWIDGET_H 90 | -------------------------------------------------------------------------------- /dtc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | DTC::DTC(QString code, QString englishMeaning, QString potentialSolution) 38 | : m_code(code), m_englishMeaning(englishMeaning), m_potentialSolution(potentialSolution) 39 | { 40 | } 41 | 42 | QString DTC::getCode() 43 | { 44 | return m_code; 45 | } 46 | 47 | QString DTC::getEnglishMeaning() 48 | { 49 | return m_englishMeaning; 50 | } 51 | 52 | QString DTC::getPotentialSolution() 53 | { 54 | return m_potentialSolution; 55 | } 56 | -------------------------------------------------------------------------------- /dtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef DTC_H 34 | #define DTC_H 35 | 36 | #include 37 | 38 | namespace AutomonKernel 39 | { 40 | class DTC 41 | { 42 | 43 | public: 44 | 45 | enum CODETYPE { POWERTRAIN, CHASSIS, BODY, NETWORK }; 46 | 47 | DTC(QString code, QString englishMeaning, QString potentialSolution); 48 | QString getCode(); 49 | QString getEnglishMeaning(); 50 | QString getPotentialSolution(); 51 | 52 | 53 | private: 54 | QString m_code; 55 | QString m_englishMeaning; 56 | QString m_potentialSolution; 57 | CODETYPE m_codeType; 58 | }; 59 | } 60 | #endif // DTC_H 61 | -------------------------------------------------------------------------------- /dtchelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef DTCHELPER_H 34 | #define DTCHELPER_H 35 | 36 | #include "dtc.h" 37 | #include "serialhelper.h" 38 | 39 | namespace AutomonKernel 40 | { 41 | class DTCHelper 42 | { 43 | public: 44 | DTCHelper(SerialHelper * serialHelper); 45 | QList getFreezeFrame() const; 46 | QList getCodesFound() const; 47 | bool resetMilAndClearCodes(); 48 | bool addDTCs(QList); 49 | int getNumberOfCodes() const; 50 | bool checkMil() const; 51 | void init(); 52 | void refreshDTCInformation(); 53 | 54 | 55 | private: 56 | void loadCodes(); 57 | void loadFoundCodes(); 58 | void setNumCodes(); 59 | QList m_codeDB; 60 | QList m_codesFound; 61 | QList m_freezeFrame; 62 | int m_numCodes; 63 | bool m_milOn; 64 | SerialHelper * m_serialHelper; 65 | 66 | }; 67 | } 68 | 69 | #endif // DTCHELPER_H 70 | -------------------------------------------------------------------------------- /enginerpm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | EngineRPM::EngineRPM(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | EngineRPM::EngineRPM() 44 | { 45 | m_command = "010C"; 46 | m_englishMeaning = "Engine RPM"; 47 | setUnits(RPM); 48 | setExpectedBytes(2); 49 | setMin(0); 50 | setMax(12000); 51 | } 52 | 53 | double EngineRPM::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (((bytes[2]*256) + bytes[3])/4); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /enginerpm.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef ENGINERPMSENSOR_H 34 | #define ENGINERPMSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class EngineRPM : public Sensor 41 | { 42 | public: 43 | EngineRPM(QString command, QString englishMeaning); 44 | EngineRPM(); 45 | double convertResult(); 46 | ~EngineRPM() { } 47 | }; 48 | } 49 | #endif // ENGINERPMSENSOR_H 50 | -------------------------------------------------------------------------------- /engineruntime.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | EngineRunTime::EngineRunTime(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | EngineRunTime::EngineRunTime() 44 | { 45 | 46 | m_command = "011F"; 47 | m_englishMeaning = "Engine Runtime"; 48 | setUnits(SECONDS); 49 | setExpectedBytes(2); 50 | setMin(0); 51 | setMax(65535); 52 | } 53 | 54 | double EngineRunTime::convertResult() 55 | { 56 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 57 | 58 | QList bytes = Automon::getBytes(*this); 59 | 60 | double value = (((int)bytes[2]*256) + (int)bytes[3]); 61 | 62 | return value; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /engineruntime.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef ENGINERUNTIMESENSOR_H 34 | #define ENGINERUNTIMESENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | class QVariant; 39 | 40 | namespace AutomonKernel 41 | { 42 | class EngineRunTime : public Sensor 43 | { 44 | public: 45 | EngineRunTime(QString command, QString englishMeaning); 46 | EngineRunTime(); 47 | double convertResult(); 48 | ~EngineRunTime() { } 49 | }; 50 | } 51 | #endif // ENGINERUNTIMESENSOR_H 52 | -------------------------------------------------------------------------------- /errorhandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "errorhandler.h" 34 | 35 | ErrorHandler::ErrorHandler(QWidget * parent) 36 | : QMessageBox(parent) 37 | { 38 | /* Set no frame around window */ 39 | setWindowFlags(Qt::FramelessWindowHint); 40 | setStyleSheet("background-color: rgba(51,51,51,80%); color:beige"); 41 | } 42 | 43 | void ErrorHandler::errorSlot(QString message) 44 | { 45 | 46 | QString msg(tr(message.toLatin1())); 47 | 48 | setText(msg); 49 | 50 | /* Modal means that nothign in background can be clicked. This dialog has full attention */ 51 | setModal(true); 52 | 53 | /* Launch the message */ 54 | exec(); 55 | exit(1); /* Somehow if it could kill itself and restart instead of just exiting */ 56 | } 57 | -------------------------------------------------------------------------------- /errorhandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef ERRORHANDLER_H 34 | #define ERRORHANDLER_H 35 | 36 | #include 37 | 38 | class ErrorHandler : public QMessageBox 39 | { 40 | Q_OBJECT 41 | public: 42 | ErrorHandler(QWidget * parent = 0); 43 | 44 | public slots: 45 | void errorSlot(QString); 46 | 47 | }; 48 | 49 | #endif // ERRORHANDLER_H 50 | -------------------------------------------------------------------------------- /exceptionhandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | #include "exceptionhandler.h" 37 | 38 | ExceptionHandler::ExceptionHandler(QWidget *parent) 39 | : QDialog(parent) 40 | { 41 | // setStyleSheet("background: rgba(51,51,51,95%); border-style: solid; border-width: 1px; border-radius: 2px; border-color:red;"); 42 | setStyleSheet("background-color: none; background-image: url(:/files/dialogbg.png);"); 43 | setWindowFlags(Qt::FramelessWindowHint); 44 | setFixedWidth(550); 45 | setFixedHeight(200); 46 | QLabel * label = new QLabel ("An Exception!",0); 47 | label->setStyleSheet("*{ color:red; font-size 20px;}"); 48 | 49 | QVBoxLayout * layout = new QVBoxLayout(); 50 | 51 | setLayout(layout); 52 | 53 | layout->addWidget(label); 54 | setModal(true); 55 | } 56 | -------------------------------------------------------------------------------- /files/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/add.png -------------------------------------------------------------------------------- /files/applicationbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/applicationbackground.png -------------------------------------------------------------------------------- /files/blue.qss: -------------------------------------------------------------------------------- 1 | * 2 | { 3 | color: beige; 4 | } 5 | 6 | QLabel, QAbstractButton 7 | { 8 | font: 10pt bold; 9 | color: yellow; 10 | } 11 | 12 | QFrame 13 | { 14 | background-color: rgba(96,96,255,60%); 15 | border-color: rgb(32,32,196); 16 | border-width: 3px; 17 | border-style: solid; 18 | border-radius: 5; 19 | padding: 3px; 20 | } 21 | 22 | QAbstractButton 23 | { 24 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, 25 | stop:0 lightblue, stop:0.5 darkblue); 26 | border-width: 3px; 27 | border-color: darkblue; 28 | border-style: solid; 29 | border-radius: 5; 30 | padding: 3px; 31 | qproperty-focusPolicy: NoFocus; 32 | } 33 | 34 | QAbstractButton:pressed 35 | { 36 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, 37 | stop:0.5 darkblue, stop:1 lightblue); 38 | border-color: beige; 39 | } 40 | -------------------------------------------------------------------------------- /files/dialogbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/dialogbg.png -------------------------------------------------------------------------------- /files/enginemil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/enginemil.png -------------------------------------------------------------------------------- /files/enginemiloff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/enginemiloff.png -------------------------------------------------------------------------------- /files/khaki.qss: -------------------------------------------------------------------------------- 1 | 2 | QWidget#StartScreen, QWidget#MainWidget { 3 | border: none; 4 | } 5 | 6 | QWidget#StartScreen, .QFrame { 7 | background-color: beige; 8 | } 9 | 10 | QPushButton, QToolButton { 11 | background-color: palegoldenrod; 12 | border-width: 2px; 13 | border-color: darkkhaki; 14 | border-style: solid; 15 | border-radius: 5; 16 | padding: 3px; 17 | /* min-width: 96px; */ 18 | /* min-height: 48px; */ 19 | qproperty-focusPolicy: NoFocus 20 | } 21 | 22 | QPushButton:hover, QToolButton:hover { 23 | background-color: khaki; 24 | } 25 | 26 | QPushButton:pressed, QToolButton:pressed { 27 | padding-left: 5px; 28 | padding-top: 5px; 29 | background-color: #d0d67c; 30 | } 31 | 32 | QLabel, QAbstractButton { 33 | font: italic 11pt "Times New Roman"; 34 | } 35 | 36 | QFrame, QLabel#title { 37 | border-width: 2px; 38 | padding: 1px; 39 | border-style: solid; 40 | border-color: darkkhaki; 41 | border-radius: 5px; 42 | } 43 | 44 | QFrame:focus { 45 | border-width: 3px; 46 | padding: 0px; 47 | } 48 | 49 | 50 | QLabel { 51 | border: none; 52 | padding: 0; 53 | background: none; 54 | } 55 | 56 | QLabel#title { 57 | font: 32px bold; 58 | } 59 | 60 | QSpinBox { 61 | padding-left: 24px; 62 | padding-right: 24px; 63 | border-color: darkkhaki; 64 | border-style: solid; 65 | border-radius: 5; 66 | border-width: 3; 67 | } 68 | 69 | QSpinBox::up-button 70 | { 71 | subcontrol-origin: padding; 72 | subcontrol-position: right; /* position at the top right corner */ 73 | width: 24px; 74 | height: 24px; 75 | border-width: 3px; 76 | border-image: url(:/files/spindownpng) 1; 77 | } 78 | 79 | QSpinBox::up-arrow { 80 | image: url(:/files/add.png); 81 | width: 12px; 82 | height: 12px; 83 | } 84 | 85 | 86 | QSpinBox::down-button 87 | { 88 | subcontrol-origin: border; 89 | subcontrol-position: left; 90 | width: 24px; 91 | height: 24px; 92 | border-width: 3px; 93 | border-image: url(:/files/spindownpng) 1; 94 | } 95 | 96 | QSpinBox::down-arrow { 97 | image: url(:/files/remove.png); 98 | width: 12px; 99 | height: 12px; 100 | } 101 | -------------------------------------------------------------------------------- /files/nature_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/nature_1.jpg -------------------------------------------------------------------------------- /files/nostyle.qss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/nostyle.qss -------------------------------------------------------------------------------- /files/pushbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/pushbutton.png -------------------------------------------------------------------------------- /files/pushbuttondown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/pushbuttondown.png -------------------------------------------------------------------------------- /files/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/remove.png -------------------------------------------------------------------------------- /files/splashscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/files/splashscreen.png -------------------------------------------------------------------------------- /files/transparent.qss: -------------------------------------------------------------------------------- 1 | QWidget#StyleWidget 2 | { 3 | background-color: none; 4 | background-image: url(icons:nature_1.jpg); 5 | } 6 | 7 | QLabel, QAbstractButton 8 | { 9 | font: 18px bold; 10 | color: beige; 11 | } 12 | 13 | QAbstractButton 14 | { 15 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(173,216,230,60%), stop:1 rgba(0,0,139,60%) ); 16 | border-color: black; 17 | border-style: solid; 18 | border-width: 3px; 19 | border-radius: 6px; 20 | } 21 | 22 | QAbstractButton:pressed, QAbstractButton:checked 23 | { 24 | background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0,0,139,60%), stop:1 rgba(173,216,230,60%) ); 25 | } 26 | 27 | QSpinBox { 28 | padding-left: 24px; 29 | padding-right: 24px; 30 | border-color: darkkhaki; 31 | border-style: solid; 32 | border-radius: 5; 33 | border-width: 3; 34 | } 35 | 36 | QSpinBox::up-button 37 | { 38 | subcontrol-origin: padding; 39 | subcontrol-position: right; /* position at the top right corner */ 40 | width: 24px; 41 | height: 24px; 42 | border-width: 3px; 43 | 44 | } 45 | 46 | QSpinBox::up-arrow 47 | { 48 | image: url(icons:add.png); 49 | width: 18px; 50 | height: 18px; 51 | } 52 | 53 | 54 | QSpinBox::down-button 55 | { 56 | subcontrol-origin: border; 57 | subcontrol-position: left; 58 | width: 24px; 59 | height: 24px; 60 | border-width: 3px; 61 | } 62 | 63 | QSpinBox::down-arrow 64 | { 65 | image: url(icons:remove.png); 66 | width: 18px; 67 | height: 18px; 68 | } 69 | 70 | 71 | QScrollBar:horizontal 72 | { 73 | border: 1px solid black; 74 | background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0,0,139,60%), stop:1 rgba(173,216,230,60%) ); 75 | height: 15px; 76 | margin: 0px 20px 0 20px; 77 | } 78 | 79 | QScrollBar::handle:horizontal 80 | { 81 | border: 1px solid black; 82 | background: rgba(0,0,139,60%); 83 | min-width: 20px; 84 | } 85 | 86 | QScrollBar::add-line:horizontal 87 | { 88 | border: 1px solid black; 89 | background: rgba(0,0,139,60%); 90 | width: 20px; 91 | subcontrol-position: right; 92 | subcontrol-origin: margin; 93 | } 94 | 95 | QScrollBar::sub-line:horizontal 96 | { 97 | border: 1px solid black; 98 | background: rgba(0,0,139,60%); 99 | width: 20px; 100 | subcontrol-position: left; 101 | subcontrol-origin: margin; 102 | } 103 | 104 | QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal 105 | { 106 | border: none; 107 | width: 16px; 108 | height: 16px; 109 | } 110 | 111 | QScrollBar:left-arrow:horizontal 112 | { 113 | image: url(icons:add.png) 114 | } 115 | 116 | QScrollBar::right-arrow:horizontal 117 | { 118 | image: url(icons:remove.png) 119 | } 120 | 121 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal 122 | { 123 | background: none; 124 | } 125 | 126 | -------------------------------------------------------------------------------- /fuellevelinput.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | FuelLevelInput::FuelLevelInput(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | FuelLevelInput::FuelLevelInput() 44 | { 45 | m_command = "012F"; 46 | m_englishMeaning = "Fuel Level Input"; 47 | setUnits(PERCENTAGE); 48 | setExpectedBytes(1); 49 | setMin(0); 50 | setMax(100); 51 | } 52 | 53 | double FuelLevelInput::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]*100/255); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /fuellevelinput.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef FUELLEVELINPUTSENSOR_H 34 | #define FUELLEVELINPUTSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class FuelLevelInput : public Sensor 41 | { 42 | public: 43 | FuelLevelInput(QString command, QString englishMeaning); 44 | FuelLevelInput(); 45 | double convertResult(); 46 | ~FuelLevelInput() { } 47 | }; 48 | } 49 | #endif // FUELLEVELINPUTSENSOR_H 50 | -------------------------------------------------------------------------------- /fuelpressure.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | FuelPressure::FuelPressure(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | FuelPressure::FuelPressure() 44 | { 45 | m_command = "010A"; 46 | m_englishMeaning = "Fuel Pressure"; 47 | setUnits(KPA); 48 | setExpectedBytes(1); 49 | setMin(0); 50 | setMax(765); 51 | } 52 | 53 | double FuelPressure::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]*3); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /fuelpressure.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef FUELPRESSURESENSOR_H 34 | #define FUELPRESSURESENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class FuelPressure : public Sensor 41 | { 42 | public: 43 | FuelPressure(QString command, QString englishMeaning); 44 | FuelPressure(); 45 | double convertResult(); 46 | ~FuelPressure() { } 47 | }; 48 | } 49 | #endif // FUELPRESSURESENSOR_H 50 | -------------------------------------------------------------------------------- /icons/accelerationtesticon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/accelerationtesticon.png -------------------------------------------------------------------------------- /icons/accellerationtesticon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/accellerationtesticon.png -------------------------------------------------------------------------------- /icons/automonsettingsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/automonsettingsicon.png -------------------------------------------------------------------------------- /icons/back/accellerationtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/accellerationtest.png -------------------------------------------------------------------------------- /icons/back/accellerationtesticon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/accellerationtesticon.png -------------------------------------------------------------------------------- /icons/back/automonsettingsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/automonsettingsicon.png -------------------------------------------------------------------------------- /icons/back/cardetailsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/cardetailsicon.png -------------------------------------------------------------------------------- /icons/back/dashboardicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/dashboardicon.png -------------------------------------------------------------------------------- /icons/back/diagnosticsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/diagnosticsicon.png -------------------------------------------------------------------------------- /icons/back/monitoringicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/back/monitoringicon.png -------------------------------------------------------------------------------- /icons/cardetailsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/cardetailsicon.png -------------------------------------------------------------------------------- /icons/dashboardicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/dashboardicon.png -------------------------------------------------------------------------------- /icons/diagnosticsicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/diagnosticsicon.png -------------------------------------------------------------------------------- /icons/monitoringicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/icons/monitoringicon.png -------------------------------------------------------------------------------- /mafairflowrate.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | MafAirFlowRate::MafAirFlowRate(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | MafAirFlowRate::MafAirFlowRate() 44 | { 45 | m_command = "0110"; 46 | m_englishMeaning = "MAF Airflow Sensor"; 47 | setUnits(GS); 48 | setExpectedBytes(2); 49 | setMin(0); 50 | setMax(655.35); 51 | } 52 | 53 | double MafAirFlowRate::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (((bytes[2]*256)+bytes[3])/100); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /mafairflowrate.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef MAFAIRFLOWRATESENSOR_H 34 | #define MAFAIRFLOWRATESENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class MafAirFlowRate : public Sensor 41 | { 42 | public: 43 | MafAirFlowRate(QString command, QString englishMeaning); 44 | MafAirFlowRate(); 45 | double convertResult(); 46 | ~MafAirFlowRate() { } 47 | }; 48 | } 49 | #endif // MAFAIRFLOWRATESENSOR_H 50 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "automonapp.h" 38 | 39 | int main(int argc, char *argv[]) 40 | { 41 | /* Create an application */ 42 | QApplication a(argc, argv); 43 | 44 | /* Set up styling of application */ 45 | QFile styleSheet(":/files/automon.qss"); 46 | 47 | /* Open file */ 48 | if (!styleSheet.open(QIODevice::ReadOnly)) { 49 | qWarning("Unable to open :/files/automon.qss"); 50 | exit(0); 51 | } 52 | 53 | /* Apply stylesheet to application */ 54 | a.setStyleSheet(styleSheet.readAll()); 55 | 56 | /* Disable the cursor since using touch screen */ 57 | // a.setOverrideCursor( QCursor( Qt::BlankCursor )); [LA] 58 | 59 | /* Open Splashscreen image, create a SplashScreen with it and show splash screen */ 60 | QPixmap pixmap(":/files/splashscreen.png"); 61 | QSplashScreen splash(pixmap); 62 | splash.show(); 63 | 64 | 65 | /* Start our automon application */ 66 | AutomonApp automon(&splash); 67 | // automon.setCursor(QCursor(Qt::BlankCursor)); [LA] 68 | automon.show(); 69 | 70 | /* Finsih the splashscreen once Automon has loaded */ 71 | splash.finish(&automon); 72 | 73 | /* Run event loop */ 74 | return a.exec(); 75 | } 76 | -------------------------------------------------------------------------------- /math-support.h: -------------------------------------------------------------------------------- 1 | #ifndef DIAL_MATH_SUPPORT_H 2 | #define DIAL_MATH_SUPPORT_H 3 | 4 | #ifndef Q_WS_X11 5 | #define Q_WS_X11 6 | #endif 7 | 8 | /* 9 | 10 | math-support.h - part of DialWidget 11 | Copyright © 2007 Michael Pyne 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions 15 | are met: 16 | 17 | 1. Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | 2. Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | 34 | */ 35 | 36 | 37 | template 38 | int sgn(T t) 39 | { 40 | return t < 0 ? -1 : (t > 0 ? 1 : 0); 41 | } 42 | 43 | template 44 | T clamp(const T &value, const T& l, const T& r) 45 | { 46 | if(value < l) 47 | return l; 48 | else if(value > r) 49 | return r; 50 | 51 | return value; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /menuitem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "menuitem.h" 34 | 35 | 36 | MenuItem::MenuItem(const QIcon & icon, const QString & name, const QSize & size, QWidget *parent) 37 | : QPushButton(icon, "", parent), m_name(name) 38 | { 39 | /* This is a reference value to the stacked widget index in the main GUI */ 40 | m_stackedWidgetIndex = -1; 41 | 42 | /* Connect the clicked event of this push button to a custom slot so we can override the clicked event */ 43 | connect(this, SIGNAL(clicked()), this, SLOT(changePanel())); 44 | 45 | /* Set the size of the button and icon to the defined one in constructor */ 46 | setFixedSize(size); 47 | setIconSize(size); 48 | 49 | /* Set no background */ 50 | setStyleSheet("background:none;"); 51 | } 52 | 53 | MenuItem::~MenuItem() 54 | { 55 | 56 | } 57 | 58 | QString MenuItem::getName() 59 | { 60 | /* Return name of menu item. */ 61 | return m_name; 62 | } 63 | 64 | void MenuItem::setPanelIndex(int index) 65 | { 66 | /* Set the index of the stacked widget that this button will load */ 67 | m_stackedWidgetIndex = index; 68 | } 69 | 70 | void MenuItem::changePanel() 71 | { 72 | /* Basically over riding the clicked signal. So we just emit another signal to change the panel to this index */ 73 | emit displayPanel(m_stackedWidgetIndex); 74 | } 75 | -------------------------------------------------------------------------------- /menuitem.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef MENUITEM_H 34 | #define MENUITEM_H 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | class MenuItem : public QPushButton 42 | { 43 | Q_OBJECT 44 | public: 45 | MenuItem(const QIcon & icon, const QString & name, const QSize & size, QWidget *parent = 0); 46 | ~MenuItem(); 47 | void setPanelIndex(int index); 48 | QString getName(); 49 | 50 | signals: 51 | void displayPanel(int stackedWidgetIndex); /* Signal that is used in the AutomonApp to change the widget shown */ 52 | 53 | public slots: 54 | void changePanel(); 55 | 56 | private: 57 | QString m_name; 58 | int m_stackedWidgetIndex; 59 | }; 60 | 61 | #endif // MENUITEM_H 62 | -------------------------------------------------------------------------------- /menuwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef MENUWIDGET_H 34 | #define MENUWIDGET_H 35 | 36 | #include 37 | #include 38 | 39 | class QHBoxLayout; 40 | 41 | #include "menuitem.h" 42 | 43 | class MenuWidget : public QWidget 44 | { 45 | public: 46 | MenuWidget(); 47 | ~MenuWidget(); 48 | bool connectButtonToPanel(QString name, int panelID, QObject * receiverObj); 49 | 50 | private: 51 | QList m_buttons; 52 | QHBoxLayout * m_layout; 53 | 54 | 55 | 56 | }; 57 | 58 | #endif // MENUWIDGET_H 59 | -------------------------------------------------------------------------------- /o2voltage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | O2Voltage::O2Voltage(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | O2Voltage::O2Voltage() 44 | { 45 | m_command = "0114"; 46 | m_englishMeaning = "02 Voltage in Bank 1 Sensor 1"; 47 | setUnits(VOLTS); 48 | setExpectedBytes(2); 49 | setMin(0); 50 | setMax(1.275); 51 | } 52 | 53 | double O2Voltage::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]*0.005); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /o2voltage.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef O2VOLTAGESENSOR_H 34 | #define O2VOLTAGESENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class O2Voltage : public Sensor 41 | { 42 | public: 43 | O2Voltage(QString command, QString englishMeaning); 44 | O2Voltage(); 45 | double convertResult(); 46 | ~O2Voltage() { } 47 | }; 48 | } 49 | #endif // O2VOLTAGESENSOR_H 50 | -------------------------------------------------------------------------------- /qtanimation/QtAbstractAnimation: -------------------------------------------------------------------------------- 1 | #include "qtabstractanimation.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtAbstractState: -------------------------------------------------------------------------------- 1 | #include "qtabstractstate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtAbstractTransition: -------------------------------------------------------------------------------- 1 | #include "qtabstracttransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtActionState: -------------------------------------------------------------------------------- 1 | #include "qtactionstate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtAnimationGroup: -------------------------------------------------------------------------------- 1 | #include "qtanimationgroup.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtAnimationState: -------------------------------------------------------------------------------- 1 | #include "qtanimationstate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtEasingCurve: -------------------------------------------------------------------------------- 1 | #include "qteasingcurve.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtEventTransition: -------------------------------------------------------------------------------- 1 | #include "qteventtransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtFinalState: -------------------------------------------------------------------------------- 1 | #include "qtfinalstate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtGraphicsWidget: -------------------------------------------------------------------------------- 1 | #include "qtgraphicswidget.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtHistoryState: -------------------------------------------------------------------------------- 1 | #include "qthistorystate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtKeyEventTransition: -------------------------------------------------------------------------------- 1 | #include "qtkeyeventtransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtMouseEventTransition: -------------------------------------------------------------------------------- 1 | #include "qtmouseeventtransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtParallelAnimationGroup: -------------------------------------------------------------------------------- 1 | #include "qtparallelanimationgroup.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtPauseAnimation: -------------------------------------------------------------------------------- 1 | #include "qtpauseanimation.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtPropertyAnimation: -------------------------------------------------------------------------------- 1 | #include "qtpropertyanimation.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtSequentialAnimationGroup: -------------------------------------------------------------------------------- 1 | #include "qtsequentialanimationgroup.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtSignalEvent: -------------------------------------------------------------------------------- 1 | #include "qtsignalevent.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtSignalTransition: -------------------------------------------------------------------------------- 1 | #include "qtsignaltransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtState: -------------------------------------------------------------------------------- 1 | #include "qtstate.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateAction: -------------------------------------------------------------------------------- 1 | #include "qtstateaction.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateFinishedEvent: -------------------------------------------------------------------------------- 1 | #include "qtstatefinishedevent.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateFinishedTransition: -------------------------------------------------------------------------------- 1 | #include "qtstatefinishedtransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateInvokeMethodAction: -------------------------------------------------------------------------------- 1 | #include "qtstateaction.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateMachine: -------------------------------------------------------------------------------- 1 | #include "qtstatemachine.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtStateSetPropertyAction: -------------------------------------------------------------------------------- 1 | #include "qtstateaction.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtTransition: -------------------------------------------------------------------------------- 1 | #include "qttransition.h" 2 | -------------------------------------------------------------------------------- /qtanimation/QtVariantAnimation: -------------------------------------------------------------------------------- 1 | #include "qtvariantanimation.h" 2 | -------------------------------------------------------------------------------- /qtanimation/animation.pri: -------------------------------------------------------------------------------- 1 | # Qt core animation module 2 | 3 | HEADERS += \ 4 | $$PWD/qtabstractanimation.h \ 5 | $$PWD/qtabstractanimation_p.h \ 6 | $$PWD/qtvariantanimation.h \ 7 | $$PWD/qtvariantanimation_p.h \ 8 | $$PWD/qtpropertyanimation.h \ 9 | $$PWD/qtpropertyanimation_p.h \ 10 | $$PWD/qtanimationgroup.h \ 11 | $$PWD/qtanimationgroup_p.h \ 12 | $$PWD/qtsequentialanimationgroup.h \ 13 | $$PWD/qtsequentialanimationgroup_p.h \ 14 | $$PWD/qtparallelanimationgroup.h \ 15 | $$PWD/qtparallelanimationgroup_p.h \ 16 | $$PWD/qtpauseanimation.h 17 | 18 | SOURCES += \ 19 | $$PWD/qtabstractanimation.cpp \ 20 | $$PWD/qtvariantanimation.cpp \ 21 | $$PWD/qtpropertyanimation.cpp \ 22 | $$PWD/qtanimationgroup.cpp \ 23 | $$PWD/qtsequentialanimationgroup.cpp \ 24 | $$PWD/qtparallelanimationgroup.cpp \ 25 | $$PWD/qtpauseanimation.cpp 26 | -------------------------------------------------------------------------------- /qtanimation/corelib_statemachine.pri: -------------------------------------------------------------------------------- 1 | HEADERS += $$PWD/qtstatemachine.h \ 2 | $$PWD/qtstatemachine_p.h \ 3 | $$PWD/qtstateaction.h \ 4 | $$PWD/qtstateaction_p.h \ 5 | $$PWD/qtsignaleventgenerator_p.h \ 6 | $$PWD/qtabstractstate.h \ 7 | $$PWD/qtabstractstate_p.h \ 8 | $$PWD/qtactionstate.h \ 9 | $$PWD/qtactionstate_p.h \ 10 | $$PWD/qtstate.h \ 11 | $$PWD/qtstate_p.h \ 12 | $$PWD/qtfinalstate.h \ 13 | $$PWD/qthistorystate.h \ 14 | $$PWD/qthistorystate_p.h \ 15 | $$PWD/qtabstracttransition.h \ 16 | $$PWD/qtabstracttransition_p.h \ 17 | $$PWD/qttransition.h \ 18 | $$PWD/qttransition_p.h \ 19 | $$PWD/qtstatefinishedevent.h \ 20 | $$PWD/qtstatefinishedtransition.h \ 21 | $$PWD/qtsignalevent.h \ 22 | $$PWD/qtsignaltransition.h \ 23 | $$PWD/qtsignaltransition_p.h 24 | 25 | SOURCES += $$PWD/qtstatemachine.cpp \ 26 | $$PWD/qtstateaction.cpp \ 27 | $$PWD/qtabstractstate.cpp \ 28 | $$PWD/qtactionstate.cpp \ 29 | $$PWD/qtstate.cpp \ 30 | $$PWD/qtfinalstate.cpp \ 31 | $$PWD/qthistorystate.cpp \ 32 | $$PWD/qtabstracttransition.cpp \ 33 | $$PWD/qttransition.cpp \ 34 | $$PWD/qtstatefinishedtransition.cpp \ 35 | $$PWD/qtsignaltransition.cpp 36 | 37 | !contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) { 38 | HEADERS += $$PWD/qtboundevent_p.h \ 39 | $$PWD/qteventtransition.h \ 40 | $$PWD/qteventtransition_p.h 41 | SOURCES += $$PWD/qteventtransition.cpp 42 | } 43 | 44 | !contains(DEFINES, QT_NO_ANIMATION) { 45 | HEADERS += $$PWD/qtanimationstate.h 46 | SOURCES += $$PWD/qtanimationstate.cpp 47 | } 48 | -------------------------------------------------------------------------------- /qtanimation/gui_statemachine.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | DEPENDPATH += $$PWD 3 | 4 | SOURCES += $$PWD/qtguistatemachine.cpp 5 | !contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) { 6 | HEADERS += \ 7 | $$PWD/qtkeyeventtransition.h \ 8 | $$PWD/qtmouseeventtransition.h \ 9 | $$PWD/qtbasickeyeventtransition_p.h \ 10 | $$PWD/qtbasicmouseeventtransition_p.h 11 | SOURCES += \ 12 | $$PWD/qtkeyeventtransition.cpp \ 13 | $$PWD/qtmouseeventtransition.cpp \ 14 | $$PWD/qtbasickeyeventtransition.cpp \ 15 | $$PWD/qtbasicmouseeventtransition.cpp 16 | } 17 | -------------------------------------------------------------------------------- /qtanimation/qtabstractstate.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QABSTRACTSTATE_H 50 | #define QABSTRACTSTATE_H 51 | 52 | #include 53 | 54 | QT_BEGIN_HEADER 55 | 56 | QT_BEGIN_NAMESPACE 57 | 58 | QT_MODULE(Core) 59 | 60 | class QtState; 61 | 62 | class QtAbstractStatePrivate; 63 | class Q_ANIMATION_EXPORT QtAbstractState : public QObject 64 | { 65 | Q_OBJECT 66 | public: 67 | ~QtAbstractState(); 68 | 69 | QtState *parentState() const; 70 | 71 | protected: 72 | QtAbstractState(QtState *parent = 0); 73 | 74 | virtual void onEntry() = 0; 75 | virtual void onExit() = 0; 76 | 77 | bool event(QEvent *e); 78 | 79 | protected: 80 | #ifdef QT_STATEMACHINE_SOLUTION 81 | QtAbstractStatePrivate *d_ptr; 82 | #endif 83 | QtAbstractState(QtAbstractStatePrivate &dd, QtState *parent); 84 | 85 | private: 86 | Q_DISABLE_COPY(QtAbstractState) 87 | Q_DECLARE_PRIVATE(QtAbstractState) 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | QT_END_HEADER 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /qtanimation/qtactionstate_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QACTIONSTATE_P_H 50 | #define QACTIONSTATE_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtabstractstate_p.h" 64 | #include "qtactionstate.h" 65 | 66 | #include 67 | 68 | QT_BEGIN_NAMESPACE 69 | 70 | class QtStateAction; 71 | 72 | class QtActionState; 73 | class Q_ANIMATION_EXPORT QtActionStatePrivate : public QtAbstractStatePrivate 74 | { 75 | Q_DECLARE_PUBLIC(QtActionState) 76 | 77 | public: 78 | QtActionStatePrivate(); 79 | ~QtActionStatePrivate(); 80 | 81 | static QtActionStatePrivate *get(QtActionState *q); 82 | static const QtActionStatePrivate *get(const QtActionState *q); 83 | 84 | QList entryActions() const; 85 | QList exitActions() const; 86 | 87 | QtActionState::RestorePolicy restorePolicy; 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /qtanimation/qtanimationframework.pri: -------------------------------------------------------------------------------- 1 | include(../common.pri) 2 | INCLUDEPATH += $$PWD 3 | DEPENDPATH += $$PWD 4 | 5 | DEFINES += QT_EXPERIMENTAL_SOLUTION QT_STATEMACHINE_SOLUTION 6 | #DEFINES += QT_NO_STATEMACHINE_EVENTFILTER 7 | 8 | qtanimationframework-uselib:!qtanimationframework-buildlib { 9 | LIBS += -L$$QTANIMATIONFRAMEWORK_LIBDIR -l$$QTANIMATIONFRAMEWORK_LIBNAME 10 | } else { 11 | include(corelib_statemachine.pri) 12 | contains(QT, gui) { 13 | include(gui_statemachine.pri) 14 | } 15 | include(animation.pri) 16 | SOURCES += $$PWD/qteasingcurve.cpp \ 17 | $$PWD/easing.cpp \ 18 | $$PWD/qtgraphicswidget.cpp 19 | HEADERS += $$PWD/qteasingcurve.h \ 20 | $$PWD/qtgraphicswidget.h 21 | } 22 | 23 | win32 { 24 | contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += Q_ANIMATION_EXPORT=__declspec(dllexport) 25 | else:qtanimationframework-uselib:DEFINES += Q_ANIMATION_EXPORT=__declspec(dllimport) 26 | else:DEFINES += Q_ANIMATION_EXPORT= 27 | } 28 | else { 29 | DEFINES += Q_ANIMATION_EXPORT= 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /qtanimation/qtanimationgroup_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QANIMATIONGROUP_P_H 50 | #define QANIMATIONGROUP_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists for the convenience 57 | // of QIODevice. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtanimationgroup.h" 64 | 65 | #include 66 | 67 | #include "qtabstractanimation_p.h" 68 | 69 | QT_BEGIN_NAMESPACE 70 | 71 | class QtAnimationGroupPrivate : public QtAbstractAnimationPrivate 72 | { 73 | Q_DECLARE_PUBLIC(QtAnimationGroup) 74 | public: 75 | QtAnimationGroupPrivate() 76 | { } 77 | 78 | virtual void animationInsertedAt(int index) { Q_UNUSED(index) }; 79 | virtual void animationRemovedAt(int index); 80 | 81 | QList animations; 82 | }; 83 | 84 | QT_END_NAMESPACE 85 | 86 | #endif //QANIMATIONGROUP_P_H 87 | -------------------------------------------------------------------------------- /qtanimation/qtanimationstate.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QANIMATIONSTATE_H 50 | #define QANIMATIONSTATE_H 51 | 52 | #ifndef QT_STATEMACHINE_SOLUTION 53 | #include 54 | #else 55 | #include "qtstate.h" 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | #ifndef QT_NO_ANIMATION 65 | 66 | class QtAbstractAnimation; 67 | 68 | class QtAnimationStatePrivate; 69 | class Q_ANIMATION_EXPORT QtAnimationState : public QtState 70 | { 71 | Q_OBJECT 72 | public: 73 | 74 | QtAnimationState(QtAbstractAnimation *animation, QtState *parent = 0); 75 | QtAnimationState(QtState *parent = 0); 76 | ~QtAnimationState(); 77 | 78 | int animationCount() const; 79 | QtAbstractAnimation *animationAt(int i) const; 80 | void addAnimation(QtAbstractAnimation *animation); 81 | void removeAnimation(QtAbstractAnimation *animation); 82 | 83 | protected: 84 | virtual void onEntry(); 85 | virtual void onExit(); 86 | 87 | bool event(QEvent *e); 88 | 89 | private: 90 | Q_DISABLE_COPY(QtAnimationState) 91 | Q_DECLARE_PRIVATE(QtAnimationState) 92 | }; 93 | 94 | #endif //QT_NO_ANIMATION 95 | 96 | QT_END_NAMESPACE 97 | 98 | QT_END_HEADER 99 | 100 | #endif // QANIMATIONSTATE_H 101 | -------------------------------------------------------------------------------- /qtanimation/qtbasickeyeventtransition_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QBASICKEYEVENTTRANSITION_P_H 50 | #define QBASICKEYEVENTTRANSITION_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | // Qt 64 | #if defined(QT_EXPERIMENTAL_SOLUTION) 65 | # include "qtabstracttransition.h" 66 | #else 67 | # include 68 | #endif 69 | #include 70 | 71 | QT_BEGIN_NAMESPACE 72 | 73 | class QBasicKeyEventTransitionPrivate; 74 | class QBasicKeyEventTransition : public QtAbstractTransition 75 | { 76 | Q_OBJECT 77 | public: 78 | QBasicKeyEventTransition(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers); 79 | ~QBasicKeyEventTransition(); 80 | 81 | protected: 82 | bool testCondition(QEvent *event) const; 83 | void onTransition(); 84 | 85 | private: 86 | Q_DISABLE_COPY(QBasicKeyEventTransition) 87 | Q_DECLARE_PRIVATE(QBasicKeyEventTransition) 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /qtanimation/qtboundevent_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QBOUNDEVENT_P_H 50 | #define QBOUNDEVENT_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include 64 | 65 | QT_BEGIN_NAMESPACE 66 | 67 | class QtBoundEvent : public QEvent 68 | { 69 | public: 70 | QtBoundEvent(QObject *object, QEvent *event) 71 | #ifdef QT_STATEMACHINE_SOLUTION 72 | : QEvent(QEvent::Type(QEvent::User-3)), 73 | #else 74 | : QEvent(QEvent::Bound), 75 | #endif 76 | m_object(object), m_event(event) {} 77 | ~QtBoundEvent() {} 78 | 79 | inline QObject *object() const { return m_object; } 80 | inline QEvent *event() const { return m_event; } 81 | 82 | private: 83 | QObject *m_object; 84 | QEvent *m_event; 85 | }; 86 | 87 | QT_END_NAMESPACE 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /qtanimation/qteventtransition.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QEVENTTRANSITION_H 50 | #define QEVENTTRANSITION_H 51 | 52 | #include "qttransition.h" 53 | 54 | QT_BEGIN_HEADER 55 | 56 | QT_BEGIN_NAMESPACE 57 | 58 | QT_MODULE(Core) 59 | 60 | class QtEventTransitionPrivate; 61 | class Q_ANIMATION_EXPORT QtEventTransition : public QtTransition 62 | { 63 | Q_OBJECT 64 | public: 65 | QtEventTransition(QObject *object, QtAbstractTransition *transition); 66 | QtEventTransition(QObject *object, QEvent::Type type); 67 | ~QtEventTransition(); 68 | 69 | protected: 70 | void onTransition(); 71 | bool testCondition(QEvent *event) const; 72 | 73 | bool event(QEvent *e); 74 | 75 | protected: 76 | QtEventTransition(QtEventTransitionPrivate &dd, QObject *object, 77 | QtAbstractTransition *transition); 78 | 79 | private: 80 | Q_DISABLE_COPY(QtEventTransition) 81 | Q_DECLARE_PRIVATE(QtEventTransition) 82 | }; 83 | 84 | QT_END_NAMESPACE 85 | 86 | QT_END_HEADER 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /qtanimation/qteventtransition_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QEVENTTRANSITION_P_H 50 | #define QEVENTTRANSITION_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qttransition_p.h" 64 | 65 | QT_BEGIN_NAMESPACE 66 | 67 | class QtEventTransition; 68 | class Q_ANIMATION_EXPORT QtEventTransitionPrivate : public QtTransitionPrivate 69 | { 70 | Q_DECLARE_PUBLIC(QtEventTransition) 71 | public: 72 | QtEventTransitionPrivate(); 73 | 74 | static QtEventTransitionPrivate *get(QtEventTransition *q); 75 | 76 | bool registered; 77 | QObject *object; 78 | QtAbstractTransition *transition; 79 | }; 80 | 81 | QT_END_NAMESPACE 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /qtanimation/qtfinalstate.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QFINALSTATE_H 50 | #define QFINALSTATE_H 51 | 52 | #ifndef QT_STATEMACHINE_SOLUTION 53 | #include 54 | #else 55 | #include "qtactionstate.h" 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | class QtFinalStatePrivate; 65 | class Q_ANIMATION_EXPORT QtFinalState : public QtActionState 66 | { 67 | Q_OBJECT 68 | public: 69 | QtFinalState(QtState *parent = 0); 70 | ~QtFinalState(); 71 | 72 | protected: 73 | void onEntry(); 74 | void onExit(); 75 | 76 | bool event(QEvent *e); 77 | 78 | private: 79 | Q_DISABLE_COPY(QtFinalState) 80 | Q_DECLARE_PRIVATE(QtFinalState) 81 | }; 82 | 83 | QT_END_NAMESPACE 84 | 85 | QT_END_HEADER 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /qtanimation/qthistorystate.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QHISTORYSTATE_H 50 | #define QHISTORYSTATE_H 51 | 52 | #ifndef QT_STATEMACHINE_SOLUTION 53 | #include 54 | #else 55 | #include "qtstate.h" 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | class QtHistoryStatePrivate; 65 | class Q_ANIMATION_EXPORT QtHistoryState : public QtAbstractState 66 | { 67 | Q_OBJECT 68 | public: 69 | ~QtHistoryState(); 70 | 71 | QtAbstractState *defaultState() const; 72 | void setDefaultState(QtAbstractState *state); 73 | 74 | protected: 75 | void onEntry(); 76 | void onExit(); 77 | 78 | bool event(QEvent *e); 79 | 80 | private: 81 | QtHistoryState(QtState::HistoryType type, 82 | QtState *parent = 0); 83 | 84 | private: 85 | Q_DISABLE_COPY(QtHistoryState) 86 | Q_DECLARE_PRIVATE(QtHistoryState) 87 | }; 88 | 89 | QT_END_NAMESPACE 90 | 91 | QT_END_HEADER 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /qtanimation/qthistorystate_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QHISTORYSTATE_P_H 50 | #define QHISTORYSTATE_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtabstractstate_p.h" 64 | 65 | #include 66 | 67 | QT_BEGIN_NAMESPACE 68 | 69 | class QtHistoryState; 70 | class QtHistoryStatePrivate : public QtAbstractStatePrivate 71 | { 72 | Q_DECLARE_PUBLIC(QtHistoryState) 73 | 74 | public: 75 | QtHistoryStatePrivate(); 76 | 77 | static QtHistoryState *create(QtState::HistoryType type, 78 | QtState *parent); 79 | 80 | static QtHistoryStatePrivate *get(QtHistoryState *q); 81 | static const QtHistoryStatePrivate *get(const QtHistoryState *q); 82 | 83 | QtAbstractState *defaultState; 84 | QtState::HistoryType historyType; 85 | QList configuration; 86 | }; 87 | 88 | QT_END_NAMESPACE 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /qtanimation/qtkeyeventtransition.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QKEYEVENTTRANSITION_H 50 | #define QKEYEVENTTRANSITION_H 51 | 52 | #if defined(QT_EXPERIMENTAL_SOLUTION) 53 | # include "qteventtransition.h" 54 | #else 55 | # include 56 | #endif 57 | QT_BEGIN_HEADER 58 | 59 | QT_BEGIN_NAMESPACE 60 | 61 | QT_MODULE(Core) 62 | 63 | class QtKeyEventTransitionPrivate; 64 | class Q_ANIMATION_EXPORT QtKeyEventTransition : public QtEventTransition 65 | { 66 | Q_OBJECT 67 | public: 68 | QtKeyEventTransition(QObject *object, QEvent::Type type, int key, 69 | Qt::KeyboardModifiers modifiers = Qt::NoModifier); 70 | ~QtKeyEventTransition(); 71 | 72 | protected: 73 | void onTransition(); 74 | bool testCondition(QEvent *event) const; 75 | 76 | private: 77 | Q_DISABLE_COPY(QtKeyEventTransition) 78 | Q_DECLARE_PRIVATE(QtKeyEventTransition) 79 | }; 80 | 81 | QT_END_NAMESPACE 82 | 83 | QT_END_HEADER 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /qtanimation/qtmouseeventtransition.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QMOUSEEVENTTRANSITION_H 50 | #define QMOUSEEVENTTRANSITION_H 51 | 52 | //Qt 53 | #if defined(QT_EXPERIMENTAL_SOLUTION) 54 | # include "qteventtransition.h" 55 | #else 56 | # include 57 | #endif 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | class QtMouseEventTransitionPrivate; 65 | class QPainterPath; 66 | class Q_ANIMATION_EXPORT QtMouseEventTransition : public QtEventTransition 67 | { 68 | Q_OBJECT 69 | public: 70 | QtMouseEventTransition(QObject *object, QEvent::Type type, 71 | Qt::MouseButton button); 72 | ~QtMouseEventTransition(); 73 | 74 | QPainterPath path() const; 75 | void setPath(const QPainterPath &path); 76 | 77 | protected: 78 | void onTransition(); 79 | bool testCondition(QEvent *event) const; 80 | 81 | private: 82 | Q_DISABLE_COPY(QtMouseEventTransition) 83 | Q_DECLARE_PRIVATE(QtMouseEventTransition) 84 | }; 85 | 86 | QT_END_NAMESPACE 87 | 88 | QT_END_HEADER 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /qtanimation/qtparallelanimationgroup.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QPARALLELANIMATIONGROUP_H 50 | #define QPARALLELANIMATIONGROUP_H 51 | 52 | #if defined(QT_EXPERIMENTAL_SOLUTION) 53 | # include "qtanimationgroup.h" 54 | #else 55 | # include 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | #ifndef QT_NO_ANIMATION 65 | 66 | class QtParallelAnimationGroupPrivate; 67 | class Q_ANIMATION_EXPORT QtParallelAnimationGroup : public QtAnimationGroup 68 | { 69 | Q_OBJECT 70 | 71 | public: 72 | QtParallelAnimationGroup(QObject *parent = 0); 73 | ~QtParallelAnimationGroup(); 74 | 75 | int duration() const; 76 | 77 | protected: 78 | QtParallelAnimationGroup(QtParallelAnimationGroupPrivate &dd, QObject *parent); 79 | bool event(QEvent *event); 80 | 81 | void updateCurrentTime(int msecs); 82 | void updateState(QtAbstractAnimation::State oldState, QtAbstractAnimation::State newState); 83 | void updateDirection(QtAbstractAnimation::Direction direction); 84 | 85 | private: 86 | Q_DISABLE_COPY(QtParallelAnimationGroup) 87 | Q_DECLARE_PRIVATE(QtParallelAnimationGroup) 88 | Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished()) 89 | }; 90 | 91 | #endif //QT_NO_ANIMATION 92 | 93 | QT_END_NAMESPACE 94 | 95 | QT_END_HEADER 96 | 97 | #endif // QPARALLELANIMATIONGROUP 98 | -------------------------------------------------------------------------------- /qtanimation/qtparallelanimationgroup_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QPARALLELANIMATIONGROUP_P_H 50 | #define QPARALLELANIMATIONGROUP_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists for the convenience 57 | // of QIODevice. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtparallelanimationgroup.h" 64 | #include "qtanimationgroup_p.h" 65 | #include 66 | 67 | QT_BEGIN_NAMESPACE 68 | 69 | class QtParallelAnimationGroupPrivate : public QtAnimationGroupPrivate 70 | { 71 | Q_DECLARE_PUBLIC(QtParallelAnimationGroup) 72 | public: 73 | QtParallelAnimationGroupPrivate() 74 | : lastIteration(0), lastCurrentTime(0) 75 | { 76 | } 77 | 78 | QHash uncontrolledFinishTime; 79 | int lastIteration; 80 | int lastCurrentTime; 81 | 82 | bool isUncontrolledAnimationFinished(QtAbstractAnimation *anim) const; 83 | void connectUncontrolledAnimations(); 84 | void disconnectUncontrolledAnimations(); 85 | 86 | // private slot 87 | void _q_uncontrolledAnimationFinished(); 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif //QPARALLELANIMATIONGROUP_P_H 93 | -------------------------------------------------------------------------------- /qtanimation/qtpauseanimation.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QPAUSEANIMATION_P_H 50 | #define QPAUSEANIMATION_P_H 51 | 52 | #if defined(QT_EXPERIMENTAL_SOLUTION) 53 | # include "qtanimationgroup.h" 54 | #else 55 | # include 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | #ifndef QT_NO_ANIMATION 65 | 66 | class QtPauseAnimationPrivate; 67 | 68 | class Q_ANIMATION_EXPORT QtPauseAnimation : public QtAbstractAnimation 69 | { 70 | Q_OBJECT 71 | Q_PROPERTY(int duration READ duration WRITE setDuration) 72 | public: 73 | QtPauseAnimation(QObject *parent = 0); 74 | QtPauseAnimation(int msecs, QObject *parent = 0); 75 | ~QtPauseAnimation(); 76 | 77 | int duration() const; 78 | void setDuration(int msecs); 79 | 80 | protected: 81 | bool event(QEvent *e); 82 | void updateCurrentTime(int msecs); 83 | 84 | private: 85 | Q_DISABLE_COPY(QtPauseAnimation) 86 | Q_DECLARE_PRIVATE(QtPauseAnimation) 87 | }; 88 | 89 | #endif //QT_NO_ANIMATION 90 | 91 | QT_END_NAMESPACE 92 | 93 | QT_END_HEADER 94 | 95 | #endif // QPAUSEANIMATION_P_H 96 | -------------------------------------------------------------------------------- /qtanimation/qtpropertyanimation_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QPROPERTYANIMATION_P_H 50 | #define QPROPERTYANIMATION_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists for the convenience 57 | // of QIODevice. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtpropertyanimation.h" 64 | #include 65 | #include 66 | 67 | #include "qtvariantanimation_p.h" 68 | 69 | QT_BEGIN_NAMESPACE 70 | 71 | class QtPropertyAnimationPrivate : public QtVariantAnimationPrivate 72 | { 73 | Q_DECLARE_PUBLIC(QtPropertyAnimation) 74 | public: 75 | QtPropertyAnimationPrivate() 76 | : target(0), propertyType(0), propertyIndex(0), hasMetaProperty(false) 77 | { 78 | } 79 | 80 | 81 | QPointer target; 82 | 83 | //for the QProperty 84 | QMetaProperty property; 85 | int propertyType; 86 | int propertyIndex; 87 | 88 | int hasMetaProperty; 89 | QByteArray propertyName; 90 | void updateProperty(const QVariant &); 91 | void updateMetaProperty(); 92 | }; 93 | 94 | QT_END_NAMESPACE 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /qtanimation/qtsignalevent.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSIGNALEVENT_H 50 | #define QSIGNALEVENT_H 51 | 52 | #include 53 | 54 | #include 55 | #include 56 | 57 | QT_BEGIN_HEADER 58 | 59 | QT_BEGIN_NAMESPACE 60 | 61 | QT_MODULE(Core) 62 | 63 | class Q_ANIMATION_EXPORT QtSignalEvent : public QEvent 64 | { 65 | public: 66 | QtSignalEvent(const QObject *sender, int signalIndex, 67 | const QList &arguments); 68 | ~QtSignalEvent(); 69 | 70 | inline const QObject *sender() const { return m_sender; } 71 | inline int signalIndex() const { return m_signalIndex; } 72 | inline QList arguments() const { return m_arguments; } 73 | 74 | private: 75 | const QObject *m_sender; 76 | int m_signalIndex; 77 | QList m_arguments; 78 | }; 79 | 80 | QT_END_NAMESPACE 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /qtanimation/qtsignaleventgenerator_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSIGNALEVENTGENERATOR_P_H 50 | #define QSIGNALEVENTGENERATOR_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include 64 | 65 | QT_BEGIN_NAMESPACE 66 | 67 | class QtStateMachine; 68 | 69 | class QtSignalEventGenerator : public QObject 70 | { 71 | public: 72 | QtSignalEventGenerator( 73 | #ifdef QT_STATEMACHINE_SOLUTION 74 | int signalIndex, 75 | #endif 76 | QtStateMachine *parent); 77 | 78 | static const QMetaObject staticMetaObject; 79 | virtual const QMetaObject *metaObject() const; 80 | virtual void *qt_metacast(const char *); 81 | virtual int qt_metacall(QMetaObject::Call, int, void **argv); 82 | 83 | private: 84 | #ifdef QT_STATEMACHINE_SOLUTION 85 | int signalIndex; 86 | #endif 87 | Q_DISABLE_COPY(QtSignalEventGenerator) 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /qtanimation/qtsignaltransition.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSIGNALTRANSITION_H 50 | #define QSIGNALTRANSITION_H 51 | 52 | #ifndef QT_STATEMACHINE_SOLUTION 53 | #include 54 | #else 55 | #include "qttransition.h" 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | class QtSignalTransitionPrivate; 65 | class Q_ANIMATION_EXPORT QtSignalTransition : public QtTransition 66 | { 67 | Q_OBJECT 68 | public: 69 | QtSignalTransition(const QObject *sender, const char *signal); 70 | ~QtSignalTransition(); 71 | 72 | protected: 73 | bool testCondition(QEvent *event) const; 74 | void onTransition(); 75 | 76 | bool event(QEvent *e); 77 | 78 | private: 79 | Q_DISABLE_COPY(QtSignalTransition) 80 | Q_DECLARE_PRIVATE(QtSignalTransition) 81 | }; 82 | 83 | QT_END_NAMESPACE 84 | 85 | QT_END_HEADER 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /qtanimation/qtsignaltransition_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSIGNALTRANSITION_P_H 50 | #define QSIGNALTRANSITION_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qttransition_p.h" 64 | 65 | QT_BEGIN_NAMESPACE 66 | 67 | class QtSignalTransition; 68 | class QtSignalTransitionPrivate : public QtTransitionPrivate 69 | { 70 | Q_DECLARE_PUBLIC(QtSignalTransition) 71 | public: 72 | QtSignalTransitionPrivate(); 73 | 74 | static QtSignalTransitionPrivate *get(QtSignalTransition *q); 75 | 76 | const QObject *sender; 77 | QByteArray signal; 78 | int signalIndex; 79 | }; 80 | 81 | QT_END_NAMESPACE 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /qtanimation/qtstate_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSTATE_P_H 50 | #define QSTATE_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtactionstate_p.h" 64 | 65 | #include 66 | 67 | QT_BEGIN_NAMESPACE 68 | 69 | class QtState; 70 | class Q_ANIMATION_EXPORT QtStatePrivate : public QtActionStatePrivate 71 | { 72 | Q_DECLARE_PUBLIC(QtState) 73 | public: 74 | QtStatePrivate(); 75 | ~QtStatePrivate(); 76 | 77 | static QtStatePrivate *get(QtState *q); 78 | static const QtStatePrivate *get(const QtState *q); 79 | 80 | QList childStates() const; 81 | QList historyStates() const; 82 | QList transitions() const; 83 | 84 | bool hasUnregisteredTransitions; 85 | QtAbstractState *errorState; 86 | bool isParallelGroup; 87 | QtAbstractState *initialState; 88 | }; 89 | 90 | QT_END_NAMESPACE 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /qtanimation/qtstatefinishedevent.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSTATEFINISHEDEVENT_H 50 | #define QSTATEFINISHEDEVENT_H 51 | 52 | #include 53 | 54 | QT_BEGIN_HEADER 55 | 56 | QT_BEGIN_NAMESPACE 57 | 58 | QT_MODULE(Core) 59 | 60 | class QtState; 61 | 62 | class Q_ANIMATION_EXPORT QtStateFinishedEvent : public QEvent 63 | { 64 | public: 65 | QtStateFinishedEvent(QtState *state); 66 | ~QtStateFinishedEvent(); 67 | 68 | QtState *state() const; 69 | 70 | private: 71 | QtState *m_state; 72 | void *d; 73 | }; 74 | 75 | QT_END_NAMESPACE 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /qtanimation/qtstatefinishedtransition.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QSTATEFINISHEDTRANSITION_H 50 | #define QSTATEFINISHEDTRANSITION_H 51 | 52 | #ifndef QT_STATEMACHINE_SOLUTION 53 | #include 54 | #else 55 | #include "qttransition.h" 56 | #endif 57 | 58 | QT_BEGIN_HEADER 59 | 60 | QT_BEGIN_NAMESPACE 61 | 62 | QT_MODULE(Core) 63 | 64 | class QtState; 65 | 66 | class QtStateFinishedTransitionPrivate; 67 | class Q_ANIMATION_EXPORT QtStateFinishedTransition : public QtTransition 68 | { 69 | Q_OBJECT 70 | public: 71 | QtStateFinishedTransition(QtState *state); 72 | ~QtStateFinishedTransition(); 73 | 74 | protected: 75 | bool testCondition(QEvent *event) const; 76 | void onTransition(); 77 | 78 | bool event(QEvent *e); 79 | 80 | private: 81 | Q_DISABLE_COPY(QtStateFinishedTransition) 82 | Q_DECLARE_PRIVATE(QtStateFinishedTransition) 83 | }; 84 | 85 | QT_END_NAMESPACE 86 | 87 | QT_END_HEADER 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /qtanimation/qttransition_p.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** This file is part of a Qt Solutions component. 4 | ** 5 | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 | ** 7 | ** Contact: Qt Software Information (qt-info@nokia.com) 8 | ** 9 | ** Commercial Usage 10 | ** Licensees holding valid Qt Commercial licenses may use this file in 11 | ** accordance with the Qt Solutions Commercial License Agreement provided 12 | ** with the Software or, alternatively, in accordance with the terms 13 | ** contained in a written agreement between you and Nokia. 14 | ** 15 | ** GNU Lesser General Public License Usage 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser 17 | ** General Public License version 2.1 as published by the Free Software 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the 19 | ** packaging of this file. Please review the following information to 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 | ** 23 | ** In addition, as a special exception, Nokia gives you certain 24 | ** additional rights. These rights are described in the Nokia Qt LGPL 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 | ** package. 27 | ** 28 | ** GNU General Public License Usage 29 | ** Alternatively, this file may be used under the terms of the GNU 30 | ** General Public License version 3.0 as published by the Free Software 31 | ** Foundation and appearing in the file LICENSE.GPL included in the 32 | ** packaging of this file. Please review the following information to 33 | ** ensure the GNU General Public License version 3.0 requirements will be 34 | ** met: http://www.gnu.org/copyleft/gpl.html. 35 | ** 36 | ** Please note Third Party Software included with Qt Solutions may impose 37 | ** additional restrictions and it is the user's responsibility to ensure 38 | ** that they have met the licensing requirements of the GPL, LGPL, or Qt 39 | ** Solutions Commercial license and the relevant license of the Third 40 | ** Party Software they are using. 41 | ** 42 | ** If you are unsure which license is appropriate for your use, please 43 | ** contact the sales department at qt-sales@nokia.com. 44 | ** 45 | ****************************************************************************/ 46 | 47 | 48 | 49 | #ifndef QTRANSITION_P_H 50 | #define QTRANSITION_P_H 51 | 52 | // 53 | // W A R N I N G 54 | // ------------- 55 | // 56 | // This file is not part of the Qt API. It exists purely as an 57 | // implementation detail. This header file may change from version to 58 | // version without notice, or even be removed. 59 | // 60 | // We mean it. 61 | // 62 | 63 | #include "qtabstracttransition_p.h" 64 | 65 | #include 66 | 67 | QT_BEGIN_NAMESPACE 68 | 69 | class QtStateAction; 70 | 71 | class QtTransition; 72 | class Q_ANIMATION_EXPORT QtTransitionPrivate : public QtAbstractTransitionPrivate 73 | { 74 | Q_DECLARE_PUBLIC(QtTransition) 75 | public: 76 | QtTransitionPrivate(); 77 | ~QtTransitionPrivate(); 78 | 79 | static QtTransitionPrivate *get(QtTransition *q); 80 | static const QtTransitionPrivate *get(const QtTransition *q); 81 | 82 | QList actions() const; 83 | }; 84 | 85 | QT_END_NAMESPACE 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /qtc-gdbmacros/LGPL_EXCEPTION.TXT: -------------------------------------------------------------------------------- 1 | Nokia Qt LGPL Exception version 1.0 2 | 3 | As a special exception to the GNU Lesser General Public License version 2.1, the object code form of a "work that uses the Library" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that the incorporated material (i) does not exceed more than 5% of the total size of the Library; and (ii) is limited to numerical parameters, data structure layouts, accessors, macros, inline functions and templates. -------------------------------------------------------------------------------- /qtc-gdbmacros/gdbmacros.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | CONFIG += shared 3 | SOURCES=gdbmacros.cpp 4 | -------------------------------------------------------------------------------- /rule.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef RULE_H 34 | #define RULE_H 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | #include "sensor.h" 41 | 42 | namespace AutomonKernel 43 | { 44 | class Rule : public QObject 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | Rule(); 50 | void setRule(QString rule); 51 | void setRuleName(QString ruleName); 52 | QString getRule(); 53 | QString getRuleName(); 54 | bool checkIfSatisfied(); 55 | bool addSensor(Sensor * sensor); 56 | bool activate(); 57 | 58 | signals: 59 | void sendAlert(QString); 60 | 61 | public slots: 62 | void updateRule(double value); 63 | 64 | private: 65 | bool validateRule(); 66 | 67 | QScriptEngine * m_scriptEngine; 68 | QString m_rule; 69 | QString m_ruleName; 70 | bool m_satisfied; 71 | QList m_sensors; 72 | }; 73 | } 74 | #endif // RULE_H 75 | -------------------------------------------------------------------------------- /ruleeditorwidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef RULEEDITORWIDGET_H 34 | #define RULEEDITORWIDGET_H 35 | 36 | #include 37 | #include "automon.h" 38 | 39 | class QLabel; 40 | class QVBoxLayout; 41 | class QHBoxLayout; 42 | class QComboBox; 43 | class QSlider; 44 | class QLCDNumber; 45 | class QPushButton; 46 | class QTableWidget; 47 | 48 | using namespace AutomonKernel; 49 | 50 | class RuleEditorWidget : public QWidget 51 | { 52 | Q_OBJECT 53 | 54 | public: 55 | RuleEditorWidget(Automon * kernel, QWidget * parent = 0); 56 | 57 | signals: 58 | void changeStatus(const QString & status); 59 | void refreshRules(); 60 | 61 | public slots: 62 | void changeSliderValuesSensor1(int index); 63 | void changeSliderValuesSensor2(int index); 64 | void createRule(); 65 | void deleteRule(); 66 | 67 | private: 68 | void updateRulesTable(); 69 | QLabel * m_header; 70 | QHBoxLayout * m_mainLayout; 71 | QVBoxLayout * m_verticalLayout; 72 | QVBoxLayout * m_newRuleLayout; 73 | QHBoxLayout * m_sensor1Layout; 74 | QHBoxLayout * m_sensor2Layout; 75 | QHBoxLayout * m_ruleListLayout; 76 | QHBoxLayout * m_buttonLayout; 77 | QHBoxLayout * m_tableLayout; 78 | QComboBox * m_sensor1; 79 | QComboBox * m_sensor2; 80 | QComboBox * m_operator1; 81 | QComboBox * m_operator2; 82 | QComboBox * m_booleanChoice; 83 | QSlider * m_sensor1Value; 84 | QSlider * m_sensor2Value; 85 | QLCDNumber * m_sensor1ValueDisplay; 86 | QLCDNumber * m_sensor2ValueDisplay; 87 | QPushButton * m_createRuleButton; 88 | QPushButton * m_deleteRuleButton; 89 | QTableWidget * m_ruleListTable; 90 | 91 | Automon * m_kernel; 92 | 93 | }; 94 | 95 | #endif // RULEEDITORWIDGET_H 96 | -------------------------------------------------------------------------------- /rules: -------------------------------------------------------------------------------- 1 | s010C > 4000 && s0105 < 40 2 | s010D > 60 && s010C < 2514 3 | -------------------------------------------------------------------------------- /sensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef SENSOR_H 34 | #define SENSOR_H 35 | 36 | #include 37 | #include "command.h" 38 | 39 | class QVariant; 40 | 41 | namespace AutomonKernel 42 | { 43 | class Sensor : public Command 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | Sensor(); 49 | enum UNITS { MPH, RPM, DEGREES, PERCENTAGE, KPA, VOLTS, SECONDS, MINUTES, GS, NA }; 50 | virtual ~Sensor() {} 51 | virtual double convertResult(); 52 | void setMax(double max); 53 | void setMin(double min); 54 | double getMin(); 55 | double getMax(); 56 | double getResult() const; 57 | void setUnits(UNITS resultUnits); 58 | void setFrequency(int frequency); 59 | bool isTurn(); 60 | float getAvgRefreshRate(); 61 | virtual void setBuffer(QString bufferResponse); 62 | virtual void setResult(); 63 | void setSupported(bool isSupported); 64 | bool isSupported(); 65 | int getChangeTimes(); 66 | void resetSensor(); 67 | QString getName(); 68 | QString getPid(); 69 | 70 | signals: 71 | void changeOccurred(double); 72 | void outOfRangeError(QString); 73 | 74 | protected: 75 | bool checkIfOutOfRange(double value); 76 | bool m_wasOutOfRange; 77 | double m_maxVal; 78 | double m_minVal; 79 | UNITS m_resultUnits; 80 | double m_result; 81 | QList m_returnedBytes; 82 | 83 | private: 84 | void validateSensorData(QString buffer); 85 | bool m_isSupported; 86 | int m_maxFrequency; 87 | int m_currentFrequency; 88 | double m_avgRefreshRate; 89 | double m_instRefreshRate; 90 | double m_lastTime; 91 | int m_changeTimes; 92 | timeval m_timeVal; 93 | 94 | }; 95 | } 96 | 97 | #endif // SENSOR_H 98 | -------------------------------------------------------------------------------- /serialhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef SERIALHELPER_H 34 | #define SERIALHELPER_H 35 | 36 | #include 37 | #include 38 | #include // [LA] 39 | //#ifdef win32 40 | // #include 41 | // #include 42 | //#else 43 | // #include 44 | // #include "QtSerialPort/qserialportinfo.h" 45 | //#endif 46 | 47 | #include "sensor.h" 48 | #include "command.h" 49 | 50 | namespace AutomonKernel 51 | { 52 | class SerialHelper : public QThread 53 | { 54 | public: 55 | SerialHelper(QString port="/dev/ttyUSB0"); 56 | ~SerialHelper(); 57 | void run(); 58 | bool addActiveSensor(Sensor * sensor); 59 | bool removeActiveSensorByCommand(QString command); 60 | bool isMonitoring(); 61 | bool sendCommand(Command & command, int timeout = 5000); 62 | void clearReadBuffer(); 63 | void setMonitoring(bool); 64 | void removeAllActiveSensors(); 65 | 66 | private: 67 | QSerialPort * m_connection; 68 | QList m_activeSensors; 69 | bool m_isMonitoring; 70 | bool m_isPaused; 71 | bool m_pausedStarted; 72 | bool m_stop; 73 | QMutex m_mutexLock; 74 | 75 | 76 | 77 | }; 78 | } 79 | #endif // SERIALHELPER_H 80 | -------------------------------------------------------------------------------- /slides/item1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/slides/item1.jpg -------------------------------------------------------------------------------- /slides/item2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/donaloconnor/automon/b26003817a21e3a8dcd22370352e4062853a40a6/slides/item2.jpg -------------------------------------------------------------------------------- /stackblur.h: -------------------------------------------------------------------------------- 1 | #ifndef DIAL_STACKBLUR_H 2 | #define DIAL_STACKBLUR_H 3 | 4 | #ifndef Q_WS_X11 5 | #define Q_WS_X11 6 | #endif 7 | 8 | /* 9 | This file is a part of the KDE project 10 | 11 | Copyright (c) Zack Rusin 12 | Copyright (c) Fredrik Höglund 13 | Copyright (c) Michael Pyne (Header addition) 14 | 15 | The stack blur algorithm was invented by Mario Klingemann 16 | 17 | 18 | This implementation also incorporates performance improvements 19 | from Anti-Grain Geometry Version 2.4, 20 | Copyright (c) Maxim Shemanarev (http://www.antigrain.com) 21 | 22 | Redistribution and use in source and binary forms, with or without 23 | modification, are permitted provided that the following conditions 24 | are met: 25 | 26 | 1. Redistributions of source code must retain the above copyright 27 | notice, this list of conditions and the following disclaimer. 28 | 2. Redistributions in binary form must reproduce the above copyright 29 | notice, this list of conditions and the following disclaimer in the 30 | documentation and/or other materials provided with the distribution. 31 | 32 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 33 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 34 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 35 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 36 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 37 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 38 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 39 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 41 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | */ 43 | 44 | void stackBlur(QImage &image, int radius); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /throttleposition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | ThrottlePosition::ThrottlePosition(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | ThrottlePosition::ThrottlePosition() 44 | { 45 | m_command = "0111"; 46 | m_englishMeaning = "Throttle Position"; 47 | setUnits(MPH); 48 | setExpectedBytes(1); 49 | setMin(0); 50 | setMax(100); 51 | } 52 | 53 | double ThrottlePosition::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]*100/255); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /throttleposition.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef THROTTLEPOSITIONSENSOR_H 34 | #define THROTTLEPOSITIONSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class ThrottlePosition : public Sensor 41 | { 42 | public: 43 | ThrottlePosition(QString command, QString englishMeaning); 44 | ThrottlePosition(); 45 | double convertResult(); 46 | ~ThrottlePosition() { } 47 | }; 48 | } 49 | #endif // THROTTLEPOSITIONSENSOR_H 50 | -------------------------------------------------------------------------------- /vehiclespeed.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "automon.h" 34 | 35 | using namespace AutomonKernel; 36 | 37 | VehicleSpeed::VehicleSpeed(QString command, QString englishMeaning) 38 | { 39 | m_command = command; 40 | m_englishMeaning = englishMeaning; 41 | } 42 | 43 | VehicleSpeed::VehicleSpeed() 44 | { 45 | m_command = "010D"; 46 | m_englishMeaning = "Vehicle Speed"; 47 | setUnits(MPH); 48 | setExpectedBytes(1); 49 | setMin(0); 50 | setMax(255); 51 | } 52 | 53 | double VehicleSpeed::convertResult() 54 | { 55 | /* This is the conversion formula. It basically returns the value from the bytes retrieved from the ECU */ 56 | 57 | QList bytes = Automon::getBytes(*this); 58 | 59 | double value = (bytes[2]); 60 | 61 | return value; 62 | 63 | } 64 | -------------------------------------------------------------------------------- /vehiclespeed.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This file is part of the Automon Project (OBD Diagnostics) - http://www.automon.io/ 4 | Source Repository: https://github.com/donaloconnor/automon/ 5 | 6 | Copyright (c) 2015, Donal O'Connor 7 | 8 | All rights reserved. 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | 13 | * Redistributions of source code must retain the above copyright notice, this 14 | list of conditions and the following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above copyright notice, 17 | this list of conditions and the following disclaimer in the documentation 18 | and/or other materials provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef VEHICLESPEEDSENSOR_H 34 | #define VEHICLESPEEDSENSOR_H 35 | 36 | #include "sensor.h" 37 | 38 | namespace AutomonKernel 39 | { 40 | class VehicleSpeed : public Sensor 41 | { 42 | public: 43 | VehicleSpeed(QString command, QString englishMeaning); 44 | VehicleSpeed(); 45 | double convertResult(); 46 | ~VehicleSpeed() { } 47 | }; 48 | } 49 | #endif // VEHICLESPEEDSENSOR_H 50 | --------------------------------------------------------------------------------