Index: excitation.c =================================================================== --- excitation.c (revision 30954) +++ excitation.c (revision 30955) @@ -86,7 +86,7 @@ if (orig != NULL) { hv.lng = strtol(orig, &end, 10); if (*end != '\0') { - rnd_message(PCB_MSG_ERROR, "Invalid integer value in board attribute '%s': '%s'\n", attrkey, orig); + rnd_message(RND_MSG_ERROR, "Invalid integer value in board attribute '%s': '%s'\n", attrkey, orig); hv.lng = 0; } } @@ -115,7 +115,7 @@ if (*end != '\0') { while(isspace(*end)) end++; if (rnd_strcasecmp(end, "hz") != 0) { - rnd_message(PCB_MSG_ERROR, "Invalid real value (Hz) in board attribute '%s': '%s'\n", attrkey, orig); + rnd_message(RND_MSG_ERROR, "Invalid real value (Hz) in board attribute '%s': '%s'\n", attrkey, orig); hv.dbl = 0; } } @@ -187,10 +187,10 @@ double f0 = 0, fc = 0; if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "gaussian::f0"), &f0)) - rnd_message(PCB_MSG_ERROR, "Gauss excitation: unable to parse frequency gaussian::f0\n"); + rnd_message(RND_MSG_ERROR, "Gauss excitation: unable to parse frequency gaussian::f0\n"); if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "gaussian::fc"), &fc)) - rnd_message(PCB_MSG_ERROR, "Gauss excitation: unable to parse frequency gaussian::fc\n"); + rnd_message(RND_MSG_ERROR, "Gauss excitation: unable to parse frequency gaussian::fc\n"); return pcb_strdup_printf("FDTD = SetGaussExcite(FDTD, %f, %f);", fc, f0); } @@ -225,7 +225,7 @@ double f0; if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "sinusoidal::f0"), &f0)) - rnd_message(PCB_MSG_ERROR, "Sinus excitation: unable to parse frequency sinusoidal::f0\n"); + rnd_message(RND_MSG_ERROR, "Sinus excitation: unable to parse frequency sinusoidal::f0\n"); return pcb_strdup_printf("FDTD = SetSinusExcite(FDTD, %f);", f0); } @@ -265,7 +265,7 @@ double f0; if (!to_hz(rnd_attribute_get(&PCB->Attributes, AEPREFIX "custom::f0"), &f0)) - rnd_message(PCB_MSG_ERROR, "Custom excitation: unable to parse frequency custom::f0\n"); + rnd_message(RND_MSG_ERROR, "Custom excitation: unable to parse frequency custom::f0\n"); return pcb_strdup_printf( "FDTD = SetCustomExcite(FDTD, %f, %s)", @@ -371,7 +371,7 @@ hv.lng = exc_ctx.selected; if ((exc_ctx.selected < 0) || (exc_ctx.selected >= sizeof(excitations)/sizeof(excitations[0]))) { - rnd_message(PCB_MSG_ERROR, "Invalid excitation selected\n"); + rnd_message(RND_MSG_ERROR, "Invalid excitation selected\n"); exc_ctx.selected = 0; } @@ -410,7 +410,7 @@ if (excnames[0] == NULL) { for(n = 0, e = excitations; e->name != NULL; n++,e++) { if (n >= MAX_EXC) { - rnd_message(PCB_MSG_ERROR, "internal error: too many excitations"); + rnd_message(RND_MSG_ERROR, "internal error: too many excitations"); break; } excnames[n] = e->name; @@ -470,7 +470,7 @@ pcb_dlg_exc(); else if (strcmp(op, "select") == 0) { if (a1 == NULL) { - rnd_message(PCB_MSG_ERROR, "OpenemsExcitation(select) needs a excitation name"); + rnd_message(RND_MSG_ERROR, "OpenemsExcitation(select) needs a excitation name"); goto error; } rnd_attribute_put(&PCB->Attributes, AEPREFIX "type", a1); @@ -485,7 +485,7 @@ case 4: a1 = excitations[exc_ctx.selected].name; start = 2; break; case 5: start = 3; break; default: - rnd_message(PCB_MSG_ERROR, "OpenemsExcitation(set) needs exactly 2 or 3 more arguments"); + rnd_message(RND_MSG_ERROR, "OpenemsExcitation(set) needs exactly 2 or 3 more arguments"); goto error; } @@ -506,7 +506,7 @@ case 3: a1 = excitations[exc_ctx.selected].name; start = 2; break; case 4: start = 3; break; default: - rnd_message(PCB_MSG_ERROR, "OpenemsExcitation(get) needs exactly 1 or 2 more arguments"); + rnd_message(RND_MSG_ERROR, "OpenemsExcitation(get) needs exactly 1 or 2 more arguments"); goto error; } @@ -528,7 +528,7 @@ static char *pcb_openems_excitation_get(pcb_board_t *pcb) { if ((exc_ctx.selected < 0) || (exc_ctx.selected >= sizeof(excitations)/sizeof(excitations[0]))) { - rnd_message(PCB_MSG_ERROR, "No excitation selected\n"); + rnd_message(RND_MSG_ERROR, "No excitation selected\n"); return rnd_strdup("%% ERROR: no excitation selected\n"); } return excitations[exc_ctx.selected].get(exc_ctx.selected); Index: export_openems.c =================================================================== --- export_openems.c (revision 30954) +++ export_openems.c (revision 30955) @@ -375,7 +375,7 @@ if (*end == '\0') resistance = tmp; else - rnd_message(PCB_MSG_WARNING, "Ignoring invalid openems::resistance value for port %s: '%s' (must be a number without suffix)\n", port_name, att); + rnd_message(RND_MSG_WARNING, "Ignoring invalid openems::resistance value for port %s: '%s' (must be a number without suffix)\n", port_name, att); } att = rnd_attribute_get(&o->Attributes, "openems::active"); @@ -385,7 +385,7 @@ else if (rnd_strcasecmp(att, "false") == 0) act = 0; else - rnd_message(PCB_MSG_WARNING, "Ignoring invalid openems::active value for port %s: '%s' (must be true or false)\n", port_name, att); + rnd_message(RND_MSG_WARNING, "Ignoring invalid openems::active value for port %s: '%s' (must be true or false)\n", port_name, att); } for(s = safe_name; *s != '\0'; s++) @@ -408,15 +408,15 @@ bot = (pcb_pstk_shape(ps, PCB_LYT_COPPER | PCB_LYT_BOTTOM, 0) != NULL); intern = (pcb_pstk_shape(ps, PCB_LYT_INTERN | PCB_LYT_BOTTOM, 0) != NULL); if (intern) { - rnd_message(PCB_MSG_ERROR, "Can not export openems vport %s: it has internal copper\n(must be either top or bottom copper)\n", port_name); + rnd_message(RND_MSG_ERROR, "Can not export openems vport %s: it has internal copper\n(must be either top or bottom copper)\n", port_name); return -1; } if (top && bot) { - rnd_message(PCB_MSG_ERROR, "Can not export openems vport %s: it has both top and bottom copper\n", port_name); + rnd_message(RND_MSG_ERROR, "Can not export openems vport %s: it has both top and bottom copper\n", port_name); return -1; } if (!top && !bot) { - rnd_message(PCB_MSG_ERROR, "Can not export openems vport %s: it does not have copper either on top or bottom\n", port_name); + rnd_message(RND_MSG_ERROR, "Can not export openems vport %s: it does not have copper either on top or bottom\n", port_name); return -1; } @@ -430,7 +430,7 @@ *gstep = -1; } if (gid1 < 0) { - rnd_message(PCB_MSG_ERROR, "Can not export openems vport %s: can not find top or bottom layer group ID\n", port_name); + rnd_message(RND_MSG_ERROR, "Can not export openems vport %s: can not find top or bottom layer group ID\n", port_name); return -1; } @@ -445,7 +445,7 @@ if (pcb->LayerGroups.grp[gid2].ltype & PCB_LYT_COPPER) return gid2; - rnd_message(PCB_MSG_ERROR, "Can not export openems vport %s: can not find pair layer\n", port_name); + rnd_message(RND_MSG_ERROR, "Can not export openems vport %s: can not find pair layer\n", port_name); return -1; } @@ -467,7 +467,7 @@ if (o->type == PCB_OBJ_SUBC) { if (!ctx->warn_subc_term) - rnd_message(PCB_MSG_ERROR, "Subcircuit being a terminal is not supported.\n"); + rnd_message(RND_MSG_ERROR, "Subcircuit being a terminal is not supported.\n"); ctx->warn_subc_term = 1; continue; } @@ -501,7 +501,7 @@ break; default: if (!ctx->warn_port_pstk) - rnd_message(PCB_MSG_ERROR, "Only padstacks can be openems ports at the moment\n"); + rnd_message(RND_MSG_ERROR, "Only padstacks can be openems ports at the moment\n"); ctx->warn_port_pstk = 1; break; } @@ -717,7 +717,7 @@ case PCB_HID_COMP_POSITIVE_XOR: break; case PCB_HID_COMP_NEGATIVE: - rnd_message(PCB_MSG_ERROR, "Can't draw composite layer, especially not on copper\n"); + rnd_message(RND_MSG_ERROR, "Can't draw composite layer, especially not on copper\n"); break; case PCB_HID_COMP_FLUSH: break; @@ -808,7 +808,7 @@ static void openems_calibrate(pcb_hid_t *hid, double xval, double yval) { - rnd_message(PCB_MSG_ERROR, "openems_calibrate() not implemented"); + rnd_message(RND_MSG_ERROR, "openems_calibrate() not implemented"); return; } Index: mesh.c =================================================================== --- mesh.c (revision 30954) +++ mesh.c (revision 30955) @@ -60,7 +60,7 @@ subst_thick = pcb_board_thickness(PCB, "openems", PCB_BRDTHICK_PRINT_ERROR); if (subst_thick <= 0) { - rnd_message(PCB_MSG_ERROR, "Assuming 1.5mm thick substrate because of the missing thickness attributes.\nFeel free to change it in the mesh dialog or add the attributes to the substrate groups."); + rnd_message(RND_MSG_ERROR, "Assuming 1.5mm thick substrate because of the missing thickness attributes.\nFeel free to change it in the mesh dialog or add the attributes to the substrate groups."); subst_thick = PCB_MM_TO_COORD(1.5); } @@ -186,12 +186,12 @@ int v; \ char *end; \ if (n->type != LHT_TEXT) { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh item: " #name " should be text\n"); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh item: " #name " should be text\n"); \ return -1; \ } \ v = strtol(n->data.text.value, &end, 10); \ if (*end != '\0') { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh integer: " #name "\n"); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh integer: " #name "\n"); \ return -1; \ } \ PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, lng, v); \ @@ -205,12 +205,12 @@ double v; \ rnd_bool succ; \ if (n->type != LHT_TEXT) { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh item: " #name " should be text\n"); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh item: " #name " should be text\n"); \ return -1; \ } \ v = pcb_get_value(n->data.text.value, NULL, NULL, &succ); \ if (!succ) { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh coord: " #name "\n"); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh coord: " #name "\n"); \ return -1; \ } \ PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, crd, (rnd_coord_t)v); \ @@ -223,7 +223,7 @@ int __found__ = 0, __n__; \ const char **__a__; \ if (node->type != LHT_TEXT) { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh value: " #name " should be text\n"); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh value: " #name " should be text\n"); \ return -1; \ } \ if (strcmp(node->data.text.value, "invalid") == 0) break; \ @@ -234,7 +234,7 @@ } \ } \ if (!__found__) { \ - rnd_message(PCB_MSG_ERROR, "Invalid mesh value '%s' for " #name "\n", node->data.text.value); \ + rnd_message(RND_MSG_ERROR, "Invalid mesh value '%s' for " #name "\n", node->data.text.value); \ return -1; \ } \ PCB_DAD_SET_VALUE(me->dlg_hid_ctx, dst, lng, __n__); \ @@ -246,7 +246,7 @@ lht_node_t *lst, *nd; if ((root->type != LHT_HASH) || (strcmp(root->name, "pcb-rnd-mesh-v1") != 0)) { - rnd_message(PCB_MSG_ERROR, "Input is not a valid mesh save - should be a ha:pcb-rnd-mesh subtree\n"); + rnd_message(RND_MSG_ERROR, "Input is not a valid mesh save - should be a ha:pcb-rnd-mesh subtree\n"); return -1; } @@ -271,7 +271,7 @@ if (lst != NULL) { int n; if (lst->type != LHT_LIST) { - rnd_message(PCB_MSG_ERROR, "Boundary shall be a list\n"); + rnd_message(RND_MSG_ERROR, "Boundary shall be a list\n"); return -1; } for(n = 0, nd = lst->data.list.first; (n < 6) && (nd != NULL); n++,nd = nd->next) @@ -512,7 +512,7 @@ pcb_range_t *r; if (vtr0_len(&mesh->line[dir].dens) < 1) { - rnd_message(PCB_MSG_ERROR, "There are not enough objects to do the meshing\n"); + rnd_message(RND_MSG_ERROR, "There are not enough objects to do the meshing\n"); return -1; } @@ -528,7 +528,7 @@ vtc0_remove(&mesh->line[dir].edge, n+1, 1); } else - rnd_message(PCB_MSG_ERROR, "meshing error: invalid minimum spacing (%$mm) required: forced %s edges are closer than that around %$mm..%$mm; try decreasing your minimum spacing to below %$mm\n", mesh->min_space, dir == PCB_MESH_VERTICAL ? "vertical" : "horizonal", c1, c2, c2-c1); + rnd_message(RND_MSG_ERROR, "meshing error: invalid minimum spacing (%$mm) required: forced %s edges are closer than that around %$mm..%$mm; try decreasing your minimum spacing to below %$mm\n", mesh->min_space, dir == PCB_MESH_VERTICAL ? "vertical" : "horizonal", c1, c2, c2-c1); } } @@ -982,7 +982,7 @@ f = pcb_fopen_askovr(&PCB->hidlib, fname, "w", NULL); if (f == NULL) { - rnd_message(PCB_MSG_ERROR, "Can not open '%s' for write\n", fname); + rnd_message(RND_MSG_ERROR, "Can not open '%s' for write\n", fname); return; } @@ -1012,11 +1012,11 @@ f = pcb_fopen(&PCB->hidlib, fname, "r"); if (f == NULL) { - rnd_message(PCB_MSG_ERROR, "Can not open '%s' for read\n", fname); + rnd_message(RND_MSG_ERROR, "Can not open '%s' for read\n", fname); return; } if (mesh_load_file(&ia, f) != 0) - rnd_message(PCB_MSG_ERROR, "Loading mesh settings from '%s' failed.\n", fname); + rnd_message(RND_MSG_ERROR, "Loading mesh settings from '%s' failed.\n", fname); fclose(f); }