Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to indicate the column order for NTTable created with qsrv ? #61

Open
gabrielfedel opened this issue Feb 7, 2024 · 1 comment

Comments

@gabrielfedel
Copy link

During some tests I noticed that a NTTable built using qsrv (it seems to happens on qsrv2 also) will have its column showed in the alphabetical order (if +putorder is not set). Not sure if here is the place, maybe is an issue of showing the table (the same issue appears on pvget and phoebus).

A database example:

record(waveform, "$(P)EvtLbls")                                      
{                                                                    
  field(DESC, "Events Labels")                                       
  field(FTVL, "STRING")                                              
  field(NELM, "2")                                                   
  field(INP,  "['Name', 'Code']")                                    
  field(PINI, "YES")                                                 
  info(Q:group, {                                                    
      "$(P)RefEvents-SP" :{                                          
           +id:"epics:nt/NTTable:1.0",                               
           "labels":{+type:"plain", +channel:"VAL", +putorder:1}     
       },                                                            
       "$(P)RefEvents-RB" :{                                         
           +id:"epics:nt/NTTable:1.0",                               
           "labels":{+type:"plain", +channel:"VAL"}                  
       }                                                             
  })                                                                 
}                                                                    
                                                                     
record(waveform, "$(P)ScEvtNames-SP")                                
{                                                                    
  field(DESC, "EventNames")                                          
  field(FTVL, "STRING")                                              
  field(NELM, "255")                                                 
  field(INP,  "['SeqEnd']")                                          
                                                                     
  info(Q:group, {                                                    
      "$(P)RefEvents-SP" :{                                          
           "value.names":{+type:"plain", +channel:"VAL", +putorder:2}
       },                                                            
      "$(P)RefEvents-RB" :{                                          
           "value.names":{+type:"plain", +channel:"VAL"}             
       }                                                             
  })                                                                 
}                                                                    
                                                                     
record(waveform, "$(P)ScEvtCodes-SP")                                
{                                                                    
  field(DESC, "EventCodes")                                          
  field(FTVL, "UCHAR")                                               
  field(NELM, "255")                                                 
  field(INP,  "[127]")                                               
                                                                     
  info(Q:group, {                                                    
      "$(P)RefEvents-SP" :{                                          
           "value.codes":{+type:"plain", +channel:"VAL", +putorder:3}
       },                                                            
      "$(P)RefEvents-RB" :{                                          
           "value.codes":{+type:"plain", +channel:"VAL"}             
       }                                                             
  })                                                                 
}                                                                    

On that example, I would get:

$ pvget TESTLABEL:RefEvents-SP
TESTLABEL:RefEvents-SP 
  Name Code
SeqEnd  127
$ pvget TESTLABEL:RefEvents-RB
TESTLABEL:RefEvents-RB 
Name   Code
 127 SeqEnd

For the second NTTable, the columns are being displayed ordered by the name of the column (code, name), but I miss a way to display them as name, column.

@mdavidsaver
Copy link
Member

if +putorder is not set

So far +putorder is the only way.

QSRV2 preserves this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants