22 * @file Node.java
33 *
44 */
5- /* Copyright (C) 2022 by Arjan van Vught mailto:info@gd32-dmx.org
5+ /* Copyright (C) 2022-2026 by Arjan van Vught mailto:info@gd32-dmx.org
66 *
77 * Permission is hereby granted, free of charge, to any person obtaining a copy
88 * of this software and associated documentation files (the "Software"), to deal
2626package org .gd32 .dmx ;
2727
2828public class Node {
29- private static final String [] NODE_NAMES = {"Bootloader TFTP" , "Art-Net" , "sACN E1.31" , "OSC Server" , "Node" };
29+ private static final String [] NODE_NAMES = { "Bootloader TFTP" , "Art-Net" , "sACN E1.31" , "OSC Client" , "OSC Server" ,
30+ "DDP Display" , "PixelPusher" };
3031
3132 private boolean isValid = false ;
3233 private boolean isBootloader = false ;
@@ -38,10 +39,10 @@ public class Node {
3839 public Node (String arg ) {
3940 super ();
4041 System .out .println ("arg [" + arg + "]" );
41-
42+
4243 String [] values = arg .split ("," );
43-
44- if (values .length >= 4 ) {
44+
45+ if (values .length >= 4 ) {
4546 isValid = isValidNodeName (values [1 ]);
4647 if (isValid ) {
4748 if (values [1 ].equals (NODE_NAMES [0 ])) {
@@ -55,7 +56,7 @@ public Node(String arg) {
5556 }
5657 }
5758 }
58-
59+
5960 if (isValid ) {
6061 if (values .length == 5 ) {
6162 displayName = values [4 ];
@@ -64,7 +65,7 @@ public Node(String arg) {
6465 }
6566 }
6667 }
67-
68+
6869 private boolean isValidNodeName (String name ) {
6970 for (int i = 0 ; i < NODE_NAMES .length ; i ++) {
7071 if (name .equals (NODE_NAMES [i ])) {
@@ -81,24 +82,24 @@ public boolean isValid() {
8182 public boolean isBootLoader () {
8283 return isBootloader ;
8384 }
84-
85+
8586 public String getIpAdress () {
8687 return ipAddress ;
8788 }
88-
89+
8990 public String getOutputName () {
9091 return outputName ;
9192 }
92-
93+
9394 public String getDisplayName () {
9495 return displayName ;
9596 }
96-
97+
9798 @ Override
9899 public String toString () {
99100 if ((ipAddress != null ) && (nodeName != null )) {
100- return ipAddress + " | " + nodeName ;
101- }
101+ return ipAddress + " | " + nodeName ;
102+ }
102103 return "Unknown" ;
103104 }
104105}
0 commit comments