Code Monkey home page Code Monkey logo

xcircuit's People

Contributors

agustincampeny avatar ieast avatar khonoka avatar rtimothyedwards avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcircuit's Issues

Patch for label anchoring and LaTeX mode

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:

XCircuit/tclxcircuit.c

Lines 4468 to 4478 in 18dc343

case LaTeXIdx:
if (objc == nidx + 1)
jval = getanchoring(interp, LATEXLABEL);
else {
if ((result = Tcl_GetBooleanFromObj(interp, objv[nidx + 1],
&value)) != TCL_OK)
return result;
if (jval != value)
setanchoring(LATEXLABEL, (value) ? LATEXLABEL : NORMAL);
}
break;

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.

C99+ compatibility

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

No way to change icon size

XCircuit is unusable on hidpi displays without some hacks. A menu option to change icon scale would help substantially.

custom meta data in SVG export

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.

Configure script ignore --mandir parameter

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.

Segmentation fault for any menu item involving xcircuit::popupfilelist

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.

EPS bounding box incorrect

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

Segmentation fault when editing a stair-like line.

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:

  • Open a terminal
  • Run xcircuit
  • Draw a line with a stair shape. In the example: [(0,0), (32,0), (32,32), (64,32), (64,64)]
  • Edit the line and align one of the vertical slopes of the stair to another vertical slope, eliminating a step. In the example: move (32,0) to (64,0)
  • Click to move to the next vertex, which is on the same position as the next vertex after itself. Move the vertex so the manhattan line transforms into a diagonal line. In the example: move (64,32) back to (32,32)
  • Click to move to the next vertex, which is on the same position as the previous. Any movement will make the line move erratically. Example move (32,32) to (64,32).
  • Click to move to the next vertex.
  • Xcircuit crashes

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.

0 - original line
1 - first click
2 - second click
3 - third click

Xcircuit immediately seg faults after launch

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

Running make on CentOs system

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

Application-specific initialization failed: couldn't connect to display ":0.0"

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)

Xcircuit not starting in macos Catalina (version 10.15.7)

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)

[1] + exit 1 xcircuit

Any help is appreciated?

License of produced schematics

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.