Commit 1fca4860 authored by icyrizard's avatar icyrizard

added apk and .ipa

parent 80c3d1c7
...@@ -4,7 +4,7 @@ www/sencha-touch-2.0.0-commercial/* ...@@ -4,7 +4,7 @@ www/sencha-touch-2.0.0-commercial/*
*.log *.log
*.gz *.gz
*.aux *.aux
www/build/* www/build/package
www/resources/sass/.sass-cache/* www/resources/sass/.sass-cache/*
*.pdf *.pdf
*.bbl *.bbl
......
...@@ -466,7 +466,7 @@ Now by executing the command. ...@@ -466,7 +466,7 @@ Now by executing the command.
\begin{lstlisting}[caption={command to build native},label={lst:buildnative}] \begin{lstlisting}[caption={command to build native},label={lst:buildnative}]
$ sencha app build native $ sencha app build native
\end{lstlisting} \end{lstlisting}
The application is packaged. All the javascript code's dependencies are resolved, minified and placed in the \texttt{build} folder. The \texttt{build} contains two folders. One \texttt{package} and one \texttt{native} folder. In the \texttt{package} folder the developer can see what result of the minification is, and can also test in the browser if everything still works. The native files are placed in the \texttt{native} folder. When executing for Android the applications extension will be a .apk\todo{ref to apk?}, for iOS it will be a .app file. The file can be transferred to the device and installed. On Android it's easier that iOS. When building for Android the result of the command(listing \ref{lst:buildnative}) runs the application when done with packaging. When building for iOS, sencha creates a .app file that can be transferred to the device by Itunes\footnote{How to do this can be found in the video ``Getting started'' at: \url{http://docs.sencha.com/touch/2-0/\#!/guide/getting\_started}}. The application is packaged. All the javascript code's dependencies are resolved, minified and placed in the \texttt{build} folder. The \texttt{build} contains two folders. One \texttt{package} and one \texttt{native} folder. In the \texttt{package} folder the developer can see what result of the minification is, and can also test in the browser if everything still works. The native files are placed in the \texttt{native} folder. When executing for Android the applications extension will be a .apk, for iOS it will be a .app file. The file can be transferred to the device and installed. On Android it's easier that iOS. When building for Android the result of the command(listing \ref{lst:buildnative}) runs the application when done with packaging. When building for iOS, sencha creates a .app file that can be transferred to the device by Itunes\footnote{How to do this can be found in the video ``Getting started'' at: \url{http://docs.sencha.com/touch/2-0/\#!/guide/getting\_started}}.
The deployment can be distributed to other devices. On Android devices it's possible to install .apk files directly to the device from the command line. The generated .apk file can also be distributed to other Android devices and can be installed without the use of the command line tool of Sencha Touch. The deployment can be distributed to other devices. On Android devices it's possible to install .apk files directly to the device from the command line. The generated .apk file can also be distributed to other Android devices and can be installed without the use of the command line tool of Sencha Touch.
For iOS this is more difficult. When a developer is in the possession of an Apple's developer account the UUID(Unique Identifier) needs to be added to the provisioning portal. This grants the device to install applications that are also registered by the developers account. If the application only needs to tested on iOS it is possible to jailbreak the iPad without obtaining an Apple's developer account. How to jailbreak the iPad to is desribed here \url{http://greenpois0n.com/}. For enabling to install without a developers account apps without ``Appsync'' has to be installed.\footnote{\url{http://www.ijailbreak.com/cydia/install-cracked-apps-ios-5-0-1-with-appsync-installous/}} For iOS this is more difficult. When a developer is in the possession of an Apple's developer account the UUID(Unique Identifier) needs to be added to the provisioning portal. This grants the device to install applications that are also registered by the developers account. If the application only needs to tested on iOS it is possible to jailbreak the iPad without obtaining an Apple's developer account. How to jailbreak the iPad to is desribed here \url{http://greenpois0n.com/}. For enabling to install without a developers account apps without ``Appsync'' has to be installed.\footnote{\url{http://www.ijailbreak.com/cydia/install-cracked-apps-ios-5-0-1-with-appsync-installous/}}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>11D50</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Flood Simulation</string>
<key>CFBundleExecutable</key>
<string>stbuild_template</string>
<key>CFBundleIconFiles</key>
<array>
<string>resources/icons/Icon~ipad.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.uva.floodsimulation</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Flood Simulation</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleResourceSpecification</key>
<string>ResourceRules.plist</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>9A334</string>
<key>DTPlatformName</key>
<string>iphoneos</string>
<key>DTPlatformVersion</key>
<string>5.0</string>
<key>DTSDKBuild</key>
<string>9A334</string>
<key>DTSDKName</key>
<string>iphoneos5.0</string>
<key>DTXcode</key>
<string>0420</string>
<key>DTXcodeBuild</key>
<string>4D199</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>3.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer><integer>2</integer>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
APPL????
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>rules</key>
<dict>
<key>.*</key>
<true/>
<key>Info.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>ResourceRules.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>100</real>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Default-LandscapeLeft~ipad.png</key>
<data>
JXo/q2Z1ai8hj1gd7P4vIqXOlWA=
</data>
<key>Default-LandscapeRight~ipad.png</key>
<data>
e/tK6sCSKi6aAZomgHMbYH/rhmg=
</data>
<key>Default-Landscape~ipad.png</key>
<data>
nkxHgxkXTcAafL7TJgVSYSBtjLE=
</data>
<key>Default-PortraitUpsideDown~ipad.png</key>
<data>
0LTYx6KF2PJvVjUJnb/Y2Vq+hmI=
</data>
<key>Default-Portrait~ipad.png</key>
<data>
S8Nr2vwPI8JgIqoOE6p862Zq7dE=
</data>
<key>Default.png</key>
<data>
rwfPrP3oFKLsAoCH5MwN+BqYgJA=
</data>
<key>Default@2x.png</key>
<data>
VoZFozEeM2JeV8esgKTL/BYZITM=
</data>
<key>Default~ipad.png</key>
<data>
L70+6wMpgRWkLtKMqOclvNoJTaM=
</data>
<key>Icon.png</key>
<data>
K7bsjP9rKk4p2NOBsifpsh7mp3k=
</data>
<key>Icon@2x.png</key>
<data>
YppWB02Wjj12M2B2rI0D8uhDasQ=
</data>
<key>Icon~ipad.png</key>
<data>
ftOjIY+czSAY5aOcsb9HVtXqmew=
</data>
<key>Icon~ipad@2x.png</key>
<data>
KkYb1dG0arZc4VFLacoT4Ck+DaI=
</data>
<key>PkgInfo</key>
<data>
n57qDP4tZfLD1rCS43W0B4LQjzE=
</data>
<key>icon-spot~ipad.png</key>
<data>
gyb58/PWoz7wRm8DKqBg0NkjTAg=
</data>
<key>webapp/.DS_Store</key>
<data>
C0mth+8OXYrXzfEaCvvP1VRLwCw=
</data>
<key>webapp/1336834306_dialog-close.png</key>
<data>
fQtBFxoA2zMhfHmn84tt3lIIKek=
</data>
<key>webapp/Homescreen.jpg</key>
<data>
Qm1gTbLW/a0MYsQmxZH5K79vOTo=
</data>
<key>webapp/Homescreen~ipad.jpg</key>
<data>
yUzfvKU76BBENiksZaOytMJkDUE=
</data>
<key>webapp/app.js</key>
<data>
xgFq7I3Mk+fNdBUNsIZ4R9A8A6s=
</data>
<key>webapp/app.json</key>
<data>
2I1D48mmuPgoVIi8Zdwaf+mWVts=
</data>
<key>webapp/iTunesArtwork.png</key>
<data>
ytuwHbp3ia19o9yHbcwbc9TIgq0=
</data>
<key>webapp/index.html</key>
<data>
53zKe8tazCzz8p8ZkAOk6vgKDbc=
</data>
<key>webapp/play1.png</key>
<data>
FAcCbOGGrb+WJZeWoIWxWN6nNoE=
</data>
<key>webapp/resources/css/app.css</key>
<data>
XliOOsJZTqvhqoVv1WdPh7s9v/I=
</data>
<key>webapp/resources/icons/1336834306_dialog-close.png</key>
<data>
fQtBFxoA2zMhfHmn84tt3lIIKek=
</data>
<key>webapp/resources/icons/Icon.png</key>
<data>
K7bsjP9rKk4p2NOBsifpsh7mp3k=
</data>
<key>webapp/resources/icons/Icon@2x.png</key>
<data>
YppWB02Wjj12M2B2rI0D8uhDasQ=
</data>
<key>webapp/resources/icons/Icon~ipad.png</key>
<data>
ftOjIY+czSAY5aOcsb9HVtXqmew=
</data>
<key>webapp/resources/icons/Icon~ipad@2x.png</key>
<data>
KkYb1dG0arZc4VFLacoT4Ck+DaI=
</data>
<key>webapp/resources/icons/iTunesArtwork.png</key>
<data>
ytuwHbp3ia19o9yHbcwbc9TIgq0=
</data>
<key>webapp/resources/icons/icon-spot~ipad.png</key>
<data>
gyb58/PWoz7wRm8DKqBg0NkjTAg=
</data>
<key>webapp/resources/icons/play1.png</key>
<data>
FAcCbOGGrb+WJZeWoIWxWN6nNoE=
</data>
<key>webapp/resources/images/.DS_Store</key>
<data>
3y++sUAKzaCQmjLBz2v0kvESHgc=
</data>
<key>webapp/resources/images/Google_Maps_Marker.png</key>
<data>
tCzMELX/Es6fK2OHN1jhe0VEN6E=
</data>
<key>webapp/resources/images/area_chart.png</key>
<data>
fwezFvxNaD7mdOtUEqILQOrIUJc=
</data>
<key>webapp/resources/images/arrow_down.png</key>
<data>
18ttAbGHxqZJv4e+UiXC3C5ZetA=
</data>
<key>webapp/resources/images/arrow_left.png</key>
<data>
pGQWDm0D3vmdytbA6ZhwAu3axwY=
</data>
<key>webapp/resources/images/arrow_right.png</key>
<data>
myB2wZZ+RH2cDXSYPt8RSlDNU6I=
</data>
<key>webapp/resources/images/arrow_up.png</key>
<data>
ml0gYmMVBwra7N/Wyy+vFT0jE/c=
</data>
<key>webapp/resources/images/bar_chart.png</key>
<data>
yJU1ieDfxf23lvrhEBhJn+GRtcg=
</data>
<key>webapp/resources/images/bg.png</key>
<data>
swSshTS0iJo5CA4++dc84mBATZE=
</data>
<key>webapp/resources/images/bg2.png</key>
<data>
4DvbLa95tyqk34VywbD/49Q7dYY=
</data>
<key>webapp/resources/images/close_icon.png</key>
<data>
fQtBFxoA2zMhfHmn84tt3lIIKek=
</data>
<key>webapp/resources/images/closebutton20.png</key>
<data>
vI2IAzQ8zt1IjwDnLIEKb33ng5s=
</data>
<key>webapp/resources/images/closebutton50.png</key>
<data>
Y2nqKeldqaYittxUBnz09YufN7Q=
</data>
<key>webapp/resources/images/clsbtn50.png</key>
<data>
O8WfUjtyYJm6wrTfe5JnTK5P0l8=
</data>
<key>webapp/resources/images/column_chart.png</key>
<data>
9hjPIcrUsupvj5rSCPcAjTIurdY=
</data>
<key>webapp/resources/images/crosshair.png</key>
<data>
uukzs5Hlds5OE5EiwwMAxgzRe1U=
</data>
<key>webapp/resources/images/crosshair2.png</key>
<data>
CQxfKp5TgbbPwk7TsceemM9kHX8=
</data>
<key>webapp/resources/images/crosshair3.png</key>
<data>
3vYv1a1mI8OyYbN/0efgDeV1GpM=
</data>
<key>webapp/resources/images/gauge_chart.png</key>
<data>
TQn561Ii1//uOqmCc7jmMUZTKnw=
</data>
<key>webapp/resources/images/image1.jpeg</key>
<data>
xKPjNeC03nsVIcO6NiDzarBrApM=
</data>
<key>webapp/resources/images/image2.jpeg</key>
<data>
rVmpcfKnbPySa1pqHwt9zEYBOXI=
</data>
<key>webapp/resources/images/line_chart.png</key>
<data>
VHtYzVYLIWNAXnSHug64nJDpEag=
</data>
<key>webapp/resources/images/loading.gif</key>
<data>
O2Hh0GmKitnGg2Kuin1IInFN4j8=
</data>
<key>webapp/resources/images/marker.png</key>
<data>
KZZabM9Rtj4uZsCxaQV795N5D58=
</data>
<key>webapp/resources/images/mixed_chart.png</key>
<data>
ldd82OQqjHAsMNhxPPg+gZYfAZk=
</data>
<key>webapp/resources/images/noimage.png</key>
<data>
Alejarw/KsnFQW/morCCoaIYO8E=
</data>
<key>webapp/resources/images/pie_chart.png</key>
<data>
vXUXBUET6MIaFWSqNyKr9lwAsBY=
</data>
<key>webapp/resources/images/radar_chart.png</key>
<data>
VMR2zHzlKMcdDuOVieZOMgGqf8A=
</data>
<key>webapp/resources/images/scatter_chart.png</key>
<data>
3b+9ZED1yKHru6YjL+E3k2Q4TbA=
</data>
<key>webapp/resources/loading/Default-LandscapeLeft~ipad.png</key>
<data>
JXo/q2Z1ai8hj1gd7P4vIqXOlWA=
</data>
<key>webapp/resources/loading/Default-LandscapeRight~ipad.png</key>
<data>
e/tK6sCSKi6aAZomgHMbYH/rhmg=
</data>
<key>webapp/resources/loading/Default-Landscape~ipad.png</key>
<data>
nkxHgxkXTcAafL7TJgVSYSBtjLE=
</data>
<key>webapp/resources/loading/Default-PortraitUpsideDown~ipad.png</key>
<data>
0LTYx6KF2PJvVjUJnb/Y2Vq+hmI=
</data>
<key>webapp/resources/loading/Default-Portrait~ipad.png</key>
<data>
S8Nr2vwPI8JgIqoOE6p862Zq7dE=
</data>
<key>webapp/resources/loading/Default.png</key>
<data>
rwfPrP3oFKLsAoCH5MwN+BqYgJA=
</data>
<key>webapp/resources/loading/Default@2x.png</key>
<data>
VoZFozEeM2JeV8esgKTL/BYZITM=
</data>
<key>webapp/resources/loading/Default~ipad.png</key>
<data>
L70+6wMpgRWkLtKMqOclvNoJTaM=
</data>
<key>webapp/resources/loading/Homescreen.jpg</key>
<data>
Qm1gTbLW/a0MYsQmxZH5K79vOTo=
</data>
<key>webapp/resources/loading/Homescreen~ipad.jpg</key>
<data>
yUzfvKU76BBENiksZaOytMJkDUE=
</data>
<key>webapp/sdk/.DS_Store</key>
<data>
3y++sUAKzaCQmjLBz2v0kvESHgc=
</data>
<key>webapp/sdk/sencha-touch.js</key>
<data>
wgECfHE89dbKuOnIq8cRt88wKi4=
</data>
<key>webapp/sdk/touch-charts.js</key>
<data>
ryQSLJQTl2iHGD92WYbKFm3zPc8=
</data>
</dict>
<key>rules</key>
<dict>
<key>.*</key>
<true/>
<key>Info.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>ResourceRules.plist</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>100</real>
</dict>
</dict>
</dict>
</plist>
Ext.define("app.model.SimulationModel",{extend:"Ext.data.Model",config:{fields:["name","corners","visbounds","area_id","center","size"],},});Ext.define("app.model.SimulationDetails",{extend:"Ext.data.Model",config:{fields:["name","center","corners","size","extents","visbounds","vissize","projection","dikes"],},});Ext.define("app.view.Main",{extend:"Ext.Container",requires:["Ext.TitleBar"],config:{title:"Simulation Browser",layout:"hbox",fullscreen:true,items:[{xtype:"listpanel",width:"20%",style:"border-right: 1px solid #373737",flex:1,},{xtype:"simulationpanel",flex:2}],}});Ext.define("app.view.Simulation",{extend:"Ext.Panel",xtype:"simulationpanel",config:{layout:"card",items:[{docked:"top",xtype:"toolbar",title:"Flood Simulation Browser",},{xtype:"SimulationMap",}],}});Ext.define("app.view.List",{extend:"Ext.navigation.View",xtype:"listpanel",requires:["Ext.data.Store","Ext.dataview.List"],title:"Simulations",config:{navigationBar:{title:"simulations",items:[{id:"simulationOptions",xtype:"button",iconCls:"list",iconMask:true,left:"100%",top:7,ui:["square"],}]},items:[{title:"Locations",id:"cities",xtype:"list",ui:"round",itemTpl:"<div>{name}</div>",store:"SimulationStore",}],},});Ext.define("app.view.Map",{extend:"Ext.Map",xtype:"SimulationMap",id:"mapa",config:{useLoadMask:true,mapOptions:{zoom:12,center:new google.maps.LatLng(52.354453,4.95536),mapTypeId:google.maps.MapTypeId.ROADMAP,navigationControl:true,scrollwheel:true,scaleControl:true,rotateControl:true,panControl:true,overviewMapControl:true,zoomControl:true,navigationControlOptions:{style:google.maps.NavigationControlStyle.DEFAULT}},listeners:{maprender:function(){this.overlayImages=[];this.Images=[];this.imageIndex=0;this.imageBounds=null;this.play=false;this.testId=0;this.areaId=0;this.listener_ref=null;this.marker_listener=null}}},getReference:function(){return this.globalMap},setGlobalMap:function(a,b){this.globalMap=b;this.globalExtMap=a},setCenterMap:function(a){this.globalExtMap.setMapCenter({latitude:a[0],longitude:a[1]})},alterMapOptions:function(a){this.globalExtMap.setMapOptions(a)},createMarker:function(b,a){map=this.globalExtMap;var b=new google.maps.LatLng(b[0],b[1]);if(a!=null){icon=a.icon||"resources/images/Google_Maps_Marker.png";draggable=a.draggable||false;raiseOnDrag=a.raiseOnDrag||false}else{icon="resources/images/Google_Maps_Marker.png";draggable=false;raiseOnDrag=false}marker=new google.maps.Marker({position:b,icon:icon,map:this.globalMap,title:"you",raiseOnDrag:true,draggable:draggable,});if(this.marker_listener!=null){google.maps.event.removeListener(this.marker_listener)}this.marker_listener=google.maps.event.addListener(marker,"dragend",function(c){map.fireEvent("dragend",c)});return marker},createOverlayImage:function(d,g,b,f){var c=this;var a="";if(f=="Flood"){a="http://sangkil.science.uva.nl:8003/drfsm/"+g+"/visualization/level/map/"}else{if(f=="Lsm"){a="http://sangkil.science.uva.nl:8003/lsm/"+g+"/visualization/paru/map/"}else{return false}}this.imageIndex=0;this.imageBounds=new google.maps.LatLngBounds(new google.maps.LatLng(d[2],d[3]),new google.maps.LatLng(d[0],d[1]));this.bounds=d;if(this.overlayImages.length>1){this.removeImages()}for(i in b){var e=new Image();e.src=a+b[i]+".png";console.log(e.src);this.overlayImages.push(new google.maps.GroundOverlay(e.src,this.imageBounds))}this.overlayImages[0].setMap(this.globalMap);this.imageIndex=this.overlayImages.length;if(this.listeners_ref!=null){google.maps.event.removeListener(this.listeners_ref)}this.listeners_ref=google.maps.event.addListener(this.overlayImages[0],"click",function(h){c.fireEvent("gotClick",h)})},nextImage:function(){var a=this;if(this.overlayImages.length<=1){return}var b=(this.overlayImages.length+this.imageIndex)%this.overlayImages.length;this.imageIndex=(this.overlayImages.length+this.imageIndex+1)%this.overlayImages.length;this.overlayImages[this.imageIndex].setMap(this.globalMap);if(this.listeners_ref!=null){google.maps.event.removeListener(this.listeners_ref)}this.listeners_ref=google.maps.event.addListener(this.overlayImages[this.imageIndex],"click",function(c){a.fireEvent("gotClick",c)});this.overlayImages[b].setMap(null)},prevImage:function(){if(this.overlayImages.length<=1){return}this.overlayImages[this.imageIndex].setMap(null);this.imageIndex-=this.imageIndex>0?1:0;if(this.imageIndex>=0){this.overlayImages[this.imageIndex].setMap(this.globalMap)}},removeImages:function(){for(i in this.overlayImages){this.overlayImages[i].setMap(null)}this.imageIndex=0;this.overlayImages=[];this.Images=[]},createOverlayPolygon:function(a){var d=[];for(var c=0;c<a[0].length-1;c++){d.push(new google.maps.LatLng(a[0][c][0],a[0][c][1]))}var b=new google.maps.Polygon({paths:d,strokeColor:"#FF0000",strokeOpacity:0.8,strokeWeight:2,fillColor:"#FF0000",fillOpacity:0.35});b.setMap(this.globalMap)},getCurrentImage:function(){if(this.overlayImages.length>0){this.overlayImages[this.imageIndex];return this.overlayImages[this.imageIndex]}},getFloodImage:function(b,a){if(a){return"http://sangkil.science.uva.nl:8003/drfsm/"+b+"/visualization/level/map/"+a+".png"}else{return false}}});Ext.define("app.view.StepsOverlay",{extend:"Ext.Container",xtype:"StepsOverlay",requires:["Ext.Anim"],config:{id:"overlay",style:"background: none;",html:'<div id="controls_title"><h2>Controls<h2></div>',showAnimation:{type:"slideIn",direction:"left",},hidden:true,width:220,height:130,scroll:false,draggable:true,items:[{xtype:"button",id:"closebutton",top:-10,right:0,ui:"plain",border:"solid",style:"color: white; background: none",html:"x",handler:this.closebutton,scope:this,},{top:30,left:35,align:"center",items:[{xtype:"button",id:"forward",ui:"blue",cls:"overlay-button",width:45,iconCls:"arrow_up",floating:"right",iconMask:true,align:"center",left:40},{top:50,xtype:"button",id:"backwards",ui:"blue",cls:"overlay-button",width:45,floating:"left",iconCls:"arrow_down",align:"center",iconMask:true,left:40},{top:24,xtype:"button",id:"play",ui:"blue",cls:"overlay-button",width:40,floating:"left",iconCls:"arrow_right",align:"center",iconMask:true,left:85,},{top:24,hidden:true,xtype:"button",id:"pause",ui:"red",cls:"overlay-button",width:40,floating:"left",iconCls:"pause",align:"center",iconMask:true,left:85,},{top:24,xtype:"button",id:"play-backw",ui:"blue",cls:"overlay-button",width:40,floating:"left",iconCls:"arrow_left",align:"center",iconMask:true,left:0,},{top:24,hidden:true,xtype:"button",id:"pause-backw",ui:"red",cls:"overlay-button",width:40,floating:"left",iconCls:"pause",align:"center",iconMask:true,left:0,}],}],closebutton:function(){Ext.dispatch({controller:app.controller.Main,action:"closeoverlay"})}}});Ext.define("app.view.OptionsPanel",{extend:"Ext.Panel",xtype:"SimulationOptions",id:"simulation_options",requires:["Ext.dataview.List"],config:{layout:"hbox",right:40,width:200,height:100,hideOnMaskTap:true,modal:true,items:[{xtype:"list",id:"optionsList",width:"100%",itemTpl:"Simulation {type}",data:[{type:"Flood"},{type:"Lsm"}],}],}});Ext.define("app.view.SimulationList",{extend:"Ext.List",xtype:"SimulationList",id:"summary",config:{scrollable:{momentum:false},title:"Floods",fullscreen:true,store:"SimulationsSummary",itemTpl:'<div><img class="map_thumb" id="{test_id}_map"src=""/> <img class="flood_thumb" id="{test_id}_flood"style:"width: 100px;" src=""/><div style:"clear:both"><div id="{test_id}_control" class="control"></div></div><h3><b>submitted:</b></h3> <bold>{submitted}</bold></div></div>'},listeners:{scroll:function(){console.log("scroll")}}});Ext.define("app.view.LsmSimulationList",{extend:"Ext.List",xtype:"LsmSimulationList",id:"lsmsimulation-list",config:{title:"lsm",store:"LsmStore",itemTpl:"{submitted}",}});Ext.define("app.view.Chart",{extend:"Ext.Panel",id:"flood-chart",xtype:"floodChart",requires:["Ext.data.Store"],config:{width:520,height:420,layout:"fit",draggable:true,items:[{xtype:"chart",theme:"Base",animate:true,id:"flood-chart-id",store:"chartStore",left:20,width:490,height:400,axes:[{type:"Numeric",position:"left",fields:["volume"],title:"Volume",minimum:0,adjustMinimumByMajorUnit:0,},{type:"Category",position:"bottom",fields:["time"],title:"Time Step",minimum:0,adjustMinimumByMajorUnit:0,}],series:[{type:"line",highlight:false,smooth:true,axis:"left",xField:["time"],yField:["volume"],}],},{xtype:"button",ui:"close",id:"closeChart",left:0,top:0,iconCls:"delete",iconMask:true,}],}});Ext.define("app.controller.Main",{extend:"Ext.app.Controller",config:{refs:{map:"#mapa",sidepanel:"listpanel",api:"api",play:"#play",pause:"#pause",playBackw:"#play-backw",pauseBackw:"#pause-backw",mapView:"SimulationMap",simulationList:{selector:"summary",xtype:"SimulationList",autoCreate:true,},overlay:{selector:"#overlay",xtype:"StepsOverlay",autoCreate:true,},simulationOptions:{selector:"#simulation-options",xtype:"SimulationOptions",autoCreate:true,},simOptionsButton:{selector:"#simulationOptions",autoCreate:true,},optionsList:{selector:"#optionsList",autoCreate:true,},lsmSimulation:{selector:"lsmsimulation-list",xtype:"LsmSimulationList",autoCreate:true,},simulation:"simulationpanel"},control:{"listpanel #cities":{itemtap:"showList",show:"initiateCities"},"listpanel #summary":{itemtap:"simulate",},"#mapa":{maprender:"setMap"},"#closebutton":{tap:"closeoverlay"},"#backwards":{tap:"prevImage"},"#forward":{tap:"nextImage"},"#simulationOptions":{tap:"openSimulationsOptions"},"#pause":{tap:"stopPlayImages"},"#play":{tap:"playImages"},"#pause-backw":{tap:"stopBackwImages"},"#play-backw":{tap:"playBackwImages"},"#optionsList":{itemtap:"changeSimulationType",},"listpanel #lsmsimulation-list":{itemtap:"simulate",}}},init:function(){this.selectedIndex=[];this.SimulType="Flood";this.test_id=null},initiateCities:function(){this.getSimOptionsButton().show()},setMap:function(a,b){this.globalMap=b;this.getMapView().setGlobalMap(a,b)},stopBackwImages:function(a){clearInterval(this.interval);a.hide();this.getPlayBackw().show()},playBackwImages:function(b){this.getPlay().show();this.getPause().hide();clearInterval(this.interval);b.hide();this.getPauseBackw().show();var a=this.getMapView();this.interval=setInterval(function(){a.prevImage()},500)},playImages:function(b){this.getPlayBackw().show();this.getPauseBackw().hide();clearInterval(this.interval);b.hide();this.getPause().show();var a=this.getMapView();this.interval=setInterval(function(){a.nextImage()},500)},stopPlayImages:function(a){clearInterval(this.interval);a.hide();this.getPlay().show();clearInterval(this.interval)},prevImage:function(){this.getMapView().prevImage()},nextImage:function(){this.getMapView().nextImage()},closeoverlay:function(){this.getPlay().show();this.getPause().hide();this.getPlayBackw().show();this.getPauseBackw().hide();clearInterval(this.interval);this.getMapView().removeImages();this.getOverlay().hide()},simulate:function(j,h,e,g){var k=this;this.getMapView().removeImages();var c=this.getMapView(),f=g.get("test_id"),a;this.test_id=f;var d=function(m){var n=m.timesteps||m.images;if(n.length>0){c.createOverlayImage(a,f,n,k.SimulType);c.testId=m.test_id;c.areaId=m.area_id}};var l=Ext.getStore("FloodDetailStore");l.each(function(m){a=m.get("visbounds")});var b="";if(this.SimulType=="Flood"){b="http://sangkil.science.uva.nl:8003/drfsm/"+f+"/info.json"}else{b="http://sangkil.science.uva.nl:8003/lsm/"+f+"/visualization/paru/info.json"}this.requestInfo(f,d,b);this.getOverlay().showBy(this.getMapView(),"tr-tr")},showList:function(l,k,g,j){this.getSimOptionsButton().hide();this.getMapView().removeImages();var c=j.get("center");var e=j.get("area_id");var f=false;for(i in this.selectedIndex){if(this.selectedIndex[i]==k){f=true}}var m=Ext.getStore("SimulationsSummary");var d=Ext.getStore("LsmStore");d.clearFilter();d.filter("area_id",e);m.clearFilter();m.filter("area_id",e);if(this.SimulType=="Flood"){this.setThumb(c);this.getSidepanel().push(this.getSimulationList())}else{if(this.SimulType=="Lsm"){this.getSidepanel().push(this.getLsmSimulation())}}var m=Ext.getStore("FloodDetailStore");m.setUrl(e);m.load();if(f==false){var b=null;var a=j.get("visbounds");var h=j.get("corners");this.selectedIndex.push(k);m.each(function(n){b=n.get("dikes")});if(b.length!=0){this.getMapView().createOverlayPolygon(b)}this.getMapView().createMarker(c);this.getSimulationOptions().show();this.getSimulationOptions().hide()}this.getMapView().setCenterMap(c);this.getMapView().alterMapOptions({zoom:13})},setThumb:function(){if(typeof this.test_id==undefined){return}var b=this;var a=Ext.getStore("SimulationsSummary");a.each(function(d){var e=d.get("test_id");var c=function(f){var g=b.getMapView().getFloodImage(e,f.timesteps[f.timesteps.length-1])||"resources/images/noimage.png";document.getElementById(e+"_flood").src=g};b.requestInfo(d.get("test_id"),c)})},requestInfo:function(b,d,a){var a=a||"http://sangkil.science.uva.nl:8003/drfsm/"+b+"/info.json";var c=Ext.Ajax.request({method:"GET",url:a,success:function(f,g){var e=Ext.decode(f.responseText);d(e)},failure:function(){console.log("failed to create images")}})},openSimulationsOptions:function(a){this.getSimulationOptions().showBy(a)},closeSimulationsOptions:function(a){this.getSimulationOptions().hide()},changeSimulationType:function(d,b,c,a){if(a.get("type")=="Lsm"&&this.SimulType!="Lsm"){this.SimulType="Lsm"}else{if(a.get("type")=="Flood"&&this.SimulType!="Flood"){this.SimulType="Flood"}}this.getSimulationOptions().hide()},});Ext.define("app.store.SimulationStore",{extend:"Ext.data.Store",requires:["Ext.data.proxy.Rest"],id:"simulationList",config:{autoLoad:true,model:"app.model.SimulationModel",proxy:{type:"rest",url:"http://sangkil.science.uva.nl:8003/area/list.json",reader:{type:"json",rootProperty:"areas"},}}});Ext.define("app.store.FloodDetailStore",{extend:"Ext.data.Store",requires:["Ext.data.proxy.Rest"],xtype:"FloodDetailStore",config:{autoLoad:true,model:"app.model.SimulationDetails",fields:["name","center","corners","size","extents","visbounds","vissize","projection","dikes"],proxy:{type:"rest",url:"http://sangkil.science.uva.nl:8003/area/1/info.json",reader:{type:"json",},},listeners:{}},setUrl:function(b){var a=Ext.getStore("FloodDetailStore").getProxy();a._url="http://sangkil.science.uva.nl:8003/area/"+b+"/info.json"},});Ext.define("app.store.SimulationsSummary",{extend:"Ext.data.Store",requires:["Ext.data.proxy.Rest"],config:{autoLoad:true,fields:["area_id","test_id","submitted"],proxy:{type:"rest",url:"http://sangkil.science.uva.nl:8003/drfsm/list.json?summary",reader:{type:"json",rootProperty:"simulations"}}},});Ext.define("app.store.LsmStore",{extend:"Ext.data.Store",config:{autoLoad:true,fields:["area_id","test_id","submitted"],proxy:{type:"rest",url:"http://sangkil.science.uva.nl:8003/lsm/list.json",reader:{type:"json",rootProperty:"simulations"}}}});Ext.define("app.store.chartStore",{extend:"Ext.data.JsonStore",config:{fields:["time","volume"]}});Ext.define("app.Api",{mixins:["Ext.mixin.Observable"],singleton:true,getIzid:function(d,a,c){var b=this;var e=Ext.Ajax.request({method:"GET",url:"http://sangkil.science.uva.nl:8003/area/"+c+"/izid.json?latlng="+d+","+a,success:function(g,h){var f=Ext.decode(g.responseText);b.fireEvent("gotIzid",f.izid)},failure:function(){console.log("getIzid: failed to get izid")}})},getCsvFile:function(a,d){var b=this;var c=Ext.Ajax.request({method:"GET",url:"http://sangkil.science.uva.nl:8003/drfsm/"+a+"/results/izid/"+d+".csv",success:function(e,f){b.fireEvent("gotCsv",e.responseText)},failure:function(){console.log("getCsvFile: failed to get csv file")}})},requestInfo:function(b,d,a){var a=a||"http://sangkil.science.uva.nl:8003/drfsm/"+b+"/info.json";var c=Ext.Ajax.request({method:"GET",url:a,success:function(f,g){var e=Ext.decode(f.responseText);d(e)},failure:function(){console.log("failed to create images")}})}});Ext.define("app.controller.ChartController",{extend:"Ext.app.Controller",requires:["app.Api"],config:{refs:{Floodchart:{xtype:"floodChart",selector:"flood-chart",autoCreate:true,},ChartData:{selector:"flood-chart-id",autoCreate:true,},ExpandButton:"#expand-button",mapView:"SimulationMap",},control:{"#mapa":{maprender:"addListener"},"#closeChart":{tap:"closeFloodChart"},"#expand-button":{tap:"expandChart"},},},init:function(){self.marker=null;map=this.getMapView();app.Api.on({gotIzid:function(a){app.Api.getCsvFile(map.testId,a)},gotCsv:function(a){me.plot(a)}})},addListener:function(){me=this;map=this.getMapView();map.on({gotClick:function(a){if(self.marker!=null){self.marker.setMap(null);self.marker=null}lat=a.latLng.lat();lng=a.latLng.lng();options={icon:"resources/images/marker.png",draggable:true,raiseOnDrag:true,};self.marker=map.createMarker([lat,lng],options);app.Api.getIzid(lat,lng,map.areaId)},dragend:function(a){console.log(a);lat=a.latLng.lat();lng=a.latLng.lng();app.Api.getIzid(lat,lng,map.areaId)}})},plot:function(a){array=a.split("\n");store=Ext.getStore("chartStore");columns=array[0];volume=[];time=[];data=[];for(i=1;i<array.length;i++){line_clmns=array[i].split(",");data.push({time:parseInt(line_clmns[0]),volume:parseInt(line_clmns[2]),})}store.setData(data);this.openChart()},openChart:function(){this.getFloodchart().showBy(this.getMapView(),"t-t")},closeFloodChart:function(){this.getFloodchart().hide()},expandChart:function(){}});Ext.application({controllers:["Main","ChartController"],models:["SimulationModel","SimulationDetails"],stores:["SimulationStore","FloodDetailStore","SimulationsSummary","LsmStore","chartStore"],name:"app",requires:["Ext.MessageBox",],views:["Main","Simulation","List","Map","StepsOverlay","OptionsPanel","SimulationList","LsmSimulationList","Chart"],icon:{57:"resources/icons/Icon.png",72:"resources/icons/Icon~ipad.png",114:"resources/icons/Icon@2x.png",144:"resources/icons/Icon~ipad@2x.png"},phoneStartupScreen:"resources/loading/Homescreen.jpg",tabletStartupScreen:"resources/loading/Homescreen~ipad.jpg",launch:function(){Ext.fly("appLoadingIndicator").destroy();Ext.Viewport.add(Ext.create("app.view.Main"))},onUpdated:function(){Ext.Msg.confirm("Application Update","This application has just successfully been updated to the latest version. Reload now?",function(){window.location.reload()})}});
\ No newline at end of file
{"id":"b67f2b40-7fd3-11e1-bda5-b5b6c868e529","js":[{"path":"sdk/sencha-touch.js","type":"js"},{"path":"app.js","update":"delta","type":"js"}],"css":[{"path":"resources/css/app.css","update":"delta","type":"css"}]}
\ No newline at end of file
<!DOCTYPE HTML>
<html manifest="" lang="en-US">
<head>
<meta charset="UTF-8">
<title>Floodsimulation Browser</title>
<style type="text/css">
/**
* Example of an initial loading indicator.
* It is recommended to keep this as minimal as possible to provide instant feedback
* while other resources are still being loaded for the first time
*/
html, body {
height: 100%;
}
#appLoadingIndicator {
position: absolute;
top: 50%;
left: 50%;
margin-top: -10px;
margin-left: -50px;
width: 100px;
height: 20px;
}
#appLoadingIndicator > * {
background-color: #FFFFFF;
float: left;
height: 20px;
margin-left: 11px;
width: 20px;
-webkit-animation-name: appLoadingIndicator;
-webkit-border-radius: 13px;
-webkit-animation-duration: 0.8s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: linear;
opacity: 0.3
}
#appLoadingIndicator > :nth-child(1) {
-webkit-animation-delay: 0.18s;
}
#appLoadingIndicator > :nth-child(2) {
-webkit-animation-delay: 0.42s;
}
#appLoadingIndicator > :nth-child(3) {
-webkit-animation-delay: 0.54s;
}
@-webkit-keyframes appLoadingIndicator{
0% {
opacity: 0.3
}
50% {
opacity: 1;
background-color:#1985D0
}
100% {
opacity:0.3
}
}
.flood_thumb {
position: relative;
z-index: 100;
left: 0px;
top: 10px;
width: 80%;
/* height: 180px;*/
}
.map_thumb {
position: relative;
left: 0px;
top: 0px;
}
#overlay {
border: solid;
border-width: 1px;
border-color: #a9a9a9;
background-image: url('resources/images/bg.png');
}
.x-list .x-list-inner {
background-image: url('resources/images/bg.png');
}
.x-list-item {
}
.x-button-icon.down.x-icon-mask {
background: url(up.png);
}
#controls_title {
}
.x-back-button {
}
#controls_title h2 {
color: white;
border: white;
background: rgb(169,3,41); /* Old browsers */
background: -moz-linear-gradient(top, rgba(169,3,41,1) 0%, rgba(143,2,34,1) 44%, rgba(109,0,25,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(169,3,41,1)), color-stop(44%,rgba(143,2,34,1)), color-stop(100%,rgba(109,0,25,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(169,3,41,1) 0%,rgba(143,2,34,1) 44%,rgba(109,0,25,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(169,3,41,1) 0%,rgba(143,2,34,1) 44%,rgba(109,0,25,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(169,3,41,1) 0%,rgba(143,2,34,1) 44%,rgba(109,0,25,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(169,3,41,1) 0%,rgba(143,2,34,1) 44%,rgba(109,0,25,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a90329', endColorstr='#6d0019',GradientType=0 ); /* IE6-9 */
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">(function(h){function f(c,d){document.write('<meta name="'+c+'" content="'+d+'">')}if("undefined"===typeof g)var g=h.Ext={};g.blink=function(c){var d=c.js||[],c=c.css||[],b,e,a;f("viewport","width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no");f("apple-mobile-web-app-capable","yes");f("apple-touch-fullscreen","yes");for(b=0,e=c.length;b<e;b++)a=c[b],"string"!=typeof a&&(a=a.path),document.write('<link rel="stylesheet" href="'+a+'">');for(b=0,e=d.length;b<
e;b++)a=d[b],"string"!=typeof a&&(a=a.path),document.write('<script src="'+a+'"><\/script>')}})(this);
;Ext.blink({"id":"b67f2b40-7fd3-11e1-bda5-b5b6c868e529","js":[{"path":"sdk/sencha-touch.js","type":"js"},{"path":"app.js","update":"delta","type":"js"}],"css":[{"path":"resources/css/app.css","update":"delta","type":"css"}]})</script>
<script type="text/javascript" src="sdk/touch-charts.js"></script>
</head>
<body>
<div id="appLoadingIndicator">
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment