diff --git a/src/ch/unizh/ini/jaer/chip/retina/DVS128.java b/src/ch/unizh/ini/jaer/chip/retina/DVS128.java index e3d17182f..251e2d25c 100644 --- a/src/ch/unizh/ini/jaer/chip/retina/DVS128.java +++ b/src/ch/unizh/ini/jaer/chip/retina/DVS128.java @@ -734,7 +734,7 @@ public void setBandwidthTweak(float val) { } bandwidth = val; final float MAX = 300; -// pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); + pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); sf.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); getSupport().firePropertyChange(DVSTweaks.BANDWIDTH, old, val); } diff --git a/src/ch/unizh/ini/jaer/chip/retina/DVS128andCochleaAMS1b.java b/src/ch/unizh/ini/jaer/chip/retina/DVS128andCochleaAMS1b.java index 49763c5e3..4bf9289f0 100644 --- a/src/ch/unizh/ini/jaer/chip/retina/DVS128andCochleaAMS1b.java +++ b/src/ch/unizh/ini/jaer/chip/retina/DVS128andCochleaAMS1b.java @@ -513,7 +513,7 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { public void setBandwidthTweak(float val) { final float MAX = 300; -// pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); + pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); sf.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX)); } diff --git a/src/ch/unizh/ini/jaer/chip/retina/DVSTweaks.java b/src/ch/unizh/ini/jaer/chip/retina/DVSTweaks.java index 6772b1954..a7dff6b22 100644 --- a/src/ch/unizh/ini/jaer/chip/retina/DVSTweaks.java +++ b/src/ch/unizh/ini/jaer/chip/retina/DVSTweaks.java @@ -26,12 +26,6 @@ public interface DVSTweaks { /** * Tweaks front end bandwidth, larger is higher bandwidth. - * - * Adjust the source follower bandwidth by changing PRSf bias current. - * - *
For minimum shot noise under low illumination, the photoreceptor bias should be large and
- * the bandwidth should be limited by the source follower buffer.
- * See Optimal biasing and physical limits of DVS event noise.
*
* @param val -1 to 1 range
*/
diff --git a/src/eu/seebetter/ini/chips/davis/DavisConfig.java b/src/eu/seebetter/ini/chips/davis/DavisConfig.java
index 48bd61204..2cb9f450b 100644
--- a/src/eu/seebetter/ini/chips/davis/DavisConfig.java
+++ b/src/eu/seebetter/ini/chips/davis/DavisConfig.java
@@ -29,7 +29,6 @@
import eu.seebetter.ini.chips.davis.imu.ImuAccelScale;
import eu.seebetter.ini.chips.davis.imu.ImuControl;
import eu.seebetter.ini.chips.davis.imu.ImuControlPanel;
-import javax.swing.UIManager;
import net.sf.jaer.biasgen.AddressedIPotArray;
import net.sf.jaer.biasgen.Biasgen;
import net.sf.jaer.biasgen.BiasgenHardwareInterface;
@@ -84,9 +83,7 @@ public class DavisConfig extends Biasgen implements DavisDisplayConfigInterface,
// subclasses for controlling aspects of camera
protected DavisConfig.VideoControl videoControl;
protected ImuControl imuControlGUI;
- EngineeringFormat eng = new EngineeringFormat();
-
- private boolean dualUserFriendlyAndBiasCurrentsViewEnabled = false;
+ EngineeringFormat eng=new EngineeringFormat();
public DavisConfig(final Chip chip) {
super(chip);
@@ -408,10 +405,9 @@ public String processRemoteControlCommand(final RemoteControlCommand command, fi
}
private ParameterControlPanel videoParameterControlPanel;
- private JPanel userFriendlyControls, combinedBiasShiftedSourcePanel;
+ private JPanel userFriendlyControls;
private JPanel configPanel;
private JTabbedPane configTabbedPane;
- private JPanel dualViewPanel;
// threshold for triggering a new frame snapshot automatically
private int autoShotThreshold;
@@ -436,44 +432,12 @@ public JPanel buildControlPanel() {
configPanel = new JPanel();
configPanel.setLayout(new BorderLayout());
- makeConfigTabbedPane();
-
- // only select panel after all added
- configPanel.add(configTabbedPane, BorderLayout.CENTER);
-
- setBatchEditOccurring(false);
- return configPanel;
- }
-
- /**
- * Sets dual view of user friendly and bias currents
- */
- void setDualView(boolean selected) {
- if (selected) {
- makeDualViewPanel();
- configPanel.removeAll();
- configPanel.add(dualViewPanel, BorderLayout.CENTER);
- } else {
- makeConfigTabbedPane();
- configPanel.removeAll();
- configPanel.add(configTabbedPane, BorderLayout.CENTER);
- }
- configPanel.validate();
- }
-
- private void makeDualViewPanel() {
- dualViewPanel = new JPanel();
- dualViewPanel.setLayout(new BorderLayout());
- dualViewPanel.add(userFriendlyControls, BorderLayout.WEST); // removes it from configTabbedPane
- dualViewPanel.add(combinedBiasShiftedSourcePanel, BorderLayout.EAST); // removes it from configTabbedPane
- }
-
- private void makeConfigTabbedPane() {
configTabbedPane = new JTabbedPane();
userFriendlyControls = new DavisUserControlPanel(getChip());
configTabbedPane.addTab("User-Friendly Controls", userFriendlyControls);
+
// biasgen
- combinedBiasShiftedSourcePanel = new JPanel();
+ final JPanel combinedBiasShiftedSourcePanel = new JPanel();
combinedBiasShiftedSourcePanel
.add(new JLabel("Low-level control of on-chip bias currents and voltages. These are only for experts!"));
combinedBiasShiftedSourcePanel.setLayout(new BoxLayout(combinedBiasShiftedSourcePanel, BoxLayout.Y_AXIS));
@@ -481,37 +445,44 @@ private void makeConfigTabbedPane() {
combinedBiasShiftedSourcePanel.add(new ShiftedSourceControlsCF(ssp));
combinedBiasShiftedSourcePanel.add(new ShiftedSourceControlsCF(ssn));
configTabbedPane.addTab("Bias Current Config", combinedBiasShiftedSourcePanel);
+
// Multiplexer
final JPanel muxPanel = new JPanel();
muxPanel.setLayout(new BoxLayout(muxPanel, BoxLayout.Y_AXIS));
configTabbedPane.addTab("Multiplexer Config", muxPanel);
SPIConfigValue.addGUIControls(muxPanel, muxControl);
+
// DVS
final JPanel dvsPanel = new JPanel();
dvsPanel.setLayout(new BoxLayout(dvsPanel, BoxLayout.Y_AXIS));
configTabbedPane.addTab("DVS Config", dvsPanel);
SPIConfigValue.addGUIControls(dvsPanel, dvsControl);
+
// APS
final JPanel apsPanel = new JPanel();
apsPanel.setLayout(new BoxLayout(apsPanel, BoxLayout.Y_AXIS));
configTabbedPane.addTab("APS Config", apsPanel);
SPIConfigValue.addGUIControls(apsPanel, apsControl);
+
// IMU
final JPanel imuControlPanel = new JPanel();
imuControlPanel.add(new JLabel("Low-level control of integrated inertial measurement unit."));
imuControlPanel.setLayout(new BoxLayout(imuControlPanel, BoxLayout.Y_AXIS));
imuControlPanel.add(new ImuControlPanel(this));
configTabbedPane.addTab("IMU Config", imuControlPanel);
+
// External Input
final JPanel extPanel = new JPanel();
extPanel.setLayout(new BoxLayout(extPanel, BoxLayout.Y_AXIS));
configTabbedPane.addTab("External Input Config", extPanel);
SPIConfigValue.addGUIControls(extPanel, extInControl);
+
// Chip config
final JPanel chipPanel = new JPanel();
chipPanel.setLayout(new BoxLayout(chipPanel, BoxLayout.Y_AXIS));
configTabbedPane.addTab("Chip Config", chipPanel);
SPIConfigValue.addGUIControls(chipPanel, chipControl);
+
// Autoexposure
if (getChip() instanceof DavisBaseCamera) {
final JPanel autoExposurePanel = new JPanel();
@@ -521,6 +492,7 @@ private void makeConfigTabbedPane() {
autoExposurePanel.add(new ParameterControlPanel(((DavisBaseCamera) getChip()).getAutoExposureController()));
configTabbedPane.addTab("APS Autoexposure Control", autoExposurePanel);
}
+
// Video Control
final JPanel videoControlPanel = new JPanel();
videoControlPanel.add(new JLabel("Controls display of APS video frame data"));
@@ -528,15 +500,19 @@ private void makeConfigTabbedPane() {
videoParameterControlPanel = new ParameterControlPanel(getVideoControl());
videoControlPanel.add(videoParameterControlPanel);
configTabbedPane.addTab("Video Control", videoControlPanel);
+
getVideoControl().addObserver(videoParameterControlPanel);
getVideoControl().getContrastContoller().addObserver(videoParameterControlPanel);
- // make special dual view panel for seeing effect of userFriendlyControls on bias currents
+ // only select panel after all added
+ configPanel.add(configTabbedPane, BorderLayout.CENTER);
+
try {
configTabbedPane.setSelectedIndex(getChip().getPrefs().getInt("DavisBaseCamera.bgTabbedPaneSelectedIndex", 0));
} catch (final IndexOutOfBoundsException e) {
configTabbedPane.setSelectedIndex(0);
}
+
// add listener to store last selected tab
configTabbedPane.addMouseListener(new MouseAdapter() {
@Override
@@ -544,6 +520,9 @@ public void mouseClicked(final MouseEvent evt) {
tabbedPaneMouseClicked(evt);
}
});
+
+ setBatchEditOccurring(false);
+ return configPanel;
}
@Override
@@ -674,7 +653,7 @@ public void setBandwidthTweak(float val) {
// log.info("tweak bandwidth by " + val);
bandwidth = val;
final float MAX = 30;
-// pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX));
+ pr.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX));
sf.changeByRatioFromPreferred(PotTweakerUtilities.getRatioTweak(val, MAX));
getChip().getSupport().firePropertyChange(DVSTweaks.BANDWIDTH, old, val);
}
@@ -978,7 +957,7 @@ public float getPhotoreceptorSourceFollowerBandwidthHz() {
// computed based on Davis240/346 C1=132fF and estimated SF bias current
float iSf = sf.getCurrent(), iPr = pr.getCurrent();
if (iSf > iPr * .5) {
- log.info(String.format("Source follower bias current (%sA) is larger than half of Photoreceptor bias current (%sA); cannot estimate cutoff frequency from SF current alone", eng.format(iSf), eng.format(iPr)));
+ log.info(String.format("Source follower bias current (%sA) is larger than half of Photoreceptor bias current (%sA); cannot estimate cutoff frequency from SF current alone",eng.format(iSf),eng.format(iPr)));
return Float.NaN;
}
// TODO note from IMU we have temperature, could account for it in thermal voltage
@@ -1312,19 +1291,4 @@ public static SPIConfigValue getConfigValueByName(final List Limited to changing fine current value. For more control, adjust these currents directly.");
+ bandwidthTweaker.setLessDescription("Slower");
+ bandwidthTweaker.setMinimumSize(new java.awt.Dimension(80, 30));
+ bandwidthTweaker.setMoreDescription("Faster");
+ bandwidthTweaker.setName("Adjusts pixel bandwidth"); // NOI18N
+ bandwidthTweaker.setPreferredSize(new java.awt.Dimension(250, 47));
+ bandwidthTweaker.setTweakDescription("");
+ bandwidthTweaker.addChangeListener(new javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ bandwidthTweakerStateChanged(evt);
+ }
+ });
bwEstLabel.setText("Estimated maximum pixel bandwidth");
bwEstLabel.setToolTipText(" Estimated DVS cutoff frequency based solely on source follower bias current. Does not account for finite photoreceptor bandwidth either from photoreceptor bias or low photocurrent.");
bwEstTF.setEditable(false);
bwEstTF.setColumns(12);
- bwEstTF.setToolTipText(" Estimated DVS cutoff frequency based solely on source follower bias current.\n Does not account for finite photoreceptor bandwidth either from photoreceptor bias or low photocurrent.\n Assumes source follower runs in subthreshold, so will only be valid for bias curreents below the specific current");
+ bwEstTF.setToolTipText(" Estimated DVS cutoff frequency based solely on source follower bias current. Does not account for finite photoreceptor bandwidth either from photoreceptor bias or low photocurrent.");
+ bwEstTF.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ bwEstTFActionPerformed(evt);
+ }
+ });
javax.swing.GroupLayout bwEstimatePanelLayout = new javax.swing.GroupLayout(bwEstimatePanel);
bwEstimatePanel.setLayout(bwEstimatePanelLayout);
bwEstimatePanelLayout.setHorizontalGroup(
bwEstimatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(bwEstimatePanelLayout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addContainerGap(147, Short.MAX_VALUE)
.addComponent(bwEstLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(bwEstTF, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(182, 182, 182))
+ .addComponent(bwEstTF, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(104, 104, 104))
);
bwEstimatePanelLayout.setVerticalGroup(
bwEstimatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -514,44 +528,36 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addContainerGap())
);
- bandwidthTweaker.setToolTipText("Adjust the source follower bandwidth by changing PRSf bias current.\n \nFor minimum shot noise under low illumination, the photoreceptor bias should be large and the bandwidth should be limited\nby the source follower buffer. See Optimal biasing and physical limits of DVS event noise. ");
- bandwidthTweaker.setLessDescription("Slower");
- bandwidthTweaker.setMinimumSize(new java.awt.Dimension(80, 30));
- bandwidthTweaker.setMoreDescription("Faster");
- bandwidthTweaker.setName("Adjusts maximum photoreceptor bandwidth"); // NOI18N
- bandwidthTweaker.setPreferredSize(new java.awt.Dimension(250, 47));
- bandwidthTweaker.setTweakDescription("");
- bandwidthTweaker.addChangeListener(new javax.swing.event.ChangeListener() {
- public void stateChanged(javax.swing.event.ChangeEvent evt) {
- bandwidthTweakerStateChanged(evt);
- }
- });
-
javax.swing.GroupLayout bwPanelLayout = new javax.swing.GroupLayout(bwPanel);
bwPanel.setLayout(bwPanelLayout);
bwPanelLayout.setHorizontalGroup(
bwPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(bwPanelLayout.createSequentialGroup()
.addContainerGap()
- .addGroup(bwPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(bwEstimatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(bandwidthTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(bwEstimatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(bwPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(bwPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(bandwidthTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addContainerGap()))
);
bwPanelLayout.setVerticalGroup(
bwPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bwPanelLayout.createSequentialGroup()
- .addContainerGap(16, Short.MAX_VALUE)
- .addComponent(bandwidthTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addContainerGap(80, Short.MAX_VALUE)
.addComponent(bwEstimatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
+ .addGroup(bwPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(bwPanelLayout.createSequentialGroup()
+ .addGap(20, 20, 20)
+ .addComponent(bandwidthTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(42, Short.MAX_VALUE)))
);
dvsPanel.add(bwPanel);
thrPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
- thrPanel.setPreferredSize(new java.awt.Dimension(500, 202));
thresholdTweaker.setToolTipText("Adjusts DVS event temporal contrast thresholds magnitude Limited to only adjusting fine current value; This current sets the rate at which the reset switch voltage is recharged.\n Limited to changing fine current value. For more control, adjust these currents directly.");
maxFiringRateTweaker.setLessDescription("Slower");
@@ -677,7 +679,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
refrEstimatePanelLayout.setHorizontalGroup(
refrEstimatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(refrEstimatePanelLayout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(229, 229, 229)
.addComponent(refrPerLabel)
.addGap(5, 5, 5)
.addComponent(refrPerTF, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -699,10 +701,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
refrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(refrPanelLayout.createSequentialGroup()
.addGap(0, 0, 0)
- .addGroup(refrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(refrEstimatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 481, Short.MAX_VALUE)
- .addComponent(maxFiringRateTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap(17, Short.MAX_VALUE))
+ .addGroup(refrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(maxFiringRateTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(refrEstimatePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap())
);
refrPanelLayout.setVerticalGroup(
refrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -716,7 +718,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
dvsPanel.add(refrPanel);
- apsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frames", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N
+ apsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Image Sensor", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N
apsPanel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
jLabel1.setText("Target Frame rate (Hz)");
@@ -972,15 +974,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(imuVisibleCB, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
);
- toggleDualViewJB.setMnemonic('D');
- toggleDualViewJB.setText("Dual view");
- toggleDualViewJB.setToolTipText("Toggles dual view of user-friendly and low level bias currents (to learn effects)");
- toggleDualViewJB.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- toggleDualViewJBActionPerformed(evt);
- }
- });
-
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
@@ -988,14 +981,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 789, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(apsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(toggleDualViewJB))))
- .addContainerGap(2379, Short.MAX_VALUE))
+ .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addContainerGap(2159, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -1003,20 +994,24 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(apsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(jPanel2Layout.createSequentialGroup()
- .addComponent(toggleDualViewJB)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(27, 27, 27)
+ .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 532, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(158, Short.MAX_VALUE))
);
- apsPanel.getAccessibleContext().setAccessibleName("Frames");
-
jScrollPane1.setViewportView(jPanel2);
- add(jScrollPane1, java.awt.BorderLayout.CENTER);
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 835, Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 735, Short.MAX_VALUE)
+ );
}// //GEN-END:initComponents
private void offThrTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_offThrTFActionPerformed
@@ -1027,17 +1022,9 @@ private void refrPerTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR
// TODO add your handling code here:
}//GEN-LAST:event_refrPerTFActionPerformed
- private void toggleDualViewJBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_toggleDualViewJBActionPerformed
- boolean oldState=!toggleDualViewJB.isSelected();
- // fire a propoerty change that the biasgen (DavisConfig) can respond to by toggling the dual view
- getConfig().setDualView(toggleDualViewJB.isSelected());
- }//GEN-LAST:event_toggleDualViewJBActionPerformed
-
- private void bandwidthTweakerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_bandwidthTweakerStateChanged
- getDvsTweaks().setBandwidthTweak(bandwidthTweaker.getValue());
- setEstimatedBandwidth();
- setFileModified();
- }//GEN-LAST:event_bandwidthTweakerStateChanged
+ private void bwEstTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bwEstTFActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_bwEstTFActionPerformed
private void glShutterCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_glShutterCBActionPerformed
((DavisBaseCamera) chip).getDavisConfig().setGlobalShutter(glShutterCB.isSelected());
@@ -1061,6 +1048,11 @@ private void autoContrastCBActionPerformed(final java.awt.event.ActionEvent evt)
contrastController.setUseAutoContrast(autoContrastCB.isSelected());
}// GEN-LAST:event_autoContrastCBActionPerformed
+ private void bandwidthTweakerStateChanged(final javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_bandwidthTweakerStateChanged
+ getDvsTweaks().setBandwidthTweak(bandwidthTweaker.getValue());
+ setEstimatedBandwidth();
+ setFileModified();
+ }// GEN-LAST:event_bandwidthTweakerStateChanged
private void setEstimatedThresholdValues() {
final float onThresholdLogE = apsDvsTweaks.getOnThresholdLogE();
@@ -1240,7 +1232,6 @@ private void imuEnabledCBActionPerformed(final java.awt.event.ActionEvent evt) {
private javax.swing.JButton snapshotButton;
private javax.swing.JPanel thrPanel;
private net.sf.jaer.biasgen.PotTweaker thresholdTweaker;
- private javax.swing.JToggleButton toggleDualViewJB;
// End of variables declaration//GEN-END:variables
/**
diff --git a/src/net/sf/jaer/eventprocessing/filter/EventRateEstimator.java b/src/net/sf/jaer/eventprocessing/filter/EventRateEstimator.java
index c6562b1c0..8d9cd29da 100644
--- a/src/net/sf/jaer/eventprocessing/filter/EventRateEstimator.java
+++ b/src/net/sf/jaer/eventprocessing/filter/EventRateEstimator.java
@@ -4,7 +4,6 @@
*/
package net.sf.jaer.eventprocessing.filter;
-import java.beans.PropertyChangeEvent;
import net.sf.jaer.Description;
import net.sf.jaer.DevelopmentStatus;
import net.sf.jaer.aemonitor.AEConstants;
@@ -12,7 +11,7 @@
import net.sf.jaer.event.BasicEvent;
import net.sf.jaer.event.EventPacket;
import net.sf.jaer.eventprocessing.EventFilter2D;
-import net.sf.jaer.graphics.AEViewer;
+import net.sf.jaer.util.filter.LowpassFilter;
/**
* Estimates event rate from the input stream.
@@ -40,20 +39,16 @@ public class EventRateEstimator extends EventFilter2D {
private float maxRate = getFloat("maxRate", 10e6f);
private float filteredRate = 0, instantaneousRate = 0;
private float eventRateTauMs = getFloat("eventRateTauMs", 100);
- private float biasChangePauseS = getFloat("biasChangePauseS", .5f);
/* Event rate estimates are sent to observers this many times per tau */
protected int UPDATE_RATE_TAU_DIVIDER = 1;
private int numEventsSinceLastUpdate = 0;
private int numEventsInLastPacket = 0;
- private boolean biasChanged=false;
- private long biasChangedTimeMs=0;
public EventRateEstimator(AEChip chip) {
super(chip);
// filter.setTauMs(eventRateTauMs);
setPropertyTooltip("eventRateTauMs", "lowpass filter time constant in ms for measuring event rate");
setPropertyTooltip("maxRate", "maximum estimated rate, which is used for zero ISIs between packets");
- setPropertyTooltip("biasChangePauseS", "time in seconds to pause measurement after detected change of any bias (0 to disable)");
}
@Override
@@ -61,16 +56,6 @@ synchronized public EventPacket extends BasicEvent> filterPacket(EventPacket
if (in == null || in.getSize() == 0) {
return in; // if there are no events, don't touch values since we don't have a new update time
}
- if (biasChanged && this.biasChangePauseS>0) {
- final long timeSinceBiasChangeMs = System.currentTimeMillis() - biasChangedTimeMs;
- if (timeSinceBiasChangeMs < 1000 * this.biasChangePauseS) {
- lastComputeTimestamp = in.getLastTimestamp();
-// System.out.println(String.format("timeSinceBiasChangeMs=%d < %.0f",timeSinceBiasChangeMs,1000*this.biasChangePauseS));
- return in;
- } else {
- biasChanged = false;
- }
- }
numEventsInLastPacket = 0;
for (BasicEvent e : in) {
addEvent(e, in);
@@ -130,10 +115,6 @@ public void resetFilter() {
@Override
public void initFilter() {
resetFilter();
- if (chip.getAeViewer() != null) {
- chip.getAeViewer().getSupport().addPropertyChangeListener(AEViewer.EVENT_CHIP, this);
- chip.getBiasgen().getSupport().addPropertyChangeListener(this);
- }
}
@Override
@@ -141,14 +122,6 @@ public String toString() {
return super.toString() + " rate=" + filteredRate;
}
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- if (evt.getSource() instanceof AEChip) {
- biasChanged = true;
- biasChangedTimeMs=System.currentTimeMillis();
- }
- }
-
public float getEventRateTauMs() {
return eventRateTauMs;
}
@@ -210,20 +183,4 @@ public void setMaxRate(float maxRate) {
public int getNumEventsInLastPacket() {
return numEventsInLastPacket;
}
-
- /**
- * @return the biasChangePauseS
- */
- public float getBiasChangePauseS() {
- return biasChangePauseS;
- }
-
- /**
- * @param biasChangePauseS the biasChangePauseS to set
- */
- synchronized public void setBiasChangePauseS(float biasChangePauseS) {
- this.biasChangePauseS = biasChangePauseS;
- putFloat("biasChangePauseS",biasChangePauseS);
-// log.info(String.format("Set biasChangePauseS=%.3fs",this.biasChangePauseS));
- }
}
diff --git a/src/net/sf/jaer/eventprocessing/filter/Info.java b/src/net/sf/jaer/eventprocessing/filter/Info.java
index 96e787316..c96fee8f7 100644
--- a/src/net/sf/jaer/eventprocessing/filter/Info.java
+++ b/src/net/sf/jaer/eventprocessing/filter/Info.java
@@ -85,7 +85,6 @@ public class Info extends EventFilter2D implements FrameAnnotater, PropertyChang
// volatile private float eventRateMeasured = 0; // volatile, also shared
private boolean addedViewerPropertyChangeListener = false; // need flag because viewer doesn't exist on creation
private boolean eventRate = getBoolean("eventRate", true);
- private boolean eventRatePerPixel = getBoolean("eventRatePerPixel", false);
private volatile boolean resetTimeEnabled = false; // user for doResetTime
private boolean resetTimeOnRewind = getBoolean("resetTimeOnRewind", false);
@@ -392,7 +391,6 @@ public Info(AEChip chip) {
setPropertyTooltip("eventRateScaleMax", "scale event rates to this maximum");
setPropertyTooltip("timeScaling", "shows time scaling relative to real time");
setPropertyTooltip("eventRate", "shows average event rate");
- setPropertyTooltip("eventRatePerPixel", "shows average event rate per pixel (selected) or total (unselected). Set eventRateScaleMax to scale bars.");
setPropertyTooltip("eventRateSigned", "uses signed event rate for ON positive and OFF negative");
setPropertyTooltip("eventRateTauMs", "lowpass time constant in ms for filtering event rate");
setPropertyTooltip("showRateTrace", "shows a historical trace of event rate");
@@ -800,8 +798,7 @@ private void drawEventRateBars(GLAutoDrawable drawable) {
// and multiply by number of pixels to get string length in screen pixels.
float sw = (glut.glutBitmapLength(font, s) / w) * sx;
glut.glutBitmapString(font, s);
- float rate=isEventRatePerPixel()? perPixelRate:totalRate;
- gl.glRectf(xpos + sw, bary + barh, xpos + sw + ((rate * sx) / getEventRateScaleMax()), bary);
+ gl.glRectf(xpos + sw, bary + barh, xpos + sw + ((totalRate * sx) / getEventRateScaleMax()), bary);
}
gl.glPopMatrix();
@@ -1062,19 +1059,4 @@ public void setMeasureSparsity(boolean measureSparsity) {
putBoolean("measureSparsity", measureSparsity);
}
- /**
- * @return the eventRatePerPixel
- */
- public boolean isEventRatePerPixel() {
- return eventRatePerPixel;
- }
-
- /**
- * @param eventRatePerPixel the eventRatePerPixel to set
- */
- public void setEventRatePerPixel(boolean eventRatePerPixel) {
- this.eventRatePerPixel = eventRatePerPixel;
- putBoolean("eventRatePerPixel", eventRatePerPixel);
- }
-
}
diff --git a/src/net/sf/jaer/util/textio/DavisTextInputReader.java b/src/net/sf/jaer/util/textio/DavisTextInputReader.java
index 1a5acd051..435d2774b 100644
--- a/src/net/sf/jaer/util/textio/DavisTextInputReader.java
+++ b/src/net/sf/jaer/util/textio/DavisTextInputReader.java
@@ -21,14 +21,18 @@
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.util.gl2.GLUT;
-import java.awt.Cursor;
import java.beans.PropertyChangeListener;
import java.io.BufferedReader;
import java.io.EOFException;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
-import java.util.HashMap;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Stream;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
@@ -65,7 +69,7 @@ public class DavisTextInputReader extends AbstractDavisTextIo implements Propert
private BufferedReader dvsReader = null;
private int lastTimestampRead = Integer.MIN_VALUE, lastPacketLastTimestamp = Integer.MIN_VALUE;
private boolean noEventsReadYet = true; // set false when new file is opened
- private int numEventsThisPacket = 0, numEventsInFile = 0;
+ private int numEventsThisPacket=0, numEventsInFile=0;
private ApsDvsEventPacket outputPacket = null;
int maxX = chip.getSizeX(), maxY = chip.getSizeY();
private boolean weWereNeverEnabled = true; // Tobi added this hack to work around the problem that if we are included in FilterChain but not enabled,
@@ -76,8 +80,7 @@ public class DavisTextInputReader extends AbstractDavisTextIo implements Propert
private int previousTimestamp = 0;
private boolean openFileAndRecordAedat = false;
protected boolean flipPolarity = getBoolean("flipPolarity", false);
- final int SPECIAL_COL = 4; // location of special flag (0 normal, 1 special)
- private HashMap
\nby changing current ratios diffOn/diff and diffOff/diff. \n
\nwhen this limit is reached, user must manually change the coarse current value.");
thresholdTweaker.setLessDescription("Lower & More events");
@@ -581,7 +587,7 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) {
jPanel4.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
- jLabel9.setText("Est. DVS thresholds:");
+ jLabel9.setText("Estimated DVS thresholds:");
jLabel9.setToolTipText("Displays computed values of DVS event temporal contrast thresholds
\nbased on paper\nTemperature and\n Parasitic Photocurrent
Effects in Dynamic Vision Sensors,
Y Nozaki, T\nDelbruck.
IEEE Trans. on Electron Devices, 2018");
jPanel4.add(jLabel9);
@@ -618,18 +624,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
thrPanel.setLayout(thrPanelLayout);
thrPanelLayout.setHorizontalGroup(
thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, thrPanelLayout.createSequentialGroup()
+ .addGroup(thrPanelLayout.createSequentialGroup()
.addContainerGap()
- .addGroup(thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(thrPanelLayout.createSequentialGroup()
+ .addGroup(thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(thresholdTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(onOffBalanceTweaker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, thrPanelLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
- .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(javax.swing.GroupLayout.Alignment.LEADING, thrPanelLayout.createSequentialGroup()
- .addGroup(thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
- .addComponent(onOffBalanceTweaker, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
- .addComponent(thresholdTweaker, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(0, 0, Short.MAX_VALUE)))
- .addGap(231, 231, 231))
+ .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 731, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addContainerGap())
);
thrPanelLayout.setVerticalGroup(
thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -646,7 +649,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
dvsPanel.add(thrPanel);
refrPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
- refrPanel.setPreferredSize(new java.awt.Dimension(500, 118));
maxFiringRateTweaker.setToolTipText("Adjusts the refractory period after each event by changing Refr bias.\n