mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Merge remote-tracking branch 'remotes/origin/master'
Conflicts: src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/ConfigPanel.java src/config-tool/ConfigTool/src/org/hyperion/hypercon/gui/LedFramePanel.java src/config-tool/ConfigTool/src/org/hyperion/hypercon/spec/DeviceConfig.java Former-commit-id: 18ef539aef815aaf80e0954b27647d29acb0be6c
This commit is contained in:
@@ -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();
|
||||
|
||||
|
@@ -7,8 +7,8 @@ import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.hyperion.hypercon.spec.ColorByteOrder;
|
||||
import org.hyperion.hypercon.spec.DeviceConfig;
|
||||
import org.hyperion.hypercon.spec.RgbByteOrder;
|
||||
|
||||
public class DevicePanel extends JPanel {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DevicePanel extends JPanel {
|
||||
private JComboBox<Integer> mBaudrateCombo;
|
||||
|
||||
private JLabel mRgbLabel;
|
||||
private JComboBox<RgbByteOrder> mRgbCombo;
|
||||
private JComboBox<ColorByteOrder> mRgbCombo;
|
||||
|
||||
public DevicePanel(DeviceConfig pDeviceConfig) {
|
||||
super();
|
||||
@@ -52,8 +52,8 @@ public class DevicePanel extends JPanel {
|
||||
mRgbLabel = new JLabel("RGB Byte Order");
|
||||
add(mRgbLabel);
|
||||
|
||||
mRgbCombo = new JComboBox<>(RgbByteOrder.values());
|
||||
mRgbCombo.setSelectedItem(mDeviceConfig.mRgbByteOrder);
|
||||
mRgbCombo = new JComboBox<>(ColorByteOrder.values());
|
||||
mRgbCombo.setSelectedItem(mDeviceConfig.mColorByteOrder);
|
||||
mRgbCombo.addActionListener(mActionListener);
|
||||
add(mRgbCombo);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class DevicePanel extends JPanel {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
mDeviceConfig.mOutput = (String)mOutputCombo.getSelectedItem();
|
||||
mDeviceConfig.mBaudrate = (Integer)mBaudrateCombo.getSelectedItem();
|
||||
mDeviceConfig.mRgbByteOrder = (RgbByteOrder)mRgbCombo.getSelectedItem();
|
||||
mDeviceConfig.mColorByteOrder = (ColorByteOrder)mRgbCombo.getSelectedItem();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -0,0 +1,5 @@
|
||||
package org.hyperion.hypercon.spec;
|
||||
|
||||
public enum ColorByteOrder {
|
||||
RGB, RBG, BRG, BGR, GRB, GBR
|
||||
}
|
@@ -1,21 +1,20 @@
|
||||
package org.hyperion.hypercon.spec;
|
||||
|
||||
|
||||
/**
|
||||
* The device specific configuration
|
||||
*/
|
||||
public class DeviceConfig {
|
||||
|
||||
/** The name of the device */
|
||||
public String mName = "MyPi";
|
||||
public String mName = "MyPi";
|
||||
/** The type specification of the device */
|
||||
public DeviceType mType = DeviceType.ws2801;
|
||||
public DeviceType mType = DeviceType.ws2801;
|
||||
/** The device 'file' name */
|
||||
public String mOutput = "/dev/spidev0.0";
|
||||
public String mOutput = "/dev/spidev0.0";
|
||||
/** The baudrate of the device */
|
||||
public int mBaudrate = 1000000;
|
||||
/** Ordering of the rgb-color channels */
|
||||
public RgbByteOrder mRgbByteOrder = RgbByteOrder.rbg;
|
||||
public int mBaudrate = 1000000;
|
||||
/** The order of the color bytes */
|
||||
public ColorByteOrder mColorByteOrder = ColorByteOrder.RGB;
|
||||
|
||||
/**
|
||||
* Creates the JSON string of the configuration as used in the Hyperion daemon configfile
|
||||
@@ -32,7 +31,7 @@ public class DeviceConfig {
|
||||
strBuf.append("\t/// - 'ws2801' this is the device (eg '/dev/spidev0.0')\n");
|
||||
strBuf.append("\t/// - 'test' this is the file used to write test output (eg '/home/pi/hyperion.out')\n");
|
||||
strBuf.append("\t/// * 'rate' : The baudrate of the output to the device (only applicable for 'ws2801')\n");
|
||||
strBuf.append("\t/// * 'colorOrder' : The order of the byte color channel (rgb, rbg, bgr, brg, gbr, grb).\n");
|
||||
strBuf.append("\t/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).\n");
|
||||
|
||||
strBuf.append("\t\"device\" :\n");
|
||||
strBuf.append("\t{\n");
|
||||
@@ -41,11 +40,10 @@ public class DeviceConfig {
|
||||
strBuf.append("\t\t\"type\" : \"").append(mType.name()).append("\",\n");
|
||||
strBuf.append("\t\t\"output\" : \"").append(mOutput).append("\",\n");
|
||||
strBuf.append("\t\t\"rate\" : ").append(mBaudrate).append(",\n");
|
||||
strBuf.append("\t\t\"colorOrder\" : ").append(mRgbByteOrder.name()).append("\n");
|
||||
strBuf.append("\t\t\"colorOrder\" : \"").append(mColorByteOrder.name().toLowerCase()).append("\"\n");
|
||||
|
||||
strBuf.append("\t}");
|
||||
|
||||
return strBuf.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +0,0 @@
|
||||
package org.hyperion.hypercon.spec;
|
||||
|
||||
public enum RgbByteOrder {
|
||||
rgb,
|
||||
rbg,
|
||||
grb,
|
||||
gbr,
|
||||
brg,
|
||||
bgr;
|
||||
|
||||
}
|
@@ -1,13 +1,13 @@
|
||||
package org.hyperion.hypercon.test;
|
||||
|
||||
import org.hyperion.hypercon.ConfigurationFile;
|
||||
import org.hyperion.hypercon.spec.ColorByteOrder;
|
||||
import org.hyperion.hypercon.spec.ColorConfig;
|
||||
import org.hyperion.hypercon.spec.DeviceConfig;
|
||||
import org.hyperion.hypercon.spec.DeviceType;
|
||||
import org.hyperion.hypercon.spec.ImageProcessConfig;
|
||||
import org.hyperion.hypercon.spec.LedFrameConstruction;
|
||||
import org.hyperion.hypercon.spec.MiscConfig;
|
||||
import org.hyperion.hypercon.spec.RgbByteOrder;
|
||||
|
||||
public class TesConfigWriter {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class TesConfigWriter {
|
||||
MiscConfig miscConfig = new MiscConfig();
|
||||
|
||||
deviceConfig.mBaudrate = 4800;
|
||||
deviceConfig.mRgbByteOrder = RgbByteOrder.bgr;
|
||||
deviceConfig.mColorByteOrder = ColorByteOrder.BGR;
|
||||
deviceConfig.mName = "DAG";
|
||||
deviceConfig.mOutput = "/dev/null";
|
||||
deviceConfig.mType = DeviceType.ldp6803;
|
||||
|
Reference in New Issue
Block a user