mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
added flag to have BGR output instead of RGB
Former-commit-id: dbd35d6dd4a84d95e0a034b99843be4949a6e169
This commit is contained in:
@@ -13,6 +13,8 @@ public class DeviceConfig {
|
||||
String mOutput = "/dev/spidev0.0";
|
||||
/** The baudrate of the device */
|
||||
int mBaudrate = 1000000;
|
||||
/** Flag indicating if the red and blue should be reversed */
|
||||
boolean mBgrOutput = false;
|
||||
|
||||
/**
|
||||
* Creates the JSON string of the configuration as used in the Hyperion daemon configfile
|
||||
@@ -23,20 +25,22 @@ public class DeviceConfig {
|
||||
StringBuffer strBuf = new StringBuffer();
|
||||
|
||||
strBuf.append("\t/// Device configuration contains the following fields: \n");
|
||||
strBuf.append("\t/// * 'name' : The user friendly name of the device (only used for display purposes)\n");
|
||||
strBuf.append("\t/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'test' and 'none')\n");
|
||||
strBuf.append("\t/// * 'output' : The output specification depends on selected device\n");
|
||||
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/// * 'name' : The user friendly name of the device (only used for display purposes)\n");
|
||||
strBuf.append("\t/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'test' and 'none')\n");
|
||||
strBuf.append("\t/// * 'output' : The output specification depends on selected device\n");
|
||||
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/// * 'bgr-output' : Use BGR output instead of RGB (reverse red and blue).\n");
|
||||
|
||||
strBuf.append("\t\"device\" :\n");
|
||||
strBuf.append("\t{\n");
|
||||
|
||||
strBuf.append("\t\t\"name\" : \"").append(mName).append("\",\n");
|
||||
strBuf.append("\t\t\"type\" : \"").append(mType).append("\",\n");
|
||||
strBuf.append("\t\t\"output\" : \"").append(mOutput).append("\",\n");
|
||||
strBuf.append("\t\t\"rate\" : ").append(mBaudrate).append("\n");
|
||||
strBuf.append("\t\t\"name\" : \"").append(mName).append("\",\n");
|
||||
strBuf.append("\t\t\"type\" : \"").append(mType).append("\",\n");
|
||||
strBuf.append("\t\t\"output\" : \"").append(mOutput).append("\",\n");
|
||||
strBuf.append("\t\t\"rate\" : ").append(mBaudrate).append(",\n");
|
||||
strBuf.append("\t\t\"bgr-output\" : ").append(mBgrOutput).append("\n");
|
||||
|
||||
strBuf.append("\t}");
|
||||
|
||||
|
@@ -5,9 +5,20 @@ package org.hyperion.hypercon.spec;
|
||||
*/
|
||||
public enum DeviceType {
|
||||
/** WS2801 Led String device with one continuous shift-register */
|
||||
ws2801,
|
||||
ws2801("WS2801"),
|
||||
/** Test device for writing color values to file-output */
|
||||
test,
|
||||
test("Test"),
|
||||
/** No device, no output is generated */
|
||||
none;
|
||||
none("None");
|
||||
|
||||
private final String mName;
|
||||
|
||||
private DeviceType(String name) {
|
||||
mName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user