Skip to content

Commit

Permalink
added concept for traffic audible alert mute. needs fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
apps4av committed Jun 16, 2024
1 parent 6cd0817 commit c863dc3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Constants {
static const Color planCurrentColor = Colors.purpleAccent;
static const Color planNextColor = Colors.grey;
static const Color planPassedColor = Colors.cyanAccent;
static const Color trackColor = Colors.blue;
static const Color trackColor = Colors.brown;
static const Color tracksColor = Colors.green;
static const Color planBorderColor = Colors.black;
static const Color planeColor = Color.fromARGB(150, 255, 0, 0);
Expand Down
14 changes: 10 additions & 4 deletions lib/gdl90/traffic_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ class Traffic {
// borderRadius: BorderRadius.circular(5),
// color: Colors.black),
// child:const Icon(Icons.arrow_upward_rounded, color: Colors.white,)));
return Transform.rotate(angle: (message.heading + 180.0 /* Image painted down on coordinate plane */) * pi * _kDivBy180,
child: CustomPaint(painter: TrafficPainter(this)));
return
Transform.rotate(angle: (message.heading + 180.0 /* Image painted down on coordinate plane */) * pi * _kDivBy180,
child: Stack(children:[
CustomPaint(painter: TrafficPainter(this)),
if(!Storage().settings.isAudibleAlertsEnabled()) // show muted symbol
const Icon(Icons.close, color: Colors.black,)
])
);
}

LatLng getCoordinates() {
Expand Down Expand Up @@ -229,9 +235,9 @@ class TrafficPainter extends CustomPainter {
static bool prefShowSpeedBarb = false; // Shows line/barb at tip of icon based on speed/velocity
static bool prefAltDiffOpacityGraduation = false; // Gradually vary opacity of icon based on altitude diff from ownship
static bool prefUseDifferentDefaultIconThanLight = false; // Use a different default icon for unmapped or "0" emitter category ID traffic
static bool prefShowBoundingBox = true; // Display outlined bounding box around icon for higher visibility
static bool prefShowBoundingBox = false; // Display outlined bounding box around icon for higher visibility
static bool prefShowShadow = false; // Display shadow effect "under" aircraft for higher visibility
static bool prefShowShapeOutline = true; // Display solid outline around aircraft for higher visibility
static bool prefShowShapeOutline = false; // Display solid outline around aircraft for higher visibility

/// Static caches, for faster rendering of the same icons for each marker, based on icon/flight state, given
/// there are a discrete number of possible renderings for all traffic
Expand Down
7 changes: 5 additions & 2 deletions lib/map_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,12 @@ class MapScreenState extends State<MapScreen> {
Storage().trafficCache.getTraffic().map((e) {
return Marker( // our position and heading to destination
point: e.getCoordinates(),
child: Transform.rotate(angle: _northUp ? 0 : Storage().position.heading * pi / 180, child: JustTheTooltip(
child: GestureDetector(onLongPress: () {Storage().settings.setAudibleAlertsEnabled(!Storage().settings.isAudibleAlertsEnabled());},
child:Transform.rotate(angle: _northUp ? 0 : Storage().position.heading * pi / 180, child: JustTheTooltip(
content: Container(padding: const EdgeInsets.all(5), child:Text(e.toString())),
triggerMode: TooltipTriggerMode.tap,
waitDuration: const Duration(seconds: 1),
child: Transform.rotate(angle: _northUp ? 0 : -Storage().position.heading * pi / 180, child: e.getIcon()))));
child: Transform.rotate(angle: _northUp ? 0 : -Storage().position.heading * pi / 180, child: e.getIcon())))));
}).toList(),
);
},
Expand Down Expand Up @@ -687,6 +688,8 @@ class MapScreenState extends State<MapScreen> {
Polyline(
strokeWidth: 4,
points: path,
borderStrokeWidth: 2,
borderColor: Constants.planBorderColor,
color: Constants.trackColor,
),
],
Expand Down

0 comments on commit c863dc3

Please sign in to comment.