diff --git a/src/config-tool/ConfigTool/build.xml b/src/config-tool/ConfigTool/build.xml new file mode 100644 index 00000000..7256686b --- /dev/null +++ b/src/config-tool/ConfigTool/build.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/HyperionConfigApplet.java b/src/config-tool/ConfigTool/src/org/hyperion/config/HyperionConfigApplet.java deleted file mode 100644 index 0b5292fe..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/HyperionConfigApplet.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.hyperion.config; - -import java.awt.BorderLayout; -import java.awt.Dimension; - -import javax.swing.JApplet; - -import org.hyperion.config.gui.ConfigPanel; - -public class HyperionConfigApplet extends JApplet { - - public HyperionConfigApplet() { - super(); - - initialise(); - } - - private void initialise() { - setPreferredSize(new Dimension(600, 300)); - - add(new ConfigPanel(), BorderLayout.CENTER); - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/Main.java b/src/config-tool/ConfigTool/src/org/hyperion/config/Main.java deleted file mode 100644 index 2405c8df..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/Main.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.hyperion.config; - -import javax.swing.JFrame; -import javax.swing.UIManager; - -import org.hyperion.config.gui.ConfigPanel; - -public class Main { - - public static void main(String[] pArgs) { - try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (Exception e) {} - - JFrame frame = new JFrame(); - frame.setTitle("Hyperion configuration Tool"); - frame.setSize(1300, 600); - frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - - frame.setContentPane(new ConfigPanel()); - - frame.setVisible(true); - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BootSequence.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BootSequence.java deleted file mode 100644 index 805eb576..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BootSequence.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.hyperion.config.spec; - -public enum BootSequence { - rainbow, - knight_rider, - none; - - public static BootSequence fromString(String pStr) { - for (BootSequence seq : values()) { - if (seq.toString().equalsIgnoreCase(pStr)) { - return seq; - } - } - return none; - } - - @Override - public String toString() { - switch(this) { - case rainbow: - return "Rainbow"; - case knight_rider: - return "Kinght Rider"; - case none: - return "None"; - } - return "None"; - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BorderSide.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BorderSide.java deleted file mode 100644 index a0bd5675..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/BorderSide.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.hyperion.config.spec; - -public enum BorderSide { - top_left (0.75*Math.PI), - top(0.5*Math.PI), - top_right(0.25*Math.PI), - right(0.0*Math.PI), - bottom_right(-0.25*Math.PI), - bottom(-0.5*Math.PI), - bottom_left(-0.75*Math.PI), - left(1.0*Math.PI); - - private final double mAngle; - - BorderSide(double pAngle) { - mAngle = pAngle; - } - - public double getAngle() { - return mAngle; - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceType.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceType.java deleted file mode 100644 index f3cfa8ee..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceType.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.hyperion.config.spec; - -public enum DeviceType { - ws2801, - test, - none; - - -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/ImageProcessConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/ImageProcessConfig.java deleted file mode 100644 index 289849d3..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/ImageProcessConfig.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.hyperion.config.spec; - -import java.util.Observable; - -public class ImageProcessConfig extends Observable { - - /** The 'integration depth' of the leds along the horizontal axis of the tv */ - public double horizontalDepth = 0.05; - /** The 'integration depth' of the leds along the vertical axis of the tv */ - public double verticalDepth = 0.05; - - /** The fraction of overlap from one to another led */ - public double overlapFraction = 0.0; - - public boolean blackBorderRemoval = true; - - @Override - public void setChanged() { - super.setChanged(); - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Led.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Led.java deleted file mode 100644 index 8135b3fc..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Led.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.hyperion.config.spec; - -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; - - -public class Led { - - public int mLedSeqNr; - - public BorderSide mSide; - - public Point2D mLocation; - - public Rectangle2D mImageRectangle; - - @Override - public String toString() { - return "Led[" + mLedSeqNr + "] Location=" + mLocation + " Rectangle=" + mImageRectangle; - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Ws2801Led.java b/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Ws2801Led.java deleted file mode 100644 index ec46f0d6..00000000 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/Ws2801Led.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.hyperion.config.spec; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; - -import javax.swing.JComponent; - -public class Ws2801Led extends JComponent { - - enum Border { - top, - topleft, - left, - bottomleft, - bottom, - bottomright, - right, - topright; - } - - final int size = 12; - final int halfSize = size/2; - - final Border mBorder; - - public Ws2801Led(Border pBorder) { - mBorder = pBorder; - } - - - @Override - protected void paintComponent(Graphics g) { - Graphics2D g2d = (Graphics2D) g.create(); - -// g2d.setColor(Color.BLACK); -// g2d.drawRect(0, 0, getWidth()-1, getHeight()-1); - - switch (mBorder) { - case top: - g2d.translate(getWidth()/2, getHeight()); - break; - case topleft: - g2d.translate(getWidth(), getHeight()); - g2d.rotate(1.75*Math.PI); - break; - case left: - g2d.translate(0, getHeight()/2); - g2d.rotate(Math.PI*0.5); - break; - case bottomleft: - g2d.translate(getWidth(), 0); - g2d.rotate(-0.75*Math.PI); - break; - case bottom: - g2d.translate(getWidth()/2, 0); - g2d.rotate(Math.PI*1.0); - break; - case bottomright: - g2d.rotate(0.75*Math.PI); - break; - case right: - g2d.translate(getWidth(), getHeight()/2); - g2d.rotate(Math.PI*1.5); - break; - case topright: - g2d.translate(0, getHeight()); - g2d.rotate(0.25*Math.PI); - break; - } - - g2d.setColor(new Color(255, 0, 0, 172)); - g2d.fillRoundRect(-3, -12, 6, 6, 2, 2); - - g2d.setColor(new Color(255, 0, 0, 255)); - g2d.drawRoundRect(-3, -12, 6, 6, 2, 2); - - g2d.setColor(Color.GRAY); - g2d.drawRect(-halfSize, -halfSize, size, halfSize); - g2d.fillRect(-halfSize, -halfSize, size, halfSize); - - } -} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/HyperConApplet.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/HyperConApplet.java new file mode 100644 index 00000000..f165c8af --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/HyperConApplet.java @@ -0,0 +1,34 @@ +package org.hyperion.hypercon; + +import java.awt.BorderLayout; +import java.awt.Dimension; + +import javax.swing.JApplet; + +import org.hyperion.hypercon.gui.ConfigPanel; + +/** + * Class for starting HyperCon (Hyperion configuration file builder) as a Applet (within a browser) + * + */ +public class HyperConApplet extends JApplet { + + /** + * Constructs the HyperCon Applet + */ + public HyperConApplet() { + super(); + + initialise(); + } + + /** + * Initialises this applet + */ + private void initialise() { + setPreferredSize(new Dimension(600, 300)); + + // Add the HyperCon configuration panel + add(new ConfigPanel(), BorderLayout.CENTER); + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/LedFrameFactory.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedFrameFactory.java similarity index 53% rename from src/config-tool/ConfigTool/src/org/hyperion/config/LedFrameFactory.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedFrameFactory.java index d382c3e4..ff997ddf 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/LedFrameFactory.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedFrameFactory.java @@ -1,16 +1,28 @@ -package org.hyperion.config; +package org.hyperion.hypercon; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Vector; -import org.hyperion.config.spec.BorderSide; -import org.hyperion.config.spec.ImageProcessConfig; -import org.hyperion.config.spec.Led; -import org.hyperion.config.spec.LedFrameConstruction; +import org.hyperion.hypercon.spec.BorderSide; +import org.hyperion.hypercon.spec.ImageProcessConfig; +import org.hyperion.hypercon.spec.Led; +import org.hyperion.hypercon.spec.LedFrameConstruction; +/** + * The LedFrameFactory translates user specifications (number of leds, etc) to actual led + * specifications (location of led, depth and width of integration, etc) + */ public class LedFrameFactory { + /** + * Convenience method for increasing the led counter (it might actually decrease if the frame is + * counter clockwise) + * + * @param frameSpec The specification of the led-frame + * @param pLedCounter The current led counter + * @return The counter/index of the next led + */ private static int increase(LedFrameConstruction frameSpec, int pLedCounter) { if (frameSpec.clockwiseDirection) { return (pLedCounter+1)%frameSpec.getLedCount(); @@ -23,6 +35,14 @@ public class LedFrameFactory { } + /** + * Translate a 'frame' and picture integration specification to per-led specification + * + * @param frameSpec The specification of the led frame + * @param processConfig The picture integration specification + * + * @return The per-led specification + */ public static Vector construct(LedFrameConstruction frameSpec, ImageProcessConfig processConfig) { Vector mLeds = new Vector<>(); @@ -31,71 +51,104 @@ public class LedFrameFactory { return mLeds; } + // Determine the led-number of the top-left led int iLed = (totalLedCount - frameSpec.firstLedOffset)%totalLedCount; if (iLed < 0) { iLed += totalLedCount; } + + // Construct the top-left led (if top-left is enabled) if (frameSpec.topLeftCorner) { - mLeds.add(createLed(frameSpec, processConfig, iLed, 0.0, 0.0, processConfig.overlapFraction, BorderSide.top_left)); + mLeds.add(createLed(frameSpec, processConfig, iLed, 0.0, 0.0, processConfig.getOverlapFraction(), BorderSide.top_left)); iLed = increase(frameSpec, iLed); } + + // Construct all leds along the top of the screen (if any) if (frameSpec.topLedCnt > 0) { + // Determine the led-spacing int ledCnt = frameSpec.topLedCnt; double ledSpacing = (double)1.0/(ledCnt); + for (int iTop=0; iTop 0) { + // Determine the led-spacing int ledCnt = frameSpec.rightLedCnt; double ledSpacing = 1.0/ledCnt; + for (int iRight=0; iRight 0) { + // Determine the led-spacing (based on top-leds [=bottom leds + gap size]) int ledCnt = frameSpec.topLedCnt; - double ledSpacing = (double)1.0/ledCnt; + for (int iBottom=(ledCnt-1); iBottom>=0; --iBottom) { + // Special case for the bottom-gap if (iBottom > (frameSpec.bottomLedCnt-1)/2 && iBottom < ledCnt - frameSpec.bottomLedCnt/2) { continue; } + // Compute the location of this led double led_x = ledSpacing/2.0 + iBottom * ledSpacing; double led_y = 1.0; - mLeds.add(createLed(frameSpec, processConfig, iLed, led_x, led_y, processConfig.overlapFraction, BorderSide.bottom)); + // Construct and add the single led specification to the list of leds + mLeds.add(createLed(frameSpec, processConfig, iLed, led_x, led_y, processConfig.getOverlapFraction(), BorderSide.bottom)); iLed = increase(frameSpec, iLed); } } + + // Construct the bottom-left led (if bottom-left is enabled) if (frameSpec.bottomLeftCorner) { - mLeds.add(createLed(frameSpec, processConfig, iLed, 0.0, 1.0, processConfig.overlapFraction, BorderSide.bottom_left)); + mLeds.add(createLed(frameSpec, processConfig, iLed, 0.0, 1.0, processConfig.getOverlapFraction(), BorderSide.bottom_left)); iLed = increase(frameSpec, iLed); } + + // Construct all leds along the left of the screen (if any) if (frameSpec.leftLedCnt > 0) { + // Determine the led-spacing int ledCnt = frameSpec.leftLedCnt; double ledSpacing = (double)1.0/ledCnt; + for (int iRight=(ledCnt-1); iRight>=0; --iRight) { + // Compute the location of this led double led_x = 0.0; double led_y = ledSpacing/2.0 + iRight * ledSpacing; - mLeds.add(createLed(frameSpec, processConfig, iLed, led_x, led_y, processConfig.overlapFraction, BorderSide.left)); + // Construct and add the single led specification to the list of leds + mLeds.add(createLed(frameSpec, processConfig, iLed, led_x, led_y, processConfig.getOverlapFraction(), BorderSide.left)); iLed = increase(frameSpec, iLed); } } @@ -103,6 +156,19 @@ public class LedFrameFactory { return mLeds; } + /** + * Constructs the specification of a single led + * + * @param pFrameSpec The overall led-frame specification + * @param pProcessSpec The overall image-processing specification + * @param seqNr The number of the led + * @param x_frac The x location of the led in fractional range [0.0; 1.0] + * @param y_frac The y location of the led in fractional range [0.0; 1.0] + * @param overlap_frac The fractional overlap of the led integration with its neighbor + * @param pBorderSide The side on which the led is located + * + * @return The image integration specifications of the single led + */ private static Led createLed(LedFrameConstruction pFrameSpec, ImageProcessConfig pProcessSpec, int seqNr, double x_frac, double y_frac, double overlap_frac, BorderSide pBorderSide) { Led led = new Led(); led.mLedSeqNr = seqNr; @@ -114,51 +180,50 @@ public class LedFrameFactory { switch (pBorderSide) { case top_left: { - led.mImageRectangle = new Rectangle2D.Double(0.0, 0.0, pProcessSpec.verticalDepth, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(0.0, 0.0, pProcessSpec.getVerticalDepth(), pProcessSpec.getHorizontalDepth()); break; } case top_right: { - led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.verticalDepth, 0.0, pProcessSpec.verticalDepth, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.getVerticalDepth(), 0.0, pProcessSpec.getVerticalDepth(), pProcessSpec.getHorizontalDepth()); break; } case bottom_left: { - led.mImageRectangle = new Rectangle2D.Double(0.0, 1.0-pProcessSpec.horizontalDepth, pProcessSpec.verticalDepth, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(0.0, 1.0-pProcessSpec.getHorizontalDepth(), pProcessSpec.getVerticalDepth(), pProcessSpec.getHorizontalDepth()); break; } case bottom_right: { - led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.verticalDepth, 1.0-pProcessSpec.horizontalDepth, pProcessSpec.verticalDepth, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.getVerticalDepth(), 1.0-pProcessSpec.getHorizontalDepth(), pProcessSpec.getVerticalDepth(), pProcessSpec.getHorizontalDepth()); break; } case top:{ double intXmin_frac = Math.max(0.0, x_frac-widthFrac); double intXmax_frac = Math.min(x_frac+widthFrac, 1.0); - led.mImageRectangle = new Rectangle2D.Double(intXmin_frac, 0.0, intXmax_frac-intXmin_frac, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(intXmin_frac, 0.0, intXmax_frac-intXmin_frac, pProcessSpec.getHorizontalDepth()); break; } case bottom: - { + { double intXmin_frac = Math.max(0.0, x_frac-widthFrac); double intXmax_frac = Math.min(x_frac+widthFrac, 1.0); - led.mImageRectangle = new Rectangle2D.Double(intXmin_frac, 1.0-pProcessSpec.horizontalDepth, intXmax_frac-intXmin_frac, pProcessSpec.horizontalDepth); + led.mImageRectangle = new Rectangle2D.Double(intXmin_frac, 1.0-pProcessSpec.getHorizontalDepth(), intXmax_frac-intXmin_frac, pProcessSpec.getHorizontalDepth()); break; } case left: { double intYmin_frac = Math.max(0.0, y_frac-heightFrac); double intYmax_frac = Math.min(y_frac+heightFrac, 1.0); - led.mImageRectangle = new Rectangle2D.Double(0.0, intYmin_frac, pProcessSpec.verticalDepth, intYmax_frac-intYmin_frac); + led.mImageRectangle = new Rectangle2D.Double(0.0, intYmin_frac, pProcessSpec.getVerticalDepth(), intYmax_frac-intYmin_frac); break; } case right: double intYmin_frac = Math.max(0.0, y_frac-heightFrac); double intYmax_frac = Math.min(y_frac+heightFrac, 1.0); - led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.verticalDepth, intYmin_frac, pProcessSpec.verticalDepth, intYmax_frac-intYmin_frac); + led.mImageRectangle = new Rectangle2D.Double(1.0-pProcessSpec.getVerticalDepth(), intYmin_frac, pProcessSpec.getVerticalDepth(), intYmax_frac-intYmin_frac); break; } return led; } - } diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/LedString.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java similarity index 75% rename from src/config-tool/ConfigTool/src/org/hyperion/config/LedString.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java index 75936f62..ecb1ef15 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/LedString.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/LedString.java @@ -1,17 +1,19 @@ -package org.hyperion.config; +package org.hyperion.hypercon; import java.io.FileWriter; import java.io.IOException; import java.util.Locale; import java.util.Vector; -import org.hyperion.config.spec.ColorConfig; -import org.hyperion.config.spec.DeviceConfig; -import org.hyperion.config.spec.ImageProcessConfig; -import org.hyperion.config.spec.Led; -import org.hyperion.config.spec.LedFrameConstruction; -import org.hyperion.config.spec.MiscConfig; - +import org.hyperion.hypercon.spec.ColorConfig; +import org.hyperion.hypercon.spec.DeviceConfig; +import org.hyperion.hypercon.spec.ImageProcessConfig; +import org.hyperion.hypercon.spec.Led; +import org.hyperion.hypercon.spec.LedFrameConstruction; +import org.hyperion.hypercon.spec.MiscConfig; +/** + * The full configuration of Hyperion with sub-items for device, color and miscelanuous items. + */ public class LedString { /** The configuration of the output device */ @@ -31,6 +33,13 @@ public class LedString { /** The translation of the led frame construction and image processing to individual led configuration */ public Vector leds; + /** + * Writes the configuration to the given file + * + * @param mFilename The absolute filename + * + * @throws IOException If unable to write the given file + */ public void saveConfigFile(String mFilename) throws IOException { try (FileWriter fw = new FileWriter(mFilename)) { @@ -57,6 +66,11 @@ public class LedString { } } + /** + * Converts the list with leds specifications to a JSON string as used by the Hyperion Deamon + * + * @return The JSON string with led-specifications + */ String ledToJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\"leds\" : \n"); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java new file mode 100644 index 00000000..721dd0c1 --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/Main.java @@ -0,0 +1,37 @@ +package org.hyperion.hypercon; + +import javax.swing.JFrame; +import javax.swing.UIManager; + +import org.hyperion.hypercon.gui.ConfigPanel; + +/** + * (static) Main-class for starting HyperCon (the Hyperion configuration file builder) as a standard + * JAVA application (contains the entry-point). + */ +public class Main { + + /** + * Entry point to start HyperCon + * + * @param pArgs HyperCon does not have command line arguments + */ + public static void main(String[] pArgs) { + try { + // Configure swing to use the system default look and feel + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) {} + + // Create a frame for the configuration panel + JFrame frame = new JFrame(); + frame.setTitle("Hyperion configuration Tool"); + frame.setSize(1300, 600); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + + // Add the HyperCon configuration panel + frame.setContentPane(new ConfigPanel()); + + // Show the frame + frame.setVisible(true); + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ColorConfigPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ColorConfigPanel.java similarity index 98% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/ColorConfigPanel.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ColorConfigPanel.java index 31b66e5b..97f16f11 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ColorConfigPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ColorConfigPanel.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -8,6 +8,11 @@ import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; +/** + * Configuration panel for the ColorConfig. + * + * NB This has not been integrated in the GUI jet! + */ public class ColorConfigPanel extends JPanel { private JPanel mRgbTransformPanel; private JLabel mThresholdLabel; diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ConfigPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java similarity index 72% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/ConfigPanel.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java index ff122804..ba763e05 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ConfigPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import java.awt.BorderLayout; import java.awt.Dimension; @@ -15,17 +15,23 @@ import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JPanel; -import org.hyperion.config.LedFrameFactory; -import org.hyperion.config.LedString; +import org.hyperion.hypercon.LedFrameFactory; +import org.hyperion.hypercon.LedString; +/** + * The main-config panel of HyperCon. Includes the configuration and the panels to edit and + * write-out the configuration. This can be placed on JFrame, JDialog or JApplet as required. + */ public class ConfigPanel extends JPanel { + /** The LED configuration information*/ private final LedString ledString = new LedString(); + /** Action for write the Hyperion deamon configuration file */ private final Action mSaveConfigAction = new AbstractAction("Create Hyperion Configuration") { + JFileChooser fileChooser = new JFileChooser(); @Override public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); if (fileChooser.showSaveDialog(ConfigPanel.this) != JFileChooser.APPROVE_OPTION) { return; } @@ -39,27 +45,39 @@ public class ConfigPanel extends JPanel { } }; + /** The panel for containing the example 'Hyperion TV' */ private JPanel mTvPanel; + /** The simulated 'Hyperion TV' */ private JHyperionTv mHyperionTv; - private JPanel mConstructionPanel; - - private JPanel mIntegrationPanel; - + /** The left (WEST) side panel containing the diferent configuration panels */ private JPanel mSpecificationPanel; + /** The panel for specifying the construction of the LED-Frame */ + private JPanel mConstructionPanel; + + /** The panel for specifying the image integration */ + private JPanel mIntegrationPanel; + + /** The panel for specifying the miscallenuous configuration */ private MiscConfigPanel mMiscPanel; + /** The button connected to mSaveConfigAction */ private JButton mSaveConfigButton; + /** + * Constructs the configuration panel with a default initialised led-frame and configuration + */ public ConfigPanel() { super(); initialise(); + // Compute the individual leds for the current configuration ledString.leds = LedFrameFactory.construct(ledString.mLedFrameConfig, ledString.mProcessConfig); mHyperionTv.setLeds(ledString.leds); + // Add Observer to update the individual leds if the configuration changes final Observer observer = new Observer() { @Override public void update(Observable o, Object arg) { @@ -72,6 +90,9 @@ public class ConfigPanel extends JPanel { ledString.mProcessConfig.addObserver(observer); } + /** + * Initialises the config-panel + */ private void initialise() { setLayout(new BorderLayout()); @@ -80,6 +101,11 @@ public class ConfigPanel extends JPanel { } + /** + * Created, if not exists, and returns the panel holding the simulated 'Hyperion TV' + * + * @return The Tv panel + */ private JPanel getTvPanel() { if (mTvPanel == null) { mTvPanel = new JPanel(); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ImageProcessPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ImageProcessPanel.java similarity index 84% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/ImageProcessPanel.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ImageProcessPanel.java index 010763a8..8042321e 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/ImageProcessPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ImageProcessPanel.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -15,7 +15,7 @@ import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.hyperion.config.spec.ImageProcessConfig; +import org.hyperion.hypercon.spec.ImageProcessConfig; public class ImageProcessPanel extends JPanel implements Observer { @@ -126,25 +126,30 @@ public class ImageProcessPanel extends JPanel implements Observer { @Override public void update(Observable pObs, Object pArg) { if (pObs == mProcessConfig && pArg != this) { - mHorizontalDepthSpinner.setValue(mProcessConfig.horizontalDepth * 100.0); - mVerticalDepthSpinner.setValue(mProcessConfig.verticalDepth * 100.0); - mOverlapSpinner.setValue(mProcessConfig.overlapFraction * 100.0); + mHorizontalDepthSpinner.setValue(mProcessConfig.getHorizontalDepth() * 100.0); + mVerticalDepthSpinner.setValue(mProcessConfig.getVerticalDepth() * 100.0); + mOverlapSpinner.setValue(mProcessConfig.getOverlapFraction() * 100.0); } } private final ActionListener mActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - mProcessConfig.blackBorderRemoval = (mBlackborderDetectorCombo.getSelectedItem() == "On"); + // Update the processing configuration + mProcessConfig.setBlackBorderRemoval((mBlackborderDetectorCombo.getSelectedItem() == "On")); + + // Notify observers + mProcessConfig.notifyObservers(this); } }; private final ChangeListener mChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - mProcessConfig.horizontalDepth = ((Double)mHorizontalDepthSpinner.getValue())/100.0; - mProcessConfig.verticalDepth = ((Double)mVerticalDepthSpinner.getValue())/100.0; - mProcessConfig.overlapFraction = ((Double)mOverlapSpinner.getValue())/100.0; - - mProcessConfig.setChanged(); + // Update the processing configuration + mProcessConfig.setHorizontalDepth(((Double)mHorizontalDepthSpinner.getValue())/100.0); + mProcessConfig.setVerticalDepth(((Double)mVerticalDepthSpinner.getValue())/100.0); + mProcessConfig.setOverlapFraction(((Double)mOverlapSpinner.getValue())/100.0); + + // Notify observers mProcessConfig.notifyObservers(this); } }; diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/JHyperionTv.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/JHyperionTv.java similarity index 98% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/JHyperionTv.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/JHyperionTv.java index 0e58c21a..6f225f8e 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/JHyperionTv.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/JHyperionTv.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import java.awt.BasicStroke; import java.awt.BorderLayout; @@ -28,7 +28,7 @@ import javax.swing.JMenu; import javax.swing.JPopupMenu; import javax.swing.SwingWorker; -import org.hyperion.config.spec.Led; +import org.hyperion.hypercon.spec.Led; public class JHyperionTv extends Component { @@ -293,7 +293,7 @@ public class JHyperionTv extends Component { ledPaint.screenX = led.lastX; ledPaint.screenY = led.lastY; - ledPaint.angle_rad = 0.5*Math.PI - led.led.mSide.getAngle(); + ledPaint.angle_rad = 0.5*Math.PI - led.led.mSide.getAngle_rad(); ledPaint.seqNr = led.led.mLedSeqNr; } diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/LedFramePanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java similarity index 98% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/LedFramePanel.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java index 0197d453..057c72c5 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/LedFramePanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -13,8 +13,8 @@ import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.hyperion.config.spec.DeviceType; -import org.hyperion.config.spec.LedFrameConstruction; +import org.hyperion.hypercon.spec.DeviceType; +import org.hyperion.hypercon.spec.LedFrameConstruction; public class LedFramePanel extends JPanel { diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/MiscConfigPanel.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/MiscConfigPanel.java similarity index 97% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/MiscConfigPanel.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/MiscConfigPanel.java index 5f9d1236..686842b5 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/MiscConfigPanel.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/MiscConfigPanel.java @@ -1,4 +1,4 @@ -package org.hyperion.config.gui; +package org.hyperion.hypercon.gui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -8,8 +8,8 @@ import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; -import org.hyperion.config.spec.BootSequence; -import org.hyperion.config.spec.MiscConfig; +import org.hyperion.hypercon.spec.BootSequence; +import org.hyperion.hypercon.spec.MiscConfig; public class MiscConfigPanel extends JPanel { diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_01.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_01.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_01.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_01.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_02.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_02.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_02.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_02.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_03.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_03.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImageBBB_03.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImageBBB_03.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_01.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_01.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_01.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_01.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_02.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_02.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_02.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_02.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_03.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_03.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_03.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_03.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_04.png b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_04.png similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_04.png rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_04.png diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_05.png.REMOVED.git-id b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_05.png.REMOVED.git-id similarity index 100% rename from src/config-tool/ConfigTool/src/org/hyperion/config/gui/TestImage_05.png.REMOVED.git-id rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/TestImage_05.png.REMOVED.git-id diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BootSequence.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BootSequence.java new file mode 100644 index 00000000..f21f73c2 --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BootSequence.java @@ -0,0 +1,31 @@ +package org.hyperion.hypercon.spec; + +/** + * Enumeration of possible boot sequences + */ +public enum BootSequence { + /** The rainbow boot sequence */ + rainbow, + /** The Knight Rider (or KITT) boot sequence */ + knight_rider, + /** No boot sequence */ + none; + + /** + * Returns a string representation of the BootSequence + * + * @return String representation of this boot-sequence + */ + @Override + public String toString() { + switch(this) { + case rainbow: + return "Rainbow"; + case knight_rider: + return "Kinght Rider"; + case none: + return "None"; + } + return "None"; + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BorderSide.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BorderSide.java new file mode 100644 index 00000000..bda7ce3c --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/BorderSide.java @@ -0,0 +1,37 @@ +package org.hyperion.hypercon.spec; + +/** + * Enumeration of possible led-locations (aka border-sides). This also contains the specification of + * the angle at which the led is placed along a specific border (0.0rad = pointing right). + */ +public enum BorderSide { + top_left (0.75*Math.PI), + top(0.5*Math.PI), + top_right(0.25*Math.PI), + right(0.0*Math.PI), + bottom_right(-0.25*Math.PI), + bottom(-0.5*Math.PI), + bottom_left(-0.75*Math.PI), + left(1.0*Math.PI); + + /** The angle of the led [rad] */ + private final double mAngle_rad; + + /** + * Constructs the BorderSide with the given led angle + * + * @param pAngle_rad The angle of the led [rad] + */ + BorderSide(double pAngle_rad) { + mAngle_rad = pAngle_rad; + } + + /** + * Returns the angle of the led placement + * + * @return The angle of the led [rad] + */ + public double getAngle_rad() { + return mAngle_rad; + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/ColorConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ColorConfig.java similarity index 63% rename from src/config-tool/ConfigTool/src/org/hyperion/config/spec/ColorConfig.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ColorConfig.java index 0df65857..539659ec 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/ColorConfig.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ColorConfig.java @@ -1,27 +1,49 @@ -package org.hyperion.config.spec; +package org.hyperion.hypercon.spec; import java.util.Locale; +/** + * The color tuning parameters of the different color channels (both in RGB space as in HSV space) + */ public class ColorConfig { + /** The saturation gain (in HSV space) */ double mSaturationGain = 1.0; + /** The value gain (in HSV space) */ double mValueGain = 1.0; + /** The minimum required RED-value (in RGB space) */ double mRedThreshold = 0.0; + /** The gamma-curve correct for the RED-value (in RGB space) */ double mRedGamma = 1.0; + /** The black-level of the RED-value (in RGB space) */ double mRedBlacklevel = 0.0; + /** The white-level of the RED-value (in RGB space) */ double mRedWhitelevel = 1.0; + /** The minimum required GREEN-value (in RGB space) */ double mGreenThreshold = 0.0; + /** The gamma-curve correct for the GREEN-value (in RGB space) */ double mGreenGamma = 1.0; + /** The black-level of the GREEN-value (in RGB space) */ double mGreenBlacklevel = 0.0; + /** The white-level of the GREEN-value (in RGB space) */ double mGreenWhitelevel = 1.0; + /** The minimum required BLUE-value (in RGB space) */ double mBlueThreshold = 0.0; + /** The gamma-curve correct for the BLUE-value (in RGB space) */ double mBlueGamma = 1.0; + /** The black-level of the BLUE-value (in RGB space) */ double mBlueBlacklevel = 0.0; + /** The white-level of the BLUE-value (in RGB space) */ double mBlueWhitelevel = 1.0; + /** + * Creates the JSON string of the configuration as used in the Hyperion daemon configfile + * + * @return The JSON string of this ColorConfig + */ public String toJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\"color\" :\n"); @@ -33,7 +55,12 @@ public class ColorConfig { return strBuf.toString(); } - public String hsvToJsonString() { + /** + * Creates the JSON string of the HSV-subconfiguration as used in the Hyperion deaomn configfile + * + * @return The JSON string of the HSV-config + */ + private String hsvToJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\t\"hsv\" :\n"); strBuf.append("\t\t{\n"); @@ -44,7 +71,12 @@ public class ColorConfig { return strBuf.toString(); } - public String rgbToJsonString() { + /** + * Creates the JSON string of the RGB-subconfiguration as used in the Hyperion deaomn configfile + * + * @return The JSON string of the RGB-config + */ + private String rgbToJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\t\"red\" :\n"); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java similarity index 63% rename from src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceConfig.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java index a04e4c17..58cef5c8 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/DeviceConfig.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java @@ -1,12 +1,24 @@ -package org.hyperion.config.spec; +package org.hyperion.hypercon.spec; +/** + * The device specific configuration + */ public class DeviceConfig { + /** The name of the device */ String mName = "MyPi"; + /** The type specification of the device */ DeviceType mType = DeviceType.ws2801; + /** The device 'file' name */ String mOutput = "/dev/spidev0.0"; + /** The baudrate of the device */ int mBaudrate = 48000; + /** + * Creates the JSON string of the configuration as used in the Hyperion daemon configfile + * + * @return The JSON string of this DeviceConfig + */ public String toJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\"device\" :\n"); diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceType.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceType.java new file mode 100644 index 00000000..963a49e3 --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceType.java @@ -0,0 +1,13 @@ +package org.hyperion.hypercon.spec; + +/** + * Enumeration of known device types + */ +public enum DeviceType { + /** WS2801 Led String device with one continuous shift-register */ + ws2801, + /** Test device for writing color values to file-output */ + test, + /** No device, no output is generated */ + none; +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ImageProcessConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ImageProcessConfig.java new file mode 100644 index 00000000..9ec4e68c --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/ImageProcessConfig.java @@ -0,0 +1,110 @@ +package org.hyperion.hypercon.spec; + +import java.util.Observable; + +import org.hyperion.hypercon.LedFrameFactory; + +/** + * Configuration parameters for the image processing. These settings are translated using the + * {@link LedFrameFactory} to configuration items used in the Hyperion daemon configfile. + * + */ +public class ImageProcessConfig extends Observable { + + /** The 'integration depth' of the leds along the horizontal axis of the tv */ + private double mHorizontalDepth = 0.05; + /** The 'integration depth' of the leds along the vertical axis of the tv */ + private double mVerticalDepth = 0.05; + + /** The fraction of overlap from one to another led */ + private double mOverlapFraction = 0.0; + + /** Flag indicating that black borders are excluded in the image processing */ + private boolean mBlackBorderRemoval = true; + + /** + * Returns the horizontal depth (top and bottom) of the image integration as a fraction of the + * image [0.0; 1.0] + * + * @return The horizontal integration depth [0.0; 1.0] + */ + public double getHorizontalDepth() { + return mHorizontalDepth; + } + + /** + * Sets the horizontal depth (top and bottom) of the image integration as a fraction of the + * image [0.0; 1.0] + * + * @param pHorizontalDepth The horizontal integration depth [0.0; 1.0] + */ + public void setHorizontalDepth(double pHorizontalDepth) { + if (mHorizontalDepth != pHorizontalDepth) { + mHorizontalDepth = pHorizontalDepth; + setChanged(); + } + } + + /** + * Returns the vertical depth (left and right) of the image integration as a fraction of the + * image [0.0; 1.0] + * + * @return The vertical integration depth [0.0; 1.0] + */ + public double getVerticalDepth() { + return mVerticalDepth; + } + + /** + * Sets the vertical depth (left and right) of the image integration as a fraction of the + * image [0.0; 1.0] + * + * @param pVerticalDepth The vertical integration depth [0.0; 1.0] + */ + public void setVerticalDepth(double pVerticalDepth) { + if (mVerticalDepth != pVerticalDepth) { + mVerticalDepth = pVerticalDepth; + setChanged(); + } + } + + /** + * Returns the fractional overlap of one integration tile with its neighbors + * + * @return The fractional overlap of the integration tiles + */ + public double getOverlapFraction() { + return mOverlapFraction; + } + + /** + * Sets the fractional overlap of one integration tile with its neighbors + * + * @param pOverlapFraction The fractional overlap of the integration tiles + */ + public void setOverlapFraction(double pOverlapFraction) { + if (mOverlapFraction != pOverlapFraction) { + mOverlapFraction = pOverlapFraction; + setChanged(); + } + } + + /** + * Returns the black border removal flag + * @return True if black border removal is enabled else false + */ + public boolean isBlackBorderRemoval() { + return mBlackBorderRemoval; + } + + /** + * Sets the black border removal flag + * @param pBlackBorderRemoval True if black border removal is enabled else false + */ + public void setBlackBorderRemoval(boolean pBlackBorderRemoval) { + if (mBlackBorderRemoval != pBlackBorderRemoval) { + mBlackBorderRemoval = pBlackBorderRemoval; + setChanged(); + } + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/Led.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/Led.java new file mode 100644 index 00000000..8edbc6b4 --- /dev/null +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/Led.java @@ -0,0 +1,33 @@ +package org.hyperion.hypercon.spec; + +import java.awt.geom.Point2D; +import java.awt.geom.Rectangle2D; + + +/** + * Led specification with fractional location along screen border and fractional-rectangle for + * integrating an image into led color + */ +public class Led { + /** The sequence number of the led */ + public int mLedSeqNr; + + /** The side along which the led is placed */ + public BorderSide mSide; + + /** The fractional location of the led */ + public Point2D mLocation; + + /** The fractional rectangle for image integration */ + public Rectangle2D mImageRectangle; + + /** + * String representation of the led specification + * + * @return The led specs as nice readable string + */ + @Override + public String toString() { + return "Led[" + mLedSeqNr + "] Location=" + mLocation + " Rectangle=" + mImageRectangle; + } +} diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/LedFrameConstruction.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/LedFrameConstruction.java similarity index 91% rename from src/config-tool/ConfigTool/src/org/hyperion/config/spec/LedFrameConstruction.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/LedFrameConstruction.java index 087b5e96..6b8d815f 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/LedFrameConstruction.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/LedFrameConstruction.java @@ -1,4 +1,4 @@ -package org.hyperion.config.spec; +package org.hyperion.hypercon.spec; import java.util.Observable; @@ -6,12 +6,15 @@ import java.util.Observable; /** * The LedFrame describes the construction of leds along the sides of the TV screen. - * */ public class LedFrameConstruction extends Observable { - + /** + * Enumeration of the led configuration direction + */ public enum Direction { + /** Clockwise led configuration */ clockwise, + /** Counter Clockwise led configuration */ counter_clockwise; } diff --git a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/MiscConfig.java b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java similarity index 64% rename from src/config-tool/ConfigTool/src/org/hyperion/config/spec/MiscConfig.java rename to src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java index bce46322..d31d7444 100644 --- a/src/config-tool/ConfigTool/src/org/hyperion/config/spec/MiscConfig.java +++ b/src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/MiscConfig.java @@ -1,24 +1,43 @@ -package org.hyperion.config.spec; +package org.hyperion.hypercon.spec; import java.util.Locale; - +/** + * Miscellaneous configuration items for the Hyperion daemon. + */ public class MiscConfig { + /** The selected boot sequence */ public BootSequence mBootSequence = BootSequence.rainbow; + /** The length of the boot sequence [ms] */ public int mBootSequenceLength_ms = 3000; + /** The width of 'grabbed' frames (screen shots) [pixels] */ public int mFrameGrabberWidth = 64; + /** The height of 'grabbed' frames (screen shots) [pixels] */ public int mFrameGrabberHeight = 64; + /** The interval of frame grabs (screen shots) [ms] */ public int mFrameGrabberInterval_ms = 100; + /** Flag enabling/disabling XBMC communication */ public boolean mXbmcChecker = true; + /** The IP-address of XBMC */ public String mXbmcAddress = "127.0.0.1"; + /** The TCP JSON-Port of XBMC */ public int mXbmcTcpPort = 9090; + /** Flag indicating that the frame-grabber is on during video playback */ public boolean mVideoOn = true; + /** Flag indicating that the frame-grabber is on during XBMC menu */ public boolean mMenuOn = false; + /** Flag indicating that the frame-grabber is on during picture slideshow */ public boolean mPictureOn = false; + /** Flag indicating that the frame-grabber is on during audio playback */ public boolean mAudioOn = false; + /** + * Creates the JSON string of the configuration as used in the Hyperion daemon configfile + * + * @return The JSON string of this MiscConfig + */ public String toJsonString() { StringBuffer strBuf = new StringBuffer(); strBuf.append("\t\"bootsequence\" :\n");