Skip to content

Commit fb5987c

Browse files
committed
Create folder for controllers and move SerialPABotBase to it.
1 parent c0a1c1f commit fb5987c

20 files changed

+1154
-1160
lines changed

SerialPrograms/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,6 @@ file(GLOB MAIN_SOURCES
281281
Source/CommonFramework/AudioPipeline/UI/AudioDisplayWidget.h
282282
Source/CommonFramework/AudioPipeline/UI/AudioSelectorWidget.cpp
283283
Source/CommonFramework/AudioPipeline/UI/AudioSelectorWidget.h
284-
Source/CommonFramework/ControllerDevices/SerialPortGlobals.h
285-
Source/CommonFramework/ControllerDevices/SerialPortOption.cpp
286-
Source/CommonFramework/ControllerDevices/SerialPortOption.h
287-
Source/CommonFramework/ControllerDevices/SerialPortSession.cpp
288-
Source/CommonFramework/ControllerDevices/SerialPortSession.h
289-
Source/CommonFramework/ControllerDevices/SerialPortWidget.cpp
290-
Source/CommonFramework/ControllerDevices/SerialPortWidget.h
291284
Source/CommonFramework/Environment/Environment.cpp
292285
Source/CommonFramework/Environment/Environment.h
293286
Source/CommonFramework/Environment/Environment_Linux.h
@@ -422,8 +415,6 @@ file(GLOB MAIN_SOURCES
422415
Source/CommonFramework/Startup/NewVersionCheck.h
423416
Source/CommonFramework/Startup/SetupSettings.cpp
424417
Source/CommonFramework/Startup/SetupSettings.h
425-
Source/CommonFramework/Tools/BotBaseHandle.cpp
426-
Source/CommonFramework/Tools/BotBaseHandle.h
427418
Source/CommonFramework/Tools/DebugDumper.cpp
428419
Source/CommonFramework/Tools/DebugDumper.h
429420
Source/CommonFramework/Tools/ErrorDumper.cpp
@@ -608,6 +599,15 @@ file(GLOB MAIN_SOURCES
608599
Source/ComputerPrograms/Framework/ComputerProgramSession.h
609600
Source/ComputerPrograms/Framework/ComputerProgramWidget.cpp
610601
Source/ComputerPrograms/Framework/ComputerProgramWidget.h
602+
Source/Controllers/SerialPABotBase/SerialPABotBase_Globals.h
603+
Source/Controllers/SerialPABotBase/SerialPABotBase_Handle.cpp
604+
Source/Controllers/SerialPABotBase/SerialPABotBase_Handle.h
605+
Source/Controllers/SerialPABotBase/SerialPABotBase_Option.cpp
606+
Source/Controllers/SerialPABotBase/SerialPABotBase_Option.h
607+
Source/Controllers/SerialPABotBase/SerialPABotBase_Session.cpp
608+
Source/Controllers/SerialPABotBase/SerialPABotBase_Session.h
609+
Source/Controllers/SerialPABotBase/SerialPABotBase_Widget.cpp
610+
Source/Controllers/SerialPABotBase/SerialPABotBase_Widget.h
611611
Source/Integrations/DiscordIntegrationSettings.cpp
612612
Source/Integrations/DiscordIntegrationSettings.h
613613
Source/Integrations/DiscordIntegrationTable.cpp

SerialPrograms/SerialPrograms.pro

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ SOURCES += \
171171
Source/CommonFramework/AudioPipeline/Tools/TimeSampleBufferReader.cpp \
172172
Source/CommonFramework/AudioPipeline/UI/AudioDisplayWidget.cpp \
173173
Source/CommonFramework/AudioPipeline/UI/AudioSelectorWidget.cpp \
174-
Source/CommonFramework/ControllerDevices/SerialPortOption.cpp \
175-
Source/CommonFramework/ControllerDevices/SerialPortSession.cpp \
176-
Source/CommonFramework/ControllerDevices/SerialPortWidget.cpp \
177174
Source/CommonFramework/Environment/Environment.cpp \
178175
Source/CommonFramework/Environment/HardwareValidation.cpp \
179176
Source/CommonFramework/Environment/SystemSleep.cpp \
@@ -229,7 +226,6 @@ SOURCES += \
229226
Source/CommonFramework/Recording/StreamRecorder.cpp \
230227
Source/CommonFramework/Startup/NewVersionCheck.cpp \
231228
Source/CommonFramework/Startup/SetupSettings.cpp \
232-
Source/CommonFramework/Tools/BotBaseHandle.cpp \
233229
Source/CommonFramework/Tools/DebugDumper.cpp \
234230
Source/CommonFramework/Tools/ErrorDumper.cpp \
235231
Source/CommonFramework/Tools/FileDownloader.cpp \
@@ -309,6 +305,10 @@ SOURCES += \
309305
Source/ComputerPrograms/Framework/ComputerProgramOption.cpp \
310306
Source/ComputerPrograms/Framework/ComputerProgramSession.cpp \
311307
Source/ComputerPrograms/Framework/ComputerProgramWidget.cpp \
308+
Source/Controllers/SerialPABotBase/SerialPABotBase_Handle.cpp \
309+
Source/Controllers/SerialPABotBase/SerialPABotBase_Option.cpp \
310+
Source/Controllers/SerialPABotBase/SerialPABotBase_Session.cpp \
311+
Source/Controllers/SerialPABotBase/SerialPABotBase_Widget.cpp \
312312
Source/Integrations/DiscordIntegrationSettings.cpp \
313313
Source/Integrations/DiscordIntegrationTable.cpp \
314314
Source/Integrations/DiscordSettingsOption.cpp \
@@ -1240,10 +1240,6 @@ HEADERS += \
12401240
Source/CommonFramework/AudioPipeline/Tools/TimeSampleWriter.h \
12411241
Source/CommonFramework/AudioPipeline/UI/AudioDisplayWidget.h \
12421242
Source/CommonFramework/AudioPipeline/UI/AudioSelectorWidget.h \
1243-
Source/CommonFramework/ControllerDevices/SerialPortGlobals.h \
1244-
Source/CommonFramework/ControllerDevices/SerialPortOption.h \
1245-
Source/CommonFramework/ControllerDevices/SerialPortSession.h \
1246-
Source/CommonFramework/ControllerDevices/SerialPortWidget.h \
12471243
Source/CommonFramework/Environment/Environment.h \
12481244
Source/CommonFramework/Environment/Environment_Linux.h \
12491245
Source/CommonFramework/Environment/Environment_Linux.tpp \
@@ -1320,7 +1316,6 @@ HEADERS += \
13201316
Source/CommonFramework/Recording/StreamRecorder.h \
13211317
Source/CommonFramework/Startup/NewVersionCheck.h \
13221318
Source/CommonFramework/Startup/SetupSettings.h \
1323-
Source/CommonFramework/Tools/BotBaseHandle.h \
13241319
Source/CommonFramework/Tools/DebugDumper.h \
13251320
Source/CommonFramework/Tools/ErrorDumper.h \
13261321
Source/CommonFramework/Tools/FileDownloader.h \
@@ -1420,6 +1415,11 @@ HEADERS += \
14201415
Source/ComputerPrograms/Framework/ComputerProgramOption.h \
14211416
Source/ComputerPrograms/Framework/ComputerProgramSession.h \
14221417
Source/ComputerPrograms/Framework/ComputerProgramWidget.h \
1418+
Source/Controllers/SerialPABotBase/SerialPABotBase_Globals.h \
1419+
Source/Controllers/SerialPABotBase/SerialPABotBase_Handle.h \
1420+
Source/Controllers/SerialPABotBase/SerialPABotBase_Option.h \
1421+
Source/Controllers/SerialPABotBase/SerialPABotBase_Session.h \
1422+
Source/Controllers/SerialPABotBase/SerialPABotBase_Widget.h \
14231423
Source/Integrations/DiscordIntegrationSettings.h \
14241424
Source/Integrations/DiscordIntegrationTable.h \
14251425
Source/Integrations/DiscordSettingsOption.h \

SerialPrograms/Source/CommonFramework/Panels/UI/PanelElements.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <QLabel>
1212
#include "Common/Qt/CollapsibleGroupBox.h"
1313
#include "CommonFramework/Globals.h"
14-
#include "CommonFramework/ControllerDevices/SerialPortGlobals.h"
14+
#include "Controllers/SerialPABotBase/SerialPABotBase_Globals.h"
1515

1616
class QPushButton;
1717

SerialPrograms/Source/CommonFramework/ControllerDevices/SerialPortGlobals.h renamed to SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_Globals.h

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
/* Serial Port Globals
2-
*
3-
* From: https://github.com/PokemonAutomation/Arduino-Source
4-
*
5-
*/
6-
7-
#ifndef PokemonAutomation_CommonFramework_SerialPortGlobals_H
8-
#define PokemonAutomation_CommonFramework_SerialPortGlobals_H
9-
10-
#include <stdint.h>
11-
#include "Common/PokemonSwSh/PokemonProgramIDs.h"
12-
13-
namespace PokemonAutomation{
14-
15-
16-
enum class AllowCommandsWhenRunning{
17-
DISABLE_COMMANDS,
18-
ENABLE_COMMANDS,
19-
};
20-
21-
22-
enum class PABotBaseLevel{
23-
NOT_PABOTBASE = 0,
24-
PABOTBASE_12KB = 1,
25-
PABOTBASE_31KB = 2,
26-
};
27-
28-
29-
inline PABotBaseLevel program_id_to_botbase_level(uint8_t id){
30-
switch (id){
31-
case PABB_PID_PABOTBASE_12KB:
32-
return PABotBaseLevel::PABOTBASE_12KB;
33-
case PABB_PID_PABOTBASE_31KB:
34-
return PABotBaseLevel::PABOTBASE_31KB;
35-
}
36-
return PABotBaseLevel::NOT_PABOTBASE;
37-
}
38-
39-
40-
41-
}
42-
#endif
1+
/* Serial Port (PABotBase) Globals
2+
*
3+
* From: https://github.com/PokemonAutomation/Arduino-Source
4+
*
5+
*/
6+
7+
#ifndef PokemonAutomation_Controllers_SerialPABotBase_Globals_H
8+
#define PokemonAutomation_Controllers_SerialPABotBase_Globals_H
9+
10+
#include <stdint.h>
11+
#include "Common/PokemonSwSh/PokemonProgramIDs.h"
12+
13+
namespace PokemonAutomation{
14+
15+
16+
enum class AllowCommandsWhenRunning{
17+
DISABLE_COMMANDS,
18+
ENABLE_COMMANDS,
19+
};
20+
21+
22+
enum class PABotBaseLevel{
23+
NOT_PABOTBASE = 0,
24+
PABOTBASE_12KB = 1,
25+
PABOTBASE_31KB = 2,
26+
};
27+
28+
29+
inline PABotBaseLevel program_id_to_botbase_level(uint8_t id){
30+
switch (id){
31+
case PABB_PID_PABOTBASE_12KB:
32+
return PABotBaseLevel::PABOTBASE_12KB;
33+
case PABB_PID_PABOTBASE_31KB:
34+
return PABotBaseLevel::PABOTBASE_31KB;
35+
}
36+
return PABotBaseLevel::NOT_PABOTBASE;
37+
}
38+
39+
40+
41+
}
42+
#endif

0 commit comments

Comments
 (0)