-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AndrewMusser
committed
Nov 22, 2023
1 parent
8ad7697
commit 25c4325
Showing
115 changed files
with
631 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(* | ||
* File: Diagnostics.var | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of ErrorProg, licensed under the MIT License. | ||
*) | ||
|
||
VAR | ||
gErrorCollector : ErrorCollector_typ := (0); | ||
gErrorCollectorHMI : ErrorCollector_HMI_typ := (0); | ||
END_VAR | ||
|
11 changes: 11 additions & 0 deletions
11
example/AsProject/Logical/Diagnostics/ErrorProg/ErrorProg.typ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(* | ||
* File: ErrorProg.typ | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of ErrorProg, licensed under the MIT License. | ||
*) | ||
|
||
TYPE | ||
|
||
END_TYPE |
8 changes: 8 additions & 0 deletions
8
example/AsProject/Logical/Diagnostics/ErrorProg/ErrorProg.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(* | ||
* File: ErrorProg.var | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of ErrorProg, licensed under the MIT License. | ||
*) | ||
|
16 changes: 16 additions & 0 deletions
16
example/AsProject/Logical/Diagnostics/ErrorProg/ErrorProgCyclic.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(* | ||
* File: ErrorProgCyclic.st | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of ErrorProg, licensed under the MIT License. | ||
*) | ||
|
||
|
||
PROGRAM _CYCLIC | ||
|
||
ErrorCollectorFn_HMI_Cyclic( gErrorCollectorHMI, gErrorCollector ); | ||
|
||
ErrorCollectorFn_Cyclic( gErrorCollector ); | ||
|
||
END_PROGRAM |
17 changes: 17 additions & 0 deletions
17
example/AsProject/Logical/Diagnostics/ErrorProg/ErrorProgInit.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(* | ||
* File: ErrorProgInit.st | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of ErrorProg, licensed under the MIT License. | ||
*) | ||
|
||
PROGRAM _INIT | ||
|
||
(* gErrorCollector is initialized in FirstInitProg - Init only if it hasn't already been *) | ||
IF NOT gErrorCollector.Internal.Initialized THEN | ||
ErrorCollectorFn_Init(gErrorCollector); | ||
END_IF | ||
(* Sources are added to gErrorCollector in the source program. *) | ||
END_PROGRAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?AutomationStudio FileVersion="4.9"?> | ||
<Program SubType="IEC" xmlns="http://br-automation.co.at/AS/Program"> | ||
<Files> | ||
<File Description="Initialization code">ErrorProgInit.st</File> | ||
<File Description="Cyclic code">ErrorProgCyclic.st</File> | ||
<File Description="Local data types" Private="true">ErrorProg.typ</File> | ||
<File Description="Local variables" Private="true">ErrorProg.var</File> | ||
</Files> | ||
</Program> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<Package xmlns="http://br-automation.co.at/AS/Package"> | ||
<Objects> | ||
<Object Type="File">Diagnostics.var</Object> | ||
<Object Type="Program" Language="IEC">ErrorProg</Object> | ||
</Objects> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<Package xmlns="http://br-automation.co.at/AS/Package"> | ||
<Objects> | ||
<Object Type="File">getRevInfo.sh</Object> | ||
<Object Type="Program" Language="IEC">RevInfo</Object> | ||
<Object Type="File">RevInfo.var</Object> | ||
</Objects> | ||
</Package> |
18 changes: 18 additions & 0 deletions
18
example/AsProject/Logical/Infrastructure/RevInfo/RevInfo.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(* | ||
* File: RevInfo.var | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of RevInfo, licensed under the MIT License. | ||
*) | ||
|
||
VAR | ||
revision : STRING[80] := ''; | ||
revisionDate : STRING[80] := ''; | ||
revisionAuthor : STRING[80] := ''; | ||
branchName : STRING[80] := ''; | ||
uncommittedChanges : STRING[80] := ''; | ||
buildDate : STRING[80] := ''; | ||
buildConfiguration : STRING[80] := ''; | ||
builder : STRING[80] := ''; | ||
END_VAR |
8 changes: 8 additions & 0 deletions
8
example/AsProject/Logical/Infrastructure/RevInfo/RevInfo/IEC.prg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?AutomationStudio Version=4.5.5.113 SP?> | ||
<Program SubType="IEC" xmlns="http://br-automation.co.at/AS/Program"> | ||
<Files> | ||
<File Description="Implementation code">Main.st</File> | ||
<File Private="true">Variables.var</File> | ||
</Files> | ||
</Program> |
71 changes: 71 additions & 0 deletions
71
example/AsProject/Logical/Infrastructure/RevInfo/RevInfo/Main.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
(* | ||
* File: Main.st | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of RevInfo, licensed under the MIT License. | ||
*) | ||
PROGRAM _INIT | ||
|
||
// Log revision information | ||
//--------------------------------------------------------------- | ||
|
||
logInfo('App', 0, '************ RevInfo Start ************', 0); | ||
|
||
// revision | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Revision: '; | ||
brsstrcat(ADR(tempString), ADR(revision)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// revisionDate | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Commit Date: '; | ||
brsstrcat(ADR(tempString), ADR(revisionDate)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// revisionAuthor | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Author: '; | ||
brsstrcat(ADR(tempString), ADR(revisionAuthor)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// branchName | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Branch Name: '; | ||
brsstrcat(ADR(tempString), ADR(branchName)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// uncommittedChanges | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Uncommitted Changes: '; | ||
brsstrcat(ADR(tempString), ADR(uncommittedChanges)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// buildDate | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Build Date: '; | ||
brsstrcat(ADR(tempString), ADR(buildDate)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// buildConfiguration | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Configuration: '; | ||
brsstrcat(ADR(tempString), ADR(buildConfiguration)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
// builder | ||
brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
tempString := 'Builder: '; | ||
brsstrcat(ADR(tempString), ADR(builder)); | ||
logInfo('App', 0, tempString, 0); | ||
|
||
logInfo('App', 0, '************ RevInfo End ************', 0); | ||
|
||
END_PROGRAM | ||
|
||
|
||
PROGRAM _CYCLIC | ||
|
||
|
||
END_PROGRAM |
10 changes: 10 additions & 0 deletions
10
example/AsProject/Logical/Infrastructure/RevInfo/RevInfo/Variables.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(* | ||
* File: Variables.var | ||
* Copyright (c) 2023 Loupe | ||
* https://loupe.team | ||
* | ||
* This file is part of RevInfo, licensed under the MIT License. | ||
*) | ||
VAR | ||
tempString : STRING[160]; | ||
END_VAR |
142 changes: 142 additions & 0 deletions
142
example/AsProject/Logical/Infrastructure/RevInfo/getRevInfo.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# File: getRevInfo.sh | ||
# Copyright (c) 2023 Loupe | ||
# https://loupe.team | ||
# | ||
# This file is part of RevInfo, licensed under the MIT License. | ||
# | ||
#!/bin/sh | ||
# The following line should be put into the pre-build step of any configuration that should run this script | ||
# "$(AS_PROJECT_PATH)\Logical\Documentation\getRevInfo.sh" | ||
# This script will update the revision and build information | ||
|
||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" | ||
|
||
cat > RevInfo.var << EOF | ||
(* RevInfo.var 2.2.0 *) | ||
VAR CONSTANT | ||
revision : STRING[80] := '$(git describe --always --tags)'; | ||
revisionDate : STRING[80] := '$(git show -s --date=default --pretty=format:%ci)'; | ||
revisionAuthor : STRING[80] := '$(git show -s --pretty=format:%an)'; | ||
branchName : STRING[80] := '$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')'; | ||
uncommittedChanges : STRING[80] := '$(git diff --shortstat)'; | ||
buildDate : STRING[80] := '$(date +"%Y-%m-%d %H:%M:%S %z")'; | ||
buildConfiguration : STRING[80] := '${AS_CONFIGURATION}'; | ||
builder : STRING[80] := '${AS_USER_NAME}'; | ||
END_VAR | ||
EOF | ||
|
||
# Example implementation of RevInfo program: | ||
# | ||
# RevInfo/Variables.var: | ||
# | ||
# VAR RETAIN | ||
# download : BOOL; | ||
# END_VAR | ||
# VAR | ||
# dataOK : BOOL; | ||
# reboot : BOOL; | ||
# i : UINT := 0; | ||
# tempString : STRING[160]; | ||
# END_VAR | ||
# | ||
# RevInfo/Main.st: | ||
# | ||
# PROGRAM _INIT | ||
# | ||
# // Log revision information | ||
# //--------------------------------------------------------------- | ||
# | ||
# logInfo('App', 0, '************ RevInfo Start ************', 0); | ||
# | ||
# // revision | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Revision: '; | ||
# brsstrcat(ADR(tempString), ADR(revision)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // revisionDate | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Commit Date: '; | ||
# brsstrcat(ADR(tempString), ADR(revisionDate)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // revisionAuthor | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Author: '; | ||
# brsstrcat(ADR(tempString), ADR(revisionAuthor)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // branchName | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Branch Name: '; | ||
# brsstrcat(ADR(tempString), ADR(branchName)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // uncommittedChanges | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Uncommitted Changes: '; | ||
# brsstrcat(ADR(tempString), ADR(uncommittedChanges)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // buildDate | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Build Date: '; | ||
# brsstrcat(ADR(tempString), ADR(buildDate)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // buildConfiguration | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Configuration: '; | ||
# brsstrcat(ADR(tempString), ADR(buildConfiguration)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# // builder | ||
# brsmemset(ADR(tempString), 0, SIZEOF(tempString)); | ||
# tempString := 'Builder: '; | ||
# brsstrcat(ADR(tempString), ADR(builder)); | ||
# logInfo('App', 0, tempString, 0); | ||
# | ||
# logInfo('App', 0, '************ RevInfo End ************', 0); | ||
# | ||
# END_PROGRAM | ||
# | ||
# | ||
# PROGRAM _CYCLIC | ||
# | ||
# // Detect an AS transfer | ||
# IF NOT download THEN | ||
# download := TRUE; | ||
# brsmemset(ADR(gDataValid), 0, SIZEOF(gDataValid)); | ||
# MessageBox_AddMsg(ADR('Download may have caused data loss. Please reboot to reload. If this was the first boot after a download, you may reset DataValid to maintain data.'), ADR('Reboot'), ADR(reboot), ADR('RESET DataValid'), ADR(dataOK)); | ||
# END_IF | ||
# | ||
# IF dataOK THEN | ||
# dataOK := FALSE; | ||
# FOR i := 0 TO SIZEOF(gDataValid)/SIZEOF(gDataValid[0]) - 1 BY 1 DO | ||
# gDataValid[i] := 1; | ||
# END_FOR | ||
# END_IF | ||
# | ||
# IF reboot THEN | ||
# SYSreset(1,1); | ||
# END_IF | ||
# | ||
# END_PROGRAM | ||
|
||
|
||
# Failed attempts to get the directory where the .sh file is stored | ||
# | ||
# echo "Script executed from: ${PWD}" | ||
# BASEDIR=$(dirname $0) | ||
# echo "Script location: ${BASEDIR}" | ||
# DIR="$( cd "$( dirname "$0" )" && pwd )" | ||
# echo "DIR = $DIR" | ||
# DIR2="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
# echo "DIR2 = $DIR2" | ||
# DIR3=${0%\*} | ||
# echo "DIR3 = $DIR3" | ||
# echo "\$0 = $0" | ||
# current_dir=$(pwd) | ||
# script_dir=$(dirname $0) | ||
# echo $current_dir | ||
# echo $script_dir |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.