[Kst] [Bug 227235] New: data files in dirfile format not recognized

freebody.kst at gmail.com freebody.kst at gmail.com
Tue Feb 16 18:47:57 CET 2010


https://bugs.kde.org/show_bug.cgi?id=227235

           Summary: data files in dirfile format not recognized
           Product: kst
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kst at kde.org
        ReportedBy: freebody.kst at gmail.com


Version:           1.9.0_devel (using Devel)
OS:                Linux
Installed from:    Compiled sources

PROBLEM:
data files in dirfile format (Dirfile Standards version 7) cannot be recognized
by kst 1.9_devel

STEPS TO REPRODUCE:
1)use the following code to generate data files:

#include <getdata.h>
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
/* dirfile name */
const char *dirfile_name = "/home/freebody/test_dirfile";
/* field code */
const char *field_code = "datafield";

gd_type_t data_type = GD_FLOAT64;
gd_spf_t spf = 5;
int fragment_index = 0;
off_t first_frame = 0;
off_t first_sample = 0;
size_t num_frames = 100;


/* Open the dirfile */
DIRFILE *dirfile = dirfile_open(dirfile_name,
GD_RDWR|GD_CREAT|GD_TEXT_ENCODED);
/**/
if (get_error(dirfile)) {
    printf("GetData error: failed to create a datafile\n");
    dirfile_close(dirfile);
    exit(1);
}



/* Add a raw field*/
dirfile_add_raw(dirfile, field_code, data_type, spf, fragment_index); 


/* Allocate a buffer */
double *data_buffer = malloc(sizeof(double) * spf * (num_frames -
first_frame));

/* Fill up the buffer */
int i = 0;
int count = 0;
for (i=0; i<spf * (num_frames - first_frame); i++)
{
    data_buffer[i] = count - 25.0;
    count++;   
}

/* Write the dirfile*/

putdata(dirfile, field_code, first_frame, 0, num_frames - first_frame, 0,
data_type, data_buffer); 

if (get_error(dirfile)) {
    printf("GetData error: failed to write the datafile\n");
    dirfile_close(dirfile);
    exit(1);
}
/* Clean up */
free(data_buffer);


dirfile_close(dirfile);

return 0;
}

2)open data wizard in kst. 


RESULTS:
Files created by the above code are not recognized as dirfiles.
I also tried other encodings; not working either.

EXPECTED RESULTS:
kst should load dirfiles properly.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Kst mailing list