merged
This commit is contained in:
78
.idea/workspace.xml
generated
78
.idea/workspace.xml
generated
@@ -10,15 +10,39 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e02dc5d7-dead-448e-976e-72d458e813a0" name="Default Changelist" comment="">
|
<list default="true" id="e02dc5d7-dead-448e-976e-72d458e813a0" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Flipper.h" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.cpp" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/DriverBoardItem.h" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/CMakeLists.txt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/.name" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Display_Config.json" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Display_Config.json" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Output_Pin_Config.json" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Output_Pin_Config.json" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Solenoid_Config.json" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/contrib/json_example/output/Solenoid_Config.json" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Display.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Display.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Lamp.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Lamp.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Solenoid.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Solenoid.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Sound.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Sound.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/DriverBoardPinController.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/DriverBoardPinController.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/OutputPinController.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/OutputPinController.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/SoundBoardPinController.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/SoundBoardPinController.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/DriverBoardPinController.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/DriverBoardPinController.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/DriverBoardPinController.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/OutputDriver.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/OutputDriver.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/SoundBoardPinController.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/detail/SoundBoardPinController.h" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/Item.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/include/output/items/Item.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Item.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Item.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Lamp.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Lamp.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Lamp.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Lamp.h" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Sound.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Sound.cpp" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Sound.h" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Sound.h" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/SocketHandler.cpp" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/SocketHandler.h" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/networking/input/TcpServer.cpp" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/networking/input/TcpServer.h" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/networking/output/OutputSocketHandler.cpp" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/src/utility/networking/output/OutputSocketHandler.h" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/FlippR-Driver/tests/output/TestOutputDriver.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/FlippR-Driver/tests/output/TestOutputDriver.cpp" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<ignored path="$PROJECT_DIR$/cmake-build-debug/" />
|
<ignored path="$PROJECT_DIR$/cmake-build-debug/" />
|
||||||
<ignored path="$PROJECT_DIR$/FlippR-Driver/build/CMakeFiles/" />
|
<ignored path="$PROJECT_DIR$/FlippR-Driver/build/CMakeFiles/" />
|
||||||
@@ -33,7 +57,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="FileEditorManager">
|
<component name="FileEditorManager">
|
||||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||||
<file pinned="false" current-in-tab="true">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.cpp">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.cpp">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="150">
|
<state relative-caret-position="150">
|
||||||
@@ -60,11 +84,11 @@
|
|||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
</file>
|
</file>
|
||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="true">
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="57">
|
<state relative-caret-position="72">
|
||||||
<caret line="9" column="40" selection-start-line="9" selection-start-column="40" selection-end-line="9" selection-end-column="40" />
|
<caret line="6" selection-start-line="6" selection-end-line="6" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -72,8 +96,8 @@
|
|||||||
<file pinned="false" current-in-tab="false">
|
<file pinned="false" current-in-tab="false">
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="495">
|
<state relative-caret-position="480">
|
||||||
<caret line="33" column="8" selection-start-line="33" selection-start-column="8" selection-end-line="33" selection-end-column="8" />
|
<caret line="32" column="8" selection-start-line="32" selection-start-column="8" selection-end-line="32" selection-end-column="8" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -82,7 +106,7 @@
|
|||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="150">
|
<state relative-caret-position="150">
|
||||||
<caret line="10" column="26" lean-forward="true" selection-start-line="10" selection-start-column="26" selection-end-line="10" selection-end-column="26" />
|
<caret line="10" column="26" selection-start-line="10" selection-start-column="26" selection-end-line="10" selection-end-column="26" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -156,10 +180,10 @@
|
|||||||
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/detail/OutputDriver.cpp" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/detail/OutputDriver.cpp" />
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/cli/OutputInterpreter.cpp" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/cli/OutputInterpreter.cpp" />
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp" />
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" />
|
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/include/output/items/Flipper.h" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/include/output/items/Flipper.h" />
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.h" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.h" />
|
||||||
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.cpp" />
|
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Flipper.cpp" />
|
||||||
|
<option value="$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
@@ -344,12 +368,12 @@
|
|||||||
<workItem from="1556736637754" duration="7752000" />
|
<workItem from="1556736637754" duration="7752000" />
|
||||||
<workItem from="1556915900568" duration="1797000" />
|
<workItem from="1556915900568" duration="1797000" />
|
||||||
<workItem from="1557142767804" duration="3551000" />
|
<workItem from="1557142767804" duration="3551000" />
|
||||||
<workItem from="1557160608181" duration="1928000" />
|
<workItem from="1557160608181" duration="2010000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TimeTrackingManager">
|
<component name="TimeTrackingManager">
|
||||||
<option name="totallyTimeSpent" value="77166000" />
|
<option name="totallyTimeSpent" value="77248000" />
|
||||||
</component>
|
</component>
|
||||||
<component name="TodoView">
|
<component name="TodoView">
|
||||||
<todo-panel id="selected-file">
|
<todo-panel id="selected-file">
|
||||||
@@ -663,13 +687,6 @@
|
|||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/PinController.cpp">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/PinController.cpp">
|
||||||
<provider selected="true" editor-type-id="text-editor" />
|
<provider selected="true" editor-type-id="text-editor" />
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state relative-caret-position="57">
|
|
||||||
<caret line="9" column="40" selection-start-line="9" selection-start-column="40" selection-end-line="9" selection-end-column="40" />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/include/output/OutputDriver.h">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/include/output/OutputDriver.h">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="480">
|
<state relative-caret-position="480">
|
||||||
@@ -710,14 +727,14 @@
|
|||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.h">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="150">
|
<state relative-caret-position="150">
|
||||||
<caret line="10" column="26" lean-forward="true" selection-start-line="10" selection-start-column="26" selection-end-line="10" selection-end-column="26" />
|
<caret line="10" column="26" selection-start-line="10" selection-start-column="26" selection-end-line="10" selection-end-column="26" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp">
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/detail/Solenoid.cpp">
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
<state relative-caret-position="495">
|
<state relative-caret-position="480">
|
||||||
<caret line="33" column="8" selection-start-line="33" selection-start-column="8" selection-end-line="33" selection-end-column="8" />
|
<caret line="32" column="8" selection-start-line="32" selection-start-column="8" selection-end-line="32" selection-end-column="8" />
|
||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
@@ -728,5 +745,12 @@
|
|||||||
</state>
|
</state>
|
||||||
</provider>
|
</provider>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/FlippR-Driver/src/output/items/DriverBoardItem.h">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state relative-caret-position="72">
|
||||||
|
<caret line="6" selection-start-line="6" selection-end-line="6" />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -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} cli/OutputInterpreter.cpp cli/OutputInterpreter.h)
|
add_library(${PROJECT_NAME} STATIC ${SOURCES} cli/OutputInterpreter.cpp cli/OutputInterpreter.h src/output/items/detail/DriverBoardItem.cpp src/output/items/detail/DriverBoardItem.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)
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"displays" :
|
"displays" :
|
||||||
[
|
[
|
||||||
|
// todo add name!
|
||||||
{
|
{
|
||||||
"digits" : 8,
|
"digits" : 8,
|
||||||
"id" : 1,
|
"id" : 1,
|
||||||
"address" : 1
|
"address" : 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
"run" : 0
|
"run" : 0
|
||||||
},
|
},
|
||||||
"driver_board" :
|
"driver_board" :
|
||||||
{
|
{ // todo new layout!
|
||||||
"i2c_address" : 32,
|
"i2c_address" : 32,
|
||||||
"pin_base" : 65,
|
"pin_base" : 65,
|
||||||
"pin-select" :
|
"pin-select" :
|
||||||
|
|||||||
@@ -3,57 +3,57 @@
|
|||||||
"solenoids" :
|
"solenoids" :
|
||||||
[
|
[
|
||||||
{ // todo is this solenoid?
|
{ // todo is this solenoid?
|
||||||
"address" : 68,
|
"address" : 61,
|
||||||
"name" : "Flipper Relay"
|
"name" : "Flipper Relay"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 88,
|
"address" : 79,
|
||||||
"name" : "Out Hole",
|
"name" : "Out Hole",
|
||||||
"deactivation_time_milliseconds" : 15
|
"deactivation_time_milliseconds" : 15
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 91,
|
"address" : 82,
|
||||||
"name" : "Bottom Right Pop"
|
"name" : "Bottom Right Pop"
|
||||||
},
|
},
|
||||||
{ // todo
|
{ // todo
|
||||||
"address" : 100,
|
"address" : 91,
|
||||||
"name" : "Top Flipper Relay"
|
"name" : "Top Flipper Relay"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 101,
|
"address" : 92,
|
||||||
"name" : "Right Kicker"
|
"name" : "Right Kicker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 103,
|
"address" : 94,
|
||||||
"name" : "Top Central Bank"
|
"name" : "Top Central Bank"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 104,
|
"address" : 95,
|
||||||
"name" : "Coin Mechanism Coil"
|
"name" : "Coin Mechanism Coil"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 105,
|
"address" : 96,
|
||||||
"name" : "Top Left Pop"
|
"name" : "Top Left Pop"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 106,
|
"address" : 97,
|
||||||
"name" : "Bottom Right Bank"
|
"name" : "Bottom Right Bank"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 107,
|
"address" : 98,
|
||||||
"name" : "Bottom Left Bank"
|
"name" : "Bottom Left Bank"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 108,
|
"address" : 99,
|
||||||
"name" : "Knocker"
|
"name" : "Knocker"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 109,
|
"address" : 100,
|
||||||
"name" : "Right Flap"
|
"name" : "Right Flap"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"address" : 110,
|
"address" : 101,
|
||||||
"name" : "Left Flap"
|
"name" : "Left Flap"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#ifndef FLIPPR_DRIVER_OUTPUT_ITEMS_DISPLAY_H_
|
#ifndef FLIPPR_DRIVER_OUTPUT_ITEMS_DISPLAY_H_
|
||||||
#define FLIPPR_DRIVER_OUTPUT_ITEMS_DISPLAY_H_
|
#define FLIPPR_DRIVER_OUTPUT_ITEMS_DISPLAY_H_
|
||||||
|
|
||||||
#include <iosfwd>
|
#include <iosfwd> // todo wtf?
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#ifndef _SRC_OUTPUT_ICABINETITEM_H_
|
#ifndef _SRC_OUTPUT_ICABINETITEM_H_
|
||||||
#define _SRC_OUTPUT_ICABINETITEM_H_
|
#define _SRC_OUTPUT_ICABINETITEM_H_
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
@@ -23,7 +22,6 @@ class Item
|
|||||||
public:
|
public:
|
||||||
virtual ~Item() = default;
|
virtual ~Item() = default;
|
||||||
|
|
||||||
virtual uint8_t get_address() const = 0;
|
|
||||||
virtual std::string get_name() const = 0;
|
virtual std::string get_name() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -8,6 +8,8 @@
|
|||||||
#ifndef _SRC_OUTPUT_ILAMP_H_
|
#ifndef _SRC_OUTPUT_ILAMP_H_
|
||||||
#define _SRC_OUTPUT_ILAMP_H_
|
#define _SRC_OUTPUT_ILAMP_H_
|
||||||
|
|
||||||
|
#include "Item.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
@@ -15,7 +17,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
class Lamp
|
class Lamp : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Lamp() = default;
|
virtual ~Lamp() = default;
|
||||||
|
|||||||
@@ -9,14 +9,16 @@
|
|||||||
#define _SRC_OUTPUT_ISOLENOID_H_
|
#define _SRC_OUTPUT_ISOLENOID_H_
|
||||||
|
|
||||||
|
|
||||||
|
#include "Item.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
// todo get name? parent calss output_item?
|
||||||
class Solenoid
|
class Solenoid : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Solenoid() = default;
|
virtual ~Solenoid() = default;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#ifndef _SRC_OUTPUT_ISOUND_H_
|
#ifndef _SRC_OUTPUT_ISOUND_H_
|
||||||
#define _SRC_OUTPUT_ISOUND_H_
|
#define _SRC_OUTPUT_ISOUND_H_
|
||||||
|
|
||||||
|
#include "Item.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
@@ -15,7 +17,7 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
class Sound
|
class Sound : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Sound() = default;
|
virtual ~Sound() = default;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#ifndef FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
#ifndef FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
||||||
#define FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
#define FLIPPR_DRIVER_DRIVERBOARDPINCONTROLLER_H
|
||||||
|
|
||||||
|
#include "OutputPinController.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
@@ -16,13 +17,11 @@ namespace items
|
|||||||
class DriverBoardItem;
|
class DriverBoardItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DriverBoardPinController
|
class DriverBoardPinController : public OutputPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~DriverBoardPinController() = default;
|
virtual ~DriverBoardPinController() = default;
|
||||||
|
|
||||||
virtual void activate(items::DriverBoardItem &driver_board_item) = 0;
|
|
||||||
virtual void deactivate(items::DriverBoardItem &driver_board_item) = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,19 @@ namespace flippR_driver
|
|||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
|
namespace items
|
||||||
|
{
|
||||||
|
class DriverBoardItem;
|
||||||
|
}
|
||||||
class OutputPinController : public PinController
|
class OutputPinController : public PinController
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~OutputPinController() = default;
|
virtual ~OutputPinController() = default;
|
||||||
|
|
||||||
|
virtual void activate(items::DriverBoardItem &driver_board_item) = 0;
|
||||||
|
virtual void deactivate(items::DriverBoardItem &driver_board_item) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void initialize_i2c_address(uint8_t i2c_address, uint8_t pin_base);
|
static void initialize_i2c_address(uint8_t i2c_address, uint8_t pin_base);
|
||||||
static void initialize_pins_output(uint8_t pin_base, std::map<std::string, uint8_t>::iterator begin, std::map<std::string, uint8_t>::iterator end);
|
static void initialize_pins_output(uint8_t pin_base, std::map<std::string, uint8_t>::iterator begin, std::map<std::string, uint8_t>::iterator end);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#ifndef FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
#ifndef FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
||||||
#define FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
#define FLIPPR_DRIVER_OUTPUT_SOUNDBOARDPINCONTROLLER_H
|
||||||
|
|
||||||
|
#include "output/OutputPinController.h"
|
||||||
#include "output/items/detail/Sound.h"
|
#include "output/items/detail/Sound.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
@@ -12,13 +13,16 @@ namespace flippR_driver
|
|||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace items
|
namespace items // todo include + fw decl??
|
||||||
{
|
{
|
||||||
class Sound;
|
class Sound;
|
||||||
}
|
}
|
||||||
class SoundBoardPinController
|
class SoundBoardPinController : public OutputPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
virtual void deactivate(items::DriverBoardItem &driver_board_item) = 0;
|
||||||
|
|
||||||
virtual void activate(const items::detail::Sound &sound) = 0;
|
virtual void activate(const items::detail::Sound &sound) = 0;
|
||||||
virtual void deactivate(const items::detail::Sound &sound) = 0;
|
virtual void deactivate(const items::detail::Sound &sound) = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ void DriverBoardPinController::deactivate(items::DriverBoardItem &driver_board_i
|
|||||||
write_data(false);
|
write_data(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo new layout without mux!
|
||||||
|
|
||||||
void DriverBoardPinController::write_driver_board_address(uint8_t address) const
|
void DriverBoardPinController::write_driver_board_address(uint8_t address) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace output
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class DriverBoardPinController : public OutputPinController, public output::DriverBoardPinController
|
class DriverBoardPinController : public output::DriverBoardPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DriverBoardPinController(std::map<std::string, uint8_t> pins_driver_board, std::shared_ptr<std::mutex> output_item_mutex);
|
DriverBoardPinController(std::map<std::string, uint8_t> pins_driver_board, std::shared_ptr<std::mutex> output_item_mutex);
|
||||||
|
|||||||
@@ -32,10 +32,15 @@ public:
|
|||||||
void activate_displays() const override;
|
void activate_displays() const override;
|
||||||
void deactivate_displays() const override;
|
void deactivate_displays() const override;
|
||||||
|
|
||||||
void deactivate_all_lamps() const override;
|
|
||||||
void activate_all_lamps() const override;
|
void activate_all_lamps() const override;
|
||||||
|
void deactivate_all_lamps() const override;
|
||||||
void rotate_all_lamps() const override;
|
void rotate_all_lamps() const override;
|
||||||
|
|
||||||
|
void activate_flipper_relay();
|
||||||
|
void activate_top_flipper_relay();
|
||||||
|
void deactivate_flipper_relay();
|
||||||
|
void deactivate_top_flipper_relay();
|
||||||
|
|
||||||
// todo driver board run for activate/deactivate?
|
// todo driver board run for activate/deactivate?
|
||||||
// todo what is flipper_relay ?
|
// todo what is flipper_relay ?
|
||||||
std::vector<std::shared_ptr<items::Lamp>> get_lamps() const override;
|
std::vector<std::shared_ptr<items::Lamp>> get_lamps() const override;
|
||||||
|
|||||||
@@ -18,14 +18,15 @@ namespace output
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class SoundBoardPinController : public OutputPinController, public output::SoundBoardPinController
|
class SoundBoardPinController : public output::SoundBoardPinController
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SoundBoardPinController(std::map<std::string, uint8_t> pins_sound, std::shared_ptr<std::mutex> output_item_mutex);
|
SoundBoardPinController(std::map<std::string, uint8_t> pins_sound, std::shared_ptr<std::mutex> output_item_mutex);
|
||||||
~SoundBoardPinController() override = default;
|
~SoundBoardPinController() override = default;
|
||||||
|
|
||||||
void activate(const items::detail::Sound &sound) override;
|
|
||||||
void deactivate(const items::detail::Sound &sound) override;
|
void activate(const items::detail::Sound &sound);
|
||||||
|
void deactivate(const items::detail::Sound &sound);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void write_sound_address(uint8_t address) const;
|
void write_sound_address(uint8_t address) const;
|
||||||
|
|||||||
@@ -18,16 +18,12 @@ namespace output
|
|||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
|
|
||||||
class DriverBoardItem : public detail::Item
|
class DriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DriverBoardItem(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
virtual ~DriverBoardItem() = default;
|
||||||
pin_controller(std::move(pin_controller)), detail::Item(address, std::move(name)) {}
|
|
||||||
|
|
||||||
~DriverBoardItem() override = default;
|
virtual uint8_t get_address() const = 0;
|
||||||
|
|
||||||
protected:
|
|
||||||
const std::shared_ptr<DriverBoardPinController> pin_controller;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
16
FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp
Normal file
16
FlippR-Driver/src/output/items/detail/DriverBoardItem.cpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// Created by rhetenor on 5/6/19.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "DriverBoardItem.h"
|
||||||
|
|
||||||
|
using namespace flippR_driver::output;
|
||||||
|
|
||||||
|
items::detail::DriverBoardItem::DriverBoardItem(std::shared_ptr<OutputPinController> pin_controller, const uint8_t address) :
|
||||||
|
pin_controller(std::move(pin_controller)), address(address)
|
||||||
|
{}
|
||||||
|
|
||||||
|
uint8_t items::detail::DriverBoardItem::get_address() const
|
||||||
|
{
|
||||||
|
return this->address;
|
||||||
|
}
|
||||||
43
FlippR-Driver/src/output/items/detail/DriverBoardItem.h
Normal file
43
FlippR-Driver/src/output/items/detail/DriverBoardItem.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
//
|
||||||
|
// Created by rhetenor on 5/6/19.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef FLIPPR_DRIVER_DRIVERBOARDITEM_H
|
||||||
|
#define FLIPPR_DRIVER_DRIVERBOARDITEM_H
|
||||||
|
|
||||||
|
#include "output/items/DriverBoardItem.h"
|
||||||
|
|
||||||
|
#include "output/OutputPinController.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
namespace flippR_driver
|
||||||
|
{
|
||||||
|
namespace output
|
||||||
|
{
|
||||||
|
namespace items
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
class DriverBoardItem : public output::items::DriverBoardItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DriverBoardItem(std::shared_ptr<OutputPinController> pin_controller, const uint8_t address);
|
||||||
|
|
||||||
|
~DriverBoardItem() override = default;
|
||||||
|
|
||||||
|
uint8_t get_address() const override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
const uint8_t address;
|
||||||
|
|
||||||
|
const std::shared_ptr<OutputPinController> pin_controller;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //FLIPPR_DRIVER_DRIVERBOARDITEM_H
|
||||||
@@ -25,14 +25,12 @@ namespace detail
|
|||||||
class Item : public items::Item
|
class Item : public items::Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Item(uint8_t address, std::string name);
|
Item(std::string name);
|
||||||
~Item() override = default;
|
~Item() override = default;
|
||||||
|
|
||||||
uint8_t get_address() const override;
|
|
||||||
std::string get_name() const override;
|
std::string get_name() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t address;
|
|
||||||
const std::string name;
|
const std::string name;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "Lamp.h"
|
#include "Lamp.h"
|
||||||
|
|
||||||
|
#include <output/DriverBoardPinController.h>
|
||||||
#include "utility/config.h"
|
#include "utility/config.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
@@ -19,7 +20,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
|
|
||||||
Lamp::Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
Lamp::Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name) :
|
||||||
DriverBoardItem(std::move(pin_controller), address, std::move(name)), activated(false)
|
detail::Item(std::move(name)), DriverBoardItem(std::move(pin_controller), address), activated(false)
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Created lamp " << name << " with address " << address;
|
CLOG(INFO, OUTPUT_LOGGER) << "Created lamp " << name << " with address " << address;
|
||||||
}
|
}
|
||||||
@@ -27,13 +28,13 @@ DriverBoardItem(std::move(pin_controller), address, std::move(name)), activated(
|
|||||||
void Lamp::activate()
|
void Lamp::activate()
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Activate lamp " << name;
|
CLOG(INFO, OUTPUT_LOGGER) << "Activate lamp " << name;
|
||||||
pin_controller->activate(*this);
|
this->pin_controller->activate(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lamp::deactivate()
|
void Lamp::deactivate()
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Deactivate lamp " << name;
|
CLOG(INFO, OUTPUT_LOGGER) << "Deactivate lamp " << name;
|
||||||
pin_controller->deactivate(*this);
|
this->pin_controller->deactivate(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lamp::is_activated()
|
bool Lamp::is_activated()
|
||||||
|
|||||||
@@ -9,18 +9,22 @@
|
|||||||
#define _SRC_OUTPUT_LAMP_H_
|
#define _SRC_OUTPUT_LAMP_H_
|
||||||
|
|
||||||
#include "output/items/Lamp.h"
|
#include "output/items/Lamp.h"
|
||||||
#include "output/items/DriverBoardItem.h"
|
#include "output/items/detail/Item.h"
|
||||||
|
#include "output/items/detail/DriverBoardItem.h"
|
||||||
|
|
||||||
namespace flippR_driver
|
namespace flippR_driver
|
||||||
{
|
{
|
||||||
namespace output
|
namespace output
|
||||||
{
|
{
|
||||||
|
|
||||||
|
class DriverBoardPinController;
|
||||||
|
|
||||||
namespace items
|
namespace items
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class Lamp : public DriverBoardItem, public items::Lamp
|
class Lamp : public detail::DriverBoardItem, public detail::Item, public items::Lamp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name);
|
Lamp(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name);
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
|
|
||||||
Solenoid::Solenoid(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time)
|
Solenoid::Solenoid(std::shared_ptr<DriverBoardPinController> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time)
|
||||||
:
|
: detail::Item(std::move(name)), DriverBoardItem(std::move(pin_controller), address), deactivation_time(deactivation_time)
|
||||||
DriverBoardItem(std::move(pin_controller), address, std::move(name)), deactivation_time(deactivation_time)
|
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Created solenoid " << name << " with address " << address;
|
CLOG(INFO, OUTPUT_LOGGER) << "Created solenoid " << name << " with address " << address;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
#define _SRC_OUTPUT_SOLENOID_H_
|
#define _SRC_OUTPUT_SOLENOID_H_
|
||||||
|
|
||||||
#include "output/items/Solenoid.h"
|
#include "output/items/Solenoid.h"
|
||||||
#include "output/items/DriverBoardItem.h"
|
#include "output/items/detail/Item.h"
|
||||||
|
#include "output/items/detail/DriverBoardItem.h"
|
||||||
|
|
||||||
|
#include "output/DriverBoardPinController.h"
|
||||||
|
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -23,7 +26,7 @@ namespace items
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class Solenoid : public DriverBoardItem, public items::Solenoid
|
class Solenoid : public DriverBoardItem, public detail::Item, public items::Solenoid
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Solenoid(std::shared_ptr<DriverBoardPinController> pin_controller, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
Solenoid(std::shared_ptr<DriverBoardPinController> pin_controller, u_int8_t address, std::string name, std::chrono::milliseconds deactivation_time);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace detail
|
|||||||
|
|
||||||
Sound::Sound(std::shared_ptr<SoundBoardPinController> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id)
|
Sound::Sound(std::shared_ptr<SoundBoardPinController> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id)
|
||||||
:
|
:
|
||||||
pin_controller(std::move(pin_controller)), Item(address, std::move(name)), deactivation_time(deactivation_time), id(id)
|
pin_controller(std::move(pin_controller)), detail::Item(std::move(name)), DriverBoardItem(pin_controller, address), deactivation_time(deactivation_time), id(id)
|
||||||
{
|
{
|
||||||
CLOG(INFO, OUTPUT_LOGGER) << "Created sound " << id << " with name " << name << " and address " << address;
|
CLOG(INFO, OUTPUT_LOGGER) << "Created sound " << id << " with name " << name << " and address " << address;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "output/items/Sound.h"
|
#include "output/items/Sound.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
#include "DriverBoardItem.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -28,7 +29,7 @@ namespace items
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|
||||||
class Sound : public Item, public items::Sound
|
class Sound : public detail::Item, public items::Sound, public detail::DriverBoardItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
u_int id;
|
u_int id;
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 27.11.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "SocketHandler.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace utility
|
|
||||||
{
|
|
||||||
//using namespace nlohmann;
|
|
||||||
|
|
||||||
SocketHandler::SocketHandler(std::string socket_file)
|
|
||||||
{
|
|
||||||
//this->socket.connect(socket_file);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
SocketHandler::create_client(const std::string& socket_file)
|
|
||||||
{
|
|
||||||
this->socket.connect(socket_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
SocketHandler::create_server(const std::string& socket_file)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SocketHandler::write_to_socket(json &json)
|
|
||||||
{
|
|
||||||
std::string json_data = json.dump();
|
|
||||||
|
|
||||||
boost::asio::write(this->socket, boost::asio::buffer(json_data, json_data.length()));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 27.11.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef FLIPPR_DRIVER_SOCKETHANDLER_H
|
|
||||||
#define FLIPPR_DRIVER_SOCKETHANDLER_H
|
|
||||||
|
|
||||||
#include <Poco/Net/Socket.h>
|
|
||||||
#include <Poco/JSON/JSON.h>
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace utility
|
|
||||||
{
|
|
||||||
class SocketHandler
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SocketHandler(std::string socket_file);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
Poco::Net::Socket socket;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void write_to_socket(std::string &data);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif //FLIPPR_DRIVER_SOCKETHANDLER_H
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
* Detector.h
|
|
||||||
*
|
|
||||||
* Created on: Jun 13, 2018
|
|
||||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "TcpServer.h"
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Detector.h
|
|
||||||
*
|
|
||||||
* Created on: Jun 13, 2018
|
|
||||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef FLIPPR_CODE_TCPSERVER_H
|
|
||||||
#define FLIPPR_CODE_TCPSERVER_H
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace utility
|
|
||||||
{
|
|
||||||
namespace networking
|
|
||||||
{
|
|
||||||
namespace input
|
|
||||||
{
|
|
||||||
|
|
||||||
class TcpServer
|
|
||||||
{
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //FLIPPR_CODE_TCPSERVER_H
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 11.12.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "OutputSocketHandler.h"
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
//
|
|
||||||
// Created by rhetenor on 11.12.18.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
|
||||||
#define FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
|
||||||
|
|
||||||
#include "utility/SocketHandler.h"
|
|
||||||
#include "output/OutputDriver.h"
|
|
||||||
|
|
||||||
namespace flippR_driver
|
|
||||||
{
|
|
||||||
namespace utility
|
|
||||||
{
|
|
||||||
|
|
||||||
class OutputSocketHandler : public SocketHandler
|
|
||||||
{
|
|
||||||
|
|
||||||
OutputSocketHandler(std::unique_ptr<output::OutputDriver> output_driver);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
|
||||||
@@ -31,8 +31,8 @@ SCENARIO("The OutputDriver should (de)activates the displays")
|
|||||||
GIVEN("An OutputDriver")
|
GIVEN("An OutputDriver")
|
||||||
{
|
{
|
||||||
Mock<output::DisplayController> display_controller;
|
Mock<output::DisplayController> display_controller;
|
||||||
When(Method(display_controller, activate_displays)).AlwaysReturn();
|
Fake(Method(display_controller, activate_displays));
|
||||||
When(Method(display_controller, deactivate_displays)).AlwaysReturn();
|
Fake(Method(display_controller, deactivate_displays));
|
||||||
|
|
||||||
std::map<std::string, std::shared_ptr<items::Solenoid>> solenoids;
|
std::map<std::string, std::shared_ptr<items::Solenoid>> solenoids;
|
||||||
std::map<std::string, std::shared_ptr<items::Lamp>> lamps;
|
std::map<std::string, std::shared_ptr<items::Lamp>> lamps;
|
||||||
@@ -61,3 +61,17 @@ SCENARIO("The OutputDriver should (de)activates the displays")
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SCENARIO("The OutputDriver should return a list of all items")
|
||||||
|
{
|
||||||
|
GIVEN("An OutputDriver with some items")
|
||||||
|
{
|
||||||
|
Mock<output::DisplayController> display_controller;
|
||||||
|
|
||||||
|
std::map<std::string, std::shared_ptr<items::Solenoid>> solenoids;
|
||||||
|
std::map<std::string, std::shared_ptr<items::Lamp>> lamps;
|
||||||
|
std::map<std::string, std::shared_ptr<items::Sound>> sounds;
|
||||||
|
std::map<uint8_t, std::shared_ptr<output::items::Display>> displays;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user