|
| 1 | +{ |
| 2 | + "title": "Flying Zippies - Model of Solid Tipping", |
| 3 | + "publicationStatus": "draft", |
| 4 | + "subtitle": "Sliding on the cart...", |
| 5 | + "category": "", |
| 6 | + "subCategory": "", |
| 7 | + "screenshot": "", |
| 8 | + "aspectRatio": 1.777777778, |
| 9 | + "fontScale": 1, |
| 10 | + "lang": "en-US", |
| 11 | + "i18nMetadata": "", |
| 12 | + "helpOnLoad": false, |
| 13 | + "theme": "no-framing", "showTopBar": false, |
| 14 | + "showBottomBar": true, |
| 15 | + "padding": 0, |
| 16 | + "about": "", |
| 17 | + "models": [ |
| 18 | + { |
| 19 | + "type": "md2d", |
| 20 | + "id": "empty-atom", |
| 21 | + "url": "models/lab-version/1/md2d/sensing-science/flying-zippies/zippy-solid-tipping.json", |
| 22 | + "viewOptions": { |
| 23 | + "viewPortX": 1.0, |
| 24 | + "viewPortY": 1.0, |
| 25 | + "viewPortWidth": 12.5, |
| 26 | + "viewPortHeight": 7.03124 |
| 27 | + }, |
| 28 | + "onLoad": [ |
| 29 | + "var idx = 0;", |
| 30 | + "var isLeftTilt = true;", |
| 31 | + "onPropertyChange('time',function(t) {", |
| 32 | + " if (t % 2000 === 0) {", |
| 33 | + " console.log('idx: ' + idx + ' isLeftTilt: ' + isLeftTilt );", |
| 34 | + " if (isLeftTilt) {", |
| 35 | + " if (idx < 4) { ", |
| 36 | + " setImageProperties(idx, { visible: false } ); idx++;", |
| 37 | + " }", |
| 38 | + " else isLeftTilt = false;", |
| 39 | + " } else {", |
| 40 | + " if (idx > 0) { ", |
| 41 | + " setImageProperties(idx, { visible: true } ); idx--;", |
| 42 | + " }", |
| 43 | + " else isLeftTilt = true;", |
| 44 | + " }", |
| 45 | + " }", |
| 46 | + "});", |
| 47 | + "set({temperatureControl: true}); set({targetTemperature: 100});", |
| 48 | + "var airAtoms = [];", |
| 49 | + "var zippyAtoms = [];", |
| 50 | + "var cartAtoms = [];", |
| 51 | + "for (var i = 0; i < getNumberOfAtoms(); i++) {", |
| 52 | + " if (getAtomProperties(i).element == 2) {", |
| 53 | + " setAtomProperties(i, { x: getAtomProperties(i).x - 0.0 });", |
| 54 | + " setAtomProperties(i, { y: getAtomProperties(i).y + 0.0 });", |
| 55 | + "}", |
| 56 | + "}", |
| 57 | + "for (var i = 0; i < getNumberOfAtoms(); i++) {", |
| 58 | + " if (getAtomProperties(i).element == 0 || getAtomProperties(i).element == 1) {", |
| 59 | + " setAtomProperties(i, { x: getAtomProperties(i).x - 0.0 });", |
| 60 | + " setAtomProperties(i, { y: getAtomProperties(i).y + 0.0 });", |
| 61 | + "}", |
| 62 | + "}", |
| 63 | + "for (var i = 0; i < getNumberOfAtoms(); i++) {", |
| 64 | + " if (getAtomProperties(i).element == 0) {", |
| 65 | + " airAtoms.push(i);", |
| 66 | + " } else if(getAtomProperties(i).element == 1) {", |
| 67 | + " zippyAtoms.push(i);", |
| 68 | + " } else if(getAtomProperties(i).element == 2) {", |
| 69 | + " cartAtoms.push(i);", |
| 70 | + " }", |
| 71 | + "set('airAtomsIndices', airAtoms);", |
| 72 | + "set('zippyAtomsIndices', zippyAtoms);", |
| 73 | + "set('cartAtomsIndices', zippyAtoms);", |
| 74 | + "}" |
| 75 | + ] |
| 76 | + } |
| 77 | + ], |
| 78 | + "parameters": [ |
| 79 | + { |
| 80 | + "name": "airAtomsIndices", |
| 81 | + "initialValue": [] |
| 82 | + }, |
| 83 | + { "name": "zippyAtomsIndices", |
| 84 | + "initialValue": [] |
| 85 | + }, |
| 86 | + { "name": "cartAtomsIndices", |
| 87 | + "initialValue": [] |
| 88 | + } |
| 89 | + ], |
| 90 | + "outputs": [ |
| 91 | + { |
| 92 | + "name": "temperature-red", |
| 93 | + "unitAbbreviation": "K", |
| 94 | + "label": "speed", |
| 95 | + "value": "return getTemperatureOfAtoms(get('airAtomsIndices'));" |
| 96 | + }, |
| 97 | + { |
| 98 | + "name": "temperature-blue", |
| 99 | + "unitAbbreviation": "K", |
| 100 | + "label": "speed", |
| 101 | + "value": "return getTemperatureOfAtoms(get('zippyAtomsIndices'));" |
| 102 | + } |
| 103 | + ], |
| 104 | + "components": [], |
| 105 | + "layout": {}, |
| 106 | + "template": "model-only" |
| 107 | +} |
0 commit comments