mdsplus icon indicating copy to clipboard operation
mdsplus copied to clipboard

Add DbiTREE_VERSION, add version to `show db`

Open WhoBrokeTheBuild opened this issue 2 years ago • 3 comments

Add DbiTREE_VERSION, which returns db->info->header->version Add the tree file format version number to the output of mdstcl show db

Example:

TCL> set tree oldtree
TCL> set tree newtree
TCL> show db
000  NEWTREE       shot: -1 [\NEWTREE::TOP]    version: 2
001  OLDTREE       shot: -1 [\OLDTREE::TOP]    version: 1

WhoBrokeTheBuild avatar Jul 07 '22 20:07 WhoBrokeTheBuild

A test is a good idea. I'm going to add in tdi/python/etc before I merge this. I need to propagate the DBI constant if nothing else. I'd like to add Tree.version in python too.

WhoBrokeTheBuild avatar Jul 07 '22 21:07 WhoBrokeTheBuild

@zack-vii This should now include the tdi, python, c++, and java interfaces too I would love some guidance on setting up tests for this, any references or instructions would be welcome

>>> import MDSplus
>>> t = MDSplus.Tree('oldtree')
>>> t.tree_version
1
TDI> TreeOpen('oldtree')
TDI> GetDbi('TREE_VERSION')
1

WhoBrokeTheBuild avatar Jul 14 '22 18:07 WhoBrokeTheBuild

@GabrieleManduchi I've updated the C++ and Java APIs to have access to this new DBI, but I'm not 100% sure what I'm doing, I would love a code review of those sections.

WhoBrokeTheBuild avatar Jul 14 '22 18:07 WhoBrokeTheBuild