mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
* #6 DMR decoder feature - work in progress * #6 DMR Decoder. * #6 DMR Decoder. Code review updates. Co-authored-by: Zhenyu Mao <maozhenyu@foxmail.com> Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
@@ -24,7 +24,6 @@ import io.github.dsheirer.gui.preference.directory.DirectoryPreferenceEditor;
|
||||
import io.github.dsheirer.gui.preference.duplicate.DuplicateCallPreferenceEditor;
|
||||
import io.github.dsheirer.gui.preference.playback.PlaybackPreferenceEditor;
|
||||
import io.github.dsheirer.gui.preference.record.RecordPreferenceEditor;
|
||||
import io.github.dsheirer.gui.preference.tuner.ChannelMultipleFrequencyPreferenceEditor;
|
||||
import io.github.dsheirer.gui.preference.tuner.TunerPreferenceEditor;
|
||||
import io.github.dsheirer.preference.UserPreferences;
|
||||
import javafx.scene.Node;
|
||||
@@ -50,8 +49,6 @@ public class PreferenceEditorFactory
|
||||
return new DirectoryPreferenceEditor(userPreferences);
|
||||
case JMBE_LIBRARY:
|
||||
return new JmbeLibraryPreferenceEditor(userPreferences);
|
||||
case SOURCE_CHANNEL_MULTIPLE_FREQUENCY:
|
||||
return new ChannelMultipleFrequencyPreferenceEditor(userPreferences);
|
||||
case SOURCE_TUNER_CHANNELIZER:
|
||||
return new TunerPreferenceEditor(userPreferences);
|
||||
case TALKGROUP_FORMAT:
|
||||
|
||||
@@ -30,7 +30,6 @@ public enum PreferenceEditorType
|
||||
AUDIO_RECORD("Record"),
|
||||
AUDIO_OUTPUT("Output/Tones"),
|
||||
AUDIO_DUPLICATE_CALL_DETECTION("Duplicate Calls"),
|
||||
SOURCE_CHANNEL_MULTIPLE_FREQUENCY("Channel - Multiple Frequency"),
|
||||
SOURCE_TUNER_CHANNELIZER("Tuner Channelizer"),
|
||||
TALKGROUP_FORMAT("Talkgroup & Radio ID"),
|
||||
DEFAULT("Default");
|
||||
|
||||
@@ -190,7 +190,6 @@ public class UserPreferencesEditor extends BorderPane
|
||||
storageItem.setExpanded(true);
|
||||
|
||||
TreeItem<String> sourceItem = new TreeItem<>("Source");
|
||||
sourceItem.getChildren().add(new TreeItem(PreferenceEditorType.SOURCE_CHANNEL_MULTIPLE_FREQUENCY));
|
||||
sourceItem.getChildren().add(new TreeItem(PreferenceEditorType.SOURCE_TUNER_CHANNELIZER));
|
||||
treeRoot.getChildren().add(sourceItem);
|
||||
sourceItem.setExpanded(true);
|
||||
@@ -247,7 +246,7 @@ public class UserPreferencesEditor extends BorderPane
|
||||
|
||||
Menu viewMenu = new Menu("View");
|
||||
MenuItem playlistEditorItem = new MenuItem("Playlist Editor");
|
||||
playlistEditorItem.setOnAction(event -> MyEventBus.getEventBus().post(new ViewPlaylistRequest()));
|
||||
playlistEditorItem.setOnAction(event -> MyEventBus.getGlobalEventBus().post(new ViewPlaylistRequest()));
|
||||
viewMenu.getItems().add(playlistEditorItem);
|
||||
mMenuBar.getMenus().add(viewMenu);
|
||||
}
|
||||
|
||||
@@ -82,13 +82,18 @@ public class JmbeLibraryPreferenceEditor extends VBox
|
||||
mUserPreferences = userPreferences;
|
||||
|
||||
//Register to receive directory preference update notifications so we can update the path labels
|
||||
MyEventBus.getEventBus().register(this);
|
||||
MyEventBus.getGlobalEventBus().register(this);
|
||||
|
||||
setPadding(new Insets(10,10,10,10));
|
||||
setSpacing(10);
|
||||
getChildren().addAll(getEditorPane(), getButtonsBox(), getAlertUserWhenMissingCheckBox());
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
MyEventBus.getGlobalEventBus().unregister(this);
|
||||
}
|
||||
|
||||
private CheckBox getAlertUserWhenMissingCheckBox()
|
||||
{
|
||||
if(mAlertUserWhenMissingCheckBox == null)
|
||||
@@ -214,7 +219,7 @@ public class JmbeLibraryPreferenceEditor extends VBox
|
||||
if(buttonType == ButtonType.YES)
|
||||
{
|
||||
mLog.info("Posting JMBE editor request to event bus");
|
||||
MyEventBus.getEventBus().post(new JmbeEditorRequest(release));
|
||||
MyEventBus.getGlobalEventBus().post(new JmbeEditorRequest(release));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,12 +98,17 @@ public class DirectoryPreferenceEditor extends HBox
|
||||
mDirectoryPreference = userPreferences.getDirectoryPreference();
|
||||
|
||||
//Register to receive directory preference update notifications so we can update the path labels
|
||||
MyEventBus.getEventBus().register(this);
|
||||
MyEventBus.getGlobalEventBus().register(this);
|
||||
|
||||
HBox.setHgrow(getEditorPane(), Priority.ALWAYS);
|
||||
getChildren().add(getEditorPane());
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
MyEventBus.getGlobalEventBus().unregister(this);
|
||||
}
|
||||
|
||||
private GridPane getEditorPane()
|
||||
{
|
||||
if(mEditorPane == null)
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2019 Dennis Sheirer
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>
|
||||
* *****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.gui.preference.tuner;
|
||||
|
||||
import io.github.dsheirer.preference.UserPreferences;
|
||||
import io.github.dsheirer.preference.source.ChannelMultiFrequencyPreference;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Spinner;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
|
||||
|
||||
/**
|
||||
* Preference settings for channel source configurations containing multiple frequencies
|
||||
*/
|
||||
public class ChannelMultipleFrequencyPreferenceEditor extends HBox
|
||||
{
|
||||
private static final String HELP_TEXT = "Rotation delay determines how long a decoder will wait before rotating " +
|
||||
"to the next frequency in a list for a rotating control channel configuration.";
|
||||
|
||||
private static final Insets MARGINS = new Insets(5,5,5,5);
|
||||
private ChannelMultiFrequencyPreference mChannelMultiFrequencyPreference;
|
||||
private GridPane mEditorPane;
|
||||
private Label mRotationDelayLabel;
|
||||
private Spinner<Integer> mRotationDelaySpinner;
|
||||
private Button mResetButton;
|
||||
private Label mHelpText;
|
||||
|
||||
public ChannelMultipleFrequencyPreferenceEditor(UserPreferences userPreferences)
|
||||
{
|
||||
mChannelMultiFrequencyPreference = userPreferences.getChannelMultiFrequencyPreference();
|
||||
getChildren().add(getEditorPane());
|
||||
}
|
||||
|
||||
private GridPane getEditorPane()
|
||||
{
|
||||
if(mEditorPane == null)
|
||||
{
|
||||
mEditorPane = new GridPane();
|
||||
GridPane.setMargin(getRotationDelaySpinner(), new Insets(5, 5, 5, 5));
|
||||
mEditorPane.add(getRotationDelaySpinner(), 0, 0);
|
||||
GridPane.setMargin(getRotationDelayLabel(), new Insets(5, 5, 5, 5));
|
||||
mEditorPane.add(getRotationDelayLabel(), 1, 0);
|
||||
GridPane.setMargin(getResetButton(), MARGINS);
|
||||
mEditorPane.add(getResetButton(), 2, 0);
|
||||
GridPane.setMargin(getHelpText(), MARGINS);
|
||||
mEditorPane.add(getHelpText(), 0, 1, 3, 1);
|
||||
}
|
||||
|
||||
return mEditorPane;
|
||||
}
|
||||
|
||||
public Spinner<Integer> getRotationDelaySpinner()
|
||||
{
|
||||
if(mRotationDelaySpinner == null)
|
||||
{
|
||||
int currentDelay = (int)(mChannelMultiFrequencyPreference.getRotationDelay() / 1000);
|
||||
mRotationDelaySpinner = new Spinner<>(1, 60, currentDelay, 1);
|
||||
mRotationDelaySpinner.setEditable(true);
|
||||
mRotationDelaySpinner.valueProperty().addListener((observable, oldValue, newValue) -> {
|
||||
mChannelMultiFrequencyPreference.setRotationDelay(newValue * 1000);
|
||||
});
|
||||
}
|
||||
|
||||
return mRotationDelaySpinner;
|
||||
}
|
||||
|
||||
public Label getRotationDelayLabel()
|
||||
{
|
||||
if(mRotationDelayLabel == null)
|
||||
{
|
||||
mRotationDelayLabel = new Label("Rotation Delay (seconds)");
|
||||
}
|
||||
|
||||
return mRotationDelayLabel;
|
||||
}
|
||||
|
||||
public Button getResetButton()
|
||||
{
|
||||
if(mResetButton == null)
|
||||
{
|
||||
mResetButton = new Button("Reset");
|
||||
mResetButton.setOnAction(event -> {
|
||||
mChannelMultiFrequencyPreference.resetRotationDelay();
|
||||
int currentDelay = (int)(mChannelMultiFrequencyPreference.getRotationDelay() / 1000);
|
||||
getRotationDelaySpinner().getValueFactory().setValue(currentDelay);
|
||||
});
|
||||
}
|
||||
|
||||
return mResetButton;
|
||||
}
|
||||
|
||||
public Label getHelpText()
|
||||
{
|
||||
if(mHelpText == null)
|
||||
{
|
||||
mHelpText = new Label(HELP_TEXT);
|
||||
mHelpText.setWrapText(true);
|
||||
}
|
||||
|
||||
return mHelpText;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user