Skip to content

Commit

Permalink
Dashboard 1 5 (#26)
Browse files Browse the repository at this point in the history
* updates for ground settings

* Gps precision update (#1)

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

* Pre planning update for angle smoothing.

Intermediate commit prior to a task/branch switch

* Update groundSettings.xml

* Add simple outlier check to angle updates

* Feature vehicle heartbeat monitor (#2)

* Add CommsMonitor class

Added CommsMonitor and basic function and timer action stubs for sending and receiving heartbeat messages to and from the APM.

Added received pulse response to SerialParser

* Implement heartbeat monitoring into comms manager and tie to dashboard serial communications

* Move start/stop heartbeat timer commands, add some notes for debug/investigation

Intermediate check in while waiting to discuss further implementation strategy with APM

* Changed CommsMonitor heartbeat check to passive monitor

check in pulses are now driven by the APM, with the Dashboard only reacting to incoming pulses.

* Add default condition when waiting for initial heartbeat pulse

* Gps precision update (#3)

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

* Version bump

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Dashboard 1 0 5 Update (#6)

* Version bump

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Feature telemetry settings reset to default (#7)

* Add Restore to defaults button

-Added UI Button
-Added on click Action Event function stub for restore logic (To be implemented)

* add a todo for upcoming task switch

* Add reset to defaults command

Add Command message and tie it to the defaults button in the data window

* Dashboard 1 0 5 (#5)

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Add event log for default settings reset

* Change dashboard version format

* Add user notification on initial low voltage telemetry reading

The low voltage warning is triggered on a VCC value below BATTERY_LOW_WARNING_THRESHOLD, but above 0.0 since this zero value is used on reset and initialization and would trigger a false positive notification.

* Dashboard 1 5 update into debounce feature (#8) (#12)

* Version bump

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Feature telemetry settings reset to default (#7)

* Add Restore to defaults button

-Added UI Button
-Added on click Action Event function stub for restore logic (To be implemented)

* add a todo for upcoming task switch

* Add reset to defaults command

Add Command message and tie it to the defaults button in the data window

* Dashboard 1 0 5 (#5)

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Add event log for default settings reset

* Change dashboard version format

* Feature telemetry settings reset to default (#13)

* Add Restore to defaults button

-Added UI Button
-Added on click Action Event function stub for restore logic (To be implemented)

* add a todo for upcoming task switch

* Add reset to defaults command

Add Command message and tie it to the defaults button in the data window

* Dashboard 1 0 5 (#5)

* Update groundSettings.xml

* Update resources_en.properties

* Revert "Gps precision update (#1)"

This reverts commit 45a48c0.

* Delete groundSettings.xml

* Pull in removal of groundSettings.xml and updated slider range calculation (#4)

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Update .gitignore

* Update .gitignore

* Add GPS and heading lock labels back into props

* Add event log for default settings reset

* Add logging notification on waypoint change serial event (#14)

* Add radio failsafe support (#15)

Added failsafe state display
Added failsafe log message

* Feature waypoint geofencing (#16)

* Update .gitignore

* Update .gitignore

* Back port Serial/Telemetry Updates from 1.0.3

This includes updated serial driver, turning off hardware flow control, and showing connection bar at the top of the map.

* Update .gitignore

* Gps precision squash

* Add precision GPS types to telemetry IDs

* Update telemetry parsing to support mixed types

Telemetry parsing now supports mixed type precision for lat/long gps values

* rework bit shifting to be correct

* Update SerialParser.java

* adjust getTelemetry call to handle double instead of float

* Increased the allowed range for settings to 72

* Convert telemetry float values to doubles across the code base

convert telemetry focused float variables and structures to double variables and structures. This probably breaks the graph and the waypoint panel in some way... Testing will bear it out.

* Reworked precision telemetry value parsing logic

...

* Update SerialParser.java

updates for ground settings

Update groundSettings.xml

Update groundSettings.xml

* Revert "Gps precision squash"

This reverts commit 7b997f9.

* Take abs value of slider range for settings

* Delete groundSettings.xml

Should not be tracked in the repository.

* Add GPS and heading lock labels back into props

* Change branch format

* Update resources_en.properties

* Update/correct versioning

* Add todos and base geofence class

* Begin defining fence types and their paint/collision behavior

* Increase size value for Horizon widgets

The layout manager isn't playing nice with the reduced size for horizon widgets. Proper resizing will occur on the vertical but not the horizontal. I've increased the preferred size value to match the current horizontal. this solves the image clipping, but the horizon widgets will be larger than other widgets for the time being.

* Date bump

* Implement geofence type classes and rename them to avoid conflict with FenceType enum

* Add collision/intersection logic for square fence

* Marking out insertion points for geofence

* Add geofence operations, checks and logging strings to commands

* Fix/Simplify radius check for circular geofence

* Geofence checks and coordinate transform changes

-Added map coordinate transform access to geofence classes for drawing
-Streamlined existing geofence calls in command manager.

* Intermediate commit during testing

* Add drawing thickness to circular geofence wall

* Implement correct scaling

Scaling on zoom now works appropriately, but Geofence still does not draw large enough yet.

* Intermediate checkin for branch switch

* Adjust circle fence drawing to fit with haversine intersect checks on waypoint placement.

* Remove inner square fence reference

* Remove test and log abnormalities

Removed layer manager test that fails on unaccounted for CommandManager reference.

Removed extraneous warning message for waypoint movement on active geofence.

* Reduce geofence default radius

* Remove old TODO

* Add radius update to fence types

* Update map repainting on geofence size change

-Clean up graphics object disposal instances are cloned.
-Distribute MapPanel out to UIConfig for on demand repaint on fence size changes.

* Added set home function to waypoint panel/map ui (#17)

-Added new state mode to the rover path for setting a home point from the waypoint panel.

-Increased default geofence radius to 100 feet. 50 is too place points and avoid warnings with any practicality.

* Prevent the manual deletion of the fence origin point (#18)

* Feature waypoint file update (#19)

* Create Parse Command

Created new Parse Command to move parsing to a tracked system behavior that supports undo/redo functionality. Initial support will be for XML and JSON formats. With XML adhering to GPX standard schema.

* Added XML Write/Read of GPX files

* Finish read write port to new command

Reading and writing GPX files is now contained and controlled by a new command - WaypointCommandParse

* Update/fix path loading

Now accounts for geofence and sends movement disable when clearing existing points to add a parsed route

* Add persistent properties removal to installer (#20)

* Added set home function to waypoint panel/map ui (#21)

-Added new state mode to the rover path for setting a home point from the waypoint panel.

-Increased default geofence radius to 100 feet. 50 is too place points and avoid warnings with any practicality.

* Release date bump

* Remove broken popup warning for low voltage (#22)

Does not properly account for settling time or average out outlier values which is causing problems. So removed for now. A more involved fix is possible but it needs to be moved to the TelemetryMonitor class

* Add enable/disable serial panel on mission toggle (#23)

Now disables operation of serial connect panel while a unit is running.

* Fix Enum mismatch (#24)

-Fix Enum mismatch
-Remove failsafe log check. This is done by the rover.

* Update StateWidget.java

Add low voltage reporting cases to State Widget

* Update .gitignore

* Enforce waypoint maximum of 64 (#25)

63 + Home Point
  • Loading branch information
ChrisParkInfinetix authored Dec 9, 2022
1 parent 96e7be5 commit b960fdd
Show file tree
Hide file tree
Showing 40 changed files with 1,858 additions and 199 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ resources/groundSettings_edited.xml
resources/groundSettings_Old.xml
resources/groundSettings.xml
resources/images/6x6-Top - Backup.png
/bin/
5 changes: 4 additions & 1 deletion DashboardInstallerScript.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "MINDS-i Dashboard"
#define MyAppVersion "1.4.0"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "MINDS-i Education"
#define MyAppURL "https://mindsieducation.com/"
#define MyAppExeName "Dashboard.exe"
Expand Down Expand Up @@ -40,6 +40,9 @@ Source: "{#ReleaseDir}\arduino-cli.exe"; DestDir: "{app}"; Flags: ignoreversion
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[InstallDelete]
Type: files; Name: "{localappdata}\MINDS-i Dashboard\persist.properties"

[Run]
Filename: "{app}\{#TelemDrivers}"; Description: "{cm:LaunchProgram, Radio Telemetry Drivers}"; Flags: hidewizard
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
4 changes: 2 additions & 2 deletions resources/resources_en.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version_id =1.4.0
release_date =2021-11-29
version_id =1.5.2
release_date =2022-12-08
image_folder =resources/images/
patch_folder =resources/images/nP/
font_folder =resources/fonts/
Expand Down
9 changes: 8 additions & 1 deletion src/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
import com.remote.SettingList;
import com.serial.*;
import com.serial.Messages.*;
import com.serial.CommsMonitor;
import com.ui.*;
import com.telemetry.*;
import com.xml;
import com.graph.DataSource;

import java.io.*;
import java.nio.file.*;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.logging.*;

import java.awt.geom.Point2D;

import jssc.SerialPort;
import jssc.SerialPortException;
import java.awt.geom.Point2D;


public class Context {
public boolean connected;
Expand All @@ -30,6 +35,7 @@ public class Context {
public SettingList settingList;
public TelemetryManager telemetry;
public TelemetryLogger telemLog;
public CommsMonitor commsMonitor;

private WaypointList waypoint;
private SerialPort port;
Expand Down Expand Up @@ -163,6 +169,7 @@ public void update(double altitude) {
}
});
}

public void toggleLocale() {
String current = (String) persist.get("subject");
if(current.equals("air")) {
Expand Down
11 changes: 9 additions & 2 deletions src/Dashboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class Dashboard implements Runnable {
public GPSWidget gpsWidget;
public BumperWidget bumperWidget;
public MapPanel mapPanel;
public SerialConnectPanel serialPanel;

//Logging
private final Logger seriallog = Logger.getLogger("d.serial");
Expand Down Expand Up @@ -137,15 +138,17 @@ public void connectionEstablished(SerialPort port) {
context.updatePort(port);
seriallog.info("Port opened");
context.sender.sendSync();
context.commsMonitor.getInstance().startHeartbeatTimer();
}
public void disconnectRequest() {
context.closePort();
seriallog.info("Serial Port Closed");
resetData();
context.commsMonitor.getInstance().stopHeartbeatTimer();
}
};

SerialConnectPanel serialPanel = new SerialConnectPanel(connectActions);
serialPanel = new SerialConnectPanel(connectActions);
serialPanel.showBaudSelector(true);

JPanel messageBox = createAlertBox();
Expand Down Expand Up @@ -252,7 +255,6 @@ private JPanel createRightPanel() {
outerPanel.add(AngleWidget.createDial(
context, Serial.HEADING, context.theme.roverTop));

//TODO - CP - Fix widget bug on the following two adds (horizon and radio widgets)
if(context.getResource("widget_type", "Angles").equals("Horizon")) {
outerPanel.add(createHorizonWidget());
outerPanel.add(RadioWidget.create(context, HORIZON_WIDGET_SIZE));
Expand Down Expand Up @@ -336,6 +338,11 @@ public static void displayErrorPopup(Exception e) {
errorFrame.pack();
}

//Toggle the enabled/disabled state of the serial panel
public void enableSerialPanel(boolean isActive) {
serialPanel.setEnabled(isActive);
}

public static void main(String[] args) {
String openglProperty = "false";

Expand Down
7 changes: 7 additions & 0 deletions src/layer/LayerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.awt.Point;
import java.awt.event.*;

import com.map.command.CommandManager;

/**
* LayerManager distributes mouse events and chances to draw on a set
* of Layer objects sorted with largest "getZ" an "top"
Expand Down Expand Up @@ -34,6 +36,11 @@ public void draw(Graphics g) {
for(Layer l : layers) {
l.paint(gn);
}

if(CommandManager.getInstance().getGeofence().getIsEnabled()) {
CommandManager.getInstance().getGeofence().paintFence(gn);
}

gn.dispose();
}

Expand Down
2 changes: 1 addition & 1 deletion src/map/CoordinateTransform.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.awt.geom.Point2D;

interface CoordinateTransform {
public interface CoordinateTransform {
/**
* Transforms a (lonitude,latitude) point to absolute (x,y) pixels
* Will return an instance of the same class as the argument p
Expand Down
20 changes: 16 additions & 4 deletions src/map/MapPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
******************************************************************************/

package com.map;

import com.Context;
import com.layer.*;

import com.map.command.CommandManager;
import com.map.geofence.WaypointGeofence;

import static com.map.WaypointList.*;
import java.awt.*;
import java.awt.event.*;
Expand Down Expand Up @@ -41,8 +45,8 @@ public class MapPanel extends JPanel implements CoordinateTransform {
private DragListener mouseListener = new DragListener();
private LayerManager mll = new LayerManager();
public WaypointPanel waypointPanel;
private RoverPath roverPath;

public RoverPath roverPath;
private final Logger iolog = Logger.getLogger("d.io");

public MapPanel(Context cxt) {
Expand Down Expand Up @@ -82,10 +86,15 @@ public MapPanel(Context cxt, Point mapPosition, int zoom, JPanel north,
south.add(east, BorderLayout.EAST);
south.add(north, BorderLayout.CENTER);

CommandManager.getInstance().initGeofence(
WaypointGeofence.MIN_RADIUS_FT,
WaypointGeofence.FenceType.CIRCLE, this);

setZoom(TILE_SIZE * (1 << zoom));
setMapPosCoords(mapPosition);

roverPath = new RoverPath(context, this, context.getWaypointList(), this);
roverPath = new RoverPath(context, this, context.getWaypointList(),
this, this);
mll.add(roverPath);
mll.add(mouseListener);
addMouseWheelListener(mouseListener);
Expand All @@ -98,6 +107,7 @@ public void componentResized(ComponentEvent e){
repaint();
}
});

}

/**
Expand Down Expand Up @@ -192,7 +202,9 @@ public int getZoom() {

public boolean setZoom(int zoom) {
boolean valid = currentTileServer.isValidZoom(zoom);
if(valid) this.zoom = zoom;
if(valid) {
this.zoom = zoom;
}

return valid;
}
Expand Down
Loading

0 comments on commit b960fdd

Please sign in to comment.