gattrib
|
Functions to manipulate the TOPLEVEL struct. More...
#include <config.h>
#include <stdio.h>
#include <math.h>
#include <libgeda/libgeda.h>
#include "../include/struct.h"
#include "../include/prototype.h"
#include "../include/globals.h"
Go to the source code of this file.
Functions | |
int | s_toplevel_read_page (TOPLEVEL *toplevel, char *filename) |
Read a schematic page. | |
void | s_toplevel_verify_design (TOPLEVEL *toplevel) |
Verify the entire design. | |
void | s_toplevel_gtksheet_to_toplevel (TOPLEVEL *toplevel) |
Copy data from gtksheet into TOPLEVEL struct. | |
void | s_toplevel_add_new_attrib (gchar *new_attrib_name) |
Add a new attribute to the top level. | |
void | s_toplevel_delete_attrib_col () |
Delete an attribute column. | |
void | s_toplevel_sheetdata_to_toplevel (TOPLEVEL *toplevel, PAGE *page) |
Copy SHEET_DATA content to TOP_LEVEL. | |
STRING_LIST * | s_toplevel_get_component_attribs_in_sheet (char *refdes) |
Get the component attributes from the top level. | |
void | s_toplevel_update_component_attribs_in_toplevel (TOPLEVEL *toplevel, OBJECT *o_current, STRING_LIST *new_comp_attrib_list) |
Update component attributes in TOP_LEVEL. | |
STRING_LIST * | s_toplevel_get_net_attribs_in_sheet (char *netname) |
void | s_toplevel_update_net_attribs_in_toplevel (OBJECT *o_current, STRING_LIST *new_net_attrib_list) |
STRING_LIST * | s_toplevel_get_pin_attribs_in_sheet (char *refdes, OBJECT *pin) |
Get pin attributes. | |
void | s_toplevel_update_pin_attribs_in_toplevel (TOPLEVEL *toplevel, char *refdes, OBJECT *o_pin, STRING_LIST *new_pin_attrib_list) |
Update pin attributes in toplevel. |
This file holds functions involved in manipulating the TOPLEVEL data structure. TOPLEVEL is the data structure inherited from gEDA's other programs, and holds all info about a project in a form native to gEDA.
Definition in file s_toplevel.c.
int s_toplevel_read_page | ( | TOPLEVEL * | toplevel, |
char * | filename | ||
) |
Reads in a schematic page & calls f_open, which fills out the toplevel structure.
toplevel | TOPLEVEL structure |
filename | file to be opened |
Definition at line 64 of file s_toplevel.c.
void s_toplevel_verify_design | ( | TOPLEVEL * | toplevel | ) |
This function loops through all components in the design looking for components which are placeholders.
Placeholders are inserted into the object list when no symbol file is found. If this function finds a placeholder, it warns the user.
toplevel | pointer to the toplevel object to be verified |
Definition at line 96 of file s_toplevel.c.
void s_toplevel_gtksheet_to_toplevel | ( | TOPLEVEL * | toplevel | ) |
Called when the user invokes "save". It first places all data from gtksheet into SHEET_DATA. Then it loops through all pages & calls s_toplevel_sheetdata_to_toplevel() to place all stuff in SHEET_DATA into the libgeda TOPLEVEL structure.
Definition at line 135 of file s_toplevel.c.
void s_toplevel_add_new_attrib | ( | gchar * | new_attrib_name | ) |
This function gets called when the user has entered a new attrib name, and clicked the OK button. It does this:
new_attrib_name | attribute to be added |
Definition at line 183 of file s_toplevel.c.
void s_toplevel_delete_attrib_col | ( | ) |
This function gets called when the user has selected a single attrib column, selected the edit->delete attrib item from the pull-down menu, and then said "yes" to the confirm dialog.
Definition at line 279 of file s_toplevel.c.
void s_toplevel_sheetdata_to_toplevel | ( | TOPLEVEL * | toplevel, |
PAGE * | page | ||
) |
This function loops through all objects on (PAGE page)->(OBJECT *start_obj). It takes the updated SHEET_DATA->TABLE data and then updates the objects with the new attribs & attrib values. For each component, it updates the attached attrib values using the updated values held in the SHEET_DATA->TABLE structure. It does so in three steps:
toplevel | TOPLEVEL structure |
page | schematic page to copy |
Definition at line 394 of file s_toplevel.c.
STRING_LIST* s_toplevel_get_component_attribs_in_sheet | ( | char * | refdes | ) |
This function returns a list of attributes attached to obj_name = comp refdes or netlist.
refdes | component refdes to return values from |
Definition at line 534 of file s_toplevel.c.
void s_toplevel_update_component_attribs_in_toplevel | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
STRING_LIST * | new_comp_attrib_list | ||
) |
For each attrib string attached to the component, update it using the value held in new_comp_attrib_list. Algorithm:
toplevel | TOPLEVEL structure |
o_current | Component (complex) to be updated. |
new_comp_attrib_list | list of name=value attribute pairs from SHEET_DATA. |
Definition at line 623 of file s_toplevel.c.
STRING_LIST* s_toplevel_get_net_attribs_in_sheet | ( | char * | netname | ) |
Definition at line 832 of file s_toplevel.c.
void s_toplevel_update_net_attribs_in_toplevel | ( | OBJECT * | o_current, |
STRING_LIST * | new_net_attrib_list | ||
) |
Definition at line 843 of file s_toplevel.c.
STRING_LIST* s_toplevel_get_pin_attribs_in_sheet | ( | char * | refdes, |
OBJECT * | pin | ||
) |
This function takes a pointer to the OBJECT pin, and returns a list of attribs found attached to the pin. The returned list is a STRING_LIST where the ->data holds a name=value string. The algorithm is as follows:
refdes | Ref des string |
pin | Pin object |
Definition at line 868 of file s_toplevel.c.
void s_toplevel_update_pin_attribs_in_toplevel | ( | TOPLEVEL * | toplevel, |
char * | refdes, | ||
OBJECT * | o_pin, | ||
STRING_LIST * | new_pin_attrib_list | ||
) |
For each attrib string attached to the pin, update it using the value held in new_pin_attrib_list. Algorithm:
toplevel | TOPLEVEL structure | |
refdes | Unused - needs refactored out | |
[in,out] | o_pin | pin to update |
[in] | new_pin_attrib_list | New pin attribute list to apply |
Definition at line 964 of file s_toplevel.c.