Class: Microstation::CadInputQueue
- Inherits:
-
Object
- Object
- Microstation::CadInputQueue
show all
- Defined in:
- lib/microstation/cad_input_queue.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(ole_obj, app) ⇒ CadInputQueue
Returns a new instance of CadInputQueue.
9
10
11
12
13
|
# File 'lib/microstation/cad_input_queue.rb', line 9
def initialize(ole_obj, app)
@ole_obj = ole_obj
@app = app
@input_procs = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
82
83
84
|
# File 'lib/microstation/cad_input_queue.rb', line 82
def method_missing(name, *args, &block)
@ole_obj.send(name, *args, &block)
end
|
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
7
8
9
|
# File 'lib/microstation/cad_input_queue.rb', line 7
def app
@app
end
|
#ole_obj ⇒ Object
Returns the value of attribute ole_obj.
7
8
9
|
# File 'lib/microstation/cad_input_queue.rb', line 7
def ole_obj
@ole_obj
end
|
Instance Method Details
#<<(string) ⇒ Object
15
16
17
|
# File 'lib/microstation/cad_input_queue.rb', line 15
def <<(string)
send_keyin(string)
end
|
#clear_ui ⇒ Object
76
77
78
79
80
|
# File 'lib/microstation/cad_input_queue.rb', line 76
def clear_ui
app.show_prompt("")
app.show_status("")
app.show_command("")
end
|
#close ⇒ Object
27
28
29
|
# File 'lib/microstation/cad_input_queue.rb', line 27
def close
@ole_ojb = nil
end
|
47
48
49
50
|
# File 'lib/microstation/cad_input_queue.rb', line 47
def get_input(*args)
com = @ole_obj.GetInput(*args)
OLE_CadInputMessage.new(com, app)
end
|
#get_point(prompt: "Enter vertex") ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/microstation/cad_input_queue.rb', line 52
def get_point(prompt: "Enter vertex")
show_prompt(prompt)
mycim = get_input(InputType::DataPoint, InputType::Reset)
if mycim.reset?
clear_ui
Failure(:reset_pressed)
elsif mycim.data_point?
clear_ui
Success(mycim.get_point)
end
end
|
#send_command(text) ⇒ Object
31
32
33
|
# File 'lib/microstation/cad_input_queue.rb', line 31
def send_command(text)
@ole_obj.SendCommand(text)
end
|
#send_data_point(pt) ⇒ Object
35
36
37
|
# File 'lib/microstation/cad_input_queue.rb', line 35
def send_data_point(pt)
@ole_obj.SendDataPoint app.to_ole_point3d(pt)
end
|
#send_drag_points(down_pt, up_point, view_specifier: nil, qualifier: nil) ⇒ Object
43
44
45
|
# File 'lib/microstation/cad_input_queue.rb', line 43
def send_drag_points(down_pt, up_point, view_specifier: nil, qualifier: nil)
@ole_obj.SendDragPoints(down_pt, up_point)
end
|
#send_keyin(string) ⇒ Object
19
20
21
|
# File 'lib/microstation/cad_input_queue.rb', line 19
def send_keyin(string)
@ole_obj.SendKeyin(string)
end
|
#send_reset ⇒ Object
23
24
25
|
# File 'lib/microstation/cad_input_queue.rb', line 23
def send_reset
@ole_obj.SendReset
end
|
#send_tentative_pt(pt) ⇒ Object
39
40
41
|
# File 'lib/microstation/cad_input_queue.rb', line 39
def send_tentative_pt(pt)
@ole_obj.SendTentativePoint(pt)
end
|
#show_command(text) ⇒ Object
64
65
66
|
# File 'lib/microstation/cad_input_queue.rb', line 64
def show_command(text)
app.show_command(text)
end
|
#show_prompt(text) ⇒ Object
68
69
70
|
# File 'lib/microstation/cad_input_queue.rb', line 68
def show_prompt(text)
app.show_prompt(text)
end
|
#show_status(text) ⇒ Object
72
73
74
|
# File 'lib/microstation/cad_input_queue.rb', line 72
def show_status(text)
app.show_status(text)
end
|
#start_default_command ⇒ Object
86
87
88
|
# File 'lib/microstation/cad_input_queue.rb', line 86
def start_default_command
@app.ole_obj.CommandState.StartDefaultCommand
end
|