10
10
import org .team2363 .helixnavigator .document .waypoint .HCustomWaypoint ;
11
11
import org .team2363 .helixnavigator .global .Standards .SupportedUnits .SupportedAngularSpeed ;
12
12
import org .team2363 .helixnavigator .global .Standards .SupportedUnits .SupportedSpeed ;
13
+ import org .team2363 .lib .ui .validation .IntegerTextField ;
13
14
import org .team2363 .lib .ui .validation .UnitTextField ;
14
15
15
16
import javafx .scene .control .CheckBox ;
@@ -39,6 +40,8 @@ public class CustomWaypointEditDialog extends WaypointEditDialog {
39
40
private final CheckBox velocityYConstrainedCheckBox = new CheckBox ("Velocity Y" );
40
41
private final CheckBox velocityMagnitudeConstrainedCheckBox = new CheckBox ("Velocity Magnitude" );
41
42
private final CheckBox angularVelocityConstrainedCheckBox = new CheckBox ("Angular Velocity" );
43
+ private final Text controlIntervalCountText = new Text ("Control Interval Count:" );
44
+ private final IntegerTextField controlIntervalCountTextField = new IntegerTextField (0 , Integer .MAX_VALUE );
42
45
43
46
public CustomWaypointEditDialog (HCustomWaypoint customWaypoint ) {
44
47
super (customWaypoint , new HCustomWaypoint ());
@@ -52,9 +55,12 @@ public CustomWaypointEditDialog(HCustomWaypoint customWaypoint) {
52
55
GridPane .setConstraints (velocityYTextField , 1 , ADDITIONAL_PROPERTIES_ROW + 2 );
53
56
GridPane .setConstraints (angularVelocityText , 0 , ADDITIONAL_PROPERTIES_ROW + 3 );
54
57
GridPane .setConstraints (angularVelocityTextField , 1 , ADDITIONAL_PROPERTIES_ROW + 3 );
58
+ GridPane .setConstraints (controlIntervalCountText , 0 , ADDITIONAL_PROPERTIES_ROW + 4 );
59
+ GridPane .setConstraints (controlIntervalCountTextField , 1 , ADDITIONAL_PROPERTIES_ROW + 4 );
55
60
56
61
addGridItems (List .of (headingText , headingTextField , velocityXText , velocityXTextField ,
57
- velocityYText , velocityYTextField , angularVelocityText , angularVelocityTextField ));
62
+ velocityYText , velocityYTextField , angularVelocityText , angularVelocityTextField ,
63
+ controlIntervalCountText , controlIntervalCountTextField ));
58
64
59
65
vBox .getChildren ().add (ADDITIONAL_NODES_ROW , activeConstraints );
60
66
vBox .getChildren ().add (ADDITIONAL_NODES_ROW + 1 , xConstrainedCheckBox );
@@ -86,6 +92,7 @@ protected void initializeTextFields() {
86
92
velocityYConstrainedCheckBox .setSelected (customWaypoint .isVelocityYConstrained ());
87
93
velocityMagnitudeConstrainedCheckBox .setSelected (customWaypoint .isVelocityMagnitudeConstrained ());
88
94
angularVelocityConstrainedCheckBox .setSelected (customWaypoint .isAngularVelocityConstrained ());
95
+ controlIntervalCountTextField .setValue (customWaypoint .getControlIntervalCount ());
89
96
}
90
97
91
98
@ Override
@@ -102,6 +109,7 @@ protected void unbindWaypoint() {
102
109
customWaypoint .velocityYConstrainedProperty ().unbind ();
103
110
customWaypoint .velocityMagnitudeConstrainedProperty ().unbind ();
104
111
customWaypoint .angularVelocityConstrainedProperty ().unbind ();
112
+ customWaypoint .controlIntervalCountProperty ().unbind ();
105
113
}
106
114
107
115
@ Override
@@ -118,7 +126,7 @@ protected void bindWaypoint() {
118
126
customWaypoint .velocityYConstrainedProperty ().bind (velocityYConstrainedCheckBox .selectedProperty ());
119
127
customWaypoint .velocityMagnitudeConstrainedProperty ().bind (velocityMagnitudeConstrainedCheckBox .selectedProperty ());
120
128
customWaypoint .angularVelocityConstrainedProperty ().bind (angularVelocityConstrainedCheckBox .selectedProperty ());
121
-
129
+ customWaypoint . controlIntervalCountProperty (). bind ( controlIntervalCountTextField . valueProperty ());
122
130
}
123
131
124
132
@ Override
@@ -135,6 +143,7 @@ protected void backupWaypoint() {
135
143
backupCustomWaypoint .setVelocityYConstrained (customWaypoint .isVelocityYConstrained ());
136
144
backupCustomWaypoint .setVelocityMagnitudeConstrained (customWaypoint .isVelocityMagnitudeConstrained ());
137
145
backupCustomWaypoint .setAngularVelocityConstrained (customWaypoint .isAngularVelocityConstrained ());
146
+ backupCustomWaypoint .setControlIntervalCount (customWaypoint .getControlIntervalCount ());
138
147
}
139
148
140
149
@ Override
@@ -151,5 +160,6 @@ protected void restoreBackup() {
151
160
customWaypoint .setVelocityYConstrained (backupCustomWaypoint .isVelocityYConstrained ());
152
161
customWaypoint .setVelocityMagnitudeConstrained (backupCustomWaypoint .isVelocityMagnitudeConstrained ());
153
162
customWaypoint .setAngularVelocityConstrained (backupCustomWaypoint .isAngularVelocityConstrained ());
163
+ customWaypoint .setControlIntervalCount (backupCustomWaypoint .getControlIntervalCount ());
154
164
}
155
165
}
0 commit comments