OSDN Git Service

modify feicontrol.rb from FEI_PC
authoriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 11 Sep 2015 15:07:03 +0000 (17:07 +0200)
committeriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 11 Sep 2015 15:07:03 +0000 (17:07 +0200)
vem_fei/vem/.feicontrol.rb.un~ [new file with mode: 0644]
vem_fei/vem/.test.rb.un~ [new file with mode: 0644]
vem_fei/vem/feicontrol.rb
vem_fei/vem/feicontrol.rb~ [new file with mode: 0644]
vem_fei/vem/test.rb~ [new file with mode: 0644]

diff --git a/vem_fei/vem/.feicontrol.rb.un~ b/vem_fei/vem/.feicontrol.rb.un~
new file mode 100644 (file)
index 0000000..82af058
Binary files /dev/null and b/vem_fei/vem/.feicontrol.rb.un~ differ
diff --git a/vem_fei/vem/.test.rb.un~ b/vem_fei/vem/.test.rb.un~
new file mode 100644 (file)
index 0000000..10410e7
Binary files /dev/null and b/vem_fei/vem/.test.rb.un~ differ
index 595c5c4..93fecc5 100644 (file)
@@ -33,17 +33,14 @@ class FEIControl < VEM
        def setSpotSize(spsize)
                puts "FEI setSpotSize"
 
-               @@tem = WIN32OLE.new('TEMScripting.Instrument')
-       #       ill    = @@tem.Illumination
-       #       ill.SpotsizeIndex = ill.SpotsizeIndex + spsize
-       #       return ill.SpotsizeIndex
+               ill    = @@tem.Illumination
+               ill.SpotsizeIndex = ill.SpotsizeIndex + spsize
+               return ill.SpotsizeIndex
        end
 
        def setMagnification(magsize)
                puts "FEI setMagnification"
 
-       
-               @@tem = WIN32OLE.new('TEMScripting.Instrument')
                proj = @@tem.Projection
                proj.MagnificationIndex = proj.MagnificationIndex + magsize
                return proj.MagnificationIndex
diff --git a/vem_fei/vem/feicontrol.rb~ b/vem_fei/vem/feicontrol.rb~
new file mode 100644 (file)
index 0000000..75ef7f4
--- /dev/null
@@ -0,0 +1,82 @@
+require "win32ole"
+require "open3"
+
+require "./vem"
+
+
+
+class FEIControl < VEM
+       def initialize
+               puts "FEI initialize"
+
+               @@tem = WIN32OLE.new('TEMScripting.Instrument')
+       end
+
+       def setStageA(x, y, z, a)
+               puts "FEI setStageA"
+
+               o,s = Open3.capture2("cscript tool/setStageA.js " + x.to_s + " " + y.to_s + " " + z.to_s + " " + a.to_s)
+               position = o.lines.to_a[3]
+               puts position
+               return position
+       end
+
+       def setStageR(x, y, z, a)
+
+               puts "FEI setStageR"
+               o,s = Open3.capture2("cscript tool/setStageR.js " + x.to_s + " "+ y.to_s + " " + z.to_s + " " + a.to_s)
+               position = o.lines.to_a[3]
+               puts position
+               return position
+       end
+
+       def setSpotSize(spsize)
+               puts "FEI setSpotSize"
+
+#              @@tem = WIN32OLE.new('TEMScripting.Instrument')
+               ill    = @@tem.Illumination
+               ill.SpotsizeIndex = ill.SpotsizeIndex + spsize
+               return ill.SpotsizeIndex
+       end
+
+       def setMagnification(magsize)
+               puts "FEI setMagnification"
+
+       
+               @@tem = WIN32OLE.new('TEMScripting.Instrument')
+               proj = @@tem.Projection
+               proj.MagnificationIndex = proj.MagnificationIndex + magsize
+               return proj.MagnificationIndex
+       end
+
+       def acquisition
+               puts "FEI acquition"
+
+               # get acquitision object
+               acq = @@tem.Acquisition
+
+               # acquire an image from "CCD" camera
+               acq.AddAcqDeviceByName("CCD")
+               imageCollection = acq.AcquireImages
+
+               img     = imageCollection.Item(0)
+               imgData = img.AsSafeArray
+               return imgData
+       end
+
+       def setObj(params)
+               puts "FEI setObj"
+       end
+
+       def setBeamTilt(params)
+               puts "FEI setBeamTilt"
+       end
+
+       def setSpeed(params)
+       end
+
+       def getCondition
+               puts "FEI getCondition"
+       end
+end
+
diff --git a/vem_fei/vem/test.rb~ b/vem_fei/vem/test.rb~
new file mode 100644 (file)
index 0000000..c40fbf5
--- /dev/null
@@ -0,0 +1,28 @@
+require "./vem"
+require "./feicontrol"
+
+class TEST
+       def initialize
+               @@vem = VEM.create("fei")
+       end
+
+       def test_setStageA
+               @@vem.setStageA(2, 0, 0, 0)
+       end
+
+       def test_setStageR
+               @@vem.setStageR(1, 0, 0, 0)
+       end
+
+       def test_setSpotSize
+               @@vem.setSpotSize(1)
+       end
+
+       def test_acquisition
+               @@vem.acquisition
+       end
+end
+
+test = TEST.new
+test.test_acquisition
+