1 $:.unshift(File.dirname(__FILE__))
8 require '../vem/feicontrol'
11 require '../tool/imageProc'
16 def initialize(command, params)
22 @cv = ConditionVariable.new
28 @vem = VEM.create(@em)
29 #puts "execute #{@command}"
32 @result = @vem.get_params
34 @result = @vem.get_vacuum_status
37 @result = @vem.set_stageA(@params["x"].to_i, @params["y"].to_i, @params["z"].to_i, @params["a"].to_i)
39 @result = @vem.set_stageR(@params["x"].to_i, @params["y"].to_i, @params["z"].to_i, @params["a"].to_i)
41 @result = @vem.set_spotsizeA(@params["sps"].to_i)
43 @result = @vem.set_spotsizeR(@params["sps"].to_i)
45 @result = @vem.set_magnificationA(@params["mag"].to_i)
47 @result = @vem.set_magnificationR(@params["mag"].to_i)
49 @result = @vem.set_defocusR(@params["defocus"].to_i)
51 @result = @vem.set_reset_defocus
53 @result = @vem.set_image_beamshift(@params["x"].to_i, @params["y"].to_i);
55 @result = @vem.acquisition_init(@params["bng"].to_i, @params["exp"], @params["size"].to_i)
57 image = @vem.acquisition
58 converted_image = convert_256(image)
59 @result = converted_image.to_json
69 @cv.wait(@mutex) while (@complete == false)