Skip to content

Commit 19004c2

Browse files
committed
Update dependencies + fix UI bugs
Increased version to v2024.11.10 Signed-off-by: Pavol Sakac <[email protected]>
1 parent 98bbc09 commit 19004c2

File tree

8 files changed

+37
-35
lines changed

8 files changed

+37
-35
lines changed

src/hackrf-sweep/.classpath

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-18">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
44
<attributes>
5-
<attribute name="module" value="true"/>
65
<attribute name="maven.pomderived" value="true"/>
76
</attributes>
87
</classpathentry>
9-
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
10-
<classpathentry kind="lib" path="lib/jcommon-1.0.17.jar"/>
11-
<classpathentry kind="lib" path="lib/jfreechart-1.0.14.jar"/>
12-
<classpathentry kind="lib" path="lib/hackrf-sweep-jna.jar"/>
13-
<classpathentry kind="lib" path="lib/jna/jna-5.13.0.jar"/>
148
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
159
<attributes>
1610
<attribute name="test" value="true"/>
@@ -32,6 +26,14 @@
3226
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
3327
<attributes>
3428
<attribute name="maven.pomderived" value="true"/>
29+
<attribute name="optional" value="true"/>
30+
</attributes>
31+
</classpathentry>
32+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
33+
<attributes>
34+
<attribute name="test" value="true"/>
35+
<attribute name="maven.pomderived" value="true"/>
36+
<attribute name="optional" value="true"/>
3537
</attributes>
3638
</classpathentry>
3739
<classpathentry kind="output" path="target/classes"/>

src/hackrf-sweep/.cproject

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</externalSetting>
7272
</externalSettings>
7373
<extensions>
74-
<extension id="org.eclipse.cdt.core.PE64" point="org.eclipse.cdt.core.BinaryParser"/>
74+
<extension id="org.eclipse.cdt.core.GNU_PE64" point="org.eclipse.cdt.core.BinaryParser"/>
7575
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
7676
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
7777
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
@@ -149,4 +149,4 @@
149149
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
150150
</scannerConfigBuildInfo>
151151
</storageModule>
152-
</cproject>
152+
</cproject>

src/hackrf-sweep/miglayout-src.zip

-181 KB
Binary file not shown.
-83.7 KB
Binary file not shown.

src/hackrf-sweep/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
<dependency>
1111
<groupId>com.miglayout</groupId>
1212
<artifactId>miglayout-swing</artifactId>
13-
<version>5.0</version>
13+
<version>11.4.2</version>
1414
</dependency>
1515
<dependency>
1616
<groupId>org.jfree</groupId>
1717
<artifactId>jfreechart</artifactId>
18-
<version>1.0.19</version>
18+
<version>1.5.5</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>net.java.dev.jna</groupId>
2222
<artifactId>jna</artifactId>
23-
<version>5.13.0</version>
23+
<version>5.15.0</version>
2424
</dependency>
2525
</dependencies>
2626
<build>

src/hackrf-sweep/src/main/java/jspectrumanalyzer/HackRFSweepSpectrumAnalyzer.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
import org.jfree.data.Range;
6060
import org.jfree.data.xy.XYSeries;
6161
import org.jfree.data.xy.XYSeriesCollection;
62-
import org.jfree.ui.Align;
63-
import org.jfree.ui.HorizontalAlignment;
64-
import org.jfree.ui.RectangleAnchor;
65-
import org.jfree.ui.RectangleEdge;
66-
import org.jfree.ui.RectangleInsets;
67-
import org.jfree.ui.TextAnchor;
62+
import org.jfree.chart.ui.Align;
63+
import org.jfree.chart.ui.HorizontalAlignment;
64+
import org.jfree.chart.ui.RectangleAnchor;
65+
import org.jfree.chart.ui.RectangleEdge;
66+
import org.jfree.chart.ui.RectangleInsets;
67+
import org.jfree.chart.ui.TextAnchor;
6868

6969
import jspectrumanalyzer.capture.ScreenCapture;
7070
import jspectrumanalyzer.core.DatasetSpectrumPeak;
@@ -791,8 +791,8 @@ private void setupChart() {
791791
NumberAxis domainAxis = ((NumberAxis) plot.getDomainAxis());
792792
NumberAxis rangeAxis = ((NumberAxis) plot.getRangeAxis());
793793
chartLineRenderer = new XYLineAndShapeRenderer();
794-
chartLineRenderer.setBaseShapesVisible(false);
795-
chartLineRenderer.setBaseStroke(new BasicStroke(parameterSpectrumLineThickness.getValue().floatValue()));
794+
chartLineRenderer.setDefaultShapesVisible(false);
795+
chartLineRenderer.setDefaultStroke(new BasicStroke(parameterSpectrumLineThickness.getValue().floatValue()));
796796

797797
rangeAxis.setAutoRange(false);
798798
rangeAxis.setRange(-110, 20);
@@ -848,7 +848,7 @@ public void chartProgress(ChartProgressEvent event) {
848848
domainAxis.setTickLabelFont(labelFont);
849849
domainAxis.setLabelPaint(colors.palette1);
850850
domainAxis.setTickLabelPaint(colors.palette1);
851-
chartLineRenderer.setBasePaint(Color.white);
851+
chartLineRenderer.setDefaultPaint(Color.white);
852852
plot.setBackgroundPaint(colors.palette4);
853853
chart.setBackgroundPaint(colors.palette4);
854854
chartLineRenderer.setSeriesPaint(1, colors.palette1);
@@ -1109,7 +1109,7 @@ private void setupParameterObservers() {
11091109
});
11101110

11111111
parameterSpectrumLineThickness.addListener((thickness) -> {
1112-
SwingUtilities.invokeLater(() -> chartLineRenderer.setBaseStroke(new BasicStroke(thickness.floatValue())));
1112+
SwingUtilities.invokeLater(() -> chartLineRenderer.setDefaultStroke(new BasicStroke(thickness.floatValue())));
11131113
});
11141114

11151115
parameterPersistentDisplayPersTime.addListener((time) -> {

src/hackrf-sweep/src/main/java/jspectrumanalyzer/Version.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
public class Version
44
{
5-
public static final String version = "v2024.02.1";
5+
public static final String version = "v2024.11.10";
66
public static final String url = "https://github.com/pavsa/hackrf-spectrum-analyzer";
77
}

src/hackrf-sweep/src/main/java/jspectrumanalyzer/ui/HackRFSweepSettingsUI.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
101101
int maxFreq = 7250;
102102
int freqStep = 1;
103103

104-
JPanel panelMainSettings = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][::0px][][]"));
104+
JPanel panelMainSettings = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][::0px][][][][]"));
105105
panelMainSettings.setBorder(new EmptyBorder(UIManager.getInsets("TabbedPane.tabAreaInsets")));;
106106
panelMainSettings.setBackground(Color.BLACK);
107+
107108
JLabel lblNewLabel = new JLabel("Frequency start [MHz]");
108109
lblNewLabel.setForeground(Color.WHITE);
109110
panelMainSettings.add(lblNewLabel, "cell 0 0,growx,aligny center");
@@ -123,24 +124,22 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
123124
txtHackrfConnected.setText("HackRF disconnected");
124125
txtHackrfConnected.setForeground(Color.WHITE);
125126
txtHackrfConnected.setBackground(Color.BLACK);
126-
panelMainSettings.add(txtHackrfConnected, "cell 0 23,growx");
127127
txtHackrfConnected.setBorder(null);
128+
panelMainSettings.add(txtHackrfConnected, "cell 0 5,growx");
128129

129130
btnPause = new JButton("Pause");
130-
panelMainSettings.add(btnPause, "cell 0 25,growx");
131131
btnPause.setBackground(Color.black);
132+
panelMainSettings.add(btnPause, "cell 0 6,growx");
132133

133134

134-
135-
136-
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
137135
setLayout(new BorderLayout());
136+
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
138137
add(panelMainSettings, BorderLayout.NORTH);
139138
add(tabbedPane, BorderLayout.CENTER);
140139
tabbedPane.setForeground(Color.WHITE);
141140
tabbedPane.setBackground(Color.BLACK);
142141

143-
JPanel tab1 = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][0][][][0][][][0][][][0][][][0][][0][][grow,fill]"));
142+
JPanel tab1 = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][0][][][0][][][0][][][0][][][0][][0][][][][grow,fill]"));
144143
tab1.setForeground(Color.WHITE);
145144
tab1.setBackground(Color.BLACK);
146145

@@ -168,7 +167,7 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
168167
sliderGain.setForeground(Color.WHITE);
169168
tab1.add(sliderGain, "flowy,cell 0 1,growx");
170169

171-
JLabel lbl_gainValue = new JLabel(hackRFSettings.getGain() + "dB");
170+
JLabel lbl_gainValue = new JLabel(hRF == null ? "0" : hRF.getGain() + "dB");
172171
lbl_gainValue.setForeground(Color.WHITE);
173172
tab1.add(lbl_gainValue, "cell 0 1,alignx right");
174173

@@ -217,8 +216,10 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
217216
((ListEditor) spinnerFFTBinHz.getEditor()).getTextField().setHorizontalAlignment(JTextField.RIGHT);
218217

219218

220-
hackRFSettings.getGain().addListener((gain) -> lbl_gainValue.setText(String.format(" %ddB [LNA: %ddB VGA: %ddB]",
221-
gain, hackRFSettings.getGainLNA().getValue(), hackRFSettings.getGainVGA().getValue())));
219+
if (hRF != null) {
220+
hRF.getGain().addListener((gain) -> lbl_gainValue.setText(String.format(" %ddB [LNA: %ddB VGA: %ddB]",
221+
gain, hRF.getGainLNA().getValue(), hRF.getGainVGA().getValue())));
222+
}
222223

223224

224225
JLabel lblNumberOfSamples = new JLabel("Number of samples");
@@ -246,7 +247,6 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
246247
Label labelVersion = new Label("Version: "+Version.version);
247248
tab1.add(labelVersion, "flowx,cell 0 17");
248249

249-
250250
JButton btnAbout = new JButton("Visit homepage");
251251
btnAbout.addActionListener(e -> {
252252
if (Desktop.isDesktopSupported()) {
@@ -362,7 +362,7 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
362362
tab2.add(checkBoxWaterfallEnabled, "cell 0 0,alignx right");
363363

364364
comboBoxDecayRate = new JComboBox(
365-
new Vector<>(IntStream.rangeClosed(hRF.getPersistentDisplayDecayRate().getMin(), hRF.getPersistentDisplayDecayRate().getMax()).
365+
new Vector<>(IntStream.rangeClosed(hRF != null ? hRF.getPersistentDisplayDecayRate().getMin() : 0, hRF != null ? hRF.getPersistentDisplayDecayRate().getMax() : 1).
366366
boxed().collect(Collectors.toList())));
367367
tab2.add(comboBoxDecayRate, "cell 0 16,alignx right");
368368

0 commit comments

Comments
 (0)