remember last directory in export png/svg/pdf/ps, added missing symbols

This commit is contained in:
Stefan Frederik 2020-12-27 22:59:15 +01:00
parent 5917cd9717
commit 9e9cac0516
8 changed files with 93 additions and 16 deletions

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>XSCHEM TUTORIAL: Backannotation of ngspice simulation data</title>
<link rel="stylesheet" type="text/css" href="xschem_man.css" />
<style type="text/css">
/* Local styling goes here */
p{padding: 15px 30px 10px;}
</style>
</head>
<body>
<!-- start of slide -->
<div class="content">
<!-- navigation buttons -->
<a href="xschem_man.html" class="home">UP</a>
<!-- slide title -->
<h1> TUTORIAL: Backannotation of NGSPICE simulation operating<br>point data into an XSCHEM schematic</h1>
<p>
</p>
<img src="backannotation1.svg">
<!-- end of slide -->
<div class="filler"></div>
</div>
<!-- frame footer -->
<iframe seamless src="xschem_footer.html" class="footer_iframe" >
</body>
</html>

View File

@ -50,6 +50,7 @@
<li><a href="tutorial_create_symbol.html">Create a symbol with XSCHEM</a></li>
<li><a href="tutorial_xschem_libraries.html">Manage XSCHEM design libraries / symbol librares</a></li>
<li><a href="tutorial_busses.html">Use bus / vector notation for signal bundles / arrays of instances</a></li>
<li><a href="tutorial_ngspice_backannotation.html">Backannotation of Ngspice simulation data into xschem</a></li>
<li><a href="tutorial_symgen.html">Use symgen.awk to create symbols from 'djboxsym' compatible text files</a></li>
<li><a href="https://xschem.sourceforge.io/stefan/xschem_man/video_tutorials/editing_and_sim.mp4">[Video] Editing commands and simulation</a></li>
<li><a href="https://xschem.sourceforge.io/stefan/xschem_man/video_tutorials/edit_attributes.mp4">[Video] Editing component attributes</a></li>

View File

@ -51,16 +51,19 @@ void print_image()
{
int save_draw_grid;
char cmd[PATH_MAX+100];
static char lastdir[PATH_MAX] = "";
const char *r;
char *tmpstring=NULL;
if(!has_x) return ;
if(!lastdir[0]) my_strncpy(lastdir, pwd_dir, S(lastdir));
if(!plotfile[0]) {
my_strdup(60, &tmpstring, "tk_getSaveFile -title {Select destination file} -initialdir [pwd]");
tcleval(tmpstring);
Tcl_VarEval(interp, "tk_getSaveFile -title {Select destination file} -initialdir ", lastdir, NULL);
r = tclresult();
my_free(717, &tmpstring);
if(r[0]) my_strncpy(plotfile, r, S(plotfile));
if(r[0]) {
my_strncpy(plotfile, r, S(plotfile));
Tcl_VarEval(interp, "file dirname ", plotfile, NULL);
my_strncpy(lastdir, tclresult(), S(lastdir));
}
else return;
}
#if 0

View File

@ -585,20 +585,22 @@ void ps_draw(void)
xRect boundbox;
int c,i, textlayer;
char tmp[2*PATH_MAX+40];
static char lastdir[PATH_MAX] = "";
int old_grid;
const char *r, *textfont;
char *psfile;
if(!lastdir[0]) my_strncpy(lastdir, pwd_dir, S(lastdir));
if(!plotfile[0]) {
my_snprintf(tmp, S(tmp), "tk_getSaveFile -title {Select destination file} -initialdir [pwd]");
tcleval(tmp);
Tcl_VarEval(interp, "tk_getSaveFile -title {Select destination file} -initialdir ", lastdir, NULL);
r = tclresult();
if(r[0]) my_strncpy(plotfile, r, S(plotfile));
else {
return;
if(r[0]) {
my_strncpy(plotfile, r, S(plotfile));
Tcl_VarEval(interp, "file dirname ", plotfile, NULL);
my_strncpy(lastdir, tclresult(), S(lastdir));
}
else return;
}
if(!(fd = open_tmpfile("psplot_", &psfile)) ) {
fprintf(errfp, "ps_draw(): can not create tmpfile %s\n", psfile);
return;

View File

@ -555,18 +555,21 @@ void svg_draw(void)
double dx, dy;
int c,i, textlayer;
int old_grid;
char *tmpstring=NULL;
static char lastdir[PATH_MAX] = "";
const char *r, *textfont;
int *unused_layer;
int color;
struct hilight_hashentry *entry;
if(!lastdir[0]) my_strncpy(lastdir, pwd_dir, S(lastdir));
if(!plotfile[0]) {
my_strdup(61, &tmpstring, "tk_getSaveFile -title {Select destination file} -initialdir [pwd]");
tcleval(tmpstring);
Tcl_VarEval(interp, "tk_getSaveFile -title {Select destination file} -initialdir ", lastdir, NULL);
r = tclresult();
my_free(963, &tmpstring);
if(r[0]) my_strncpy(plotfile, r, S(plotfile));
if(r[0]) {
my_strncpy(plotfile, r, S(plotfile));
Tcl_VarEval(interp, "file dirname ", plotfile, NULL);
my_strncpy(lastdir, tclresult(), S(lastdir));
}
else return;
}
svg_restore_lw();

View File

@ -0,0 +1,10 @@
v {xschem version=2.9.9 file_version=1.2 }
G {}
K {type=label
format="*.alias @lab"
template="name=l1 sig_type=std_logic lab=xxx text=yyy"}
V {}
S {}
E {}
B 5 -1.25 -1.25 1.25 1.25 {name=p dir=in}
T {@text} 0 0 0 0 12 12 {}

View File

@ -0,0 +1,12 @@
v {xschem version=2.9.9 file_version=1.2}
K {type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
}
T {@symname} -63 -6 0 0 0.3 0.3 {}
T {@name} 135 -22 0 0 0.2 0.2 {}
L 4 -130 -10 130 -10 {}
L 4 -130 10 130 10 {}
L 4 -130 -10 -130 10 {}
L 4 130 -10 130 10 {}

View File

@ -0,0 +1,11 @@
v {xschem version=2.9.9 file_version=1.2}
K {type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
}
T {@symname} -67.5 -6 0 0 0.3 0.3 {}
T {@name} 135 -22 0 0 0.2 0.2 {}
L 4 -130 -10 130 -10 {}
L 4 -130 10 130 10 {}
L 4 -130 -10 -130 10 {}
L 4 130 -10 130 10 {}