Skip to content

Commit ca90777

Browse files
committed
convenience changes
1 parent 7095a5c commit ca90777

File tree

20 files changed

+263
-41
lines changed

20 files changed

+263
-41
lines changed

.github/workflows/cpp-ci-serial-programs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
run: |
6363
del SerialPrograms/bin/RelWithDebInfo/SerialProgramsLib.lib
6464
echo https://github.com/${{github.repository}}/commit/${{github.sha}} > SerialPrograms/bin/RelWithDebInfo/version.txt
65+
copy binding.txt SerialPrograms/bin/RelWithDebInfo/binding.txt
66+
copy SWITCH1.JSON SerialPrograms/bin/RelWithDebInfo/SWITCH1.JSON
67+
copy SWITCH2.JSON SerialPrograms/bin/RelWithDebInfo/SWITCH2.JSON
68+
copy SWITCH3.JSON SerialPrograms/bin/RelWithDebInfo/SWITCH3.JSON
6569
- uses: actions/upload-artifact@v4
6670
if: startsWith(matrix.os, 'windows')
6771
with:

Common/Cpp/Options/KeyboardLayoutOption.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ KeyboardLayoutOption::~KeyboardLayoutOption() = default;
1616
KeyboardLayoutOption::KeyboardLayoutOption(
1717
std::string label,
1818
LockMode lock_while_running,
19-
KeyboardLayout default_value
19+
[[maybe_unused]] KeyboardLayout default_value
2020
)
2121
: EnumDropdownOption<KeyboardLayout>(
2222
std::move(label),
@@ -25,7 +25,7 @@ KeyboardLayoutOption::KeyboardLayoutOption(
2525
{KeyboardLayout::AZERTY, "azerty", "AZERTY"},
2626
},
2727
lock_while_running,
28-
default_value
28+
KeyboardLayout::AZERTY
2929
)
3030
{}
3131

SWITCH1.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{0f6db325-d18b-4aed-98ee-6a1a992015f4}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM5"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2bc279a3&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SWITCH2.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{28323704-5993-4af4-b3d5-1ca360590e93}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM8"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2aeecc7b&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SWITCH3.JSON

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Audio": {
3+
"AudioVisualization": "FREQ_BARS",
4+
"InputDevice": "{0.0.1.00000000}.{06dd0a26-59ea-4728-b42f-f38d1d87eb85}",
5+
"InputFile": "",
6+
"InputFormat": "1 x 96,000 Hz (Interleaved Stereo L/R)",
7+
"OutputDevice": "",
8+
"Volume": 1.0
9+
},
10+
"ConsoleType": "switch1",
11+
"Controller": {
12+
"Interface": "Serial: PABotBase",
13+
"Serial: PABotBase": "COM7"
14+
},
15+
"Overlay": {
16+
"Boxes": true,
17+
"Images": false,
18+
"Log": false,
19+
"Stats": true,
20+
"Text": true
21+
},
22+
"Video": {
23+
"Camera": "\\\\?\\usb#vid_298f&pid_1996&mi_00#7&20db319&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global",
24+
"Resolution": [
25+
1920,
26+
1080
27+
],
28+
"SourceType": "Camera"
29+
}
30+
}

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ void PreloadSettings::load(const JsonValue& json){
6969
return;
7070
}
7171

72-
// Naughty mode.
73-
obj->read_boolean(NAUGHTY_MODE, "NAUGHTY_MODE");
74-
75-
// Developer mode stuff.
76-
const std::string* dev_token = obj->get_string("DEVELOPER_TOKEN");
77-
if (dev_token){
78-
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
79-
#if QT_VERSION < 0x060700
80-
hash.addData(dev_token->c_str(), (int)dev_token->size());
81-
#else
82-
QByteArrayView dataView(dev_token->data(), dev_token->size());
83-
hash.addData(dataView);
84-
#endif
85-
DEVELOPER_MODE = TOKENS.find(hash.result().toHex().toStdString()) != TOKENS.end();
86-
}
87-
8872
const JsonObject* debug_obj = obj->get_object("DEBUG");
8973
if (debug_obj){
9074
debug_obj->read_boolean(DEBUG.COLOR_CHECK, "COLOR_CHECK");

SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class PreloadSettings{
6969

7070
void load(const JsonValue& json);
7171

72-
bool NAUGHTY_MODE = false;
73-
bool DEVELOPER_MODE = false;
72+
bool NAUGHTY_MODE = true;
73+
bool DEVELOPER_MODE = true;
7474

7575
DebugSettings DEBUG;
7676
};

SerialPrograms/Source/CommonFramework/Notifications/EventNotificationOption.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ EventNotificationOption::~EventNotificationOption(){}
176176
EventNotificationOption::EventNotificationOption(
177177
std::string label,
178178
bool enabled, bool ping,
179-
std::chrono::seconds rate_limit
179+
[[maybe_unused]] std::chrono::seconds rate_limit
180180
)
181181
: StaticTableRow(label)
182-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, rate_limit)
182+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::chrono::seconds(0))
183183
, m_test_button(*this)
184184
{
185185
add_option(m_data->m_enabled, "Enabled");
@@ -196,10 +196,10 @@ EventNotificationOption::EventNotificationOption(
196196
std::string label,
197197
bool enabled, bool ping,
198198
std::vector<std::string> tags,
199-
std::chrono::seconds rate_limit
199+
[[maybe_unused]] std::chrono::seconds rate_limit
200200
)
201201
: StaticTableRow(label)
202-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), rate_limit)
202+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, std::move(tags), std::chrono::seconds(0))
203203
, m_test_button(*this)
204204
{
205205
add_option(m_data->m_enabled, "Enabled");
@@ -217,10 +217,10 @@ EventNotificationOption::EventNotificationOption(
217217
bool enabled, bool ping,
218218
ImageAttachmentMode screenshot,
219219
std::vector<std::string> tags,
220-
std::chrono::seconds rate_limit
220+
[[maybe_unused]] std::chrono::seconds rate_limit
221221
)
222222
: StaticTableRow(label)
223-
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), rate_limit)
223+
, m_data(CONSTRUCT_TOKEN, std::move(label), enabled, ping, screenshot, std::move(tags), std::chrono::seconds(0))
224224
, m_test_button(*this)
225225
{
226226
add_option(m_data->m_enabled, "Enabled");

SerialPrograms/Source/CommonFramework/VideoPipeline/Backends/CameraWidgetQt6.5.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,18 @@ std::string CameraBackend::get_camera_name(const CameraInfo& info) const{
5555
#endif
5656
for (const auto& camera : cameras){
5757
if (camera.id().toStdString() == info.device_name()){
58-
return camera.description().toStdString();
58+
QByteArray camera1 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2bc279a3&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
59+
QByteArray camera2 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&2aeecc7b&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
60+
QByteArray camera3 = QByteArray("\\\\?\\usb#vid_298f&pid_1996&mi_00#7&20db319&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\global");
61+
if (camera.id() == camera1){
62+
return "ShadowCast Video 1";
63+
}else if (camera.id() == camera2){
64+
return "ShadowCast Video 2";
65+
}else if (camera.id() == camera3){
66+
return "ShadowCast Video 3";
67+
}else{
68+
return camera.description().toStdString();
69+
}
5970
}
6071
}
6172
std::cout << "Error: no such camera for CameraInfo: " << info.device_name() << std::endl;

SerialPrograms/Source/CommonTools/Options/LanguageOCROption.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ LanguageOCRCell::LanguageOCRCell(
5151
std::forward_as_tuple(language),
5252
std::forward_as_tuple(index)
5353
);
54+
if (language == Language::French){
55+
m_default = index;
56+
m_current = index;
57+
}
5458
index++;
5559
}
5660
}

0 commit comments

Comments
 (0)