This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a110da9
commit c9b6c99
Showing
5 changed files
with
221 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "epos.h" | ||
|
||
Epos::Epos(QObject *parent) : QObject(parent) | ||
{ | ||
|
||
} | ||
|
||
|
||
void Epos::on_uirequest_velocity(int motorid, int velocity) | ||
{ | ||
QString textMotor = (motorid == MOTORID_LOWER) ? "lower" : "upper"; | ||
QString textState = "off"; | ||
if (velocity > 0) { | ||
textState = "is on, direction ccw, velocity " + QString::number(abs(velocity)); | ||
} | ||
else if (velocity < 0) { | ||
textState = "is on, direction cw, velocity " + QString::number(abs(velocity)); | ||
} | ||
|
||
emit log(EventLogType::Notify, "EPOS :: " + textMotor + " motor " + textState); | ||
} | ||
|
||
|
||
void Epos::on_uirequest_tension(bool state) | ||
{ | ||
QString textState = (state) ? "on" : "off"; | ||
emit log(EventLogType::Notify, "EPOS :: tension motor is " + textState); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef EPOS_H | ||
#define EPOS_H | ||
|
||
#include <QObject> | ||
|
||
#include "eventlog.h" | ||
|
||
class Epos : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit Epos(QObject *parent = nullptr); | ||
|
||
private: | ||
const int MOTORID_LOWER = 0; | ||
const int MOTORID_UPPER = 1; | ||
|
||
public slots: | ||
void on_uirequest_velocity(int motorid, int velocity); | ||
void on_uirequest_tension(bool state); | ||
|
||
signals: | ||
void log(EventLogType type, const QString &message); | ||
}; | ||
|
||
#endif // EPOS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters