From: himetani_cafe Date: Thu, 18 Feb 2016 09:40:03 +0000 (+0900) Subject: [TMP] Before developing command exectuion UI view. X-Git-Tag: v0.3.0p0049 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=refs%2Ftags%2Fv0.3.0p0049;p=eos%2Fzephyr.git [TMP] Before developing command exectuion UI view. --- diff --git a/front-end/app/scripts/directives/Command.ts b/front-end/app/scripts/directives/Command.ts index c9ff0ba..8c2cc33 100644 --- a/front-end/app/scripts/directives/Command.ts +++ b/front-end/app/scripts/directives/Command.ts @@ -89,9 +89,14 @@ namespace app.directives { controller.isOpen = false; }); - this.WebSocket.on('test', function(data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function(msg) { + console.log(msg); }); + + this.WebSocket.on('test', function(msg) { + console.log(msg); + }); + } public submit() { diff --git a/front-end/dist/bundle.js b/front-end/dist/bundle.js index ec923c4..3f1c09f 100644 --- a/front-end/dist/bundle.js +++ b/front-end/dist/bundle.js @@ -41200,8 +41200,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -41800,8 +41803,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -42400,8 +42406,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -43000,8 +43009,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -43600,8 +43612,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -44200,8 +44215,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -44800,8 +44818,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -45400,8 +45421,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -46000,8 +46024,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -46600,8 +46627,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -47200,8 +47230,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -47800,8 +47833,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -48400,8 +48436,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { @@ -49000,8 +49039,11 @@ this.$scope.$on('close', function () { controller.isOpen = false; }); - this.WebSocket.on('test', function (data) { - console.log("HOGEHOGEHOGEHOHGOEHGOH"); + this.WebSocket.on('connect', function (msg) { + console.log(msg); + }); + this.WebSocket.on('test', function (msg) { + console.log(msg); }); } CommandController.prototype.submit = function () { diff --git a/n_thesis.log b/n_thesis.log deleted file mode 100644 index b8462de..0000000 --- a/n_thesis.log +++ /dev/null @@ -1,56 +0,0 @@ -This is e-pTeX, Version 3.14159265-p3.5-130605-2.6 (utf8.euc) (TeX Live 2014) (preloaded format=platex 2015.3.17) 3 FEB 2016 13:38 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**/Users/Takafumi/m_thesis/n_thesis.tex -(/Users/Takafumi/m_thesis/n_thesis.tex -pLaTeX2e <2006/11/10> (based on LaTeX2e <2014/05/01> patch level 0) -Babel <3.9k> and hyphenation patterns for 78 languages loaded. -(/usr/local/texlive/2014/texmf-dist/tex/platex/base/jarticle.cls -Document Class: jarticle 2006/06/27 v1.6 Standard pLaTeX class -\c@@paper=\count81 -(/usr/local/texlive/2014/texmf-dist/tex/platex/base/jsize12.clo -File: jsize12.clo 2006/06/27 v1.6 Standard pLaTeX file (size option) -) -\c@part=\count82 -\c@section=\count83 -\c@subsection=\count84 -\c@subsubsection=\count85 -\c@paragraph=\count86 -\c@subparagraph=\count87 -\c@figure=\count88 -\c@table=\count89 -\abovecaptionskip=\skip41 -\belowcaptionskip=\skip42 -\symmincho=\mathgroup4 -LaTeX Font Info: Overwriting symbol font `mincho' in version `bold' -(Font) JY1/mc/m/n --> JY1/gt/m/n on input line 601. -\toclineskip=\dimen118 -\@lnumwidth=\dimen119 -\bibindent=\dimen120 -\heisei=\count90 -) - -! LaTeX Error: File `AIthesis.sty' not found. - -Type X to quit or to proceed, -or enter new name. (Default extension: sty) - -Enter file name: -! Emergency stop. - - -l.5 \usepackage - {ascmac}^^M -End of file on the terminal! - - -Here is how much of TeX's memory you used: - 251 strings out of 493807 - 2615 string characters out of 6151951 - 56782 words of memory out of 5000000 - 3804 multiletter control sequences out of 15000+600000 - 7817 words of font info for 32 fonts, out of 8000000 for 9000 - 929 hyphenation exceptions out of 8191 - 22i,0n,19p,159b,36s stack positions out of 5000i,500n,10000p,200000b,80000s -No pages of output. diff --git a/server/api/v1/execution/index.js b/server/api/v1/execution/index.js index f02a1ee..ba52af9 100644 --- a/server/api/v1/execution/index.js +++ b/server/api/v1/execution/index.js @@ -6,8 +6,12 @@ var path = require('path') var formidable = require('formidable') var db = require(__dirname + '/../../../../server/class/DB').instance; var eos = require(__dirname + '/../../../../server/class/Eos').instance; +var ws = require(__dirname + '/../../../../server/ws').instance; router.post('/', function(req, res) { + + ws.emit(); + var form = new formidable.IncomingForm(); var root; var result; diff --git a/server/app.js b/server/app.js index c700669..328dcce 100644 --- a/server/app.js +++ b/server/app.js @@ -8,6 +8,8 @@ var app = express(); var EventEmitter = require('events').EventEmitter; var emitter = new EventEmitter; var server = require('http').Server(app) +var ioServer = require('socket.io'); +var ws = require('./ws').instance; require('./express')(app); require('./routes')(app); @@ -29,8 +31,8 @@ DB.init() console.log('NODE_ENV = ' + app.get('env')) }); - var io = require('socket.io').listen(server); - require('./ws')(io); + var io = ioServer.listen(server); + ws.connect(io); }); -//exports = module.exports = app; +exports = module.exports = app; diff --git a/server/ws/index.js b/server/ws/index.js index 321267f..b2d8227 100644 --- a/server/ws/index.js +++ b/server/ws/index.js @@ -3,10 +3,17 @@ var fs = require('fs') var socket; -module.exports = function(io) { - io.on('connection', function(socket) { - console.log("websocket was connected") - socket.emit('test', 'testtesttest'); +var instance = { + connect: function(io) { + io.on('connection', function(s) { + socket = s; + console.log('connected'); + socket.emit('connect', 'connected'); + }); + }, + emit: function() { + socket.emit('test','outer test'); + } /* array include obj { @@ -22,5 +29,6 @@ module.exports = function(io) { socket.emit('done', 'success') }) */ - }) -} +}; + +module.exports = { instance: instance };