@@ -23,6 +23,10 @@ public class PAPITypeManager : ILightTypeManager
2323
2424 private bool _guiInitialized = false ;
2525
26+ private double _initialGlideslopeValue = PAPIArray . DefaultTargetGlidePath ;
27+
28+ private double _initialTargetGlideslopeValue = PAPIArray . DefaultGlideslopeTolerance ;
29+
2630 #region ILightTypeManager Members
2731
2832 public void Initialize ( ILightGroup group )
@@ -31,26 +35,33 @@ public void Initialize(ILightGroup group)
3135
3236 foreach ( var lightArray in group . LightArrays . OfType < PAPIArray > ( ) )
3337 {
34- Util . LogInfo ( lightArray ) ;
3538 _papiArrays . Add ( lightArray ) ;
39+
40+ _initialTargetGlideslopeValue = lightArray . GlideslopeTolerance ;
41+ _initialGlideslopeValue = lightArray . TargetGlideslope ;
3642 }
3743
3844 group . LightArrayAdded += ( sender , arguments ) =>
39- {
40- var papi = arguments . Array as PAPIArray ;
41- if ( papi != null )
4245 {
46+ var papi = arguments . Array as PAPIArray ;
47+ if ( papi == null )
48+ {
49+ return ;
50+ }
51+
4352 _papiArrays . Add ( papi ) ;
44- }
45- } ;
53+
54+ _initialTargetGlideslopeValue = papi . GlideslopeTolerance ;
55+ _initialGlideslopeValue = papi . TargetGlideslope ;
56+ } ;
4657 }
4758
4859 public void OnGui ( int windowID )
4960 {
5061 if ( ! _guiInitialized )
5162 {
52- _glideslopeField = new EditableGUIField < double > ( PAPIArray . DefaultTargetGlidePath , DoubleConvertDelegate ) ;
53- _glideslopeToleranceField = new EditableGUIField < double > ( PAPIArray . DefaultGlideslopeTolerance , DoubleConvertDelegate ) ;
63+ _glideslopeField = new EditableGUIField < double > ( _initialGlideslopeValue , DoubleConvertDelegate ) ;
64+ _glideslopeToleranceField = new EditableGUIField < double > ( _initialTargetGlideslopeValue , DoubleConvertDelegate ) ;
5465
5566 _guiInitialized = true ;
5667 }
@@ -63,7 +74,7 @@ public void OnGui(int windowID)
6374
6475 #endregion
6576
66- private void DoDegreeField < T > ( string name , EditableGUIField < T > field )
77+ private static void DoDegreeField < T > ( string name , EditableGUIField < T > field )
6778 {
6879 GUILayout . BeginHorizontal ( ) ;
6980 {
0 commit comments