Skip to content

Commit

Permalink
Update dependencies + fix UI bugs
Browse files Browse the repository at this point in the history
Increased version to v2024.11.10

Signed-off-by: Pavol Sakac <[email protected]>
  • Loading branch information
pavsa committed Nov 10, 2024
1 parent 98bbc09 commit 19004c2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 35 deletions.
16 changes: 9 additions & 7 deletions src/hackrf-sweep/.classpath
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-18">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry kind="lib" path="lib/jcommon-1.0.17.jar"/>
<classpathentry kind="lib" path="lib/jfreechart-1.0.14.jar"/>
<classpathentry kind="lib" path="lib/hackrf-sweep-jna.jar"/>
<classpathentry kind="lib" path="lib/jna/jna-5.13.0.jar"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
Expand All @@ -32,6 +26,14 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
Expand Down
4 changes: 2 additions & 2 deletions src/hackrf-sweep/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.PE64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_PE64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
Expand Down Expand Up @@ -149,4 +149,4 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>
</cproject>
Binary file removed src/hackrf-sweep/miglayout-src.zip
Binary file not shown.
Binary file removed src/hackrf-sweep/miglayout15-swing.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions src/hackrf-sweep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.0</version>
<version>11.4.2</version>
</dependency>
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.19</version>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
<version>5.15.0</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
import org.jfree.data.Range;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.jfree.ui.Align;
import org.jfree.ui.HorizontalAlignment;
import org.jfree.ui.RectangleAnchor;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.RectangleInsets;
import org.jfree.ui.TextAnchor;
import org.jfree.chart.ui.Align;
import org.jfree.chart.ui.HorizontalAlignment;
import org.jfree.chart.ui.RectangleAnchor;
import org.jfree.chart.ui.RectangleEdge;
import org.jfree.chart.ui.RectangleInsets;
import org.jfree.chart.ui.TextAnchor;

import jspectrumanalyzer.capture.ScreenCapture;
import jspectrumanalyzer.core.DatasetSpectrumPeak;
Expand Down Expand Up @@ -791,8 +791,8 @@ private void setupChart() {
NumberAxis domainAxis = ((NumberAxis) plot.getDomainAxis());
NumberAxis rangeAxis = ((NumberAxis) plot.getRangeAxis());
chartLineRenderer = new XYLineAndShapeRenderer();
chartLineRenderer.setBaseShapesVisible(false);
chartLineRenderer.setBaseStroke(new BasicStroke(parameterSpectrumLineThickness.getValue().floatValue()));
chartLineRenderer.setDefaultShapesVisible(false);
chartLineRenderer.setDefaultStroke(new BasicStroke(parameterSpectrumLineThickness.getValue().floatValue()));

rangeAxis.setAutoRange(false);
rangeAxis.setRange(-110, 20);
Expand Down Expand Up @@ -848,7 +848,7 @@ public void chartProgress(ChartProgressEvent event) {
domainAxis.setTickLabelFont(labelFont);
domainAxis.setLabelPaint(colors.palette1);
domainAxis.setTickLabelPaint(colors.palette1);
chartLineRenderer.setBasePaint(Color.white);
chartLineRenderer.setDefaultPaint(Color.white);
plot.setBackgroundPaint(colors.palette4);
chart.setBackgroundPaint(colors.palette4);
chartLineRenderer.setSeriesPaint(1, colors.palette1);
Expand Down Expand Up @@ -1109,7 +1109,7 @@ private void setupParameterObservers() {
});

parameterSpectrumLineThickness.addListener((thickness) -> {
SwingUtilities.invokeLater(() -> chartLineRenderer.setBaseStroke(new BasicStroke(thickness.floatValue())));
SwingUtilities.invokeLater(() -> chartLineRenderer.setDefaultStroke(new BasicStroke(thickness.floatValue())));
});

parameterPersistentDisplayPersTime.addListener((time) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public class Version
{
public static final String version = "v2024.02.1";
public static final String version = "v2024.11.10";
public static final String url = "https://github.com/pavsa/hackrf-spectrum-analyzer";
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
int maxFreq = 7250;
int freqStep = 1;

JPanel panelMainSettings = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][::0px][][]"));
JPanel panelMainSettings = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][::0px][][][][]"));
panelMainSettings.setBorder(new EmptyBorder(UIManager.getInsets("TabbedPane.tabAreaInsets")));;
panelMainSettings.setBackground(Color.BLACK);

JLabel lblNewLabel = new JLabel("Frequency start [MHz]");
lblNewLabel.setForeground(Color.WHITE);
panelMainSettings.add(lblNewLabel, "cell 0 0,growx,aligny center");
Expand All @@ -123,24 +124,22 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
txtHackrfConnected.setText("HackRF disconnected");
txtHackrfConnected.setForeground(Color.WHITE);
txtHackrfConnected.setBackground(Color.BLACK);
panelMainSettings.add(txtHackrfConnected, "cell 0 23,growx");
txtHackrfConnected.setBorder(null);
panelMainSettings.add(txtHackrfConnected, "cell 0 5,growx");

btnPause = new JButton("Pause");
panelMainSettings.add(btnPause, "cell 0 25,growx");
btnPause.setBackground(Color.black);
panelMainSettings.add(btnPause, "cell 0 6,growx");




JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
setLayout(new BorderLayout());
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
add(panelMainSettings, BorderLayout.NORTH);
add(tabbedPane, BorderLayout.CENTER);
tabbedPane.setForeground(Color.WHITE);
tabbedPane.setBackground(Color.BLACK);

JPanel tab1 = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][0][][][0][][][0][][][0][][][0][][0][][grow,fill]"));
JPanel tab1 = new JPanel(new MigLayout("", "[123.00px,grow,leading]", "[][][0][][][0][][][0][][][0][][][0][][0][][][][grow,fill]"));
tab1.setForeground(Color.WHITE);
tab1.setBackground(Color.BLACK);

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

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

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


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


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


JButton btnAbout = new JButton("Visit homepage");
btnAbout.addActionListener(e -> {
if (Desktop.isDesktopSupported()) {
Expand Down Expand Up @@ -362,7 +362,7 @@ public HackRFSweepSettingsUI(HackRFSettings hackRFSettings)
tab2.add(checkBoxWaterfallEnabled, "cell 0 0,alignx right");

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

Expand Down

0 comments on commit 19004c2

Please sign in to comment.