-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assign triggers to inputs and add labels to 7 segment displays.
- Loading branch information
Showing
14 changed files
with
318 additions
and
210 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
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,12 @@ | ||
#ifndef INPUT_H | ||
#define INPUT_H | ||
|
||
|
||
class Input { | ||
public: | ||
virtual bool getOn( ) const = 0; | ||
virtual void setOn( bool value ) = 0; | ||
|
||
}; | ||
|
||
#endif /* INPUT_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
#ifndef INPUT_H | ||
#define INPUT_H | ||
#ifndef INPUTBUTTON_H | ||
#define INPUTBUTTON_H | ||
|
||
#include "graphicelement.h" | ||
#include "input.h" | ||
|
||
class InputButton : public GraphicElement { | ||
class InputButton : public GraphicElement, public Input { | ||
public: | ||
explicit InputButton(QGraphicsItem * parent); | ||
virtual ~InputButton(); | ||
explicit InputButton( QGraphicsItem *parent ); | ||
virtual ~InputButton( ); | ||
bool on; | ||
|
||
// QGraphicsItem interface | ||
/* QGraphicsItem interface */ | ||
protected: | ||
void mousePressEvent(QGraphicsSceneMouseEvent * event); | ||
void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); | ||
void mousePressEvent( QGraphicsSceneMouseEvent *event ); | ||
void mouseReleaseEvent( QGraphicsSceneMouseEvent *event ); | ||
|
||
// GraphicElement interface | ||
public: | ||
virtual ElementType elementType() { | ||
return ElementType::BUTTON; | ||
/* GraphicElement interface */ | ||
public: | ||
virtual ElementType elementType( ) { | ||
return( ElementType::BUTTON ); | ||
} | ||
void updateLogic(); | ||
void updateLogic( ); | ||
|
||
// Input interface | ||
public: | ||
bool getOn() const; | ||
void setOn(bool value); | ||
}; | ||
|
||
#endif // INPUT_H | ||
#endif /* INPUTBUTTON_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
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
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
Oops, something went wrong.