OSDN Git Service

all files of WITs
[vem/WITs.git] / JS / em.js
index c07ba30..d4c9334 100644 (file)
--- a/JS/em.js
+++ b/JS/em.js
@@ -4,6 +4,23 @@ var UrlElement = userSetting.GetUrlElementInstance();
 var hello = userSetting.sayHello;
 console.log(UrlElement['sendIpAddress']);
 
+var LoadLogMemory = new LogMemory();
+var GETLogMemory = LoadLogMemory.LogMemoryInstance();
+var MemoryAll = LoadLogMemory.GETLog();
+
+/*
+getCurrentParams()
+clickMove()
+setStage()
+setSpotSize()
+setMagnificationA()
+setMagnificationR()
+correntConditionText()
+setSpotSize()
+setMagnificationR()
+setMagnificationA()
+nowCondition()
+*/
 
 
 function getCurrentParams(){
@@ -22,8 +39,6 @@ console.log("getcurrentparams");
   });
 }
 
-
-
 function clickMove(direction){
   var movingdistance = $("#movingdistance").val();
   var movexr = $("#movex").val();
@@ -47,23 +62,21 @@ switch(directionSwitch){
     break;
 
     case "Left":
-      movexr = parseInt(movexr) - (parseInt(movingdistance));
+      movexr = parseInt(movexr) + (parseInt(movingdistance));
       $("#movex").val(String(movexr));
     break;
 
     case "Right":
-    movexr = parseInt(movexr) + (parseInt(movingdistance));
+    movexr = parseInt(movexr) - (parseInt(movingdistance));
     $("#movex").val(String(movexr));
     $("#currentx").val(String(movexr));
     break;
     }
     $.ajax({
       type:"GET",
-      //電子顕微鏡通信時
-  //    url:"http://192.168.4.146:9090/fei/set/stagea?x="+encodeURIComponent(movexr)+
-      //モック
       url:"http://" +UrlElement['sendIpAddress']+
-      ":"+UrlElement['sendPortNumber']+"/fei/set/stagea?x="+encodeURIComponent(movexr)+
+      ":"+UrlElement['sendPortNumber']+"/"+UrlElement['sendManufacturer']+
+      "/set/stagea?x="+encodeURIComponent(movexr)+
       "&y="+encodeURIComponent(moveyr)+
       "&z="+encodeURIComponent(movezr)+
       "&a="+encodeURIComponent(movezr),
@@ -78,9 +91,6 @@ function setStage(){
   var movexr = $("#movex").val();
   var moveyr = $("#movey").val();
   var movezr = $("#movez").val();
-console.log("movingdistance="+movingdistance);
-console.log("movex="+movexr);
-console.log("movey="+moveyr);
 
   $("#movey").keydown(function(e){
     console.log(e.keyCode);
@@ -99,6 +109,8 @@ console.log("movey="+moveyr);
   });
 
   $("#movex").keydown(function(e){
+    console.log(e.keyCode);
+    console.log(typeof(e.keyCode));
     //RIGHT(→,a,k)
     if (e.keyCode == 39 || e.keyCode == 68 || e.keyCode == 76) {
     movexr = parseInt(movexr) + (parseInt(movingdistance)-1);
@@ -117,7 +129,7 @@ console.log("movey="+moveyr);
 //    url:"http://192.168.4.146:9090/fei/set/stagea?x="+encodeURIComponent(movexr)+
     url:"http://"+UrlElement['sendIpAddress']+
     ":"+UrlElement['sendPortNumber']+
-    "/"+UrlElement['sendElectronMicroscopeName']+
+    "/"+UrlElement['sendManufacturer']+
     "/set/stagea?x="+encodeURIComponent(movexr)+
     "&y="+encodeURIComponent(moveyr)+
     "&z="+encodeURIComponent(movezr)+
@@ -136,3 +148,62 @@ function currentConditionText(){
   console.log("currentcondition");
   $("#Currentcondition").innerHTML='x:"movexr" y:"moveyr" z:"movezr"'
 }
+
+function setSpotSize(){
+  var setSpotSize = $("#SpotSize").val();
+  $.ajax({
+    type:"GET",
+    url:"http://"+UrlElement['sendIpAddress']+
+    ":"+UrlElement['sendPortNumber']+
+    "/"+UrlElement['sendManufacturer']+
+    "/set/spotsizea?sps="+encodeURIComponent(setSpotSize),
+    success: function(data){
+      console.log(data);
+    }
+  });
+}
+
+function setMagnificationA(){
+  var magnificationA = $("#magnificationA").val();
+  $.ajax({
+    type:"GET",
+    url:"http://"+UrlElement['sendIpAddress']+
+    ":"+UrlElement['sendPortNumber']+
+    "/"+UrlElement['sendManufacturer']+
+    "/set/magnificationa?mag="+encodeURIComponent(magnificationA),
+    success: function(data){
+      console.log(data);
+    }
+  });
+}
+function setMagnificationR(){
+  var magnificationR = $("#magnificationR").val();
+  $.ajax({
+    type:"GET",
+    url:"http://"+UrlElement['sendIpAddress']+
+    ":"+UrlElement['sendPortNumber']+
+    "/"+UrlElement['sendManufacturer']+
+    "/set/magnificationr?mag="+encodeURIComponent(magnificationR),
+    success: function(data){
+      console.log(data);
+    }
+  });
+}
+
+function nowCondition(){
+  var movexr = $("#movex").val();
+  var moveyr = $("#movey").val();
+  var movezr = $("#movez").val();
+  var movea = $("#movea").val();
+  var spotSize = $("#spotSize").val();
+  var exptime = $("#exptime").val();
+  var manufacturer = UrlElement['sendElectronMicroscopeName'];
+  document.getElementById("tem").innerHTML = manufacturer;
+  document.getElementById("currentx").innerHTML = parseInt(movexr);
+  document.getElementById("currenty").innerHTML = parseInt(moveyr);
+  document.getElementById("currentz").innerHTML = parseInt(movezr);
+  document.getElementById("currenta").innerHTML = parseInt(movea);
+  document.getElementById("SpotSizeIndex").innerHTML = parseInt(spotSize);
+  document.getElementById("MagIndex").innerHTML = parseInt(magnificationA);
+
+}