1
0
Fork 0

Use framecount technique to improve performance

This commit is contained in:
legoboyvdlp R 2020-11-16 22:55:11 +00:00
parent d8a962d969
commit 5264de9b7f
4 changed files with 16 additions and 13 deletions

View file

@ -240,7 +240,9 @@ var IESIRecipient =
NewIESIRecipient.MainScreen = canvas_IESI.new("Aircraft/A320-family/Models/Instruments/IESI/res/iesi.svg", "A320 IESI");
}
if (math.mod(notifications.frameNotification.FrameCount,2) == 0) {
NewIESIRecipient.MainScreen.update(notification);
}
return emesary.Transmitter.ReceiptStatus_OK;
}
return emesary.Transmitter.ReceiptStatus_NotProcessed;

View file

@ -972,14 +972,14 @@ var UpperECAMRecipient =
EWDRecipient.MainScreen = canvas_upperECAM.new("Aircraft/A320-family/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg", "A320 E/WD CFM", "CFM");
}
}
if (math.mod(notifications.frameNotification.FrameCount,2) == 0) {
if (EWDRecipient.type) {
EWDRecipient.MainScreen.updateIAE(notification);
} else {
EWDRecipient.MainScreen.updateCFM(notification);
}
}
return emesary.Transmitter.ReceiptStatus_OK;
}
return emesary.Transmitter.ReceiptStatus_NotProcessed;

View file

@ -352,12 +352,13 @@ var ECAMRecipient =
{
if (notification.NotificationType == "FrameNotification")
{
debug.dump(notifications.frameNotification.FrameCount);
if (notifications.frameNotification.FrameCount == 5){
if (math.mod(notifications.frameNotification.FrameCount,5) == 0) {
ECAM.loop(notification);
} elsif (notifications.frameNotification.FrameCount == 7){
}
if (math.mod(notifications.frameNotification.FrameCount,10) == 0) {
phaseLoop();
} elsif (notifications.frameNotification.FrameCount == 10){
}
if (math.mod(notifications.frameNotification.FrameCount,10) == 5) {
ECAM_controller.loop(notification);
}
return emesary.Transmitter.ReceiptStatus_OK;

View file

@ -24,7 +24,7 @@ var cur_frame_inc = 0.05;
var execLoop = func
{
notifications.frameNotification.fetchvars();
if (notifications.frameNotification.FrameCount > 10) {
if (notifications.frameNotification.FrameCount > 20) {
notifications.frameNotification.FrameCount = 0;
}
emesary.GlobalTransmitter.NotifyAll(notifications.frameNotification);