PDA

View Full Version : QwtScaleEngine Time scale engine



med_1309
25th August 2010, 15:15
Hello,

in order to make a time scale
- I converted time [h: m: s] in seconds
- I draw label like in cpuplot examples
- My scale move like cpuplot example
- But I dont want to use the method setaxisscale in cpuplot

in the following case :
23h00 ----- 00h00 ---- 01h00 in h:m:s
82800s------0s--------3600s in s
setAxisScale(xBottom, min=82600,max=3600)

the axis must have only positive value witch zero in the midle
for implement that i have this solution

while(i != max)
{
//if i>84600 i=i-84600
i = (min++)%84600 //84600 is 24h60m60s convert in sec
}

1) how to make this in QwtLinearScaleEngine ?
2) What methods should I reimplemented (divide scale)?
3) Is this the class to use ?
4) is it possible to save autoScale() and transformation (I want to change the least)?

I hope have been clear

Thanks Mederic

Uwe
25th August 2010, 18:54
1) how to make this in QwtLinearScaleEngine ?
2) What methods should I reimplemented (divide scale)?
3) Is this the class to use ?

Derive from QwtScaleEngine and implement all pure virtual methods.


4) is it possible to save autoScale() and transformation (I want to change the least)?
Yes, but I don't think that you want to do this. I can imagine a log2 based transformation or something irregular f.e when you want to have a scale with gaps, but your transformation doesn't look special to me.

Uwe