Skip to content

Commit

Permalink
Allign scripts with axopen.templates (#456)
Browse files Browse the repository at this point in the history
* Create draft PR for #455

* scripts modified

---------

Co-authored-by: TK <[email protected]>
  • Loading branch information
IX-BOT and TomKovac authored Nov 27, 2024
1 parent 58a8d67 commit 3953958
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
15 changes: 8 additions & 7 deletions src/scripts/check_requisites_nuget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ has_feed_access(){

# Check if the feed is authorized
has_feed_authorization_passed(){
if dotnet tool update axsharp.ixc --prerelease; then
printf "${GREEN}Authentication passed successfully while accessing feed $feedUrl.${NC}"
return 0
else
printf "${RED}Authentication failed while accessing feed $feedUrl.${NC}"
return 1
fi
# if dotnet tool update axsharp.ixc --prerelease; then
# printf "${GREEN}Authentication passed successfully while accessing feed $feedUrl.${NC}"
# return 0
# else
# printf "${RED}Authentication failed while accessing feed $feedUrl.${NC}"
# return 1
# fi
return 0
}

# Check if the correct number of arguments are provided
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/copy_hardware_ids.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if ! [[ -e $input_file ]]; then
echo "File $input_file does not exist!!!"
exit 1
fi
output_dir=src/IO/$PLC_NAME
output_dir=src/IO
if ! [[ -d $output_dir ]]; then
echo "Directory $output_dir does not exist!!!"
mkdir -p $output_dir
Expand Down
14 changes: 11 additions & 3 deletions src/scripts/copy_io_addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ if ! [[ -e $input_file ]]; then
echo "File $input_file does not exist!!!"
exit 1
fi
output_dir=src/IO/$PLC_NAME
output_dir=src/IO
if ! [[ -d $output_dir ]]; then
echo "Directory $output_dir does not exist!!!"
mkdir -p $output_dir
fi
noInputsFoundInTheHwConfig=1
noOutputsFoundInTheHwConfig=1
output_file_inputs="$output_dir/Inputs.st"
output_file_outputs="$output_dir/Outputs.st"
echo "NAMESPACE ${NAMESPACE}" > "$output_file_inputs"
Expand Down Expand Up @@ -73,7 +75,7 @@ while IFS= read -r line; do

# Extract the substring from : to ;, excluding : and ;
variable_type=$(echo "$line" | awk -F':' '{print $2}' | awk -F';' '{print $1}')

noInputsFoundInTheHwConfig = 0
# Output the variables
echo " ${variable_name} AT %B${address_offset}: ${variable_type};" >> "$output_file_inputs"
fi
Expand All @@ -88,11 +90,17 @@ while IFS= read -r line; do

# Extract the substring from : to ;, excluding : and ;
variable_type=$(echo "$line" | awk -F':' '{print $2}' | awk -F';' '{print $1}')

noOutputsFoundInTheHwConfig = 0
# Output the variables
echo " ${variable_name} AT %B${address_offset}: ${variable_type};" >> "$output_file_outputs"
fi
done < "$input_file"
if [ $noInputsFoundInTheHwConfig -eq 1 ]; then
echo " noInputsFoundInTheHwConfig AT %B0: BYTE;" >> "$output_file_inputs"
fi
if [ $noOutputsFoundInTheHwConfig -eq 1 ]; then
echo " noOutputsFoundInTheHwConfig AT %B0: BYTE;" >> "$output_file_outputs"
fi
echo " END_STRUCT;" >> "$output_file_inputs"
echo " END_STRUCT;" >> "$output_file_outputs"
echo " END_TYPE" >> "$output_file_inputs"
Expand Down

0 comments on commit 3953958

Please sign in to comment.