extra option

This commit is contained in:
sirjonasxx 2021-04-25 23:54:22 +02:00
parent da35c41524
commit bcc428408a
2 changed files with 8 additions and 3 deletions

View File

@ -43,15 +43,17 @@ public class UiLoggerController implements Initializable {
public CheckMenuItem chkHideOnDisconnect; public CheckMenuItem chkHideOnDisconnect;
public CheckMenuItem chkResetOnDisconnect; public CheckMenuItem chkResetOnDisconnect;
private final static int FILTER_AMOUNT_THRESHOLD_S = 15; private final static int FILTER_AMOUNT_THRESHOLD_L = 15;
private final static int FILTER_AMOUNT_THRESHOLD_M = 9; private final static int FILTER_AMOUNT_THRESHOLD_M = 9;
private final static int FILTER_AMOUNT_THRESHOLD_H = 4; private final static int FILTER_AMOUNT_THRESHOLD_H = 4;
private final static int FILTER_AMOUNT_THRESHOLD_U = 2;
private final static int FILTER_TIME_THRESHOLD = 5000; private final static int FILTER_TIME_THRESHOLD = 5000;
public RadioMenuItem chkAntiSpam_none; public RadioMenuItem chkAntiSpam_none;
public RadioMenuItem chkAntiSpam_low; public RadioMenuItem chkAntiSpam_low;
public RadioMenuItem chkAntiSpam_medium; public RadioMenuItem chkAntiSpam_medium;
public RadioMenuItem chkAntiSpam_high; public RadioMenuItem chkAntiSpam_high;
public RadioMenuItem chkAntiSpam_ultra;
private Map<Integer, LinkedList<Long>> filterTimestamps = new HashMap<>(); private Map<Integer, LinkedList<Long>> filterTimestamps = new HashMap<>();
@ -108,8 +110,10 @@ public class UiLoggerController implements Initializable {
int headerId = packet.headerId(); int headerId = packet.headerId();
int threshold = chkAntiSpam_none.isSelected() ? 100000000 : ( int threshold = chkAntiSpam_none.isSelected() ? 100000000 : (
chkAntiSpam_low.isSelected() ? FILTER_AMOUNT_THRESHOLD_S : ( chkAntiSpam_low.isSelected() ? FILTER_AMOUNT_THRESHOLD_L : (
chkAntiSpam_medium.isSelected() ? FILTER_AMOUNT_THRESHOLD_M : FILTER_AMOUNT_THRESHOLD_H chkAntiSpam_medium.isSelected() ? FILTER_AMOUNT_THRESHOLD_M : (
chkAntiSpam_high.isSelected() ? FILTER_AMOUNT_THRESHOLD_H : FILTER_AMOUNT_THRESHOLD_U
)
) )
); );

View File

@ -60,6 +60,7 @@
<RadioMenuItem fx:id="chkAntiSpam_low" mnemonicParsing="false" text="Low" toggleGroup="$antispam" /> <RadioMenuItem fx:id="chkAntiSpam_low" mnemonicParsing="false" text="Low" toggleGroup="$antispam" />
<RadioMenuItem fx:id="chkAntiSpam_medium" mnemonicParsing="false" text="Medium" toggleGroup="$antispam" /> <RadioMenuItem fx:id="chkAntiSpam_medium" mnemonicParsing="false" text="Medium" toggleGroup="$antispam" />
<RadioMenuItem fx:id="chkAntiSpam_high" mnemonicParsing="false" text="High" toggleGroup="$antispam" /> <RadioMenuItem fx:id="chkAntiSpam_high" mnemonicParsing="false" text="High" toggleGroup="$antispam" />
<RadioMenuItem fx:id="chkAntiSpam_ultra" mnemonicParsing="false" text="Ultra" toggleGroup="$antispam" />
</items> </items>
</Menu> </Menu>
<CheckMenuItem fx:id="chkSkipBigPackets" mnemonicParsing="false" onAction="#toggleSkipPackets" selected="true" text="Skip big packets" /> <CheckMenuItem fx:id="chkSkipBigPackets" mnemonicParsing="false" onAction="#toggleSkipPackets" selected="true" text="Skip big packets" />