rtimothyedwards / xcircuit Goto Github PK
View Code? Open in Web Editor NEWXCircuit circuit drawing and schematic capture tool
License: GNU General Public License v2.0
XCircuit circuit drawing and schematic capture tool
License: GNU General Public License v2.0
XCircuit has been my primary schematic drawing tool since I started studying EE, and everything has been smooth except for LaTeX mode, which has never worked for me.
A couple days ago I got into the source files and found a problem in the following bit of code:
Lines 4468 to 4478 in 18dc343
As you can see there, jval
only gets assigned when there are no extra arguments in the TCL command, as in $label latex
, which returns the current value for the selected label. The problem is that when I try to set the value running $label latex 1
, then jval
is never assigned, and it's value is undefined, so the comparison in line 4475 is never true.
This problem replicates to adjacent functions that use the getanchoring()
function.
I was able to fix this and also made some improvements in the LaTeX file generation routine in the functions.c
source file, which fixed the problem completely.
Hoping this could be of use for others, maybe I can share my patches or make a pull request.
For context my operating system is MacOS 10.14.6, and i'm running the MacPorts version of XCircuit 3.10.17. From what I remember this issue was also present in Linux, but I'm not sure if it was solved.
After grace period of 25 years, Clang-16 and GCC-14 are enabling errors code that was made illegal in C99 standard. Note that it's very easy to accidentally mess this up by forgetting to specify a return type, and the result is Undefined Behavior and extremely prone to crashing or worse, so it's important for compilers to be able to catch this and prevent user error.
Here is except of build failure
Cascade.c:283:8: error: type specifier missing, defaults to 'int'; ISO C99 and
later do not support implicit int [-Werror,-Wimplicit-int]
static GetIdealSize(mw, replyWidth, replyHeight)
~~~~~~ ^
int
You can verify/reproduce the build failure on older versions of GCC using the following flags: -Werror=implicit-int
XCircuit is unusable on hidpi displays without some hacks. A menu option to change icon scale would help substantially.
It is possible to add a feature to customize the meta data specifically the Description in the SVG export.
I use the svg format for showing my drawings in HTML. With inline SVG the SVG description works really well as the alt tex and is great for accessibility.
Seems "mandir" parameters never used in real case and maintainer has no chance to set correct manual's location
$ grep -n -i -C2 mandir Makefile.in
189- $(am__cd) "$$dir" && rm -f $$files; }; \
190- }
191:man1dir = $(mandir)/man1
192-NROFF = nroff
193-MANS = $(man_MANS)
--
347-localedir = @localedir@
348-localstatedir = @localstatedir@
349:mandir = @mandir@
350-mkdir_p = @mkdir_p@
351-oldincludedir = @oldincludedir@
--
385-# Directories for app-defaults file and manual page
386-appdefaultsdir = $(libdir)/$(PACKAGE)-$(VERSION)/app-defaults
387:appmandir = $(libdir)/$(PACKAGE)-$(VERSION)/man
388-install_appdefaultsdir = @DIST_DIR@/lib/$(PACKAGE)-$(VERSION)/app-defaults
389:install_appmandir = @DIST_DIR@/lib/$(PACKAGE)-$(VERSION)/man
390-install_bindir = @DIST_DIR@/bin
391-PATHNAMES = -DPROG_VERSION=\"$(VERSION)\" \
--
918- @echo "Installing app-defaults file"
919- $(mkinstalldirs) $(DESTDIR)$(install_appdefaultsdir)
920: $(mkinstalldirs) $(DESTDIR)$(install_appmandir)
921- $(INSTALL_DATA) lib/XCircuit.ad $(DESTDIR)$(install_appdefaultsdir)/XCircuit
922: $(INSTALL_DATA) lib/xcircuit.1 $(DESTDIR)$(install_appmandir)/xcircuit.1
923- @echo "Installing library and netlist files"
924- $(mkinstalldirs) $(DESTDIR)$(install_librarydir)
I think better use --mandir for installing if it set.
OS: Manjaro Linux, Kernel 5.7.15-1
XCircuit version: 3.10.28 from distro repositories, but also occurs with 3.10.26 compiled locally from AUR/github (even when compiled --with-python
instead of TCL).
TCL/TK version: 8.6.10
The problem occurs inside of a fresh Manjaro install on a VM as well as my primary system, but does not occur on Arch running in Windows Subsystem for Linux using the same versions of XCircuit and TCL.
Specifically, the segmentation fault occurs when wm deiconify .filelist
is called, even if done outside of popupfilelist.
I am able to deiconify other dialogs and read and write files using the commands the filelist dialogue would have eventually called to do so.
The EPS bounding box is not set correctly when the page includes flipped or rotated pin labels on the periphery. Attached is an example. It doesn't matter whether Xcircuit saves the file in eps or ps format.
(the attachment has a .txt extension since it was not possible to upload the .eps file here)
retina.eps.txt
System: Ubuntu 18.04.3 LTS
Version: Xcircuit v3.8 rev 78 (installed via apt)
Bug: Xcircuit crashes when editing a stair-like line. Console says Segmentation fault (core dumped)
Steps to reproduce:
[(0,0), (32,0), (32,32), (64,32), (64,64)]
(32,0)
to (64,0)
(64,32)
back to (32,32)
(32,32)
to (64,32)
.Images are provided as an example. The red crosshair indicates where the cursor started. The blue crosshair indicates where the cursor ended and a click was performed.
Following is my system configuration (Arch linux)
$ uname -a
Linux arc 5.10.7-arch1-1 #1 SMP PREEMPT Wed, 13 Jan 2021 12:02:01 +0000 x86_64 GNU/Linux
and package versions
local/tcl 8.6.11-1
The Tcl scripting language
local/tcllib 1.19-1
Set of pure-Tcl extensions.
local/tk 8.6.11.1-1
A windowing toolkit for use with tcl
local/cairo 1.17.4-3
2D graphics library with support for multiple output devices
local/lib32-libx11 1.7.0-1
X11 client-side library (32-bit)
local/libx11 1.7.0-3
X11 client-side library
local/xcircuit 3.10.28-1
A program for drawing publishable-quality electrical circuit schematic diagrams
Upon running xcircuit from the terminal, it shows the gui and immediately crashes without any error messages, just this
[1] 1391935 segmentation fault (core dumped) xcircuit
Trying to install on centos 7 leads to an error upon calling make:
help.c: In function ‘starthelp’:
help.c:334:13: error: ‘OptionsHelpButton’ undeclared (first use in this function)
button = OptionsHelpButton;
^
help.c:334:13: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [help.o] Error 1
I installed xcircuit following the instructions page. When I run xcircuit
I get the following message:
application-specific initialization failed: couldn't connect to display ":0"
Error in startup script: couldn't connect to display ":0"
while executing
"load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk"
("package ifneeded Tk 8.6.10" script)
invoked from within
"package require Tk $tcl_version"
invoked from within
"if {$tcl_version < 8.0} {
return -code error "tkcon requires at least Tcl/Tk8"
} else {
package require Tk $tcl_version
}"
(file "/usr/local/lib/xcircuit-3.10/tkcon.tcl" line 44)
Hi,
I have installed Xcircuit via macports
sudo port install xcircuit
And then tried to open Xcircuit via
xcircuit
I get the following error
application-specific initialization failed: couldn't connect to display "0:0"
Error in startup script: couldn't connect to display "0:0"
while executing
"load /opt/local/lib/libtk8.6.dylib Tk"
("package ifneeded Tk 8.6.11" script)
invoked from within
"package require Tk $tcl_version"
invoked from within
"if {$tcl_version < 8.0} {
return -code error "tkcon requires at least Tcl/Tk8"
} else {
package require Tk $tcl_version
}"
(file "/opt/local/lib/xcircuit-3.9/tkcon.tcl" line 44)
Any help is appreciated?
Hello,
I have a question. From what I understand, since there is no a symbol exception like described here it means that files generated by xcircuit are under GPL. Is this correct?
Thank you
./configure --enable-shared
, but it does not suuport this.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.