|
<?xml version="1.0" encoding="UTF-8"?> |
|
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Wed Nov 13 2013 18:31:00 GMT-0500 (EST)--> |
|
<XholonWorkbook> |
|
|
|
<Notes><![CDATA[ |
|
Khan Academy |
|
------------ |
|
Title: Acceleration |
|
Description: Calculating the acceleration of a Porshe |
|
Url: http://www.khanacademy.org/video/acceleration?playlist=Physics |
|
InternalName: acceleration |
|
YoutubeId: FOkQszg1-j8 |
|
Keywords: physics, kinematics |
|
|
|
My Notes |
|
-------- |
|
Updated November 13, 2013, to make it work with the GWT version of Xholon. |
|
|
|
]]></Notes> |
|
|
|
<script implName="lang:javascript:inline:"><![CDATA[ |
|
var changeInVelocity = 60.0; // mph |
|
var direction = "East"; |
|
var changeInTime = 3.0; // s |
|
var acceleration = changeInVelocity / changeInTime; // (mph)/s |
|
console.log(acceleration + " (mph)/s2 to the " + direction); |
|
]]></script> |
|
|
|
<_-.XholonClass> |
|
|
|
<!-- domain objects --> |
|
<PhysicalSystem/> |
|
<Car/> |
|
|
|
<!-- quantities --> |
|
<ChangeInVelocity superClass="Quantity"/> |
|
<ChangeInTime superClass="Quantity"/> |
|
<Acceleration superClass="Quantity"/> |
|
|
|
</_-.XholonClass> |
|
|
|
<xholonClassDetails> |
|
<Car> |
|
<port name="changeInVelocity" connector="#xpointer(ChangeInVelocity)"/> |
|
<port name="changeInTime" connector="#xpointer(ChangeInTime)"/> |
|
<port name="acceleration" connector="#xpointer(Acceleration)"/> |
|
</Car> |
|
</xholonClassDetails> |
|
|
|
<PhysicalSystem> |
|
<Car roleName="Porsche 911"> |
|
<ChangeInVelocity>60.0 mph</ChangeInVelocity> |
|
<Attribute_String roleName="direction">East</Attribute_String> |
|
<ChangeInTime>3.0 s</ChangeInTime> |
|
<Acceleration>0.0 (mph)/s</Acceleration> |
|
</Car> |
|
</PhysicalSystem> |
|
|
|
<Carbehavior implName="org.primordion.script.Behavior_gwtjs"><![CDATA[ |
|
var car; |
|
var beh = { |
|
postConfigure: function() { |
|
// set application parameter |
|
$wnd.xh.param("MaxProcessLoops", "1"); |
|
// define car |
|
car = this.cnode.parent(); |
|
}, |
|
act: function() { |
|
// update acceleration value |
|
car.acceleration.val(car.changeInVelocity.val() / car.changeInTime.val()); |
|
// update SVG |
|
var svg = $wnd.Snap("#xhsvg svg"); |
|
var textEle = svg.select("text#text11"); |
|
textEle.node.textContent = car.acceleration.val(); |
|
} |
|
} |
|
]]></Carbehavior> |
|
|
|
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml, |
|
<svg id="svg1384377763454" xmlns="http://www.w3.org/2000/svg" |
|
xmlns:xlink="http://www.w3.org/1999/xlink" |
|
version="1.1" |
|
width="185.0" height="121.0"> |
|
|
|
<style> |
|
svg#svg1384377763454 rect { |
|
fill: white; |
|
stroke: #a121f1; |
|
stroke-width: 1px; |
|
} |
|
svg#svg1384377763454 rect.rectalt { |
|
fill: #efffdf; |
|
} |
|
svg#svg1384377763454 rect:active { |
|
stroke-width: 2px; |
|
} |
|
svg#svg1384377763454 text { |
|
font-family: "Courier New",courier,monospace; |
|
font-size: 8px; |
|
fill: black; |
|
pointer-events: none; |
|
} |
|
</style> |
|
<title>Acceleration</title> |
|
<g id="toplevelgroup" transform="translate(0,0) scale(2) rotate(0)"> |
|
<title>hjsdkhf sdkhfjsdhf skdh</title> |
|
<g id="g1"> |
|
<title>Porsche 911</title> |
|
<rect id="Car" x="10" y="10" width="82" height="50" class="rectalt"/> |
|
<text id="text2" x="15" y="20">Porsche 911</text> |
|
</g> |
|
<g id="g9"> |
|
<title>acceleration</title> |
|
<rect id="Car/Acceleration" x="16" y="25" width="70" height="30"/> |
|
<text id="text10" x="21" y="35">Acceleration</text> |
|
<text id="text11" x="21" y="46">0</text> |
|
<text id="text12" x="40" y="46">(mph)/s</text> |
|
</g> |
|
</g> |
|
</svg> |
|
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient> |
|
|
|
|
|
</XholonWorkbook> |