Changeset 11649 for trunk/FACT++/gui/FactGui.h
- Timestamp:
- 07/27/11 12:23:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11646 r11649 181 181 } 182 182 183 double align(double min, double val, double max) const 184 { 185 if (val<min) 186 return min; 187 if (val>max) 188 return max; 189 return val; 183 int GetCol(double dmin, double val, double dmax, bool enable) 184 { 185 if (!enable) 186 return kWhite; 187 188 if (val<dmin) 189 return kBlue+4;//kBlack; 190 191 if (val>dmax) 192 return kRed+4;//kWhite; 193 194 const double min = dmin; 195 const double scale = dmax==dmin ? 1 : dmax-dmin; 196 197 const int col = (val-min)/scale*(fPalette.size()-1); 198 199 return gStyle->GetColorPalette(col); 190 200 } 191 201 … … 219 229 } 220 230 221 if (fMin <0)231 if (fMin>=0) 222 232 dmin = fMin; 223 if (fMax <0)233 if (fMax>=0) 224 234 dmax = fMax; 225 235 … … 236 246 continue; 237 247 238 const double val = align(dmin, fData[cnt], dmax); 239 240 const int col = (val-min)/scale*(fPalette.size()-1); 241 242 if (fEnable[cnt]) 243 fill.SetFillColor(gStyle->GetColorPalette(col)); 244 else 245 fill.SetFillColor(kWhite); 246 248 const int col = GetCol(dmin, fData[cnt], dmax, fEnable[cnt]); 249 250 fill.SetFillColor(col); 247 251 fill.Modify(); 248 252 … … 259 263 continue; 260 264 261 const double val = align(dmin, fData[cnt], dmax); 262 263 const int col = (val-min)/scale*(fPalette.size()-1); 264 265 if (fEnable[cnt]) 266 fill.SetFillColor(gStyle->GetColorPalette(col)); 267 else 268 fill.SetFillColor(kWhite); 265 const int col = GetCol(dmin, fData[cnt], dmax, fEnable[cnt]); 266 267 fill.SetFillColor(col); 269 268 fill.Modify(); 270 269 … … 283 282 line.Modify(); 284 283 285 const double val = align(dmin, fData[fWhite], dmax); 286 287 const int col = (val-min)/scale*(fPalette.size()-1); 288 289 if (fEnable[fWhite]) 290 fill.SetFillColor(gStyle->GetColorPalette(col)); 291 else 292 fill.SetFillColor(kWhite); 284 const int col = GetCol(dmin, fData[fWhite], dmax, fEnable[fWhite]); 285 286 fill.SetFillColor(col); 293 287 fill.Modify(); 294 288 … … 2763 2757 void on_fThresholdDisableOthers_clicked() 2764 2758 { 2765 const uint16_t isw = fThresholdIdx->value();2766 const uint16_t ihw = isw<0 ? -1 : fPatchMapHW[isw];2759 const int16_t isw = fThresholdIdx->value(); 2760 const int16_t ihw = isw<0 ? -1 : fPatchMapHW[isw]; 2767 2761 2768 2762 Dim::SendCommand("FTM_CONTROL/DISABLE_ALL_PATCHES_EXCEPT", ihw); … … 3076 3070 Camera *cam = new Camera; 3077 3071 cam->SetBit(kCanDelete); 3072 cam->SetMin(fRatesMin->value()); 3073 cam->SetMax(fRatesMax->value()); 3078 3074 cam->Draw(); 3079 3075
Note:
See TracChangeset
for help on using the changeset viewer.