seperated public include headers
This commit is contained in:
@@ -58,6 +58,7 @@ else()
|
|||||||
endif(Boost_FOUND)
|
endif(Boost_FOUND)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
# Set libraries include path
|
# Set libraries include path
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR})
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR})
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define SRC_INPUT_IINPUTDRIVER_H_
|
#define SRC_INPUT_IINPUTDRIVER_H_
|
||||||
|
|
||||||
#include "utilities/IEventHandler.h"
|
#include "utilities/IEventHandler.h"
|
||||||
#include "IEventNotifier.h"
|
#include "input/IEventNotifier.h"
|
||||||
|
|
||||||
namespace Input {
|
namespace Input {
|
||||||
|
|
||||||
31
FlippR-Driver/src/output/CabinetItem.h
Normal file
31
FlippR-Driver/src/output/CabinetItem.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* CabinetItem.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class CabinetItem {
|
||||||
|
public:
|
||||||
|
CabinetItem();
|
||||||
|
virtual ~CabinetItem();
|
||||||
|
virtual bool isActivated();
|
||||||
|
virtual bool activate();
|
||||||
|
virtual bool deactivate();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int address;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
bool activated;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_CABINETITEM_H_ */
|
||||||
21
FlippR-Driver/src/output/Display.cpp
Normal file
21
FlippR-Driver/src/output/Display.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Display.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Display.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
Display::Display() {
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Display::~Display() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
33
FlippR-Driver/src/output/Display.h
Normal file
33
FlippR-Driver/src/output/Display.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Display.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_
|
||||||
|
|
||||||
|
#include "IDisplay.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class Display: public IDisplay {
|
||||||
|
public:
|
||||||
|
Display();
|
||||||
|
virtual ~Display();
|
||||||
|
|
||||||
|
virtual int getID();
|
||||||
|
virtual void write();
|
||||||
|
|
||||||
|
public:
|
||||||
|
int score;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int address;
|
||||||
|
int id;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_DISPLAY_H_ */
|
||||||
25
FlippR-Driver/src/output/IDisplay.h
Normal file
25
FlippR-Driver/src/output/IDisplay.h
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* IDisplay.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class IDisplay {
|
||||||
|
public:
|
||||||
|
IDisplay();
|
||||||
|
virtual ~IDisplay();
|
||||||
|
|
||||||
|
virtual int getID();
|
||||||
|
|
||||||
|
virtual void write() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAY_H_ */
|
||||||
27
FlippR-Driver/src/output/IDisplayController.h
Normal file
27
FlippR-Driver/src/output/IDisplayController.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* IDisplayController.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_
|
||||||
|
#include "config.h"
|
||||||
|
#include "IDisplay.h"
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class IDisplayController {
|
||||||
|
public:
|
||||||
|
IDisplayController();
|
||||||
|
virtual ~IDisplayController();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::array<IDisplay, NUMBER_OF_DISPLAYS> displays;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IDISPLAYCONTROLLER_H_ */
|
||||||
21
FlippR-Driver/src/output/IOutputDriver.h
Normal file
21
FlippR-Driver/src/output/IOutputDriver.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* IOutputDriver.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class IOutputDriver {
|
||||||
|
public:
|
||||||
|
IOutputDriver();
|
||||||
|
virtual ~IOutputDriver();
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_IOUTPUTDRIVER_H_ */
|
||||||
23
FlippR-Driver/src/output/ISound.h
Normal file
23
FlippR-Driver/src/output/ISound.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* ISound.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class ISound {
|
||||||
|
public:
|
||||||
|
ISound();
|
||||||
|
virtual ~ISound();
|
||||||
|
|
||||||
|
virtual void play() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_ISOUND_H_ */
|
||||||
21
FlippR-Driver/src/output/Lamp.cpp
Normal file
21
FlippR-Driver/src/output/Lamp.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Lamp.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Lamp.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
Lamp::Lamp() {
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Lamp::~Lamp() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
23
FlippR-Driver/src/output/Lamp.h
Normal file
23
FlippR-Driver/src/output/Lamp.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Lamp.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_
|
||||||
|
|
||||||
|
#include "CabinetItem.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class Lamp: public CabinetItem {
|
||||||
|
public:
|
||||||
|
Lamp();
|
||||||
|
virtual ~Lamp();
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_LAMP_H_ */
|
||||||
21
FlippR-Driver/src/output/OutputDriver.cpp
Normal file
21
FlippR-Driver/src/output/OutputDriver.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* OutputDriver.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "OutputDriver.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
OutputDriver::OutputDriver() {
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
OutputDriver::~OutputDriver() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
23
FlippR-Driver/src/output/OutputDriver.h
Normal file
23
FlippR-Driver/src/output/OutputDriver.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* OutputDriver.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_
|
||||||
|
|
||||||
|
#include "IOutputDriver.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class OutputDriver: public IOutputDriver {
|
||||||
|
public:
|
||||||
|
OutputDriver();
|
||||||
|
virtual ~OutputDriver();
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_OUTPUTDRIVER_H_ */
|
||||||
21
FlippR-Driver/src/output/Solenoid.cpp
Normal file
21
FlippR-Driver/src/output/Solenoid.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Solenoid.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Solenoid.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
Solenoid::Solenoid() {
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Solenoid::~Solenoid() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
23
FlippR-Driver/src/output/Solenoid.h
Normal file
23
FlippR-Driver/src/output/Solenoid.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Solenoid.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_
|
||||||
|
|
||||||
|
#include "CabinetItem.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class Solenoid: public CabinetItem {
|
||||||
|
public:
|
||||||
|
Solenoid();
|
||||||
|
virtual ~Solenoid();
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_SOLENOID_H_ */
|
||||||
21
FlippR-Driver/src/output/Sound.cpp
Normal file
21
FlippR-Driver/src/output/Sound.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Sound.cpp
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Sound.h"
|
||||||
|
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
Sound::Sound() {
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Sound::~Sound() {
|
||||||
|
// TODO Auto-generated destructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
30
FlippR-Driver/src/output/Sound.h
Normal file
30
FlippR-Driver/src/output/Sound.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Sound.h
|
||||||
|
*
|
||||||
|
* Created on: Aug 2, 2018
|
||||||
|
* Author: rhetenor
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_
|
||||||
|
#define SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_
|
||||||
|
|
||||||
|
#include "ISound.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
namespace output {
|
||||||
|
|
||||||
|
class Sound : ISound {
|
||||||
|
public:
|
||||||
|
Sound();
|
||||||
|
virtual ~Sound();
|
||||||
|
|
||||||
|
virtual void play();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int address;
|
||||||
|
std::string name;
|
||||||
|
};
|
||||||
|
|
||||||
|
} /* namespace output */
|
||||||
|
|
||||||
|
#endif /* SOURCE_DIRECTORY__SRC_OUTPUT_SOUND_H_ */
|
||||||
@@ -16,3 +16,5 @@
|
|||||||
|
|
||||||
#define INPUT_MATRIX_SIZE 8
|
#define INPUT_MATRIX_SIZE 8
|
||||||
#define INPUT_SLEEP_DURATION_NANO 800
|
#define INPUT_SLEEP_DURATION_NANO 800
|
||||||
|
|
||||||
|
#define NUMBER_OF_DISPLAYS 5
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ add_executable(${PROJECT_NAME} ${SOURCES})
|
|||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/tests)
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/tests)
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
||||||
#find_library(flippr-driver NAMES lib${CMAKE_PROJECT_NAME}.a HINTS ${CMAKE_SOURCE_DIR}/bin)
|
#find_library(flippr-driver NAMES lib${CMAKE_PROJECT_NAME}.a HINTS ${CMAKE_SOURCE_DIR}/bin)
|
||||||
#if(NOT flippr-driver)
|
#if(NOT flippr-driver)
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../catch.hpp"
|
#include "catch.hpp"
|
||||||
#include "../fakeit.hpp"
|
#include "fakeit.hpp"
|
||||||
|
|
||||||
#include "../../src/utilities/LoggerFactory.hpp"
|
#include "utilities/LoggerFactory.hpp"
|
||||||
#include "../../src/input/EventHandler.h"
|
#include "input/EventHandler.h"
|
||||||
#include "../../src/input/IInputDriver.h"
|
#include "IInputDriver.h"
|
||||||
|
|
||||||
|
|
||||||
// testing purposes
|
// testing purposes
|
||||||
|
|||||||
Reference in New Issue
Block a user