File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
core/pv/src/main/java/org/phoebus/pv/pva Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,28 @@ public static VType decode(final PVAStructure struct) throws Exception
7878 final int dimensions [];
7979 final int offsets [];
8080 final boolean reversed [];
81- if (dim .get ().length < 2 )
81+ final int n_dims = dim .get ().length ;
82+ // Fetching by field name in case structure changes
83+ if (n_dims <= 1 )
8284 {
83- dimensions = offsets = new int [] { 0 , 0 };
85+ dimensions = new int [] { 0 , 0 };
86+ offsets = new int [] { 0 , 0 };
8487 reversed = new boolean [] { false , false };
88+ if (n_dims == 1 )
89+ { // Treat 1-dim array as "image" with height 1
90+ final PVAStructure d = dim .get ()[0 ];
91+ PVAInt el = d .get ("size" );
92+ dimensions [0 ] = el .get ();
93+ el = d .get ("offset" );
94+ offsets [0 ] = el .get ();
95+ final PVABool b = d .get ("reverse" );
96+ reversed [0 ] = b .get ();
97+
98+ dimensions [1 ] = 1 ;
99+ }
85100 }
86101 else
87- { // Fetching by field name in case structure changes
88- final int n_dims = dim .get ().length ;
102+ {
89103 dimensions = new int [n_dims ];
90104 offsets = new int [n_dims ];
91105 reversed = new boolean [n_dims ];
You can’t perform that action at this time.
0 commit comments