ra4king / CircuitSim

Basic Circuit Simulator
https://ra4king.github.io/CircuitSim
BSD 3-Clause "New" or "Revised" License
76 stars 27 forks source link

Hexadecimal Probe #54

Closed Dallas-D closed 1 year ago

Dallas-D commented 5 years ago

Added ability for probes to display their value in binary or hexadecimal. This is expandable to decimal or other bases in the future. Fixes #53

I've been having issues with installing the Java 9 SDK so I have not had a chance to build and debug. I will update when progress has been made.

ausbin commented 5 years ago

re: java 9, are you on debian/ubuntu? i believe in some versions the openjdk 9 in the repos does not include javafx: https://lists.debian.org/debian-java/2017/10/msg00032.html. kind of a mess, i had to install the oracle JDK (like extract the linux jdk installation tarball to my homedir)

however i believe in newer versions of ubuntu this is fixed

Dallas-D commented 5 years ago

I got Java 9 working so it now builds. Hexadecimal values work really well. Decimal values, not so much. The way that GuiUtils draws values prevents the string from being longer than 8 characters, so it wraps to the next line, which doesn't really work for large decimal values. I put a temporary fix that lets the text wrap without looking too weird, but the drawValue probably needs a rewrite.

Dallas-D commented 5 years ago

I went ahead and added the new BASE property to the ConstantPeer since it was basically the same code as a Probe. The problem with decimal numbers still apply.

Dallas-D commented 5 years ago

Problem with wrapping decimal numbers is resolved.

Dallas-D commented 5 years ago

Bump for @ra4king to review this PR

ra4king commented 1 year ago

Sorry I missed this for years, I've been bad at keeping up with PRs. Can you fix the conflicts and we can then start proper rounds of reviews :)

ra4king commented 1 year ago

I finished the merge for you, thanks!