Commit ceeb6bb3 authored by Jérémie Garcia's avatar Jérémie Garcia

Mini bug fixes in View

Now running almost properly
parent 866509ce
......@@ -84,4 +84,5 @@ mobile/WOB/qr_code.png
mobile/WOB_new/qr_code.png
**/traj/**
\ No newline at end of file
**/traj/**
WOB/qr_code.png
......@@ -34,7 +34,7 @@
</head>
<body onresize="javascript:Trajectoires.View.traj_initCanvas()">
<body onresize="javascript:Traj.View.traj_initCanvas()">
<!-- Start of first page -->
<div id="main-page" data-role="page" data-theme="a">
......@@ -46,7 +46,7 @@
<label> Undo: </label>
<div>
<a onClick="javascript:Trajectoires.State.undo();" data-role="button" data-theme="a" data-icon="back" data-inline="true"></a>
<a onClick="javascript:Traj.State.undo();" data-role="button" data-theme="a" data-icon="back" data-inline="true"></a>
</div>
<label>Speakers Pos: </label>
......@@ -254,10 +254,10 @@
<div id="sessionDiv">
<a id="lblCurrentSession" data-role="button" data-mini="true" data-inline="true" data-inline="true">0</a>
<div id="sessionDivOverCanvas">
<a onClick="javascript:Trajectoires.Session.selectPreviousSession();" data-inline="true" data-mini="true" data-role="button" data-iconpos="notext" data-icon="arrow-l"> Previous </a>
<a onClick="javascript:Trajectoires.Session.selectNextSession();" data-inline="true" data-mini="true" data-role="button" data-iconpos="notext" data-icon="arrow-r"> Next </a>
<a onClick="javascript:Trajectoires.Session.newSession();" data-inline="true" data-mini="true" data-role="button" data-icon="plus" data-iconpos="notext"> New </a>
<a onClick="javascript:Trajectoires.Session.deleteSelectedSession();" data-inline="true" data-mini="true" data-role="button" data-icon="delete" data-iconpos="notext"> Delete </a>
<a onClick="javascript:Traj.Session.selectPreviousSession();" data-inline="true" data-mini="true" data-role="button" data-iconpos="notext" data-icon="arrow-l"> Previous </a>
<a onClick="javascript:Traj.Session.selectNextSession();" data-inline="true" data-mini="true" data-role="button" data-iconpos="notext" data-icon="arrow-r"> Next </a>
<a onClick="javascript:Traj.Session.newSession();" data-inline="true" data-mini="true" data-role="button" data-icon="plus" data-iconpos="notext"> New </a>
<a onClick="javascript:Traj.Session.deleteSelectedSession();" data-inline="true" data-mini="true" data-role="button" data-icon="delete" data-iconpos="notext"> Delete </a>
</div>
</div>
......@@ -319,7 +319,7 @@
<script type="text/javascript">
$(document).ready(function() {
Trajectoires.initialize();
Traj.initialize();
$.mobile.loading().hide();
});
</script>
......
......@@ -19,8 +19,8 @@ Traj.View = {
// Unit converter
scaleFactor : 4,
minWH : {},
pixToValue : Traj.View.scaleFactor / Traj.View.minWH,
minWH : {}, //Ratios of Width and height to be changed dynamically on init
pixToValue : 1,
//Speakers related draing vars
SPEAKER_DIST : 1, //Distances of the speakers in arbitrary units
......@@ -78,16 +78,15 @@ Traj.View = {
return ctx;
}
this.bg_ctx = initializeCanvasContext(bg_canvas,canvas_width,canvas_height);
this.traj_ctx = initializeCanvasContext(traj_canvas,canvas_width,canvas_height);
this.dyn_ctx = initializeCanvasContext(dyn_canvas,canvas_width,canvas_height);
this.current_ctx = initializeCanvasContext(current_canvas,canvas_width,canvas_height);
this.bg_ctx = initializeCanvasContext(this.bg_canvas,canvas_width,canvas_height);
this.traj_ctx = initializeCanvasContext(this.traj_canvas,canvas_width,canvas_height);
this.dyn_ctx = initializeCanvasContext(this.dyn_canvas,canvas_width,canvas_height);
this.current_ctx = initializeCanvasContext(this.current_canvas,canvas_width,canvas_height);
this.minWH = Math.min(this.dyn_canvas.width, this.dyn_canvas.height);
this.pixToValue = this.scaleFactor / this.minWH;
this.repaintAll();
}
},
//used to clear any of the graphics contexts
clearContext : function(ctx) {
......
......@@ -37,10 +37,10 @@ var app = {
function motion(event){
Trajectoires.OSC.sendMessage("/Accelerometer", [event.accelerationIncludingGravity.x, event.accelerationIncludingGravity.y, event.accelerationIncludingGravity.z]);
Traj.OSC.sendMessage("/Accelerometer", [event.accelerationIncludingGravity.x, event.accelerationIncludingGravity.y, event.accelerationIncludingGravity.z]);
}
function orientation(event){
Trajectoires.OSC.sendMessage("/Magnetometer", [event.alpha , event.beta, event.gamma]);
Traj.OSC.sendMessage("/Magnetometer", [event.alpha , event.beta, event.gamma]);
);
}
\ No newline at end of file
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