From 41b78e2d43ede54bd66387b93d6bb4fb0a578a27 Mon Sep 17 00:00:00 2001 From: Tobi Delbruck Date: Tue, 19 Dec 2023 08:06:24 -0800 Subject: [PATCH] Added dual view of user-friendly and bias currents. Cleaned up layout of DavisConfig --- .../ini/chips/davis/DavisConfig.java | 78 ++++++--- .../chips/davis/DavisUserControlPanel.form | 158 ++++++++++-------- .../chips/davis/DavisUserControlPanel.java | 153 +++++++++-------- 3 files changed, 225 insertions(+), 164 deletions(-) diff --git a/src/eu/seebetter/ini/chips/davis/DavisConfig.java b/src/eu/seebetter/ini/chips/davis/DavisConfig.java index 53d061024..48bd61204 100644 --- a/src/eu/seebetter/ini/chips/davis/DavisConfig.java +++ b/src/eu/seebetter/ini/chips/davis/DavisConfig.java @@ -29,6 +29,7 @@ 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; @@ -83,7 +84,9 @@ public class DavisConfig extends Biasgen implements DavisDisplayConfigInterface, // subclasses for controlling aspects of camera protected DavisConfig.VideoControl videoControl; protected ImuControl imuControlGUI; - EngineeringFormat eng=new EngineeringFormat(); + EngineeringFormat eng = new EngineeringFormat(); + + private boolean dualUserFriendlyAndBiasCurrentsViewEnabled = false; public DavisConfig(final Chip chip) { super(chip); @@ -405,9 +408,10 @@ public String processRemoteControlCommand(final RemoteControlCommand command, fi } private ParameterControlPanel videoParameterControlPanel; - private JPanel userFriendlyControls; + private JPanel userFriendlyControls, combinedBiasShiftedSourcePanel; private JPanel configPanel; private JTabbedPane configTabbedPane; + private JPanel dualViewPanel; // threshold for triggering a new frame snapshot automatically private int autoShotThreshold; @@ -432,12 +436,44 @@ 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 - final JPanel combinedBiasShiftedSourcePanel = new 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)); @@ -445,44 +481,37 @@ public JPanel buildControlPanel() { 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(); @@ -492,7 +521,6 @@ public JPanel buildControlPanel() { 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")); @@ -500,19 +528,15 @@ public JPanel buildControlPanel() { videoParameterControlPanel = new ParameterControlPanel(getVideoControl()); videoControlPanel.add(videoParameterControlPanel); configTabbedPane.addTab("Video Control", videoControlPanel); - getVideoControl().addObserver(videoParameterControlPanel); getVideoControl().getContrastContoller().addObserver(videoParameterControlPanel); - // only select panel after all added - configPanel.add(configTabbedPane, BorderLayout.CENTER); - + // make special dual view panel for seeing effect of userFriendlyControls on bias currents 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 @@ -520,9 +544,6 @@ public void mouseClicked(final MouseEvent evt) { tabbedPaneMouseClicked(evt); } }); - - setBatchEditOccurring(false); - return configPanel; } @Override @@ -957,7 +978,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 @@ -1291,4 +1312,19 @@ public static SPIConfigValue getConfigValueByName(final List con return null; } + + /** + * @return the dualUserFriendlyAndBiasCurrentsViewEnabled + */ + public boolean isDualUserFriendlyAndBiasCurrentsViewEnabled() { + return dualUserFriendlyAndBiasCurrentsViewEnabled; + } + + /** + * @param dualUserFriendlyAndBiasCurrentsViewEnabled the + * dualUserFriendlyAndBiasCurrentsViewEnabled to set + */ + public void setDualUserFriendlyAndBiasCurrentsViewEnabled(boolean dualUserFriendlyAndBiasCurrentsViewEnabled) { + this.dualUserFriendlyAndBiasCurrentsViewEnabled = dualUserFriendlyAndBiasCurrentsViewEnabled; + } } diff --git a/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.form b/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.form index 6831bd734..dee6803a1 100644 --- a/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.form +++ b/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.form @@ -32,20 +32,14 @@ - - - - - - - - - - - - + + + + + + @@ -57,14 +51,17 @@ - + - + + + + - + @@ -74,9 +71,13 @@ - + + + + + - + @@ -88,7 +89,7 @@ - + @@ -165,72 +166,48 @@ + + + - + - - - - - - - - + + + + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + @@ -259,12 +236,27 @@ - - - + + + + + + + + + + + + + + + + + + @@ -274,22 +266,30 @@ + + + - + - - - + - + + + + + + + + - + @@ -352,7 +352,7 @@ - + @@ -406,6 +406,9 @@ + + + @@ -413,11 +416,11 @@ - + + - - + @@ -458,7 +461,7 @@ - + @@ -505,7 +508,7 @@ - + @@ -514,6 +517,9 @@ + + + @@ -853,6 +859,16 @@ + + + + + + + + + + diff --git a/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.java b/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.java index 67aacf8fc..42f8faacd 100644 --- a/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.java +++ b/src/eu/seebetter/ini/chips/davis/DavisUserControlPanel.java @@ -373,10 +373,10 @@ private void initComponents() { dvsContSp = new javax.swing.JSpinner(); captureEventsCB = new javax.swing.JCheckBox(); bwPanel = new javax.swing.JPanel(); - bandwidthTweaker = new net.sf.jaer.biasgen.PotTweaker(); bwEstimatePanel = new javax.swing.JPanel(); bwEstLabel = new javax.swing.JLabel(); bwEstTF = new javax.swing.JTextField(); + bandwidthTweaker = new net.sf.jaer.biasgen.PotTweaker(); thrPanel = new javax.swing.JPanel(); thresholdTweaker = new net.sf.jaer.biasgen.PotTweaker(); onOffBalanceTweaker = new net.sf.jaer.biasgen.PotTweaker(); @@ -416,6 +416,7 @@ private void initComponents() { imuPanel = new javax.swing.JPanel(); imuVisibleCB = new javax.swing.JCheckBox(); imuEnabledCB = new javax.swing.JCheckBox(); + toggleDualViewJB = new javax.swing.JToggleButton(); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); @@ -428,7 +429,9 @@ private void initComponents() { .addGap(0, 100, Short.MAX_VALUE) ); - dvsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DVS", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N + setLayout(new java.awt.BorderLayout()); + + dvsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DVS Events", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); // NOI18N dvsPanel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N displayEventsCheckBox.setText("Display events"); @@ -482,19 +485,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { dvsPanel.add(captureEventsCB); bwPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); - - 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 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); - } - }); + bwPanel.setPreferredSize(new java.awt.Dimension(500, 139)); 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."); @@ -502,22 +493,17 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) { 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.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(147, Short.MAX_VALUE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(bwEstLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(bwEstTF, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(104, 104, 104)) + .addComponent(bwEstTF, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(182, 182, 182)) ); bwEstimatePanelLayout.setVerticalGroup( bwEstimatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -528,36 +514,44 @@ 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() - .addComponent(bwEstimatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .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)) .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(80, Short.MAX_VALUE) + .addContainerGap(16, Short.MAX_VALUE) + .addComponent(bandwidthTweaker, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .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
\nby changing current ratios diffOn/diff and diffOff/diff. \n

Limited to only adjusting fine current value;
\nwhen this limit is reached, user must manually change the coarse current value."); thresholdTweaker.setLessDescription("Lower & More events"); @@ -587,7 +581,7 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) { jPanel4.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); - jLabel9.setText("Estimated DVS thresholds:"); + jLabel9.setText("Est. 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); @@ -624,15 +618,18 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { thrPanel.setLayout(thrPanelLayout); thrPanelLayout.setHorizontalGroup( thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(thrPanelLayout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, thrPanelLayout.createSequentialGroup() .addContainerGap() - .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() + .addGroup(thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(thrPanelLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 731, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap()) + .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)) ); thrPanelLayout.setVerticalGroup( thrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -649,6 +646,7 @@ 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

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"); @@ -679,7 +677,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { refrEstimatePanelLayout.setHorizontalGroup( refrEstimatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(refrEstimatePanelLayout.createSequentialGroup() - .addGap(229, 229, 229) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(refrPerLabel) .addGap(5, 5, 5) .addComponent(refrPerTF, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -701,10 +699,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) - .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()) + .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)) ); refrPanelLayout.setVerticalGroup( refrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -718,7 +716,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { dvsPanel.add(refrPanel); - 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.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.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setText("Target Frame rate (Hz)"); @@ -974,6 +972,15 @@ 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( @@ -981,12 +988,14 @@ 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, 789, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 569, 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) - .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(2159, Short.MAX_VALUE)) + .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)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -994,24 +1003,20 @@ 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) - .addComponent(imuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .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(dvsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 532, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(158, Short.MAX_VALUE)) ); + apsPanel.getAccessibleContext().setAccessibleName("Frames"); + jScrollPane1.setViewportView(jPanel2); - 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) - ); + add(jScrollPane1, java.awt.BorderLayout.CENTER); }// //GEN-END:initComponents private void offThrTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_offThrTFActionPerformed @@ -1022,9 +1027,17 @@ private void refrPerTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR // TODO add your handling code here: }//GEN-LAST:event_refrPerTFActionPerformed - private void bwEstTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bwEstTFActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_bwEstTFActionPerformed + 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 glShutterCBActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_glShutterCBActionPerformed ((DavisBaseCamera) chip).getDavisConfig().setGlobalShutter(glShutterCB.isSelected()); @@ -1048,11 +1061,6 @@ 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(); @@ -1232,6 +1240,7 @@ 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 /**