Skip to content

Commit

Permalink
Improve Phoenix diagnostics device naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 21, 2023
1 parent ee627f4 commit 2dd1984
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hub/dataSources/PhoenixDiagnosticsSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ export default class PhoenixDiagnosticsSource extends LiveDataSource {
/** Converts a device object to its simple name. */
private getDeviceName(device: Response_Device): string {
let name = device.Model.replaceAll(" ", "");
if (device.Model.startsWith("CANCoder")) {
if (name.startsWith("CANCoder")) {
name = "CANcoder";
} else if (name.startsWith("TalonFX")) {
name = "TalonFX";
} else if (name.startsWith("Pigeon2")) {
name = "Pigeon2";
}
name = name + "-" + (device.Name.startsWith(device.Model) ? device.ID.toString() : device.Name);
if (device.CANivoreDevName.length > 0) {
Expand Down

0 comments on commit 2dd1984

Please sign in to comment.