Bug fixes.

UI updates.
This commit is contained in:
Dmitry Isaenko 2019-11-02 07:24:46 +03:00
parent 0bc4aa5f3b
commit 96f672e245
7 changed files with 52 additions and 24 deletions

View file

@ -6,7 +6,7 @@
<groupId>loper</groupId> <groupId>loper</groupId>
<artifactId>LogiLedus</artifactId> <artifactId>LogiLedus</artifactId>
<version>1.2-SNAPSHOT</version> <version>1.3-SNAPSHOT</version>
<!-- <url></url> --> <!-- <url></url> -->
<description> <description>

View file

@ -16,7 +16,7 @@ import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class MainFx extends Application { public class MainFx extends Application {
public static final String appVersion = "v1.2"; public static final String appVersion = "v1.3";
private static boolean traySupport = true; private static boolean traySupport = true;

View file

@ -9,6 +9,11 @@ public class EffectsThread extends LoThread {
private byte[] command; private byte[] command;
private byte[] commit = {
0x11, (byte) 0xff, 0x03, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
/** /**
* Used to set effects * Used to set effects
* @param effectData : set of rules, always not empty and not null * @param effectData : set of rules, always not empty and not null
@ -61,8 +66,10 @@ public class EffectsThread extends LoThread {
handler = usbConnect.getHandlerKbrd(); handler = usbConnect.getHandlerKbrd();
if (! write(command)) if (! write(command)){
MessagesConsumer.getInstance().inform("Complete!"); if (! write(commit))
MessagesConsumer.getInstance().inform("Complete!");
}
usbConnect.close(); usbConnect.close();
return null; return null;

View file

@ -2,6 +2,7 @@ package logiledus.USB;
import javafx.concurrent.Task; import javafx.concurrent.Task;
import logiledus.MessagesConsumer; import logiledus.MessagesConsumer;
import logiledus.RainbowHexDump;
import org.usb4java.DeviceHandle; import org.usb4java.DeviceHandle;
import org.usb4java.LibUsb; import org.usb4java.LibUsb;
@ -37,11 +38,12 @@ abstract class LoThread extends Task<Void> {
IntBuffer readBufTrans = IntBuffer.allocate(1); IntBuffer readBufTrans = IntBuffer.allocate(1);
LibUsb.interruptTransfer(handler, (byte) 0x82, readBuffer, readBufTrans, 1000); LibUsb.interruptTransfer(handler, (byte) 0x82, readBuffer, readBufTrans, 1000);
/* /*
readBufTrans.rewind();
readBuffer.rewind(); readBuffer.rewind();
byte[] arr = new byte[readBuffer.get()]; byte[] arr = new byte[readBufTrans.get()];
readBuffer.get(arr); readBuffer.get(arr);
RainbowHexDump.hexDumpUTF8(arr); RainbowHexDump.hexDumpUTF8(arr);
*/ //*/
return false; return false;
} }
} }

View file

@ -10,7 +10,7 @@ public class UsbConnect {
private DeviceHandle handlerKbrd; private DeviceHandle handlerKbrd;
private boolean connected = false; private boolean connected = false;
public UsbConnect(){ public UsbConnect(){
MessagesConsumer mc = MessagesConsumer.getInstance(); MessagesConsumer mc = MessagesConsumer.getInstance();
@ -67,17 +67,8 @@ public class UsbConnect {
LibUsb.freeDeviceList(deviceList, true); LibUsb.freeDeviceList(deviceList, true);
// Check if this device uses kernel driver and detach if possible: // I don't really care what is resulting value for this
result = LibUsb.kernelDriverActive(handlerKbrd, DEFAULT_INTERFACE); LibUsb.setAutoDetachKernelDriver(handlerKbrd, true);
if (result == 1) { // used by kernel
if (LibUsb.detachKernelDriver(handlerKbrd, DEFAULT_INTERFACE) != LibUsb.SUCCESS) {
mc.inform("Detach kernel failed: " + UsbErrorCodes.getErrCode(result));
close();
return;
}
}
else if (result != LibUsb.SUCCESS)
mc.inform("Can't proceed with libusb driver : "+UsbErrorCodes.getErrCode(result));
// Claim interface // Claim interface
result = LibUsb.claimInterface(handlerKbrd, DEFAULT_INTERFACE); result = LibUsb.claimInterface(handlerKbrd, DEFAULT_INTERFACE);

View file

@ -216,24 +216,38 @@
.tab-pane .tab:hover SVGPath{ .tab-pane .tab:hover SVGPath{
-fx-fill: #d0d0d0; -fx-fill: #d0d0d0;
} }
/*
.tab-pane .tab{ .tab-pane .tab{
-fx-background-color: #3c3f41; /* #2b2b2b; */ -fx-background-color: #3c3f41;
-fx-focus-color: transparent; -fx-focus-color: transparent;
-fx-faint-focus-color: transparent; -fx-faint-focus-color: transparent;
-fx-border-radius: 0 0 0 0; -fx-border-radius: 0 0 0 0;
-fx-border-width: 0 0 3 0; -fx-border-width: 0 0 3 0;
-fx-border-color: #2b2b2b; -fx-border-color: #2b2b2b;
} }
.tab-pane .tab:selected{ .tab-pane .tab:selected{
-fx-background-color: #3c3f41;/*#2b2b2b; */
-fx-background-color: #3c3f41;
-fx-focus-color: transparent; -fx-focus-color: transparent;
-fx-faint-focus-color: transparent; -fx-faint-focus-color: transparent;
-fx-border-radius: 0 0 0 0; -fx-border-radius: 0 0 0 0;
-fx-border-width: 0 0 3 0; -fx-border-width: 0 0 3 0;
-fx-border-color: #40b9bb; /* #289de8; */ -fx-border-color: #40b9bb;
} }
*/
.tab-pane .tab{
-fx-background-color: #3c3f41;
-fx-background-radius: 2;
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
}
.tab-pane .tab:selected{
-fx-background-color: #40b9bb;
-fx-background-radius: 2;
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
}
.tab-pane > .tab-header-area { .tab-pane > .tab-header-area {
-fx-background-insets: 0.0; -fx-background-insets: 0.0;
-fx-padding: 5 5 5 5; -fx-padding: 5 5 5 5;

View file

@ -205,11 +205,12 @@
-fx-fill: #2c2c2c; -fx-fill: #2c2c2c;
} }
.tab-pane .tab:selected SVGPath, .tab-pane .tab:selected:hover SVGPath{ .tab-pane .tab:selected SVGPath, .tab-pane .tab:selected:hover SVGPath{
-fx-fill: #141414; -fx-fill: #ebebeb;
} }
.tab-pane .tab:hover SVGPath{ .tab-pane .tab:hover SVGPath{
-fx-fill: #2b2b2b; -fx-fill: #2b2b2b;
} }
/*
.tab-pane .tab{ .tab-pane .tab{
-fx-background-color: #fefefe; -fx-background-color: #fefefe;
-fx-focus-color: transparent; -fx-focus-color: transparent;
@ -225,9 +226,22 @@
-fx-faint-focus-color: transparent; -fx-faint-focus-color: transparent;
-fx-border-radius: 0 0 0 0; -fx-border-radius: 0 0 0 0;
-fx-border-width: 0 0 3 0; -fx-border-width: 0 0 3 0;
-fx-border-color: #40b9bb; /* #289de8; */ -fx-border-color: #40b9bb;
}
*/
.tab-pane .tab{
-fx-background-color: #fefefe;
-fx-background-radius: 2;
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
} }
.tab-pane .tab:selected{
-fx-background-color: #40b9bb;
-fx-background-radius: 2;
-fx-focus-color: transparent;
-fx-faint-focus-color: transparent;
}
.tab-pane > .tab-header-area { .tab-pane > .tab-header-area {
-fx-background-insets: 0.0; -fx-background-insets: 0.0;
-fx-padding: 5 5 5 5; -fx-padding: 5 5 5 5;