OSDN Git Service

[TMP] Before developing command exectuion UI view. v0.3.0p0049
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 18 Feb 2016 09:40:03 +0000 (18:40 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 18 Feb 2016 09:40:03 +0000 (18:40 +0900)
front-end/app/scripts/directives/Command.ts
front-end/dist/bundle.js
n_thesis.log [deleted file]
server/api/v1/execution/index.js
server/app.js
server/ws/index.js

index c9ff0ba..8c2cc33 100644 (file)
@@ -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() {
index ec923c4..3f1c09f 100644 (file)
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 () {
                        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 (file)
index b8462de..0000000
+++ /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 <RETURN> to proceed,
-or enter new name. (Default extension: sty)
-
-Enter file name: 
-! Emergency stop.
-<read *> 
-         
-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.
index f02a1ee..ba52af9 100644 (file)
@@ -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;
index c700669..328dcce 100644 (file)
@@ -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;
index 321267f..b2d8227 100644 (file)
@@ -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 };