Open
Conversation
Port the spiceimport branch to v3-dev. Adds File > "Import Subcircuit
From Spice..." which parses SPICE netlist text and creates a
CustomCompositeModel subcircuit.
Supported SPICE elements: R, C, L, D, Q (BJT with area/RC/RB/RE/CJE/CJC),
J (JFET), V, I, E (VCVS), G (VCCS), H (CCVS), F (CCCS), B (behavioral).
Handles .model (NPN/PNP/D/NJF/PJF), .subckt/.ends, .rename, POLY(),
VALUE={expr}, continuation lines, and area-scaled transistor models.
New files:
- BetterStringTokenizer.java - flexible tokenizer for SPICE parsing
- ImportFromSpiceDialog.java - main SPICE import dialog and parser
Modified files:
- Menus.java - add menu item
- CommandManager.java - add command handler
- CustomCompositeModel.java - add setName() to ExtListEntry
- EditCompositeModelDialog.java - add loadModel() and defaultName for
external model loading
- TransistorModel.java - fix getModelWithName to use 2-arg constructor
for proper initialization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the
origin/spiceimportbranch to v3-dev. Adds File > "Import Subcircuit From Spice..." which opens a dialog where users can paste SPICE netlist text to create a CircuitJS1 subcircuit model.Supported SPICE elements
+), area-scaled transistor model variantsChanges
BetterStringTokenizer.java(flexible SPICE tokenizer),ImportFromSpiceDialog.java(695-line parser and dialog)importfromspicecommand handlersetName()toExtListEntry(for.renamedirective)loadModel()method anddefaultNamefield for external model loading (used by SPICE importer to bypasscreateModel()which requires an existing circuit)getModelWithName()to use 2-arg constructorTransistorModel(name, 1e-13)instead of no-arg constructor, ensuring proper initialization of emission coefficients and other defaultsTest plan
🤖 Generated with Claude Code