Skip to content

Commit

Permalink
move reset methods to respective value file
Browse files Browse the repository at this point in the history
  • Loading branch information
HoodieRocks committed Jan 12, 2025
1 parent bff042a commit 83a07f4
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 100 deletions.
65 changes: 65 additions & 0 deletions lib/utils/data/values/AutonomousValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,69 @@ class AutonomousValues {
static TextEditingController l2E = TextEditingController(text: "0");
static TextEditingController l2F = TextEditingController(text: "0");
static TextEditingController l2G = TextEditingController(text: "0");


static void resetAutoEtcValues() {
AutonomousValues.autoStartPosition.text = "Center";
AutonomousValues.autoMobility.text = "No";
AutonomousValues.coralMissed.text = "0";
AutonomousValues.coralHP.text = "0";
AutonomousValues.coralField.text = "0";
AutonomousValues.algaeRemoved.text = "0";
AutonomousValues.algaeBarge.text = "0";
AutonomousValues.algaeProcessor.text = "0";
}

static void resetAutoReef() {
// tough coral
AutonomousValues.l1E.text = "0";
AutonomousValues.l1NE.text = "0";
AutonomousValues.l1NW.text = "0";
AutonomousValues.l1SE.text = "0";
AutonomousValues.l1SW.text = "0";
AutonomousValues.l1W.text = "0";

// L2 coral
AutonomousValues.l2A.text = "0";
AutonomousValues.l2B.text = "0";
AutonomousValues.l2C.text = "0";
AutonomousValues.l2D.text = "0";
AutonomousValues.l2E.text = "0";
AutonomousValues.l2F.text = "0";
AutonomousValues.l2G.text = "0";
AutonomousValues.l2H.text = "0";
AutonomousValues.l2I.text = "0";
AutonomousValues.l2J.text = "0";
AutonomousValues.l2K.text = "0";
AutonomousValues.l2L.text = "0";

// L3 coral
AutonomousValues.l3A.text = "0";
AutonomousValues.l3B.text = "0";
AutonomousValues.l3C.text = "0";
AutonomousValues.l3D.text = "0";
AutonomousValues.l3E.text = "0";
AutonomousValues.l3F.text = "0";
AutonomousValues.l3G.text = "0";
AutonomousValues.l3H.text = "0";
AutonomousValues.l3I.text = "0";
AutonomousValues.l3J.text = "0";
AutonomousValues.l3K.text = "0";
AutonomousValues.l3L.text = "0";

// L4 coral
AutonomousValues.l4A.text = "0";
AutonomousValues.l4B.text = "0";
AutonomousValues.l4C.text = "0";
AutonomousValues.l4D.text = "0";
AutonomousValues.l4E.text = "0";
AutonomousValues.l4F.text = "0";
AutonomousValues.l4G.text = "0";
AutonomousValues.l4H.text = "0";
AutonomousValues.l4I.text = "0";
AutonomousValues.l4J.text = "0";
AutonomousValues.l4K.text = "0";
AutonomousValues.l4L.text = "0";
}

}
8 changes: 8 additions & 0 deletions lib/utils/data/values/CommentValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ class CommentValues {
TextEditingController(text: "");
static final TextEditingController endgameComments =
TextEditingController(text: "");


static void resetComments() {
CommentValues.autoComments.text = "";
CommentValues.autoOrder.text = "";
CommentValues.teleopComments.text = "";
CommentValues.endgameComments.text = "";
}
}
10 changes: 10 additions & 0 deletions lib/utils/data/values/EndgameValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ class EndgameValues {

static TextEditingController endgame = TextEditingController(text: "No");
static TextEditingController climbTime = TextEditingController(text: "0");


static void resetEndgameValues() {
EndgameValues.endgame.text = "No"; // was climb, now endgame
EndgameValues.climbTime.text = "0"; // parked was below
EndgameValues.stopwatchState.text = "0";
EndgameValues.stopwatch.stop();
EndgameValues.stopwatch.reset();
}

}
19 changes: 19 additions & 0 deletions lib/utils/data/values/TeleoperatedValues.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,23 @@ class TeleoperatedValues {
static TextEditingController humanPlayerMisses =
TextEditingController(text: "0");
static TextEditingController fieldCrosses = TextEditingController(text: "0");


static void resetTeleopValues() {
TeleoperatedValues.coralNearL1.text = "0";
TeleoperatedValues.coralNearL2.text = "0";
TeleoperatedValues.coralNearL3.text = "0";
TeleoperatedValues.coralNearL4.text = "0";
TeleoperatedValues.coralFarL1.text = "0";
TeleoperatedValues.coralFarL2.text = "0";
TeleoperatedValues.coralFarL3.text = "0";
TeleoperatedValues.coralFarL4.text = "0";
TeleoperatedValues.coralMissed.text = "0";
TeleoperatedValues.algaeRemoved.text = "0";
TeleoperatedValues.algaeProcessor.text = "0";
TeleoperatedValues.algaeBarge.text = "0";
TeleoperatedValues.humanPlayerMisses.text = "0";
TeleoperatedValues.fieldCrosses.text = "0";
}

}
105 changes: 5 additions & 100 deletions lib/utils/helpers/AppDataHelper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,105 +38,10 @@ class AppDataHelper {
}

static void resetStates() {
resetAutoEtcValues();
resetAutoReef();
resetTeleopValues();
resetEndgameValues();
resetComments();
}

static void resetAutoEtcValues() {
AutonomousValues.autoStartPosition.text = "Center";
AutonomousValues.autoMobility.text = "No";
AutonomousValues.coralMissed.text = "0";
AutonomousValues.coralHP.text = "0";
AutonomousValues.coralField.text = "0";
AutonomousValues.algaeRemoved.text = "0";
AutonomousValues.algaeBarge.text = "0";
AutonomousValues.algaeProcessor.text = "0";
}

static void resetAutoReef() {
// tough coral
AutonomousValues.l1E.text = "0";
AutonomousValues.l1NE.text = "0";
AutonomousValues.l1NW.text = "0";
AutonomousValues.l1SE.text = "0";
AutonomousValues.l1SW.text = "0";
AutonomousValues.l1W.text = "0";

// L2 coral
AutonomousValues.l2A.text = "0";
AutonomousValues.l2B.text = "0";
AutonomousValues.l2C.text = "0";
AutonomousValues.l2D.text = "0";
AutonomousValues.l2E.text = "0";
AutonomousValues.l2F.text = "0";
AutonomousValues.l2G.text = "0";
AutonomousValues.l2H.text = "0";
AutonomousValues.l2I.text = "0";
AutonomousValues.l2J.text = "0";
AutonomousValues.l2K.text = "0";
AutonomousValues.l2L.text = "0";

// L3 coral
AutonomousValues.l3A.text = "0";
AutonomousValues.l3B.text = "0";
AutonomousValues.l3C.text = "0";
AutonomousValues.l3D.text = "0";
AutonomousValues.l3E.text = "0";
AutonomousValues.l3F.text = "0";
AutonomousValues.l3G.text = "0";
AutonomousValues.l3H.text = "0";
AutonomousValues.l3I.text = "0";
AutonomousValues.l3J.text = "0";
AutonomousValues.l3K.text = "0";
AutonomousValues.l3L.text = "0";

// L4 coral
AutonomousValues.l4A.text = "0";
AutonomousValues.l4B.text = "0";
AutonomousValues.l4C.text = "0";
AutonomousValues.l4D.text = "0";
AutonomousValues.l4E.text = "0";
AutonomousValues.l4F.text = "0";
AutonomousValues.l4G.text = "0";
AutonomousValues.l4H.text = "0";
AutonomousValues.l4I.text = "0";
AutonomousValues.l4J.text = "0";
AutonomousValues.l4K.text = "0";
AutonomousValues.l4L.text = "0";
}

static void resetTeleopValues() {
TeleoperatedValues.coralNearL1.text = "0";
TeleoperatedValues.coralNearL2.text = "0";
TeleoperatedValues.coralNearL3.text = "0";
TeleoperatedValues.coralNearL4.text = "0";
TeleoperatedValues.coralFarL1.text = "0";
TeleoperatedValues.coralFarL2.text = "0";
TeleoperatedValues.coralFarL3.text = "0";
TeleoperatedValues.coralFarL4.text = "0";
TeleoperatedValues.coralMissed.text = "0";
TeleoperatedValues.algaeRemoved.text = "0";
TeleoperatedValues.algaeProcessor.text = "0";
TeleoperatedValues.algaeBarge.text = "0";
TeleoperatedValues.humanPlayerMisses.text = "0";
TeleoperatedValues.fieldCrosses.text = "0";
}

static void resetEndgameValues() {
EndgameValues.endgame.text = "No"; // was climb, now endgame
EndgameValues.climbTime.text = "0"; // parked was below
EndgameValues.stopwatchState.text = "0";
EndgameValues.stopwatch.stop();
EndgameValues.stopwatch.reset();
}

static void resetComments() {
CommentValues.autoComments.text = "";
CommentValues.autoOrder.text = "";
CommentValues.teleopComments.text = "";
CommentValues.endgameComments.text = "";
AutonomousValues.resetAutoEtcValues();
AutonomousValues.resetAutoReef();
TeleoperatedValues.resetTeleopValues();
EndgameValues.resetEndgameValues();
CommentValues.resetComments();
}
}

0 comments on commit 83a07f4

Please sign in to comment.