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"); NewIESIRecipient.MainScreen = canvas_IESI.new("Aircraft/A320-family/Models/Instruments/IESI/res/iesi.svg", "A320 IESI");
} }
NewIESIRecipient.MainScreen.update(notification); if (math.mod(notifications.frameNotification.FrameCount,2) == 0) {
NewIESIRecipient.MainScreen.update(notification);
}
return emesary.Transmitter.ReceiptStatus_OK; return emesary.Transmitter.ReceiptStatus_OK;
} }
return emesary.Transmitter.ReceiptStatus_NotProcessed; return emesary.Transmitter.ReceiptStatus_NotProcessed;

View file

@ -972,13 +972,13 @@ var UpperECAMRecipient =
EWDRecipient.MainScreen = canvas_upperECAM.new("Aircraft/A320-family/Models/Instruments/Upper-ECAM/res/cfm-eis2.svg", "A320 E/WD CFM", "CFM"); 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) {
if (EWDRecipient.type) { EWDRecipient.MainScreen.updateIAE(notification);
EWDRecipient.MainScreen.updateIAE(notification); } else {
} else { EWDRecipient.MainScreen.updateCFM(notification);
EWDRecipient.MainScreen.updateCFM(notification);
}
} }
return emesary.Transmitter.ReceiptStatus_OK; return emesary.Transmitter.ReceiptStatus_OK;
} }

View file

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

View file

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