propagate hilight nets when descending with "Alt-e" (in new window or tab) - ***needs some testing***
This commit is contained in:
parent
a33888b0e9
commit
2300597ca3
|
|
@ -642,6 +642,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
if '3' argument is given combine '1' and '2' </pre>
|
||||
<li><kbd> copy</kbd></li><pre>
|
||||
Copy selection to clipboard </pre>
|
||||
<li><kbd> copy_hilights</kbd></li><pre>
|
||||
Copy hilights hash table from previous schematic to new created tab/window </pre>
|
||||
<li><kbd> copy_hierarchy to from</kbd></li><pre>
|
||||
Copy hierarchy info from tab/window "from" to tab/window "to"
|
||||
Example: xschem copy_hierarchy .drw .x1.drw </pre>
|
||||
|
|
@ -1768,6 +1770,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -206,6 +206,38 @@ Hilight_hashentry *hier_hilight_hash_lookup(const char *token, int value, const
|
|||
return entry;
|
||||
}
|
||||
|
||||
/* copy hilight hash table to new created schematic. Used for Alt-e descend */
|
||||
void copy_hilights(void)
|
||||
{
|
||||
int i;
|
||||
Hilight_hashentry **entry, **new_entry;
|
||||
Xschem_ctx *old_xctx = get_old_xctx();
|
||||
|
||||
for(i=0;i<HASHSIZE; ++i) {
|
||||
entry = &old_xctx->hilight_table[i];
|
||||
new_entry = &xctx->hilight_table[i];
|
||||
while(entry && *entry) {
|
||||
Hilight_hashentry *new = (Hilight_hashentry *)my_calloc(_ALLOC_ID_, 1, sizeof( Hilight_hashentry ));
|
||||
|
||||
if(*new_entry) (*new_entry) = new;
|
||||
xctx->hilight_nets = 1;
|
||||
|
||||
my_strdup2(_ALLOC_ID_, &(new->token), (*entry)->token);
|
||||
my_strdup2(_ALLOC_ID_, &(new->path), (*entry)->path);
|
||||
new->hash = (*entry)->hash;
|
||||
new->oldvalue = (*entry)->oldvalue;
|
||||
new->value = (*entry)->value;
|
||||
new->time = (*entry)->time;
|
||||
new->next = NULL;
|
||||
|
||||
*new_entry = new;
|
||||
entry = &(*entry)->next;
|
||||
new_entry = &(*new_entry)->next;
|
||||
}
|
||||
if(*new_entry) (*new_entry)->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* what:
|
||||
* 1: list only nets
|
||||
* 2: list only intances
|
||||
|
|
|
|||
|
|
@ -669,6 +669,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
/* copy_hilights
|
||||
* Copy hilights hash table from previous schematic to new created tab/window */
|
||||
else if(!strcmp(argv[1], "copy_hilights"))
|
||||
{
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
copy_hilights();
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
/* copy_hierarchy to from
|
||||
* Copy hierarchy info from tab/window "from" to tab/window "to"
|
||||
|
|
@ -1464,7 +1472,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
break;
|
||||
case 'l':
|
||||
if(!strcmp(argv[2], "last_created_window")) { /* return win_path of last created tab or window */
|
||||
Tcl_SetResult(interp, get_last_created_window(), TCL_VOLATILE);
|
||||
Tcl_SetResult(interp, get_last_created_window_path(), TCL_VOLATILE);
|
||||
}
|
||||
else if(!strcmp(argv[2], "lastsel")) { /* number of selected objects */
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
|
|
|
|||
16
src/xinit.c
16
src/xinit.c
|
|
@ -43,6 +43,7 @@ static char window_path[MAX_NEW_WINDOWS][WINDOW_PATH_SIZE];
|
|||
/* ==0 if no additional windows/tabs, ==1 if one additional window/tab, ... */
|
||||
static int window_count = 0;
|
||||
static int last_created_window = -1;
|
||||
static Xschem_ctx *old_xctx;
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* EWMH message handling routines 20071027... borrowed from wmctrl code */
|
||||
|
|
@ -95,7 +96,18 @@ char *get_window_path(int i)
|
|||
return window_path[i];
|
||||
}
|
||||
|
||||
char *get_last_created_window(void)
|
||||
Xschem_ctx *get_old_xctx(void)
|
||||
{
|
||||
return old_xctx;
|
||||
}
|
||||
|
||||
|
||||
int get_last_created_window(void)
|
||||
{
|
||||
return last_created_window;
|
||||
}
|
||||
|
||||
char *get_last_created_window_path(void)
|
||||
{
|
||||
if(last_created_window >= 0) {
|
||||
return window_path[last_created_window];
|
||||
|
|
@ -1653,6 +1665,7 @@ static void create_new_window(int *window_count, const char *noconfirm, const ch
|
|||
win_id = Tk_WindowId(Tk_NameToWindow(interp, window_path[n], mainwindow));
|
||||
Tk_ChangeWindowAttributes(Tk_NameToWindow(interp, window_path[n], mainwindow), CWBackingStore, &winattr);
|
||||
}
|
||||
old_xctx = xctx;
|
||||
xctx = NULL;
|
||||
alloc_xschem_data(toppath, window_path[n]); /* alloc data into xctx */
|
||||
xctx->netlist_type = CAD_SPICE_NETLIST; /* for new windows start with spice netlist mode */
|
||||
|
|
@ -1764,6 +1777,7 @@ static void create_new_tab(int *window_count, const char *noconfirm, const char
|
|||
|
||||
my_snprintf(win_path, S(win_path), ".x%d.drw", i);
|
||||
my_strncpy(window_path[i], win_path, S(window_path[i]));
|
||||
old_xctx = xctx;
|
||||
xctx = NULL;
|
||||
alloc_xschem_data("", win_path); /* alloc data into xctx */
|
||||
xctx->netlist_type = CAD_SPICE_NETLIST; /* for new windows start with spice netlist mode */
|
||||
|
|
|
|||
|
|
@ -1535,10 +1535,12 @@ extern int get_tab_or_window_number(const char *win_path);
|
|||
extern void swap_tabs(void);
|
||||
extern void swap_windows(int dr);
|
||||
extern int check_loaded(const char *f, char *win_path);
|
||||
extern char *get_last_created_window(void);
|
||||
extern char *get_last_created_window_path(void);
|
||||
extern int get_last_created_window(void);
|
||||
extern char *get_window_path(int i);
|
||||
extern int get_window_count(void);
|
||||
extern Xschem_ctx **get_save_xctx(void);
|
||||
extern Xschem_ctx *get_old_xctx(void);
|
||||
extern void link_symbols_to_instances(int from);
|
||||
extern void load_ascii_string(char **ptr, FILE *fd);
|
||||
extern char *read_line(FILE *fp, int dbg_level);
|
||||
|
|
@ -1737,6 +1739,7 @@ extern void propagate_hilights(int set, int clear, int mode);
|
|||
extern void select_connected_nets(int stop_at_junction);
|
||||
extern char *resolved_net(const char *net);
|
||||
extern void draw_hilight_net(int on_window);
|
||||
extern void copy_hilights(void);
|
||||
extern void display_hilights(int what, char **str);
|
||||
extern void redraw_hilights(int clear);
|
||||
extern void set_tcl_netlist_type(void);
|
||||
|
|
|
|||
|
|
@ -3988,6 +3988,7 @@ proc open_sub_schematic {{inst {}} {inst_number 0}} {
|
|||
set res [xschem schematic_in_new_window force]
|
||||
# if successfull descend into indicated sub-schematic
|
||||
if {$res} {
|
||||
xschem copy_hilights
|
||||
xschem new_schematic switch [xschem get last_created_window]
|
||||
if { $rawfile ne {}} {
|
||||
if {$sim_type eq {op}} {
|
||||
|
|
|
|||
Loading…
Reference in New Issue