altosuilib: Show the recovered product name in the Configure Rom dialog
[fw/altos] / altosuilib / AltosRomconfigUI.java
index fd670d4ec9df439081ee7533662989f9e2223083..eb2e8333d5df9597c2eb767cc0a6be31a7e04441 100644 (file)
@@ -29,9 +29,11 @@ public class AltosRomconfigUI
 {
        Container       pane;
        Box             box;
+       JLabel          product_label;
        JLabel          serial_label;
        JLabel          radio_calibration_label;
 
+       JLabel          product_value;
        JFrame          owner;
        JTextField      serial_value;
        JTextField      radio_calibration_value;
@@ -54,6 +56,29 @@ public class AltosRomconfigUI
 
                int y = 0;
 
+               /* Product name */
+               /* Serial */
+               c = new GridBagConstraints();
+               c.gridx = 0; c.gridy = y;
+               c.gridwidth = 3;
+               c.fill = GridBagConstraints.NONE;
+               c.anchor = GridBagConstraints.LINE_START;
+               c.insets = il;
+               product_label = new JLabel("Product:");
+               pane.add(product_label, c);
+
+               c = new GridBagConstraints();
+               c.gridx = 3; c.gridy = y;
+               c.gridwidth = 3;
+               c.fill = GridBagConstraints.HORIZONTAL;
+               c.weightx = 1;
+               c.anchor = GridBagConstraints.LINE_START;
+               c.insets = ir;
+               product_value = new JLabel(config.usb_product);
+               pane.add(product_value, c);
+
+               y++;
+
                /* Serial */
                c = new GridBagConstraints();
                c.gridx = 0; c.gridy = y;
@@ -76,7 +101,7 @@ public class AltosRomconfigUI
 
                y++;
 
-               if (AltosLib.has_radio(config.usb_id.pid)) {
+               if (config == null || AltosLib.has_radio(config.usb_id.pid)) {
                        /* Radio calibration value */
                        c = new GridBagConstraints();
                        c.gridx = 0; c.gridy = y;