[Kst] Re: A couple of issues with the new ASCII

Peter Kümmel syntheticpp at gmx.net
Thu Jan 27 13:17:16 CET 2011


On 27.01.2011 12:22, Peter Kümmel wrote:
> On 26.01.2011 23:10, Nicolas Brisset wrote:
>> So, now I can do some tests, and here are some problems I have come across and which must absolutely be solved prior to 2.0.3 (wrong data loaded!!!).
>>
>> I have tried loading p, q, r against Time_rel from the new fixed-width+delimiter.txt sample file with various settings which should all work. Some don't!
>> In all cases, I used "Custom delimiter: ;" as the other setting expectedly does not work.
>> 1) "Do not make assumptions on column width": OK
>> 2) "Each column has a constant width": not good, compare the first 20 samples in the view vector dialog: there are sign problems
> 
> fixed.
> 
>> 3) "All columns have the same width: 13 characters": the delimiter is not correctly handled. It keeps being reset to whitespace
> 
> This options is not correct for this file. And it is also at the wrong place in the dialog.
> The columns are 1. whitespace separated, or 2. by a custom delimiter, or 3. have a fixed width, eg
> 
> 4 columns width=4:
> -234-234-234-234
> 
> 4 columns width=5:
> -234 -234 -234 -234

The code for Fixed looks totally buggy:

v[i] = lexc.toDouble(&buffer[0] + _rowIndex[i] - _rowIndex[0] + _config._columnWidth * (col - 1));

could only work when _rowIndex[0] == 0.


Shouldn't it be read like this: goto the beginning of line i and then forward to the column start:

v[i] = lexc.toDouble(&buffer[0] + _rowIndex[i] + _config._columnWidth * (col - 1));


> 
>>
>> Apart from that, I have just remembered another thing which we wanted to do: trimm whitespace from the vector names. When doing the above tests, you'll know what I mean... I wanted to do it, but the function that returns the field list is awfully complicated (why?) and I'd first need to understand how it is built up. I don't feel up to it just now.
>>
>> Nicolas
>>
>> P.S.: I have the impression that the AsciiSourceConfig::load function is never used (the one Peter has doubts about). I have put a breakpoint in it, and it does not stop when using the data wizard nor when loading a .kst from an ASCII file. Is there a sure way to know if it is called somewhere else in the code? Looking for load( does not sound like a good idea :-)
>>
>> _______________________________________________
>> Kst mailing list
>> Kst at kde.org
>> https://mail.kde.org/mailman/listinfo/kst
>>
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
> 


More information about the Kst mailing list