From e6ecc5d46c7ebb11efbc674289c87e50f6d5dfbc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Wed, 7 Dec 2022 22:10:39 +0900 Subject: Update Tier -> Tire Bug-AGL: SPEC-4642 Signed-off-by: Scott Murray Change-Id: I8540eb55d83bf617a4c0d7fb9f97a16c72611603 (cherry picked from commit 1a5706e55524f8ba16d28ea9e9748e3ff0ac48c1) --- lib/HomePage.dart | 26 +++++++------- lib/Kuksa-server/vehicle_methods.dart | 24 ++++++------- lib/Kuksa-server/vehicle_server_path.dart | 8 ++--- lib/Tier_pressure.dart | 60 ------------------------------- lib/Tire_pressure.dart | 60 +++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 lib/Tier_pressure.dart create mode 100644 lib/Tire_pressure.dart diff --git a/lib/HomePage.dart b/lib/HomePage.dart index 6487ef5..b6a0349 100644 --- a/lib/HomePage.dart +++ b/lib/HomePage.dart @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -import 'package:dashboard_app/Tier_pressure.dart'; +import 'package:dashboard_app/Tire_pressure.dart'; import 'package:dashboard_app/drawArrow.dart'; import 'package:dashboard_app/provider.dart'; import 'package:dashboard_app/size.dart'; @@ -66,8 +66,8 @@ class _HomePageState extends ConsumerState { child: Column( children: [ - TierPressure( - tname: 'L Front Tier', + TirePressure( + tname: 'L Front Tire', tpress: vehicle.frontLeftTP, mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, @@ -98,8 +98,8 @@ class _HomePageState extends ConsumerState { ), ), ), - TierPressure( - tname: 'L Rear Tier', + TirePressure( + tname: 'L Rear Tire', tpress: vehicle.rearLeftTP, crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.start, @@ -112,8 +112,8 @@ class _HomePageState extends ConsumerState { right: SizeConfig.safeBlockHorizontal * 7, child: Column( children: [ - TierPressure( - tname: 'R Front Tier', + TirePressure( + tname: 'R Front Tire', tpress: vehicle.frontRightTP, mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, @@ -143,8 +143,8 @@ class _HomePageState extends ConsumerState { ), ), ), - TierPressure( - tname: 'R Rear Tier', + TirePressure( + tname: 'R Rear Tire', tpress: vehicle.rearRightTP, mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -285,7 +285,7 @@ class _HomePageState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.end, children: [ - TierPressure( + TirePressure( tname: 'L Front Tire', tpress: vehicle.frontLeftTP, mainAxisAlignment: @@ -330,7 +330,7 @@ class _HomePageState extends ConsumerState { ), ), ), - TierPressure( + TirePressure( tname: 'L Rear Tire', tpress: vehicle.rearLeftTP, mainAxisAlignment: @@ -362,7 +362,7 @@ class _HomePageState extends ConsumerState { top: 0, child: Column( children: [ - TierPressure( + TirePressure( tname: 'R Front Tire', tpress: vehicle.frontRightTP, mainAxisAlignment: @@ -407,7 +407,7 @@ class _HomePageState extends ConsumerState { ), ), ), - TierPressure( + TirePressure( tname: 'R Rear Tire', tpress: vehicle.rearRightTP, mainAxisAlignment: diff --git a/lib/Kuksa-server/vehicle_methods.dart b/lib/Kuksa-server/vehicle_methods.dart index 099d480..1a99bc7 100644 --- a/lib/Kuksa-server/vehicle_methods.dart +++ b/lib/Kuksa-server/vehicle_methods.dart @@ -14,10 +14,10 @@ class VISS { subscribe(socket,ref, VSPath.vehicleSpeed); subscribe(socket,ref, VSPath.vehicleEngineRPM); subscribe(socket,ref, VSPath.vehicleFuelLevel); - subscribe(socket,ref, VSPath.vehicleFrontLeftTier); - subscribe(socket, ref,VSPath.vehicleFrontRightTier); - subscribe(socket, ref,VSPath.vehicleRearLeftTier); - subscribe(socket,ref, VSPath.vehicleRearRightTier); + subscribe(socket,ref, VSPath.vehicleFrontLeftTire); + subscribe(socket, ref,VSPath.vehicleFrontRightTire); + subscribe(socket, ref,VSPath.vehicleRearLeftTire); + subscribe(socket,ref, VSPath.vehicleRearRightTire); subscribe(socket, ref,VSPath.vehicleIsChildLockActiveLeft); subscribe(socket,ref, VSPath.vehicleIsChildLockActiveRight); subscribe(socket,ref, VSPath.vehicleCurrentLatitude); @@ -32,10 +32,10 @@ class VISS { get(socket,ref, VSPath.vehicleEngineRPM); get(socket,ref, VSPath.vehicleFuelLevel); get(socket,ref,VSPath.vehicleAmbientAirTemperature); - get(socket,ref,VSPath.vehicleFrontLeftTier); - get(socket,ref, VSPath.vehicleFrontRightTier); - get(socket,ref, VSPath.vehicleRearLeftTier); - get(socket,ref, VSPath.vehicleRearRightTier); + get(socket,ref,VSPath.vehicleFrontLeftTire); + get(socket,ref, VSPath.vehicleFrontRightTire); + get(socket,ref, VSPath.vehicleRearLeftTire); + get(socket,ref, VSPath.vehicleRearRightTire); get(socket,ref,VSPath.vehicleIsChildLockActiveLeft); get(socket,ref, VSPath.vehicleIsChildLockActiveRight); get(socket,ref,VSPath.vehicleCurrentLatitude); @@ -127,16 +127,16 @@ class VISS { case VSPath.vehicleFuelLevel: vehicleSignal.update(fuelLevel: dp["value"]); break; - case VSPath.vehicleFrontLeftTier: + case VSPath.vehicleFrontLeftTire: vehicleSignal.update(frontLeftTP: dp["value"]); break; - case VSPath.vehicleFrontRightTier: + case VSPath.vehicleFrontRightTire: vehicleSignal.update(frontRightTP: dp["value"]); break; - case VSPath.vehicleRearLeftTier: + case VSPath.vehicleRearLeftTire: vehicleSignal.update(rearLeftTP: dp["value"]); break; - case VSPath.vehicleRearRightTier: + case VSPath.vehicleRearRightTire: vehicleSignal.update(rearRightTP: dp["value"]); break; diff --git a/lib/Kuksa-server/vehicle_server_path.dart b/lib/Kuksa-server/vehicle_server_path.dart index de33502..8d8923c 100644 --- a/lib/Kuksa-server/vehicle_server_path.dart +++ b/lib/Kuksa-server/vehicle_server_path.dart @@ -11,14 +11,14 @@ class VSPath { static const String vehicleAmbientAirTemperature = "Vehicle.AmbientAirTemperature"; - static const String vehicleFrontLeftTier = + static const String vehicleFrontLeftTire = "Vehicle.Chassis.Axle.Row1.Wheel.Left.Tire.Pressure"; - static const String vehicleFrontRightTier = + static const String vehicleFrontRightTire = "Vehicle.Chassis.Axle.Row1.Wheel.Right.Tire.Pressure"; - static const String vehicleRearLeftTier = + static const String vehicleRearLeftTire = "Vehicle.Chassis.Axle.Row2.Wheel.Left.Tire.Pressure"; - static const String vehicleRearRightTier = + static const String vehicleRearRightTire = "Vehicle.Chassis.Axle.Row2.Wheel.Right.Tire.Pressure"; static const String vehicleIsChildLockActiveLeft = "Vehicle.Cabin.Door.Row2.Left.IsChildLockActive"; diff --git a/lib/Tier_pressure.dart b/lib/Tier_pressure.dart deleted file mode 100644 index cb8ace5..0000000 --- a/lib/Tier_pressure.dart +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -import 'package:dashboard_app/size.dart'; -import 'package:flutter/material.dart'; -import 'package:percent_indicator/linear_percent_indicator.dart'; - - - -class TierPressure extends StatefulWidget { - String tname; - double tpress; - CrossAxisAlignment crossAxisAlignment; - MainAxisAlignment mainAxisAlignment; - TierPressure( - {Key? key, - required this.tname, - required this.tpress, - required this.crossAxisAlignment, - required this.mainAxisAlignment}) - : super(key: key); - - @override - State createState() => _TierPressureState(); -} - -class _TierPressureState extends State { - @override - Widget build(BuildContext context) { - return SizedBox( - height: SizeConfig.safeBlockVertical * 12, - width: SizeConfig.safeBlockHorizontal * 14, - child: Column( - mainAxisAlignment: widget.mainAxisAlignment, - - children: [ - Text( - '${widget.tname}', - style: SizeConfig.smallnormalfont2, - ), - Text( - widget.tpress.toString() + ' PSI', - style: SizeConfig.smallnormalfont, - ), - LinearPercentIndicator( - width: SizeConfig.safeBlockHorizontal * 11, - - progressColor: widget.tpress / 50 > 0.6 ? Colors.green : Colors.red, - lineHeight: SizeConfig.safeBlockVertical * 1.5, - alignment: MainAxisAlignment.center, - animateFromLastPercent: true, - animation: true, - percent: widget.tpress / 50, - - barRadius: Radius.circular(SizeConfig.fontsize / 4), - backgroundColor: Colors.grey, - ), - ], - ), - ); - } -} diff --git a/lib/Tire_pressure.dart b/lib/Tire_pressure.dart new file mode 100644 index 0000000..2f68bf3 --- /dev/null +++ b/lib/Tire_pressure.dart @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +import 'package:dashboard_app/size.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/linear_percent_indicator.dart'; + + + +class TirePressure extends StatefulWidget { + String tname; + double tpress; + CrossAxisAlignment crossAxisAlignment; + MainAxisAlignment mainAxisAlignment; + TirePressure( + {Key? key, + required this.tname, + required this.tpress, + required this.crossAxisAlignment, + required this.mainAxisAlignment}) + : super(key: key); + + @override + State createState() => _TirePressureState(); +} + +class _TirePressureState extends State { + @override + Widget build(BuildContext context) { + return SizedBox( + height: SizeConfig.safeBlockVertical * 12, + width: SizeConfig.safeBlockHorizontal * 14, + child: Column( + mainAxisAlignment: widget.mainAxisAlignment, + + children: [ + Text( + '${widget.tname}', + style: SizeConfig.smallnormalfont2, + ), + Text( + widget.tpress.toString() + ' PSI', + style: SizeConfig.smallnormalfont, + ), + LinearPercentIndicator( + width: SizeConfig.safeBlockHorizontal * 11, + + progressColor: widget.tpress / 50 > 0.6 ? Colors.green : Colors.red, + lineHeight: SizeConfig.safeBlockVertical * 1.5, + alignment: MainAxisAlignment.center, + animateFromLastPercent: true, + animation: true, + percent: widget.tpress / 50, + + barRadius: Radius.circular(SizeConfig.fontsize / 4), + backgroundColor: Colors.grey, + ), + ], + ), + ); + } +} -- cgit 1.2.3-korg