From 9a9dfecb590c0aef038f7b88746e52bef9e5338d Mon Sep 17 00:00:00 2001 From: Anh Date: Tue, 14 Jan 2025 18:55:08 +0700 Subject: [PATCH] Show BenchmarkRunModeEnum in running screen --- .../lib/ui/home/benchmark_running_screen.dart | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/flutter/lib/ui/home/benchmark_running_screen.dart b/flutter/lib/ui/home/benchmark_running_screen.dart index 12ed2184c..db5a73d45 100644 --- a/flutter/lib/ui/home/benchmark_running_screen.dart +++ b/flutter/lib/ui/home/benchmark_running_screen.dart @@ -4,6 +4,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:collection/collection.dart'; +import 'package:mlperfbench/store.dart'; import 'package:provider/provider.dart'; import 'package:mlperfbench/benchmark/info.dart'; @@ -28,12 +29,14 @@ class BenchmarkRunningScreen extends StatefulWidget { class _BenchmarkRunningScreenState extends State { late BenchmarkState state; + late Store store; late AppLocalizations l10n; late ProgressInfo progress; @override Widget build(BuildContext context) { state = context.watch(); + store = context.watch(); l10n = AppLocalizations.of(context)!; progress = state.taskRunner.progressInfo; @@ -68,21 +71,35 @@ class _BenchmarkRunningScreenState extends State { Widget _title() { // The TaskRunner always run all benchmarks in performance mode first then in accuracy mode. - var runModeStage = '1/1'; + var loadgenRunModeStage = '1/1'; if (progress.runMode.selectedRunModes.length > 1) { - runModeStage = progress.accuracy ? '2/2' : '1/2'; + loadgenRunModeStage = progress.accuracy ? '2/2' : '1/2'; } - var runModeName = + final loadgenRunModeName = progress.accuracy ? l10n.progressAccuracy : l10n.progressPerformance; + final benchmarkRunModeName = + store.selectedBenchmarkRunMode.localizedName(l10n); return Padding( padding: const EdgeInsets.fromLTRB(40, 48, 40, 4), - child: Text( - '($runModeStage) $runModeName', - style: const TextStyle( - fontWeight: FontWeight.w500, - color: AppColors.lightText, - fontSize: 20, - ), + child: Column( + children: [ + Text( + '($loadgenRunModeStage) $loadgenRunModeName', + style: const TextStyle( + fontWeight: FontWeight.w500, + color: AppColors.lightText, + fontSize: 20, + ), + ), + Text( + benchmarkRunModeName, + style: const TextStyle( + fontWeight: FontWeight.w500, + color: AppColors.lightText, + fontSize: 14, + ), + ), + ], )); }