|
@@ -198,18 +198,18 @@ export const DscifProvider = DataFormatProvider({
|
|
|
parse: async (plugin, data, params?: DsCifParams) => {
|
|
|
const cifCell = await plugin.build().to(data).apply(StateTransforms.Data.ParseCif).commit();
|
|
|
const b = plugin.build().to(cifCell);
|
|
|
- const blocks = cifCell.obj!.data.blocks.slice(0); // iterate over all blocks as even 0th can contain data
|
|
|
+ const blocks = cifCell.obj!.data.blocks;
|
|
|
|
|
|
- if (blocks.length !== 1 && blocks.length !== 2 && blocks.length !== 3) throw new Error('unknown number of blocks');
|
|
|
+ if (blocks.length === 0) throw new Error('no data blocks');
|
|
|
|
|
|
const volumes: StateObjectSelector<PluginStateObject.Volume.Data>[] = [];
|
|
|
let i = 0;
|
|
|
for (const block of blocks) {
|
|
|
const entryId = Array.isArray(params?.entryId) ? params?.entryId[i] : params?.entryId;
|
|
|
- if (block.categories['volume_data_3d']?.rowCount > 0) {
|
|
|
+ if (block.categories['volume_data_3d_info']?.rowCount > 0) {
|
|
|
volumes.push(b.apply(StateTransforms.Volume.VolumeFromDensityServerCif, { blockHeader: block.header, entryId }).selector);
|
|
|
+ i++;
|
|
|
}
|
|
|
- i++;
|
|
|
}
|
|
|
|
|
|
await b.commit();
|