Updated Moose.lua

This commit is contained in:
funkyfranky
2024-01-01 22:48:35 +00:00
parent d0ce19b779
commit 966a374f98
150 changed files with 6601 additions and 6601 deletions

View File

@@ -1,33 +1,33 @@
--- Simple function scheduling
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
--
--
-- # Status: TESTED - 12 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( "Hello World 1")
end, {}, 1
)
SCHEDULER:New( nil,
function()
BASE:E( "Hello World 2")
end, {}, 2
)
collectgarbage()
--- Simple function scheduling
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
--
--
-- # Status: TESTED - 12 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( "Hello World 1")
end, {}, 1
)
SCHEDULER:New( nil,
function()
BASE:E( "Hello World 2")
end, {}, 2
)
collectgarbage()

View File

@@ -1,34 +1,34 @@
--- Simple Object Scheduling
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. Tracing of a scheduler in an Object.
-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start.
--
-- # Status: TESTED - 12 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message )
self = BASE:Inherit( self, BASE:New() )
local TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, 1
)
end
--- Simple Object Scheduling
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. Tracing of a scheduler in an Object.
-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start.
--
-- # Status: TESTED - 12 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message )
self = BASE:Inherit( self, BASE:New() )
local TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, 1
)
end
local Test = TEST_BASE:New( "Hello World" )

View File

@@ -1,24 +1,24 @@
--- Simple repeat scheduling of a function.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds.
--
--
-- # Status: TESTED - 13 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( "Hello World Repeat")
end, {}, 1, 1
--- Simple repeat scheduling of a function.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- # Test cases:
--
-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds.
--
--
-- # Status: TESTED - 13 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( "Hello World Repeat")
end, {}, 1, 1
)

View File

@@ -1,44 +1,44 @@
--- Object Repeat Scheduling.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- Three Test objects are created.
--
-- # Test cases:
--
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
--
-- # Status: TESTED - 13 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, Start, Repeat, Randomize, Stop
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
end
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
--- Object Repeat Scheduling.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- Three Test objects are created.
--
-- # Test cases:
--
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
--
-- # Status: TESTED - 13 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, Start, Repeat, Randomize, Stop
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
end
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )

View File

@@ -1,41 +1,41 @@
--- Simple repeat scheduling of a function.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 14 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log.
-- After 10 seconds, TestScheduler will stop the scheduler.
-- After 20 seconds, TestScheduler will restart the scheduler.
--
-- # Test cases:
--
-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds.
--
--
-- # Status: TESTED - 14 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( timer.getTime() .. " - Hello World Repeat")
end, {}, 1, 1
)
SCHEDULER:New( nil,
function()
TestScheduler:Stop()
end, {}, 10
)
SCHEDULER:New( nil,
function()
TestScheduler:Start()
end, {}, 20
)
--- Simple repeat scheduling of a function.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 14 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log.
-- After 10 seconds, TestScheduler will stop the scheduler.
-- After 20 seconds, TestScheduler will restart the scheduler.
--
-- # Test cases:
--
-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds.
--
--
-- # Status: TESTED - 14 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( timer.getTime() .. " - Hello World Repeat")
end, {}, 1, 1
)
SCHEDULER:New( nil,
function()
TestScheduler:Stop()
end, {}, 10
)
SCHEDULER:New( nil,
function()
TestScheduler:Start()
end, {}, 20
)

View File

@@ -1,60 +1,60 @@
--- No Object Scheduling because of garbage collect and Object nillification.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- A Test object is created.
-- It is nillified directly after the Schedule has been planned.
-- There should be no schedule fired.
-- The Test object should be garbage collected!
--
-- THIS IS A VERY IMPORTANT TEST!
--
-- # Test cases:
--
-- 1. No schedule should be fired! The destructors of the Test object should be shown.
-- 2. Commend the nillification of the Test object in the source, and test again.
-- The schedule should now be fired and Hello World should be logged through the Test object.
--
-- # Status: STARTED - 12 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, 1
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Test 1" )
Test1 = nil
BASE:E( Test1 )
end
local Test2 = TEST_BASE:New( "Hello World Test 2" )
BASE:E( Test2 )
local Test3 = TEST_BASE:New( "Hello World Test 3" )
Test3 = nil
BASE:E( Test3 )
collectgarbage()
BASE:E( "Collect Garbage executed." )
BASE:E( "You should only see a Hello Worlld message for Test 2!" )
--- No Object Scheduling because of garbage collect and Object nillification.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 12 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- A Test object is created.
-- It is nillified directly after the Schedule has been planned.
-- There should be no schedule fired.
-- The Test object should be garbage collected!
--
-- THIS IS A VERY IMPORTANT TEST!
--
-- # Test cases:
--
-- 1. No schedule should be fired! The destructors of the Test object should be shown.
-- 2. Commend the nillification of the Test object in the source, and test again.
-- The schedule should now be fired and Hello World should be logged through the Test object.
--
-- # Status: STARTED - 12 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, 1
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Test 1" )
Test1 = nil
BASE:E( Test1 )
end
local Test2 = TEST_BASE:New( "Hello World Test 2" )
BASE:E( Test2 )
local Test3 = TEST_BASE:New( "Hello World Test 3" )
Test3 = nil
BASE:E( Test3 )
collectgarbage()
BASE:E( "Collect Garbage executed." )
BASE:E( "You should only see a Hello Worlld message for Test 2!" )
BASE:E( "Check if Test 1 and Test 3 are garbage collected!" )

View File

@@ -1,80 +1,80 @@
--- Object Repeat Scheduling.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
-- After 15 seconds, Test1 is nillified and Garbage Collect is done.
-- After 30 seconds, Test2 is nillified and Garbage Collect is done.
-- After 45 seconds, Test3 is nillified and Garbage Collect is done.
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
--
-- Three Test objects are created.
--
-- # Test cases:
--
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds.
-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds.
-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds.
--
-- # Status: TESTED - 13 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, Start, Repeat, Randomize, Stop
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
-- Nillify Test1 after 15 seconds and garbage collect.
local Nil1 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test1 and Garbage Collect" )
Test1 = nil
collectgarbage()
end, {}, 15 )
end
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
-- Nillify Test2 after 30 seconds and garbage collect.
local Nil2 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test2 and Garbage Collect" )
Test2 = nil
collectgarbage()
end, {}, 30 )
-- Nillify Test3 after 45 seconds and garbage collect.
local Nil3 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test3 and Garbage Collect" )
Test3 = nil
collectgarbage()
end, {}, 45 )
collectgarbage()
--- Object Repeat Scheduling.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 13 Dec 2016
--
-- # Situation
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
-- After 15 seconds, Test1 is nillified and Garbage Collect is done.
-- After 30 seconds, Test2 is nillified and Garbage Collect is done.
-- After 45 seconds, Test3 is nillified and Garbage Collect is done.
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
--
-- Three Test objects are created.
--
-- # Test cases:
--
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds.
-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds.
-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds.
--
-- # Status: TESTED - 13 Dec 2016
local TEST_BASE = {
ClassName = "TEST_BASE",
}
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
self = BASE:Inherit( self, BASE:New() )
self.TestScheduler = SCHEDULER:New( self,
function( Object, Message )
Object:E( Message )
end, { Message }, Start, Repeat, Randomize, Stop
)
return self
end
do
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
-- Nillify Test1 after 15 seconds and garbage collect.
local Nil1 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test1 and Garbage Collect" )
Test1 = nil
collectgarbage()
end, {}, 15 )
end
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
-- Nillify Test2 after 30 seconds and garbage collect.
local Nil2 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test2 and Garbage Collect" )
Test2 = nil
collectgarbage()
end, {}, 30 )
-- Nillify Test3 after 45 seconds and garbage collect.
local Nil3 = SCHEDULER:New( nil,
function()
BASE:E( "Nillify Test3 and Garbage Collect" )
Test3 = nil
collectgarbage()
end, {}, 45 )
collectgarbage()