src/hg/lib/netCart.c 1.2
1.2 2010/05/11 01:43:30 kent
Refactoring to split the trackDb.tableName field into separate track and table fields. Similarly track.mapName field goes to the same track and table fields.
Index: src/hg/lib/netCart.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/netCart.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 1000000 -r1.1 -r1.2
--- src/hg/lib/netCart.c 18 Mar 2009 18:27:00 -0000 1.1
+++ src/hg/lib/netCart.c 11 May 2010 01:43:30 -0000 1.2
@@ -1,68 +1,68 @@
/* netCart.c - take care of parsing and combining values from the
* net trackDb optional settings and the same values that may be
* in the cart.
*/
#include "common.h"
#include "jksql.h"
#include "trackDb.h"
#include "cart.h"
#include "dystring.h"
#include "hui.h"
#include "netCart.h"
static char const rcsid[] = "$Id$";
enum netColorEnum netFetchColorOption(struct cart *cart, struct trackDb *tdb,
boolean compositeLevel)
/****** netColorOption - Chrom colors by default **************************/
{
char *netColor = NULL;
enum netColorEnum ret;
netColor = trackDbSettingClosestToHomeOrDefault(tdb, NET_COLOR, CHROM_COLORS);
/* trackDb can be netColor=Chromosome or netColor=grayScale,
need to translate grayScale into "Gray scale" */
if (sameWord(TDB_GRAY_SCALE,netColor))
netColor = GRAY_SCALE;
/* and then, allow cart to override trackDb */
ret = netColorStringToEnum(
cartUsualStringClosestToHome(cart, tdb, compositeLevel, NET_COLOR,
netColor));
return(ret);
} /* enum netColorEnum netFetchColorOption() */
enum netLevelEnum netFetchLevelOption(struct cart *cart, struct trackDb *tdb,
boolean compositeLevel)
/****** netLevelOption - net level 0 (All levels) by default ***********/
{
char *netLevel = NULL;
enum netLevelEnum ret;
netLevel = trackDbSettingClosestToHomeOrDefault(tdb, NET_LEVEL, "0");
/* trackDb can be netLevel=0 thru netLevel=1, need to translate that
number into enum strings */
/* assume "All levels" first */
ret = netLevelStringToEnum(NET_LEVEL_0);
switch(sqlUnsigned(netLevel))
{
case 0: break;
case 1: ret = netLevelStringToEnum(NET_LEVEL_1); break;
case 2: ret = netLevelStringToEnum(NET_LEVEL_2); break;
case 3: ret = netLevelStringToEnum(NET_LEVEL_3); break;
case 4: ret = netLevelStringToEnum(NET_LEVEL_4); break;
case 5: ret = netLevelStringToEnum(NET_LEVEL_5); break;
case 6: ret = netLevelStringToEnum(NET_LEVEL_6); break;
- default: warn("trackDb setting %s=%s for table %s is unrecognized, should be in range [0-6]",
- NET_LEVEL, netLevel, tdb->tableName);
+ default: warn("trackDb setting %s=%s for track %s is unrecognized, should be in range [0-6]",
+ NET_LEVEL, netLevel, tdb->track);
break;
}
/* allow cart to override trackDb */
ret = netLevelStringToEnum(
cartUsualStringClosestToHome(cart, tdb, compositeLevel, NET_LEVEL,
netLevelEnumToString(ret)));
return(ret);
} /* enum netLevelEnum netFetchLevelOption() */