working on cli and added lamp json
This commit is contained in:
@@ -90,7 +90,7 @@ file(GLOB_RECURSE SOURCES src/*.cpp)
|
|||||||
if(BUILD_SHARED_LIB)
|
if(BUILD_SHARED_LIB)
|
||||||
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
add_library(${PROJECT_NAME} SHARED ${SOURCES})
|
||||||
else()
|
else()
|
||||||
add_library(${PROJECT_NAME} STATIC ${SOURCES})
|
add_library(${PROJECT_NAME} STATIC ${SOURCES} cli/OutputInterpreter.cpp cli/OutputInterpreter.h)
|
||||||
endif(BUILD_SHARED_LIB)
|
endif(BUILD_SHARED_LIB)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
|
||||||
|
|||||||
16
FlippR-Driver/cli/OutputInterpreter.cpp
Normal file
16
FlippR-Driver/cli/OutputInterpreter.cpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// Created by rhetenor on 5/5/19.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "OutputInterpreter.h"
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
OutputInterpreter::OutputInterpreter(std::string output_pin_config_file, std::string output_lamp_config_file,
|
||||||
|
std::string output_solenoid_config_file, std::string output_sound_config_file,
|
||||||
|
std::string output_display_config_file)
|
||||||
|
: output_driver(flippR_driver::get_OutputDriver(ifstream(output_pin_config_file), ifstream(output_lamp_config_file),
|
||||||
|
ifstream(output_solenoid_config_file), ifstream(output_sound_config_file), ifstream(output_display_config_file)))
|
||||||
|
{}
|
||||||
24
FlippR-Driver/cli/OutputInterpreter.h
Normal file
24
FlippR-Driver/cli/OutputInterpreter.h
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
//
|
||||||
|
// Created by rhetenor on 5/5/19.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef FLIPPR_DRIVER_OUTPUTINTERPRETER_H
|
||||||
|
#define FLIPPR_DRIVER_OUTPUTINTERPRETER_H
|
||||||
|
|
||||||
|
#include "DriverFactory.h"
|
||||||
|
|
||||||
|
class OutputInterpreter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OutputInterpreter(std::string output_pin_config_file, std::string output_lamp_config_file,
|
||||||
|
std::string output_solenoid_config_file, std::string output_sound_config_file,
|
||||||
|
std::string output_display_config_file);
|
||||||
|
|
||||||
|
void startInterpreter();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::shared_ptr<flippR_driver::output::OutputDriver> output_driver;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //FLIPPR_DRIVER_OUTPUTINTERPRETER_H
|
||||||
@@ -78,14 +78,9 @@ int main (int argc, char *argv[])
|
|||||||
signal(SIGINT, __sigint_handler);
|
signal(SIGINT, __sigint_handler);
|
||||||
|
|
||||||
po::options_description po_desc("Options");
|
po::options_description po_desc("Options");
|
||||||
boost::optional<std::string> input_pin_config_file;
|
boost::optional<std::string> input_pin_config_file, output_pin_config_file;
|
||||||
std::string input_matrix_config_file;
|
|
||||||
|
|
||||||
boost::optional<std::string> output_pin_config_file;
|
std::string input_matrix_config_file, output_display_config_file, output_lamp_config_file, output_solenoid_config_file, output_sound_config_file;
|
||||||
std::string output_display_config_file;
|
|
||||||
std::string output_lamp_config_file;
|
|
||||||
std::string output_solenoid_config_file;
|
|
||||||
std::string output_sound_config_file;
|
|
||||||
|
|
||||||
register_program_options(po_desc, input_pin_config_file, input_matrix_config_file, output_pin_config_file, output_display_config_file, output_lamp_config_file, output_solenoid_config_file, output_sound_config_file);
|
register_program_options(po_desc, input_pin_config_file, input_matrix_config_file, output_pin_config_file, output_display_config_file, output_lamp_config_file, output_solenoid_config_file, output_sound_config_file);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,319 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"address" : 0,
|
"address" : 0,
|
||||||
"name" : "Special 100000 points"
|
"name" : "Special 100000 Points"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"address" : 1,
|
||||||
|
"name" : "Special 200000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 2,
|
||||||
|
"name" : "Woman Speech Lamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 3,
|
||||||
|
"name" : "Highest Score"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 4,
|
||||||
|
"name" : "Pop 2+4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 5,
|
||||||
|
"name" : "Special 300000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 6,
|
||||||
|
"name" : "Pop 1+3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 7,
|
||||||
|
"name" : "Special Orange"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 8,
|
||||||
|
"name" : "Down"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 9,
|
||||||
|
"name" : "Lamp 30 Sec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 10,
|
||||||
|
"name" : "Lamp 20 Sec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 11,
|
||||||
|
"name" : "Lamp 10 Sec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 12,
|
||||||
|
"name" : "Lamp 5 Sec"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 13,
|
||||||
|
"name" : "Can Play 4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 14,
|
||||||
|
"name" : "Can Play 3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 15,
|
||||||
|
"name" : "P Of Champ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 16,
|
||||||
|
"name" : "M Of Champ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 17,
|
||||||
|
"name" : "A Of Champ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 18,
|
||||||
|
"name" : "Can Play 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 19,
|
||||||
|
"name" : "Big Bonus 20000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 20,
|
||||||
|
"name" : "Can Play 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 21,
|
||||||
|
"name" : "H Of Champ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 22,
|
||||||
|
"name" : "C Of Champ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 23,
|
||||||
|
"name" : "Special Red"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 24,
|
||||||
|
"name" : "Super Bonus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 25,
|
||||||
|
"name" : "Bonus 20000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 26,
|
||||||
|
"name" : "2nd Kicker Lamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 27,
|
||||||
|
"name" : "Bonus 18000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 28,
|
||||||
|
"name" : "Bonus 17000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 29,
|
||||||
|
"name" : "Bonus 16000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 30,
|
||||||
|
"name" : "Man Speech Lamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 31,
|
||||||
|
"name" : "Bonus 15000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 32,
|
||||||
|
"name" : "Bonus 14000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 33,
|
||||||
|
"name" : "Bonus 13000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 34,
|
||||||
|
"name" : "Bonus 12000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 35,
|
||||||
|
"name" : "Ball"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 36,
|
||||||
|
"name" : "Bonus 11000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 37,
|
||||||
|
"name" : "Bonus 10000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 38,
|
||||||
|
"name" : "Bonus 9000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 39,
|
||||||
|
"name" : "Bonus 8000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 40,
|
||||||
|
"name" : "Bonus 7000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 41,
|
||||||
|
"name" : "Bonus 6000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 42,
|
||||||
|
"name" : "Bonus 5000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 43,
|
||||||
|
"name" : "Pop 5 Head Lamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 44,
|
||||||
|
"name" : "Bonus 3000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 45,
|
||||||
|
"name" : "Bonus 2000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 46,
|
||||||
|
"name" : "Bonus 1000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 47,
|
||||||
|
"name" : "Bonus 4000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 48,
|
||||||
|
"name" : "Right Advance Time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 49,
|
||||||
|
"name" : "UP"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 50,
|
||||||
|
"name" : "Bonux Multiplier x50"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 51,
|
||||||
|
"name" : "Bonus Multiplier x20"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 52,
|
||||||
|
"name" : "Bonus Multiplier x10"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 53,
|
||||||
|
"name" : "Credit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 54,
|
||||||
|
"name" : "Bonus 19000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 55,
|
||||||
|
"name" : "5th Button"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 56,
|
||||||
|
"name" : "4th Button"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 57,
|
||||||
|
"name" : "3rd Button"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 58,
|
||||||
|
"name" : "2nd Button"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 59,
|
||||||
|
"name" : "1st Button"
|
||||||
|
},
|
||||||
|
{ // todo!
|
||||||
|
"address" : 60,
|
||||||
|
"name" : "Flipper Relay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 61,
|
||||||
|
"name" : "Lamp 5"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 62,
|
||||||
|
"name" : "Lamp 4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 63,
|
||||||
|
"name" : "Ball To Play"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 64,
|
||||||
|
"name" : "Tunnel Lamp 20000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 65,
|
||||||
|
"name" : "Tunnel Lamp 30000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 66,
|
||||||
|
"name" : "Tunnel Lamp 50000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 67,
|
||||||
|
"name" : "Match"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 68,
|
||||||
|
"name" : "Lamp 3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 69,
|
||||||
|
"name" : "Lamp 2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 70,
|
||||||
|
"name" : "1st Kicker Lamp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 71,
|
||||||
|
"name" : "Lamp 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 72,
|
||||||
|
"name" : "Left Advance Time"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 73,
|
||||||
|
"name" : "Tilt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 74,
|
||||||
|
"name" : "Game Over"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 75,
|
||||||
|
"name" : "500000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 76,
|
||||||
|
"name" : "200000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 77,
|
||||||
|
"name" : "150000 Points"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"address" : 78,
|
||||||
|
"name" : "100000 Points"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
std::shared_ptr<input::InputDriver> get_InputDriver(std::istream& input_config_stream, std::istream& matrix_config_stream);
|
std::shared_ptr<input::InputDriver> get_InputDriver(const std::istream& input_config_stream, const std::istream& matrix_config_stream);
|
||||||
std::shared_ptr<output::OutputDriver> get_OutputDriver(std::istream &output_pin_config,
|
std::shared_ptr<output::OutputDriver> get_OutputDriver(const std::istream &output_pin_config,
|
||||||
std::istream &lamp_config,
|
const std::istream &lamp_config,
|
||||||
std::istream &solenoid_config,
|
const std::istream &solenoid_config,
|
||||||
std::istream &sound_config,
|
const std::istream &sound_config,
|
||||||
std::istream &display_config);
|
const std::istream &display_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //flippR_driver_DRIVERFACTORY_H
|
#endif //flippR_driver_DRIVERFACTORY_H
|
||||||
|
|||||||
Reference in New Issue
Block a user