Re: error while displaying a line



Hey,

I tend to think it would often incorrectly "guess" what the developer
visually prefers, as with Alexey's example showing zero or not.  Also,
do you show a range of +/-0.01 or +/-100 around the value?  These
could be settings, a new struct argument containing bool zero_x, bool
zero_y, int offset_x, int offset_y, with the default behavior
undefined (passed a NULL pointer?) resulting in this error.  I feel
you'd have to overwrite the default behavior quite often.  The
developer might also benefit from having this error displayed as a
warning; to possibly indicate an algorithm problem. The developer can
also handle this error with a trivial if/else statement when they have
specific needs.  One example: for an oscilloscope the user sets the
desired volts/div so often you won't autoscale, but if you did
autoscale it would be to allowable division sizes.

That's my $0.02

-Eric

On Fri, Sep 19, 2008 at 2:25 AM,  <z pekar gmail com> wrote:
> so maybe some default behavior should be implemented in order to avoid
> the error output, and if the app. developer doesn't like it - he can
> always rewrite it.
>
> On Fri, Sep 19, 2008 at 11:14 AM, Alexey Shuvaev
> <shuvaev physik uni-wuerzburg de> wrote:
>> On Thu, Sep 18, 2008 at 10:04:10PM +0200, Dr. Roland Bock wrote:
>>> z pekar gmail com wrote:
>>>> Hello,
>>>> I get an error while displaying a line (parallel to x-achse; y(x) = c)
>>>>
>>>> gtk_databox_set_total_limits: assertion `left != right' failed
>>>>
>>>> what could it be?
>>>> thank you
>>>
>>> Hi,
>>>
>>> you are probably calling gtk_databox_auto_rescale?
>>>
>>> That function calculates
>>>
>>> (Pixel_max - Pixel_min)/(Value_max - Value_min)
>>>
>>> This fails for a line parallel to the x axis (and would also fail for a
>>> line parallel to the y axis).
>>>
>>> Of course it would be possible to "guess" a useful data range. The
>>> question is: What is the right heuristic, which seems natural for
>>> viewers at different values?
>>>
>>> Solutions are welcome :-)
>>>
>> I don't think one can have a good "guess" for all cases.
>> For example, when plotting some abstract mathematical function one may
>> set y_scale = x_scale. On the other hand, in a physics application when
>> x = time and y = voltage one may want to always include zero (y = 0) in
>> the graph and to set y scale to full device range if the signal is
>> a constant zero too.
>>
>> So, IMHO, the proper scaling is a responsibility of the application developer
>> and not the library.
>>
>> Just my 0.02$,
>> Alexey.
>> _______________________________________________
>> gtkdatabox-list mailing list
>> gtkdatabox-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtkdatabox-list
>>
> _______________________________________________
> gtkdatabox-list mailing list
> gtkdatabox-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkdatabox-list
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]