Ejemplo n.º 1
0
 public override void InitState()
 {
     if (engine == null || part == null || vessel == null)
     {
         return;
     }
     //update thrust info
     UpdateThrustInfo();
     realIsp   = GetIsp((float)(part.staticPressureAtm), (float)(part.atmDensity / 1.225), (float)part.machNumber);
     flowMod   = GetFlowMod((float)(part.atmDensity / 1.225), (float)part.machNumber);
     thrustMod = realIsp * flowMod / zeroIsp;
     //update Role
     if (engine.throttleLocked && info.Role != TCARole.MANUAL)
     {
         info.SetRole(TCARole.MANUAL);
     }
     InitLimits();
     nominalFullThrust = nominalCurrentThrust(1);
     rotationEnabled   = info.Role != TCARole.MANEUVER ||
                         (info.Mode & ManeuverMode.TORQUE) == ManeuverMode.TORQUE;
     translationEnabled = info.Role != TCARole.MANEUVER ||
                          (info.Mode & ManeuverMode.TRANSLATION) == ManeuverMode.TRANSLATION;
     //            Utils.Log("Engine.InitState: {}\n" +
     //                      "wThrustDir {}\n" +
     //                      "wThrustPos {}\n" +
     //                      "zeroIsp {}, realIsp {}, flowMod {}, thrustMod {}\n" +
     //                      "P {}, Rho {}, Mach {}, multIsp {}, multFlow {}\n" +
     //                      "###############################################################",
     //                      name, wThrustDir, wThrustPos,
     //                      zeroIsp, realIsp, flowMod, thrustMod,
     //                      part.staticPressureAtm, part.atmDensity, part.machNumber,
     //                      engine.multIsp, engine.multFlow);//debug
 }
Ejemplo n.º 2
0
 public void SetRole(TCARole role)
 {
     info.SetRole(role);
 }