1d117a71a704be36027f6781fc393f0f0d2b2c0b tdreszer Mon Jul 19 10:50:56 2010 -0700 Fixed dimZ bug that Jim noticed. Also cleand up failed nesting diff --git src/hg/lib/hui.c src/hg/lib/hui.c index dfafacf..a32cfc9 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -2406,6 +2406,7 @@ dimensions_t *dimensions; members_t* members[27]; char* checkedTags[27]; // FIXME: Should move checkedTags into membersForAll->members[ix]->selected; + char letters[27]; } membersForAll_t; static char* abcMembersChecked(struct trackDb *parentTdb, struct cart *cart, members_t* members, char letter) @@ -2442,10 +2443,7 @@ if(currentlyCheckedTags == NULL) currentlyCheckedTags = dyStringCreate(members->tags[mIx]); else - { - dyStringAppendC(currentlyCheckedTags,','); - dyStringAppend(currentlyCheckedTags,members->tags[mIx]); - } + dyStringPrintf(currentlyCheckedTags,",%s",members->tags[mIx]); } } if(currentlyCheckedTags) @@ -2480,6 +2478,7 @@ { // NOTE: Don't I wish I had made these as an slList ages ago! (tim) membersForAll->members[ixOut] = membersForAll->members[ixIn]; membersForAll->checkedTags[ixOut] = membersForAll->checkedTags[ixIn]; + membersForAll->letters[ixOut] = membersForAll->letters[ixIn]; } ixOut++; } @@ -2501,6 +2500,7 @@ int ix; membersForAll = needMem(sizeof(membersForAll_t)); membersForAll->members[dimV]=subgroupMembersGet(parentTdb,"view"); +membersForAll->letters[dimV]='V'; membersForAll->dimMax=dimA; // This can expand, depending upon ABC dimensions membersForAll->dimensions = dimensionSettingsGet(parentTdb); if(membersForAll->dimensions != NULL) @@ -2511,14 +2511,21 @@ if(letter != 'X' && letter != 'Y') { membersForAll->members[membersForAll->dimMax]=subgroupMembersGet(parentTdb, membersForAll->dimensions->subgroups[ix]); + membersForAll->letters[membersForAll->dimMax]=letter; if(cart != NULL) membersForAll->checkedTags[membersForAll->dimMax] = abcMembersChecked(parentTdb,cart,membersForAll->members[membersForAll->dimMax],letter); membersForAll->dimMax++; } else if(letter == 'X') + { membersForAll->members[dimX]=subgroupMembersGet(parentTdb, membersForAll->dimensions->subgroups[ix]); + membersForAll->letters[dimX]=letter; + } else + { membersForAll->members[dimY]=subgroupMembersGet(parentTdb, membersForAll->dimensions->subgroups[ix]); + membersForAll->letters[dimY]=letter; + } } } membersForAll->abcCount = membersForAll->dimMax - dimA; @@ -2549,7 +2556,11 @@ for(ix=0;ixdimMax && membersForAll->letters[abcIx] != letter;abcIx++) ; // Advance to correct letter + if (abcIx >= membersForAll->dimMax) + errAbort("Invalid 'filterComposite' trackDb setting. Dimension '%s' not found.",dim); if(sameWord(filterGroups[ix],"one")) membersForAll->members[abcIx]->fcType = fctOne; else if(sameWord(filterGroups[ix],"onlyOne") || sameWord(filterGroups[ix],"oneOnly")) @@ -5661,9 +5672,9 @@ { int ixX,cntX=0; if(dimensionY) - printf("%s", dimensionX->groupTitle); + printf("%s", dimensionX->groupTitle); else - printf("  %s",(top?"TOP":"BOTTOM"), dimensionX->groupTitle); + printf("  %s",(top?"TOP":"BOTTOM"), dimensionX->groupTitle); for (ixX = 0; ixX < dimensionX->count; ixX++) { @@ -5680,19 +5691,19 @@ { if(dimensionY) { - printf("%s", dimensionX->groupTitle); + printf("%s", dimensionX->groupTitle); printf("All ",top?"TOP":"BOTTOM"); buttonsForAll(); puts(""); } else - printf("%s  ",top?"TOP":"BOTTOM", dimensionX->groupTitle); + printf("%s  ",top?"TOP":"BOTTOM", dimensionX->groupTitle); } } else if(dimensionY) { printf(""); - printf("%s", dimensionY->groupTitle); + printf("%s", dimensionY->groupTitle); printf(""); buttonsForAll(); puts(""); @@ -5710,7 +5721,7 @@ if(dimensionX && dimensionY) { int ixX,cntX=0; - printf("%s",COLOR_BG_ALTDEFAULT, dimensionY->groupTitle); + printf("%s",COLOR_BG_ALTDEFAULT, dimensionY->groupTitle); for (ixX = 0; ixX < dimensionX->count; ixX++) // Special row of +- +- +- { if(dimensionX->subtrackList && dimensionX->subtrackList[ixX] && dimensionX->subtrackList[ixX]->val) @@ -5725,7 +5736,7 @@ } // If dimension is big enough, then add Y buttons to right as well if(cntX>MATRIX_RIGHT_BUTTONS_AFTER) - printf("%s", dimensionY->groupTitle); + printf("%s", dimensionY->groupTitle); puts("\n"); } } @@ -5802,7 +5813,7 @@ boolean alreadySet=FALSE; if(membersForAll->members[ix]->selected != NULL) alreadySet = membersForAll->members[ix]->selected[aIx]; - safef(objName, sizeof(objName), "%s.mat_%s_dim%c_cb",parentTdb->track,membersForAll->members[ix]->tags[aIx], 'A' + (ix - dimA)); + safef(objName, sizeof(objName), "%s.mat_%s_dim%c_cb",parentTdb->track,membersForAll->members[ix]->tags[aIx],membersForAll->letters[ix]); safef(javascript,sizeof(javascript),"onclick='matCbClick(this);' class=\"matCB abc %s\"",membersForAll->members[ix]->tags[aIx]); // TODO Set classes properly (if needed!!!) The class abc works but what about a b or c? cgiMakeCheckBoxJS(objName,alreadySet,javascript); @@ -6110,7 +6121,7 @@ } if(cells[ixX][ixY] > 0) { - boolean halfChecked = (chked[ixX][ixY] > 0 && chked[ixX][ixY] != enabd[ixX][ixY]); + boolean halfChecked = (chked[ixX][ixY] > 0 && chked[ixX][ixY] < enabd[ixX][ixY]); struct dyString *dyJS = dyStringCreate("onclick='matCbClick(this);'"); if(dimensionX && dimensionY) @@ -6212,7 +6223,7 @@ if (hasSubgroups) { puts("Select subtracks:"); - puts("    All                     "); + puts("    All                     "); } else { @@ -6274,7 +6285,7 @@ if(sameWord(subGroup,"view")) continue; // Multi-view should have taken care of "view" subgroup already puts (""); - printf("", words[1]); + printf("", words[1]); for (j = 2; j < wordCnt; j++) { if (!parseAssignment(words[j], &name, &value))
    %s
    %s