Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/hatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 17 additions & 2 deletions lib/metrics.dart

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional note: I don't think you meant to include these changes on this branch. not super impactful in this particular case but just to be careful, it's worth double-checking your changes before you commit and what branch you're making a new one off of

Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ List<BreakdownData> breakdowns = [
BreakdownSegmentData(
localizedNameSingular: "Defending", path: "DEFENDING"),
BreakdownSegmentData(localizedNameSingular: "Immobile", path: "IMMOBILE"),
BreakdownSegmentData(localizedNameSingular: "Stealing", path: "STEALING"),
],
),
BreakdownData(
Expand Down Expand Up @@ -370,8 +371,22 @@ List<BreakdownData> breakdowns = [
path: "STOP_TO_SHOOT",
),
BreakdownSegmentData(
localizedNameSingular: "Dump",
path: "DUMP",
localizedNameSingular: "Push",
path: "PUSH",
),
],
),
BreakdownData(
localizedName: "Stealing Type",
path: "stealerType",
segments: [
BreakdownSegmentData(
localizedNameSingular: "To Alliance Zone",
path: "TO_ALLIANCE",
),
BreakdownSegmentData(
localizedNameSingular: "To Neutral Zone",
path: "TO_NEUTRAL",
),
],
)
Expand Down
13 changes: 8 additions & 5 deletions lib/pages/raw_scout_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,7 @@ extension EndgameClimbResultExtension on EndgameClimbResult {
}
}

enum FeederType {
continuous,
stopToShoot,
dump,
}
enum FeederType { continuous, stopToShoot, dump, push }

extension FeederTypeName on FeederType {
String get description {
Expand All @@ -754,10 +750,17 @@ extension FeederTypeName on FeederType {
return "Dump";
case FeederType.stopToShoot:
return "Stop to Shoot";
case FeederType.push:
return "Push";
}
}
}

enum StealerType {
toAlliance,
toNeutral,
}

enum AutoClimbResult {
notAttempted,
failed,
Expand Down
26 changes: 20 additions & 6 deletions lib/reusable/lovat_api/get_scout_report_analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ extension GetScoutReportAnalysis on LovatAPI {
}

final json = jsonDecode(response!.body);
//final json = jsonDecode(
// '{"totalPoints":200,"driverAbility":0,"robotRoles":[0,1,2,3,4],"climb":3,"autoClimb":0,"autoClimbStartTime":0,"contactDefenseTime":0,"campingDefenseTime":0,"scoringRate":12.3,"feedingRate":10.7,"defenseEffectiveness":0,"feeds":0, "volleys": 3, "ballsFed": 23, "accuracy":4,"feederType":[0],"climbResult":0,"climbStartTime":0,"autoPath":{"autoPoints":60,"positions":[{"location":2,"event":0,"time":2},{"location":2,"event":1,"time":7},{"location":0,"event":2,"time":0},{"location":5,"event":7,"time":1},{"location":7,"event":1,"time":13},{"location":5,"event":4,"time":0},{"location":7,"event":7,"time":0}],"match":"2025casf_qm3_5","tournamentName":"San Francisco Regional"},"note":"this is a test disregard","robotBrokeDescription":"robot go boom","timeStamp":"1970-01-01T00:00:00.000Z"}');

// final json = jsonDecode(
// '{"totalPoints":200,"driverAbility":0,"robotRoles":[0,1,2,3,4],"climb":3,"autoClimb":0,"autoClimbStartTime":0,"contactDefenseTime":0,"campingDefenseTime":0,"scoringRate":12.3,"feedingRate":10.7,"defenseEffectiveness":0,"feeds":0, "volleys": 3, "ballsFed": 23, "accuracy":4,"feederType":[0],"climbResult":0,"climbStartTime":0,"autoPath":{"autoPoints":60,"positions":[{"location":2,"event":0,"time":2},{"location":2,"event":1,"time":7},{"location":0,"event":2,"time":0},{"location":5,"event":7,"time":1},{"location":7,"event":1,"time":13},{"location":5,"event":4,"time":0},{"location":7,"event":7,"time":0}],"match":"2025casf_qm3_5","tournamentName":"San Francisco Regional"},"note":"this is a test disregard","robotBrokeDescription":"robot go boom","timeStamp":"1970-01-01T00:00:00.000Z"}');

return SingleScoutReportAnalysis.fromJson(json);
}
Expand Down Expand Up @@ -61,7 +62,7 @@ class SingleScoutReportAnalysis {
final num campingDefenseTime;
final num scoringRate;
final num feedingRate;
final num defenseEffectiveness;
final num? defenseEffectiveness;
final num feeds;
final num? accuracy;
final EndgameClimbResult climbResult;
Expand Down Expand Up @@ -91,13 +92,26 @@ class SingleScoutReportAnalysis {
autoClimbStartTime: json['autoClimbStartTime'],
contactDefenseTime: json['contactDefenseTime'],
campingDefenseTime: json['campingDefenseTime'],
defenseEffectiveness: json["defenseEffectiveness"] + 1,
defenseEffectiveness: json["defenseEffectiveness"] != null
? json["defenseEffectiveness"] + 1
: null,
feeds: json["feeds"],
accuracy: json["accuracy"],
accuracy: 0,
climbStartTime: json["climbStartTime"],
climbResult: EndgameClimbResult.values[(json['climbResult'] as int)],
autoClimb: AutoClimbResult.values[(json['autoClimb'] as int)],
autoPath: AutoPath.fromMapSingleMatch(json["autoPath"]),
// autoPath: AutoPath.fromMapSingleMatch(json["autoPath"]),
autoPath: AutoPath.fromMapSingleMatch({
"autoPoints": 60,
"match": "2022cc_qm14_1",
"positions": [
{"location": 7, "event": 0, "time": 0}, // center start
{"location": 10, "event": 3, "time": 4}, // cargo ship
{"location": 1, "event": 2, "time": 9}, // left rocket
{"location": 10, "event": 4, "time": 11}, // cargo ship
{"location": 2, "event": 1, "time": 13}, // right rocket
]
}),
autoScore: json["autoPath"]["autoPoints"],
volleys: json["volleys"],
ballsFed: json["totalBallsFed"],
Expand Down
Loading