diff --git a/deploy/HyperCon.jar.REMOVED.git-id b/deploy/HyperCon.jar.REMOVED.git-id index 2ea5f8fc..ce03336a 100644 --- a/deploy/HyperCon.jar.REMOVED.git-id +++ b/deploy/HyperCon.jar.REMOVED.git-id @@ -1 +1 @@ -ada8097cb71b680dd6fa48cf190ff66c8814ad0b \ No newline at end of file +6a841c91e85de05d2ed4dfed9955cb1c89a9bf03 \ 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 0534a6e3..af5c852e 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java @@ -100,6 +100,6 @@ public class LedString { pJsonBuf.addRawValue("vscan", String.format(Locale.ENGLISH, "{ %1$cminimum%1$c : %2$.4f, %1$cmaximum%1$c : %3$.4f }", '"', led.mImageRectangle.getMinY(), led.mImageRectangle.getMaxY()), true); pJsonBuf.stopObject(led.equals(leds.get(leds.size()-1))); } - pJsonBuf.stopArray(); + pJsonBuf.stopArray(false); } } diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/EffectEnginePanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/EffectEnginePanel.java index 0526ea7e..26f01025 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/EffectEnginePanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/EffectEnginePanel.java @@ -9,7 +9,11 @@ import javax.swing.GroupLayout; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JSpinner; import javax.swing.JTextField; +import javax.swing.SpinnerNumberModel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -30,7 +34,9 @@ public class EffectEnginePanel extends JPanel { private JCheckBox mBootSequenceCheck; private JLabel mBootSequenceLabel; private JTextField mBootSequenceField; - + private JLabel mBootSequenceLengthLabel; + private JSpinner mBootSequenceLengthSpinner; + public EffectEnginePanel(final MiscConfig pMiscConfig) { super(); @@ -125,6 +131,22 @@ public class EffectEnginePanel extends JPanel { }); mBootSequencePanel.add(mBootSequenceField); + mBootSequenceLengthLabel = new JLabel("Length[ms]: "); + mBootSequenceLengthLabel.setMinimumSize(new Dimension(75, 10)); + mBootSequenceLengthLabel.setEnabled(mMiscConfig.mBootSequenceEnabled); + mBootSequencePanel.add(mBootSequenceLengthLabel); + + mBootSequenceLengthSpinner = new JSpinner(new SpinnerNumberModel(mMiscConfig.mBootSequenceLength_ms, 100, 1500000, 500)); + mBootSequenceLengthSpinner.setMaximumSize(new Dimension(1024, 20)); + mBootSequenceLengthSpinner.setEnabled(mMiscConfig.mBootSequenceEnabled); + mBootSequenceLengthSpinner.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + mMiscConfig.mBootSequenceLength_ms = (Integer)mBootSequenceLengthSpinner.getValue(); + } + }); + mBootSequencePanel.add(mBootSequenceLengthSpinner); + GroupLayout layout = new GroupLayout(mBootSequencePanel); mBootSequencePanel.setLayout(layout); @@ -133,14 +155,20 @@ public class EffectEnginePanel extends JPanel { .addGroup(layout.createParallelGroup() .addComponent(mBootSequenceLabel) .addComponent(mBootSequenceField)) + .addGroup(layout.createParallelGroup() + .addComponent(mBootSequenceLengthLabel) + .addComponent(mBootSequenceLengthSpinner)) ); - layout.setHorizontalGroup(layout.createParallelGroup() - .addGroup(layout.createSequentialGroup() + layout.setHorizontalGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup() + .addComponent(mBootSequenceCheck) .addComponent(mBootSequenceLabel) - .addComponent(mBootSequenceField)) - .addComponent(mBootSequenceCheck)); - + .addComponent(mBootSequenceLengthLabel)) + .addGroup(layout.createParallelGroup() + .addComponent(mBootSequenceCheck) + .addComponent(mBootSequenceField) + .addComponent(mBootSequenceLengthSpinner))); } return mBootSequencePanel; } diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java index 21e5971e..e576b470 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java @@ -14,6 +14,8 @@ public class MiscConfig { public boolean mBootSequenceEnabled = true; /** The effect selected for the boot sequence */ public String mBootSequenceEffect = "Rainbow swirl fast"; + /** The (maximum) length of the boot-sequence */ + public int mBootSequenceLength_ms = 3000; /** Flag indicating that the Frame Grabber is enabled */ public boolean mFrameGrabberEnabled = true; @@ -68,12 +70,16 @@ public class MiscConfig { for (String effectPath : effectPaths) { strBuf.addArrayElement(effectPath, effectPath == effectPaths[effectPaths.length-1]); } - strBuf.stopArray(!mBootSequenceEnabled); - strBuf.toggleComment(!mBootSequenceEnabled); - strBuf.addValue("bootsequence", mBootSequenceEffect, true); - strBuf.toggleComment(false); + strBuf.stopArray(true); strBuf.stopObject(); + strBuf.toggleComment(!mBootSequenceEnabled); + strBuf.startObject("Bootsequence"); + strBuf.addValue("effect", mBootSequenceEffect, false); + strBuf.addValue("duration_ms", mBootSequenceLength_ms, true); + strBuf.stopObject(); + strBuf.toggleComment(false); + strBuf.newLine(); String grabComment =