diff --git a/BoneCentral/WebApplication/index.js b/BoneCentral/WebApplication/index.js index 4ddf3b1..8575e53 100644 --- a/BoneCentral/WebApplication/index.js +++ b/BoneCentral/WebApplication/index.js @@ -1,34 +1,31 @@ -var express = require('express'); -var bodyParser = require('body-parser'); -var fileSystem = require('fs'); -var path = require("path"); -var CppInterface = require('../Brain/CppInterface'); -var VisionInterface = require("../Brain/VisionInterface"); -var WebLogger = require('./WebLogger'); -var FileLogger = require('./FileLogger'); -var app = express(); -var GoThroughGate = require("../Brain/GoThroughGate"); - -var peripheralsFactory = new CppInterface.Factory(); -var ThrustManager = require("../Brain/ThrustManager"); -var thrustManager = new ThrustManager(peripheralsFactory); - -var thrustController = peripheralsFactory.createThrustController(); -var headLights = peripheralsFactory.createHeadlights(); -var powerManager = peripheralsFactory.createPowerManager(); -var imuSensor = peripheralsFactory.createImuSensor(); - -var fileLogger = new FileLogger("./test.log"); -var webLogger = new WebLogger(fileLogger); -peripheralsFactory.createCppLogSource(webLogger); +var express = require('express'); +var bodyParser = require('body-parser'); +var fileSystem = require('fs'); +var path = require("path"); +var WebLogger = require('./WebLogger'); +var FileLogger = require('./FileLogger'); +var CppInterface = require('../Brain/CppInterface'); +var VisionInterface = require("../Brain/VisionInterface"); +var GoThroughGate = require("../Brain/GoThroughGate"); +var ThrustManager = require("../Brain/ThrustManager"); + +var fileLogger = new FileLogger("./test.log"); +var webLogger = new WebLogger(fileLogger); +var peripheralsFactory = new CppInterface.Factory(); +var visionFactoy = new VisionInterface.Factory(); +var thrustManager = new ThrustManager(peripheralsFactory); +var goThroughGate = new GoThroughGate(visionFactoy, thrustManager, webLogger); + +var thrustController = peripheralsFactory.createThrustController(); +var powerManager = peripheralsFactory.createPowerManager(); +var imuSensor = peripheralsFactory.createImuSensor(); +var headLights = peripheralsFactory.createHeadlights(); +var gateDetector = visionFactoy.createGateDetector(webLogger); +peripheralsFactory.createCppLogSource(webLogger); CppInterface.Peripherals.initialize(); -var visionFactoy = new VisionInterface.Factory(); -var gateDetector = visionFactoy.createGateDetector(webLogger); - -var goThroughGate = new GoThroughGate(visionFactoy, thrustManager, webLogger); - +app = express(); app.use('/', express.static('static')); app.use(bodyParser.json()); @@ -238,7 +235,6 @@ app.post('/runScript', function(req, res) { }) }); - app.listen(80, function () { - console.log('Example app listening on port 80!'); + console.log('Web app listening on port 80!'); }); diff --git a/BoneCentral/WebApplication/static/index.html b/BoneCentral/WebApplication/static/index.html index b414869..14c4046 100644 --- a/BoneCentral/WebApplication/static/index.html +++ b/BoneCentral/WebApplication/static/index.html @@ -6,11 +6,12 @@ USUb +