Skip to content

Commit

Permalink
Remove legacy PF tooling code.
Browse files Browse the repository at this point in the history
It's been 2 months now.
  • Loading branch information
siimav committed Aug 4, 2024
1 parent 538621d commit b6845d5
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions Source/RP0/Tooling/ModuleToolingPFSide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class ModuleToolingPFSide : ModuleToolingDiamLen
protected PartModule pmDecoupler;

protected BaseField diameterFld, heightFld, hingeEnabledFld, fairingStagedFld;
[Obsolete]
protected BaseField baseRad, maxRad, cylEnd, sideThickness, inlineHeight, noseHeightRatio;

protected bool EnsureFields()
{
Expand All @@ -39,15 +37,7 @@ protected bool EnsureFields()
hingeEnabledFld = pmFairing.Fields["hingeEnabled"];
fairingStagedFld = pmDecoupler.Fields["fairingStaged"];

//TODO: legacy code, remove all those at a later date
baseRad = pmFairing.Fields["baseRad"];
maxRad = pmFairing.Fields["maxRad"];
cylEnd = pmFairing.Fields["cylEnd"];
sideThickness = pmFairing.Fields["sideThickness"];
inlineHeight = pmFairing.Fields["inlineHeight"];
noseHeightRatio = pmFairing.Fields["noseHeightRatio"];

if (baseRad == null && diameterFld == null)
if (diameterFld == null)
{
RP0Debug.LogError($"[ModuleTooling] Could not bind to ProceduralFairingSide fields on {part}");
return false;
Expand Down Expand Up @@ -96,19 +86,6 @@ public override void GetDimensions(out float diam, out float len)
diam = diameterFld.GetValue<float>(pmFairing);
len = heightFld.GetValue<float>(pmFairing);
}
else
{
//TODO: legacy code, remove all those at a later date
float baseRadF, maxRadF, cylEndF, sideThicknessF, inlineHeightF, noseHeightRatioF;
baseRadF = baseRad.GetValue<float>(pmFairing);
maxRadF = maxRad.GetValue<float>(pmFairing);
cylEndF = cylEnd.GetValue<float>(pmFairing);
sideThicknessF = sideThickness.GetValue<float>(pmFairing);
inlineHeightF = inlineHeight.GetValue<float>(pmFairing);
noseHeightRatioF = noseHeightRatio.GetValue<float>(pmFairing);
diam = (Math.Max(baseRadF, maxRadF) + sideThicknessF) * 2f;
len = (inlineHeightF > 0) ? inlineHeightF : (noseHeightRatioF * diam / 2) + cylEndF;
}
}

public void UpdateToolingAndCosts()
Expand Down

0 comments on commit b6845d5

Please sign in to comment.