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

MultiPlatform (win) path update

Added interface.js to allow use (firefox only, no chrome) of the html
file alone.
parent 325cabb7
......@@ -9,6 +9,7 @@ if (typeof require !== 'undefined') {
os = require('os'),
qr = require('qr-image'),
//midi = require('midi'),
pathModule = require('path'),
fetchingInterface = null;
}
......@@ -907,6 +908,8 @@ var path = window.location.pathname;
//go back to the .app file
path = path.substr(0, path.lastIndexOf('WOB'));
var save_directory = path + "traj";
save_directory = pathModule.normalize(save_directory);
//WArning may have permission problems!
if (!fs.existsSync(save_directory)){
......@@ -915,12 +918,13 @@ if (!fs.existsSync(save_directory)){
function savetraj(args){
var session_dir = save_directory+"/"+args[0];
session_dir = pathModule.normalize(session_dir);
if (!fs.existsSync(session_dir)){
fs.mkdirSync(session_dir);
}
var filename = session_dir+"/"+args[1]+".txt";
var filename = session_dir+ pathModule.sep +args[1]+".txt";
//make the content of the file
var content = "";
......@@ -956,8 +960,9 @@ function savetraj(args){
});
}
default_interface_path = default_interface_path.replace("index.html","server/interfaces");
default_interface_path = pathModule.normalize(default_interface_path);
console.log(default_interface_path);
//add the default server
var default_traj_server = {
webSocketPort: 8081,
......@@ -976,9 +981,6 @@ var default_traj_server = {
};
var def_server = global.interface.serverRow(default_traj_server);
//global.interface.trajectoiresPage = fs.readFileSync( './server/interfaces/Trajectoires.html', ['utf-8'] );
//OLD FUNCTIONS WITH IP ADDRESS INSTEAD OF COMPUTER'S NAME
var interfaces = os.networkInterfaces();
var addresses = [];
......@@ -992,8 +994,9 @@ var def_server = global.interface.serverRow(default_traj_server);
}
var server_ip = addresses[0];
//to use computer name instead
// var server_ip = os.hostname();
var link = 'http://' + server_ip + ':8080/Trajectoires.html';
var link = 'http://' + server_ip + ':'+ default_traj_server.webServerPort+ '/Trajectoires.html';
//URL DISPLAY
var div_text = "<a href=\"" +link + "\" target=\"_blank\">"+ link +"</a>" ;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -91,7 +91,6 @@ Traj.Player = {
},
stopPlayActions : function() {
console.log("Stop action");
if (this.isPlaying) {
if (this.requestId) {
cancelAnimationFrame(this.requestId);
......
......@@ -28,6 +28,7 @@ Traj.Session = {
for (var j = 0; j < array[i].X.length; j++) {
newCurve.addTimedPoint(array[i].X[j],array[i].Y[j],array[i].Z[j],array[i].t[j]);
newCurve.setOrientationAtIndex(array[i].orientation,i);
}
newCurve.sourceNumber = array[i].sourceNumber;
trajectories.push(newCurve);
......
......@@ -128,7 +128,6 @@ Traj.Utils = {
},
distanceBtwPoints : function(p1, p2) {
console.log()
var dx = p1[0] - p2[0];
var dy = p1[1] - p2[1];
return Math.sqrt(dx * dx + dy * dy);
......
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