Comments (1)
I found out why it's not working and why it worked when there was a file in file history.
It has to do with the order of executions and the following lines of code
Digital/src/main/java/de/neemann/digital/gui/Main.java
Lines 194 to 202 in 426a1e1
Here is a detailed explanation
The order of executions is as follows when debugging
- create a new element library
a. calls theLibraryNode.traverse()
method frompopulateNodeMap()
b. calls theLibraryNode.traverse()
method directly
Digital/src/main/java/de/neemann/digital/draw/library/ElementLibrary.java
Lines 255 to 263 in 426a1e1
- register components from custom Java components to the above-created library using the
ElementLibrary.registerComponentSource()
method - set the above created and modified library as the library of
MainBuilder
using theMainBuilder.setLibrary()
method - then the
MainBuilder.openLater()
method calls theMainBuilder.build()
method which in turn instantiates theMain
class - while instantiating the
Main
class, as per the first block of code linked, theLibraryNode.traverse()
method is called once more as a result of calling theMain.loadFile()
method which only happens if there is a file in File History
The gotcha
First two calls to the LibraryNode.traverse()
method happens before the ElementLibrary.registerComponentSource()
and the MainBuilder.setLibrary()
method calls. Because of this, the custom Java components are not in the element library when the LibraryNode.traverse()
method is called which is responsible for marking library nodes as unique. Since the custom Java components are not marked as unique, they become unusable. And since the LibraryNode.traverse()
method is called once more after all this when there is a file in File History, the custom Java components become usable.
Originally posted by @me-nkr in #1312 (comment)
from digital.
Related Issues (20)
- 74xx Dil Chips - Pin changed from v0.29 to v0.30
- Export to KiCad/eeschema [work in progress]
- Verilog 语法检测有问题
- Create New circuit Error
- Add ability to fix VGA window size
- 747266.dig - 74x7266 Quad 2-Input XNOR Gates
- 7434.dig - 74x34 Hex Buffers
- 74381.dig - 74x381 4-Bit Arithmetic Logic Unit
- Highlight the selected input pin on a Multiplexer HOT 2
- Missing gate inputs HOT 2
- No Tristate Buffer nor Tristatable Inverter. HOT 2
- 74ls161 error "No output connected to a wire ([1; Splitter]) the state of the wire is undefined" HOT 2
- Error "More than one output is active on a wire causing a short circuit" HOT 3
- Bi directional I/O? HOT 10
- Add the ability to color code wires.
- Trying to use IVerilog throws "The system cannot find the path specified" error on Windows HOT 5
- Security vulnerability | CVE-2022-45688 and CVE-2023-5072
- Nand inconsistent HOT 2
- Expanding components, D-Flip-Flop 4 input HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digital.