Bug 132954

Summary: Can't use datasource metadata in labels
Product: [Applications] kst Reporter: Nicolas Brisset <nicolas.brisset>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Solaris   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nicolas Brisset 2006-08-25 10:21:22 UTC
Version:           1.3.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

When importing metadata from a file it can currently be used only in the metadata dialog called from the vector RMB menu in the data manager. It should supposedly be possible to use these strings in labels (if I have misunderstood something there, then this is not a bug report but a wishlist item!) but it does not seem to work.

To reproduce (with a recent svn otherwise you don't have netCDF metadata):
1) download http://www.unidata.ucar.edu/software/netcdf/examples/GOTEX.C130_N130AR.LRT.RF06.PNI.nc
2) install netcdf libs and headers, and compile the netcdf datasource if you did not have it yet !
3) load the data file in the wizard, plot e.g. ADIFR vs time_offset
4) go to the data manager, RMB menu on one of the vectors, "Metadata": you get a dialog where you can see a couple of metadata, for instance "Source"
5) create a label in the plot with the following contents: "Source: [Source]", the result is "Source: " while the expected result is "Source: NCAR Research Aviation Facility"
Comment 1 George Staikos 2006-08-29 06:53:29 UTC
  After thinking about this, I realized that we need a new notation.  
Exporting metadata to strings directly seems like the wrong thing.  We need a 
notation that will allow the user to access the metadata of a given file.  It 
should probably be a two-parameter [] notation.  Any ideas on how best to 
specify this?
Comment 2 Nicolas Brisset 2006-08-29 09:41:55 UTC
I could imagine something like [file1.dat[Provider]] for instance, but the major problem here is that file1.dat may not be a unique identifier, and using the absolute path would be *very* painful (possibly as a last resort when the filename is not enough, i.e. unique ?). Note that [file1.dat,Provider] sounds prone to problems as some files or metadata may have names with commas in them...
In the case we choose to export metadata to strings anyway, I think it would be more or less like when you duplicate all curves with the change data file tool: the new curves and vectors you get from the second datafile are all suffixed with "'", which makes them fairly easy to identify.

I think I like the "new notation" approach better, provided that I don't have to type in the full path each time. It would be nice/necessary (though maybe not easy) to ensure that labels using metadata track changes to the provider file and update automatically, like when you change a datafile at loading time (-F switch), with the "Change data file..." tool, or reload. Maybe a possibility for that would be to have a mapping defined somewhere (in a small 2-column listview dialog) between datasource instances (datasource1, datasource2, etc) and the corresponding data files (/tmp/dir1/file.dat, /tmp/dir2/file.dat, etc). One would then use [datasource1[Provider]] and check the datafile<->instance number assignment when in doubt.
Comment 3 Nicolas Brisset 2006-10-03 10:56:38 UTC
Any update on this ? I have many user requests regarding this ability of using metadata... 
Comment 4 Nicolas Brisset 2007-03-05 13:01:05 UTC
I think this can now be considered as fixed. The only problems left are related with updates when changing datasources, and are being discussed as part of bug #141597 anyway.