Skip to content

Commit 3691efb

Browse files
committed
Initial Commit
1 parent 7d5c771 commit 3691efb

File tree

73 files changed

+3867
-0
lines changed

Some content is hidden

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

73 files changed

+3867
-0
lines changed

.clang-format

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
BasedOnStyle: Google
2+
AccessModifierOffset: -2
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlines: Left
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterDefinitionReturnType: None
16+
AlwaysBreakAfterReturnType: None
17+
AlwaysBreakBeforeMultilineStrings: false
18+
AlwaysBreakTemplateDeclarations: true
19+
BinPackArguments: false
20+
BinPackParameters: false
21+
BraceWrapping:
22+
AfterCaseLabel : true
23+
AfterClass: true
24+
AfterControlStatement: true
25+
AfterEnum: true
26+
AfterFunction: true
27+
AfterNamespace: true
28+
AfterObjCDeclaration: true
29+
AfterStruct: true
30+
AfterUnion: true
31+
AfterExternBlock: false
32+
BeforeCatch: true
33+
BeforeElse: true
34+
IndentBraces: false
35+
SplitEmptyFunction: true
36+
SplitEmptyRecord: true
37+
SplitEmptyNamespace: true
38+
BreakAfterJavaFieldAnnotations: false
39+
BreakBeforeBinaryOperators: None
40+
BreakBeforeBraces: Custom
41+
BreakBeforeInheritanceComma: true
42+
BreakBeforeTernaryOperators: true
43+
BreakConstructorInitializers: AfterColon
44+
BreakConstructorInitializersBeforeComma: false
45+
BreakStringLiterals: false
46+
ColumnLimit: 0
47+
CompactNamespaces: false
48+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
49+
ConstructorInitializerIndentWidth: 2
50+
ContinuationIndentWidth: 2
51+
Cpp11BracedListStyle: false
52+
DerivePointerAlignment: false
53+
DisableFormat: false
54+
FixNamespaceComments: false
55+
IncludeBlocks: Preserve
56+
IncludeCategories:
57+
- Regex: '^<ext/.*\.h>'
58+
Priority: 2
59+
- Regex: '^<.*\.h>'
60+
Priority: 1
61+
- Regex: '^<.*'
62+
Priority: 2
63+
- Regex: '.*'
64+
Priority: 3
65+
IncludeIsMainRegex: '([-_](test|unittest))?$'
66+
IndentCaseLabels: true
67+
IndentPPDirectives: None
68+
IndentWidth: 2
69+
IndentWrappedFunctionNames: false
70+
KeepEmptyLinesAtTheStartOfBlocks: false
71+
MacroBlockBegin: ''
72+
MacroBlockEnd: ''
73+
MaxEmptyLinesToKeep: 1
74+
NamespaceIndentation: All
75+
PenaltyBreakAssignment: 2
76+
PenaltyBreakBeforeFirstCallParameter: 1
77+
PenaltyBreakComment: 300
78+
PenaltyBreakFirstLessLess: 120
79+
PenaltyBreakString: 1000
80+
PenaltyExcessCharacter: 1000000
81+
PenaltyReturnTypeOnItsOwnLine: 200
82+
PointerAlignment: Right
83+
ReflowComments: false
84+
SortIncludes: true
85+
SortUsingDeclarations: true
86+
SpaceAfterCStyleCast: false
87+
SpaceAfterTemplateKeyword: false
88+
SpaceBeforeAssignmentOperators: true
89+
SpaceBeforeParens: ControlStatements
90+
SpaceInEmptyParentheses: false
91+
SpacesBeforeTrailingComments: 1
92+
SpacesInAngles: false
93+
SpacesInCStyleCastParentheses: false
94+
SpacesInContainerLiterals: true
95+
SpacesInParentheses: false
96+
SpacesInSquareBrackets: false
97+
Standard: Cpp11
98+
TabWidth: 2
99+
UseTab: ForIndentation

.cmake-format.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
format:
2+
disable: false
3+
line_width: 80
4+
tab_size: 2
5+
use_tabchars: false
6+
fractional_tab_policy: use-space
7+
max_subgroups_hwrap: 2
8+
max_pargs_hwrap: 6
9+
max_rows_cmdline: 2
10+
separate_ctrl_name_with_space: false
11+
separate_fn_name_with_space: false
12+
dangle_parens: false
13+
dangle_align: prefix
14+
min_prefix_chars: 4
15+
max_prefix_chars: 10
16+
max_lines_hwrap: 2
17+
line_ending: unix
18+
command_case: canonical
19+
keyword_case: unchanged
20+
always_wrap: []
21+
enable_sort: true
22+
autosort: false
23+
require_valid_layout: false
24+
layout_passes: {}
25+
markup:
26+
bullet_char: "*"
27+
enum_char: .
28+
first_comment_is_literal: false
29+
literal_comment_pattern: null
30+
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
31+
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
32+
explicit_trailing_pattern: "#<"
33+
hashruler_min_length: 10
34+
canonicalize_hashrulers: true
35+
enable_markup: true
36+
lint:
37+
disabled_codes: [C0301]
38+
function_pattern: "[0-9a-z_]+"
39+
macro_pattern: "[0-9A-Z_]+"
40+
global_var_pattern: "[a-zA-Z][0-9a-zA-Z_]+"
41+
internal_var_pattern: _[A-Z][0-9A-Z_]+
42+
local_var_pattern: "[a-z][a-z0-9_]+"
43+
private_var_pattern: _[0-9a-z_]+
44+
public_var_pattern: "[A-Z][0-9A-Z_]+"
45+
argument_var_pattern: "[a-z][a-z0-9_]+"
46+
keyword_pattern: "[A-Z][0-9A-Z_]+"
47+
max_conditionals_custom_parser: 2
48+
min_statement_spacing: 1
49+
max_statement_spacing: 2
50+
max_returns: 6
51+
max_branches: 12
52+
max_arguments: 5
53+
max_localvars: 15
54+
max_statements: 50
55+
encode:
56+
emit_byteorder_mark: false
57+
input_encoding: utf-8
58+
output_encoding: utf-8
59+
misc:
60+
per_command: {}

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: ad3154

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build
2+
3+
on: push
4+
5+
jobs:
6+
windows_build:
7+
name: Windows Build
8+
runs-on: windows-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
with:
13+
submodules: recursive
14+
- name: Compile
15+
run: |
16+
mkdir build
17+
cmake -S . -B build -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DCAN_DRIVER=None -DCMAKE_BUILD_TYPE=Debug
18+
cmake --build build --config Debug

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
# Editors
35+
.vs/
36+
.vscode/
37+
out
38+
build

CMakeLists.txt

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
3+
project(
4+
"AgISOUniversalTerminal"
5+
LANGUAGES CXX
6+
VERSION 0.0.1)
7+
8+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
9+
10+
find_package(JUCE MODULE)
11+
find_package(CAN_Stack MODULE)
12+
find_package(Threads REQUIRED)
13+
14+
# set(CAN_DRIVER "TouCAN") Set this to be whatever your CAN driver is
15+
# add_subdirectory(ISO11783-CAN-Stack)
16+
17+
juce_add_gui_app(
18+
AgISOUniversalTerminal
19+
# ICON_BIG ... # ICON_* arguments specify a path to an
20+
# image file to use as an icon ICON_SMALL ...
21+
COMPANY_NAME
22+
"Open-Agriculture"
23+
PRODUCT_NAME
24+
"AgISOUniversalTerminal")
25+
26+
juce_generate_juce_header(AgISOUniversalTerminal)
27+
28+
target_sources(
29+
AgISOUniversalTerminal
30+
PRIVATE src/Main.cpp
31+
"src/ServerMainComponent.cpp"
32+
"src/DataMaskComponent.cpp"
33+
"src/WorkingSetSelectorComponent.cpp"
34+
"src/PictureGraphicComponent.cpp"
35+
"src/WorkingSetComponent.cpp"
36+
"src/AlarmMaskComponent.cpp"
37+
"src/DataMaskRenderAreaComponent.cpp"
38+
"src/JuceManagedWorkingSetCache.cpp"
39+
"src/OutputRectangleComponent.cpp"
40+
"src/OutputStringComponent.cpp"
41+
"src/ButtonComponent.cpp"
42+
"src/ContainerComponent.cpp"
43+
"src/ObjectPointerComponent.cpp"
44+
"src/OutputNumberComponent.cpp"
45+
"src/SoftkeyMaskRenderArea.cpp"
46+
"src/KeyComponent.cpp"
47+
"src/SoftKeyMaskComponent.cpp"
48+
"src/OutputMeterComponent.cpp"
49+
"src/InputBooleanComponent.cpp"
50+
"src/LoggerComponent.cpp"
51+
"src/InputNumberComponent.cpp"
52+
"src/OutputEllipseComponent.cpp"
53+
"src/OutputLineComponent.cpp"
54+
"src/OutputLinearBarGraphComponent.cpp"
55+
"src/OutputPolygonComponent.cpp"
56+
"src/InputListComponent.cpp")
57+
58+
target_include_directories(AgISOUniversalTerminal
59+
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
60+
61+
target_link_libraries(
62+
AgISOUniversalTerminal
63+
PRIVATE juce::juce_gui_extra isobus::Isobus isobus::HardwareIntegration
64+
isobus::Utility
65+
PUBLIC juce::juce_recommended_config_flags juce::juce_recommended_lto_flags
66+
juce::juce_recommended_warning_flags)

README.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# AgIsoVirtualTerminal
2+
3+
This project is a free, but experimental ISO11783-6 (ISOBUS) virtual terminal server GUI meant for agricultural and forestry equipment.
4+
5+
The project is written in C++ and is based on AgIsoStack++ and the JUCE GUI framework.
6+
7+
This project is somewhat functional for a single VT client, but is still in the early stages of development, and as such is not fit for general consumption.
8+
9+
## Project Status
10+
11+
This section will be updated as progress is made on the project.
12+
13+
Supported features:
14+
15+
- All basic ISO11783 stuff, such as address claiming, TP, ETP, diagnostic protocol, etc.
16+
- Exactly 1 VT client
17+
- Object pool deserializer (most objects up to version 6 with some exceptions)
18+
- Data masks
19+
- Soft key masks
20+
- Key objects
21+
- Containers
22+
- Object Pointers
23+
- Input numbers
24+
- Output numbers
25+
- Output rectangles
26+
- Output ellipse
27+
- Output polygon
28+
- Output line
29+
- Output linear bar graph (except target line)
30+
- Output arched bar graph (except tick marks and target line)
31+
- Picture graphics (with and without run-length encoding)
32+
- Output Strings (partial - font clipping is not compliant)
33+
- Input lists (partial - drawing the selector needs work)
34+
- Some CAN messages (Object pool upload state machine and handshake messages, change active mask response, change child location response, change numeric value and response, key/button activation and release messages, change numeric value, select input object)
35+
36+
Unimplemented features (for now)
37+
38+
- Alarm masks
39+
- All audio functionality
40+
- Selecting different working sets
41+
- Window masks
42+
- Aux N/O
43+
- Most macro functionality
44+
- Animations
45+
- Output Lists
46+
- Logging
47+
- Input Boolean
48+
- TAN
49+
- Several messages, such as ESC
50+
- Probably more things to be honest
51+
52+
## Compilation
53+
54+
This project is compiled with CMake and your favorite C++17 compiler.
55+
56+
Make sure you select your desired CAN driver as supported by AgIso Stack by defining the `CAN_DRIVER` variable.
57+
58+
Example:
59+
60+
```
61+
cmake -S. -B build -DCAN_DRIVER=TouCAN
62+
cmake --build build
63+
```
64+
65+
### Disclaimers
66+
67+
This project is not associated with the AEF in any way. By acquiring or using this project you agree to the [JUCE License](https://github.com/juce-framework/JUCE/blob/master/LICENSE.md) as well as any applicable licenses provided by dependencies such as AgIsoStack.
68+
69+
It is claimed that compliance with ISO 11783 may involve the use of a patent concerning the controller area network (CAN) protocol referred to throughout this project and the ISO 11783/J1939 standards.
70+
71+
No contributor to this project takes any position concerning the evidence, validity, and scope of said patent.
72+
73+
Some elements of ISO 11783 and J1939 may be subject to patent rights other than the one identified above. No member of this project shall be held responsible for identifying any or all such patent rights.

cmake/FindCAN_Stack.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if (NOT TARGET isobus::isobus)
2+
include(FetchContent)
3+
FetchContent_Declare(
4+
CAN_Stack
5+
GIT_REPOSITORY https://github.com/Open-Agriculture/AgIsoStack-plus-plus.git
6+
GIT_TAG vt-server-managed-working-set
7+
)
8+
FetchContent_MakeAvailable(CAN_Stack)
9+
endif()

cmake/FindJUCE.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if (NOT TARGET JUCE::JUCE)
2+
include(FetchContent)
3+
FetchContent_Declare(
4+
JUCE
5+
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
6+
GIT_TAG 7.0.8
7+
)
8+
FetchContent_MakeAvailable(JUCE)
9+
endif()

include/AlarmMaskComponent.hpp

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//================================================================================================
2+
/// @file AlarmMaskComponent.hpp
3+
///
4+
/// @brief Defines a GUI component to draw a data mask.
5+
/// @author Adrian Del Grosso
6+
///
7+
/// @copyright 2023 Adrian Del Grosso
8+
//================================================================================================
9+
#ifndef ALARM_MASK_COMPONENT_HPP
10+
#define ALARM_MASK_COMPONENT_HPP
11+
12+
#include "isobus/isobus/isobus_virtual_terminal_objects.hpp"
13+
#include "isobus/isobus/isobus_virtual_terminal_server_managed_working_set.hpp"
14+
15+
#include "JuceHeader.h"
16+
17+
class AlarmMaskComponent : public isobus::AlarmMask
18+
, public Component
19+
{
20+
public:
21+
AlarmMaskComponent(std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> workingSet, isobus::AlarmMask sourceObject);
22+
23+
void on_content_changed(bool initial = false);
24+
25+
void paint(Graphics &g) override;
26+
27+
private:
28+
std::shared_ptr<isobus::VirtualTerminalServerManagedWorkingSet> parentWorkingSet;
29+
std::vector<std::shared_ptr<Component>> childComponents;
30+
31+
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AlarmMaskComponent);
32+
};
33+
34+
#endif // ALARM_MASK_COMPONENT_HPP

0 commit comments

Comments
 (0)