Skip to content

Commit 66c6912

Browse files
authored
Merge pull request #649 from PokemonAutomation/main
Rebase with master.
2 parents f093997 + bb46c90 commit 66c6912

File tree

1,214 files changed

+310448
-306583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,214 files changed

+310448
-306583
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -text
Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,70 @@
1-
name: C++ CI Serial Programs
2-
3-
on: [push, pull_request, workflow_dispatch]
4-
5-
jobs:
6-
build:
7-
runs-on: ${{ matrix.os }}
8-
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
os: [windows-2025, macos-13, ubuntu-24.04]
13-
qt_version: ['6.9.0']
14-
include:
15-
- qt_version: '6.9.0'
16-
qt_version_major: '6'
17-
qt_modules: 'qtmultimedia qtserialport'
18-
19-
steps:
20-
- uses: actions/checkout@v4
21-
with:
22-
path: Arduino-Source
23-
- uses: actions/checkout@v4
24-
with:
25-
repository: 'PokemonAutomation/Packages'
26-
path: Packages
27-
- name: Install dependencies
28-
if: startsWith(matrix.os, 'ubuntu')
29-
run: |
30-
sudo apt update
31-
sudo apt install libopencv-dev
32-
- name: Install dependencies
33-
if: startsWith(matrix.os, 'mac')
34-
run: |
35-
brew install opencv onnxruntime
36-
- uses: jurplel/install-qt-action@v4
37-
with:
38-
version: ${{ matrix.qt_version }}
39-
modules: ${{ matrix.qt_modules }}
40-
- name: Generate binaries
41-
run: |
42-
cd Arduino-Source/SerialPrograms
43-
mkdir bin
44-
cd bin
45-
cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }}
46-
cmake --build . --config Release --parallel 10
47-
- name: Copy resources
48-
if: startsWith(matrix.os, 'windows')
49-
run: |
50-
robocopy Packages/SerialPrograms/Resources Output/Resources /s
51-
robocopy Packages/PABotBase/PABotBase-Switch Output/PABotBase /s
52-
robocopy Arduino-Source/SerialPrograms/bin Output/Binaries *.dll
53-
robocopy Arduino-Source/SerialPrograms/bin/Release Output/Binaries SerialPrograms.exe
54-
echo https://github.com/${{github.repository}}/commit/${{github.sha}} > Output/version.txt
55-
write-host "Robocopy exited with exit code:" $lastexitcode
56-
if ($lastexitcode -eq 1)
57-
{
58-
exit 0
59-
}
60-
else
61-
{
62-
exit 1
63-
}
64-
- uses: actions/upload-artifact@v4
65-
if: startsWith(matrix.os, 'windows')
66-
with:
67-
name: Serial Programs for windows (${{ matrix.qt_version }})
68-
path: Output
1+
name: C++ CI Serial Programs
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [windows-2025, macos-13, ubuntu-24.04]
13+
qt_version: ['6.9.1']
14+
include:
15+
- qt_version: '6.9.1'
16+
qt_version_major: '6'
17+
qt_modules: 'qtmultimedia qtserialport'
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
path: Arduino-Source
23+
submodules: 'recursive'
24+
- uses: actions/checkout@v4
25+
with:
26+
repository: 'PokemonAutomation/Packages'
27+
path: Packages
28+
- uses: jurplel/install-qt-action@v4
29+
with:
30+
version: ${{ matrix.qt_version }}
31+
modules: ${{ matrix.qt_modules }}
32+
- name: Install dependencies
33+
if: startsWith(matrix.os, 'ubuntu')
34+
run: |
35+
sudo apt update
36+
sudo apt upgrade
37+
sudo apt install libopencv-dev
38+
- name: Install dependencies
39+
if: startsWith(matrix.os, 'mac')
40+
run: |
41+
brew install opencv onnxruntime
42+
- name: Generate binaries
43+
run: |
44+
cd Arduino-Source/SerialPrograms
45+
mkdir bin
46+
cd bin
47+
cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }}
48+
cmake --build . --config Release --parallel 10
49+
- name: Copy resources
50+
if: startsWith(matrix.os, 'windows')
51+
run: |
52+
robocopy Packages/SerialPrograms/Resources Output/Resources /s
53+
robocopy Packages/PABotBase/PABotBase-Switch Output/PABotBase /s
54+
robocopy Arduino-Source/SerialPrograms/bin Output/Binaries *.dll
55+
robocopy Arduino-Source/SerialPrograms/bin/Release Output/Binaries SerialPrograms.exe
56+
echo https://github.com/${{github.repository}}/commit/${{github.sha}} > Output/version.txt
57+
write-host "Robocopy exited with exit code:" $lastexitcode
58+
if ($lastexitcode -eq 1)
59+
{
60+
exit 0
61+
}
62+
else
63+
{
64+
exit 1
65+
}
66+
- uses: actions/upload-artifact@v4
67+
if: startsWith(matrix.os, 'windows')
68+
with:
69+
name: Serial Programs for windows (${{ matrix.qt_version }})
70+
path: Output

.gitignore

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
SerialPrograms/bin/
2-
3-
.vscode
4-
5-
# macOS hidden system file
6-
.DS_Store
7-
8-
build-*/
9-
build/
10-
11-
# Qt config file on a user basis
12-
*.pro.user
13-
14-
# all other common C++ ignorables
15-
# Prerequisites
16-
*.d
17-
18-
# Compiled Object files
19-
*.slo
20-
*.lo
21-
*.o
22-
*.obj
23-
24-
# Precompiled Headers
25-
*.gch
26-
*.pch
27-
28-
# Compiled Dynamic libraries
29-
SerialPrograms/*.so
30-
SerialPrograms/*.dylib
31-
SerialPrograms/*.dll
32-
33-
# Fortran module files
34-
*.mod
35-
*.smod
36-
37-
# Compiled Static libraries
38-
SerialPrograms/*.lai
39-
SerialPrograms/*.la
40-
SerialPrograms/*.a
41-
SerialPrograms/*.lib
42-
43-
# Executables
44-
*.exe
45-
*.out
46-
*.app
47-
48-
.vs
49-
Resources/*
50-
SerialPrograms/CMakeLists.txt.user
51-
opencv_world4110d.dll
52-
53-
# Python cache
54-
__pycache__
55-
56-
# Jupyter Notebooks
57-
*.ipynb
1+
SerialPrograms/bin/
2+
3+
.vscode
4+
5+
# macOS hidden system file
6+
.DS_Store
7+
8+
build-*/
9+
build/
10+
11+
# Qt config file on a user basis
12+
*.pro.user
13+
14+
# all other common C++ ignorables
15+
# Prerequisites
16+
*.d
17+
18+
# Compiled Object files
19+
*.slo
20+
*.lo
21+
*.o
22+
*.obj
23+
24+
# Precompiled Headers
25+
*.gch
26+
*.pch
27+
28+
# Compiled Dynamic libraries
29+
SerialPrograms/*.so
30+
SerialPrograms/*.dylib
31+
SerialPrograms/*.dll
32+
33+
# Fortran module files
34+
*.mod
35+
*.smod
36+
37+
# Compiled Static libraries
38+
SerialPrograms/*.lai
39+
SerialPrograms/*.la
40+
SerialPrograms/*.a
41+
SerialPrograms/*.lib
42+
43+
# Executables
44+
*.exe
45+
*.out
46+
*.app
47+
48+
.vs
49+
Resources/*
50+
SerialPrograms/CMakeLists.txt.user
51+
opencv_world4110d.dll
52+
53+
# Python cache
54+
__pycache__
55+
56+
# Jupyter Notebooks
57+
*.ipynb

3rdParty/ONNX/OnnxToolsPA.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
/* Simple Integer Option
2-
*
3-
* From: https://github.com/PokemonAutomation/
4-
*
5-
* This option is thread-safe.
6-
*
7-
*/
8-
9-
#ifndef PokemonAutomation_3rdParty_OnnxToolsPA_H
10-
#define PokemonAutomation_3rdParty_OnnxToolsPA_H
11-
12-
#include <string>
13-
#include <onnxruntime_c_api.h>
14-
#include "Common/Cpp/Unicode.h"
15-
16-
namespace PokemonAutomation{
17-
18-
#ifdef _WIN32
19-
20-
inline std::wstring str_to_onnx_str(const std::string& str){
21-
return utf8_to_wstr(str);
22-
}
23-
24-
25-
#else
26-
27-
28-
inline std::string str_to_onnx_str(std::string str){
29-
return str;
30-
}
31-
32-
33-
#endif
34-
35-
36-
37-
}
38-
#endif
1+
/* Simple Integer Option
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
* This option is thread-safe.
6+
*
7+
*/
8+
9+
#ifndef PokemonAutomation_3rdParty_OnnxToolsPA_H
10+
#define PokemonAutomation_3rdParty_OnnxToolsPA_H
11+
12+
#include <string>
13+
#include <onnxruntime_c_api.h>
14+
#include "Common/Cpp/Unicode.h"
15+
16+
namespace PokemonAutomation{
17+
18+
#ifdef _WIN32
19+
20+
inline std::wstring str_to_onnx_str(const std::string& str){
21+
return utf8_to_wstr(str);
22+
}
23+
24+
25+
#else
26+
27+
28+
inline std::string str_to_onnx_str(std::string str){
29+
return str;
30+
}
31+
32+
33+
#endif
34+
35+
36+
37+
}
38+
#endif
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
2-
// Licensed under the MIT License.
3-
4-
#include "onnxruntime_c_api.h"
5-
6-
#ifdef __cplusplus
7-
extern "C" {
8-
#endif
9-
10-
/**
11-
* \param use_arena zero: false. non-zero: true.
12-
*/
13-
ORT_EXPORT
14-
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CPU, _In_ OrtSessionOptions* options, int use_arena)
15-
ORT_ALL_ARGS_NONNULL;
16-
17-
#ifdef __cplusplus
18-
}
19-
#endif
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#include "onnxruntime_c_api.h"
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
/**
11+
* \param use_arena zero: false. non-zero: true.
12+
*/
13+
ORT_EXPORT
14+
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CPU, _In_ OrtSessionOptions* options, int use_arena)
15+
ORT_ALL_ARGS_NONNULL;
16+
17+
#ifdef __cplusplus
18+
}
19+
#endif

0 commit comments

Comments
 (0)