Browse Source

Activated RangeListProperty in vmd/parser.ts with hardcoded 'atom-test' line

yakomaxa 2 năm trước cách đây
mục cha
commit
19401c4bc6

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

@@ -357,13 +357,13 @@ 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)) {
+   if (property.head.startsWith(propPrefix)) {
         const name = property.head.substr(propPrefix.length);
-        if (entityProps.indexOf(name) !== -1) return 'entity-test';
-        if (chainProps.indexOf(name) !== -1) return 'chain-test';
-        if (residueProps.indexOf(name) !== -1) return 'residue-test';
+        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;
     }
-    return 'atom-test';
+    return 'atom-test' as string;
 }
 
 const flagProps = [

+ 1 - 1
src/mol-script/transpilers/vmd/keywords.ts

@@ -105,7 +105,7 @@ const ResDict = {
 export const keywords: KeywordDict = {
     all: {
         '@desc': 'everything',
-        map: () => B.struct.generator.atomGroups()
+        map: () => B.struct.generator.all()
     },
     none: {
         '@desc': 'nothing',

+ 4 - 1
src/mol-script/transpilers/vmd/parser.ts

@@ -3,6 +3,7 @@
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  * @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>
+ * @author Koya Sakuma
  */
 
 import * as P from '../../../mol-util/monadic-parser';
@@ -170,7 +171,9 @@ 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 reasons 
+	    return B.struct.generator.atomGroups({ 'atom-test': test });
         });
     },