diff --git a/lib/utils/data/values/AutonomousValues.dart b/lib/utils/data/values/AutonomousValues.dart index 0c4741f..8219ff4 100644 --- a/lib/utils/data/values/AutonomousValues.dart +++ b/lib/utils/data/values/AutonomousValues.dart @@ -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"; + } + } diff --git a/lib/utils/data/values/CommentValues.dart b/lib/utils/data/values/CommentValues.dart index f3b4b9e..c9d0b10 100644 --- a/lib/utils/data/values/CommentValues.dart +++ b/lib/utils/data/values/CommentValues.dart @@ -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 = ""; + } } diff --git a/lib/utils/data/values/EndgameValues.dart b/lib/utils/data/values/EndgameValues.dart index c50477c..3b60c7e 100644 --- a/lib/utils/data/values/EndgameValues.dart +++ b/lib/utils/data/values/EndgameValues.dart @@ -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(); + } + } diff --git a/lib/utils/data/values/TeleoperatedValues.dart b/lib/utils/data/values/TeleoperatedValues.dart index ccf1381..ae73d6e 100644 --- a/lib/utils/data/values/TeleoperatedValues.dart +++ b/lib/utils/data/values/TeleoperatedValues.dart @@ -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"; + } + } diff --git a/lib/utils/helpers/AppDataHelper.dart b/lib/utils/helpers/AppDataHelper.dart index cfcbe90..f62bb60 100644 --- a/lib/utils/helpers/AppDataHelper.dart +++ b/lib/utils/helpers/AppDataHelper.dart @@ -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(); } }