Hi Bastin,
the class 'PowerPanel' was implemented to show only positive values, because solar modules usually only produce energy...
Nevertheless, you can adapt the implementation in order to show also a value range that include negative values:
- Open the class 'DataPlotter'
- Open the method 'OnSetMinValue' within the Code Editor and remove the limitation that ensures that 'value' is greater than 0.
- Open the method 'OnSetMaxValue' within the Code Editor and remove the limitation that ensures that 'value' is greater than 0.
- Open the method 'DrawSamples' within the Code Editor and change the implementation of drawing the samples:
/* draw all samples of the last sequence */
for ( x = 0; x < SamplesPerUpdate; x = x + 1 )
{
/* draw data of channel */
y = Bounds.h - borderY;
if ( MaxValue > MinValue )
y = y - (( SampleStorage[ x ] - MinValue ) * ( Bounds.h - 2 * borderY ) / ( MaxValue - MinValue ));
DrawPenLine( PenColor, Bounds.w - deltaX * ( SamplesPerUpdate - x ) - 10, LastValue, y );
LastValue = y;
}
Now you can use the data plotter with your desired value range and just add your samples. Please note, that the scale that is shown within the power panel needs to be adapted to your value range.