public FGTable(FGTable t) { Data = t.Data; nRows = t.nRows; nCols = t.nCols; lastRowIndex = t.lastRowIndex; lastColumnIndex = t.lastColumnIndex; }
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; }
void SetDefaults() { MaxPitch = MinPitch = P_Factor = Pitch = Advance = MinRPM = MaxRPM = deltaT = 0.0; Sense = 1; // default clockwise rotation ReversePitch = 0.0; Reversed = false; Feathered = false; Reverse_coef = 0.0; GearRatio = 1.0; CtFactor = CpFactor = CpTweak = CtTweak = MachPowTweak = 1.0; ConstantSpeed = 1; // assume constant speed unless told otherwise cThrust = null; cThrustFP = null; cPower = null; cPowerFP = null; CtMach = null; CpMach = null; MachDrag = null; Vinduced = 0.0; }
public void Load(ConfigNode node) { if (node.HasNode("PROPELLER")) { node = node.GetNode("PROPELLER"); } if (node.HasValue("name")) { name = node.GetValue("name"); } if (node.HasValue("ixx")) { Ixx = double.Parse(node.GetValue("ixx")); } if (node.HasValue("ixxFTLB")) { Ixx = double.Parse(node.GetValue("ixxFTLB")) * FTLBTOJ; } if (node.HasValue("diameterIN")) { Diameter = double.Parse(node.GetValue("diameterIN")) * INTOM; } if (node.HasValue("diameterFT")) { Diameter = double.Parse(node.GetValue("diameterFT")) * FTTOM; } if (node.HasValue("diameter")) { Diameter = double.Parse(node.GetValue("diameter")); } if (node.HasValue("numblades")) { numBlades = int.Parse(node.GetValue("numblades")); } if (node.HasValue("gearratio")) { GearRatio = double.Parse(node.GetValue("gearratio")); } if (node.HasValue("minpitch")) { MinPitch = double.Parse(node.GetValue("minpitch")); } if (node.HasValue("maxpitch")) { MaxPitch = double.Parse(node.GetValue("maxpitch")); } if (node.HasValue("minrpm")) { MinRPM = double.Parse(node.GetValue("minrpm")); } if (node.HasValue("maxrpm")) { MaxRPM = double.Parse(node.GetValue("maxrpm")); ConstantSpeed = 1; } if (node.HasValue("constspeed")) { ConstantSpeed = int.Parse(node.GetValue("constspeed")); } if (node.HasValue("reversepitch")) { ReversePitch = double.Parse(node.GetValue("reversepitch")); } if (node.HasNode("cThrust")) { cThrust = new FGTable(node.GetNode("cThrust")); } if (node.HasNode("cThrustFP")) { cThrustFP = new FloatCurve(); cThrustFP.Load(node.GetNode("cThrustFP")); } if (node.HasNode("cPower")) { cPower = new FGTable(node.GetNode("cPower")); } if (node.HasNode("cPowerFP")) { cPowerFP = new FloatCurve(); cPowerFP.Load(node.GetNode("cPowerFP")); } if (node.HasNode("CtMach")) { CtMach = new FloatCurve(); CtMach.Load(node.GetNode("CtMach")); } if (node.HasNode("CpMach")) { CpMach = new FloatCurve(); CpMach.Load(node.GetNode("CpMach")); } if (node.HasNode("MachDrag")) { MachDrag = new FloatCurve(); MachDrag.Load(node.GetNode("MachDrag")); } if (node.HasValue("sense")) { Sense = double.Parse(node.GetValue("sense")); } SetSense(Sense >= 0.0 ? 1.0 : -1.0); if (node.HasValue("P_Factor")) { P_Factor = double.Parse(node.GetValue("P_Factor")); } if (node.HasValue("ct_factor")) { SetCtFactor(double.Parse(node.GetValue("ct_factor"))); } if (node.HasValue("cp_factor")) { SetCpFactor(double.Parse(node.GetValue("cp_factor"))); } CalcDefaults(); // persistent values if (node.HasValue("RPM")) { RPM = double.Parse(node.GetValue("RPM")); } if (node.HasValue("Pitch")) { Pitch = double.Parse(node.GetValue("Pitch")); } if (node.HasValue("Feathered")) { Feathered = bool.Parse(node.GetValue("Feathered")); } if (node.HasValue("Reversed")) { Reversed = bool.Parse(node.GetValue("Reversed")); } }
public void Load(ConfigNode node) { if (node.HasNode("PROPELLER")) node = node.GetNode("PROPELLER"); if (node.HasValue("name")) name = node.GetValue("name"); if (node.HasValue("ixx")) Ixx = double.Parse(node.GetValue("ixx")); if (node.HasValue("ixxFTLB")) Ixx = double.Parse(node.GetValue("ixxFTLB")) * FTLBTOJ; if (node.HasValue("diameterIN")) Diameter = double.Parse(node.GetValue("diameterIN")) * INTOM; if (node.HasValue("diameterFT")) Diameter = double.Parse(node.GetValue("diameterFT")) * FTTOM; if (node.HasValue("diameter")) Diameter = double.Parse(node.GetValue("diameter")); if (node.HasValue("numblades")) numBlades = int.Parse(node.GetValue("numblades")); if (node.HasValue("gearratio")) GearRatio = double.Parse(node.GetValue("gearratio")); if (node.HasValue("minpitch")) MinPitch = double.Parse(node.GetValue("minpitch")); if (node.HasValue("maxpitch")) MaxPitch = double.Parse(node.GetValue("maxpitch")); if (node.HasValue("minrpm")) MinRPM = double.Parse(node.GetValue("minrpm")); if (node.HasValue("maxrpm")) { MaxRPM = double.Parse(node.GetValue("maxrpm")); ConstantSpeed = 1; } if (node.HasValue("constspeed")) ConstantSpeed = int.Parse(node.GetValue("constspeed")); if (node.HasValue("reversepitch")) ReversePitch = double.Parse(node.GetValue("reversepitch")); if (node.HasNode("cThrust")) cThrust = new FGTable(node.GetNode("cThrust")); if (node.HasNode("cThrustFP")) { cThrustFP = new FloatCurve(); cThrustFP.Load(node.GetNode("cThrustFP")); } if (node.HasNode("cPower")) cPower = new FGTable(node.GetNode("cPower")); if (node.HasNode("cPowerFP")) { cPowerFP = new FloatCurve(); cPowerFP.Load(node.GetNode("cPowerFP")); } if (node.HasNode("CtMach")) { CtMach = new FloatCurve(); CtMach.Load(node.GetNode("CtMach")); } if (node.HasNode("CpMach")) { CpMach = new FloatCurve(); CpMach.Load(node.GetNode("CpMach")); } if (node.HasNode("MachDrag")) { MachDrag = new FloatCurve(); MachDrag.Load(node.GetNode("MachDrag")); } if (node.HasValue("sense")) Sense = double.Parse(node.GetValue("sense")); SetSense(Sense >= 0.0 ? 1.0 : -1.0); if (node.HasValue("P_Factor")) P_Factor = double.Parse(node.GetValue("P_Factor")); if (node.HasValue("ct_factor")) SetCtFactor(double.Parse(node.GetValue("ct_factor"))); if (node.HasValue("cp_factor")) SetCpFactor(double.Parse(node.GetValue("cp_factor"))); CalcDefaults(); // persistent values if (node.HasValue("RPM")) RPM = double.Parse(node.GetValue("RPM")); if (node.HasValue("Pitch")) Pitch = double.Parse(node.GetValue("Pitch")); if (node.HasValue("Feathered")) Feathered = bool.Parse(node.GetValue("Feathered")); if (node.HasValue("Reversed")) Reversed = bool.Parse(node.GetValue("Reversed")); }
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; }