OSDN Git Service

rm vem
[vem/vem.git] / test / view / mock / img.js
index ec29170..80a02d8 100644 (file)
@@ -3,8 +3,7 @@ var i = 0;
 
 
 function startAcq(){
-  console.log("start");
-  $("button").text("stop");
+ $("button").text("stop");
   ws = new WebSocket("ws://localhost:3000");
 
   // メッセージ受信時の処理
@@ -14,8 +13,7 @@ function startAcq(){
     }else{
       ws.send("acq");
       draw(JSON.parse(event.data));
-      console.log(event.data);
-      console.log(i);
+     console.log(i);
       i = i + 1;
     }
   };
@@ -23,8 +21,8 @@ function startAcq(){
 }
 
 function stopAcq(){
+ $("button").text("start");
   console.log("stop");
-  $("button").text("start");
   ws.close(1000, "close");
 }
 
@@ -60,3 +58,4 @@ function draw(data){
   // CanvasのコンテキストにImageDataを設定
   ctx.putImageData(imgData, 0, 0);
 }
+