public AJEPropJSB(AJEPropJSB t) { name = t.name; deltaT = t.deltaT; GearRatio = t.GearRatio; numBlades = t.numBlades; J = t.J; RPM = t.RPM; Ixx = t.Ixx; Diameter = t.Diameter; MaxPitch = t.MaxPitch; MinPitch = t.MinPitch; MinRPM = t.MinRPM; MaxRPM = t.MaxRPM; Pitch = t.Pitch; P_Factor = t.P_Factor; Sense = t.Sense; Advance = t.Advance; ExcessTorque = t.ExcessTorque; D4 = t.D4; D5 = t.D5; HelicalTipMach = t.HelicalTipMach; Vinduced = t.Vinduced; vTorque = t.vTorque; if (t.cThrust != null) { cThrust = new FGTable(t.cThrust); } else { cThrustFP = t.cThrustFP; } if (t.cPower != null) { cPower = new FGTable(t.cPower); } else { cPowerFP = t.cPowerFP; } CtMach = t.CtMach; CpMach = t.CpMach; MachDrag = t.MachDrag; CtFactor = t.CtFactor; CpFactor = t.CpFactor; ConstantSpeed = t.ConstantSpeed; ReversePitch = t.ReversePitch; Reversed = t.Reversed; Reverse_coef = t.Reverse_coef; Feathered = t.Feathered; }
public SolverPropeller(ITorqueProducer eng, double power, double sfc, double gear, string propName, double minR, double maxR, double diam, double ixx) { engine = eng; maxPower = power; BSFC = sfc; gearRatio = gear; gearRatioRecip = 1d / gear; propJSB = new AJEPropJSB(propName, minR, maxR, diam, ixx); // set our prop stats diameter = propJSB.GetDiameter(); ixx = propJSB.GetIxx(); minRPM = propJSB.GetMinRPM(); maxRPM = propJSB.GetMaxRPM(); maxRPMRecip = 1d / maxRPM; }
// get prop from prefab void FixProp() { if(part.partInfo != null && part.partInfo.partPrefab.Modules.Contains("AJEPropeller")) { AJEPropeller prefab = (AJEPropeller)part.partInfo.partPrefab.Modules["AJEPropeller"]; propJSB = new AJEPropJSB(prefab.propJSB); } }
public AJEPropJSB(AJEPropJSB t) { name = t.name; deltaT = t.deltaT; GearRatio = t.GearRatio; numBlades = t.numBlades; J = t.J; RPM = t.RPM; Ixx = t.Ixx; Diameter = t.Diameter; MaxPitch = t.MaxPitch; MinPitch = t.MinPitch; MinRPM = t.MinRPM; MaxRPM = t.MaxRPM; Pitch = t.Pitch; P_Factor =t.P_Factor; Sense = t.Sense; Advance = t.Advance; ExcessTorque = t.ExcessTorque; D4 = t.D4; D5 = t.D5; HelicalTipMach = t.HelicalTipMach; Vinduced = t.Vinduced; vTorque = t.vTorque; if (t.cThrust != null) cThrust = new FGTable(t.cThrust); else cThrustFP = t.cThrustFP; if (t.cPower != null) cPower = new FGTable(t.cPower); else cPowerFP = t.cPowerFP; CtMach = t.CtMach; CpMach = t.CpMach; MachDrag = t.MachDrag; CtFactor = t.CtFactor; CpFactor = t.CpFactor; ConstantSpeed = t.ConstantSpeed; ReversePitch = t.ReversePitch; Reversed = t.Reversed; Reverse_coef = t.Reverse_coef; Feathered = t.Feathered; }
public override void OnStart(StartState state) { if (state == StartState.Editor) return; if (vessel == null) return; engine = new EngineWrapper(part); engine.IspMultiplier = IspMultiplier; engine.idle = idle; engine.useVelocityCurve = false; engine.ThrustUpperLimit = maxThrust; engine.useEngineResponseTime = false; part.maxTemp = 200f; engine.heatProduction = 10f; //v0 *= 0.5144f; //omega0 *= 0.1047f; //power0 *= 745.7f; //omega *= 0.1047f; //power *= 745.7f; //propeller = new AJEPropellerSolver(r0, v0 * 0.5144f, omega0 * PistonEngine.RPM2RADPS, rho0, power0 * PistonEngine.HP2W); pistonengine = new PistonEngine(power * PistonEngine.HP2W, maxRPM * PistonEngine.RPM2RADPS, BSFC); pistonengine._hasSuper = boost0 > 0; pistonengine.setBoostParams(wastegateMP * INHG2PA, boost0 * INHG2PA, boost1 * INHG2PA, rated0, rated1, cost1 * PistonEngine.HP2W, switchAlt, turbo); if (displacement > 0) pistonengine._displacement = displacement * PistonEngine.CIN2CM; pistonengine._compression = compression; pistonengine._coolerEffic = coolerEffic; pistonengine._coolerMin = coolerMin + CTOK; pistonengine._ramAir = ramAir; propJSB = new AJEPropJSB(propName, minRPM * gearratio, maxRPM * gearratio, propDiam, propIxx); if(propJSB.GetConstantSpeed() == 0) Fields["propPitch"].guiActive = false; if (exhaustThrust <= 0f) Fields["netExhaustThrust"].guiActive = false; if (meredithEffect <= 0f) Fields["netMeredithEffect"].guiActive = false; pistonengine.ComputeVEMultiplier(); // given newly-set stats omega = 30; // start slow }