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
--- /dev/null
+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
+
--- /dev/null
+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
+