ソースを参照

testLevel in helper.ts was debuged and now comes back in vmd/parser.ts

yakomaxa 2 年 前
コミット
94787229a4

+ 3 - 3
src/mol-script/transpilers/helper.ts

@@ -357,8 +357,8 @@ const entityProps = ['entityKey', 'label_entity_id', 'entityType'];
 const chainProps = ['chainKey', 'label_asym_id', 'label_entity_id', 'auth_asym_id', 'entityType'];
 const residueProps = ['residueKey', 'label_comp_id', 'label_seq_id', 'auth_comp_id', 'auth_seq_id', 'pdbx_formal_charge', 'secondaryStructureKey', 'secondaryStructureFlags', 'isModified', 'modifiedParentName'];
 export function testLevel(property: any) {
-    if (property.head.startsWith(propPrefix)) {
-        const name = property.head.substr(propPrefix.length);
+    if (property.head.name.startsWith(propPrefix)) {
+        const name = property.head.name.substr(propPrefix.length);
         if (entityProps.indexOf(name) !== -1) return 'entity-test' as string;
         if (chainProps.indexOf(name) !== -1) return 'chain-test' as string;
         if (residueProps.indexOf(name) !== -1) return 'residue-test' as string;
@@ -370,7 +370,7 @@ const flagProps = [
     'structure-query.atom-property.macromolecular.secondary-structure-flags'
 ];
 export function valuesTest(property: any, values: any[]) {
-    if (flagProps.indexOf(property.head) !== -1) {
+    if (flagProps.indexOf(property.head.name) !== -1) {
         const name = values[0].head;
         const flags: any[] = [];
         values.forEach(v => flags.push(...v.args[0]));

+ 2 - 2
src/mol-script/transpilers/vmd/parser.ts

@@ -176,10 +176,10 @@ const lang = P.MonadicParser.createLanguage({
                 test = rangeTest ? rangeTest : listTest;
             }
 
-	    //  return B.struct.generator.atomGroups({ [h.testLevel(property)]: test });
+	    return B.struct.generator.atomGroups({ [h.testLevel(property)]: test });
 	    //  h.testLevel is not working for unknown reason, so relaced it by hardcoded 'atom-test'
             //	    console.log(h.testLevel(property));
-	    return B.struct.generator.atomGroups({ 'atom-test': test });
+	    //return B.struct.generator.atomGroups({ 'atom-test': test });
         });
     },