From 038b89776d2ed84d15b6b47c7a6b9e543c6d09e2 Mon Sep 17 00:00:00 2001 From: kaltokri Date: Fri, 20 Oct 2023 22:45:52 +0200 Subject: [PATCH 1/3] Added replacement of head tag again --- .github/workflows/build-docs.yml | 12 ++++++++++++ Moose Development/docs-header.html | 5 +++++ Moose Development/docs-header.py | 26 ++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Moose Development/docs-header.html create mode 100644 Moose Development/docs-header.py diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7d4f074b9..c31b19a21 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -93,6 +93,18 @@ jobs: lua luadocumentor.lua -d ${{ github.workspace }}/build/doc "${{ github.workspace }}/Moose Development/Moose" working-directory: ${{ github.workspace }}/build/tools/luadocumentor + ######################################################################### + # Replace tag + ######################################################################### + - name: Replace head tag + run: | + python3 "${{ github.workspace }}/Moose Development/docs-header.py" + working-directory: ${{ github.workspace }}/build/doc + + - name: Check replacement of head tag + run: | + head -10 ${{ github.workspace }}/build/doc/AI.AI_A2A_Cap.html + ######################################################################### # Push to MOOSE_DOCS ######################################################################### diff --git a/Moose Development/docs-header.html b/Moose Development/docs-header.html new file mode 100644 index 000000000..e6613e196 --- /dev/null +++ b/Moose Development/docs-header.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Moose Development/docs-header.py b/Moose Development/docs-header.py new file mode 100644 index 000000000..72dfc6f28 --- /dev/null +++ b/Moose Development/docs-header.py @@ -0,0 +1,26 @@ +# import required module +from pathlib import Path +import os + +# assign directory +directory = '.' + +print( "Replacing head tag in all html files" ) + +# Read template file +with open( os.path.dirname(__file__) + '/docs-header.html', 'r') as file: + newhead = file.read() + +# iterate over files in +# that directory +files = Path(directory).glob('*.html') +for file in files: + # print(file) + with open(file, 'r') as fileread: + filedata = fileread.read() + # Replace the target string + filedata = filedata.replace( '', newhead ) + + # Write the file out again + with open(file, 'w') as filewrite: + filewrite.write(filedata) From 456c002c3cc59293c68b4532fb8b3086f52cd5e6 Mon Sep 17 00:00:00 2001 From: kaltokri Date: Fri, 20 Oct 2023 23:36:27 +0200 Subject: [PATCH 2/3] Fix for missing w3.css in DOCS repo --- .github/workflows/build-docs.yml | 2 +- Moose Development/docs-header.html | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c31b19a21..4a7bc1f8c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -136,7 +136,7 @@ jobs: - name: Copy build result to MOOSE_DOCS run: | - cp ./build/doc/*.html ./build/MOOSE_DOCS/Documentation/ + cp ./build/doc/*.* ./build/MOOSE_DOCS/Documentation/ - name: Push result to docs repository if: ${{ vars.FORCE_PUSH == 'true' }} diff --git a/Moose Development/docs-header.html b/Moose Development/docs-header.html index e6613e196..e559ffff1 100644 --- a/Moose Development/docs-header.html +++ b/Moose Development/docs-header.html @@ -1,5 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file From ab068670cc1d2970437bcf974f23ddef00a8219b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 21 Oct 2023 12:43:20 +0200 Subject: [PATCH 3/3] #RECOVERYTANKER * Added option to set unlimited fuel --- .../Moose/Ops/RecoveryTanker.lua | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/RecoveryTanker.lua b/Moose Development/Moose/Ops/RecoveryTanker.lua index 0489ccb3d..a4c00cfea 100644 --- a/Moose Development/Moose/Ops/RecoveryTanker.lua +++ b/Moose Development/Moose/Ops/RecoveryTanker.lua @@ -63,6 +63,7 @@ -- @field #boolean eplrs If true, enable data link, e.g. if used as AWACS. -- @field #boolean recovery If true, tanker will recover using the AIRBOSS marshal pattern. -- @field #number terminaltype Terminal type of used parking spots on airbases. +-- @field #boolean unlimitedfuel If true, the tanker will have unlimited fuel. -- @extends Core.Fsm#FSM --- Recovery Tanker. @@ -300,6 +301,7 @@ RECOVERYTANKER = { eplrs = nil, recovery = nil, terminaltype = nil, + unlimitedfuel = false, } --- Unique ID (global). @@ -308,7 +310,7 @@ _RECOVERYTANKERID=0 --- Class version. -- @field #string version -RECOVERYTANKER.version="1.0.9" +RECOVERYTANKER.version="1.0.10" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -326,6 +328,7 @@ RECOVERYTANKER.version="1.0.9" -- DONE: Set AA TACAN. -- DONE: Add refueling event/state. -- DONE: Possibility to add already present/spawned aircraft, e.g. for warehouse. +-- DONE: Add unlimited fuel ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Constructor @@ -550,6 +553,15 @@ end -- User functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--- Set the tanker to have unlimited fuel. +-- @param #RECOVERYTANKER self +-- @param #boolean OnOff If true, the tanker will have unlimited fuel. +-- @return #RECOVERYTANKER self +function RECOVERYTANKER:SetUnlimitedFuel(OnOff) + self.unlimitedfuel = OnOff + return self +end + --- Set the speed the tanker flys in its orbit pattern. -- @param #RECOVERYTANKER self -- @param #number speed True air speed (TAS) in knots. Default 274 knots, which results in ~250 KIAS. @@ -899,6 +911,14 @@ function RECOVERYTANKER:onafterStart(From, Event, To) -- Spawn tanker. We need to introduce an alias in case this class is used twice. This would confuse the spawn routine. local Spawn=SPAWN:NewWithAlias(self.tankergroupname, self.alias) + if self.unlimitedfuel then + Spawn:OnSpawnGroup( + function (grp) + grp:CommandSetUnlimitedFuel(self.unlimitedfuel) + end + ) + end + -- Set radio frequency and modulation. Spawn:InitRadioCommsOnOff(true) Spawn:InitRadioFrequency(self.RadioFreq)