Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 8310) +++ trunk/scconfig/Rev.h (revision 8311) @@ -1 +1 @@ -static const int myrev = 8169; +static const int myrev = 8311; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 8310) +++ trunk/scconfig/Rev.tab (revision 8311) @@ -1,3 +1,4 @@ +8311 configure new sources for sim gui 8169 configure lib_target: support plugin to get some attributes put in the tEDAx netlist 8150 configure bom export plugin 8124 configure sch_dialogs: stance dialog Index: trunk/src/plugins/sch_dialogs/Plug.tmpasm =================================================================== --- trunk/src/plugins/sch_dialogs/Plug.tmpasm (revision 8310) +++ trunk/src/plugins/sch_dialogs/Plug.tmpasm (revision 8311) @@ -10,6 +10,7 @@ $(PLUGDIR)/sch_dialogs/dlg_library.o $(PLUGDIR)/sch_dialogs/dlg_attrib.o $(PLUGDIR)/sch_dialogs/dlg_stance.o + $(PLUGDIR)/sch_dialogs/dlg_cond.o $(PLUGDIR)/sch_dialogs/dlg_abstract.o $(PLUGDIR)/sch_dialogs/dlg_view.o $(PLUGDIR)/sch_dialogs/dlg_project.o Index: trunk/src/plugins/sch_dialogs/dlg_cond.c =================================================================== --- trunk/src/plugins/sch_dialogs/dlg_cond.c (nonexistent) +++ trunk/src/plugins/sch_dialogs/dlg_cond.c (revision 8311) @@ -0,0 +1,358 @@ +/* + * COPYRIGHT + * + * cschem - modular/flexible schematics editor - GUI + * Copyright (C) 2023 Tibor 'Igor2' Palinkas + * + * (Supported by NLnet NGI0 Entrust in 2023) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/sch-rnd + * contact lead developer: http://www.repo.hu/projects/sch-rnd/contact.html + * mailing list: http://www.repo.hu/projects/sch-rnd/contact.html + */ + +/* stance configuration dialog */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "quick_attr_util.h" + +/*** Conditional ***/ + +typedef enum { CDLG_DNP, CDLG_OMIT } cond_dlg_type_t; + +typedef struct cond_dlg_ctx_s { + RND_DAD_DECL_NOINIT(dlg) + + csch_sheet_t *sheet; + csch_oidpath_t idp; + const char *attr_name; + cond_dlg_type_t type; + + int wcond, wscript; + + void *obj; /* for the hash */ +} cond_dlg_ctx_t; + +static htpp_t obj2dlg; + +static void cond_apply(cond_dlg_ctx_t *ctx) +{ + vts0_t lst = {0}; + rnd_hid_attribute_t *atxt = &ctx->dlg[ctx->wscript]; + rnd_hid_text_t *txt = atxt->wdata; + char *tmp = txt->hid_get_text(atxt, ctx->dlg_hid_ctx), *s, *next; + csch_source_arg_t *src = csch_attrib_src_c(NULL, 0, 0, "ConditionalDialog input"); + csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->sheet, &ctx->idp); + + if (obj == NULL) { + rnd_message(RND_MSG_ERROR, "ConditionalDialog: can't apply: object does not exist\n"); + rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wcond, 0); + rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wscript, 0); + return; + } + + vts0_append(&lst, (char *)ctx->dlg[ctx->wcond].val.str); + for(s = tmp; (s != NULL) && (*s != '\0'); s = next) { + next = strpbrk(s, "\r\n"); + if (next != NULL) { + *next = '\0'; + next++; + } + vts0_append(&lst, s); + } + + csch_attrib_set_arr(&obj->attr, CSCH_ATP_USER_DEFAULT, ctx->attr_name, &lst, src, NULL); + csch_sheet_set_changed(obj->hdr.sheet, 1); + free(tmp); + vts0_uninit(&lst); +} + + +static void cond_dlg_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) +{ + cond_dlg_ctx_t *ctx = caller_data; + + if (ctx->dlg_ret_override->value == 1) + cond_apply(ctx); + + csch_oidpath_free(&ctx->idp); + + htpp_pop(&obj2dlg, ctx->obj); + free(ctx); +} + +static void cond_obj2dlg(cond_dlg_ctx_t *ctx) +{ + csch_attrib_t *fa; + rnd_hid_attr_val_t hv; + gds_t tmp = {0}; + csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->sheet, &ctx->idp); + + if (obj == NULL) { + rnd_message(RND_MSG_ERROR, "ConditionalDialog: can't apply: object does not exist\n"); + rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wcond, 0); + rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wscript, 0); + return; + } + + fa = csch_attrib_get(&obj->attr, ctx->attr_name); + + if ((fa == NULL) || (fa->arr.used < 1)) + hv.str = "stance.model != \"standard\""; + else + hv.str = fa->arr.array[0]; + + rnd_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wcond, &hv); + + if ((fa == NULL) || (fa->arr.used < 2)) { + switch(ctx->type) { + case CDLG_DNP: gds_append_str(&tmp, "scalar,dnp\nsub,^.*$,yes,dnp\n"); break; + case CDLG_OMIT: gds_append_str(&tmp, "scalar,omit\nsub,^.*$,yes,omit\n"); break; + } + } + else { + long n; + for(n = 1; n < fa->arr.used; n++) { + gds_append_str(&tmp, fa->arr.array[n]); + gds_append(&tmp, '\n'); + } + } + + hv.str = tmp.array; + rnd_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wscript, &hv); + gds_uninit(&tmp); +} + +static void cond_apply_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) +{ + cond_apply(caller_data); +} + +int sch_rnd_conditional_dlg(csch_cgrp_t *obj, cond_dlg_type_t type) +{ + cond_dlg_ctx_t *ctx; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", 0}, {"Apply & close", 1}, {NULL, 0}}; + const char *attr_name; + csch_sheet_t *sheet = obj->hdr.sheet; + + while((obj != NULL) && !csch_obj_is_grp(&obj->hdr)) obj = obj->hdr.parent; + + if ((obj == NULL) || (obj == &sheet->direct)) { + rnd_message(RND_MSG_ERROR, "sch_rnd_conditional_dlg(): object is not in a group\n"); + return -1; + } + + if ((obj->role != CSCH_ROLE_SYMBOL) && (obj->role != CSCH_ROLE_WIRE_NET)) { + rnd_message(RND_MSG_ERROR, "sch_rnd_conditional_dlg(): group shall be a symbol or a wirenet\n"); + return -1; + } + + switch(type) { + case CDLG_DNP: attr_name = "forge-if/dnp"; break; + case CDLG_OMIT: attr_name = "forge-if/omit"; break; + default: return -1; + } + + ctx = htpp_get(&obj2dlg, obj); + if (ctx != NULL) { + TODO("raise?"); + return 0; + } + + ctx = calloc(sizeof(cond_dlg_ctx_t), 1); + ctx->obj = obj; + ctx->sheet = sheet; + ctx->attr_name = attr_name; + ctx->type = type; + + htpp_set(&obj2dlg, obj, ctx); + csch_oidpath_from_obj(&ctx->idp, &obj->hdr); + + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Attribute: "); + RND_DAD_LABEL(ctx->dlg, ctx->attr_name); + RND_DAD_END(ctx->dlg); + + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Cond.:"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + ctx->wcond = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, "Script:"); + RND_DAD_TEXT(ctx->dlg, ""); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wscript = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Apply"); + RND_DAD_CHANGE_CB(ctx->dlg, cond_apply_cb); + + RND_DAD_BEGIN_VBOX(ctx->dlg); /* spring */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + + RND_DAD_END(ctx->dlg); + + RND_DAD_DEFSIZE(ctx->dlg, 300, 400); + RND_DAD_NEW("ConditionalDialog", ctx->dlg, "Conditional forge quick edit", ctx, 0, cond_dlg_close_cb); /* type=local */ + + cond_obj2dlg(ctx); + return 0; +} + +void csch_dlg_cond_preunload(csch_sheet_t *sheet) +{ + htpp_entry_t *e; + rnd_dad_retovr_t retovr = {0}; + + for(e = htpp_first(&obj2dlg); e != NULL; e = htpp_next(&obj2dlg, e)) { + cond_dlg_ctx_t *ctx = e->value; + if (ctx->sheet == sheet) + rnd_hid_dad_close(ctx->dlg_hid_ctx, &retovr, 0); + } +} + +const char csch_acts_ConditionalDialog[] = "ConditionalDialog(object, dnp|omit)"; +const char csch_acth_ConditionalDialog[] = "Open the conditional helper dialog for an object.\n"; +fgw_error_t csch_act_ConditionalDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + rnd_design_t *hidlib = RND_ACT_DESIGN; + csch_sheet_t *sheet = (csch_sheet_t *)hidlib; + const char *stype; + csch_chdr_t *obj; + int cmd; + cond_dlg_type_t type; + + CSCH_ACT_CONVARG_OBJ(1, ConditionalDialog, cmd, obj); + RND_ACT_MAY_CONVARG(2, FGW_STR, ConditionalDialog, stype = argv[2].val.cstr); + + if (rnd_strcasecmp(stype, "dnp") == 0) type = CDLG_DNP; + else if (rnd_strcasecmp(stype, "omit") == 0) type = CDLG_OMIT; + else { + rnd_message(RND_MSG_ERROR, "ConditionalDialog(): invalid second argument (type)\n"); + return FGW_ERR_ARG_CONV; + } + + switch(cmd) { + case F_Object: + { + csch_coord_t x, y; + + if (obj == NULL) { + if (sch_rnd_get_coords("Click on a symbol for editing conditionals", &x, &y, 0) != 0) + break; + obj = sch_rnd_search_obj_at(sheet, x, y, sch_rnd_slop); + if (obj == NULL) { + rnd_message(RND_MSG_ERROR, "ConditionalDialog(): no symbol under cursor\n"); + break; + } + } + } + break; + default: + rnd_message(RND_MSG_ERROR, "ConditionalDialog(): invalid first argument\n"); + return FGW_ERR_ARG_CONV; + } + + return sch_rnd_conditional_dlg((csch_cgrp_t *)obj, type); +} + +const char csch_acts_quick_attr_forge__if__dnp[] = "quick_attr_forge__if__dnp(objptr)"; +const char csch_acth_quick_attr_forge__if__dnp[] = "Qucik Attribute Edit for the standard forge-if/dnp attribute"; +const char csch_acts_quick_attr_forge__if__omit[] = "quick_attr_forge__if__dnp(objptr)"; +const char csch_acth_quick_attr_forge__if__omit[] = "Qucik Attribute Edit for the standard forge-if/omit attribute"; +fgw_error_t csch_act_quick_attr_forge__if__dnp_omit(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + const char *fname = argv[0].val.argv0.func->name; + csch_cgrp_t *grp; + + if (strlen(fname) < 22) { + rnd_message(RND_MSG_ERROR, "csch_act_quick_attr_forge__if__dnp_omit(): called with invalid name '%s' (1)\n", fname); + return FGW_ERR_ARG_CONV; + } + + QUICK_ATTR_GET_GRP(grp, "csch_act_quick_attr_forge__if__dnp_omit"); + + switch(fname[22]) { + case 'd': sch_rnd_conditional_dlg(grp, CDLG_DNP); break; + case 'o': sch_rnd_conditional_dlg(grp, CDLG_OMIT); break; + default: + rnd_message(RND_MSG_ERROR, "csch_act_quick_attr_forge__if__dnp_omit(): called with invalid name '%s' (2)\n", fname); + return FGW_ERR_ARG_CONV; + } + + return 0; +} + + + +/*** Common ***/ + +static const char cookie[] = "cond gui"; +void csch_dlg_cond_init(void) +{ + htpp_init(&obj2dlg, ptrhash, ptrkeyeq); +} + +void csch_dlg_cond_uninit(void) +{ + rnd_dad_retovr_t retovr = {0}; + htpp_entry_t *e; + + for(e = htpp_first(&obj2dlg); e != NULL; e = htpp_next(&obj2dlg, e)) { + cond_dlg_ctx_t *ctx = e->value; + rnd_hid_dad_close(ctx->dlg_hid_ctx, &retovr, 0); + } + htpp_uninit(&obj2dlg); +} Index: trunk/src/plugins/sch_dialogs/dlg_cond.h =================================================================== --- trunk/src/plugins/sch_dialogs/dlg_cond.h (nonexistent) +++ trunk/src/plugins/sch_dialogs/dlg_cond.h (revision 8311) @@ -0,0 +1,13 @@ +void csch_dlg_cond_init(void); +void csch_dlg_cond_uninit(void); + + +extern const char csch_acts_ConditionalDialog[]; +extern const char csch_acth_ConditionalDialog[]; +fgw_error_t csch_act_ConditionalDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv); + +extern const char csch_acts_quick_attr_forge__if__dnp[]; +extern const char csch_acth_quick_attr_forge__if__dnp[]; +extern const char csch_acts_quick_attr_forge__if__omit[]; +extern const char csch_acth_quick_attr_forge__if__omit[]; +fgw_error_t csch_act_quick_attr_forge__if__dnp_omit(fgw_arg_t *res, int argc, fgw_arg_t *argv); Index: trunk/src/plugins/sch_dialogs/dlg_stance.c =================================================================== --- trunk/src/plugins/sch_dialogs/dlg_stance.c (revision 8310) +++ trunk/src/plugins/sch_dialogs/dlg_stance.c (revision 8311) @@ -49,12 +49,6 @@ #include #include -#include -#include -#include -#include - -#include "quick_attr_util.h" #include "timed_chg.h" typedef struct stance_dlg_ctx_s { @@ -314,447 +308,7 @@ return 0; } -/*** Conditional ***/ -typedef enum { CDLG_DNP, CDLG_OMIT } cond_dlg_type_t; - -typedef struct cond_dlg_ctx_s { - RND_DAD_DECL_NOINIT(dlg) - - csch_sheet_t *sheet; - csch_oidpath_t idp; - const char *attr_name; - cond_dlg_type_t type; - - int wcond, wscript; - - void *obj; /* for the hash */ -} cond_dlg_ctx_t; - -static htpp_t obj2dlg; - -static void cond_apply(cond_dlg_ctx_t *ctx) -{ - vts0_t lst = {0}; - rnd_hid_attribute_t *atxt = &ctx->dlg[ctx->wscript]; - rnd_hid_text_t *txt = atxt->wdata; - char *tmp = txt->hid_get_text(atxt, ctx->dlg_hid_ctx), *s, *next; - csch_source_arg_t *src = csch_attrib_src_c(NULL, 0, 0, "ConditionalDialog input"); - csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->sheet, &ctx->idp); - - if (obj == NULL) { - rnd_message(RND_MSG_ERROR, "ConditionalDialog: can't apply: object does not exist\n"); - rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wcond, 0); - rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wscript, 0); - return; - } - - vts0_append(&lst, (char *)ctx->dlg[ctx->wcond].val.str); - for(s = tmp; (s != NULL) && (*s != '\0'); s = next) { - next = strpbrk(s, "\r\n"); - if (next != NULL) { - *next = '\0'; - next++; - } - vts0_append(&lst, s); - } - - csch_attrib_set_arr(&obj->attr, CSCH_ATP_USER_DEFAULT, ctx->attr_name, &lst, src, NULL); - csch_sheet_set_changed(obj->hdr.sheet, 1); - free(tmp); - vts0_uninit(&lst); -} - - -static void cond_dlg_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) -{ - cond_dlg_ctx_t *ctx = caller_data; - - if (ctx->dlg_ret_override->value == 1) - cond_apply(ctx); - - csch_oidpath_free(&ctx->idp); - - htpp_pop(&obj2dlg, ctx->obj); - free(ctx); -} - -static void cond_obj2dlg(cond_dlg_ctx_t *ctx) -{ - csch_attrib_t *fa; - rnd_hid_attr_val_t hv; - gds_t tmp = {0}; - csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->sheet, &ctx->idp); - - if (obj == NULL) { - rnd_message(RND_MSG_ERROR, "ConditionalDialog: can't apply: object does not exist\n"); - rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wcond, 0); - rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wscript, 0); - return; - } - - fa = csch_attrib_get(&obj->attr, ctx->attr_name); - - if ((fa == NULL) || (fa->arr.used < 1)) - hv.str = "stance.model != \"standard\""; - else - hv.str = fa->arr.array[0]; - - rnd_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wcond, &hv); - - if ((fa == NULL) || (fa->arr.used < 2)) { - switch(ctx->type) { - case CDLG_DNP: gds_append_str(&tmp, "scalar,dnp\nsub,^.*$,yes,dnp\n"); break; - case CDLG_OMIT: gds_append_str(&tmp, "scalar,omit\nsub,^.*$,yes,omit\n"); break; - } - } - else { - long n; - for(n = 1; n < fa->arr.used; n++) { - gds_append_str(&tmp, fa->arr.array[n]); - gds_append(&tmp, '\n'); - } - } - - hv.str = tmp.array; - rnd_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wscript, &hv); - gds_uninit(&tmp); -} - -static void cond_apply_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) -{ - cond_apply(caller_data); -} - -int sch_rnd_conditional_dlg(csch_cgrp_t *obj, cond_dlg_type_t type) -{ - cond_dlg_ctx_t *ctx; - rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", 0}, {"Apply & close", 1}, {NULL, 0}}; - const char *attr_name; - csch_sheet_t *sheet = obj->hdr.sheet; - - while((obj != NULL) && !csch_obj_is_grp(&obj->hdr)) obj = obj->hdr.parent; - - if ((obj == NULL) || (obj == &sheet->direct)) { - rnd_message(RND_MSG_ERROR, "sch_rnd_conditional_dlg(): object is not in a group\n"); - return -1; - } - - if ((obj->role != CSCH_ROLE_SYMBOL) && (obj->role != CSCH_ROLE_WIRE_NET)) { - rnd_message(RND_MSG_ERROR, "sch_rnd_conditional_dlg(): group shall be a symbol or a wirenet\n"); - return -1; - } - - switch(type) { - case CDLG_DNP: attr_name = "forge-if/dnp"; break; - case CDLG_OMIT: attr_name = "forge-if/omit"; break; - default: return -1; - } - - ctx = htpp_get(&obj2dlg, obj); - if (ctx != NULL) { - TODO("raise?"); - return 0; - } - - ctx = calloc(sizeof(cond_dlg_ctx_t), 1); - ctx->obj = obj; - ctx->sheet = sheet; - ctx->attr_name = attr_name; - ctx->type = type; - - htpp_set(&obj2dlg, obj, ctx); - csch_oidpath_from_obj(&ctx->idp, &obj->hdr); - - RND_DAD_BEGIN_VBOX(ctx->dlg); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - - RND_DAD_BEGIN_HBOX(ctx->dlg); - RND_DAD_LABEL(ctx->dlg, "Attribute: "); - RND_DAD_LABEL(ctx->dlg, ctx->attr_name); - RND_DAD_END(ctx->dlg); - - RND_DAD_BEGIN_HBOX(ctx->dlg); - RND_DAD_LABEL(ctx->dlg, "Cond.:"); - RND_DAD_STRING(ctx->dlg); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - ctx->wcond = RND_DAD_CURRENT(ctx->dlg); - RND_DAD_END(ctx->dlg); - - RND_DAD_BEGIN_HBOX(ctx->dlg); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - RND_DAD_LABEL(ctx->dlg, "Script:"); - RND_DAD_TEXT(ctx->dlg, ""); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wscript = RND_DAD_CURRENT(ctx->dlg); - RND_DAD_END(ctx->dlg); - - RND_DAD_BEGIN_HBOX(ctx->dlg); - RND_DAD_BUTTON(ctx->dlg, "Apply"); - RND_DAD_CHANGE_CB(ctx->dlg, cond_apply_cb); - - RND_DAD_BEGIN_VBOX(ctx->dlg); /* spring */ - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - RND_DAD_END(ctx->dlg); - - RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - RND_DAD_END(ctx->dlg); - - RND_DAD_END(ctx->dlg); - - RND_DAD_DEFSIZE(ctx->dlg, 300, 400); - RND_DAD_NEW("ConditionalDialog", ctx->dlg, "Conditional forge quick edit", ctx, 0, cond_dlg_close_cb); /* type=local */ - - cond_obj2dlg(ctx); - return 0; -} - -void csch_dlg_cond_preunload(csch_sheet_t *sheet) -{ - htpp_entry_t *e; - rnd_dad_retovr_t retovr = {0}; - - for(e = htpp_first(&obj2dlg); e != NULL; e = htpp_next(&obj2dlg, e)) { - cond_dlg_ctx_t *ctx = e->value; - if (ctx->sheet == sheet) - rnd_hid_dad_close(ctx->dlg_hid_ctx, &retovr, 0); - } -} - -const char csch_acts_ConditionalDialog[] = "ConditionalDialog(object, dnp|omit)"; -const char csch_acth_ConditionalDialog[] = "Open the conditional helper dialog for an object.\n"; -fgw_error_t csch_act_ConditionalDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - rnd_design_t *hidlib = RND_ACT_DESIGN; - csch_sheet_t *sheet = (csch_sheet_t *)hidlib; - const char *stype; - csch_chdr_t *obj; - int cmd; - cond_dlg_type_t type; - - CSCH_ACT_CONVARG_OBJ(1, ConditionalDialog, cmd, obj); - RND_ACT_MAY_CONVARG(2, FGW_STR, ConditionalDialog, stype = argv[2].val.cstr); - - if (rnd_strcasecmp(stype, "dnp") == 0) type = CDLG_DNP; - else if (rnd_strcasecmp(stype, "omit") == 0) type = CDLG_OMIT; - else { - rnd_message(RND_MSG_ERROR, "ConditionalDialog(): invalid second argument (type)\n"); - return FGW_ERR_ARG_CONV; - } - - switch(cmd) { - case F_Object: - { - csch_coord_t x, y; - - if (obj == NULL) { - if (sch_rnd_get_coords("Click on a symbol for editing conditionals", &x, &y, 0) != 0) - break; - obj = sch_rnd_search_obj_at(sheet, x, y, sch_rnd_slop); - if (obj == NULL) { - rnd_message(RND_MSG_ERROR, "ConditionalDialog(): no symbol under cursor\n"); - break; - } - } - } - break; - default: - rnd_message(RND_MSG_ERROR, "ConditionalDialog(): invalid first argument\n"); - return FGW_ERR_ARG_CONV; - } - - return sch_rnd_conditional_dlg((csch_cgrp_t *)obj, type); -} - -const char csch_acts_quick_attr_forge__if__dnp[] = "quick_attr_forge__if__dnp(objptr)"; -const char csch_acth_quick_attr_forge__if__dnp[] = "Qucik Attribute Edit for the standard forge-if/dnp attribute"; -const char csch_acts_quick_attr_forge__if__omit[] = "quick_attr_forge__if__dnp(objptr)"; -const char csch_acth_quick_attr_forge__if__omit[] = "Qucik Attribute Edit for the standard forge-if/omit attribute"; -fgw_error_t csch_act_quick_attr_forge__if__dnp_omit(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - const char *fname = argv[0].val.argv0.func->name; - csch_cgrp_t *grp; - - if (strlen(fname) < 22) { - rnd_message(RND_MSG_ERROR, "csch_act_quick_attr_forge__if__dnp_omit(): called with invalid name '%s' (1)\n", fname); - return FGW_ERR_ARG_CONV; - } - - QUICK_ATTR_GET_GRP(grp, "csch_act_quick_attr_forge__if__dnp_omit"); - - switch(fname[22]) { - case 'd': sch_rnd_conditional_dlg(grp, CDLG_DNP); break; - case 'o': sch_rnd_conditional_dlg(grp, CDLG_OMIT); break; - default: - rnd_message(RND_MSG_ERROR, "csch_act_quick_attr_forge__if__dnp_omit(): called with invalid name '%s' (2)\n", fname); - return FGW_ERR_ARG_CONV; - } - - return 0; -} - -/*** test benches ***/ - -typedef struct { - csch_sheet_t *sheet; - csch_oidpath_t idp; - long wchk[1]; /* over-allocated for num_benches */ -} test_bench_obj_t; - -typedef struct { - long wname, wtoggle; -} test_bench_row_t; - -typedef struct test_bench_dlg_ctx_s { - RND_DAD_DECL_NOINIT(dlg) - long num_objs, num_benches; - test_bench_obj_t **obj; - test_bench_row_t row[1]; /* over-allocated for num_benches */ -} test_bench_dlg_ctx_t; - - -static void test_bench_free(test_bench_dlg_ctx_t *ctx) -{ - long n; - - for(n = 0; n < ctx->num_objs; n++) { - csch_oidpath_free(&ctx->obj[n]->idp); - free(ctx->obj[n]); - } - free(ctx); -} - -static void test_bench_dlg_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) -{ - test_bench_free(caller_data); -} - -static void sch_rnd_test_bench_sch2dlg(test_bench_dlg_ctx_t *ctx) -{ - long n, m; - for(n = 0; n < ctx->num_objs; n++) { - csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->obj[n]->sheet, &ctx->obj[n]->idp); - if (obj == NULL) { - for(m = 0; m < ctx->num_benches; m++) - rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->obj[n]->wchk[m], 0); - continue; - } - rnd_trace("obj update!\n"); - } -} - -static int sch_rnd_test_bench_dlg(const vtp0_t *objs, int modal) -{ - test_bench_dlg_ctx_t *ctx; - rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - rnd_conf_listitem_t *item_li; - const char *item_str; - int idx; - long n, numo, numb; - - numb = rnd_conflist_length(&conf_core.stance.test_bench_values); - if (numb < 1) { - rnd_message(RND_MSG_ERROR, "Please define stance.test_bench values first\nHint: file menu, project, project stances\n"); - return -1; - } - - for(n = numo = 0; n < objs->used; n++) { - csch_cgrp_t *g = objs->array[n]; - if (!csch_obj_is_grp(&g->hdr)) continue; - if (g->role != CSCH_ROLE_SYMBOL) continue; - numo++; - } - - if (numo == 0) { - rnd_message(RND_MSG_ERROR, "No symbols included in target objects.\n"); - return -1; - } - - ctx = calloc(sizeof(test_bench_dlg_ctx_t) + sizeof(test_bench_row_t)*numo, 1); - ctx->num_benches = numb; - ctx->num_objs = numo; - ctx->obj = malloc(sizeof(test_bench_obj_t *) * ctx->num_objs); - - for(n = 0; n < ctx->num_objs; n++) { - ctx->obj[n] = calloc(sizeof(test_bench_obj_t) + sizeof(long) * ctx->num_benches, 1); - } - - for(n = numo = 0; n < objs->used; n++) { - csch_cgrp_t *g = objs->array[n]; - if (!csch_obj_is_grp(&g->hdr)) continue; - if (g->role != CSCH_ROLE_SYMBOL) continue; - ctx->obj[numo]->sheet = g->hdr.sheet; - csch_oidpath_from_obj(&ctx->obj[numo]->idp, &g->hdr); - numo++; - } - - - RND_DAD_BEGIN_VBOX(ctx->dlg); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - - RND_DAD_BEGIN_TABLE(ctx->dlg, ctx->num_objs+2); - RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - - /* header row */ - RND_DAD_LABEL(ctx->dlg, "\\"); - for(n = 0; n < ctx->num_objs; n++) { - csch_cgrp_t *grp = (csch_cgrp_t *)csch_oidpath_resolve(ctx->obj[n]->sheet, &ctx->obj[n]->idp); - const char *name = NULL; - if (grp != NULL) - name = csch_attrib_get_str(&grp->attr, "name"); - if (name == NULL) - name = "?"; - RND_DAD_LABEL(ctx->dlg, name); - } - RND_DAD_LABEL(ctx->dlg, ""); - - /* data rows */ - rnd_conf_loop_list_str(&conf_core.stance.test_bench_values, item_li, item_str, idx) { - RND_DAD_LABEL(ctx->dlg, item_str); - ctx->row[idx].wname = RND_DAD_CURRENT(ctx->dlg); - for(n = 0; n < ctx->num_objs; n++) { - RND_DAD_BOOL(ctx->dlg); - ctx->obj[n]->wchk[idx] = RND_DAD_CURRENT(ctx->dlg); - } - RND_DAD_BUTTON(ctx->dlg, "Tgl!"); - RND_DAD_HELP(ctx->dlg, "Toggle all in row: set them all on or all off"); - ctx->row[idx].wtoggle = RND_DAD_CURRENT(ctx->dlg); - } - - RND_DAD_END(ctx->dlg); - RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - RND_DAD_END(ctx->dlg); - - RND_DAD_DEFSIZE(ctx->dlg, 600, 300); - RND_DAD_NEW("TestBenchesDialog", ctx->dlg, "Test benches quick edit", ctx, modal, test_bench_dlg_close_cb); /* type=local */ - - sch_rnd_test_bench_sch2dlg(ctx); - - if (modal) { - RND_DAD_RUN(ctx->dlg); - test_bench_free(ctx); - } - - return 0; -} - - -const char csch_acts_TestBenchDialog[] = "TestBenchDialog(object|selected)"; -const char csch_acth_TestBenchDialog[] = "Open the test bench selector for the current object or for selected objects.\n"; -fgw_error_t csch_act_TestBenchDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv) -{ - rnd_design_t *hidlib = RND_ACT_DESIGN; - csch_sheet_t *sheet = (csch_sheet_t *)hidlib; - vtp0_t lst = {0}; - - csch_search_all_selected(sheet, NULL, &lst, 1); - - sch_rnd_test_bench_dlg(&lst, 0); - vtp0_uninit(&lst); - return 0; -} - - /*** Common ***/ /* trigger gui update if any stance conf changes */ @@ -781,7 +335,6 @@ static rnd_conf_hid_callbacks_t cb = {0}; htpp_init(&prj2dlg, ptrhash, ptrkeyeq); - htpp_init(&obj2dlg, ptrhash, ptrkeyeq); /* get a global conf change callback */ cb.val_change_post = stance_change_post; @@ -799,12 +352,5 @@ } htpp_uninit(&prj2dlg); - for(e = htpp_first(&obj2dlg); e != NULL; e = htpp_next(&obj2dlg, e)) { - cond_dlg_ctx_t *ctx = e->value; - rnd_hid_dad_close(ctx->dlg_hid_ctx, &retovr, 0); - } - htpp_uninit(&obj2dlg); - - rnd_conf_hid_unreg(cookie); } Index: trunk/src/plugins/sch_dialogs/sch_dialogs.c =================================================================== --- trunk/src/plugins/sch_dialogs/sch_dialogs.c (revision 8310) +++ trunk/src/plugins/sch_dialogs/sch_dialogs.c (revision 8311) @@ -48,6 +48,7 @@ #include "dlg_about.h" #include "dlg_abstract.h" #include "dlg_stance.h" +#include "dlg_cond.h" #include "dlg_undo.h" #include "dlg_pen.h" #include "dlg_text.h" @@ -157,6 +158,7 @@ csch_dlg_tree_uninit(); csch_dlg_abst_uninit(); csch_dlg_stance_uninit(); + csch_dlg_cond_uninit(); csch_dlg_library_uninit(); sch_rnd_attr_quick_uninit(); rnd_dlg_pref_uninit(); @@ -173,6 +175,7 @@ csch_dlg_tree_init(); csch_dlg_abst_init(); csch_dlg_stance_init(); + csch_dlg_cond_init(); csch_dlg_library_init(); csch_dlg_undo_init(); rnd_event_bind(CSCH_EVENT_SHEET_PREUNLOAD, csch_dlg_ev_preunload, NULL, sch_dialogs_cookie); Index: trunk/src/plugins/std_forge/Plug.tmpasm =================================================================== --- trunk/src/plugins/std_forge/Plug.tmpasm (revision 8310) +++ trunk/src/plugins/std_forge/Plug.tmpasm (revision 8311) @@ -2,6 +2,7 @@ put /local/rnd/mod/OBJS [@ $(PLUGDIR)/std_forge/std_forge.o $(PLUGDIR)/std_forge/cond_gram.o + $(PLUGDIR)/std_forge/dlg_test_bench.o @] put /local/rnd/mod/BYACCIC {$(PLUGDIR)/std_forge/cond_gram} Index: trunk/src/plugins/std_forge/dlg_test_bench.c =================================================================== --- trunk/src/plugins/std_forge/dlg_test_bench.c (nonexistent) +++ trunk/src/plugins/std_forge/dlg_test_bench.c (revision 8311) @@ -0,0 +1,254 @@ +/* + * COPYRIGHT + * + * cschem - modular/flexible schematics editor - GUI + * Copyright (C) 2023 Tibor 'Igor2' Palinkas + * + * (Supported by NLnet NGI0 Entrust in 2023) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/sch-rnd + * contact lead developer: http://www.repo.hu/projects/sch-rnd/contact.html + * mailing list: http://www.repo.hu/projects/sch-rnd/contact.html + */ + +/* stance configuration dialog */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +/*** test benches ***/ + +typedef struct { + csch_sheet_t *sheet; + csch_oidpath_t idp; + long wchk[1]; /* over-allocated for num_benches */ +} test_bench_obj_t; + +typedef struct { + long wname, wtoggle; +} test_bench_row_t; + +typedef struct test_bench_dlg_ctx_s { + RND_DAD_DECL_NOINIT(dlg) + long num_objs, num_benches; + test_bench_obj_t **obj; + test_bench_row_t row[1]; /* over-allocated for num_benches */ +} test_bench_dlg_ctx_t; + + +static void test_bench_free(test_bench_dlg_ctx_t *ctx) +{ + long n; + + for(n = 0; n < ctx->num_objs; n++) { + csch_oidpath_free(&ctx->obj[n]->idp); + free(ctx->obj[n]); + } + free(ctx); +} + +static void test_bench_dlg_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) +{ + test_bench_free(caller_data); +} + +static void sch_rnd_test_bench_sch2dlg(test_bench_dlg_ctx_t *ctx) +{ + long n, m; + for(n = 0; n < ctx->num_objs; n++) { + csch_cgrp_t *obj = (csch_cgrp_t *)csch_oidpath_resolve(ctx->obj[n]->sheet, &ctx->obj[n]->idp); + if (obj == NULL) { + for(m = 0; m < ctx->num_benches; m++) + rnd_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->obj[n]->wchk[m], 0); + continue; + } + rnd_trace("obj update!\n"); + } +} + +static int sch_rnd_test_bench_dlg(const vtp0_t *objs, int modal) +{ + test_bench_dlg_ctx_t *ctx; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_conf_listitem_t *item_li; + const char *item_str; + int idx; + long n, numo, numb; + + numb = rnd_conflist_length(&conf_core.stance.test_bench_values); + if (numb < 1) { + rnd_message(RND_MSG_ERROR, "Please define stance.test_bench values first\nHint: file menu, project, project stances\n"); + return -1; + } + + for(n = numo = 0; n < objs->used; n++) { + csch_cgrp_t *g = objs->array[n]; + if (!csch_obj_is_grp(&g->hdr)) continue; + if (g->role != CSCH_ROLE_SYMBOL) continue; + numo++; + } + + if (numo == 0) { + rnd_message(RND_MSG_ERROR, "No symbols included in target objects.\n"); + return -1; + } + + ctx = calloc(sizeof(test_bench_dlg_ctx_t) + sizeof(test_bench_row_t)*numo, 1); + ctx->num_benches = numb; + ctx->num_objs = numo; + ctx->obj = malloc(sizeof(test_bench_obj_t *) * ctx->num_objs); + + for(n = 0; n < ctx->num_objs; n++) { + ctx->obj[n] = calloc(sizeof(test_bench_obj_t) + sizeof(long) * ctx->num_benches, 1); + } + + for(n = numo = 0; n < objs->used; n++) { + csch_cgrp_t *g = objs->array[n]; + if (!csch_obj_is_grp(&g->hdr)) continue; + if (g->role != CSCH_ROLE_SYMBOL) continue; + ctx->obj[numo]->sheet = g->hdr.sheet; + csch_oidpath_from_obj(&ctx->obj[numo]->idp, &g->hdr); + numo++; + } + + + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + + RND_DAD_BEGIN_TABLE(ctx->dlg, ctx->num_objs+2); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + + /* header row */ + RND_DAD_LABEL(ctx->dlg, "\\"); + for(n = 0; n < ctx->num_objs; n++) { + csch_cgrp_t *grp = (csch_cgrp_t *)csch_oidpath_resolve(ctx->obj[n]->sheet, &ctx->obj[n]->idp); + const char *name = NULL; + if (grp != NULL) + name = csch_attrib_get_str(&grp->attr, "name"); + if (name == NULL) + name = "?"; + RND_DAD_LABEL(ctx->dlg, name); + } + RND_DAD_LABEL(ctx->dlg, ""); + + /* data rows */ + rnd_conf_loop_list_str(&conf_core.stance.test_bench_values, item_li, item_str, idx) { + RND_DAD_LABEL(ctx->dlg, item_str); + ctx->row[idx].wname = RND_DAD_CURRENT(ctx->dlg); + for(n = 0; n < ctx->num_objs; n++) { + RND_DAD_BOOL(ctx->dlg); + ctx->obj[n]->wchk[idx] = RND_DAD_CURRENT(ctx->dlg); + } + RND_DAD_BUTTON(ctx->dlg, "Tgl!"); + RND_DAD_HELP(ctx->dlg, "Toggle all in row: set them all on or all off"); + ctx->row[idx].wtoggle = RND_DAD_CURRENT(ctx->dlg); + } + + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + + RND_DAD_DEFSIZE(ctx->dlg, 600, 300); + RND_DAD_NEW("TestBenchesDialog", ctx->dlg, "Test benches quick edit", ctx, modal, test_bench_dlg_close_cb); /* type=local */ + + sch_rnd_test_bench_sch2dlg(ctx); + + if (modal) { + RND_DAD_RUN(ctx->dlg); + test_bench_free(ctx); + } + + return 0; +} + + +const char csch_acts_TestBenchDialog[] = "TestBenchDialog(object|selected)"; +const char csch_acth_TestBenchDialog[] = "Open the test bench selector for the current object or for selected objects.\n"; +fgw_error_t csch_act_TestBenchDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv) +{ + rnd_design_t *hidlib = RND_ACT_DESIGN; + csch_sheet_t *sheet = (csch_sheet_t *)hidlib; + vtp0_t lst = {0}; + + csch_search_all_selected(sheet, NULL, &lst, 1); + + sch_rnd_test_bench_dlg(&lst, 0); + vtp0_uninit(&lst); + return 0; +} + + +/*** Common ***/ + +/* trigger gui update if any the test_bench_values stance conf changes */ +static void test_bench_change_post(rnd_conf_native_t *cfg, int arr_idx, void *user_data) +{ + rnd_design_t *curr = rnd_multi_get_current(); +} + +static void test_bench_preunload(rnd_design_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) +{ + +} + +static rnd_conf_hid_id_t test_bench_hid_id; +static const char cookie[] = "test bench gui"; +void csch_dlg_test_bench_init(void) +{ + static rnd_conf_hid_callbacks_t cb; + rnd_conf_native_t *cn = rnd_conf_get_field("stance/test_bench_values"); + + rnd_event_bind(CSCH_EVENT_SHEET_PREUNLOAD, test_bench_preunload, NULL, cookie); + + /* get a global conf change callback */ + cb.val_change_post = test_bench_change_post; + test_bench_hid_id = rnd_conf_hid_reg(cookie, &cb); + + if (cn != NULL) { + memset(&cb, 0, sizeof(rnd_conf_hid_callbacks_t)); + cb.val_change_post = test_bench_change_post; + rnd_conf_hid_set_cb(cn, test_bench_hid_id, &cb); + } +} + +void csch_dlg_test_bench_uninit(void) +{ + rnd_event_unbind_allcookie(cookie); +} Index: trunk/src/plugins/std_forge/dlg_test_bench.h =================================================================== --- trunk/src/plugins/std_forge/dlg_test_bench.h (nonexistent) +++ trunk/src/plugins/std_forge/dlg_test_bench.h (revision 8311) @@ -0,0 +1,6 @@ +void csch_dlg_test_bench_init(void); +void csch_dlg_test_bench_uninit(void); + +extern const char csch_acts_TestBenchDialog[]; +extern const char csch_acth_TestBenchDialog[]; +fgw_error_t csch_act_TestBenchDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv); Index: trunk/src/plugins/std_forge/std_forge.c =================================================================== --- trunk/src/plugins/std_forge/std_forge.c (revision 8310) +++ trunk/src/plugins/std_forge/std_forge.c (revision 8311) @@ -54,6 +54,7 @@ #include #include "cond.h" +#include "dlg_test_bench.h" #if 0 typedef struct { @@ -482,6 +483,7 @@ void pplg_uninit_std_forge(void) { gds_uninit(&stmp); + csch_dlg_test_bench_uninit(); vtl0_uninit(&cond_stack); genht_uninit_deep(htsp, &cond_cache, { forgecond_ctx_t *fc = htent->value; @@ -496,6 +498,7 @@ RND_API_CHK_VER; fgw_eng_reg(&fgw_std_forge_eng); htsp_init(&cond_cache, strhash, strkeyeq); + csch_dlg_test_bench_init(); return 0; } Index: trunk/src/sch-rnd/Makefile.dep =================================================================== --- trunk/src/sch-rnd/Makefile.dep (revision 8310) +++ trunk/src/sch-rnd/Makefile.dep (revision 8311) @@ -659,6 +659,17 @@ ../plugins/sch_dialogs/abst_attr.h ../libcschem/project.h \ ../libcschem/engine.h ../plugins/sch_dialogs/quick_attr.h \ ../plugins/sch_dialogs/dlg_attrib.h +../plugins/sch_dialogs/dlg_cond.o: ../plugins/sch_dialogs/dlg_cond.c \ + ../libcschem/config.h ../libcschem/project.h ../libcschem/common_types.h \ + ../libcschem/concrete.h ../libcschem/rtree.h ../libcschem/attrib.h \ + ../libcschem/oidpath.h ../libcschem/vtoid.h \ + ../../src_3rd/libuundo/uundo.h ../../src_3rd/libminuid/libminuid.h \ + ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ + ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ + ../libcschem/engine.h ../libcschem/event.h ../libcschem/actions_csch.h \ + ../libcschem/search.h ../sch-rnd/crosshair.h ../sch-rnd/draw.h \ + ../sch-rnd/search.h ../sch-rnd/funchash_core.h \ + ../sch-rnd/funchash_core_list.h ../plugins/sch_dialogs/quick_attr_util.h ../plugins/sch_dialogs/dlg_library.o: \ ../plugins/sch_dialogs/dlg_library.c ../libcschem/config.h \ ../libcschem/concrete.h ../libcschem/common_types.h ../libcschem/rtree.h \ @@ -717,10 +728,8 @@ ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ ../libcschem/engine.h ../libcschem/event.h ../libcschem/actions_csch.h \ - ../sch-rnd/crosshair.h ../sch-rnd/draw.h ../sch-rnd/search.h \ - ../sch-rnd/funchash_core.h ../sch-rnd/funchash_core_list.h \ - ../plugins/sch_dialogs/quick_attr_util.h \ - ../plugins/sch_dialogs/timed_chg.h ../sch-rnd/conf_core.h + ../libcschem/search.h ../plugins/sch_dialogs/timed_chg.h \ + ../sch-rnd/conf_core.h ../plugins/sch_dialogs/dlg_text.o: ../plugins/sch_dialogs/dlg_text.c \ ../libcschem/config.h ../libcschem/concrete.h \ ../libcschem/common_types.h ../libcschem/rtree.h ../libcschem/attrib.h \ @@ -787,10 +796,11 @@ ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ ../plugins/sch_dialogs/dlg_about.h ../plugins/sch_dialogs/dlg_abstract.h \ - ../plugins/sch_dialogs/dlg_stance.h ../plugins/sch_dialogs/dlg_undo.h \ - ../plugins/sch_dialogs/dlg_pen.h ../plugins/sch_dialogs/dlg_text.h \ - ../libcschem/cnc_text.h ../libcschem/cnc_text_dyn.h \ - ../plugins/sch_dialogs/dlg_tree.h ../plugins/sch_dialogs/dlg_library.h \ + ../plugins/sch_dialogs/dlg_stance.h ../plugins/sch_dialogs/dlg_cond.h \ + ../plugins/sch_dialogs/dlg_undo.h ../plugins/sch_dialogs/dlg_pen.h \ + ../plugins/sch_dialogs/dlg_text.h ../libcschem/cnc_text.h \ + ../libcschem/cnc_text_dyn.h ../plugins/sch_dialogs/dlg_tree.h \ + ../plugins/sch_dialogs/dlg_library.h \ ../plugins/sch_dialogs/dlg_infobar.c ../sch-rnd/sheet.h \ ../libcschem/plug_io.h ../libcschem/abstract.h ../libcschem/TODO.h \ ../plugins/sch_dialogs/dlg_view.h ../plugins/sch_dialogs/dlg_project.h \ @@ -799,7 +809,13 @@ ../plugins/sch_dialogs/conf_internal.c \ ../plugins/sch_dialogs/adialogs_conf_fields.h ../plugins/sim/sim.o: ../plugins/sim/sim.c ../libcschem/config.h \ - ../plugins/sim/sim.h + ../libcschem/project.h ../libcschem/common_types.h \ + ../libcschem/concrete.h ../libcschem/rtree.h ../libcschem/attrib.h \ + ../libcschem/oidpath.h ../libcschem/vtoid.h \ + ../../src_3rd/libuundo/uundo.h ../../src_3rd/libminuid/libminuid.h \ + ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ + ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ + ../libcschem/engine.h ../plugins/sim/sim.h ../plugins/sim_gui/sim_gui.o: ../plugins/sim_gui/sim_gui.c \ ../libcschem/config.h ../plugins/sim_gui/plot_test.c \ ../plugins/lib_plot/plot_preview.h ../plugins/lib_plot/plot_data.h @@ -808,7 +824,8 @@ ../libcschem/abstract.h ../libcschem/common_types.h \ ../libcschem/attrib.h ../libcschem/TODO.h ../libcschem/engine.h \ ../libcschem/actions_csch.h ../libcschem/libcschem.h \ - ../../src_3rd/libminuid/libminuid.h ../libcschem/util_compile.h + ../../src_3rd/libminuid/libminuid.h ../libcschem/util_compile.h \ + ../plugins/sim/sim.h ../plugins/std_cschem/std_cschem.o: ../plugins/std_cschem/std_cschem.c \ ../libcschem/config.h ../libcschem/abstract.h \ ../libcschem/common_types.h ../libcschem/attrib.h ../libcschem/TODO.h \ @@ -847,6 +864,17 @@ ../plugins/std_forge/cond_gram.h ../plugins/std_forge/cond.h \ ../libcschem/abstract.h ../libcschem/common_types.h \ ../libcschem/config.h ../libcschem/attrib.h ../libcschem/TODO.h +../plugins/std_forge/dlg_test_bench.o: \ + ../plugins/std_forge/dlg_test_bench.c ../libcschem/config.h \ + ../libcschem/project.h ../libcschem/common_types.h \ + ../libcschem/concrete.h ../libcschem/rtree.h ../libcschem/attrib.h \ + ../libcschem/oidpath.h ../libcschem/vtoid.h \ + ../../src_3rd/libuundo/uundo.h ../../src_3rd/libminuid/libminuid.h \ + ../../src_3rd/gengeo2d/typecfg_long_double.h ../../src_3rd/opc89.h \ + ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ + ../libcschem/engine.h ../libcschem/event.h ../libcschem/actions_csch.h \ + ../libcschem/search.h ../sch-rnd/conf_core.h \ + ../plugins/sch_dialogs/quick_attr_util.h ../plugins/std_forge/std_forge.o: ../plugins/std_forge/std_forge.c \ ../libcschem/config.h ../libcschem/abstract.h \ ../libcschem/common_types.h ../libcschem/attrib.h ../libcschem/TODO.h \ @@ -857,7 +885,8 @@ ../../src_3rd/gengeo2d/common.h ../../src_3rd/gengeo2d/prim.h \ ../libcschem/engine.h ../libcschem/actions_csch.h \ ../libcschem/libcschem.h ../libcschem/project.h \ - ../libcschem/util_compile.h ../plugins/std_forge/cond.h + ../libcschem/util_compile.h ../plugins/std_forge/cond.h \ + ../plugins/std_forge/dlg_test_bench.h ../plugins/std_tools/std_tools.o: ../plugins/std_tools/std_tools.c \ ../libcschem/config.h ../libcschem/search.h ../libcschem/concrete.h \ ../libcschem/common_types.h ../libcschem/rtree.h ../libcschem/attrib.h \ Index: trunk/src/sch-rnd/sch-rnd-conf.lht =================================================================== --- trunk/src/sch-rnd/sch-rnd-conf.lht (revision 8310) +++ trunk/src/sch-rnd/sch-rnd-conf.lht (revision 8311) @@ -117,6 +117,14 @@ ha:target_pcb { plugin=target_pcb } } } + ha:sim_spice { + li:engines { + ha:std_forge { plugin=std_forge } + ha:std_cschem { plugin=std_cschem } + ha:std_devmap { plugin=std_devmap } + ha:target_sim_ngspice { plugin=target_sim_ngspice } + } + } ha:spice_raw { li:engines { ha:std_forge { plugin=std_forge }