📄 simulatorstab.java
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: SimulatorsTab.java * * Copyright (c) 2004 Sun Microsystems and Static Free Software * * Electric(tm) 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. * * Electric(tm) 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 Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.tool.user.dialogs.options;import com.sun.electric.tool.io.FileType;import com.sun.electric.tool.simulation.Simulation;import com.sun.electric.tool.user.dialogs.OpenFile;import java.awt.Frame;import javax.swing.JPanel;/** * Class to handle the "Simulators" tab of the Preferences dialog. */public class SimulatorsTab extends PreferencePanel{ /** Creates new form SimulatorsTab */ public SimulatorsTab(Frame parent, boolean modal) { super(parent, modal); initComponents(); } /** return the panel to use for this preferences tab. */ public JPanel getPanel() { return simulators; } /** return the name of this preferences tab. */ public String getName() { return "Simulators"; } // this is a copy of what is in com.sun.electric.plugins.irsim.Sim.java /** event scheduling */ private static final int DEBUG_EV = 0x01; /** final value computation */ private static final int DEBUG_DC = 0x02; /** tau/delay computation */ private static final int DEBUG_TAU = 0x04; /** taup computation */ private static final int DEBUG_TAUP = 0x08; /** spike analysis */ private static final int DEBUG_SPK = 0x10; /** tree walk */ private static final int DEBUG_TW = 0x20; /** * Method called at the start of the dialog. * Caches current values and displays them in the Compaction tab. */ public void init() { // for all simulators resimulateEachChange.setSelected(Simulation.isBuiltInResimulateEach()); autoAdvanceTime.setSelected(Simulation.isBuiltInAutoAdvance()); multistateDisplay.setSelected(Simulation.isWaveformDisplayMultiState()); // for IRSIM showCommands.setSelected(Simulation.isIRSIMShowsCommands()); delayedX.setSelected(Simulation.isIRSIMDelayedX()); int initialDebugging = Simulation.getIRSIMDebugging(); if ((initialDebugging&DEBUG_EV) != 0) debugEv.setSelected(true); if ((initialDebugging&DEBUG_DC) != 0) debugDC.setSelected(true); if ((initialDebugging&DEBUG_TAU) != 0) debugTau.setSelected(true); if ((initialDebugging&DEBUG_TAUP) != 0) debugTauP.setSelected(true); if ((initialDebugging&DEBUG_SPK) != 0) debugSpk.setSelected(true); if ((initialDebugging&DEBUG_TW) != 0) debugTW.setSelected(true); parameterFile.setText(Simulation.getIRSIMParameterFile()); simModel.addItem("RC"); simModel.addItem("Linear"); simModel.setSelectedItem(Simulation.getIRSIMStepModel()); if (!Simulation.hasIRSIM()) { debugEv.setEnabled(false); debugDC.setEnabled(false); debugTau.setEnabled(false); debugTauP.setEnabled(false); debugSpk.setEnabled(false); debugTW.setEnabled(false); simModel.setEnabled(false); simModel.setEnabled(false); parameterFile.setEditable(false); setParameterFile.setEnabled(false); showCommands.setEnabled(false); delayedX.setEnabled(false); } } /** * Method called when the "OK" panel is hit. * Updates any changed fields in the Compaction tab. */ public void term() { boolean currBoolean = resimulateEachChange.isSelected(); if (currBoolean != Simulation.isBuiltInResimulateEach()) Simulation.setBuiltInResimulateEach(currBoolean); currBoolean = autoAdvanceTime.isSelected(); if (currBoolean != Simulation.isBuiltInAutoAdvance()) Simulation.setBuiltInAutoAdvance(currBoolean); currBoolean = multistateDisplay.isSelected(); if (currBoolean != Simulation.isWaveformDisplayMultiState()) Simulation.setWaveformDisplayMultiState(currBoolean); currBoolean = showCommands.isSelected(); if (currBoolean != Simulation.isIRSIMShowsCommands()) Simulation.setIRSIMShowsCommands(currBoolean); currBoolean = delayedX.isSelected(); if (currBoolean != Simulation.isIRSIMDelayedX()) Simulation.setIRSIMDelayedX(currBoolean); int currInt = 0; if (debugEv.isSelected()) currInt |= DEBUG_EV; if (debugDC.isSelected()) currInt |= DEBUG_DC; if (debugTau.isSelected()) currInt |= DEBUG_TAU; if (debugTauP.isSelected()) currInt |= DEBUG_TAUP; if (debugSpk.isSelected()) currInt |= DEBUG_SPK; if (debugTW.isSelected()) currInt |= DEBUG_TW; if (currInt != Simulation.getIRSIMDebugging()) Simulation.setIRSIMDebugging(currInt); String currString = parameterFile.getText(); if (!currString.equals(Simulation.getIRSIMParameterFile())) Simulation.setIRSIMParameterFile(currString); currString = (String)simModel.getSelectedItem(); if (!currString.equals(Simulation.getIRSIMStepModel())) Simulation.setIRSIMStepModel(currString); } /** * Method called when the factory reset is requested. */ public void reset() { if (Simulation.isFactoryBuiltInResimulateEach() != Simulation.isBuiltInResimulateEach()) Simulation.setBuiltInResimulateEach(Simulation.isFactoryBuiltInResimulateEach()); if (Simulation.isFactoryBuiltInAutoAdvance() != Simulation.isBuiltInAutoAdvance()) Simulation.setBuiltInAutoAdvance(Simulation.isFactoryBuiltInAutoAdvance()); if (Simulation.isFactoryWaveformDisplayMultiState() != Simulation.isWaveformDisplayMultiState()) Simulation.setWaveformDisplayMultiState(Simulation.isFactoryWaveformDisplayMultiState()); // for IRSIM if (!Simulation.getFactoryIRSIMParameterFile().equals(Simulation.getIRSIMParameterFile())) Simulation.setIRSIMParameterFile(Simulation.getFactoryIRSIMParameterFile()); if (!Simulation.getFactoryIRSIMStepModel().equals(Simulation.getIRSIMStepModel())) Simulation.setIRSIMStepModel(Simulation.getFactoryIRSIMStepModel()); if (Simulation.getFactoryIRSIMDebugging() != Simulation.getIRSIMDebugging()) Simulation.setIRSIMDebugging(Simulation.getFactoryIRSIMDebugging()); if (Simulation.isFactoryIRSIMShowsCommands() != Simulation.isIRSIMShowsCommands()) Simulation.setIRSIMShowsCommands(Simulation.isFactoryIRSIMShowsCommands()); if (Simulation.isFactoryIRSIMDelayedX() != Simulation.isIRSIMDelayedX()) Simulation.setIRSIMDelayedX(Simulation.isFactoryIRSIMDelayedX()); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; simulators = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); autoAdvanceTime = new javax.swing.JCheckBox(); resimulateEachChange = new javax.swing.JCheckBox(); multistateDisplay = new javax.swing.JCheckBox(); jPanel2 = new javax.swing.JPanel(); setParameterFile = new javax.swing.JButton(); parameterFile = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); simModel = new javax.swing.JComboBox(); jPanel3 = new javax.swing.JPanel(); debugEv = new javax.swing.JCheckBox(); debugDC = new javax.swing.JCheckBox(); debugTau = new javax.swing.JCheckBox(); debugTauP = new javax.swing.JCheckBox(); debugSpk = new javax.swing.JCheckBox(); debugTW = new javax.swing.JCheckBox(); jPanel4 = new javax.swing.JPanel(); showCommands = new javax.swing.JCheckBox(); delayedX = new javax.swing.JCheckBox(); getContentPane().setLayout(new java.awt.GridBagLayout()); setTitle("Tool Options"); setName(""); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); simulators.setLayout(new java.awt.GridBagLayout()); jPanel1.setLayout(new java.awt.GridBagLayout());
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -