diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index acc33ff91..d2d350685 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -10,4 +10,4 @@ updates:
directory: "/"
schedule:
interval: daily
- open-pull-requests-limit: 10
+ open-pull-requests-limit: 10
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 779e12137..720762fda 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,11 +21,11 @@ jobs:
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
shell: bash
- - name: Set up AdoptOpenJDK 17
+ - name: Set up AdoptOpenJDK 20
uses: actions/setup-java@v3
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '20'
architecture: x64
- name: Install submodules
run: |
@@ -79,11 +79,11 @@ jobs:
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- - name: Set up AdoptOpenJDK 17
+ - name: Set up AdoptOpenJDK 20
uses: actions/setup-java@v3
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '20'
architecture: x64
- id: get-id
run: |
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index fd2751250..fd2ac11d6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -49,11 +49,11 @@ jobs:
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
shell: bash
- - name: Set up AdoptOpenJDK 17
+ - name: Set up AdoptOpenJDK 20
uses: actions/setup-java@v3
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '20'
architecture: x64
- name: Install submodules
run: |
@@ -103,11 +103,11 @@ jobs:
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- - name: Set up AdoptOpenJDK 17
+ - name: Set up AdoptOpenJDK 20
uses: actions/setup-java@v3
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '20'
architecture: x64
- id: get-id
run: |
@@ -162,11 +162,11 @@ jobs:
id=$(echo $RELEASE_VERSION | cut -dv -f2)
echo "id=$id" >> $GITHUB_OUTPUT
shell: bash
- - name: Set up AdoptOpenJDK 17
+ - name: Set up AdoptOpenJDK 20
uses: actions/setup-java@v3
with:
distribution: 'temurin'
- java-version: '17'
+ java-version: '20'
architecture: x64
- name: Set up Maven Settings for deploy
uses: s4u/maven-settings-action@v2.8.0
diff --git a/data/img/ha_luciferin.jpg b/data/img/ha_luciferin.jpg
index a0aab29a8..b06f005b5 100644
Binary files a/data/img/ha_luciferin.jpg and b/data/img/ha_luciferin.jpg differ
diff --git a/docs/index.md b/docs/index.md
index 19cf4a00c..091ac6cb9 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -19,6 +19,38 @@
### In this release:
+- ***Breaking changes***: requires `Glow Worm Luciferin` (v5.11.8)
+- **Added support for ESP32-C3, ESP32-S2, ESP32-S3.**
+ Lolin ESP32-C3, Lolin ESP32-S2 and Lolin ESP32-S3 are now fully compatible with the existing Luciferin Official PCB.
+ TinyS2 and TinyS3 are now compatible with the existing Luciferin Module for the Luciferin Official PCB.
+ Closes [#46].
+- Added **support for DotStar LED strips.** Closes [#42].
+- Added the possibility to **configure GPIOs for Relay, Button and LDR**.
+- Added the possibility to **switch profiles through MQTT**. Closes [#110].
+- Added **BRG, RBG, GBR color order** support.
+- Improved power saving mode. Closes [#107].
+- Improved existing light effects.
+- Improved aspect ratio auto detection, very dark scenes do not trigger an aspect ratio switch as there is no way to
+ know which is the correct one.
+- IMAX 1.85:1 format now triggers the letterbox aspect ratio.
+- There is now a single Web Installer for both stable and beta firmware.
+- Reduced firmware footprint.
+- Removed the hard limit on the maximum number of LEDs. You can now use as many LEDs as you want as long as your
+ microcontroller has enough memory.
+- Increased the priority of the capturing threads. This fixed a flickering issue that occurs while using the smoothing
+ effect (frame generation) on Hybrid CPUs. Does not affect CPU load.
+- UDP broadcast collision fix. Corrects weird behaviours when using two instances of Firefly Luciferin on two or more
+ computers on the same network with UDP stream.
+- Configuring the Web Interface no longer requires an Internet connection. Closes [#52].
+- Fixed a bottleneck that reduced performance when driving many LEDs via USB. ESP32 was able to drive 500LEDs at 5FPS,
+ now it can drive the same amount of LEDs at 30FPS.
+- Fixed an issue that prevented a profile from changing the current framerate without pausing and restarting the
+ capture.
+- Arduino Bootstrapper update (v.1.15.2).
+
+
+### In the previous release:
+
- ***Breaking changes***: requires `Glow Worm Luciferin` (v5.10.6).
- **Added a smoothing feature that is used to smooth the transitions from one color to another**,
this is particularly useful to reduce eye strain with contents that produces fast flashing like fast peaced games or
@@ -40,9 +72,4 @@
- Web Installer now presents an option to install beta or previous version of the Glow Worm Luciferin firmware.
- Improved log level configurability.
- Removed warnings in the Home Assistant logs.
-- Arduino Bootstrapper update (v.1.14).
-
-### In the previous release:
-
-- ***Hotfix release:*** Fixed an issue that prevents 21:9 screen resolutions to correctly capture the screen. No
- firmware upgrade needed.
+- Arduino Bootstrapper update (v.1.14).
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7b7cbcfc1..cff422ef6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,11 +22,10 @@
2.11.7
UTF-8
UTF-8
- 17.0.2
20.0.2
0.0.8
- 17
- 17
+ 20
+ 20
3.11.0
3.6.0
3.2.4
diff --git a/src/main/java/org/dpsoftware/FireflyLuciferin.java b/src/main/java/org/dpsoftware/FireflyLuciferin.java
index dcc5f28db..bebf9c285 100644
--- a/src/main/java/org/dpsoftware/FireflyLuciferin.java
+++ b/src/main/java/org/dpsoftware/FireflyLuciferin.java
@@ -102,9 +102,13 @@ public class FireflyLuciferin extends Application implements SerialPortEventList
public static boolean communicationError = false;
public static Color colorInUse;
public static int gpio = 0; // 0 means not set, firmware discards this value
- public static int colorOrder = 1; // 1 means GRB, 2 RGB, 3 BGR
+ public static int colorOrder = 0; // 1 means GRB, 2 RGB, 3 BGR
public static int ldrAction = 0; // 1 no action, 2 calibrate, 3 reset, 4 save
public static int fireflyEffect = 0;
+ public static int relayPin = -1;
+ public static int sbPin = -1;
+ public static int ldrPin = -1;
+ public static int gpioClockPin = 0;
public static boolean nightMode = false;
public static String version = "";
public static String minimumFirmwareVersion = "";
@@ -167,6 +171,7 @@ public FireflyLuciferin() {
hostServices = this.getHostServices();
powerSavingManager = new PowerSavingManager();
powerSavingManager.setLastFrameTime(LocalDateTime.now());
+ NativeExecutor.setHighPriorityThreads(config.getThreadPriority());
}
/**
@@ -193,13 +198,22 @@ private static void setNightBrightness(boolean tempNightMode) {
/**
* Set LED number, this can be changed on the fly.
+ * We are transferring byte via Serial, the maximum decimal number that can be represented with 1 byte is 255.
+ * Use a multiplier to set a much bigger number using only 2 bytes.
*
* @param ledMatrixInUse led matrix in use
*/
public static void setLedNumber(String ledMatrixInUse) {
ledNumber = CommonUtility.isSingleDeviceMultiScreen() ? MessageServer.totalLedNum : config.getLedMatrixInUse(ledMatrixInUse).size();
- ledNumHighLowCount = ledNumber > Constants.SERIAL_CHUNK_SIZE ? Constants.SERIAL_CHUNK_SIZE - 1 : ledNumber - 1;
- ledNumHighLowCountSecondPart = ledNumber > Constants.SERIAL_CHUNK_SIZE ? ledNumber - Constants.SERIAL_CHUNK_SIZE : 0;
+ int multiplier = (int) Math.floor((double) ledNumber / Constants.SERIAL_CHUNK_SIZE);
+ int lastPart = ledNumber - (Constants.SERIAL_CHUNK_SIZE * multiplier);
+ if (lastPart < 1) {
+ multiplier--;
+ ledNumHighLowCount = Constants.SERIAL_CHUNK_SIZE - 1;
+ } else {
+ ledNumHighLowCount = ledNumber > Constants.SERIAL_CHUNK_SIZE ? lastPart - 1 : ledNumber - 1;
+ }
+ ledNumHighLowCountSecondPart = ledNumber > Constants.SERIAL_CHUNK_SIZE ? multiplier : 0;
}
/**
@@ -208,6 +222,7 @@ public static void setLedNumber(String ledMatrixInUse) {
* @param args startup args
*/
public static void main(String[] args) {
+ profileArgs = Constants.DEFAULT;
if (args.length > 1) {
profileArgs = args[1];
}
@@ -241,6 +256,7 @@ public static void checkForNightMode() {
*/
private void setRuntimeLogLevel() {
LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
+ log.info("** Log level -> " + config.getRuntimeLogLevel() + " **");
loggerContext.getLogger(Constants.LOG_LEVEL_ROOT).setLevel(Level.toLevel(config.getRuntimeLogLevel()));
}
diff --git a/src/main/java/org/dpsoftware/JavaFXStarter.java b/src/main/java/org/dpsoftware/JavaFXStarter.java
index d15fa00a0..4d4fbe617 100644
--- a/src/main/java/org/dpsoftware/JavaFXStarter.java
+++ b/src/main/java/org/dpsoftware/JavaFXStarter.java
@@ -22,6 +22,8 @@
package org.dpsoftware;
import lombok.extern.slf4j.Slf4j;
+import org.dpsoftware.config.Constants;
+import org.dpsoftware.utilities.CommonUtility;
import java.util.Objects;
@@ -52,6 +54,7 @@ public static void main(String... args) {
}
whoAmI = Integer.parseInt(args[0]);
spawnInstances = false;
+ CommonUtility.sleepMilliseconds(Constants.SPAWN_INSTANCE_WAIT_START_DELAY);
} else {
log.info("Starting default instance");
}
diff --git a/src/main/java/org/dpsoftware/NativeExecutor.java b/src/main/java/org/dpsoftware/NativeExecutor.java
index f74e029fd..55321ce45 100644
--- a/src/main/java/org/dpsoftware/NativeExecutor.java
+++ b/src/main/java/org/dpsoftware/NativeExecutor.java
@@ -44,6 +44,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.concurrent.TimeUnit;
/**
* A utility class for running native commands and get the results
@@ -55,27 +56,6 @@ public final class NativeExecutor {
public static boolean restartOnly = false;
public static boolean exitTriggered = false;
- /**
- * This is the real runner that return command output line by line.
- * It waits for the output, don't use it if you don't need the result output.
- *
- * @param cmdToRunUsingArgs Command to run and args, in an array
- * @return A list of string containing the output, empty list if command does not exist
- */
- public static List runNativeWaitForOutput(String[] cmdToRunUsingArgs) {
- return runNative(cmdToRunUsingArgs, true);
- }
-
- /**
- * This is the real runner that execute commands without waiting for the output.
- * It doesn't wait for the output, use it if you don't need the result output.
- *
- * @param cmdToRunUsingArgs Command to run and args, in an array
- */
- public static void runNativeNoWaitForOutput(String[] cmdToRunUsingArgs) {
- runNative(cmdToRunUsingArgs, false);
- }
-
/**
* This is the real runner that executes command.
* Don't use this method directly and prefer the runNativeWaitForOutput() or runNativeNoWaitForOutput() shortcut.
@@ -84,26 +64,21 @@ public static void runNativeNoWaitForOutput(String[] cmdToRunUsingArgs) {
* @param waitForOutput Example: If you need to exit the app you don't need to wait for the output or the app will not exit
* @return A list of string containing the output, empty list if command does not exist
*/
- private static List runNative(String[] cmdToRunUsingArgs, boolean waitForOutput) {
+ public static List runNative(String[] cmdToRunUsingArgs, int waitForOutput) {
Process process;
ArrayList cmdOutput = new ArrayList<>();
try {
- if (cmdToRunUsingArgs.length > 1) {
- process = Runtime.getRuntime().exec(cmdToRunUsingArgs);
- } else {
- process = Runtime.getRuntime().exec(cmdToRunUsingArgs[0]);
- }
+ process = Runtime.getRuntime().exec(cmdToRunUsingArgs);
} catch (SecurityException | IOException e) {
log.info(CommonUtility.getWord(Constants.CANT_RUN_CMD), Arrays.toString(cmdToRunUsingArgs), e.getMessage());
return new ArrayList<>(0);
}
- if (waitForOutput) {
+ if (waitForOutput > 0) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream(), Charset.defaultCharset()))) {
String line;
- while ((line = reader.readLine()) != null) {
+ while (process.waitFor(waitForOutput, TimeUnit.MILLISECONDS) && (line = reader.readLine()) != null) {
cmdOutput.add(line);
}
- process.waitFor();
} catch (IOException e) {
log.info(CommonUtility.getWord(Constants.NO_OUTPUT), Arrays.toString(cmdToRunUsingArgs), e.getMessage());
return new ArrayList<>(0);
@@ -121,24 +96,15 @@ private static List runNative(String[] cmdToRunUsingArgs, boolean waitFo
* @param whoAmISupposedToBe instance #
*/
public static void spawnNewInstance(int whoAmISupposedToBe) {
- String strToRun;
log.info("Installation path from spawn={}", getInstallationPath());
+ List execCommand = new ArrayList<>();
if (NativeExecutor.isWindows()) {
- String[] cmdToRun = getInstallationPath().split("\\\\");
- StringBuilder command = new StringBuilder();
- for (String str : cmdToRun) {
- if (str.contains(" ")) {
- command.append("\\" + "\"").append(str).append("\"");
- } else {
- command.append("\\").append(str);
- }
- }
- command = new StringBuilder(command.substring(1));
- strToRun = Constants.CMD_RUN + command + " " + whoAmISupposedToBe;
- } else {
- strToRun = getInstallationPath() + " " + whoAmISupposedToBe;
+ execCommand.add(Constants.CMD_SHELL_FOR_CMD_EXECUTION);
+ execCommand.add(Constants.CMD_PARAM_FOR_CMD_EXECUTION);
}
- runNativeNoWaitForOutput(new String[]{strToRun});
+ execCommand.add(getInstallationPath());
+ execCommand.add(String.valueOf(whoAmISupposedToBe));
+ runNative(execCommand.toArray(String[]::new), Constants.SPAWN_INSTANCE_WAIT_DELAY);
}
/**
@@ -148,15 +114,10 @@ public static void spawnNewInstances() {
if (JavaFXStarter.spawnInstances && FireflyLuciferin.config.getMultiMonitor() > 1) {
if (FireflyLuciferin.config.getMultiMonitor() == 3) {
NativeExecutor.spawnNewInstance(1);
- if ((FireflyLuciferin.config.getMultiMonitor() == 2) || (FireflyLuciferin.config.getMultiMonitor() == 3)) {
- CommonUtility.sleepSeconds(1);
- NativeExecutor.spawnNewInstance(2);
- }
- CommonUtility.sleepSeconds(1);
+ NativeExecutor.spawnNewInstance(2);
NativeExecutor.spawnNewInstance(3);
} else {
NativeExecutor.spawnNewInstance(1);
- CommonUtility.sleepSeconds(1);
if (FireflyLuciferin.config.getMultiMonitor() == 2) {
NativeExecutor.spawnNewInstance(2);
}
@@ -184,9 +145,9 @@ public static void restartNativeInstance(String profileToUse) {
execCommand.add(getInstallationPath());
execCommand.add(String.valueOf(JavaFXStarter.whoAmI));
if (profileToUse != null) {
- execCommand.add("\"" + profileToUse + "\"");
+ execCommand.add(profileToUse);
}
- runNativeNoWaitForOutput(execCommand.toArray(String[]::new));
+ runNative(execCommand.toArray(String[]::new), 0);
if (CommonUtility.isSingleDeviceMultiScreen()) {
restartOnly = true;
}
@@ -348,7 +309,7 @@ static void exitOtherInstances() {
*/
public static boolean isScreensaverRunning() {
String[] scrCmd = {Constants.CMD_SHELL_FOR_CMD_EXECUTION, Constants.CMD_PARAM_FOR_CMD_EXECUTION, Constants.CMD_LIST_RUNNING_PROCESS};
- List scrProcess = runNativeWaitForOutput(scrCmd);
+ List scrProcess = runNative(scrCmd, Constants.CMD_WAIT_DELAY);
return scrProcess.stream().filter(s -> s.contains(Constants.SCREENSAVER_EXTENSION)).findAny().orElse(null) != null;
}
@@ -388,4 +349,18 @@ public void deleteRegistryKey() {
}
}
+ /**
+ * Change thread priority to high = 128
+ */
+ public static void setHighPriorityThreads(String priority) {
+ if (isWindows()) {
+ CommonUtility.delaySeconds(() -> {
+ log.info("Changing thread priority to -> " + priority);
+ String[] cmd = {Constants.CMD_POWERSHELL, Constants.CMD_SET_PRIORITY
+ .replace("{0}", String.valueOf(Enums.ThreadPriority.valueOf(priority).getValue()))};
+ NativeExecutor.runNative(cmd, 0);
+ }, 1);
+ }
+ }
+
}
diff --git a/src/main/java/org/dpsoftware/config/Configuration.java b/src/main/java/org/dpsoftware/config/Configuration.java
index 73dc05d75..23ee43b4a 100644
--- a/src/main/java/org/dpsoftware/config/Configuration.java
+++ b/src/main/java/org/dpsoftware/config/Configuration.java
@@ -23,6 +23,7 @@
import ch.qos.logback.classic.Level;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -43,108 +44,108 @@
@NoArgsConstructor
@Getter
@Setter
+@JsonPropertyOrder({"mqttStream", "wifiEnable", "serialPort", "baudRate", "extendedLog"})
public class Configuration implements Cloneable {
- // Color correction, Hue-Saturation (using HSV 360° wheel)
- public Map hueMap;
- // Numbers of LEDs
- int topLed;
- int leftLed;
- int rightLed;
- int bottomLeftLed;
- int bottomRightLed;
- int bottomRowLed;
- // LED strip orientation
- String orientation;
- // Number of CPU Threads to use, this app is heavy multithreaded,
- // high cpu cores equals to higher framerate but big CPU usage
- // 4 Threads are enough for 24FPS on an Intel i7 5930K@4.2GHz
- // 3 thread is enough for 30FPS with GPU Hardware Acceleration and uses nearly no CPU
- private int numberOfCPUThreads;
- // Windows Desktop Duplication API
- private String captureMethod;
- // Serial port to use, use AUTO for automatic port search
- // NOTE: for full firmware this contains the deviceName of the MQTT device where to stream
- @JsonProperty("serialPort")
- private String outputDevice;
+ private String audioChannels = Enums.AudioChannels.AUDIO_CHANNEL_2.getBaseI18n();
+ private String audioDevice = NativeExecutor.isWindows() ? Enums.Audio.DEFAULT_AUDIO_OUTPUT_WASAPI.getBaseI18n()
+ : Enums.Audio.DEFAULT_AUDIO_OUTPUT_NATIVE.getBaseI18n();
+ private float audioLoopbackGain = 0.0f;
+ private boolean autoDetectBlackBars = true;
// Arduino/Microcontroller config
private String baudRate = Constants.DEFAULT_BAUD_RATE;
- // Default led matrix to use
- private String defaultLedMatrix;
- private boolean autoDetectBlackBars = true;
- // used for Serial connection timeout
- private int timeout = 100;
- // Screen resolution
- private int screenResX;
- private int screenResY;
- // OS Scaling factor example: 150%
- private int osScaling;
- // Gamma correction of 2.2 is recommended for LEDs like WS2812B or similar
- private double gamma;
- // White temperature for color correction (Kelvin)
- private int whiteTemperature = Constants.DEFAULT_WHITE_TEMP;
+ private int bottomLeftLed;
+ private int bottomRightLed;
+ private int bottomRowLed;
+ private int brightness;
+ // Brightness limiter
+ private Float brightnessLimiter = Enums.BrightnessLimiter.BRIGHTNESS_LIMIT_DISABLED.getBrightnessLimitFloat();
+ // Windows Desktop Duplication API
+ private String captureMethod;
+ private boolean checkForUpdates = true;
+ private String colorChooser = Constants.DEFAULT_COLOR_CHOOSER;
// Used for RGB, RGBW strips (accurate, brighter)
private int colorMode = 1;
+ private String configVersion = "";
+ // Default led matrix to use
+ private String defaultLedMatrix;
+ private String desiredFramerate = Constants.DEFAULT_FRAMERATE;
+ private String effect = Enums.Effect.BIAS_LIGHT.getBaseI18n();
+ // LDR
+ private boolean enableLDR;
+ // Misc Tab
+ private boolean eyeCare = false;
+ private String frameInsertion = Enums.FrameInsertion.NO_SMOOTHING.getBaseI18n();
// MQTT WiFi Config params
@JsonProperty("wifiEnable")
private boolean fullFirmware = false; // old name for compatibility with previous version
+ // Gamma correction of 2.2 is recommended for LEDs like WS2812B or similar
+ private double gamma;
+ private String gapTypeSide = Constants.GAP_TYPE_DEFAULT_SIDE;
+ private String gapTypeTopBottom = Constants.GAP_TYPE_DEFAULT_TOP_BOTTOM;
+ private String grabberAreaTopBottom = Constants.GRABBER_AREA_TOP_BOTTOM_DEFAULT;
+ private String grabberSide = Constants.GRABBER_AREA_SIDE_DEFAULT;
+ private int groupBy = Constants.GROUP_BY_LEDS;
+ private String language;
+ private int ldrInterval;
+ private int ldrMin;
+ private boolean ldrTurnOff;
+ private int ledStartOffset = 0;
+ private int leftLed;
+ private int monitorNumber = 1;
+ private String mqttDiscoveryTopic = "homeassistant";
+ private boolean mqttEnable = false;
+ private String mqttPwd = "";
private String mqttServer = "";
private String mqttTopic = "";
private String mqttUsername = "";
- private String mqttPwd = "";
- private String mqttDiscoveryTopic = "homeassistant";
- private boolean mqttEnable = false;
- @JsonProperty("mqttStream")
- private boolean wirelessStream = false; // this refers to wireless stream (MQTT or UDP), old name for compatibility with previous version
- private String streamType = Enums.StreamType.UDP.getStreamType();
- private boolean checkForUpdates = true;
- // Misc Tab
- private boolean eyeCare = false;
+ private int multiMonitor = 1;
+ private boolean multiScreenSingleDevice = false;
+ private String nightModeBrightness = "0%";
private String nightModeFrom = LocalTime.now().withHour(22).withMinute(0).truncatedTo(ChronoUnit.MINUTES).toString();
private String nightModeTo = LocalTime.now().withHour(8).withMinute(0).truncatedTo(ChronoUnit.MINUTES).toString();
- private String nightModeBrightness = "0%";
- private boolean toggleLed = true;
- private String desiredFramerate = Constants.DEFAULT_FRAMERATE;
- private String frameInsertion = Enums.FrameInsertion.NO_SMOOTHING.getBaseI18n();
- private String colorChooser = Constants.DEFAULT_COLOR_CHOOSER;
- private int brightness;
- private int ledStartOffset = 0;
+ // Number of CPU Threads to use, this app is heavy multithreaded,
+ // high cpu cores equals to higher framerate but big CPU usage
+ // 4 Threads are enough for 24FPS on an Intel i7 5930K@4.2GHz
+ // 3 thread is enough for 30FPS with GPU Hardware Acceleration and uses nearly no CPU
+ private int numberOfCPUThreads;
+ // LED strip orientation
+ private String orientation;
+ // OS Scaling factor example: 150%
+ private int osScaling;
+ // Serial port to use, use AUTO for automatic port search
+ // NOTE: for full firmware this contains the deviceName of the MQTT device where to stream
+ @JsonProperty("serialPort")
+ private String outputDevice;
+ private String powerSaving = "";
+ private int rightLed;
+ @JsonProperty("extendedLog")
+ private String runtimeLogLevel = Level.INFO.levelStr;
+ private int sampleRate = 0;
+ // Screen resolution
+ private int screenResX;
+ private int screenResY;
private String splitBottomMargin = Constants.SPLIT_BOTTOM_MARGIN_DEFAULT;
- private String grabberAreaTopBottom = Constants.GRABBER_AREA_TOP_BOTTOM_DEFAULT;
- private String grabberSide = Constants.GRABBER_AREA_SIDE_DEFAULT;
- private String gapTypeTopBottom = Constants.GAP_TYPE_DEFAULT_TOP_BOTTOM;
- private String gapTypeSide = Constants.GAP_TYPE_DEFAULT_SIDE;
+ // Deprecated values
+ private boolean splitBottomRow = true;
private boolean startWithSystem = true;
- private int multiMonitor = 1;
- private int monitorNumber = 1;
+ private String streamType = Enums.StreamType.UDP.getStreamType();
private boolean syncCheck = true;
- private String effect = Enums.Effect.BIAS_LIGHT.getBaseI18n();
- private float audioLoopbackGain = 0.0f;
- private String audioDevice = NativeExecutor.isWindows() ? Enums.Audio.DEFAULT_AUDIO_OUTPUT_WASAPI.getBaseI18n()
- : Enums.Audio.DEFAULT_AUDIO_OUTPUT_NATIVE.getBaseI18n();
- private String audioChannels = Enums.AudioChannels.AUDIO_CHANNEL_2.getBaseI18n();
- private boolean multiScreenSingleDevice = false;
- private String powerSaving = "";
private String theme = Enums.Theme.DEFAULT.getBaseI18n();
- private String language;
- private int groupBy = Constants.GROUP_BY_LEDS;
- // This is just a temporary variable to know what is the current profile once the user select a profile via tray icon
- private String defaultProfile = Constants.DEFAULT;
- // LDR
- private boolean enableLDR;
- private boolean ldrTurnOff;
- private int ldrInterval;
- private int ldrMin;
- // Brightness limiter
- private Float brightnessLimiter = Enums.BrightnessLimiter.BRIGHTNESS_LIMIT_DISABLED.getBrightnessLimitFloat();
- private int sampleRate = 0;
+ private String threadPriority = Enums.ThreadPriority.HIGH.name();
+ // used for Serial connection timeout
+ private int timeout = 100;
+ private boolean toggleLed = true;
+ // Numbers of LEDs
+ private int topLed;
+ // White temperature for color correction (Kelvin)
+ private int whiteTemperature = Constants.DEFAULT_WHITE_TEMP;
+ @JsonProperty("mqttStream")
+ private boolean wirelessStream = false; // this refers to wireless stream (MQTT or UDP), old name for compatibility with previous version
+ // Color correction, Hue-Saturation (using HSV 360° wheel)
+ private Map hueMap;
// LED Matrix Map
private Map> ledMatrix;
- // Deprecated values
- private boolean splitBottomRow = true;
- @JsonProperty("extendedLog")
- private String runtimeLogLevel = Level.INFO.levelStr;
- private String configVersion = "";
/**
* Constructor
diff --git a/src/main/java/org/dpsoftware/config/Constants.java b/src/main/java/org/dpsoftware/config/Constants.java
index 293fe5b73..29daabcaa 100644
--- a/src/main/java/org/dpsoftware/config/Constants.java
+++ b/src/main/java/org/dpsoftware/config/Constants.java
@@ -41,6 +41,7 @@ public class Constants {
public static final String TURN_LED_OFF = "controller.turn.led.off";
public static final String DEFAULT_COLOR_CHOOSER = "255,255,255,255";
public static final String CLEAN_EXIT = "CLEAN EXIT";
+ // This value must meet the one in Firefly Luciferin
public static final int SERIAL_CHUNK_SIZE = 250;
public static final String DATE_FORMAT = "EEEE, MMM dd, yyyy HH:mm:ss a";
public static final String SETTING_LED_SERIAL = "Setting LEDs";
@@ -54,7 +55,11 @@ public class Constants {
public static final String RIGHT_DISPLAY = "fxml.ledsconfigtab.rightdisplay";
public static final String MAIN_DISPLAY = "fxml.ledsconfigtab.maindisplay";
public static final String AUTO_DETECT_BLACK_BARS = "autodetect.black.bars";
- public static final int DEEP_BLACK_CHANNEL_TOLERANCE = 6;
+ public static final int NUMBER_OF_AREA_TO_CHECK = 50;
+ public static final int DEEP_BLACK_CHANNEL_TOLERANCE = 10;
+ public static final int MINIMUM_WHITE_PIXELS_PCT = 40;
+ public static final int AR_LETTERBOX_GAP = 42;
+ public static final int AR_PILLARBOX_GAP = 480;
public static final String CONTEXT_MENU_COLOR = "context.menu.color";
public static final String CONTEXT_MENU_GAMMA = "context.menu.gamma";
public static final String CONTEXT_MENU_AUDIO_DEVICE = "context.menu.audio.device";
@@ -69,6 +74,7 @@ public class Constants {
// Upgrade
public static final String LIGHT_FIRMWARE_DUMMY_VERSION = "1.0.0";
public static final String MINIMUM_FIRMWARE_FOR_AUTO_UPGRADE = "4.0.3";
+ public static final String FORCE_FIRMWARE_AUTO_UPGRADE = "4.0.4";
public static final String MIN_FIRMWARE_NOT_MATCH = "min.firmware.not.match";
public static final String GITHUB_POM_URL = "https://raw.githubusercontent.com/sblantipodi/firefly_luciferin/master/pom.xml";
public static final String GITHUB_GLOW_WORM_URL_FULL = "https://raw.githubusercontent.com/sblantipodi/glow_worm_luciferin/master/docs/static/firmware_build/manifest_full.json";
@@ -82,6 +88,7 @@ public class Constants {
public static final String SETUP_FILENAME_MAC = "FireflyLuciferinMac.dmg";
public static final String SETUP_FILENAME_LINUX_DEB = "FireflyLuciferinLinux.deb";
public static final String SETUP_FILENAME_LINUX_RPM = "FireflyLuciferinLinux.rpm";
+ public static final String FIRMWARE_FILENAME_PATTERN = "glob:*.{bin}";
public static final String GITHUB_RELEASES = "https://github.com/sblantipodi/firefly_luciferin/releases/download/v";
public static final String GITHUB_RELEASES_FIRMWARE = "https://github.com/sblantipodi/glow_worm_luciferin/raw/master/docs/static/firmware_build/";
public static final String GITHUB_RELEASES_FIRMWARE_BETA = "https://github.com/sblantipodi/glow_worm_luciferin/raw/master/docs/static/firmware_build_beta";
@@ -113,26 +120,7 @@ public class Constants {
public static final String PROP_VERSION = "version";
public static final String MSG_BUNDLE = "messagebundle";
// Resources
- public static final String IMAGE_TRAY_PLAY = "/org/dpsoftware/gui/img/tray_play.png";
- public static final String IMAGE_TRAY_PLAY_CENTER = "/org/dpsoftware/gui/img/tray_play_center.png";
- public static final String IMAGE_TRAY_PLAY_LEFT = "/org/dpsoftware/gui/img/tray_play_left.png";
- public static final String IMAGE_TRAY_PLAY_RIGHT = "/org/dpsoftware/gui/img/tray_play_right.png";
- public static final String IMAGE_TRAY_PLAY_RIGHT_GOLD = "/org/dpsoftware/gui/img/tray_play_right_gold.png";
- public static final String IMAGE_TRAY_PLAY_WAITING = "/org/dpsoftware/gui/img/tray_play_waiting.png";
- public static final String IMAGE_TRAY_PLAY_WAITING_CENTER = "/org/dpsoftware/gui/img/tray_play_waiting_center.png";
- public static final String IMAGE_TRAY_PLAY_WAITING_LEFT = "/org/dpsoftware/gui/img/tray_play_waiting_left.png";
- public static final String IMAGE_TRAY_PLAY_WAITING_RIGHT = "/org/dpsoftware/gui/img/tray_play_waiting_right.png";
- public static final String IMAGE_TRAY_PLAY_WAITING_RIGHT_GOLD = "/org/dpsoftware/gui/img/tray_play_waiting_right_gold.png";
- public static final String IMAGE_TRAY_STOP = "/org/dpsoftware/gui/img/tray_stop.png";
- public static final String IMAGE_TRAY_STOP_CENTER = "/org/dpsoftware/gui/img/tray_stop_center.png";
- public static final String IMAGE_TRAY_STOP_LEFT = "/org/dpsoftware/gui/img/tray_stop_left.png";
- public static final String IMAGE_TRAY_STOP_RIGHT = "/org/dpsoftware/gui/img/tray_stop_right.png";
- public static final String IMAGE_TRAY_STOP_RIGHT_GOLD = "/org/dpsoftware/gui/img/tray_stop_right_gold.png";
- public static final String IMAGE_TRAY_GREY = "/org/dpsoftware/gui/img/tray_stop_grey.png";
- public static final String IMAGE_TRAY_GREY_CENTER = "/org/dpsoftware/gui/img/tray_stop_grey_center.png";
- public static final String IMAGE_TRAY_GREY_LEFT = "/org/dpsoftware/gui/img/tray_stop_grey_left.png";
- public static final String IMAGE_TRAY_GREY_RIGHT = "/org/dpsoftware/gui/img/tray_stop_grey_right.png";
- public static final String IMAGE_TRAY_GREY_RIGHT_GOLD = "/org/dpsoftware/gui/img/tray_stop_grey_right_gold.png";
+ public static final String IMAGE_TRAY_STOP = "/org/dpsoftware/gui/img/luciferin_logo.png";
public static final String IMAGE_CONTROL_GREY = "/org/dpsoftware/gui/img/luciferin_logo_grey.png";
public static final String IMAGE_CONTROL_GREY_CENTER = "/org/dpsoftware/gui/img/luciferin_logo_grey_center.png";
public static final String IMAGE_CONTROL_GREY_LEFT = "/org/dpsoftware/gui/img/luciferin_logo_grey_left.png";
@@ -152,7 +140,7 @@ public class Constants {
public static final String IMAGE_CONTROL_LOGO_CENTER = "/org/dpsoftware/gui/img/luciferin_logo_center.png";
public static final String IMAGE_CONTROL_LOGO_LEFT = "/org/dpsoftware/gui/img/luciferin_logo_left.png";
public static final String IMAGE_CONTROL_LOGO_RIGHT = "/org/dpsoftware/gui/img/luciferin_logo_right.png";
- public static final String IMAGE_CONTROL_LOGO_RIGHT_GOLD = "/org/dpsoftware/gui/img/luciferin_logo_right.png";
+ public static final String IMAGE_CONTROL_LOGO_RIGHT_GOLD = "/org/dpsoftware/gui/img/luciferin_logo_right_gold.png";
public static final String FXML = ".fxml";
public static final String FXML_SETTINGS = "settings";
public static final String FXML_INFO = "info";
@@ -169,8 +157,6 @@ public class Constants {
public static final String FIRMWARE_UPGRADE_RES = "firmware.upgrade.res";
public static final String ERROR_READING_CONFIG = "error.reading.config";
public static final String YAML_EXTENSION = ".yaml";
- public static final String GW_FIRMWARE_BIN_ESP8266 = "GlowWormLuciferinFULL_ESP8266_firmware.bin";
- public static final String GW_FIRMWARE_BIN_ESP32 = "GlowWormLuciferinFULL_ESP32_firmware.bin";
// MQTT (topic are used even when using WiFi only)
public static final boolean JSON_STREAM = false;
public static final String STATE_ON_GLOWWORM = "GlowWorm";
@@ -184,13 +170,13 @@ public class Constants {
public static final String FIREFLY_LUCIFERIN_FRAMERATE = "lights/firelyluciferin/framerate";
public static final String FIREFLY_LUCIFERIN_EFFECT_TOPIC = "lights/glowwormluciferin/effectToFf";
public static final String FIREFLY_LUCIFERIN_GAMMA = "lights/firelyluciferin/gamma";
- // No swap because that topic needs MAC, no need to swap topic.
+ public static final String FIREFLY_LUCIFERIN_PROFILE_SET = "lights/firelyluciferin/profile/set";
+ // No swap because that topic needs MAC, no need to swap topic. Some topics are HTTP only via IP.
public static final String GLOW_WORM_FIRM_CONFIG_TOPIC = "lights/glowwormluciferin/firmwareconfig";
public static final String UNSUBSCRIBE_STREAM_TOPIC = "lights/glowwormluciferin/unsubscribe";
public static final String ASPECT_RATIO_TOPIC = "lights/firelyluciferin/aspectratio";
public static final String SET_ASPECT_RATIO_TOPIC = "lights/firelyluciferin/setaspectratio";
public static final String SET_SMOOTHING_TOPIC = "lights/firelyluciferin/smoothing/set";
- public static final String SMOOTHING_TOPIC = "lights/firelyluciferin/smoothing";
public static final String LDR_TOPIC = "ldr";
public static final String STATE_IP = "IP";
public static final String STATE_DHCP = "dhcp";
@@ -205,6 +191,7 @@ public class Constants {
public static final String COLOR_MODE = "colorMode";
public static final String MAC = "MAC";
public static final String GPIO = "gpio";
+ public static final String GPIO_CLOCK = "gpioClock";
public static final String STATE = "state";
public static final String RUNNING = "running";
public static final String DEVICE_TABLE_DATA = "deviceTableData";
@@ -248,6 +235,9 @@ public class Constants {
public static final String HTTP_LDR_TURNOFF = "ldrTurnOff";
public static final String HTTP_LDR_INTERVAL = "ldrInterval";
public static final String HTTP_LDR_MIN = "ldrMin";
+ public static final String HTTP_LDR_RELAYPIN = "relayPin";
+ public static final String HTTP_LDR_SBPIN = "sbPin";
+ public static final String HTTP_LDR_LDRPIN = "ldrPin";
public static final String MQTT_ADD_DEVICE = "fxml.mqtttab.mqttadddevice";
public static final String MQTT_REMOVE_DEVICE = "fxml.mqtttab.mqttremovedevice";
public static final String MQTT_DISCOVERY = "fxml.mqtttab.mqttdiscovery";
@@ -255,15 +245,17 @@ public class Constants {
public static final String MQTT_FIREFLY_BASE_TOPIC = "firelyluciferin";
public static final String MQTT_DISCOVERY_TOPIC_BASE_PATH = "luciferin";
public static final String MQTT_FIREFLY_0_FPS = "{\"producing\":\"0.0\",\"consuming\":\"0.0\"}";
+ public static final String EDITABLE_PIN_LDRPIN = "ldrPinColumn";
+ public static final String EDITABLE_PIN_RELAYPIN = "relayPinColumn";
+ public static final String EDITABLE_PIN_SBPIN = "sbPinColumn";
+ public static final String EDITABLE_PIN_GPIO_CLOCK = "gpioClockColumn";
+ public static final String CDC_DEVICE = "_CDC";
// GUI
public static final String SAVE = "fxml.save";
public static final String SAVE_AND_CLOSE = "fxml.save.and.close";
public static final String FRAMERATE_TITLE = "framerate.title";
public static final String FRAMERATE_HEADER = "framerate.header";
public static final String FRAMERATE_CONTEXT = "framerate.context";
- public static final String GPIO_TITLE = "gpio.title";
- public static final String GPIO_HEADER = "gpio.header";
- public static final String GPIO_CONTEXT = "gpio.context";
public static final String BAUDRATE_TITLE = "baudrate.title";
public static final String BAUDRATE_HEADER = "baudrate.header";
public static final String BAUDRATE_CONTEXT = "baudrate.context";
@@ -297,6 +289,7 @@ public class Constants {
public static final String GITHUB_CHANGELOG = "https://sblantipodi.github.io/firefly_luciferin";
public static final String UPGRADE_SUCCESS = "upgrade.success";
public static final String DEVICEUPGRADE_SUCCESS = "device.upgrade.success";
+ public static final String DEVICEUPGRADE_SUCCESS_CDC = "device.upgrade.success.cdc";
public static final String FIRMWARE_PROGRAM_NOTIFY = "device.program.success";
public static final String FIRMWARE_PROGRAM_NOTIFY_HEADER = "device.program.success.header";
public static final String NEW_FIRMWARE_AVAILABLE = "new.firmware.available";
@@ -320,8 +313,6 @@ public class Constants {
public static final String PERCENT = "%";
public static final String GAMMA_DEFAULT = "2.2";
public static final String USB_DEVICE = "USB device";
- public static final String ESP8266 = "ESP8266";
- public static final String ESP32 = "ESP32";
public static final String DASH = "-";
public static final String UPDATE_FILENAME = "GlowWormLuciferinFULL_board_firmware.bin";
public static final String UPDATE_FILENAME_LIGHT = "GlowWormLuciferinLIGHT_board_firmware.bin";
@@ -333,9 +324,14 @@ public class Constants {
public static final String SERIAL_BAUDRATE = "baudrate:";
public static final String SERIAL_MQTTTOPIC = "mqttopic:";
public static final String SERIAL_COLOR_MODE = "colorMode:";
+ public static final String SERIAL_COLOR_ORDER = "colorOrder:";
public static final String SERIAL_LDR = "ldr:";
public static final String SERIAL_MAC = "MAC:";
public static final String SERIAL_GPIO = "gpio:";
+ public static final String SERIAL_LDR_RELAYPIN = "relayPin:";
+ public static final String SERIAL_LDR_SBPIN = "sbPin:";
+ public static final String SERIAL_LDR_LDRPIN = "ldrPin:";
+ public static final String SERIAL_GPIO_CLOCK = "gpioClock:";
public static final String NO_DEVICE_FOUND = "no.device.found";
public static final int FAKE_GUI_TRAY_ICON = -100;
public static final int PRIMARY_DISPLAY_TOLERANCE = 100;
@@ -482,7 +478,6 @@ public class Constants {
public static final String FPS_PLACEHOLDER = "FRAMERATE_PLACEHOLDER";
public static final String GSTREAMER_SCREENSHOT = "gstreamer_screenshot.bmp";
public static final String GSTREAMER_SCREENSHOT_EXTENSION = "bmp";
- public static final int NUMBER_OF_AREA_TO_CHECK = 50;
public static final String SPLIT_BOTTOM_MARGIN_OFF = "0%";
public static final String SPLIT_BOTTOM_MARGIN_DEFAULT = "15%";
public static final String GRABBER_AREA_TOP_BOTTOM_DEFAULT = "8%";
@@ -530,6 +525,7 @@ public class Constants {
public static final int UDP_PORT_PREFERRED_OUTBOUND = 10002;
public static final String UDP_IP_FOR_PREFERRED_OUTBOUND = "8.8.8.8";
public static final String UDP_PING = "PING";
+ public static final String UDP_DEVICE_NAME = "DN";
public static final String UDP_PONG = "PONG";
public static final double UDP_CHUNK_SIZE = 140;
public static final int UDP_MAX_BUFFER_SIZE = 4096;
@@ -602,7 +598,8 @@ public class Constants {
public static final String CSS_UNDERLINE = "-fx-underline: true;";
public static final String CSS_NO_UNDERLINE = "-fx-underline: false;";
// Windows Registry and native commands
- public static final String CMD_RUN = "cmd /c start ";
+ public static final String CMD_POWERSHELL = "powershell.exe";
+ public static final String CMD_SET_PRIORITY = "Get-WmiObject Win32_process -filter 'name = \\\"Firefly Luciferin.exe\\\"' | foreach-object { $_.SetPriority({0}) }";
public static final String REGISTRY_KEY_PATH = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\";
public static final String REGISTRY_KEY_PATH_SCREEN_SAVER = "Control Panel\\Desktop";
public static final String REGISTRY_KEY_NAME = "FireflyLuciferin";
@@ -616,13 +613,16 @@ public class Constants {
public static final String CMD_LIST_RUNNING_PROCESS = "tasklist.exe /fo csv /nh | findstr /i \"\\" + SCREENSAVER_EXTENSION + "\"";
public static final String CMD_SHELL_FOR_CMD_EXECUTION = "cmd.exe";
public static final String CMD_PARAM_FOR_CMD_EXECUTION = "/c";
+ public static final int CMD_WAIT_DELAY = 10000;
+ public static final int SPAWN_INSTANCE_WAIT_DELAY = 1000;
+ public static final int SPAWN_INSTANCE_WAIT_START_DELAY = 3000;
// Native executor
public static final String CANT_RUN_CMD = "cant.run.cmd";
public static final String NO_OUTPUT = "no.output";
public static final String INTERRUPTED_WHEN_READING = "interrupted.when.reading";
public static final String DPKG_CHECK_CMD = "dpkg --version";
- public static int GROUP_BY_LEDS = 1;
// Log level root
public static final String LOG_LEVEL_ROOT = "org.dpsoftware";
+ public static int GROUP_BY_LEDS = 1;
-}
\ No newline at end of file
+}
diff --git a/src/main/java/org/dpsoftware/config/Enums.java b/src/main/java/org/dpsoftware/config/Enums.java
index 2e69e0ae9..c67cf8d6d 100644
--- a/src/main/java/org/dpsoftware/config/Enums.java
+++ b/src/main/java/org/dpsoftware/config/Enums.java
@@ -37,6 +37,15 @@ public enum OsKind {
OTHER
}
+ public enum SupportedDevice {
+ ESP8266,
+ ESP32,
+ ESP32_C3_CDC,
+ ESP32_S2,
+ ESP32_S3,
+ ESP32_S3_CDC
+ }
+
public enum PlayerStatus {
PLAY,
PLAY_WAITING,
@@ -474,7 +483,8 @@ public enum ColorMode implements LocalizedEnum {
RGB_MODE("enum.color.mode.rgb"),
RGBW_MODE_ACCURATE("enum.color.mode.rgbw.accurate"),
RGBW_MODE_BRIGHTER("enum.color.mode.rgbw.brighter"),
- RGBW_RGB("enum.color.mode.rgbw.rgb");
+ RGBW_RGB("enum.color.mode.rgbw.rgb"),
+ DOTSTAR("enum.color.mode.dotstar");
private final String colorMode;
ColorMode(String colorMode) {
@@ -489,7 +499,10 @@ public String getValue() {
public enum ColorOrder {
GRB(1),
RGB(2),
- BGR(3);
+ BGR(3),
+ BRG(4),
+ RBG(5),
+ GBR(6);
private final int colorOrder;
ColorOrder(int colorOrder) {
@@ -505,4 +518,22 @@ public int getValue() {
}
}
+ public enum ThreadPriority {
+ REALTIME(256),
+ HIGH(128),
+ ABOVE_NORMAL(32768),
+ NORMAL(32),
+ BELOW_NORMAL(16384),
+ LOW(16384);
+ private final int threadPriority;
+
+ ThreadPriority(int threadPriority) {
+ this.threadPriority = threadPriority;
+ }
+
+ public int getValue() {
+ return threadPriority;
+ }
+ }
+
}
diff --git a/src/main/java/org/dpsoftware/grabber/GStreamerGrabber.java b/src/main/java/org/dpsoftware/grabber/GStreamerGrabber.java
index 10da6ba2f..103b9a10f 100644
--- a/src/main/java/org/dpsoftware/grabber/GStreamerGrabber.java
+++ b/src/main/java/org/dpsoftware/grabber/GStreamerGrabber.java
@@ -61,8 +61,8 @@ public class GStreamerGrabber extends javax.swing.JComponent {
public AppSink videosink;
boolean writeToFile = false;
int capturedFrames = 0;
- private Color[] previousFrame;
long start;
+ private Color[] previousFrame;
/**
* Creates a new instance of GstVideoComponent
@@ -228,7 +228,7 @@ public void rgbFrame(int width, int height, IntBuffer rgbBuffer) {
|| Enums.Effect.MUSIC_MODE_BRIGHT.equals(LocalizedEnum.fromBaseStr(Enums.Effect.class, FireflyLuciferin.config.getEffect())))) {
if (!FireflyLuciferin.config.getFrameInsertion().equals(Enums.FrameInsertion.NO_SMOOTHING.getBaseI18n())) {
if (previousFrame != null) {
- frameInsertion(leds);
+ frameInsertion(leds);
}
} else {
PipelineManager.offerToTheQueue(leds);
@@ -245,7 +245,7 @@ public void rgbFrame(int width, int height, IntBuffer rgbBuffer) {
* Insert frames between captured frames, inserted frames represents the linear interpolation from the two captured frames.
* Higher levels will smooth transitions from one color to another but LEDs will be less responsive to quick changes.
*
- * @param leds array containing color information
+ * @param leds array containing color information
*/
void frameInsertion(Color[] leds) {
Color[] frameInsertion = new Color[ledMatrix.size()];
diff --git a/src/main/java/org/dpsoftware/grabber/GrabberManager.java b/src/main/java/org/dpsoftware/grabber/GrabberManager.java
index 78eeb6ccf..14892ee81 100644
--- a/src/main/java/org/dpsoftware/grabber/GrabberManager.java
+++ b/src/main/java/org/dpsoftware/grabber/GrabberManager.java
@@ -206,8 +206,19 @@ public void getFPS() {
runBenchmark(framerateAlert, notified);
if (config.isMqttEnable()) {
if (!NativeExecutor.exitTriggered) {
+ MqttFramerateDto mqttFramerateDto = new MqttFramerateDto();
+ mqttFramerateDto.setProducing(String.valueOf(FPS_PRODUCER));
+ mqttFramerateDto.setConsuming(String.valueOf(FPS_CONSUMER));
+ mqttFramerateDto.setEffect(config.getEffect());
+ mqttFramerateDto.setColorMode(String.valueOf(Enums.ColorMode.values()[config.getColorMode() - 1].getBaseI18n()));
+ mqttFramerateDto.setAspectRatio(config.isAutoDetectBlackBars() ?
+ CommonUtility.getWord(Constants.AUTO_DETECT_BLACK_BARS) : config.getDefaultLedMatrix());
+ mqttFramerateDto.setGamma(String.valueOf(config.getGamma()));
+ mqttFramerateDto.setSmoothingLvl(config.getFrameInsertion());
+ mqttFramerateDto.setProfile(Constants.DEFAULT.equals(FireflyLuciferin.profileArgs) ?
+ CommonUtility.getWord(Constants.DEFAULT) : FireflyLuciferin.profileArgs);
NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.FIREFLY_LUCIFERIN_FRAMERATE),
- CommonUtility.toJsonString(new MqttFramerateDto(String.valueOf(FPS_PRODUCER), String.valueOf(FPS_CONSUMER))));
+ CommonUtility.toJsonString(mqttFramerateDto));
}
}
};
@@ -228,7 +239,13 @@ private void runBenchmark(AtomicInteger framerateAlert, AtomicBoolean notified)
} else {
framerateAlert.set(0);
}
- if (FPS_GW_CONSUMER == 0 && framerateAlert.get() == 6 && config.isFullFirmware()) {
+ int iterationNumber;
+ if (config.isMultiScreenSingleDevice()) {
+ iterationNumber = 15;
+ } else {
+ iterationNumber = 6;
+ }
+ if (FPS_GW_CONSUMER == 0 && framerateAlert.get() == iterationNumber && config.isFullFirmware()) {
log.info("Glow Worm Luciferin is not responding, restarting...");
NativeExecutor.restartNativeInstance();
}
diff --git a/src/main/java/org/dpsoftware/grabber/ImageProcessor.java b/src/main/java/org/dpsoftware/grabber/ImageProcessor.java
index 58dbf9cb8..330fef51e 100644
--- a/src/main/java/org/dpsoftware/grabber/ImageProcessor.java
+++ b/src/main/java/org/dpsoftware/grabber/ImageProcessor.java
@@ -311,20 +311,25 @@ static boolean switchAspectRatio(Enums.AspectRatio aspectRatio, int[][] blackPix
int topMatrix = Arrays.stream(blackPixelMatrix[0]).sum();
int centerMatrix = Arrays.stream(blackPixelMatrix[1]).sum();
int bottomMatrix = Arrays.stream(blackPixelMatrix[2]).sum();
+ // To swìtch to another aspect ratio some center pixels should not be black. Don't switch if the screen is too black.
+ int whitePixelPercentage = (Constants.NUMBER_OF_AREA_TO_CHECK * Constants.MINIMUM_WHITE_PIXELS_PCT) / 100;
+ boolean enoughWhitePixelForTheChange = centerMatrix < (Constants.NUMBER_OF_AREA_TO_CHECK - whitePixelPercentage);
// NUMBER_OF_AREA_TO_CHECK must be black on botton/top left/right, center pixels must be less than NUMBER_OF_AREA_TO_CHECK (at least on NON black pixel in the center)
if (topMatrix == Constants.NUMBER_OF_AREA_TO_CHECK && centerMatrix < Constants.NUMBER_OF_AREA_TO_CHECK && bottomMatrix == Constants.NUMBER_OF_AREA_TO_CHECK) {
if (!FireflyLuciferin.config.getDefaultLedMatrix().equals(aspectRatio.getBaseI18n())) {
- FireflyLuciferin.config.setDefaultLedMatrix(aspectRatio.getBaseI18n());
- GStreamerGrabber.ledMatrix = FireflyLuciferin.config.getLedMatrixInUse(aspectRatio.getBaseI18n());
- log.info("Switching to " + aspectRatio.getBaseI18n() + " aspect ratio.");
- if (FireflyLuciferin.config.isMqttEnable()) {
- NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.ASPECT_RATIO_TOPIC), aspectRatio.getBaseI18n());
+ if (enoughWhitePixelForTheChange) {
+ FireflyLuciferin.config.setDefaultLedMatrix(aspectRatio.getBaseI18n());
+ GStreamerGrabber.ledMatrix = FireflyLuciferin.config.getLedMatrixInUse(aspectRatio.getBaseI18n());
+ log.info("Switching to " + aspectRatio.getBaseI18n() + " aspect ratio.");
+ if (FireflyLuciferin.config.isMqttEnable()) {
+ NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.ASPECT_RATIO_TOPIC), aspectRatio.getBaseI18n());
+ }
}
}
isPillarboxLetterbox = true;
} else {
if (!FireflyLuciferin.config.getDefaultLedMatrix().equals(Enums.AspectRatio.FULLSCREEN.getBaseI18n())) {
- if (setFullscreen) {
+ if (setFullscreen && enoughWhitePixelForTheChange) {
FireflyLuciferin.config.setDefaultLedMatrix(Enums.AspectRatio.FULLSCREEN.getBaseI18n());
GStreamerGrabber.ledMatrix = FireflyLuciferin.config.getLedMatrixInUse(Enums.AspectRatio.FULLSCREEN.getBaseI18n());
log.info("Switching to " + Enums.AspectRatio.FULLSCREEN.getBaseI18n() + " aspect ratio.");
@@ -346,9 +351,9 @@ static boolean switchAspectRatio(Enums.AspectRatio aspectRatio, int[][] blackPix
*/
public static int calculateBorders(Enums.AspectRatio aspectRatio) {
if (aspectRatio == Enums.AspectRatio.LETTERBOX) {
- return (((FireflyLuciferin.config.getScreenResY() * 280) / 2160) / Constants.RESAMPLING_FACTOR) - 5;
+ return (((FireflyLuciferin.config.getScreenResY() * Constants.AR_LETTERBOX_GAP) / 2160) / Constants.RESAMPLING_FACTOR) - 5;
} else {
- return (((FireflyLuciferin.config.getScreenResY() * 480) / 2160) / Constants.RESAMPLING_FACTOR) - 5;
+ return (((FireflyLuciferin.config.getScreenResY() * Constants.AR_PILLARBOX_GAP) / 2160) / Constants.RESAMPLING_FACTOR) - 5;
}
}
diff --git a/src/main/java/org/dpsoftware/gui/TestCanvas.java b/src/main/java/org/dpsoftware/gui/TestCanvas.java
index fff9213c5..41794b68e 100644
--- a/src/main/java/org/dpsoftware/gui/TestCanvas.java
+++ b/src/main/java/org/dpsoftware/gui/TestCanvas.java
@@ -275,7 +275,7 @@ private int drawTiles(Configuration conf, float saturationToUse, boolean draw, L
}
}
if (ledNumWithOffset == numbersList.get(0) || ledNumWithOffset == numbersList.get(numbersList.size() - 1)) {
- gc.setFill(Color.ORANGE);
+ gc.setFill(new Color(1.0, 0.45, 0.0, 1.0));
}
return taleBorder;
}
diff --git a/src/main/java/org/dpsoftware/gui/TrayIconManager.java b/src/main/java/org/dpsoftware/gui/TrayIconManager.java
index 08e6e6ae4..719fe8998 100644
--- a/src/main/java/org/dpsoftware/gui/TrayIconManager.java
+++ b/src/main/java/org/dpsoftware/gui/TrayIconManager.java
@@ -144,9 +144,9 @@ public void manageAspectRatioListener(String menuItemText, boolean sendSetCmd) {
* @param menuItemText item text
*/
public void manageProfileListener(String menuItemText) {
- FireflyLuciferin.config.setDefaultProfile(menuItemText);
+ FireflyLuciferin.profileArgs = menuItemText;
setProfileAndRestart(menuItemText);
- FireflyLuciferin.config.setDefaultProfile(menuItemText);
+ FireflyLuciferin.profileArgs = menuItemText;
updateLEDs();
profilesSubMenu.removeAll();
populateProfiles();
@@ -169,7 +169,7 @@ private void updateLEDs() {
} else if (FireflyLuciferin.RUNNING) {
FireflyLuciferin.guiManager.stopCapturingThreads(true);
if (requirePipeline) {
- FireflyLuciferin.guiManager.startCapturingThreads();
+ CommonUtility.delaySeconds(() -> FireflyLuciferin.guiManager.startCapturingThreads(), 4);
}
}
}
@@ -255,6 +255,7 @@ public void windowGainedFocus(final WindowEvent e) {
}
initTrayListener();
try {
+ trayIcon.setImageAutoSize(true);
tray.add(trayIcon);
} catch (AWTException e) {
log.error(String.valueOf(e));
@@ -355,27 +356,27 @@ public void mouseExited(MouseEvent e) {
*/
private void initializeImages() {
// load an image
- imagePlay = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY));
- imagePlayCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_CENTER));
- imagePlayLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_LEFT));
- imagePlayRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_RIGHT));
- imagePlayWaiting = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_WAITING));
- imagePlayWaitingCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_WAITING_CENTER));
- imagePlayWaitingLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_WAITING_LEFT));
- imagePlayWaitingRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_WAITING_RIGHT));
+ imagePlay = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY));
+ imagePlayCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_CENTER));
+ imagePlayLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_LEFT));
+ imagePlayRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_RIGHT));
+ imagePlayWaiting = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_WAITING));
+ imagePlayWaitingCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_WAITING_CENTER));
+ imagePlayWaitingLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_WAITING_LEFT));
+ imagePlayWaitingRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_WAITING_RIGHT));
imageStop = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_STOP));
- imageStopCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_STOP_CENTER));
- imageStopLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_STOP_LEFT));
- imageStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_STOP_RIGHT));
- imageGreyStop = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_GREY));
- imageGreyStopCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_GREY_CENTER));
- imageGreyStopLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_GREY_LEFT));
- imageGreyStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_GREY_RIGHT));
+ imageStopCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_LOGO_CENTER));
+ imageStopLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_LOGO_LEFT));
+ imageStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_LOGO_RIGHT));
+ imageGreyStop = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_GREY));
+ imageGreyStopCenter = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_GREY_CENTER));
+ imageGreyStopLeft = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_GREY_LEFT));
+ imageGreyStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_GREY_RIGHT));
if (CommonUtility.isSingleDeviceMultiScreen()) {
- imagePlayRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_RIGHT_GOLD));
- imagePlayWaitingRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_PLAY_WAITING_RIGHT_GOLD));
- imageStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_STOP_RIGHT_GOLD));
- imageGreyStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_TRAY_GREY_RIGHT_GOLD));
+ imagePlayRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_RIGHT_GOLD));
+ imagePlayWaitingRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_PLAY_WAITING_RIGHT_GOLD));
+ imageStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_LOGO_RIGHT_GOLD));
+ imageGreyStopRight = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(Constants.IMAGE_CONTROL_GREY_RIGHT_GOLD));
}
}
@@ -505,9 +506,9 @@ private void setMenuItemStyle(String menuLabel, JMenuItem jMenuItem, String menu
|| (menuLabel.equals(CommonUtility.getWord(Constants.AUTO_DETECT_BLACK_BARS)) && FireflyLuciferin.config.isAutoDetectBlackBars())) {
jMenuItem.setForeground(new Color(0, 153, 255));
}
- if (menuLabel.equals(FireflyLuciferin.config.getDefaultProfile())
+ if (menuLabel.equals(FireflyLuciferin.profileArgs)
|| (menuLabel.equals(CommonUtility.getWord(Constants.DEFAULT))
- && FireflyLuciferin.config.getDefaultProfile().equals(Constants.DEFAULT))) {
+ && FireflyLuciferin.profileArgs.equals(Constants.DEFAULT))) {
jMenuItem.setForeground(new Color(0, 153, 255));
}
}
@@ -549,6 +550,7 @@ public Image setTrayIconImage(Enums.PlayerStatus playerStatus) {
case GREY -> setImage(imageGreyStop, imageGreyStopRight, imageGreyStopLeft, imageGreyStopCenter);
};
if (trayIcon != null) {
+ trayIcon.setImageAutoSize(true);
trayIcon.setImage(img);
}
return img;
diff --git a/src/main/java/org/dpsoftware/gui/controllers/ColorCorrectionDialogController.java b/src/main/java/org/dpsoftware/gui/controllers/ColorCorrectionDialogController.java
index dfdb365b6..bf4a79bec 100644
--- a/src/main/java/org/dpsoftware/gui/controllers/ColorCorrectionDialogController.java
+++ b/src/main/java/org/dpsoftware/gui/controllers/ColorCorrectionDialogController.java
@@ -704,7 +704,7 @@ public void reset() {
hueMonitorSlider.setValue(0.0F);
whiteTemp.setValue(Constants.DEFAULT_WHITE_TEMP * 100);
setWhiteTemperature();
- FireflyLuciferin.config.hueMap = initHSLMap();
+ FireflyLuciferin.config.setHueMap(initHSLMap());
selectedChannel = Color.BLACK;
applyLabelClass(masterLabel, Constants.CSS_CLASS_LABEL);
manageHueSliderValue();
diff --git a/src/main/java/org/dpsoftware/gui/controllers/DevicesTabController.java b/src/main/java/org/dpsoftware/gui/controllers/DevicesTabController.java
index bf8c936f9..98505dd88 100644
--- a/src/main/java/org/dpsoftware/gui/controllers/DevicesTabController.java
+++ b/src/main/java/org/dpsoftware/gui/controllers/DevicesTabController.java
@@ -24,15 +24,12 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
-import javafx.scene.control.Button;
-import javafx.scene.control.Label;
import javafx.scene.control.*;
import javafx.scene.control.cell.ComboBoxTableCell;
import javafx.scene.control.cell.TextFieldTableCell;
import javafx.scene.input.InputEvent;
import lombok.extern.slf4j.Slf4j;
import org.dpsoftware.FireflyLuciferin;
-import org.dpsoftware.NativeExecutor;
import org.dpsoftware.config.Configuration;
import org.dpsoftware.config.Constants;
import org.dpsoftware.config.Enums;
@@ -43,11 +40,11 @@
import org.dpsoftware.managers.dto.FirmwareConfigDto;
import org.dpsoftware.utilities.CommonUtility;
-import java.awt.*;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.Optional;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* Devices Tab controller
@@ -71,6 +68,8 @@ public class DevicesTabController {
public ComboBox multiMonitor;
@FXML
public CheckBox syncCheck;
+ @FXML
+ public TableColumn gpioClockColumn;
boolean cellEdit = false;
// Inject main controller
@FXML
@@ -106,6 +105,12 @@ public class DevicesTabController {
@FXML
private TableColumn ldrColumn;
@FXML
+ private TableColumn ldrPinColumn;
+ @FXML
+ private TableColumn relayPinColumn;
+ @FXML
+ private TableColumn sbPinColumn;
+ @FXML
private Label versionLabel;
/**
@@ -153,7 +158,8 @@ protected void updateItem(Hyperlink item, boolean empty) {
baudrateColumn.setCellValueFactory(cellData -> cellData.getValue().baudRateProperty());
mqttTopicColumn.setCellValueFactory(cellData -> cellData.getValue().mqttTopicProperty());
colorModeColumn.setCellValueFactory(cellData -> cellData.getValue().colorModeProperty());
- colorOrderColumn.setCellFactory(tc -> new ComboBoxTableCell<>(Enums.ColorOrder.GRB.name(), Enums.ColorOrder.RGB.name(), Enums.ColorOrder.BGR.name()));
+ colorOrderColumn.setCellFactory(tc -> new ComboBoxTableCell<>(Enums.ColorOrder.GRB.name(), Enums.ColorOrder.RGB.name(),
+ Enums.ColorOrder.BGR.name(), Enums.ColorOrder.BRG.name(), Enums.ColorOrder.RBG.name(), Enums.ColorOrder.GBR.name()));
colorOrderColumn.setCellValueFactory(cellData -> cellData.getValue().colorOrderProperty());
colorOrderColumn.setStyle(Constants.TC_BOLD_TEXT + Constants.CSS_UNDERLINE);
colorOrderColumn.setOnEditStart((TableColumn.CellEditEvent t) -> cellEdit = true);
@@ -178,11 +184,80 @@ protected void updateItem(Hyperlink item, boolean empty) {
}
});
ldrColumn.setCellValueFactory(cellData -> cellData.getValue().ldrValueProperty());
+ ldrPinColumn.setCellValueFactory(cellData -> cellData.getValue().ldrPinProperty());
+ ldrPinColumn.setStyle(Constants.TC_BOLD_TEXT + Constants.CSS_UNDERLINE);
+ ldrPinColumn.setCellFactory(TextFieldTableCell.forTableColumn());
+ ldrPinColumn.setOnEditStart((TableColumn.CellEditEvent t) -> cellEdit = true);
+ ldrPinColumn.setOnEditCancel((TableColumn.CellEditEvent t) -> cellEdit = false);
+ ldrPinColumn.setOnEditCommit(this::setPins);
+ relayPinColumn.setCellValueFactory(cellData -> cellData.getValue().relayPinProperty());
+ relayPinColumn.setStyle(Constants.TC_BOLD_TEXT + Constants.CSS_UNDERLINE);
+ relayPinColumn.setCellFactory(TextFieldTableCell.forTableColumn());
+ relayPinColumn.setOnEditStart((TableColumn.CellEditEvent t) -> cellEdit = true);
+ relayPinColumn.setOnEditCancel((TableColumn.CellEditEvent t) -> cellEdit = false);
+ relayPinColumn.setOnEditCommit(this::setPins);
+ sbPinColumn.setCellValueFactory(cellData -> cellData.getValue().sbPinProperty());
+ sbPinColumn.setStyle(Constants.TC_BOLD_TEXT + Constants.CSS_UNDERLINE);
+ sbPinColumn.setCellFactory(TextFieldTableCell.forTableColumn());
+ sbPinColumn.setOnEditStart((TableColumn.CellEditEvent t) -> cellEdit = true);
+ sbPinColumn.setOnEditCancel((TableColumn.CellEditEvent t) -> cellEdit = false);
+ sbPinColumn.setOnEditCommit(this::setPins);
+ gpioClockColumn.setCellValueFactory(cellData -> cellData.getValue().gpioClockProperty());
+ gpioClockColumn.setStyle(Constants.TC_BOLD_TEXT + Constants.CSS_UNDERLINE);
+ gpioClockColumn.setCellFactory(TextFieldTableCell.forTableColumn());
+ gpioClockColumn.setOnEditStart((TableColumn.CellEditEvent t) -> cellEdit = true);
+ gpioClockColumn.setOnEditCancel((TableColumn.CellEditEvent t) -> cellEdit = false);
+ gpioClockColumn.setOnEditCommit(this::setPins);
numberOfLEDSconnectedColumn.setCellValueFactory(cellData -> cellData.getValue().numberOfLEDSconnectedProperty());
deviceTable.setEditable(true);
deviceTable.setItems(getDeviceTableData());
}
+ /**
+ * Set GPIO pins: relay pin, smart button pin, ldr pin
+ *
+ * @param t device table row
+ */
+ private void setPins(TableColumn.CellEditEvent t) {
+ cellEdit = false;
+ GlowWormDevice device = t.getTableView().getItems().get(t.getTablePosition().getRow());
+ Optional result = FireflyLuciferin.guiManager.showLocalizedAlert(Constants.GPIO_OK_TITLE, Constants.GPIO_OK_HEADER,
+ Constants.GPIO_OK_CONTEXT, Alert.AlertType.CONFIRMATION);
+ ButtonType button = result.orElse(ButtonType.OK);
+ if (button == ButtonType.OK) {
+ String pinToEdit = t.getTableColumn().getText();
+ log.info("Setting " + pinToEdit + " " + t.getNewValue() + " on " + device.getDeviceName());
+ if (t.getTableColumn().getId().equals(Constants.EDITABLE_PIN_LDRPIN)) {
+ device.setLdrPin(t.getNewValue());
+ } else if (t.getTableColumn().getId().equals(Constants.EDITABLE_PIN_RELAYPIN)) {
+ device.setRelayPin(t.getNewValue());
+ } else if (t.getTableColumn().getId().equals(Constants.EDITABLE_PIN_SBPIN)) {
+ device.setSbPin(t.getNewValue());
+ } else if (t.getTableColumn().getId().equals(Constants.EDITABLE_PIN_GPIO_CLOCK)) {
+ device.setGpioClock(t.getNewValue());
+ }
+ if (FireflyLuciferin.guiManager != null) {
+ FireflyLuciferin.guiManager.stopCapturingThreads(true);
+ }
+ if (FireflyLuciferin.config != null && FireflyLuciferin.config.isFullFirmware()) {
+ FirmwareConfigDto firmwareConfigDto = new FirmwareConfigDto();
+ firmwareConfigDto.setMAC(device.getMac());
+ firmwareConfigDto.setLdrPin(Integer.parseInt(device.getLdrPin()));
+ firmwareConfigDto.setRelayPin(Integer.parseInt(device.getRelayPin()));
+ firmwareConfigDto.setSbPin(Integer.parseInt(device.getSbPin()));
+ firmwareConfigDto.setGpioClock(Integer.parseInt(device.getGpioClock()));
+ NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.GLOW_WORM_FIRM_CONFIG_TOPIC),
+ CommonUtility.toJsonString(firmwareConfigDto));
+ } else if (FireflyLuciferin.config != null) {
+ FireflyLuciferin.ldrPin = Integer.parseInt(device.getLdrPin());
+ FireflyLuciferin.relayPin = Integer.parseInt(device.getRelayPin());
+ FireflyLuciferin.sbPin = Integer.parseInt(device.getSbPin());
+ FireflyLuciferin.gpioClockPin = Integer.parseInt(device.getGpioClock());
+ settingsController.sendSerialParams();
+ }
+ }
+ }
+
/**
* Init form values
*/
@@ -241,34 +316,24 @@ public void setTableEdit() {
gpioColumn.setOnEditCommit(t -> {
cellEdit = false;
GlowWormDevice device = t.getTableView().getItems().get(t.getTablePosition().getRow());
- if (t.getNewValue().equals(String.valueOf(2)) || t.getNewValue().equals(String.valueOf(3)) || t.getNewValue().equals(String.valueOf(5))
- || t.getNewValue().equals(String.valueOf(16))) {
- Optional result = FireflyLuciferin.guiManager.showLocalizedAlert(Constants.GPIO_OK_TITLE, Constants.GPIO_OK_HEADER,
- Constants.GPIO_OK_CONTEXT, Alert.AlertType.CONFIRMATION);
- ButtonType button = result.orElse(ButtonType.OK);
- if (button == ButtonType.OK) {
- log.info("Setting GPIO" + t.getNewValue() + " on " + device.getDeviceName());
- device.setGpio(t.getNewValue());
- if (FireflyLuciferin.guiManager != null) {
- FireflyLuciferin.guiManager.stopCapturingThreads(true);
- }
- if (FireflyLuciferin.config != null && FireflyLuciferin.config.isFullFirmware()) {
- FirmwareConfigDto gpioDto = new FirmwareConfigDto();
- gpioDto.setGpio(Integer.parseInt(t.getNewValue()));
- gpioDto.setMAC(device.getMac());
- NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.GLOW_WORM_FIRM_CONFIG_TOPIC),
- CommonUtility.toJsonString(gpioDto));
- } else if (FireflyLuciferin.config != null) {
- FireflyLuciferin.gpio = Integer.parseInt(t.getNewValue());
- settingsController.sendSerialParams();
- }
+ Optional result = FireflyLuciferin.guiManager.showLocalizedAlert(Constants.GPIO_OK_TITLE, Constants.GPIO_OK_HEADER,
+ Constants.GPIO_OK_CONTEXT, Alert.AlertType.CONFIRMATION);
+ ButtonType button = result.orElse(ButtonType.OK);
+ if (button == ButtonType.OK) {
+ log.info("Setting GPIO" + t.getNewValue() + " on " + device.getDeviceName());
+ device.setGpio(t.getNewValue());
+ if (FireflyLuciferin.guiManager != null) {
+ FireflyLuciferin.guiManager.stopCapturingThreads(true);
}
- } else {
- log.info("Unsupported GPIO");
- if (NativeExecutor.isWindows()) {
- FireflyLuciferin.guiManager.showLocalizedNotification(Constants.GPIO_HEADER, Constants.GPIO_CONTEXT, TrayIcon.MessageType.ERROR);
- } else {
- FireflyLuciferin.guiManager.showLocalizedAlert(Constants.GPIO_TITLE, Constants.GPIO_HEADER, Constants.GPIO_CONTEXT, Alert.AlertType.ERROR);
+ if (FireflyLuciferin.config != null && FireflyLuciferin.config.isFullFirmware()) {
+ FirmwareConfigDto gpioDto = new FirmwareConfigDto();
+ gpioDto.setGpio(Integer.parseInt(t.getNewValue()));
+ gpioDto.setMAC(device.getMac());
+ NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.GLOW_WORM_FIRM_CONFIG_TOPIC),
+ CommonUtility.toJsonString(gpioDto));
+ } else if (FireflyLuciferin.config != null) {
+ FireflyLuciferin.gpio = Integer.parseInt(t.getNewValue());
+ settingsController.sendSerialParams();
}
}
});
@@ -282,7 +347,11 @@ public void manageDeviceList() {
Calendar calendar = Calendar.getInstance();
Calendar calendarTemp = Calendar.getInstance();
ObservableList deviceTableDataToRemove = FXCollections.observableArrayList();
+ AtomicBoolean showClockColumn = new AtomicBoolean(false);
deviceTableData.forEach(glowWormDevice -> {
+ if (Enums.ColorMode.DOTSTAR.name().equalsIgnoreCase(glowWormDevice.getColorMode())) {
+ showClockColumn.set(true);
+ }
calendar.setTime(new Date());
calendarTemp.setTime(new Date());
calendar.add(Calendar.SECOND, -20);
@@ -302,6 +371,7 @@ public void manageDeviceList() {
// Temp list contains the removed devices, they will be readded if a microcontroller restart occurs, and if the capture is runnning.
deviceTableDataTemp.addAll(deviceTableDataToRemove);
deviceTableData.removeAll(deviceTableDataToRemove);
+ gpioClockColumn.setVisible(showClockColumn.get());
deviceTable.refresh();
}
}
diff --git a/src/main/java/org/dpsoftware/gui/controllers/MiscTabController.java b/src/main/java/org/dpsoftware/gui/controllers/MiscTabController.java
index 717140ed5..e06131d67 100644
--- a/src/main/java/org/dpsoftware/gui/controllers/MiscTabController.java
+++ b/src/main/java/org/dpsoftware/gui/controllers/MiscTabController.java
@@ -48,7 +48,11 @@
import org.dpsoftware.managers.PipelineManager;
import org.dpsoftware.managers.SerialManager;
import org.dpsoftware.managers.StorageManager;
-import org.dpsoftware.managers.dto.*;
+import org.dpsoftware.managers.dto.AudioDevice;
+import org.dpsoftware.managers.dto.ColorDto;
+import org.dpsoftware.managers.dto.FirmwareConfigDto;
+import org.dpsoftware.managers.dto.StateDto;
+import org.dpsoftware.managers.dto.mqttdiscovery.SelectProfileDiscovery;
import org.dpsoftware.utilities.CommonUtility;
import java.text.DecimalFormat;
@@ -159,6 +163,16 @@ protected void initialize() {
audioDevice.getItems().add(device.getDeviceName());
}
}
+ manageFramerate();
+ for (Enums.FrameInsertion frameIns : Enums.FrameInsertion.values()) {
+ frameInsertion.getItems().add(frameIns.getI18n());
+ }
+ }
+
+ /**
+ * Manage framerate field
+ */
+ private void manageFramerate() {
for (Enums.Framerate fps : Enums.Framerate.values()) {
if (fps.getBaseI18n().equals(Enums.Framerate.UNLOCKED.getBaseI18n())) {
framerate.getItems().add(fps.getI18n());
@@ -170,12 +184,24 @@ protected void initialize() {
framerate.getEditor().textProperty().addListener((observable, oldValue, newValue) -> forceFramerateValidation(newValue));
framerate.focusedProperty().addListener((obs, oldVal, focused) -> {
if (!focused) {
- framerate.setValue((CommonUtility.removeChars(framerate.getValue())) + Constants.FPS_VAL);
+ if (LocalizedEnum.fromStr(Enums.Framerate.class, framerate.getValue()) != Enums.Framerate.UNLOCKED) {
+ framerate.setValue((CommonUtility.removeChars(framerate.getValue())) + Constants.FPS_VAL);
+ }
+ if (FireflyLuciferin.RUNNING && !framerate.getValue().equals(FireflyLuciferin.config.getDesiredFramerate())) {
+ Platform.runLater(() -> {
+ FireflyLuciferin.guiManager.stopCapturingThreads(FireflyLuciferin.RUNNING);
+ CommonUtility.delaySeconds(() -> {
+ if (LocalizedEnum.fromStr(Enums.Framerate.class, framerate.getValue()) != Enums.Framerate.UNLOCKED) {
+ FireflyLuciferin.config.setDesiredFramerate(framerate.getValue().replaceAll(Constants.FPS_VAL, ""));
+ } else {
+ FireflyLuciferin.config.setDesiredFramerate(Enums.Framerate.UNLOCKED.getBaseI18n());
+ }
+ FireflyLuciferin.guiManager.startCapturingThreads();
+ }, 4);
+ });
+ }
}
});
- for (Enums.FrameInsertion frameIns : Enums.FrameInsertion.values()) {
- frameInsertion.getItems().add(frameIns.getI18n());
- }
}
/**
@@ -310,10 +336,10 @@ public void initValuesFromSettingsFile(Configuration currentConfig, boolean upda
profiles.getItems().addAll(sm.listProfilesForThisInstance());
profiles.getItems().add(CommonUtility.getWord(Constants.DEFAULT));
}
- if (FireflyLuciferin.config.getDefaultProfile().equals(Constants.DEFAULT)) {
+ if (FireflyLuciferin.profileArgs.equals(Constants.DEFAULT)) {
profiles.setValue(CommonUtility.getWord(Constants.DEFAULT));
} else {
- profiles.setValue(FireflyLuciferin.config.getDefaultProfile());
+ profiles.setValue(FireflyLuciferin.profileArgs);
}
enableDisableProfileButtons();
evaluateLDRConnectedFeatures();
@@ -494,15 +520,7 @@ private void initColorListeners(Configuration currentConfig) {
*/
private void initBrightnessGammaListeners(Configuration currentConfig) {
// Gamma can be changed on the fly
- gamma.valueProperty().addListener((ov, t, gamma) -> {
- if (currentConfig != null && currentConfig.isFullFirmware()) {
- GammaDto gammaDto = new GammaDto();
- gammaDto.setGamma(Double.parseDouble(gamma));
- NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.FIREFLY_LUCIFERIN_GAMMA),
- CommonUtility.toJsonString(gammaDto));
- }
- FireflyLuciferin.config.setGamma(Double.parseDouble(gamma));
- });
+ gamma.valueProperty().addListener((ov, t, gamma) -> FireflyLuciferin.config.setGamma(Double.parseDouble(gamma)));
brightness.valueProperty().addListener((ov, oldVal, newVal) -> turnOnLEDs(currentConfig, false, true));
}
@@ -635,13 +653,16 @@ public void save(InputEvent e) {
@SuppressWarnings("Duplicates")
public void save(Configuration config) {
config.setGamma(Double.parseDouble(gamma.getValue()));
- config.setDefaultProfile(Constants.DEFAULT);
config.setColorMode(colorMode.getSelectionModel().getSelectedIndex() + 1);
if (framerate.getValue().length() == 0) {
framerate.setValue(Constants.DEFAULT_FRAMERATE);
config.setDesiredFramerate(Constants.DEFAULT_FRAMERATE);
} else {
- config.setDesiredFramerate(framerate.getValue().replaceAll(Constants.FPS_VAL, ""));
+ if (LocalizedEnum.fromStr(Enums.Framerate.class, framerate.getValue()) != Enums.Framerate.UNLOCKED) {
+ config.setDesiredFramerate(framerate.getValue().replaceAll(Constants.FPS_VAL, ""));
+ } else {
+ config.setDesiredFramerate(Enums.Framerate.UNLOCKED.getBaseI18n());
+ }
}
config.setFrameInsertion(LocalizedEnum.fromStr(Enums.FrameInsertion.class, frameInsertion.getValue()).getBaseI18n());
config.setEyeCare(eyeCare.isSelected());
@@ -676,6 +697,10 @@ public void save(Configuration config) {
public void addProfile(InputEvent e) {
profiles.commitValue();
saveUsingProfile(e);
+ if (FireflyLuciferin.config.isMqttEnable()) {
+ MqttTabController.publishDiscoveryTopic(new SelectProfileDiscovery(), false);
+ MqttTabController.publishDiscoveryTopic(new SelectProfileDiscovery(), true);
+ }
}
/**
@@ -695,6 +720,10 @@ public void removeProfile(InputEvent e) {
FireflyLuciferin.guiManager.trayIconManager.updateTray();
}
}
+ if (FireflyLuciferin.config.isMqttEnable()) {
+ MqttTabController.publishDiscoveryTopic(new SelectProfileDiscovery(), false);
+ MqttTabController.publishDiscoveryTopic(new SelectProfileDiscovery(), true);
+ }
}
/**
@@ -861,9 +890,6 @@ private void manageFrameInsertionCombo() {
FireflyLuciferin.config.setFrameInsertion(LocalizedEnum.fromStr(Enums.FrameInsertion.class, frameInsertion.getValue()).getBaseI18n());
FireflyLuciferin.guiManager.startCapturingThreads();
}, 4);
- if (FireflyLuciferin.config.isMqttEnable()) {
- NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.SMOOTHING_TOPIC), frameInsertion.getValue());
- }
});
}
}
diff --git a/src/main/java/org/dpsoftware/gui/controllers/MqttTabController.java b/src/main/java/org/dpsoftware/gui/controllers/MqttTabController.java
index 1c4273be1..8230e8cc4 100644
--- a/src/main/java/org/dpsoftware/gui/controllers/MqttTabController.java
+++ b/src/main/java/org/dpsoftware/gui/controllers/MqttTabController.java
@@ -75,6 +75,50 @@ public class MqttTabController {
@FXML
private SettingsController settingsController;
+ /**
+ * Publish all the topics needed for the MQTT discovery process.
+ *
+ * @param createEntity if true create the MQTT entity, if false it destroys the entity
+ */
+ public static void publishDiscoveryTopics(boolean createEntity) {
+ publishDiscoveryTopic(new LightDiscovery(), createEntity);
+ publishDiscoveryTopic(new NumberWhiteTempDiscovery(), createEntity);
+ publishDiscoveryTopic(new SelectGammaDiscovery(), createEntity);
+ publishDiscoveryTopic(new SelectSmoothingDiscovery(), createEntity);
+ publishDiscoveryTopic(new SelectProfileDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorConsumingDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorProducingDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorVersionDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorLedsDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorLastUpdateDiscovery(), createEntity);
+ publishDiscoveryTopic(new SwitchRebootDiscovery(), createEntity);
+ publishDiscoveryTopic(new SelectAspectRatioDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorAspectRatioDiscovery(), createEntity);
+ if (CommonUtility.getDeviceToUse() != null && CommonUtility.getDeviceToUse().getMac() != null) {
+ publishDiscoveryTopic(new SelectColorModeDiscovery(), createEntity);
+ }
+ publishDiscoveryTopic(new SelectEffectDiscovery(), createEntity);
+ publishDiscoveryTopic(new SwitchBiasLightDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorGWConsumingDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorGpioDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorWiFiDiscovery(), createEntity);
+ publishDiscoveryTopic(new SensorLdrDiscovery(), createEntity);
+ }
+
+ /**
+ * Publish to a discovery topic to create or destroy the MQTT entity
+ *
+ * @param discoveryObject MQTT entity object
+ * @param createEntity if true create the MQTT entity, if false it destroys the entity
+ */
+ public static void publishDiscoveryTopic(DiscoveryObject discoveryObject, boolean createEntity) {
+ log.info("Sending MQTT discovery msg to topic: {}", discoveryObject.getDiscoveryTopic());
+ log.info("Message sent: {}", discoveryObject.getCreateEntityStr());
+ NetworkManager.publishToTopic(discoveryObject.getDiscoveryTopic(), createEntity ?
+ discoveryObject.getCreateEntityStr() : discoveryObject.getDestroyEntityStr(), false, true, 0);
+ CommonUtility.sleepMilliseconds(Constants.MQTT_DISCOVERY_CALL_DELAY);
+ }
+
/**
* Inject main controller containing the TabPane
*
@@ -261,49 +305,6 @@ public void saveButtonHover() {
settingsController.checkProfileDifferences();
}
- /**
- * Publish all the topics needed for the MQTT discovery process.
- *
- * @param createEntity if true create the MQTT entity, if false it destroys the entity
- */
- private void publishDiscoveryTopics(boolean createEntity) {
- publishDiscoveryTopic(new LightDiscovery(), createEntity);
- publishDiscoveryTopic(new NumberWhiteTempDiscovery(), createEntity);
- publishDiscoveryTopic(new SelectGammaDiscovery(), createEntity);
- publishDiscoveryTopic(new SelectSmoothingDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorConsumingDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorProducingDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorVersionDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorLedsDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorLastUpdateDiscovery(), createEntity);
- publishDiscoveryTopic(new SwitchRebootDiscovery(), createEntity);
- publishDiscoveryTopic(new SelectAspectRatioDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorAspectRatioDiscovery(), createEntity);
- if (CommonUtility.getDeviceToUse() != null && CommonUtility.getDeviceToUse().getMac() != null) {
- publishDiscoveryTopic(new SelectColorModeDiscovery(), createEntity);
- }
- publishDiscoveryTopic(new SelectEffectDiscovery(), createEntity);
- publishDiscoveryTopic(new SwitchBiasLightDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorGWConsumingDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorGpioDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorWiFiDiscovery(), createEntity);
- publishDiscoveryTopic(new SensorLdrDiscovery(), createEntity);
- }
-
- /**
- * Publish to a discovery topic to create or destroy the MQTT entity
- *
- * @param discoveryObject MQTT entity object
- * @param createEntity if true create the MQTT entity, if false it destroys the entity
- */
- private void publishDiscoveryTopic(DiscoveryObject discoveryObject, boolean createEntity) {
- log.info("Sending MQTT discovery msg to topic: {}", discoveryObject.getDiscoveryTopic());
- log.info("Message sent: {}", discoveryObject.getCreateEntityStr());
- NetworkManager.publishToTopic(discoveryObject.getDiscoveryTopic(), createEntity ?
- discoveryObject.getCreateEntityStr() : discoveryObject.getDestroyEntityStr(), false, true, 0);
- CommonUtility.sleepMilliseconds(Constants.MQTT_DISCOVERY_CALL_DELAY);
- }
-
/**
* Send an MQTT discovery message to the MQTT discovery topic to add the Glow Worm device
*/
diff --git a/src/main/java/org/dpsoftware/gui/elements/GlowWormDevice.java b/src/main/java/org/dpsoftware/gui/elements/GlowWormDevice.java
index 18f64c387..4e35f25ec 100644
--- a/src/main/java/org/dpsoftware/gui/elements/GlowWormDevice.java
+++ b/src/main/java/org/dpsoftware/gui/elements/GlowWormDevice.java
@@ -46,16 +46,21 @@ public class GlowWormDevice {
private final SimpleStringProperty colorMode = new SimpleStringProperty("");
private final SimpleStringProperty colorOrder = new SimpleStringProperty("");
private final SimpleStringProperty ldrValue = new SimpleStringProperty("");
+ private final SimpleStringProperty ldrPin = new SimpleStringProperty("");
+ private final SimpleStringProperty relayPin = new SimpleStringProperty("");
+ private final SimpleStringProperty sbPin = new SimpleStringProperty("");
+ private final SimpleStringProperty gpioClock = new SimpleStringProperty("");
private boolean dhcpInUse;
public GlowWormDevice() {
this("", "", false, "", "", "", "", "", "", "",
- "", "", "", "", "", "");
+ "", "", "", "", "", "", "", "", "", "");
}
public GlowWormDevice(String deviceName, String deviceIP, boolean dhcpInUse, String wifi, String deviceVersion, String deviceBoard,
String mac, String gpio, String numberOfLEDSconnected, String lastSeen, String firmwareType,
- String baudRate, String mqttTopic, String colorMode, String colorOrder, String ldrValue) {
+ String baudRate, String mqttTopic, String colorMode, String colorOrder, String ldrValue, String relayPin,
+ String sbPin, String ldrPin, String gpioClock) {
setDeviceName(deviceName);
setDeviceIP(deviceIP);
this.dhcpInUse = dhcpInUse;
@@ -72,6 +77,10 @@ public GlowWormDevice(String deviceName, String deviceIP, boolean dhcpInUse, Str
setColorMode(colorMode);
setColorOrder(colorOrder);
setLdrValue(ldrValue);
+ setRelayPin(relayPin);
+ setSbPin(sbPin);
+ setLdrPin(ldrPin);
+ setGpioClock(gpioClock);
}
public String getDeviceName() {
@@ -262,4 +271,52 @@ public StringProperty ldrValueProperty() {
return ldrValue;
}
+ public String getRelayPin() {
+ return relayPin.get();
+ }
+
+ public void setRelayPin(String relayPinStr) {
+ relayPin.set(relayPinStr);
+ }
+
+ public StringProperty relayPinProperty() {
+ return relayPin;
+ }
+
+ public String getSbPin() {
+ return sbPin.get();
+ }
+
+ public void setSbPin(String sbPinStr) {
+ sbPin.set(sbPinStr);
+ }
+
+ public StringProperty sbPinProperty() {
+ return sbPin;
+ }
+
+ public String getLdrPin() {
+ return ldrPin.get();
+ }
+
+ public void setLdrPin(String ldrPinStr) {
+ ldrPin.set(ldrPinStr);
+ }
+
+ public StringProperty ldrPinProperty() {
+ return ldrPin;
+ }
+
+ public String getGpioClock() {
+ return gpioClock.get();
+ }
+
+ public void setGpioClock(String gpioClockStr) {
+ gpioClock.set(gpioClockStr);
+ }
+
+ public StringProperty gpioClockProperty() {
+ return gpioClock;
+ }
+
}
diff --git a/src/main/java/org/dpsoftware/managers/NetworkManager.java b/src/main/java/org/dpsoftware/managers/NetworkManager.java
index 426e51257..881a470e8 100644
--- a/src/main/java/org/dpsoftware/managers/NetworkManager.java
+++ b/src/main/java/org/dpsoftware/managers/NetworkManager.java
@@ -34,7 +34,7 @@
import org.dpsoftware.config.Constants;
import org.dpsoftware.config.Enums;
import org.dpsoftware.config.LocalizedEnum;
-import org.dpsoftware.managers.dto.GammaDto;
+import org.dpsoftware.gui.controllers.MqttTabController;
import org.dpsoftware.managers.dto.TcpResponse;
import org.dpsoftware.network.tcpUdp.TcpClient;
import org.dpsoftware.utilities.CommonUtility;
@@ -42,6 +42,7 @@
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import java.awt.*;
+import java.io.IOException;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -163,9 +164,9 @@ public static void stream(String msg) {
* @param message mqtt message
* @throws JsonProcessingException something went wrong during JSON processing
*/
- private static void manageDefaultTopic(MqttMessage message) throws JsonProcessingException {
+ private static void manageDefaultTopic(MqttMessage message) throws IOException {
ObjectMapper mapper = new ObjectMapper();
- JsonNode mqttmsg = mapper.readTree(new String(message.getPayload()));
+ JsonNode mqttmsg = mapper.readTree(message.getPayload());
if (mqttmsg.get(Constants.STATE) != null && mqttmsg.get(Constants.MQTT_TOPIC) != null) {
if (mqttmsg.get(Constants.MQTT_TOPIC) != null) {
if (mqttmsg.get(Constants.STATE).asText().equals(Constants.ON) && mqttmsg.get(Constants.EFFECT).asText().equals(Constants.SOLID)) {
@@ -204,12 +205,12 @@ private static void manageDefaultTopic(MqttMessage message) throws JsonProcessin
* @param message mqtt message
* @throws JsonProcessingException something went wrong during JSON processing
*/
- private static void manageMqttSetTopic(MqttMessage message) throws JsonProcessingException {
+ private static void manageMqttSetTopic(MqttMessage message) throws IOException {
if (message.toString().contains(Constants.MQTT_START)) {
FireflyLuciferin.guiManager.startCapturingThreads();
} else if (message.toString().contains(Constants.MQTT_STOP)) {
ObjectMapper gammaMapper = new ObjectMapper();
- JsonNode macObj = gammaMapper.readTree(new String(message.getPayload()));
+ JsonNode macObj = gammaMapper.readTree(message.getPayload());
if (macObj.get(Constants.MAC) != null) {
String mac = macObj.get(Constants.MAC).asText();
if (CommonUtility.getDeviceToUse() != null && CommonUtility.getDeviceToUse().getMac().equals(mac)) {
@@ -225,9 +226,9 @@ private static void manageMqttSetTopic(MqttMessage message) throws JsonProcessin
* @param message mqtt message
* @throws JsonProcessingException something went wrong during JSON processing
*/
- private static void manageFpsTopic(MqttMessage message) throws JsonProcessingException {
+ private static void manageFpsTopic(MqttMessage message) throws IOException {
ObjectMapper mapperFps = new ObjectMapper();
- JsonNode mqttmsg = mapperFps.readTree(new String(message.getPayload()));
+ JsonNode mqttmsg = mapperFps.readTree(message.getPayload());
CommonUtility.updateFpsWithFpsTopic(mqttmsg);
}
@@ -269,14 +270,14 @@ public static String getTopic(String command) {
topic = Constants.SET_ASPECT_RATIO_TOPIC.replace(fireflyBaseTopic, defaultFireflyTopic);
case Constants.SET_SMOOTHING_TOPIC ->
topic = Constants.SET_SMOOTHING_TOPIC.replace(fireflyBaseTopic, defaultFireflyTopic);
- case Constants.SMOOTHING_TOPIC ->
- topic = Constants.SMOOTHING_TOPIC.replace(fireflyBaseTopic, defaultFireflyTopic);
case Constants.FIREFLY_LUCIFERIN_EFFECT_TOPIC ->
topic = Constants.FIREFLY_LUCIFERIN_EFFECT_TOPIC.replace(gwBaseTopic, defaultTopic);
case Constants.GLOW_WORM_FIRM_CONFIG_TOPIC -> topic = Constants.GLOW_WORM_FIRM_CONFIG_TOPIC;
case Constants.UNSUBSCRIBE_STREAM_TOPIC ->
topic = Constants.UNSUBSCRIBE_STREAM_TOPIC.replace(gwBaseTopic, defaultTopic);
case Constants.LDR_TOPIC -> topic = Constants.LDR_TOPIC.replace(gwBaseTopic, defaultTopic);
+ case Constants.FIREFLY_LUCIFERIN_PROFILE_SET ->
+ topic = Constants.FIREFLY_LUCIFERIN_PROFILE_SET.replace(fireflyBaseTopic, defaultFireflyTopic);
}
return topic;
}
@@ -316,9 +317,6 @@ private void manageSmoothing(MqttMessage message) {
FireflyLuciferin.guiManager.stopCapturingThreads(FireflyLuciferin.RUNNING);
CommonUtility.delaySeconds(() -> FireflyLuciferin.guiManager.startCapturingThreads(), 4);
});
- if (FireflyLuciferin.config.isMqttEnable()) {
- CommonUtility.delaySeconds(() -> NetworkManager.publishToTopic(NetworkManager.getTopic(Constants.SMOOTHING_TOPIC), message.toString()), 1);
- }
}
}
@@ -336,6 +334,36 @@ private void manageEffect(String message) {
}
}
+ /**
+ * Manage profile topic
+ *
+ * @param message message
+ */
+ private void manageProfile(String message) {
+ if (FireflyLuciferin.config != null) {
+ CommonUtility.delayMilliseconds(() -> FireflyLuciferin.guiManager.trayIconManager.manageProfileListener(message), 200);
+ }
+ }
+
+ /**
+ * Manage firmware config topic
+ * No swap because that topic needs MAC, no need to swap topic. Some topics are HTTP only via IP.
+ *
+ * @param message message
+ */
+ private void manageFirmwareConfig(String message) throws JsonProcessingException {
+ if (FireflyLuciferin.config != null) {
+ if (CommonUtility.getDeviceToUse() != null && CommonUtility.getDeviceToUse().getMac() != null) {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode mqttmsg = mapper.readTree(message);
+ if (CommonUtility.getDeviceToUse().getMac().equals(mqttmsg.get(Constants.MAC).asText())) {
+ FireflyLuciferin.config.setColorMode(mqttmsg.get(Constants.COLOR_MODE).asInt());
+ }
+ }
+ log.debug(message);
+ }
+ }
+
/**
* Set effect
*/
@@ -372,9 +400,9 @@ private void setEffect(String message) {
* @param message mqtt message
* @throws JsonProcessingException something went wrong during JSON processing
*/
- private void manageGamma(MqttMessage message) throws JsonProcessingException {
+ private void manageGamma(MqttMessage message) throws IOException {
ObjectMapper gammaMapper = new ObjectMapper();
- JsonNode gammaObj = gammaMapper.readTree(new String(message.getPayload()));
+ JsonNode gammaObj = gammaMapper.readTree(message.getPayload());
if (gammaObj.get(Constants.MQTT_GAMMA) != null) {
FireflyLuciferin.config.setGamma(Double.parseDouble(gammaObj.get(Constants.MQTT_GAMMA).asText()));
}
@@ -386,16 +414,23 @@ private void manageGamma(MqttMessage message) throws JsonProcessingException {
* @param message mqtt message
*/
private void showUpdateNotification(MqttMessage message) {
- if (UpgradeManager.deviceNameForSerialDevice.equals(message.toString())) {
+ if (UpgradeManager.deviceNameForSerialDevice.equals(message.toString())
+ || UpgradeManager.deviceNameForSerialDevice.equals(message + Constants.CDC_DEVICE)) {
log.info("Update successfull=" + message);
if (!CommonUtility.isSingleDeviceMultiScreen() || CommonUtility.isSingleDeviceMainInstance()) {
javafx.application.Platform.runLater(() -> {
+ String notificationContext = message + " ";
+ if (UpgradeManager.deviceNameForSerialDevice.contains(Constants.CDC_DEVICE) && !FireflyLuciferin.config.isWirelessStream()) {
+ notificationContext += CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS_CDC);
+ } else {
+ notificationContext += CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS);
+ }
if (NativeExecutor.isWindows()) {
FireflyLuciferin.guiManager.showNotification(CommonUtility.getWord(Constants.UPGRADE_SUCCESS),
- message + " " + CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS), TrayIcon.MessageType.INFO);
+ notificationContext, TrayIcon.MessageType.INFO);
} else {
FireflyLuciferin.guiManager.showAlert(Constants.FIREFLY_LUCIFERIN, CommonUtility.getWord(Constants.UPGRADE_SUCCESS),
- message + " " + CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS), Alert.AlertType.INFORMATION);
+ notificationContext, Alert.AlertType.INFORMATION);
}
});
}
@@ -436,9 +471,17 @@ void attemptReconnect() throws MqttException {
client.setCallback(this);
if (firstConnection) {
CommonUtility.turnOnLEDs();
- GammaDto gammaDto = new GammaDto();
- gammaDto.setGamma(FireflyLuciferin.config.getGamma());
- publishToTopic(getTopic(Constants.FIREFLY_LUCIFERIN_GAMMA), CommonUtility.toJsonString(gammaDto));
+ // Wait that the device is engaged before updating MQTT discovery entities.
+ if (StorageManager.updateMqttDiscovery) {
+ ScheduledExecutorService es = Executors.newScheduledThreadPool(1);
+ es.scheduleAtFixedRate(() -> {
+ if (CommonUtility.getDeviceToUse() != null && CommonUtility.getDeviceToUse().getMac() != null && !CommonUtility.getDeviceToUse().getMac().isEmpty()) {
+ MqttTabController.publishDiscoveryTopics(false);
+ MqttTabController.publishDiscoveryTopics(true);
+ es.shutdownNow();
+ }
+ }, 0, 2, TimeUnit.SECONDS);
+ }
}
subscribeToTopics();
log.info(Constants.MQTT_CONNECTED);
@@ -486,9 +529,10 @@ void subscribeToTopics() throws MqttException {
client.subscribe(getTopic(Constants.UPDATE_RESULT_MQTT_TOPIC));
client.subscribe(getTopic(Constants.FIREFLY_LUCIFERIN_GAMMA));
client.subscribe(getTopic(Constants.SET_SMOOTHING_TOPIC));
- client.subscribe(getTopic(Constants.SMOOTHING_TOPIC));
client.subscribe(getTopic(Constants.SET_ASPECT_RATIO_TOPIC));
client.subscribe(getTopic(Constants.FIREFLY_LUCIFERIN_EFFECT_TOPIC));
+ client.subscribe(getTopic(Constants.FIREFLY_LUCIFERIN_PROFILE_SET));
+ client.subscribe(Constants.GLOW_WORM_FIRM_CONFIG_TOPIC);
}
/**
@@ -499,7 +543,7 @@ void subscribeToTopics() throws MqttException {
*/
@Override
@SuppressWarnings("Duplicates")
- public void messageArrived(String topic, MqttMessage message) throws JsonProcessingException {
+ public void messageArrived(String topic, MqttMessage message) throws IOException {
lastActivity = new Date();
if (topic.equals(getTopic(Constants.DEFAULT_MQTT_STATE_TOPIC))) {
manageDefaultTopic(message);
@@ -516,6 +560,10 @@ public void messageArrived(String topic, MqttMessage message) throws JsonProcess
manageSmoothing(message);
} else if (topic.equals(getTopic(Constants.FIREFLY_LUCIFERIN_EFFECT_TOPIC))) {
manageEffect(message.toString());
+ } else if (topic.equals(getTopic(Constants.FIREFLY_LUCIFERIN_PROFILE_SET))) {
+ manageProfile(message.toString());
+ } else if (topic.equals(Constants.GLOW_WORM_FIRM_CONFIG_TOPIC)) {
+ manageFirmwareConfig(message.toString());
}
}
diff --git a/src/main/java/org/dpsoftware/managers/PowerSavingManager.java b/src/main/java/org/dpsoftware/managers/PowerSavingManager.java
index 45345b584..3900998c2 100644
--- a/src/main/java/org/dpsoftware/managers/PowerSavingManager.java
+++ b/src/main/java/org/dpsoftware/managers/PowerSavingManager.java
@@ -61,12 +61,19 @@ public class PowerSavingManager {
PowerSavingScreenSaver powerSavingScreenSaver = PowerSavingScreenSaver.NOT_TRIGGERED;
boolean screenSaverTaskNeeded = false;
boolean screenSaverRunning = false;
+ int lastMouseX;
+ int lastMouseY;
+ boolean mouseMoved = true;
/**
* Execute a task that checks if screensaver is enabled/running.
*/
public void addPowerSavingTask() {
log.info("Adding hook for power saving.");
+ PointerInfo a = MouseInfo.getPointerInfo();
+ Point mouseCoordinate = a.getLocation();
+ lastMouseX = (int) mouseCoordinate.getX();
+ lastMouseY = (int) mouseCoordinate.getY();
ScheduledExecutorService scheduledExecutorServiceSS = Executors.newScheduledThreadPool(1);
scheduledExecutorServiceSS.scheduleAtFixedRate(() -> {
// The methods below must run in a separate thread from the capture pipeline
@@ -80,13 +87,38 @@ public void addPowerSavingTask() {
managePowerSavingLeds();
unlockCheckLedDuplication = true;
}, 60, 10, TimeUnit.SECONDS);
+ mouseListenerThread();
+ }
+
+ /**
+ * Manage mouse events in a separate thread
+ */
+ private void mouseListenerThread() {
+ ScheduledExecutorService ssMouse = Executors.newScheduledThreadPool(1);
+ ssMouse.scheduleAtFixedRate(() -> {
+ PointerInfo a = MouseInfo.getPointerInfo();
+ Point mouseCoordinates = a.getLocation();
+ if (lastMouseX == (int) mouseCoordinates.getX() && lastMouseY == (int) mouseCoordinates.getY()) {
+ mouseMoved = false;
+ } else {
+ mouseMoved = true;
+ if (!FireflyLuciferin.RUNNING && FireflyLuciferin.config.isToggleLed() && shutDownLedStrip) {
+ CommonUtility.turnOnLEDs();
+ }
+ lastFrameTime = LocalDateTime.now();
+ shutDownLedStrip = false;
+ powerSavingScreenSaver = PowerSavingScreenSaver.NOT_TRIGGERED;
+ }
+ lastMouseX = (int) mouseCoordinates.getX();
+ lastMouseY = (int) mouseCoordinates.getY();
+ }, 30, 1, TimeUnit.SECONDS);
}
/**
* Turn OFF/ON LEds if a power saving event has been triggered
*/
private void managePowerSavingLeds() {
- if ((screenSaverTaskNeeded && screenSaverRunning) || shutDownLedStrip) {
+ if (!mouseMoved && ((screenSaverTaskNeeded && screenSaverRunning) || shutDownLedStrip)) {
if (powerSavingScreenSaver != PowerSavingScreenSaver.TRIGGERED_NOT_RUNNING &&
powerSavingScreenSaver != PowerSavingScreenSaver.TRIGGERED_RUNNING) {
if (FireflyLuciferin.RUNNING) {
@@ -103,11 +135,11 @@ private void managePowerSavingLeds() {
if (powerSavingScreenSaver != PowerSavingScreenSaver.NOT_TRIGGERED) {
if (powerSavingScreenSaver == PowerSavingScreenSaver.TRIGGERED_RUNNING) {
log.info("Power saving off.");
-
} else if (powerSavingScreenSaver == PowerSavingScreenSaver.TRIGGERED_NOT_RUNNING) {
CommonUtility.turnOnLEDs();
log.info("Power saving off.");
}
+ shutDownLedStrip = false;
powerSavingScreenSaver = PowerSavingScreenSaver.NOT_TRIGGERED;
}
}
diff --git a/src/main/java/org/dpsoftware/managers/SerialManager.java b/src/main/java/org/dpsoftware/managers/SerialManager.java
index 5c8543773..9b77234b8 100644
--- a/src/main/java/org/dpsoftware/managers/SerialManager.java
+++ b/src/main/java/org/dpsoftware/managers/SerialManager.java
@@ -84,7 +84,8 @@ public void initSerial(FireflyLuciferin fireflyLuciferin) {
serial.notifyOnDataAvailable(true);
DevicesTabController.deviceTableData.add(new GlowWormDevice(Constants.USB_DEVICE, serialPortId.getName(), false,
Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH,
- FireflyLuciferin.formatter.format(new Date()), Constants.DASH, Constants.DASH, Constants.DASH, Enums.ColorOrder.GRB.name(), Constants.DASH));
+ FireflyLuciferin.formatter.format(new Date()), Constants.DASH, Constants.DASH, Constants.DASH, Enums.ColorOrder.GRB.name(),
+ Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH, Constants.DASH));
GUIManager guiManager = new GUIManager();
if (numberOfSerialDevices > 1 && config.getOutputDevice().equals(Constants.SERIAL_PORT_AUTO)) {
FireflyLuciferin.communicationError = true;
@@ -141,7 +142,7 @@ public void sendColorsViaUSB(Color[] leds) throws IOException {
}
} else {
int i = 0, j = -1;
- byte[] ledsArray = new byte[(FireflyLuciferin.ledNumber * 3) + 22];
+ byte[] ledsArray = new byte[(FireflyLuciferin.ledNumber * 3) + 26];
// DPsoftware checksum
int ledsCountHi = ((FireflyLuciferin.ledNumHighLowCount) >> 8) & 0xff;
int ledsCountLo = (FireflyLuciferin.ledNumHighLowCount) & 0xff;
@@ -158,6 +159,11 @@ public void sendColorsViaUSB(Color[] leds) throws IOException {
int ldrActionToUse = (FireflyLuciferin.ldrAction) & 0xff;
int colorModeToSend = (config.getColorMode()) & 0xff;
int colorOrderToSend = (FireflyLuciferin.colorOrder) & 0xff;
+ // Pins is set to +10 because null values are zero, so GPIO 0 is 10, GPIO 1 is 11.
+ int relayPinToSend = (FireflyLuciferin.relayPin >= 0 ? FireflyLuciferin.relayPin + 10 : 0) & 0xff;
+ int sbPinToSend = (FireflyLuciferin.sbPin >= 0 ? FireflyLuciferin.sbPin + 10 : 0) & 0xff;
+ int ldrPinToSend = (FireflyLuciferin.ldrPin >= 0 ? FireflyLuciferin.ldrPin + 10 : 0) & 0xff;
+ int gpioClockToSend = (FireflyLuciferin.gpioClockPin) & 0xff;
ledsArray[++j] = (byte) ('D');
ledsArray[++j] = (byte) ('P');
ledsArray[++j] = (byte) ('s');
@@ -179,8 +185,12 @@ public void sendColorsViaUSB(Color[] leds) throws IOException {
ledsArray[++j] = (byte) (ldrActionToUse);
ledsArray[++j] = (byte) (colorModeToSend);
ledsArray[++j] = (byte) (colorOrderToSend);
+ ledsArray[++j] = (byte) (relayPinToSend);
+ ledsArray[++j] = (byte) (sbPinToSend);
+ ledsArray[++j] = (byte) (ldrPinToSend);
+ ledsArray[++j] = (byte) (gpioClockToSend);
ledsArray[++j] = (byte) ((ledsCountHi ^ ledsCountLo ^ loSecondPart ^ brightnessToSend ^ gpioToSend ^ baudRateToSend ^ whiteTempToSend ^ fireflyEffectToSend
- ^ enableLdr ^ ldrTurnOff ^ ldrInterval ^ ldrMin ^ ldrActionToUse ^ colorModeToSend ^ colorOrderToSend ^ 0x55));
+ ^ enableLdr ^ ldrTurnOff ^ ldrInterval ^ ldrMin ^ ldrActionToUse ^ colorModeToSend ^ colorOrderToSend ^ relayPinToSend ^ sbPinToSend ^ ldrPinToSend ^ gpioClockToSend ^ 0x55));
FireflyLuciferin.ldrAction = 1;
if (leds.length == 1) {
FireflyLuciferin.colorInUse = leds[0];
@@ -262,14 +272,25 @@ public void handleSerialEvent(SerialPortEvent event) {
try {
if (input.ready()) {
String inputLine = input.readLine();
- log.trace(inputLine);
+ log.debug(inputLine);
DevicesTabController.deviceTableData.forEach(glowWormDevice -> {
if (glowWormDevice.getDeviceName().equals(Constants.USB_DEVICE)) {
+ if (!config.isMqttEnable() && config.isFullFirmware()) {
+ DevicesTabController.deviceTableData.forEach(gwDevice -> {
+ if (glowWormDevice.getMac().equals(gwDevice.getMac())) {
+ gwDevice.setLastSeen(FireflyLuciferin.formatter.format(new Date()));
+ }
+ });
+ }
glowWormDevice.setLastSeen(FireflyLuciferin.formatter.format(new Date()));
// Skipping the Setting LED loop from Glow Worm Luciferin Serial communication
if (!inputLine.contains(Constants.SETTING_LED_SERIAL)) {
if (inputLine.contains(Constants.SERIAL_VERSION)) {
- glowWormDevice.setDeviceVersion(inputLine.replace(Constants.SERIAL_VERSION, ""));
+ String deviceVer = inputLine.replace(Constants.SERIAL_VERSION, "");
+ if (config.isCheckForUpdates() && Enums.SupportedDevice.ESP32_S3_CDC.name().equals(glowWormDevice.getDeviceBoard())) {
+ deviceVer = Constants.FORCE_FIRMWARE_AUTO_UPGRADE;
+ }
+ glowWormDevice.setDeviceVersion(deviceVer);
} else if (inputLine.contains(Constants.SERIAL_LED_NUM)) {
glowWormDevice.setNumberOfLEDSconnected(inputLine.replace(Constants.SERIAL_LED_NUM, ""));
} else if (inputLine.contains(Constants.SERIAL_BOARD)) {
@@ -284,6 +305,8 @@ public void handleSerialEvent(SerialPortEvent event) {
glowWormDevice.setMqttTopic(inputLine.replace(Constants.SERIAL_MQTTTOPIC, ""));
} else if (inputLine.contains(Constants.SERIAL_COLOR_MODE)) {
glowWormDevice.setColorMode(Enums.ColorMode.values()[Integer.parseInt(inputLine.replace(Constants.SERIAL_COLOR_MODE, "")) - 1].getI18n());
+ } else if (inputLine.contains(Constants.SERIAL_COLOR_ORDER)) {
+ glowWormDevice.setColorOrder(Enums.ColorOrder.findByValue(Integer.parseInt(inputLine.replace(Constants.SERIAL_COLOR_ORDER, ""))).name());
} else if (inputLine.contains(Constants.SERIAL_BAUDRATE)) {
boolean validBaudrate = true;
int receivedBaudrate = Integer.parseInt(inputLine.replace(Constants.SERIAL_BAUDRATE, ""));
@@ -291,11 +314,19 @@ public void handleSerialEvent(SerialPortEvent event) {
validBaudrate = false;
}
glowWormDevice.setBaudRate(validBaudrate ? Enums.BaudRate.findByValue(receivedBaudrate).getBaudRate() : Constants.DASH);
- } else if (!config.isFullFirmware() && inputLine.contains(Constants.SERIAL_FRAMERATE)) {
+ } else if ((!config.isFullFirmware() || !config.isMqttEnable()) && inputLine.contains(Constants.SERIAL_FRAMERATE)) {
FireflyLuciferin.FPS_GW_CONSUMER = Float.parseFloat(inputLine.replace(Constants.SERIAL_FRAMERATE, ""));
} else if (inputLine.contains(Constants.SERIAL_LDR)) {
CommonUtility.ldrStrength = Integer.parseInt(inputLine.replace(Constants.SERIAL_LDR, ""));
glowWormDevice.setLdrValue(inputLine.replace(Constants.SERIAL_LDR, "") + Constants.PERCENT);
+ } else if (inputLine.contains(Constants.SERIAL_LDR_LDRPIN)) {
+ glowWormDevice.setLdrPin(inputLine.replace(Constants.SERIAL_LDR_LDRPIN, ""));
+ } else if (inputLine.contains(Constants.SERIAL_LDR_RELAYPIN)) {
+ glowWormDevice.setRelayPin(inputLine.replace(Constants.SERIAL_LDR_RELAYPIN, ""));
+ } else if (inputLine.contains(Constants.SERIAL_LDR_SBPIN)) {
+ glowWormDevice.setSbPin(inputLine.replace(Constants.SERIAL_LDR_SBPIN, ""));
+ } else if (inputLine.contains(Constants.SERIAL_GPIO_CLOCK)) {
+ glowWormDevice.setGpioClock(inputLine.replace(Constants.SERIAL_GPIO_CLOCK, ""));
}
}
}
diff --git a/src/main/java/org/dpsoftware/managers/StorageManager.java b/src/main/java/org/dpsoftware/managers/StorageManager.java
index 23191beea..d98743f28 100644
--- a/src/main/java/org/dpsoftware/managers/StorageManager.java
+++ b/src/main/java/org/dpsoftware/managers/StorageManager.java
@@ -43,9 +43,9 @@
import java.io.File;
import java.io.IOException;
-import java.util.LinkedHashSet;
-import java.util.Objects;
-import java.util.Set;
+import java.nio.file.*;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -56,6 +56,7 @@
@Slf4j
public class StorageManager {
+ public static boolean updateMqttDiscovery = false;
private final ObjectMapper mapper;
public boolean restartNeeded = false;
private String path;
@@ -154,7 +155,7 @@ public Configuration readProfileConfig(String profileName) {
* @return current configuration file
*/
public Configuration readProfileInUseConfig() {
- return readConfig(false, FireflyLuciferin.config != null ? FireflyLuciferin.config.getDefaultProfile() : Constants.DEFAULT);
+ return readConfig(false, FireflyLuciferin.config != null ? FireflyLuciferin.profileArgs : Constants.DEFAULT);
}
/**
@@ -264,8 +265,6 @@ public Configuration loadConfigurationYaml() {
Configuration config;
if (FireflyLuciferin.profileArgs != null && !FireflyLuciferin.profileArgs.isEmpty()) {
config = readProfileConfig(FireflyLuciferin.profileArgs);
- config.setDefaultProfile(FireflyLuciferin.profileArgs);
- FireflyLuciferin.profileArgs = "";
} else {
config = readProfileInUseConfig();
}
@@ -322,6 +321,7 @@ public void updateConfigFile(Configuration config) throws IOException {
writeToStorage = updatePrevious259(config, writeToStorage); // Version <= 2.5.9
writeToStorage = updatePrevious273(config, writeToStorage); // Version <= 2.7.3
writeToStorage = updatePrevious21010(config, writeToStorage); // Version <= 2.10.10
+ writeToStorage = updatePrevious2124(config, writeToStorage); // Version <= 2.12.4
if (config.getAudioDevice().equals(Enums.Audio.DEFAULT_AUDIO_OUTPUT.getBaseI18n())) {
config.setAudioDevice(Enums.Audio.DEFAULT_AUDIO_OUTPUT_NATIVE.getBaseI18n());
writeToStorage = true;
@@ -404,7 +404,7 @@ private boolean updatePrevious259(Configuration config, boolean writeToStorage)
*/
private boolean updatePrevious273(Configuration config, boolean writeToStorage) {
if (UpgradeManager.versionNumberToNumber(config.getConfigVersion()) <= 21071003) {
- config.hueMap = ColorCorrectionDialogController.initHSLMap();
+ config.setHueMap(ColorCorrectionDialogController.initHSLMap());
writeToStorage = true;
}
return writeToStorage;
@@ -429,6 +429,25 @@ private boolean updatePrevious21010(Configuration config, boolean writeToStorage
return writeToStorage;
}
+ /**
+ * Update configuration file previous than 2.12.4
+ *
+ * @param config configuration to update
+ * @param writeToStorage if an update is needed, write to storage
+ * @return true if update is needed
+ */
+ private boolean updatePrevious2124(Configuration config, boolean writeToStorage) {
+ if (UpgradeManager.versionNumberToNumber(config.getConfigVersion()) < 21121004) {
+ if (config.isMqttEnable()) {
+ if (CommonUtility.isSingleDeviceMainInstance() || !CommonUtility.isSingleDeviceMultiScreen()) {
+ updateMqttDiscovery = true;
+ writeToStorage = true;
+ }
+ }
+ }
+ return writeToStorage;
+ }
+
/**
* Reconfigure LED matrix
*
@@ -487,24 +506,66 @@ public String getProfileFileName(String profileName) {
return JavaFXStarter.whoAmI + "_" + profileName + Constants.YAML_EXTENSION;
}
+ /**
+ * In the programming realm, glob is a pattern with wildcards to match filenames.
+ * Using glob patterns to filter a list of filenames for our example.
+ * Using the popular wildcards “*” and “?”.
+ *
+ * @param rootDir path where to search (includes subfolders)
+ * @param pattern to search (ex: "glob: pattern")
+ * *.java Matches all files with extension “java”
+ * *.{java,class} Matches all files with extensions of “java” or “class”
+ * *.* Matches all files with a “.” somewhere in its name
+ * ???? Matches all files with four characters in its name
+ * [test].docx Matches all files with filename ‘t', ‘e', ‘s', or ‘t' and “docx” extension
+ * [0-4].csv Matches all files with filename ‘0', ‘1', ‘2', ‘3', or ‘4' with “csv” extension
+ * C:\\temp\\* Matches all files in the “C:\temp” directory on Windows systems
+ * src/test/* Matches all files in the “src/test/” directory on Unix-based systems
+ * @return list of filename
+ * @throws IOException io
+ */
+ @SuppressWarnings("all")
+ List searchFilesWithWc(Path rootDir, String pattern) throws IOException {
+ List matchesList = new ArrayList<>();
+ FileVisitor matcherVisitor = new SimpleFileVisitor<>() {
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attribs) {
+ FileSystem fs = FileSystems.getDefault();
+ PathMatcher matcher = fs.getPathMatcher(pattern);
+ Path name = file.getFileName();
+ if (matcher.matches(name)) {
+ matchesList.add(name.toString());
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ };
+ Files.walkFileTree(rootDir, matcherVisitor);
+ return matchesList;
+ }
+
/**
* Delete temp files
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public void deleteTempFiles() {
- if (NativeExecutor.isWindows()) {
- File fireflyLuciferinTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_WINDOWS);
- if (fireflyLuciferinTmpFile.isFile()) fireflyLuciferinTmpFile.delete();
- } else if (NativeExecutor.isLinux()) {
- File fireflyLuciferinDebTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_LINUX_DEB);
- if (fireflyLuciferinDebTmpFile.isFile()) fireflyLuciferinDebTmpFile.delete();
- File fireflyLuciferinRpmTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_LINUX_RPM);
- if (fireflyLuciferinRpmTmpFile.isFile()) fireflyLuciferinRpmTmpFile.delete();
+ try {
+ if (NativeExecutor.isWindows()) {
+ File fireflyLuciferinTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_WINDOWS);
+ if (fireflyLuciferinTmpFile.isFile()) fireflyLuciferinTmpFile.delete();
+ } else if (NativeExecutor.isLinux()) {
+ File fireflyLuciferinDebTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_LINUX_DEB);
+ if (fireflyLuciferinDebTmpFile.isFile()) fireflyLuciferinDebTmpFile.delete();
+ File fireflyLuciferinRpmTmpFile = new File(path + File.separator + Constants.SETUP_FILENAME_LINUX_RPM);
+ if (fireflyLuciferinRpmTmpFile.isFile()) fireflyLuciferinRpmTmpFile.delete();
+ }
+ List firmwareFiles = searchFilesWithWc(Paths.get(path), Constants.FIRMWARE_FILENAME_PATTERN);
+ for (String firmwareFilename : firmwareFiles) {
+ File fileToDelete = new File(path + File.separator + firmwareFilename);
+ if (fileToDelete.isFile()) fileToDelete.delete();
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
}
- File glowWormEsp8266TmpFile = new File(path + File.separator + Constants.GW_FIRMWARE_BIN_ESP8266);
- if (glowWormEsp8266TmpFile.isFile()) glowWormEsp8266TmpFile.delete();
- File glowWormEsp32TmpFile = new File(path + File.separator + Constants.GW_FIRMWARE_BIN_ESP32);
- if (glowWormEsp32TmpFile.isFile()) glowWormEsp32TmpFile.delete();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/dpsoftware/managers/UpgradeManager.java b/src/main/java/org/dpsoftware/managers/UpgradeManager.java
index 1222aac9c..97492806f 100644
--- a/src/main/java/org/dpsoftware/managers/UpgradeManager.java
+++ b/src/main/java/org/dpsoftware/managers/UpgradeManager.java
@@ -40,6 +40,7 @@
import org.dpsoftware.JavaFXStarter;
import org.dpsoftware.NativeExecutor;
import org.dpsoftware.config.Constants;
+import org.dpsoftware.config.Enums;
import org.dpsoftware.gui.GUIManager;
import org.dpsoftware.gui.controllers.DevicesTabController;
import org.dpsoftware.gui.elements.GlowWormDevice;
@@ -51,6 +52,8 @@
import java.awt.*;
import java.io.*;
import java.math.BigInteger;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.channels.Channels;
@@ -102,7 +105,7 @@ public boolean checkRemoteUpdateFF(String currentVersion) {
try {
if (currentVersion != null && !currentVersion.equals(Constants.LIGHT_FIRMWARE_DUMMY_VERSION) && !currentVersion.equals(Constants.DASH)) {
long numericVerion = versionNumberToNumber(currentVersion);
- URL url = new URL(Constants.GITHUB_POM_URL);
+ URL url = new URI(Constants.GITHUB_POM_URL).toURL();
URLConnection urlConnection = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
String inputLine;
@@ -120,7 +123,7 @@ public boolean checkRemoteUpdateFF(String currentVersion) {
} else {
return false;
}
- } catch (IOException e) {
+ } catch (IOException | URISyntaxException e) {
log.error(e.getMessage());
return false;
}
@@ -141,15 +144,15 @@ public boolean checkRemoteUpdateGW(boolean useAlphaFirmware, String currentVersi
URL url;
if (useAlphaFirmware) {
if (FireflyLuciferin.config != null && FireflyLuciferin.config.isFullFirmware()) {
- url = new URL(Constants.GITHUB_GLOW_WORM_URL_FULL_BETA);
+ url = new URI(Constants.GITHUB_GLOW_WORM_URL_FULL_BETA).toURL();
} else {
- url = new URL(Constants.GITHUB_GLOW_WORM_URL_LIGHT_BETA);
+ url = new URI(Constants.GITHUB_GLOW_WORM_URL_LIGHT_BETA).toURL();
}
} else {
if (FireflyLuciferin.config != null && FireflyLuciferin.config.isFullFirmware()) {
- url = new URL(Constants.GITHUB_GLOW_WORM_URL_FULL);
+ url = new URI(Constants.GITHUB_GLOW_WORM_URL_FULL).toURL();
} else {
- url = new URL(Constants.GITHUB_GLOW_WORM_URL_LIGHT);
+ url = new URI(Constants.GITHUB_GLOW_WORM_URL_LIGHT).toURL();
}
}
URLConnection urlConnection = url.openConnection();
@@ -171,7 +174,7 @@ public boolean checkRemoteUpdateGW(boolean useAlphaFirmware, String currentVersi
} else {
return false;
}
- } catch (IOException e) {
+ } catch (IOException | URISyntaxException e) {
log.error(e.getMessage());
return false;
}
@@ -233,7 +236,7 @@ protected Object call() throws Exception {
} else if (NativeExecutor.isMac()) {
filename = Constants.SETUP_FILENAME_MAC;
} else {
- List commandOutput = NativeExecutor.runNativeWaitForOutput(Constants.DPKG_CHECK_CMD.split(" "));
+ List commandOutput = NativeExecutor.runNative(Constants.DPKG_CHECK_CMD.split(" "), Constants.CMD_WAIT_DELAY);
if (commandOutput.size() > 0) {
filename = Constants.SETUP_FILENAME_LINUX_DEB;
} else {
@@ -392,7 +395,7 @@ public void checkGlowWormUpdates(boolean fireflyUpdate) {
});
}
}
- }, 15);
+ }, 20);
}
}
@@ -413,10 +416,10 @@ void executeUpdate(GlowWormDevice glowWormDevice, boolean downloadFirmwareOnly)
} else {
filename = Constants.UPDATE_FILENAME_LIGHT;
}
- if (glowWormDevice.getDeviceBoard().equals(Constants.ESP8266)) {
- filename = filename.replace(Constants.DEVICE_BOARD, Constants.ESP8266);
- } else if (glowWormDevice.getDeviceBoard().equals(Constants.ESP32)) {
- filename = filename.replace(Constants.DEVICE_BOARD, Constants.ESP32);
+ Enums.SupportedDevice deviceName = Enums.SupportedDevice.valueOf(glowWormDevice.getDeviceBoard());
+ filename = filename.replace(Constants.DEVICE_BOARD, deviceName.name());
+ if (Enums.SupportedDevice.ESP32_S3_CDC.name().equals(glowWormDevice.getDeviceBoard())) {
+ filename = filename.replace(Constants.CDC_DEVICE, "");
}
downloadFile(filename);
Path localFile = Paths.get(System.getProperty(Constants.HOME_PATH) + File.separator + Constants.DOCUMENTS_FOLDER
@@ -433,7 +436,7 @@ void executeUpdate(GlowWormDevice glowWormDevice, boolean downloadFirmwareOnly)
Constants.MANUAL_UPGRADE, Alert.AlertType.INFORMATION);
}
}
- } catch (IOException e) {
+ } catch (IOException | URISyntaxException e) {
log.error(e.getMessage());
}
}
@@ -446,11 +449,11 @@ void executeUpdate(GlowWormDevice glowWormDevice, boolean downloadFirmwareOnly)
* @param path firmware path to file
* @throws IOException something bad happened in the connection
*/
- private void postDataToMicrocontroller(GlowWormDevice glowWormDevice, Path path) throws IOException {
+ private void postDataToMicrocontroller(GlowWormDevice glowWormDevice, Path path) throws IOException, URISyntaxException {
String boundary = new BigInteger(256, new Random()).toString();
String url = Constants.UPGRADE_URL.replace("{0}", glowWormDevice.getDeviceIP());
- URLConnection connection = new URL(url).openConnection();
+ URLConnection connection = new URI(url).toURL().openConnection();
connection.setDoOutput(true);
connection.setRequestProperty(Constants.UPGRADE_CONTENT_TYPE, Constants.UPGRADE_MULTIPART + boundary);
@@ -483,7 +486,12 @@ private void postDataToMicrocontroller(GlowWormDevice glowWormDevice, Path path)
if (Constants.OK.contentEquals(response)) {
log.info(CommonUtility.getWord(Constants.FIRMWARE_UPGRADE_RES), glowWormDevice.getDeviceName(), Constants.OK);
if (!FireflyLuciferin.config.isMqttEnable()) {
- String notificationContext = glowWormDevice.getDeviceName() + " " + CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS);
+ String notificationContext = glowWormDevice.getDeviceName() + " ";
+ if (Enums.SupportedDevice.ESP32_S3_CDC.name().equals(glowWormDevice.getDeviceBoard()) && !FireflyLuciferin.config.isWirelessStream()) {
+ notificationContext += CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS_CDC);
+ } else {
+ notificationContext += CommonUtility.getWord(Constants.DEVICEUPGRADE_SUCCESS);
+ }
if (NativeExecutor.isWindows()) {
FireflyLuciferin.guiManager.showNotification(CommonUtility.getWord(Constants.UPGRADE_SUCCESS), notificationContext, TrayIcon.MessageType.INFO);
} else {
diff --git a/src/main/java/org/dpsoftware/managers/dto/FirmwareConfigDto.java b/src/main/java/org/dpsoftware/managers/dto/FirmwareConfigDto.java
index 2bef80add..f7df6285e 100644
--- a/src/main/java/org/dpsoftware/managers/dto/FirmwareConfigDto.java
+++ b/src/main/java/org/dpsoftware/managers/dto/FirmwareConfigDto.java
@@ -45,6 +45,7 @@ public class FirmwareConfigDto {
String mqttuser;
String mqttpass;
Integer gpio;
+ Integer gpioClock;
String additionalParam;
String colorMode;
String colorOrder;
@@ -52,4 +53,7 @@ public class FirmwareConfigDto {
String lednum;
@JsonProperty("MAC")
String MAC;
+ Integer ldrPin;
+ Integer relayPin;
+ Integer sbPin;
}
\ No newline at end of file
diff --git a/src/main/java/org/dpsoftware/managers/dto/LdrDto.java b/src/main/java/org/dpsoftware/managers/dto/LdrDto.java
index 94ad382b8..6fe5d5eb7 100644
--- a/src/main/java/org/dpsoftware/managers/dto/LdrDto.java
+++ b/src/main/java/org/dpsoftware/managers/dto/LdrDto.java
@@ -41,5 +41,8 @@ public class LdrDto {
int ldrInterval;
int ldrMin;
int ldrAction;
+ Integer relayPin;
+ Integer sbPin;
+ Integer ldrPin;
}
diff --git a/src/main/java/org/dpsoftware/managers/dto/MqttFramerateDto.java b/src/main/java/org/dpsoftware/managers/dto/MqttFramerateDto.java
index 3a290e3ef..093967d8d 100644
--- a/src/main/java/org/dpsoftware/managers/dto/MqttFramerateDto.java
+++ b/src/main/java/org/dpsoftware/managers/dto/MqttFramerateDto.java
@@ -38,5 +38,11 @@ public class MqttFramerateDto {
private String producing;
private String consuming;
+ private String effect;
+ private String colorMode;
+ private String aspectRatio;
+ private String gamma;
+ private String smoothingLvl;
+ private String profile;
}
\ No newline at end of file
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectAspectRatioDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectAspectRatioDiscovery.java
index 4e5e586b1..55fbb3e74 100644
--- a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectAspectRatioDiscovery.java
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectAspectRatioDiscovery.java
@@ -63,7 +63,8 @@ public String getDiscoveryTopic() {
public String getCreateEntityStr() {
this.name = generateUniqueName("Luciferin Aspect Ratio");
this.uniqueId = this.name.replaceAll(" ", "_");
- this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/setaspectratio";
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
+ this.valueTemplate = "{{ value_json.aspectRatio }}";
this.commandTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/setaspectratio";
this.icon = "mdi:monitor-screenshot";
this.options = new ArrayList<>();
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectColorModeDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectColorModeDiscovery.java
index 67db9f286..274b813d6 100644
--- a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectColorModeDiscovery.java
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectColorModeDiscovery.java
@@ -54,23 +54,15 @@ public class SelectColorModeDiscovery implements DiscoveryObject {
@Override
public String getDiscoveryTopic() {
- return FireflyLuciferin.config.getMqttDiscoveryTopic() + "/select/" + CommonUtility.getDeviceToUse().getMac().replace(":", "") + "/colormode/config";
+ return FireflyLuciferin.config.getMqttDiscoveryTopic() + "/select/device" + CommonUtility.getDeviceToUse().getMac().replace(":", "") + "/colormode/config";
}
@Override
public String getCreateEntityStr() {
- this.name = generateUniqueName("Luciferin Color Mode");
- this.uniqueId = this.name.replaceAll(" ", "_");
- this.stateTopic = Constants.GLOW_WORM_FIRM_CONFIG_TOPIC;
- int cntInput = 0;
- StringBuilder colorModeIndexInput = new StringBuilder();
- for (Enums.ColorMode colorMode : Enums.ColorMode.values()) {
- int ordinal = colorMode.ordinal();
- colorModeIndexInput.append("{% ").append((cntInput == 0) ? "if" : "elif").append(" value_json.colorMode == '").append(++ordinal).append("' %}").append(colorMode.getBaseI18n());
- cntInput++;
- }
- colorModeIndexInput.append("{% endif %}");
- this.valueTemplate = colorModeIndexInput.toString();
+ this.name = generateUniqueName("Luciferin Color Mode" + " " + CommonUtility.getDeviceToUse().getDeviceName());
+ this.uniqueId = this.name.replaceAll(" ", "_") + CommonUtility.getDeviceToUse().getMac().replace(":", "");
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
+ this.valueTemplate = "{{ value_json.colorMode }}";
this.options = new ArrayList<>();
StringBuilder colorModeIndex = new StringBuilder();
int cntOutput = 0;
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectEffectDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectEffectDiscovery.java
index a0a807eaf..da2ecf0e6 100644
--- a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectEffectDiscovery.java
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectEffectDiscovery.java
@@ -60,7 +60,7 @@ public String getDiscoveryTopic() {
public String getCreateEntityStr() {
this.name = generateUniqueName("Luciferin Effect Selector");
this.uniqueId = this.name.replaceAll(" ", "_");
- this.stateTopic = "lights/" + FireflyLuciferin.config.getMqttTopic() + "/effectToGw";
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
this.valueTemplate = "{{ value_json.effect }}";
this.commandTopic = "lights/" + FireflyLuciferin.config.getMqttTopic() + "/effectToGw";
this.commandTemplate = "{\"state\":\"ON\",\"effect\":\"{{value}}\"}";
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectGammaDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectGammaDiscovery.java
index 8771af445..00f1415dd 100644
--- a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectGammaDiscovery.java
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectGammaDiscovery.java
@@ -61,7 +61,7 @@ public String getDiscoveryTopic() {
public String getCreateEntityStr() {
this.name = generateUniqueName("Luciferin Gamma");
this.uniqueId = this.name.replaceAll(" ", "_");
- this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/gamma";
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
this.commandTemplate = "{\"gamma\":\"{{value}}\"}";
this.commandTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/gamma";
this.icon = "mdi:gamma";
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectProfileDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectProfileDiscovery.java
new file mode 100644
index 000000000..524d045fb
--- /dev/null
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectProfileDiscovery.java
@@ -0,0 +1,80 @@
+/*
+ SelectProfileDiscovery.java
+
+ Firefly Luciferin, very fast Java Screen Capture software designed
+ for Glow Worm Luciferin firmware.
+
+ Copyright © 2020 - 2023 Davide Perini (https://github.com/sblantipodi)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+package org.dpsoftware.managers.dto.mqttdiscovery;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Getter;
+import org.dpsoftware.FireflyLuciferin;
+import org.dpsoftware.config.Constants;
+import org.dpsoftware.managers.StorageManager;
+import org.dpsoftware.utilities.CommonUtility;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Getter
+public class SelectProfileDiscovery implements DiscoveryObject {
+
+ @JsonProperty("unique_id")
+ String uniqueId;
+ String name;
+ @JsonProperty("state_topic")
+ String stateTopic;
+ @JsonProperty("value_template")
+ String valueTemplate;
+ @JsonProperty("command_topic")
+ String commandTopic;
+ @JsonProperty("force_update")
+ boolean forceUpdate;
+ String icon;
+ List options;
+
+ @Override
+ public String getDiscoveryTopic() {
+ return FireflyLuciferin.config.getMqttDiscoveryTopic() + "/select/" + getBaseFireflyDiscoveryTopic() + "/profile/config";
+ }
+
+ @Override
+ public String getCreateEntityStr() {
+ this.name = generateUniqueName("Luciferin Profiles");
+ this.uniqueId = this.name.replaceAll(" ", "_");
+ this.commandTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/profile/set";
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
+ this.valueTemplate = "{{ value_json.profile }}";
+ this.forceUpdate = true;
+ this.icon = "mdi:folder-arrow-left-right";
+ this.options = new ArrayList<>();
+ StorageManager sm = new StorageManager();
+ this.options.addAll(sm.listProfilesForThisInstance());
+ this.options.add(CommonUtility.getWord(Constants.DEFAULT));
+ return CommonUtility.toJsonString(this);
+ }
+
+ @Override
+ public String getDestroyEntityStr() {
+ return "";
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectSmoothingDiscovery.java b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectSmoothingDiscovery.java
index 50994b046..5686fc99f 100644
--- a/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectSmoothingDiscovery.java
+++ b/src/main/java/org/dpsoftware/managers/dto/mqttdiscovery/SelectSmoothingDiscovery.java
@@ -61,7 +61,8 @@ public String getDiscoveryTopic() {
public String getCreateEntityStr() {
this.name = generateUniqueName("Luciferin Smoothing Level");
this.uniqueId = this.name.replaceAll(" ", "_");
- this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/smoothing";
+ this.stateTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/framerate";
+ this.valueTemplate = "{{ value_json.smoothingLvl }}";
this.commandTopic = "lights/" + getBaseFireflyDiscoveryTopic() + "/smoothing/set";
this.icon = "mdi:iron-outline";
this.options = new ArrayList<>();
diff --git a/src/main/java/org/dpsoftware/network/tcpUdp/UdpServer.java b/src/main/java/org/dpsoftware/network/tcpUdp/UdpServer.java
index 86678b56b..a816a4a25 100644
--- a/src/main/java/org/dpsoftware/network/tcpUdp/UdpServer.java
+++ b/src/main/java/org/dpsoftware/network/tcpUdp/UdpServer.java
@@ -93,42 +93,44 @@ public void receiveBroadcastUDPPacket() {
while (udpBroadcastReceiverRunning) {
socket.receive(packet);
String received = new String(packet.getData(), 0, packet.getLength());
- if (!Constants.UDP_PING.equals(received)) {
- log.trace("Received UDP broadcast=" + received);
- // Share received broadcast with other Firefly Luciferin instances
- shareBroadCastToOtherInstances(received);
- }
- if (LocalizedEnum.fromBaseStr(Enums.Effect.class, received) != null) {
- FireflyLuciferin.config.setEffect(received);
- if (!FireflyLuciferin.RUNNING) {
- FireflyLuciferin.guiManager.startCapturingThreads();
+ if (!received.startsWith(Constants.UDP_DEVICE_NAME)) {
+ if (!received.contains(Constants.UDP_PING)) {
+ log.trace("Received UDP broadcast=" + received);
+ // Share received broadcast with other Firefly Luciferin instances
+ shareBroadCastToOtherInstances(received);
}
- }
- if (received.contains(Constants.STOP_STR)) {
- if (FireflyLuciferin.RUNNING) {
- FireflyLuciferin.guiManager.stopCapturingThreads(false);
- CommonUtility.turnOnLEDs();
+ if (LocalizedEnum.fromBaseStr(Enums.Effect.class, received) != null) {
+ FireflyLuciferin.config.setEffect(received);
+ if (!FireflyLuciferin.RUNNING) {
+ FireflyLuciferin.guiManager.startCapturingThreads();
+ }
}
- }
- if (!Constants.UDP_PONG.equals(received) && !Constants.UDP_PING.equals(received)) {
- JsonNode responseJson = CommonUtility.fromJsonToObject(received);
- if (responseJson != null && responseJson.get(Constants.STATE) != null && responseJson.get(Constants.MQTT_DEVICE_NAME) != null) {
- turnOnLightFirstTime(responseJson);
- CommonUtility.updateDeviceTable(Objects.requireNonNull(responseJson));
- CommonUtility.updateFpsWithDeviceTopic(Objects.requireNonNull(responseJson));
- } else if (responseJson != null && responseJson.get(Constants.MQTT_FRAMERATE) != null) {
- CommonUtility.updateFpsWithFpsTopic(Objects.requireNonNull(responseJson));
- } else if (UpgradeManager.deviceNameForSerialDevice.equals(received)) {
- log.info("Update successful=" + received);
- CommonUtility.sleepSeconds(60);
- FireflyLuciferin.guiManager.startCapturingThreads();
- } else {
- DevicesTabController.deviceTableData.forEach(glowWormDevice -> {
- if (glowWormDevice.getDeviceName().equals(received)) {
- log.info("Update successful=" + received);
- shareBroadCastToOtherInstances(received);
- }
- });
+ if (received.contains(Constants.STOP_STR)) {
+ if (FireflyLuciferin.RUNNING) {
+ FireflyLuciferin.guiManager.stopCapturingThreads(false);
+ CommonUtility.turnOnLEDs();
+ }
+ }
+ if (!Constants.UDP_PONG.equals(received) && !Constants.UDP_PING.equals(received)) {
+ JsonNode responseJson = CommonUtility.fromJsonToObject(received);
+ if (responseJson != null && responseJson.get(Constants.STATE) != null && responseJson.get(Constants.MQTT_DEVICE_NAME) != null) {
+ turnOnLightFirstTime(responseJson);
+ CommonUtility.updateDeviceTable(Objects.requireNonNull(responseJson));
+ CommonUtility.updateFpsWithDeviceTopic(Objects.requireNonNull(responseJson));
+ } else if (responseJson != null && responseJson.get(Constants.MQTT_FRAMERATE) != null) {
+ CommonUtility.updateFpsWithFpsTopic(Objects.requireNonNull(responseJson));
+ } else if (UpgradeManager.deviceNameForSerialDevice.equals(received)) {
+ log.info("Update successful=" + received);
+ CommonUtility.sleepSeconds(60);
+ FireflyLuciferin.guiManager.startCapturingThreads();
+ } else {
+ DevicesTabController.deviceTableData.forEach(glowWormDevice -> {
+ if (glowWormDevice.getDeviceName().equals(received)) {
+ log.info("Update successful=" + received);
+ shareBroadCastToOtherInstances(received);
+ }
+ });
+ }
}
}
}
@@ -155,8 +157,7 @@ private void turnOnLightFirstTime(JsonNode udpMsg) {
}
/**
- * Send a broadcast PING every second to the correct Network Adapter on the correct broadcast address
- * This is needed on some routers that blocks UDP traffic when there is no bidirectional traffic
+ * Manage UDP communication with Glow Worm
*/
@SuppressWarnings("Duplicates")
void broadcastToCorrectNetworkAdapter() {
@@ -173,21 +174,8 @@ void broadcastToCorrectNetworkAdapter() {
&& localIP.getHostAddress().equals(interfaceAddress.getAddress().getHostAddress())) {
log.info("Network adapter in use=" + networkInterface.getDisplayName());
log.info("Broadcast address found=" + interfaceAddress.getBroadcast());
- ScheduledExecutorService serialscheduledExecutorService = Executors.newScheduledThreadPool(1);
- // PING broadcast every seconds
- Runnable framerateTask = () -> {
- byte[] bufferBroadcastPing = Constants.UDP_PING.getBytes();
- DatagramPacket broadCastPing;
- try {
- broadcastAddress = interfaceAddress.getBroadcast();
- broadCastPing = new DatagramPacket(bufferBroadcastPing, bufferBroadcastPing.length,
- interfaceAddress.getBroadcast(), Constants.UDP_BROADCAST_PORT);
- socket.send(broadCastPing);
- } catch (IOException e) {
- log.error(e.getMessage());
- }
- };
- serialscheduledExecutorService.scheduleAtFixedRate(framerateTask, 0, 1, TimeUnit.SECONDS);
+ pingTask(interfaceAddress);
+ setIpTask(interfaceAddress);
}
}
}
@@ -197,6 +185,63 @@ void broadcastToCorrectNetworkAdapter() {
}
}
+ /**
+ * Send device name to GW. If the device name is the one used by the GW device,
+ * GW will use the Firefly Luciferin IP for the next communications.
+ *
+ * @param interfaceAddress inet address
+ */
+ private void setIpTask(InterfaceAddress interfaceAddress) {
+ // Send device name every 2 seconds
+ ScheduledExecutorService udpIpExecutorService = Executors.newScheduledThreadPool(1);
+ Runnable setIpTask = () -> {
+ try {
+ byte[] bufferBroadcastPing;
+ DatagramPacket broadCastPing;
+ // Send the name of the device where Firefly wants to connect
+ if (!Constants.SERIAL_PORT_AUTO.equals(FireflyLuciferin.config.getOutputDevice())) {
+ String udpMsg = (Constants.UDP_DEVICE_NAME + FireflyLuciferin.config.getOutputDevice());
+ bufferBroadcastPing = udpMsg.getBytes();
+ broadcastAddress = interfaceAddress.getBroadcast();
+ broadCastPing = new DatagramPacket(bufferBroadcastPing, bufferBroadcastPing.length,
+ interfaceAddress.getBroadcast(), Constants.UDP_BROADCAST_PORT);
+ log.trace(udpMsg);
+ socket.send(broadCastPing);
+ }
+ } catch (IOException e) {
+ log.error(e.getMessage());
+ }
+ };
+ udpIpExecutorService.scheduleAtFixedRate(setIpTask, 0, 2, TimeUnit.SECONDS);
+ }
+
+ /**
+ * Send a broadcast PING every second to the correct Network Adapter on the correct broadcast address
+ * This is needed on some routers that blocks UDP traffic when there is no bidirectional traffic.
+ * Glow Worm receives the PING and uses the IP from the Firefly instance for next communications.
+ *
+ * @param interfaceAddress inet address
+ */
+ private void pingTask(InterfaceAddress interfaceAddress) {
+ // PING broadcast every seconds
+ ScheduledExecutorService udpBrExecutorService = Executors.newScheduledThreadPool(1);
+ Runnable pingTask = () -> {
+ try {
+ String udpMsg = (Constants.UDP_PING + interfaceAddress.getBroadcast().toString().substring(1));
+ byte[] bufferBroadcastPing = udpMsg.getBytes();
+ DatagramPacket broadCastPing;
+ broadcastAddress = interfaceAddress.getBroadcast();
+ broadCastPing = new DatagramPacket(bufferBroadcastPing, bufferBroadcastPing.length,
+ interfaceAddress.getBroadcast(), Constants.UDP_BROADCAST_PORT);
+ socket.send(broadCastPing);
+ log.trace(udpMsg);
+ } catch (IOException e) {
+ log.error(e.getMessage());
+ }
+ };
+ udpBrExecutorService.scheduleAtFixedRate(pingTask, 0, 1, TimeUnit.SECONDS);
+ }
+
/**
* Share received broadcast with other Firefly Luciferin instances
*
diff --git a/src/main/java/org/dpsoftware/utilities/CommonUtility.java b/src/main/java/org/dpsoftware/utilities/CommonUtility.java
index 39c870854..30f23ad0e 100644
--- a/src/main/java/org/dpsoftware/utilities/CommonUtility.java
+++ b/src/main/java/org/dpsoftware/utilities/CommonUtility.java
@@ -53,6 +53,8 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
+import static org.dpsoftware.FireflyLuciferin.config;
+
/**
* CommonUtility class for useful methods
*/
@@ -335,12 +337,17 @@ public static void addDevice(JsonNode actualObj) {
deviceColorOrderInt = actualObj.get(Constants.COLOR).get(Constants.COLOR_ORDER).asInt();
}
}
+ String deviceVer = (actualObj.get(Constants.DEVICE_VER).textValue());
+ String deviceBoard = actualObj.get(Constants.DEVICE_BOARD) == null ? Constants.DASH : actualObj.get(Constants.DEVICE_BOARD).textValue();
+ if (config.isCheckForUpdates() && Enums.SupportedDevice.ESP32_S3_CDC.name().equals(deviceBoard)) {
+ deviceVer = Constants.FORCE_FIRMWARE_AUTO_UPGRADE;
+ }
DevicesTabController.deviceTableData.add(new GlowWormDevice(actualObj.get(Constants.MQTT_DEVICE_NAME).textValue(),
actualObj.get(Constants.STATE_IP).textValue(),
actualObj.get(Constants.STATE_DHCP) != null && actualObj.get(Constants.STATE_DHCP).asBoolean(),
(actualObj.get(Constants.WIFI) == null ? Constants.DASH : actualObj.get(Constants.WIFI) + Constants.PERCENT),
- (actualObj.get(Constants.DEVICE_VER).textValue()),
- (actualObj.get(Constants.DEVICE_BOARD) == null ? Constants.DASH : actualObj.get(Constants.DEVICE_BOARD).textValue()),
+ deviceVer,
+ deviceBoard,
(actualObj.get(Constants.MAC) == null ? Constants.DASH : actualObj.get(Constants.MAC).textValue()),
(actualObj.get(Constants.GPIO) == null ? Constants.DASH : actualObj.get(Constants.GPIO).toString()),
(actualObj.get(Constants.NUMBER_OF_LEDS) == null ? Constants.DASH : actualObj.get(Constants.NUMBER_OF_LEDS).textValue()),
@@ -351,7 +358,11 @@ public static void addDevice(JsonNode actualObj) {
(actualObj.get(Constants.MQTT_TOPIC) == null ? FireflyLuciferin.config.isFullFirmware() ? Constants.MQTT_BASE_TOPIC : Constants.DASH
: actualObj.get(Constants.MQTT_TOPIC).textValue()), deviceColorMode,
Enums.ColorOrder.findByValue(deviceColorOrderInt).name(),
- (actualObj.get(Constants.MQTT_LDR_VALUE) == null ? Constants.DASH : actualObj.get(Constants.MQTT_LDR_VALUE).asInt() + Constants.PERCENT)));
+ (actualObj.get(Constants.MQTT_LDR_VALUE) == null ? Constants.DASH : actualObj.get(Constants.MQTT_LDR_VALUE).asInt() + Constants.PERCENT),
+ (actualObj.get(Constants.HTTP_LDR_RELAYPIN) == null ? Constants.DASH : actualObj.get(Constants.HTTP_LDR_RELAYPIN).toString()),
+ (actualObj.get(Constants.HTTP_LDR_SBPIN) == null ? Constants.DASH : actualObj.get(Constants.HTTP_LDR_SBPIN).toString()),
+ (actualObj.get(Constants.HTTP_LDR_LDRPIN) == null ? Constants.DASH : actualObj.get(Constants.HTTP_LDR_LDRPIN).toString()),
+ (actualObj.get(Constants.GPIO_CLOCK) == null ? Constants.DASH : actualObj.get(Constants.GPIO_CLOCK).toString())));
if (CommonUtility.getDeviceToUse() != null && actualObj.get(Constants.MAC) != null) {
if (CommonUtility.getDeviceToUse().getMac().equals(actualObj.get(Constants.MAC).textValue())) {
if (actualObj.get(Constants.WHITE_TEMP) != null) {
@@ -386,8 +397,8 @@ public static void updateDeviceTable(JsonNode mqttmsg) {
if (mqttmsg.get(Constants.GPIO) != null) {
glowWormDevice.setGpio(mqttmsg.get(Constants.GPIO).toString());
}
- if (mqttmsg.get(Constants.DEVICE_VER) != null) {
- glowWormDevice.setDeviceVersion(mqttmsg.get(Constants.DEVICE_VER).textValue());
+ if (mqttmsg.get(Constants.GPIO_CLOCK) != null) {
+ glowWormDevice.setGpioClock(mqttmsg.get(Constants.GPIO_CLOCK).toString());
}
if (mqttmsg.get(Constants.WIFI) != null) {
CommonUtility.wifiStrength = mqttmsg.get(Constants.WIFI) != null ? mqttmsg.get(Constants.WIFI).asInt() : 0;
@@ -423,9 +434,28 @@ public static void updateDeviceTable(JsonNode mqttmsg) {
if (mqttmsg.get(Constants.NUMBER_OF_LEDS) != null) {
glowWormDevice.setNumberOfLEDSconnected(mqttmsg.get(Constants.NUMBER_OF_LEDS).asText());
}
+ if (mqttmsg.get(Constants.HTTP_LDR_RELAYPIN) != null) {
+ glowWormDevice.setRelayPin(mqttmsg.get(Constants.HTTP_LDR_RELAYPIN).asText());
+ }
+ if (mqttmsg.get(Constants.HTTP_LDR_SBPIN) != null) {
+ glowWormDevice.setSbPin(mqttmsg.get(Constants.HTTP_LDR_SBPIN).asText());
+ }
+ if (mqttmsg.get(Constants.HTTP_LDR_LDRPIN) != null) {
+ glowWormDevice.setLdrPin(mqttmsg.get(Constants.HTTP_LDR_LDRPIN).asText());
+ }
if (mqttmsg.get(Constants.STATE_DHCP) != null) {
glowWormDevice.setDhcpInUse(mqttmsg.get(Constants.STATE_DHCP).asBoolean());
}
+ if (mqttmsg.get(Constants.DEVICE_BOARD) != null) {
+ glowWormDevice.setDeviceBoard(mqttmsg.get(Constants.DEVICE_BOARD).asText());
+ }
+ if (mqttmsg.get(Constants.DEVICE_VER) != null) {
+ String deviceVer = (mqttmsg.get(Constants.DEVICE_VER).textValue());
+ if (config.isCheckForUpdates() && Enums.SupportedDevice.ESP32_S3_CDC.name().equals(glowWormDevice.getDeviceBoard())) {
+ deviceVer = Constants.FORCE_FIRMWARE_AUTO_UPGRADE;
+ }
+ glowWormDevice.setDeviceVersion(deviceVer);
+ }
}
});
if (!isDevicePresent.get()) {
@@ -436,6 +466,9 @@ public static void updateDeviceTable(JsonNode mqttmsg) {
GlowWormDevice mqttDeviceInUse = CommonUtility.getDeviceToUse();
if (mqttDeviceInUse != null) {
UpgradeManager.deviceNameForSerialDevice = mqttDeviceInUse.getDeviceName();
+ if (Enums.SupportedDevice.ESP32_S3_CDC.name().equals(mqttDeviceInUse.getDeviceBoard())) {
+ UpgradeManager.deviceNameForSerialDevice += Constants.CDC_DEVICE;
+ }
}
}
}
diff --git a/src/main/resources/gstreamer b/src/main/resources/gstreamer
index 1e3eb204c..f2704e9da 160000
--- a/src/main/resources/gstreamer
+++ b/src/main/resources/gstreamer
@@ -1 +1 @@
-Subproject commit 1e3eb204ccc82d2ef10888b5cec673a41a014b3d
+Subproject commit f2704e9daba22861d0f40acda69abe354707c1a1
diff --git a/src/main/resources/messagebundle_de.properties b/src/main/resources/messagebundle_de.properties
index 430f0ddcf..68cf102a5 100644
--- a/src/main/resources/messagebundle_de.properties
+++ b/src/main/resources/messagebundle_de.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW Gemischt (Heller)
enum.color.mode.rgbw.rgb=RGBW (Nur RGB)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Deaktiviert
multimonitor.dual=Zwei Bildschirme
@@ -243,9 +244,6 @@ error.reading.config=Fehler beim Lesen der Konfigurationsdatei. Standardkonfigur
framerate.title=Fehler bei Bildwiederholrate
framerate.header=Firefly Luciferin ist nicht synchron
framerate.context=Dein Computer nimmt deinen Bildschirm zu schnell auf und Glow Worm Luciferin kommt nicht hinterher.\nDas kann zu Synchronisationsproblemen führen. Möchtest du die Bildwiederholrate zu {0} FPS ändern?
-gpio.title=GPIO Fehler
-gpio.header=Nicht unterstützter GPIO
-gpio.context=Luciferin unterstützt GPIO2, GPIO3, GPIO5 und GPIO16
baudrate.title=Warnung
baudrate.header=Möchten Sie die Baudrate wirklich ändern?
baudrate.context=Sollte trotz guter Verbindung Flackern auftreten, kann es helfen, die Baudrate zu verringern.\n\nWenn du die maximale Bildwiederholrate erhöhen möchtest, kann es helfen, die Baudrate zu erhöhen.\nWenn du die Baudrate erhöhst und dein Mikrocontroller diese Geschwindigkeit nicht unterstützt, wirst du nicht mehr in der Lage sein, das nachträglich zu ändern, es sei denn du überspielst manuell die Firmware.\n\nBei Klick auf “OK” bestätigst du, die Baudrate zu ändern und deinen Mikrocontroller neuzustarten. Bitte warte einen Moment, bis er sich wieder verbindet.
@@ -267,6 +265,7 @@ once.download.finished=Sobald der Download abgeschlossen ist,\nwechsle bitte zu
new.version.available=Neue Version verfügbar!
upgrade.success=Update erfolgreich
device.upgrade.success=Firmware Update erfolgreich.\nDie Bildschirmaufnahme wird wieder beginnen, sobald der Mikrocontroller seinen Neustart abgeschlossen hat.
+device.upgrade.success.cdc=Firmware Update erfolgreich.\nCOM-Port hat sich geändert, bitte wählen Sie den neuen Port in den Einstellungen aus.
device.program.success=Angeschlossenes Gerät wurde programmiert
device.program.success.header=Alle Einstellungen von Firefly Luciferin wurden automatisch auf das verbundene Gerät übertragen.
new.firmware.available=Neue Firmware verfügbar!
diff --git a/src/main/resources/messagebundle_en.properties b/src/main/resources/messagebundle_en.properties
index 471000033..46d55e863 100644
--- a/src/main/resources/messagebundle_en.properties
+++ b/src/main/resources/messagebundle_en.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW Mixed (Brighter)
enum.color.mode.rgbw.rgb=RGBW (RGB only)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Disabled
multimonitor.dual=Dual display
@@ -243,9 +244,6 @@ error.reading.config=Error reading config file, writing a default one.
framerate.title=Framerate error
framerate.header=Firefly Luciferin is out of sync
framerate.context=Your computer is capturing the screen too fast and Glow Worm Luciferin firmware can't keep up.\nThis can cause synchronization issues, do you want to lower the framerate to {0} FPS?
-gpio.title=GPIO error
-gpio.header=Unsupported GPIO
-gpio.context=Luciferin supports GPIO2, GPIO3, GPIO5 and GPIO16
baudrate.title=Warning
baudrate.header=Are you sure you want to change the baud rate?
baudrate.context=If you are experiencing flickering and your hardware connections are properly made, lowering the baud rate may reduce the flicker.\n\nIf you want to increase the maximum framerate, increasing the baud rate can help.\nIf you increase the baud rate and your microcontroller doesn't support that speed, you will not be able to change it again until you manually reflash the firmware.\n\nBy pressing OK you accept to change the baud rate and to reboot your microcontroller, please wait some moments until it reconnects.
@@ -266,7 +264,8 @@ click.ok.download.linux=\nClick Ok to download new version in your\n~/Documents/
once.download.finished=Once the download is finished,\nplease go to that folder and install it manually.
new.version.available=New version available!
upgrade.success=Upgrade success
-device.upgrade.success= firmware upgrade successful.\nScreen capture will begin as soon as the microcontroller reboot is complete.
+device.upgrade.success=firmware upgrade successful.\nScreen capture will begin as soon as the microcontroller reboot is complete.
+device.upgrade.success.cdc=firmware upgrade successful.\nCOM port has changed, please select the new port in the settings.
device.program.success=Connected device has been programmed
device.program.success.header=All Firefly Luciferin settings were automatically transferred to the connected device.
new.firmware.available=New firmware available!
diff --git a/src/main/resources/messagebundle_es.properties b/src/main/resources/messagebundle_es.properties
index 9b5ce1134..7799cd0e1 100644
--- a/src/main/resources/messagebundle_es.properties
+++ b/src/main/resources/messagebundle_es.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW Mixto (más brillante)
enum.color.mode.rgbw.rgb=RGBW (Solo RGB)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Deshabilitado
multimonitor.dual=Pantalla doble
@@ -243,9 +244,6 @@ error.reading.config=Error al leer archivo de configuración, escribiendo uno po
framerate.title=Error de tasa de refresco
framerate.header=Firefly Luciferin fuera de sincronismo
framerate.context=Su ordenador está capturando la pantalla demasiado rápido y el firmware Glow Worm Luciferin no sigue el ritmo.\nEsto puede causar problemas de sincronización, ¿desea bajar la tasa de refresco a {0} FPS?
-gpio.title=Error GPIO
-gpio.header=GPIO no soportado
-gpio.context=Luciferin soporta GPIO2, GPIO3, GPIO5 y GPIO16
baudrate.title=Aviso
baudrate.header=¿Está seguro de querer cambiar la tasa de baudios?
baudrate.context=Si experimenta parpadeos y las conexiones del hardware son correctas, bajar la tasa de baudios podría reducir el parpadeo\n\nSi quiere aumentar la tasa máxima de refresco, puede ayudar aumentar la tasa de baudios.\nSi aumenta la tasa de baudios y su microcontrolador no soporta esa velocidad, no podrá cambiarla de nuevo hasta que reprograme manualmente el firmware.\n\nPulsando OK está aceptando cambiar la tasa de baudios y reiniciar su microcontrolador, por favor espere un momento hasta que se reconecte.
@@ -266,7 +264,8 @@ click.ok.download.linux=\nPulse OK para descargar la nueva versión en su carpet
once.download.finished=Cuando haya terminado la descarga,\npor favor, vaya a dicha carpeta e instálelo manualmente.
new.version.available=¡Disponible nueva versión!
upgrade.success=Actualización correcta
-device.upgrade.success= Actualización correcta de firmware.\nLa captura de pantalla empezará tam pronto se complete el reinicio del microcontrolador.
+device.upgrade.success=Actualización correcta de firmware.\nLa captura de pantalla empezará tam pronto se complete el reinicio del microcontrolador.
+device.upgrade.success.cdc=Actualización correcta de firmware.\nEl puerto COM ha cambiado, seleccione el nuevo puerto en la configuración.
device.program.success=El dispositivo conectado ha sido programado
device.program.success.header=Todas las configuraciones de Firefly Luciferin se transfirieron automáticamente al dispositivo conectado.
new.firmware.available=¡Disponible nuevo firmware!
diff --git a/src/main/resources/messagebundle_fr.properties b/src/main/resources/messagebundle_fr.properties
index 2043b0922..9941925c1 100644
--- a/src/main/resources/messagebundle_fr.properties
+++ b/src/main/resources/messagebundle_fr.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW Mixte (Plus lumineux)
enum.color.mode.rgbw.rgb=RGBW (RGB uniquement)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Désactiver
multimonitor.dual=Deux écrans
@@ -243,9 +244,6 @@ error.reading.config=Erreur de lecture du fichier de configuration, écriture d'
framerate.title=Erreur de fréquence d'images
framerate.header=Firefly Luciferin n'est plus synchronisé
framerate.context=Votre ordinateur capture l'écran trop rapidement et le logiciel Glow Worm Luciferin ne peut pas suivre.\nCela peut entraîner des problèmes de synchronisation. Voulez-vous réduire la fréquence d'images à {0} FPS ?
-gpio.title=Erreur GPIO
-gpio.header=GPIO non supporté
-gpio.context=Luciferin supporte GPIO2, GPIO3, GPIO5 et GPIO16
baudrate.title=Attention
baudrate.header=Êtes-vous sûr de vouloir modifier le baudrate ?
baudrate.context=Si vous rencontrez des scintillements et que vos connexions matérielles sont correctes, la diminution du débit en bauds peut réduire le scintillement.\n\nSi vous souhaitez augmenter la fréquence d'images maximale, l'augmentation du baudrate peut vous aider.\nSi vous augmentez le baudrate et votre le microcontrôleur ne prend pas en charge cette vitesse, vous ne pourrez plus la modifier jusqu'à ce que vous reflashiez manuellement le firmware.\n\nEn appuyant sur OK, vous acceptez de modifier le baudrate et de redémarrer votre microcontrôleur, veuillez patienter quelques instants jusqu'à ce qu'il se reconnecte .
@@ -266,7 +264,8 @@ click.ok.download.linux=\nCliquez sur OK pour télécharger la nouvelle version
once.download.finished=Une fois le téléchargement terminé,\nveuillez accéder à ce dossier et l'installer manuellement.
new.version.available=Nouvelle version disponible!
upgrade.success=Mise à niveau réussie
-device.upgrade.success= mise à jour du firmware réussie.\nLa capture d'écran commencera dès que le redémarrage du microcontrôleur sera terminé.
+device.upgrade.success=mise à jour du firmware réussie.\nLa capture d'écran commencera dès que le redémarrage du microcontrôleur sera terminé.
+device.upgrade.success.cdc=mise à jour du firmware réussie.\nLe port COM a changé, veuillez sélectionner le nouveau port dans les paramètres.
device.program.success=L'appareil connecté a été programmé
device.program.success.header=Tous les paramètres Firefly Luciferin ont été automatiquement transférés vers l'appareil connecté.
new.firmware.available=Nouveau firmware disponible!
diff --git a/src/main/resources/messagebundle_hu.properties b/src/main/resources/messagebundle_hu.properties
index ec9d831df..14ab2e71e 100644
--- a/src/main/resources/messagebundle_hu.properties
+++ b/src/main/resources/messagebundle_hu.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW Vegyes (Világosabb)
enum.color.mode.rgbw.rgb=RGBW (Csak RGB)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Letiltva
multimonitor.dual=Kettő kijelző
@@ -243,9 +244,6 @@ error.reading.config=Hiba a konfig fájl betöltésekor, alapértékek használa
framerate.title=Framerate hiba
framerate.header=Firefly Luciferin nincs szinkronban
framerate.context=Az számítógép túl gyorsan vételezi a képkockákat és a Glow Worm Luciferin firmware nem tudja követni.\nEz szinkronizációs problémákhoz vezethet. Szeretnéd csökkenteni a mintavételezést {0} FPS-re?
-gpio.title=GPIO hiba
-gpio.header=Nem támogatott GPIO
-gpio.context=Luciferin által támogatott kimenetek GPIO2, GPIO3, GPIO5 and GPIO16
baudrate.title=Figyelmeztetés
baudrate.header=Biztos, hogy meg szeretnéd változtatni az átviteli sebességet?
baudrate.context=Ha villódzást érzékelsz és a hardver fizikai kontaktok megfelelőek, akkor az átviteli sebesség csökkentése mérsékelheti a villódzást.\n\nHa növelni szeretnéd a maximális képkockasebességet, az átviteli sebesség növelése segíthet.\nHa növeled az átviteli sebességet, de azt a mikrokontrollered nem támogatja, akkor nem fogod tudni visszaállítani amíg újra nem flasheled a mikrokontroller firmware-t.\n\nAz OK megnyomásával az új átviteli sebesség lesz beállítva és a mikrokontroller újraindul. Kérlek várj amíg a mikrokontroller újra csatlakozik.
@@ -266,7 +264,8 @@ click.ok.download.linux=\nAz új verziójú \n~/Documents/FireflyLuciferin mapp
once.download.finished=A letöltés végeztével,\n kérlek telepítsed manuálisan a letöltési mappából.
new.version.available=Új verzó elérhető!
upgrade.success=Frissítés sikeres
-device.upgrade.success= Frissítés sikeres.\nA képvételezés megkezdődik amint a mikrokontroller újraindult.
+device.upgrade.success=Frissítés sikeres.\nA képvételezés megkezdődik amint a mikrokontroller újraindult.
+device.upgrade.success.cdc=Frissítés sikeres.\nA COM port megváltozott, kérjük, válassza ki az új portot a beállításokban.
device.program.success=A csatlakoztatott eszköz programozásra került
device.program.success.header=A Firefly Luciferin összes beállítása automatikusan átkerült a csatlakoztatott eszközre.
new.firmware.available=Új firmware elérhető!
diff --git a/src/main/resources/messagebundle_it.properties b/src/main/resources/messagebundle_it.properties
index 3d10ec916..eb15b7e89 100644
--- a/src/main/resources/messagebundle_it.properties
+++ b/src/main/resources/messagebundle_it.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW (Più luminoso)
enum.color.mode.rgbw.rgb=RGBW (Solo RGB)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Disabilitato
multimonitor.dual=Doppio schermo
@@ -243,9 +244,6 @@ error.reading.config=Errore durante la lettura del file di configurazione, scriv
framerate.title=Problema nella frequenza di aggiornamento
framerate.header=Firefly Luciferin è fuori sincronia
framerate.context=Il tuo computer sta catturando lo schermo troppo velocemente e Glow Worm Luciferin non riesce a stare al passo.\nPotrebbero esserci problemi di sincronizzazione.\nVuoi abbassare il framerate a {0} FPS?
-gpio.title=Errore GPIO
-gpio.header=GPIO non supportato
-gpio.context=Luciferin supporta GPIO2, GPIO3, GPIO5 e GPIO16
baudrate.title=Attenzione
baudrate.header=Sei sicuro di voler cambiare il baud rate?
baudrate.context=Se le tue connessioni sono ben fatte e noti problemi di sfarfallio, abbassare il baud rate potrebbe aiutare a risolvere il problema.\nSe vuoi aumentare il framerate massimo, aumentare il baud rate potrebbe aiutare.\nSe aumenti il baud rate oltre al limite consentito dal tuo microcontrollore, non sarai più in grado di comunicare con il microcontrollore e dovrai flashare nuovamente il firmware.\nSe premi OK, il baud rate verrà modificato e il tuo microcontrollore verrà riavviato, attendi qualche secondo prima che si riconnetta.
@@ -266,7 +264,8 @@ click.ok.download.linux=\nClicca Ok per scaricare la nuova versione nella seguen
once.download.finished=Quando il download sarà terminato,\nvai in quella cartella e installa manualmente.
new.version.available=Nuova versione disponibile!
upgrade.success=Aggiornamento avvenuto con successo
-device.upgrade.success= aggiornamento firmware avvenuto con successo.\nLa cattura dello schermo inizierà appena il microcontrollore sarà riavviato.
+device.upgrade.success=aggiornamento firmware avvenuto con successo.\nLa cattura dello schermo inizierà appena il microcontrollore sarà riavviato.
+device.upgrade.success.cdc=aggiornamento firmware avvenuto con successo.\nLa porta COM è cambiata, seleziona la nuova porta nelle impostazioni.
device.program.success=Il dispositivo connesso è stato programmato
device.program.success.header=Tutte le impostazioni di Firefly Luciferin sono state trasferite automaticamente al dispositivo connesso.
new.firmware.available=Nuovo firmware disponibile!
diff --git a/src/main/resources/messagebundle_ru.properties b/src/main/resources/messagebundle_ru.properties
index 66ecf1e85..9ca80e0a1 100644
--- a/src/main/resources/messagebundle_ru.properties
+++ b/src/main/resources/messagebundle_ru.properties
@@ -216,6 +216,7 @@ enum.color.mode.rgb=RGB
enum.color.mode.rgbw.accurate=RGBW
enum.color.mode.rgbw.brighter=RGBW (Ярче)
enum.color.mode.rgbw.rgb=RGBW (только RGB)
+enum.color.mode.dotstar=DotStar
multimonitor.disabled=Выключено
multimonitor.dual=Два монитора
@@ -243,9 +244,6 @@ error.reading.config=Ошибка чтения файла конфигураци
framerate.title=Ошибка частоты кадров (FPS)
framerate.header=Firefly Luciferin не синхронизирован
framerate.context=Ваш компьютер захватывает экран слишком быстро, и прошивка Glow Worm Luciferin не успевает за ним..\nЭто может вызвать проблемы с синхронизацией, вы хотите понизить частоту кадров до {0} FPS?
-gpio.title=Ошибка GPIO
-gpio.header=Неподдерживаемый GPIO
-gpio.context=Luciferin поддерживает GPIO2, GPIO3, GPIO5 и GPIO16
baudrate.title=Предупреждение
baudrate.header=Вы уверены, что хотите изменить скорость передачи данных?
baudrate.context=Если светодиоды мерцают и устройство подключено и собрано правильно, снижение скорости передачи данных может уменьшить мерцание..\n\nЕсли вы хотите увеличить максимальную частоту кадров, вам может помочь увеличение скорости передачи данных.\nЕсли вы увеличиваете скорость передачи данных, а ваш контроллер не поддерживает эту скорость, вы не сможете изменить ее снова, пока не зальете прошивку вручную..\n\nНажав OK, вы соглашаетесь изменить скорость передачи данных и перезагрузить контроллер. Подождите несколько секунд, пока он снова не подключится.
@@ -266,7 +264,8 @@ click.ok.download.linux=\nНажмите «ОК», чтобы загрузить
once.download.finished=Когда загрузка будет завершена,\nперейдите в эту папку и установите программу вручную.
new.version.available=Доступна новая версия программы!
upgrade.success=Обновление успешно
-device.upgrade.success= обновление прошивки выполнено успешно.\nЗахват экрана начнется, как только завершится перезагрузка контроллера.
+device.upgrade.success=обновление прошивки выполнено успешно.\nЗахват экрана начнется, как только завершится перезагрузка контроллера.
+device.upgrade.success.cdc=обновление прошивки выполнено успешно.\nCOM-порт изменился, пожалуйста, выберите новый порт в настройках.
device.program.success=Подключенное устройство запрограммировано
device.program.success.header=Все настройки Firefly Luciferin автоматически переносились на подключенное устройство.
new.firmware.available=Доступна новая версия прошивки!
diff --git a/src/main/resources/org/dpsoftware/gui/devicesTab.fxml b/src/main/resources/org/dpsoftware/gui/devicesTab.fxml
index 1adc14ff5..dc9f4857e 100644
--- a/src/main/resources/org/dpsoftware/gui/devicesTab.fxml
+++ b/src/main/resources/org/dpsoftware/gui/devicesTab.fxml
@@ -38,10 +38,11 @@
-
-
+
+
+
-
+
@@ -49,6 +50,9 @@
+
+
+
diff --git a/src/main/resources/org/dpsoftware/gui/img/luciferin_logo_play.png b/src/main/resources/org/dpsoftware/gui/img/luciferin_logo_play.png
index ac1598fa7..bf05fbb98 100644
Binary files a/src/main/resources/org/dpsoftware/gui/img/luciferin_logo_play.png and b/src/main/resources/org/dpsoftware/gui/img/luciferin_logo_play.png differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play.png b/src/main/resources/org/dpsoftware/gui/img/tray_play.png
deleted file mode 100644
index ac6972aa9..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_center.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_center.png
deleted file mode 100644
index f672fb6a8..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_center.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_left.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_left.png
deleted file mode 100644
index ae5fdad8a..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_left.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_right.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_right.png
deleted file mode 100644
index dce8731a2..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_right.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_right_gold.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_right_gold.png
deleted file mode 100644
index 3ef0037e6..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_right_gold.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting.png
deleted file mode 100644
index 82552599a..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_center.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_center.png
deleted file mode 100644
index 7efe4178f..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_center.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_left.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_left.png
deleted file mode 100644
index 680d32ee8..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_left.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right.png
deleted file mode 100644
index 02d535d2e..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right_gold.png b/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right_gold.png
deleted file mode 100644
index e6b5657c8..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_play_waiting_right_gold.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop.png
deleted file mode 100644
index ce8f33fce..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_center.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_center.png
deleted file mode 100644
index f167e91e3..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_center.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey.png
deleted file mode 100644
index 6eca4c327..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_center.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_center.png
deleted file mode 100644
index 5ccd01d06..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_center.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_left.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_left.png
deleted file mode 100644
index 9559a5a29..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_left.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right.png
deleted file mode 100644
index 6b226d66c..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right_gold.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right_gold.png
deleted file mode 100644
index 62fd696e3..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_grey_right_gold.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_left.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_left.png
deleted file mode 100644
index b13f8ee50..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_left.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_right.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_right.png
deleted file mode 100644
index 9091d73e4..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_right.png and /dev/null differ
diff --git a/src/main/resources/org/dpsoftware/gui/img/tray_stop_right_gold.png b/src/main/resources/org/dpsoftware/gui/img/tray_stop_right_gold.png
deleted file mode 100644
index b18b6dc36..000000000
Binary files a/src/main/resources/org/dpsoftware/gui/img/tray_stop_right_gold.png and /dev/null differ
diff --git a/src/main/resources/project.properties b/src/main/resources/project.properties
index 0e6b3b405..8f1a7a8f9 100644
--- a/src/main/resources/project.properties
+++ b/src/main/resources/project.properties
@@ -1,4 +1,4 @@
version=${project.version}
-minimum.firmware.version=5.10.6
+minimum.firmware.version=5.11.8
# This feature is not exposed to end users. Used for testing purpose only. Set false before the release.
gw.alpha.download=false
\ No newline at end of file