Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active November 15, 2018 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/9c111d1ffac80a6905964d9433a532b7 to your computer and use it in GitHub Desktop.
Save kenwebb/9c111d1ffac80a6905964d9433a532b7 to your computer and use it in GitHub Desktop.
WebRTC complex Schweiz 2018
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Thu Nov 15 2018 08:07:36 GMT-0500 (Eastern Standard Time)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: WebRTC complex Schweiz 2018
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 9c111d1ffac80a6905964d9433a532b7 based on bbb22a5cd9599e94f70a207118cf3ec5
Keywords:
My Notes
--------
September 14, 2018
- set host and key in port connector to "delete"
Load this wb as:
http://127.0.0.1:8888/XholonWebRTC.html?app=WebRTC+complex+Schweiz+2018&src=lstr&gui=none&remoteid0=Able101&remoteid2=Charlie101
http://127.0.0.1:8888/XholonWebRTC.html?app=9c111d1ffac80a6905964d9433a532b7&src=gist&gui=none&remoteid0=Able101&remoteid2=Charlie101
Use this URL if running a local peerjs server:
http://127.0.0.1:8888/XholonWebRTC.html?app=WebRTC+complex+Schweiz+2018&src=lstr&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=localhost
Use this URL if running my version of peerjs server on heroku localhost:
http://127.0.0.1:8888/XholonWebRTC.html?app=WebRTC+complex+Schweiz+2018&src=lstr&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=herokulocalhost
Use this URL if running my version of peerjs server on herokuapp.com:
http://127.0.0.1:8888/XholonWebRTC.html?app=WebRTC+complex+Schweiz+2018&src=lstr&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=herokuxhpeerjs
http://127.0.0.1:8888/XholonWebRTC.html?app=9c111d1ffac80a6905964d9433a532b7&src=gist&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=herokuxhpeerjs
http://www.primordion.com/Xholon/gwt/XholonWebRTC.html?app=9c111d1ffac80a6905964d9433a532b7&src=gist&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=herokuxhpeerjs
https://www.primordion.com/Xholon/gwt/XholonWebRTC.html?app=9c111d1ffac80a6905964d9433a532b7&src=gist&gui=none&remoteid0=Able101&remoteid2=Charlie101&ver=herokuxhpeerjs
Use 10 cantons of Switzerland as node names (10 that I have been to, or that I may visit).
see notes for "WebRTC complex Canada 2018"
References
----------
() http://peerjs.com/
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<Universe/>
<!-- 10 of the 26 cantons in Switzerland -->
<StGallen/>
<Graubunden/>
<Thurgau/>
<Zurich/>
<Schwyz/>
<Glarus/>
<Genf/>
<Zug/>
<Tessin/>
<Bern/>
<Gift/>
<container/>
<Ort/>
<!-- for use with "Island B3" app -->
<DataExport/>
</_-.XholonClass>
<xholonClassDetails>
<?xmlreader-patch {
"localhost":
[
{"op":"replace", "sel":"./StGallen/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid0,delete,3,localhost,9000,/"},
{"op":"replace", "sel":"./Graubunden/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid2,delete,3,localhost,9000,/"}
]
,
"herokulocalhost":
[
{"op":"replace", "sel":"./StGallen/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid0,delete,3,localhost,5000,/"},
{"op":"replace", "sel":"./Graubunden/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid2,delete,3,localhost,5000,/"}
]
,
"herokuxhpeerjs":
[
{"op":"replace", "sel":"./StGallen/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid0,delete,3,xhpserver.herokuapp.com,,/"},
{"op":"replace", "sel":"./Graubunden/port/@connector", "content":"RemoteNodeService-PeerJS,remoteid2,delete,3,xhpserver.herokuapp.com,,/"}
]
}
?>
<StGallen xhType="XhtypePureActiveObject">
<port name="port" index="0" connector="RemoteNodeService-PeerJS,remoteid0,delete,3,delete,9000,/"/>
</StGallen>
<Graubunden xhType="XhtypePureActiveObject">
<port name="port" index="0" connector="RemoteNodeService-PeerJS,remoteid2,delete,3,delete,9000,/"/>
</Graubunden>
<Avatar><Color>red</Color></Avatar>
<Gift><Color>indigo</Color></Gift>
<container><Color>orange</Color></container>
<Ort><Color>green</Color></Ort>
<DataExport><Color>green</Color></DataExport>
</xholonClassDetails>
<PhysicalSystem>
<Universe>
<StGallen/>
<Graubunden/>
</Universe>
<Animate duration="1" selection="#one" xpath="./PhysicalSystem/Universe" efParams="{&quot;selection&quot;:&quot;#one&quot;,&quot;sort&quot;:&quot;disable&quot;,&quot;width&quot;:600,&quot;height&quot;:600,&quot;mode&quot;:&quot;tween&quot;,&quot;labelContainers&quot;:true,&quot;includeId&quot;:true,&quot;shape&quot;:&quot;circle&quot;,&quot;maxChars&quot;:4,&quot;togglePortColors&quot;:false}"/>
</PhysicalSystem>
<PhysicalSystembehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, beh = {
postConfigure: function() {
me = this.cnode.parent();
$wnd.xh.param("TimeStepInterval", 1000);
// SVG caption
$wnd.xh.svg = {};
$wnd.xh.svg.caption = $doc.createElement("p");
$wnd.xh.svg.caption.textContent = $wnd.xh.param("ModelName");
var div = $doc.querySelector("#xhanim");
// create a new div for this animation
var one = $doc.createElement("div");
one.setAttribute("id", "one");
div.appendChild(one);
one.appendChild($wnd.xh.svg.caption);
$wnd.xh.root().append(this.cnode.remove());
var ava = $wnd.xh.avatar();
//ava.action("param setCtxtOnselect false;start;");
ava.action("param setCtxtOnselect false;enter physicalSystem;enter universe;enter stGallen;appear;start;");
if ($wnd.xh.html["selectTab"]) {
$wnd.xh.html.selectTab(0); // display contents of the "out" tab
}
}
}
//# sourceURL=PhysicalSystembehavior.js
]]></PhysicalSystembehavior>
<StGallenbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, meName, beh = {
postConfigure: function() {
me = this.cnode.parent();
meName = me.xhc().name();
//THIS BEHAVIOR NODE MUST REMAIN A DIRECT CHILD OF THE StGallen NODE (otherwise the call to processReceivedMessage() won't work)
//root.append(this.cnode.remove());
},
act: function() {
// send one or more test messages from StGallen, through the proxy, to the remote end (these are asynchronous messages)
if (me.port(0)) {
me.port(0).msg(103, meName + " " + $wnd.xh.param("TimeStep"), this.cnode);
}
if (this.cnode.first()) {
// a user may accidentally drop some content onto the behavior (this.cnode) node instead of the me node
me.append(this.cnode.first().remove());
}
},
processReceivedMessage: function(msg) {
me.println("processReceivedMessage " + meName + " " + msg.data);
}
}
//# sourceURL=StGallenbehavior.js
]]></StGallenbehavior>
<Graubundenbehavior implName="org.primordion.xholon.base.Behavior_gwtjs"><![CDATA[
var me, meName, beh = {
postConfigure: function() {
me = this.cnode.parent();
meName = me.xhc().name();
//THIS BEHAVIOR NODE MUST REMAIN A DIRECT CHILD OF THE Graubunden NODE (otherwise the call to processReceivedMessage() won't work)
//root.append(this.cnode.remove());
},
act: function() {
// send one or more test messages from StGallen, through the proxy, to the remote end (these are asynchronous messages)
if (me.port(0)) {
me.port(0).msg(103, meName + " " + $wnd.xh.param("TimeStep"), this.cnode);
}
if (this.cnode.first()) {
// a user may accidentally drop some content onto the behavior (this.cnode) node instead of the me node
me.append(this.cnode.first().remove());
}
},
processReceivedMessage: function(msg) {
me.println("processReceivedMessage " + meName + " " + msg.data);
}
}
//# sourceURL=Graubundenbehavior.js
]]></Graubundenbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>PhysicalSystem</title>
<rect id="PhysicalSystem" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Hello</title>
<rect id="PhysicalSystem/Universe" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment