// dg2.C // implementation of the "Dg" tcl command /* * $Log: dg2.C,v $ * Revision 1.2 1995/11/08 21:45:56 tamches * specialized s.t. only the implementation of the "Dg" tcl command is here * * Revision 1.1 1995/11/04 00:44:11 tamches * First version of new table visi * */ #include // exit() #include #include "tclclean.h" #include "tkclean.h" #include "tkTools.h" #include "tableVisiTcl.h" #include "visi/h/visualization.h" #include "dg2.h" #define AGGREGATE 0 #define BINWIDTH 1 #define FOLDMETHOD 2 #define METRICNAME 3 #define METRICUNITS 4 #define NUMBINS 5 #define NUMMETRICS 6 #define NUMRESOURCES 7 #define DEFINEPHASE 8 #define RESOURCENAME 9 #define STARTSTREAM 10 #define STOPSTREAM 11 #define DGSUM 12 #define DGVALID 13 #define DGENABLED 14 #define VALUE 15 #define CMDERROR 16 #define LASTBUCKET 17 #define FIRSTBUCKET 18 struct cmdTabEntry { const char *cmdname; int index; int numargs; }; static struct cmdTabEntry Dg_Cmds[] = { {"aggregate", AGGREGATE, 2}, {"binwidth", BINWIDTH, 0}, {"firstbucket", FIRSTBUCKET, 2}, {"foldmethod", FOLDMETHOD, 2}, {"lastbucket", LASTBUCKET, 2}, {"metricname", METRICNAME, 1}, {"metricunits", METRICUNITS, 1}, {"numbins", NUMBINS, 0}, {"nummetrics", NUMMETRICS, 0}, {"numresources", NUMRESOURCES, 0}, {"phase", DEFINEPHASE, 3}, {"resourcename", RESOURCENAME, 1}, {"start", STARTSTREAM, 2}, {"stop", STOPSTREAM, 2}, {"sum", DGSUM, 2}, {"valid", DGVALID, 2}, {"enabled", DGENABLED, 2}, {"value", VALUE, 3}, {NULL, CMDERROR, 0} }; int findCommand(Tcl_Interp *interp, int argc, char *argv[]) { if (argc == 0) { sprintf(interp->result, "USAGE: Dg