diff --git a/README.md b/README.md index a586bdc..c33755f 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ A guide that documents the process of configuring advances parts of the scouting - `prematch` - Contains fields for initials, match number, and team number, and automatically selects the team based on the match number and driver station configured in the settings. *All inputs on this page feed into the `lib/utils/data/values/PrematchValues.dart` values.* - `qrcode` - Contains routes for scanning QR codes and managing related data for creating or saving them. - - `settings` - Provides the settings route where users configure event ID, QR code centerfold, team number editability, and other important settings for app functionality. + - `settings` - Provides the settings route where users configure event ID, team number editability, and other important settings for app functionality. *All inputs on this page feed into the `lib/utils/data/values/SettingValues.dart` values.* - `styles` - Contains widgets for easily generating headers and titles, as well as a set of colors used throughout the app to maintain uniformity in the scouting platform. - `utils` - Includes utilities like constants, value files, and helpers to support app functionality. diff --git a/assets/images/centerfolds/bottle_of_wotah_centerfold.png b/assets/images/centerfolds/bottle_of_wotah_centerfold.png deleted file mode 100644 index eae7062..0000000 Binary files a/assets/images/centerfolds/bottle_of_wotah_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/bruh_centerfold.png b/assets/images/centerfolds/bruh_centerfold.png deleted file mode 100644 index e28a044..0000000 Binary files a/assets/images/centerfolds/bruh_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/cheese.png b/assets/images/centerfolds/cheese.png deleted file mode 100644 index d0b8c2b..0000000 Binary files a/assets/images/centerfolds/cheese.png and /dev/null differ diff --git a/assets/images/centerfolds/huh_centerfold.png b/assets/images/centerfolds/huh_centerfold.png deleted file mode 100644 index acccef3..0000000 Binary files a/assets/images/centerfolds/huh_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/hungwy_centerfold.png b/assets/images/centerfolds/hungwy_centerfold.png deleted file mode 100644 index 3d9f3e8..0000000 Binary files a/assets/images/centerfolds/hungwy_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/jimmy_centerfold.png b/assets/images/centerfolds/jimmy_centerfold.png deleted file mode 100644 index 751c486..0000000 Binary files a/assets/images/centerfolds/jimmy_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/jqr_code_centerfold.png b/assets/images/centerfolds/jqr_code_centerfold.png deleted file mode 100644 index 61d80b4..0000000 Binary files a/assets/images/centerfolds/jqr_code_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/kiss_motore_centerfold.png b/assets/images/centerfolds/kiss_motore_centerfold.png deleted file mode 100644 index ecfc0d8..0000000 Binary files a/assets/images/centerfolds/kiss_motore_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/peppa_pig_centerfold.png b/assets/images/centerfolds/peppa_pig_centerfold.png deleted file mode 100644 index 433b994..0000000 Binary files a/assets/images/centerfolds/peppa_pig_centerfold.png and /dev/null differ diff --git a/assets/images/centerfolds/who_did_this_centerfold.png b/assets/images/centerfolds/who_did_this_centerfold.png deleted file mode 100644 index f9491c2..0000000 Binary files a/assets/images/centerfolds/who_did_this_centerfold.png and /dev/null differ diff --git a/lib/routes/auto/AutonomousDataRoute.dart b/lib/routes/auto/AutonomousDataRoute.dart index f4252ae..a1a4990 100644 --- a/lib/routes/auto/AutonomousDataRoute.dart +++ b/lib/routes/auto/AutonomousDataRoute.dart @@ -130,6 +130,13 @@ class _DataRouteState extends State { ), ], ), + // various right side data entry and labels + const AutonomousRightLabel1(), + const AutonomousRightRow1(), + const AutonomousRightLabel2(), + const AutonomousRightRow2(), + const AutonomousRightLabel3(), + const AutonomousRightRow3(), // robot information Align( alignment: Alignment.centerLeft, @@ -137,7 +144,7 @@ class _DataRouteState extends State { width: 400.0, padding: const EdgeInsets.only(top: 20.0, right: 0.0), child: Text( - "Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team # ${PrematchValues.teamNumber.text}", + "Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -145,13 +152,6 @@ class _DataRouteState extends State { fontSize: 15.0), ), )), - // various right side data entry and labels - const AutonomousRightLabel1(), - const AutonomousRightRow1(), - const AutonomousRightLabel2(), - const AutonomousRightRow2(), - const AutonomousRightLabel3(), - const AutonomousRightRow3(), ], ), ), diff --git a/lib/routes/comments/fields/CommentsFields.dart b/lib/routes/comments/fields/CommentsFields.dart index 8ce8fa3..69d6010 100644 --- a/lib/routes/comments/fields/CommentsFields.dart +++ b/lib/routes/comments/fields/CommentsFields.dart @@ -22,9 +22,61 @@ class _CommentsFields extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const TitleStyle( - text: "Auto Comments", - padding: EdgeInsets.only(top: 10.0, left: 18.0)), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const TitleStyle( + text: "Auto Comments", + padding: EdgeInsets.only(top: 10.0, left: 18.0)), + Row(children: [ + Align( + alignment: Alignment.bottomRight, + child: Container( + padding: EdgeInsets.only(right: 10), + height: 30.0, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppStyle + .textInputColorLight, // Set the background color here + ), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return const TeleopRoute(title: "Teleop/Endgame"); + })); + }, + child: const Text("< Teleop/Endgame", + style: TextStyle( + fontSize: 12.0, + fontFamily: "Helvetica", + color: Colors.white)), + ))), + Align( + alignment: Alignment.bottomRight, + child: Container( + padding: EdgeInsets.only(right: 60), + height: 30.0, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppStyle + .textInputColorLight, // Set the background color here + ), + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) { + return const QRCodeRoute(title: "QR Code"); + })); + }, + child: const Text("Current QR Code >", + style: TextStyle( + fontSize: 12.0, + fontFamily: "Helvetica", + color: Colors.white)), + ))), + ]), + ], + ), TextInputField( onChanged: (value) { setState(() { @@ -99,29 +151,6 @@ class _CommentsFields extends State { fontFamily: "Helvetica", color: Colors.white)), ))), - Align( - alignment: Alignment.bottomRight, - child: Container( - padding: const EdgeInsets.only( - top: 4.0, right: 40, left: 80.0, bottom: 20.0), - height: 80.0, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: AppStyle - .textInputColorLight, // Set the background color here - ), - onPressed: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) { - return const TeleopRoute(title: "Teleop/Endgame"); - })); - }, - child: const Text("< Teleop/Endgame", - style: TextStyle( - fontSize: 24.0, - fontFamily: "Helvetica", - color: Colors.white)), - ))) ], ); } diff --git a/lib/routes/qrcode/QRCodeRoute.dart b/lib/routes/qrcode/QRCodeRoute.dart index b6e8bd3..3bbbf70 100644 --- a/lib/routes/qrcode/QRCodeRoute.dart +++ b/lib/routes/qrcode/QRCodeRoute.dart @@ -117,3 +117,4 @@ class _QRCodeRouteState extends State { ); } } + diff --git a/lib/routes/settings/SettingsRoute.dart b/lib/routes/settings/SettingsRoute.dart index 6ed0c5b..3bdf75c 100644 --- a/lib/routes/settings/SettingsRoute.dart +++ b/lib/routes/settings/SettingsRoute.dart @@ -135,25 +135,6 @@ class _SettingsRoute extends State { ), Row( children: [ - Column( - children: [ - const TitleStyle( - text: "QR Code Centerfold", - padding: EdgeInsets.only(left: 30, top: 10)), - PlatformDropdownMenu( - margin: const EdgeInsets.only(top: 10, right: 30), - selectedItemFontSize: 10.0, - dropdownMenuSelectedItem: - SettingValues.currentSelectedCenterfold.text, - onChanged: (value) { - setState(() { - SettingValues.currentSelectedCenterfold.text = - value; - }); - }, - dropdownItems: OptionConstants.centerfolds), - ], - ), Column( children: [ const TitleStyle( diff --git a/lib/routes/teleop/TeleopRoute.dart b/lib/routes/teleop/TeleopRoute.dart index 48a0657..463a038 100644 --- a/lib/routes/teleop/TeleopRoute.dart +++ b/lib/routes/teleop/TeleopRoute.dart @@ -42,29 +42,12 @@ class _TeleopRouteState extends State { physics: const AlwaysScrollableScrollPhysics(), child: Column(children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.end, children: [ - Padding( - padding: const EdgeInsets.only(left: 20, top: 10.0), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - minimumSize: const Size(150.0, 40.0), - backgroundColor: AppStyle.textInputColor, - ), - onPressed: () { - showConformationDialog(context); - }, - child: const Text("Reset", - style: TextStyle( - fontSize: 14.0, - fontFamily: "Helvetica", - color: Colors.white)), - ), - ), Align( alignment: Alignment.bottomRight, child: Container( - padding: const EdgeInsets.only(top: 4.0, right: 60), + padding: const EdgeInsets.only(top: 4.0, right: 10), // height: 47.0, child: ElevatedButton( style: ElevatedButton.styleFrom( @@ -109,6 +92,14 @@ class _TeleopRouteState extends State { ))), ], ), + const TeleoperatedLabels4(), + const TeleoperatedFields4(), + const TeleoperatedLabels3(), + const TeleoperatedFields3(), + const TeleoperatedLabels2(), + const TeleoperatedFields2(), + const TeleoperatedLabels(), + const TeleoperatedFields(), // robot info Align( alignment: Alignment.centerLeft, @@ -116,7 +107,7 @@ class _TeleopRouteState extends State { width: 400.0, padding: const EdgeInsets.only(top: 20.0, left: 20.0), child: Text( - "Driver Station: ${SettingValues.selectedDriverStation.text}, Match #: ${PrematchValues.matchNumber.text}, Team #: ${PrematchValues.teamNumber.text}", + "Driver Station: ${SettingValues.selectedDriverStation.text}, Match #${PrematchValues.matchNumber.text}, Team #${PrematchValues.teamNumber.text}", textAlign: TextAlign.left, style: TextStyle( color: Colors.white, @@ -124,14 +115,6 @@ class _TeleopRouteState extends State { fontSize: 15.0), ), )), - const TeleoperatedLabels4(), - const TeleoperatedFields4(), - const TeleoperatedLabels3(), - const TeleoperatedFields3(), - const TeleoperatedLabels2(), - const TeleoperatedFields2(), - const TeleoperatedLabels(), - const TeleoperatedFields(), ]), ), ); diff --git a/lib/utils/data/constants/OptionConstants.dart b/lib/utils/data/constants/OptionConstants.dart index 1411c8e..25a8a7a 100644 --- a/lib/utils/data/constants/OptionConstants.dart +++ b/lib/utils/data/constants/OptionConstants.dart @@ -1,20 +1,6 @@ // ignore_for_file: file_names class OptionConstants { - static List centerfolds = [ - "bottle_of_wotah_centerfold", - "bruh_centerfold", - "cheese", - "huh_centerfold", - "hungwy_centerfold", - "jimmy_centerfold", - "jqr_code_centerfold", - "kiss_motore_centerfold", - "peppa_pig_centerfold", - "who_did_this_centerfold", - "none" - ]; - static final yesNoOptions = ["Yes", "No"]; static final startPositions = ["Left", "Center", "Right"]; diff --git a/lib/utils/data/values/AutonomousValues.dart b/lib/utils/data/values/AutonomousValues.dart index 8219ff4..d9749a5 100644 --- a/lib/utils/data/values/AutonomousValues.dart +++ b/lib/utils/data/values/AutonomousValues.dart @@ -67,7 +67,6 @@ class AutonomousValues { static TextEditingController l2F = TextEditingController(text: "0"); static TextEditingController l2G = TextEditingController(text: "0"); - static void resetAutoEtcValues() { AutonomousValues.autoStartPosition.text = "Center"; AutonomousValues.autoMobility.text = "No"; @@ -130,5 +129,4 @@ class AutonomousValues { 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 c9d0b10..f9afada 100644 --- a/lib/utils/data/values/CommentValues.dart +++ b/lib/utils/data/values/CommentValues.dart @@ -4,17 +4,13 @@ import 'package:flutter/material.dart'; class CommentValues { static final TextEditingController autoComments = TextEditingController(text: ""); - static final TextEditingController autoOrder = - TextEditingController(text: ""); static final TextEditingController teleopComments = 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 3b60c7e..12b2238 100644 --- a/lib/utils/data/values/EndgameValues.dart +++ b/lib/utils/data/values/EndgameValues.dart @@ -11,7 +11,6 @@ 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 @@ -19,5 +18,4 @@ class EndgameValues { EndgameValues.stopwatch.stop(); EndgameValues.stopwatch.reset(); } - } diff --git a/lib/utils/data/values/SettingValues.dart b/lib/utils/data/values/SettingValues.dart index 20611f3..be8583e 100644 --- a/lib/utils/data/values/SettingValues.dart +++ b/lib/utils/data/values/SettingValues.dart @@ -3,8 +3,6 @@ import 'package:flutter/material.dart'; import 'package:scouting_platform/utils/data/constants/AppConstants.dart'; class SettingValues { - static final TextEditingController currentSelectedCenterfold = - TextEditingController(text: "none"); static TextEditingController selectedDriverStation = TextEditingController(text: "Red 1"); diff --git a/lib/utils/data/values/TeleoperatedValues.dart b/lib/utils/data/values/TeleoperatedValues.dart index ae73d6e..e0ca4e2 100644 --- a/lib/utils/data/values/TeleoperatedValues.dart +++ b/lib/utils/data/values/TeleoperatedValues.dart @@ -19,7 +19,6 @@ class TeleoperatedValues { TextEditingController(text: "0"); static TextEditingController fieldCrosses = TextEditingController(text: "0"); - static void resetTeleopValues() { TeleoperatedValues.coralNearL1.text = "0"; TeleoperatedValues.coralNearL2.text = "0"; @@ -36,5 +35,4 @@ class TeleoperatedValues { TeleoperatedValues.humanPlayerMisses.text = "0"; TeleoperatedValues.fieldCrosses.text = "0"; } - } diff --git a/lib/utils/helpers/AppDataHelper.dart b/lib/utils/helpers/AppDataHelper.dart index f62bb60..26cc46c 100644 --- a/lib/utils/helpers/AppDataHelper.dart +++ b/lib/utils/helpers/AppDataHelper.dart @@ -22,6 +22,20 @@ class AppDataHelper { } } + static Future saveQRCodeCopy(String data) async { + final status = await Permission.storage.request(); + if (status.isGranted) { + final file = File( + "/storage/emulated/0/Documents/${AppConstants.defaultEventID}_output.csv"); + if (!await file.exists()) { + await file.create(); + } + await file.writeAsString("$data\n", mode: FileMode.append); + } else { + throw Exception('Permission denied'); + } + } + // Get the current event ID from a file called "current_event_id.txt" static Future getCurrentEventIDAndCurrentDriverStation() async { final status = await Permission.storage.request(); diff --git a/lib/utils/helpers/QRCodeHelper.dart b/lib/utils/helpers/QRCodeHelper.dart index 0decf2c..1c2b7bb 100644 --- a/lib/utils/helpers/QRCodeHelper.dart +++ b/lib/utils/helpers/QRCodeHelper.dart @@ -9,6 +9,7 @@ import 'package:scouting_platform/utils/data/values/EndgameValues.dart'; import 'package:scouting_platform/utils/data/values/PrematchValues.dart'; import 'package:scouting_platform/utils/data/values/SettingValues.dart'; import 'package:scouting_platform/utils/data/values/TeleoperatedValues.dart'; +import 'package:scouting_platform/utils/helpers/AppDataHelper.dart'; class QrcodeHelper { /// Returns a string that represents the contents of the QR code that will be generated and separates them with a "^" character @@ -28,6 +29,8 @@ class QrcodeHelper { // Encode to UTF-8 and then base64 to compress size and reduce issues with characters List utf8Encoded = utf8.encode(computedValues); + AppDataHelper.saveQRCodeCopy(computedValues); + return base64.encode(utf8Encoded); } @@ -109,38 +112,37 @@ class QrcodeHelper { /// Computes all teleoperated values and returns them as a single string separated by a caret static String computeTeleopValues() { return computeValues([ - parseInt(TeleoperatedValues.coralNearL1.text), // index: 55 - parseInt(TeleoperatedValues.coralNearL2.text), // index: 56 - parseInt(TeleoperatedValues.coralNearL3.text), // index: 57 - parseInt(TeleoperatedValues.coralNearL4.text), // index: 58 - parseInt(TeleoperatedValues.coralFarL1.text), // index: 59 - parseInt(TeleoperatedValues.coralFarL2.text), // index: 60 - parseInt(TeleoperatedValues.coralFarL3.text), // index: 61 - parseInt(TeleoperatedValues.coralFarL4.text), // index: 62 - parseInt(TeleoperatedValues.coralMissed.text), // index: 63 - parseInt(TeleoperatedValues.algaeRemoved.text), // index: 64 - parseInt(TeleoperatedValues.algaeProcessor.text), // index: 65 - parseInt(TeleoperatedValues.algaeBarge.text), // index: 66 - parseInt(TeleoperatedValues.humanPlayerMisses.text), // index: 67 - parseInt(TeleoperatedValues.fieldCrosses.text), // index: 68 + parseInt(TeleoperatedValues.coralNearL1.text), // index: 46 + parseInt(TeleoperatedValues.coralNearL2.text), // index: 47 + parseInt(TeleoperatedValues.coralNearL3.text), // index: 48 + parseInt(TeleoperatedValues.coralNearL4.text), // index: 49 + parseInt(TeleoperatedValues.coralFarL1.text), // index: 50 + parseInt(TeleoperatedValues.coralFarL2.text), // index: 51 + parseInt(TeleoperatedValues.coralFarL3.text), // index: 52 + parseInt(TeleoperatedValues.coralFarL4.text), // index: 53 + parseInt(TeleoperatedValues.coralMissed.text), // index: 54 + parseInt(TeleoperatedValues.algaeRemoved.text), // index: 55 + parseInt(TeleoperatedValues.algaeProcessor.text), // index: 56 + parseInt(TeleoperatedValues.algaeBarge.text), // index: 57 + parseInt(TeleoperatedValues.humanPlayerMisses.text), // index: 58 + parseInt(TeleoperatedValues.fieldCrosses.text), // index: 59 ]); } /// Computes all endgame values and returns them as a single string separated by a caret static String computeEndgameValues() { return computeValues([ - parseString(EndgameValues.endgame.text), // index: 69 - parseString(EndgameValues.climbTime.text), // index: 70 + parseString(EndgameValues.endgame.text), // index: 60 + parseString(EndgameValues.climbTime.text), // index: 61 ]); } /// Computes all comment values and returns them as a single string separated by a caret static String computeCommentValues() { return computeValues([ - parseString(stripEmoji(CommentValues.autoComments.text)), // index: 71 - parseString(stripEmoji(CommentValues.autoOrder.text)), // index: 72 - parseString(stripEmoji(CommentValues.teleopComments.text)), // index: 73 - parseString(stripEmoji(CommentValues.endgameComments.text)) // index: 74 + parseString(stripEmoji(CommentValues.autoComments.text)), // index: 62 + parseString(stripEmoji(CommentValues.teleopComments.text)), // index: 63 + parseString(stripEmoji(CommentValues.endgameComments.text)) // index: 64 ]); } @@ -149,7 +151,7 @@ class QrcodeHelper { return computeValues([ parseString(OptionConstants.availableDriverstations .indexOf(SettingValues.selectedDriverStation.text) - .toString()) // index: 75 + .toString()) // index: 65 ]); } diff --git a/pubspec.yaml b/pubspec.yaml index 50788ea..6c25548 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -70,17 +70,6 @@ flutter: - assets/images/reefscape/karthik-reef-diagram-top-shorter.png - assets/images/reefscape/karthik-reef-diagram-middle-compressed.png - assets/images/reefscape/karthik-reef-diagram-bottom-shorter.png - # QR code centerfolds - - assets/images/centerfolds/jqr_code_centerfold.png - - assets/images/centerfolds/jimmy_centerfold.png - - assets/images/centerfolds/peppa_pig_centerfold.png - - assets/images/centerfolds/kiss_motore_centerfold.png - - assets/images/centerfolds/bottle_of_wotah_centerfold.png - - assets/images/centerfolds/bruh_centerfold.png - - assets/images/centerfolds/huh_centerfold.png - - assets/images/centerfolds/hungwy_centerfold.png - - assets/images/centerfolds/who_did_this_centerfold.png - - assets/images/centerfolds/cheese.png # Custom fonts specific to team 1114 fonts: - family: "HesDeadJim"