OSDN Git Service

commit by fei
authoriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 4 Feb 2016 09:31:01 +0000 (18:31 +0900)
committeriwasaki <iwaaya@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 4 Feb 2016 09:31:01 +0000 (18:31 +0900)
1  2 
lib/.cameraSocket.rb.un~
lib/.request.rb.un~
lib/cameraSocket.rb
lib/request.rb
vem/.feicontrol.rb.un~
vem/feicontrol.rb
vem/feicontrol.rb~

index 0b248d4,0b248d4..d7b3376
Binary files differ
index 8a2bd2d,8a2bd2d..4744145
Binary files differ
@@@ -22,32 -23,32 +23,33 @@@ class CameraSocke
  
        puts "CameraSocket thread: #{Thread.current}"
  
-                       ws.onopen do
-                               puts "ws open"
-                               @buf["type"] = "connection"
-                               @buf["data"] = "open"
-                               @camera.on_flag
-                               ws.send(@buf.to_json)
-                       end
-                       ws.onmessage do |msg|
-                               rec_buf = JSON.parse(msg)
-                               if(rec_buf["type"]=="req")
-                                       if(rec_buf["data"]=="img")
-                                               @buf["type"] = "img"
-                                               @camera.unlock_acq
-                                               @buf["data"] = @camera.get_image 
-                                               @buf["count"] = @count
-                                               ws.send(@buf.to_json)
-                                               @count = @count + 1
-                                       end
-                               end
-                       end
-                       ws.onclose do
-                               @camera.off_flag
-                       end
-               end
-       end
+       ws.onopen do
+         puts "ws open"
+         @buf["type"] = "connection"
+         @buf["data"] = "open"
+         ws.send(@buf.to_json)
++      @request = Request.new('acq', nil)
+       end
+       ws.onmessage do |msg|
+         rec_buf = JSON.parse(msg)
+         if(rec_buf["type"]=="req")
+           if(rec_buf["data"]=="img")
 -            request = Request.new('acq', nil)
 -            @camera_host.put_request(request)
++            @camera_host.put_request(@request)
+             @buf["type"] = "img"
 -            @buf["data"] = request.get_result
++            @buf["data"] = @request.get_result
+             @buf["count"] = @count
+             ws.send(@buf.to_json)
+             @count = @count + 1
++            @request = Request.new('acq', nil)
+           end
+         end
+       end
+       ws.onclose do
+         puts "ws close"
+       end
+     end
+   end
  end
diff --cc lib/request.rb
@@@ -25,7 -25,7 +25,7 @@@ class Reques
  
    def execute
      @vem = VEM.create(@em)
-     puts "execute"
 -    puts "execute #{@command}"
++    #puts "execute #{@command}"
      case @command
      when "get"
        @result = @vem.get_params
@@@ -62,7 -64,7 +64,6 @@@
      else
        puts "else"
      end
--      puts "request complete"
        @complete = true
        @cv.broadcast
    end
@@@ -70,8 -72,7 +71,6 @@@
    def get_result
      @mutex.synchronize do
        @cv.wait(@mutex) while (@complete == false)
--      puts "resturn result"
-       puts @result
        return @result
      end
    end
index 4a740ae,55fcb70..805268d
Binary files differ
@@@ -58,7 -58,11 +58,11 @@@ class FEIControl < VE
                @@params[:stage][:a] = @@tem.Stage.Position.A
                @@params[:ill][:spotSizeIndex] = @@tem.Illumination.SpotsizeIndex
                @@params[:proj][:magIndex] = @@tem.Projection.MagnificationIndex
 -    @@params[:proj][:defocus] = @@tem.Projection.Defocus
 +              @@params[:proj][:defocus] = @@tem.Projection.Defocus*1000000000
+     @@params[:proj][:mag] = @@tem.Projection.Magnification
+     @@params[:proj][:imageBeamShift][:x] = @@tem.Projection.ImageBeamShift.x
+     @@params[:proj][:imageBeamShift][:y] = @@tem.Projection.ImageBeamShift.y
+     @@params[:proj][:focus] = @@tem.Projection.Focus
                #       @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
                #       @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
                #       @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
@@@ -36,7 -36,7 +36,7 @@@ class FEIControl < VE
                        :proj => {
                                :magIndex => 0,
                                :mag => 0,
--                              :imageShift => {:x => 0, :y => 0},
++                              :imageBeamShift => {:x => 0, :y => 0},
                                :focus => 0,
                                :defocus => 0,
                                :objStg => {:x => 0, :y => 0}
                @@params[:stage][:a] = @@tem.Stage.Position.A
                @@params[:ill][:spotSizeIndex] = @@tem.Illumination.SpotsizeIndex
                @@params[:proj][:magIndex] = @@tem.Projection.MagnificationIndex
++<<<<<<< HEAD
 +              @@params[:proj][:defocus] = @@tem.Projection.Defocus*1000000000
++=======
++    @@params[:proj][:mag] = @@tem.Projection.Magnification
++    @@params[:proj][:imageBeamShift][:x] = @@tem.Projection.ImageBeamShift.x
++    @@params[:proj][:imageBeamShift][:y] = @@tem.Projection.ImageBeamShift.y
++    @@params[:proj][:focus] = @@tem.Projection.Focus
++    @@params[:proj][:defocus] = @@tem.Projection.Defocus
++>>>>>>> c40fae8a2f64d018688751e591cc90330dfd6f6c
                #       @@params[:ccdCamera][:binning] = ccdCamerasAcqParams.Binning
                #       @@params[:ccdCamera][:expTime]  = ccdCamerasAcqParams.ExposureTime
                #       @@params[:ccdCamera][:imageSize] = ccdCamerasAcqParams.ImageSize
                return @@params[:proj].to_json
        end
  
--      def set_image_beam_shift(x, y)
++      def set_image_beamshift(x, y)
                puts "FEI setImageShift"
  
                proj = @@tem.Projection
                puts "FEI setBeamTilt"
        end
  
-               puts @@tem.Vacuum.Gauges.Item(4).Name
 +      def get_vacuum_status
 +              puts "FEI getVacuumStatus"
++              puts @@tem.Vacuum.Gauges.Item(5).Name
 +              puts @@tem.Vacuum.Gauges.Item(1).Pressure
 +      end
 +
  end