OSDN Git Service

add vem function(spotsize & magnification, A, R)
authoriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 6 Jan 2016 05:44:55 +0000 (14:44 +0900)
committeriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 6 Jan 2016 05:44:55 +0000 (14:44 +0900)
vem/.feicontrol.rb.un~
vem/.test.rb.un~
vem/.vem.rb.un~
vem/feicontrol.rb
vem/feicontrol.rb~
vem/test.rb
vem/test.rb~
vem/vem.rb
vem/vem.rb~

index 65080e1..9f2620d 100644 (file)
Binary files a/vem/.feicontrol.rb.un~ and b/vem/.feicontrol.rb.un~ differ
index dfed9e3..0b50774 100644 (file)
Binary files a/vem/.test.rb.un~ and b/vem/.test.rb.un~ differ
index b8aba52..e6fd0ea 100644 (file)
Binary files a/vem/.vem.rb.un~ and b/vem/.vem.rb.un~ differ
index 100fb9e..2fba37b 100644 (file)
@@ -51,9 +51,9 @@ class FEIControl < VEM
                @@params[:stage][:a] = @@tem.Stage.Position.A
                @@params[:ill][:spotSizeIndex] = @@tem.Illumination.SpotsizeIndex
                @@params[:proj][:magIndex] = @@tem.Projection.MagnificationIndex
-       #       @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
-       #       @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
-       #       @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
+               #       @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
+               #       @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
+               #       @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
 
                return @@params.to_json
        end
@@ -97,22 +97,41 @@ class FEIControl < VEM
                return @@params[:stage].to_json
        end
 
-       def set_spotsize(spsize)
-               puts "FEI setSpotSize"
+       def set_spotsizeA(spsize)
+               puts "FEI setSpotSizeA"
+
+               ill    = @@tem.Illumination
+               ill.SpotsizeIndex = spsize
+               @@params[:ill][:spotSizeIndex] = ill.SpotsizeIndex
+               return @@params[:ill].to_json
+       end
+
+       def set_spotsizeR(spsize)
+               puts "FEI setSpotSizeR"
 
                ill    = @@tem.Illumination
                ill.SpotsizeIndex = ill.SpotsizeIndex + spsize
                @@params[:ill][:spotSizeIndex] = ill.SpotsizeIndex
-               return @@params[:ill][:spotSizeIndex].to_json
+               return @@params[:ill].to_json
+       end
+
+
+       def set_magnificationA(magsize)
+               puts "FEI setMagnificationA"
+
+               proj = @@tem.Projection
+               proj.MagnificationIndex = magsize
+               @@params[:proj][:magIndex] = proj.MagnificationIndex
+               return @@params[:proj].to_json
        end
 
-       def set_magnification(magsize)
-               puts "FEI setMagnification"
+       def set_magnificationR(magsize)
+               puts "FEI setMagnificationR"
 
                proj = @@tem.Projection
                proj.MagnificationIndex = proj.MagnificationIndex + magsize
                @@params[:proj][:magIndex] = proj.MagnificationIndex
-               return @@params[:proj][:magIndex]
+               return @@params[:proj].to_json
        end
 
        def acquisition_init(binning, exp_time, image_size)
index 265e1ac..4ddc622 100644 (file)
@@ -49,11 +49,11 @@ class FEIControl < VEM
                @@params[:stage][:y] = @@tem.Stage.Position.Y
                @@params[:stage][:z] = @@tem.Stage.Position.Z
                @@params[:stage][:a] = @@tem.Stage.Position.A
-               @@params[:ill][:spotSizeIndex] = ill.SpotsizeIndex
-               @@params[:proj][:magIndex] = proj.MagnificationIndex
-               @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
-               @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
-               @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
+               @@params[:ill][:spotSizeIndex] = @@tem.Illumination.SpotsizeIndex
+               @@params[:proj][:magIndex] = @@tem.Projection.MagnificationIndex
+       #       @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
+       #       @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
+       #       @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
 
                return @@params.to_json
        end
@@ -103,7 +103,7 @@ class FEIControl < VEM
                ill    = @@tem.Illumination
                ill.SpotsizeIndex = ill.SpotsizeIndex + spsize
                @@params[:ill][:spotSizeIndex] = ill.SpotsizeIndex
-               return @@params[:ill][:spotSizeIndex].to_json
+               return @@params[:ill].to_json
        end
 
        def set_magnification(magsize)
@@ -112,7 +112,7 @@ class FEIControl < VEM
                proj = @@tem.Projection
                proj.MagnificationIndex = proj.MagnificationIndex + magsize
                @@params[:proj][:magIndex] = proj.MagnificationIndex
-               return @@params[:proj][:magIndex]
+               return @@params[:proj].to_json
        end
 
        def acquisition_init(binning, exp_time, image_size)
index ee91c7c..8259b3a 100644 (file)
@@ -22,8 +22,12 @@ class TEST
                @@vem.set_stageR(1, 0, 0, 0)
        end
 
-       def test_set_spotsize
-               @@vem.set_spotsize(1)
+       def test_set_spotsizeA
+               @@vem.set_spotsizeA(10)
+       end
+
+       def test_set_spotsizeR
+               @@vem.set_spotsizeR(1)
        end
 
        def test_acq_init
@@ -39,7 +43,8 @@ test = TEST.new
 test.test_get_params
 test.test_set_stageA
 test.test_set_stageR
-test.test_set_spotsize
+test.test_set_spotsizeA
+test.test_set_spotsizeR
 test.test_acq_init
 test.test_acq
 
index fe2557e..ee91c7c 100644 (file)
@@ -7,7 +7,7 @@ require "./mock"
 
 class TEST
        def initialize
-               @@vem = VEM.create("mock")
+               @@vem = VEM.create("fei")
        end
 
        def test_get_params
index 5869aae..20a3b78 100644 (file)
@@ -3,48 +3,54 @@ $:.unshift(File.dirname(__FILE__))
 
 class VEM
        def self.create (inst)
-    if inst == "hitachi" then
-      HITACHIControl.new()
-    elsif inst == "fei" then
-      FEIControl.new()
-    elsif inst == "jeol" then
-      JEOLControl.new()
-    elsif inst == "mock" then
-      MockControl.instance
-    end
-  end
+               if inst == "hitachi" then
+                       HITACHIControl.new()
+               elsif inst == "fei" then
+                       FEIControl.new()
+               elsif inst == "jeol" then
+                       JEOLControl.new()
+               elsif inst == "mock" then
+                       MockControl.instance
+               end
+       end
 
-  def initialize
-  end
+       def initialize
+       end
 
-  def get_params
-  end
+       def get_params
+       end
 
-  def set_stageA(x, y, z, a)
-  end
+       def set_stageA(x, y, z, a)
+       end
 
-  def set_stageR(x, y, z, a)
-  end
+       def set_stageR(x, y, z, a)
+       end
 
-  def set_spotsize(spsize)
-  end
+       def set_spotsizeA(spsize)
+       end
 
-  def set_magnification(magsize)
-  end
+       def set_spotsizeR(spsize)
+       end
 
-  def acquisition_init
-  end
+       def set_magnificationA(magsize)
+       end
 
-  def acquisition
-  end
+       def set_magnificationR(magsize)
+       end
 
-  def set_obj(params)
-  end
+       def acquisition_init
+       end
 
-  def set_beamtilt(params)
-  end
+       def acquisition
+       end
 
-  def set_speed(params)
-  end
+       def set_obj(params)
+       end
+
+       def set_beamtilt(params)
+       end
+
+       def set_speed(params)
+       end
 
 end
index 322cc4a..5869aae 100644 (file)
@@ -6,7 +6,7 @@ class VEM
     if inst == "hitachi" then
       HITACHIControl.new()
     elsif inst == "fei" then
-      FEIControl.instance
+      FEIControl.new()
     elsif inst == "jeol" then
       JEOLControl.new()
     elsif inst == "mock" then