Somehow fixed the problem with the timer activating too soon by changing the timer start to when it is in the "inner process" of the main method

This commit is contained in:
cs-powell
2024-12-17 14:18:53 -05:00
parent 33a4b8eb7e
commit 0eafd83c5b
15 changed files with 267 additions and 75 deletions

View File

@@ -6,31 +6,29 @@ import Visualizer.visualizer;
public class testprocess1 extends testprocess {
public testprocess1(Model inputM, XPlaneConnect xpc) {
super(inputM, xpc);
public testprocess1() {
super();
}
@Override
public void innerProcess(visualizer vis1) {
float[] array = m.next();
public void innerProcess() {
double r = Math.random();
if (m.getModelQueueLength() < 5) {
if (r > 0.5) {
// m.createAction(ActionType.DELAY, null, 200, null);
m.createAction(ActionType.DELAY, null, 200, null);
m.createAction(ActionType.VISION, null, 0, "sim/cockpit2/gauges/indicators/compass_heading_deg_mag");
// m.createAction(ActionType.DELAY, null, 200, null);
m.createAction(ActionType.VISION, null, 0, "sim/cockpit2/gauges/indicators/airspeed_kts_pilot");
} else {
m.createAction(ActionType.VISION, null, 0, "sim/cockpit2/gauges/indicators/airspeed_kts_pilot");
}
}
// m.printModelQueue();
m.logData();
try {
vis1.updateVisualizer(m);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// try {
// vis1.updateVisualizer(m);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
}