private void useFlightConfigurationFromRemoteServer(ThrustMatrix tm) { if (flightConsoleConfig != null) { tm.m1 = flightConsoleConfig.tm.m1; tm.m2 = flightConsoleConfig.tm.m2; tm.m3 = flightConsoleConfig.tm.m3; tm.m4 = flightConsoleConfig.tm.m4; } }
private void calculatePitchCorrectionVector(ThrustMatrix tm) { // pitch difference double v = cv * Math.abs(getPitchDiviation()); if (getPitchDiviation() > 0) { tm.m3 += v; tm.m4 += v; } else { tm.m1 += v; tm.m2 += v; } }
private void calculateRollCorrectionVector(ThrustMatrix tm) { double v; // roll difference v = cv * Math.abs(getRollDiviation()); if (getRollDiviation() > 0) { tm.m2 += v; tm.m4 += v; } else { tm.m1 += v; tm.m3 += v; } }
private void normalizeCorrectionVector(ThrustMatrix tm) { double normalizationFactor = 1.0f; if (normalizationFactor < calculateNormalizationFactor(tm.m1)) { normalizationFactor = calculateNormalizationFactor(tm.m1); } if (normalizationFactor < calculateNormalizationFactor(tm.m2)) { normalizationFactor = calculateNormalizationFactor(tm.m2); } if (normalizationFactor < calculateNormalizationFactor(tm.m3)) { normalizationFactor = calculateNormalizationFactor(tm.m3); } if (normalizationFactor < calculateNormalizationFactor(tm.m4)) { normalizationFactor = calculateNormalizationFactor(tm.m4); } tm.m1 /= normalizationFactor; tm.m2 /= normalizationFactor; tm.m3 /= normalizationFactor; tm.m4 /= normalizationFactor; }