/[ascend]/trunk/tcltk98/generic/interface/BrowserQuery.h
ViewVC logotype

Annotation of /trunk/tcltk98/generic/interface/BrowserQuery.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations) (download) (as text)
Fri Oct 29 20:54:12 2004 UTC (17 years, 7 months ago) by aw0a
Original Path: trunk/ascend4/interface/BrowserQuery.h
File MIME type: text/x-chdr
File size: 14187 byte(s)
Setting up web subdirectory in repository
1 aw0a 1 /*
2     * BrowserQuery.h
3     * by Kirk Abbott and Ben Allan
4     * Created: 1/94
5     * Version: $Revision: 1.17 $
6     * Version control file: $RCSfile: BrowserQuery.h,v $
7     * Date last modified: $Date: 2003/08/23 18:43:04 $
8     * Last modified by: $Author: ballan $
9     *
10     * This file is part of the ASCEND Tcl/Tk interface
11     *
12     * Copyright 1997, Carnegie Mellon University
13     *
14     * The ASCEND Tcl/Tk interface is free software; you can redistribute
15     * it and/or modify it under the terms of the GNU General Public License as
16     * published by the Free Software Foundation; either version 2 of the
17     * License, or (at your option) any later version.
18     *
19     * The ASCEND Tcl/Tk interface is distributed in hope that it will be
20     * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22     * General Public License for more details.
23     *
24     * You should have received a copy of the GNU General Public License
25     * along with the program; if not, write to the Free Software Foundation,
26     * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
27     * COPYING. COPYING is found in ../compiler.
28     */
29    
30     #ifndef __BrowserInst_io_module__
31     #define __BrowserInst_io_module__
32    
33    
34     extern int Asc_BrowIsRelationCmd(ClientData cdata, Tcl_Interp *interp,
35     int argc, CONST84 char *argv[]);
36     /*
37     * Asc_BrowIsRelationCmd;
38     * Registered as: __brow_isrelation ?current?search?.
39     *
40     * Will return 1, if the the instance in question is of relation type
41     * of is an array, of array ... of relation. The normal InstanceType
42     * routines return the empty string for array of relations, and it is
43     * sometimes handy to know apriori what the type of the array is.
44     */
45    
46     extern int Asc_BrowIsLogRelCmd(ClientData cdata, Tcl_Interp *interp,
47     int argc, CONST84 char *argv[]);
48     /*
49     * Asc_BrowIsLogRelCmd;
50     * Registered as: __brow_islogrel ?current?search?.
51     *
52     * Will return 1, if the the instance in question is of logical relation
53     * type of is an array, of array ... of logical relation. The normal
54     * InstanceType routines return the empty string for array of logical
55     * relations, and it is sometimes handy to know apriori what the type of
56     * the array is.
57     */
58    
59     extern int Asc_BrowIsWhenCmd(ClientData cdata, Tcl_Interp *interp,
60     int argc, CONST84 char *argv[]);
61     /*
62     * Asc_BrowIsWhenCmd;
63     * Registered as: __brow_iswhen ?current?search?.
64     *
65     * Will return 1, if the the instance in question is of when
66     * type of is an array, of array ... of when. The normal
67     * InstanceType routines return the empty string for array of whens,
68     * and it is sometimes handy to know apriori what the type of
69     * the array is.
70     */
71    
72     extern int Asc_BrowIsInstanceInWhenCmd(ClientData cdata, Tcl_Interp *interp,
73     int argc, CONST84 char *argv[]);
74     /*
75     * Asc_BrowIsInstanceInWhenCmd;
76     * Registered as: __brow_isinstanceinwhen ?current?search?.
77     *
78     * Will return 1, if the the instance in question may be in the list
79     * of variables or in some CASE of a WHEN Statement: boolean, integer,
80     * symbol, relations.
81     */
82    
83     extern int Asc_BrowIsModelCmd(ClientData cdata, Tcl_Interp *interp,
84     int argc, CONST84 char *argv[]);
85     /*
86     * Asc_BrowIsModelCmd;
87     * Registered as: __brow_ismodel ?current?search?.
88     *
89     * Will return 1, if the the instance in question is of model type
90     * of is an array, of array ... of model. The normal InstanceType
91     * routines return the empty string for array of models, and it is
92     * sometimes handy to know apriori what the type of the array is.
93     */
94    
95     extern struct gl_list_t *Asc_BrowShortestPath(CONST struct Instance *i,
96     CONST struct Instance *ref,
97     unsigned int, unsigned int);
98     /*
99     * Returns the shortest path (instance pointers) from i back to ref.
100     * If ref NULL, goes to top of instance tree.
101     * Usage: path = Asc_BrowShortestPath(i,ref,0,UINT_MAX);
102     * The search is recursive on the unsigned arguments.
103     */
104    
105     extern int Asc_BrowWriteNameRec(char *fname, CONST struct InstanceName *rec);
106     /*
107     * Write the string in the given rec into the fname buffer in the
108     * ascend interface format. fname is assumed big enough.
109     * This call being exported as very handy elsewhere, e.g. solver. baa
110     */
111    
112     extern int Asc_BrowWriteAtomValue(char *ftorv, CONST struct Instance *i);
113     /*
114     * Assumes ftorv is big enough and writes some value appropriate for
115     * the instance i into the string ftorv.
116     * This should be done with a DString in the compiler.
117     */
118    
119    
120     extern int Asc_BrowWriteInstanceNameCmd(ClientData cdata, Tcl_Interp *interp,
121     int argc, CONST84 char *argv[]);
122     /*
123     * int Asc_BrowWriteInstanceName;
124     * Comment: registered as \"iname inst\" - no args"
125     * Print the instance's name to the specified file. The shortest path to
126     * root is always printed. For the purposes of interface1, root is always
127     * the 'first' instance of a simulation (aka as the simulation base ptr)
128     * or NULL. Will accept the symbolic name of a pointer in the form of
129     * current of search as the basis of its queries.
130     */
131    
132     extern int Asc_BrowCountNamesCmd(ClientData cdata, Tcl_Interp *interp,
133     int argc, CONST84 char *argv[]);
134     /*
135     * int Asc_BrowCountNamesCmd;
136     * Registered as "count_names"
137     * Returns the counts of ALIASES for all instances in the entire subtree
138     * given current or search.
139     * returned is a list (with labels) of:
140     * total unique instances counted.
141     * total ATOM-like instances counted (ATOM, constant,set)
142     * total names of these atoms.
143     * total creating names of these atoms.
144     * total relation-like instances (relation, logical, when)
145     * total names of these relations.
146     * total creating names of these relations.
147     * total MODEL instances counted.
148     * total names of these models.
149     * total creating names of these models.
150     * total array instances counted.
151     * total names of these arrays.
152     * total creating names of these arrays.
153     */
154    
155     extern int Asc_BrowWriteAliasesCmd(ClientData cdata, Tcl_Interp *interp,
156     int argc, CONST84 char *argv[]);
157     /*
158     * int Asc_BrowWriteAliases;
159     * Comments : registered as "ALIASES"
160     * Print the instance's names to the interpreter.
161     */
162    
163     extern int Asc_BrowWriteISAsCmd(ClientData cdata, Tcl_Interp *interp,
164     int argc, CONST84 char *argv[]);
165     /*
166     * int Asc_BrowWriteISAs;
167     * Comments : registered as \"isas\"
168     * Print the instance's construction names to the interpreter.
169     */
170    
171     extern int Asc_BrowWriteCliqueCmd(ClientData cdata, Tcl_Interp *interp,
172     int argc, CONST84 char *argv[]);
173     /*
174     * int Asc_WriteClique(f,i)
175     * Comments : registered as \"cliques\"
176     * Print all the instance's clique members.
177     */
178    
179     extern int Asc_BrowWriteInstanceCmd(ClientData cdata, Tcl_Interp *interp,
180     int argc, CONST84 char *argv[]);
181     /*
182     * Asc_BrowWriteInstanceCmd(cdata,interp,argc,argv)
183     * Registered as : */
184     #define Asc_BrowWriteInstanceCmdHN "brow_child_list"
185     #define Asc_BrowWriteInstanceCmdHU \
186     "<current,search> <all,N> [\"TYPE\",\"VALUE\"] [\"ATOMS\"] [\"PASSED\"]"
187     /* Comments :
188     * Print i's children in a form that we can readily stuff into the
189     * childBoxes in the Browser. Will take the symbolic name of a pointer
190     * i.e. current or search, to use as the basis of its queries. Will
191     * also accept attributes in the form of TYPE, VALUE, ATOMS
192     * to determine what form the information is returned.
193     */
194    
195     extern int Asc_BrowWriteAtomChildren(Tcl_Interp *, CONST struct Instance *);
196     /*
197     * Asc_BrowWriteAtomChildren
198     * Append the children of an atom (with values in display units) to
199     * the interp->result as list elements.
200     */
201    
202     extern int Asc_BrowWriteDimensions(char *fdims, CONST dim_type *dimp);
203     /*
204     * Nearly the string equivalent of PrintDimen in dimen.c, except:
205     * a) this one writes in proper dimensions
206     * b) fdims has the dimensionality of dimp _appended_ to it, except as d
207     * c) fdims is assumed long enough.
208     * d) if dimensionality is wild or none, a * overwrites the string.
209     */
210    
211     extern int Asc_BrowIsPlotAllowedCmd(ClientData cdata, Tcl_Interp *interp,
212     int argc, CONST84 char *argv[]);
213     /*
214     * int Asc_BrowIsPlotAllowedCmd;
215     * Registered as : \"b_isplottable ?cur?search?.
216     * Will accept the current of search instance and determine if the type
217     * of the instance is 'plottable'. The current implementation makes use
218     * of the type `plt_plot' as the basis of this decision. Will return 1
219     * if TRUE, 0 otherwise. This function should not exist.
220     */
221    
222     extern int Asc_BrowPreparePlotFileCmd(ClientData cdata, Tcl_Interp *interp,
223     int argc, CONST84 char *argv[]);
224     /*
225     * int Asc_BrowPreparePlotFileCmd;
226     * Registered as : \"b_prepplotfile\" inst filename type.
227     * Will operate on the current or the search instance to produce a file
228     * that may be plotted by the existing plotting programs. Requires a
229     * filename arguement and an optional plot_type specifier
230     * PLAIN_PLOT, GNU_PLOT, XGRAPH_PLOT.
231     */
232    
233     extern int Asc_BrowRefinesMeCmd(ClientData cdata, Tcl_Interp *interp,
234     int argc, CONST84 char *argv[]);
235     /*
236     * int Asc_BrowRefinesMeCmd;
237     * Registered as : \"irefines_me\";
238     * Will return ALL the library types that refine the current instance.
239     * If instance typedesc is out of sync with library, returns none.
240     * Will return the empty string if not refined by any types.
241     */
242    
243     extern int Asc_BrowWriteValues(ClientData cdata, Tcl_Interp *interp,
244     int argc, CONST84 char *argv[]);
245     /*
246     * bwritevalues [qlfdid] filename acmd <current,root,qlfdid>
247     * Write out the real and boolean values of an instance tree starting
248     * at the instance indicated to a file filname. current/root refer to
249     * browser. qlfdid is a full id. Only the first letter of the last arg
250     * is significant.
251     * acmd is the string that will be prefixed to the qlfdid value pair,
252     * eg. bwritevalues /tmp/val.txt "ASSIGN {sim" current is one way to write
253     * the values, using the script ASSIGN command. acmd could also be
254     * qassign {sim. As neither of these is the obvious choice in all circum-
255     * stances, the command allows choice.
256     * note that the simulation name should be part of acmd and an open
257     * brace should be provided because a close brace after the name will
258     * be printed.
259     */
260    
261     extern int Asc_BrowFindTypeCmd(ClientData cdata, Tcl_Interp *interp,
262     int argc, CONST84 char *argv[]);
263     /*
264     * Implementation of find by type. More will be said later.
265     * Old Usage : __brow_find_type type attribute ?value?
266     * New usage:
267     * __brow_find_type <current,search> <typename> [attr [loval [hival]]]
268     *
269     * The Tcl window corresponding to this function has 4 boxes to fill.
270     * Type, Atributtes, Low Value and High Value.
271     *
272     * There is nothing about this function from Kirk. After looking trough
273     * the code, I can make the following remarks.
274     *
275     * 1) The default context for finding by type is the instance currently
276     * highlighted.
277     * 2) Obviously, the type one wants to find has to be provided in the first
278     * box of the Tcl window.
279     * 3) For each type of instance, there exists a filtering function
280     * which will perform according to the values given in the other
281     * 3 boxes. When the type one provides is a Model or an
282     * array, the filtering functions of these types do nothing.
283     * 4) The box Attributes correponds to the children of the type
284     * selected. So, for example, "included" is a valid attribute of
285     * a relation.
286     * 5) When the Attribute is provided, the value of the
287     * attribute should also be provided in the box "Low Value", if
288     * applicable. For example, for the attribute "included" a valid
289     * value is TRUE (or FALSE). In this way, one can ask for
290     * specific relations among the total list.
291     * 6) There are two special attributes, which do not correpond to
292     * children of an instance: "VALUE" and "UNDEFINED".
293     * i)For example, if the type requested is a boolean, we can
294     * use the attribute VALUE for finding booleans with a particular
295     * value. The value selected should be provided in the box "Lower
296     * Value". This capability can be used for boolean, integer,
297     * symbol, relation, and logic_relation.
298     * Similarly, "UNDEFINED" is used when the value of
299     * a symbol, integer or real has not been defined. In that case
300     * the last two boxes are left empty.
301     * ii)Specifically for the type "relation", the Attribute "VALUE" is
302     * associated with the residual of the relation. We can specify
303     * the range of the residuals we are interesting in, by using the
304     * last two boxes.
305     *
306     * My modification to this function is an extension to deal with
307     * logical relations, and whens. For conditional relations I did
308     * nothing. They will show up in the list of relations. For whens,
309     * I do the same as the case of models and arrays. For Logrelations,
310     * the filtering can be done in terms of the logical residual.
311     * Note that for this case, Feasibles Lower Value for the attribute
312     * "VALUE" are "TRUE" and "FALSE".
313     *
314     * VRR
315     */
316    
317     extern int Asc_BrowRelationRelopCmd(ClientData cdata, Tcl_Interp *interp,
318     int argc, CONST84 char *argv[]);
319     /*
320     * Usage : __brow_reln_relop ?cur?search?.
321     * Returns the a string describing the type of the relation. Valid
322     * results are:
323     * equal, notequal, less, greater, maximize, minimize.
324     */
325    
326     extern int Asc_BrowClearVarsCmd(ClientData cdata, Tcl_Interp *interp,
327     int argc, CONST84 char *argv[]);
328     /*
329     * Asc_BrowClearVarsCmd
330     * usage: free_all_vars [qlfdid]
331     * Sets fixed flag of all variables to FALSE in Browser current instance,or if
332     * qlfdid given, in the qlfdid instance.
333     */
334    
335     #endif /* __BrowserInst_io_module__ */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22