diff --git a/deploy/HyperCon.jar.REMOVED.git-id b/deploy/HyperCon.jar.REMOVED.git-id index d20b95cb..43f8e851 100644 --- a/deploy/HyperCon.jar.REMOVED.git-id +++ b/deploy/HyperCon.jar.REMOVED.git-id @@ -1 +1 @@ -6f2aab422e3d1b03080de92c3e3aea9b270a3e9b \ No newline at end of file +56543287f8f9c84993d0578339da66f81efe6bdb \ No newline at end of file diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java index 7c343e06..1c96616d 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java @@ -21,6 +21,7 @@ public class LedString { /** THe configuration of the 'physical' led frame */ public LedFrameConstruction mLedFrameConfig = new LedFrameConstruction(); + /** The configuration of the image processing */ public ImageProcessConfig mProcessConfig = new ImageProcessConfig(); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java index 6794e368..a47073fc 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java @@ -121,7 +121,7 @@ public class ConfigPanel extends JPanel { mSpecificationPanel = new JPanel(); mSpecificationPanel.setLayout(new BoxLayout(mSpecificationPanel, BoxLayout.Y_AXIS)); - mConstructionPanel = new LedFramePanel(ledString.mLedFrameConfig); + mConstructionPanel = new LedFramePanel(ledString.mLedFrameConfig, ledString.mDeviceConfig); mConstructionPanel.setBorder(BorderFactory.createTitledBorder("Construction")); mSpecificationPanel.add(mConstructionPanel); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java index 53079df7..fd0dcb33 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java @@ -12,12 +12,14 @@ import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import org.hyperion.hypercon.spec.DeviceConfig; import org.hyperion.hypercon.spec.DeviceType; import org.hyperion.hypercon.spec.LedFrameConstruction; public class LedFramePanel extends JPanel { private final LedFrameConstruction mLedFrameSpec; + private final DeviceConfig mDeviceConfig; private JLabel mTypeLabel; private JComboBox mTypeCombo; @@ -41,10 +43,11 @@ public class LedFramePanel extends JPanel { private JLabel mOffsetLabel; private JSpinner mOffsetSpinner; - public LedFramePanel(LedFrameConstruction ledFrameSpec) { + public LedFramePanel(LedFrameConstruction ledFrameSpec, DeviceConfig deviceConfig) { super(); mLedFrameSpec = ledFrameSpec; + mDeviceConfig = deviceConfig; initialise(); } @@ -151,6 +154,10 @@ public class LedFramePanel extends JPanel { } void updateLedConstruction() { + mDeviceConfig.mType = (DeviceType) mTypeCombo.getSelectedItem(); + mDeviceConfig.setChanged(); + mDeviceConfig.notifyObservers(); + mLedFrameSpec.topLeftCorner = (Boolean)mTopCornerCombo.getSelectedItem(); mLedFrameSpec.topRightCorner = (Boolean)mTopCornerCombo.getSelectedItem(); mLedFrameSpec.bottomLeftCorner = (Boolean)mBottomCornerCombo.getSelectedItem(); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java index 9c693328..970d1913 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java @@ -1,20 +1,22 @@ package org.hyperion.hypercon.spec; +import java.util.Observable; + /** * The device specific configuration */ -public class DeviceConfig { +public class DeviceConfig extends Observable { /** The name of the device */ - String mName = "MyPi"; + public String mName = "MyPi"; /** The type specification of the device */ - DeviceType mType = DeviceType.ws2801; + public DeviceType mType = DeviceType.ws2801; /** The device 'file' name */ - String mOutput = "/dev/spidev0.0"; + public String mOutput = "/dev/spidev0.0"; /** The baudrate of the device */ - int mBaudrate = 1000000; + public int mBaudrate = 1000000; /** Flag indicating if the red and blue should be reversed */ - boolean mBgrOutput = false; + public boolean mBgrOutput = false; /** * Creates the JSON string of the configuration as used in the Hyperion daemon configfile @@ -47,4 +49,8 @@ public class DeviceConfig { return strBuf.toString(); } + @Override + public void setChanged() { + super.setChanged(); + } }