- Controller class controls common tasks and options.
- Telemetri is a class which gets new options from API
What im trying to do is;
when telemetri gets new Interval value, change the interval of the timer.
Both classes has referances to each other. What is the correct order to create them? I took controller up and down in lines.
So if two classes has referances to eachother. Which order should i create them?
Thank you very much.
Code: Select all
#Persistent
global Telemetri := new Telemetri_class()
global Controller := new Controller_class()
class Controller_class {
;Main options and functions here.
__New() {
SetTimer, % Telemetri.Tele(), 20000
}
changeTelemetriInterval(_interval) {
SetTimer, % Telemetri.Tele(), % _interval
}
}
class Telemetri_class {
;Do some API CALLS
;get new interval value
__New() {
;Controller.changeTelemetriInterval(60000)
}
Tele() {
MsgBox, Telemetri is in action
;new data arrived which is 60000
Controller.changeTelemetriInterval(60000)
}
}