aims_project_windows 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,4 +36,18 @@ end
36
36
  AimsProject::ThreadCallbackEvent.set_event_type(Wx::Event.new_event_type)
37
37
  Wx::EvtHandler.register_class(AimsProject::ThreadCallbackEvent, AimsProject::ThreadCallbackEvent.event_type, "evt_thread_callback", 0)
38
38
 
39
- controller.main_loop
39
+ begin
40
+ controller.main_loop
41
+ rescue AimsProject::AimsProjectException => ex
42
+ STDERR.puts ex.message
43
+ rescue => error
44
+ STDERR.puts
45
+ STDERR.puts "Sorry, something went wrong. Please send the following information to joshua.shapiro@gmail.com"
46
+ STDERR.puts
47
+ STDERR.puts "FILE: #{__FILE__}"
48
+ STDERR.puts "VERSION: #{AimsProject::VERSION}"
49
+ STDERR.puts "ERROR: " + error.message
50
+ STDERR.print "\t" + error.backtrace.slice(0..5).join("\n\t")
51
+ STDERR.puts
52
+ STDERR.puts
53
+ end
data/lib/aims_project.rb CHANGED
@@ -6,6 +6,7 @@ require "rubygems"
6
6
  require 'aims'
7
7
  require 'yaml'
8
8
 
9
+ require 'aims_project/version.rb'
9
10
  require 'aims_project/project.rb'
10
11
  require 'aims_project/calculation.rb'
11
12
  require 'aims_project/geometry_file.rb'
@@ -133,8 +134,6 @@ require 'aims_project/aims_project_exception.rb'
133
134
  # that will upload the calculations to the server and submit them to the queue.
134
135
  #
135
136
 
136
-
137
-
138
137
  module AimsProject
139
138
  # Constants
140
139
  STAGED = "STAGED"
@@ -33,14 +33,14 @@ class AppController < Wx::App
33
33
  self.app_name = "AimsViewer"
34
34
  # Create the frame, toolbar and menubar and define event handlers
35
35
  size = [1000,700]
36
- @frame = Frame.new(nil, -1, "AimsViewer", DEFAULT_POSITION, size)
36
+ @frame = Frame.new(nil, :title => "AimsViewer", :size => size)
37
37
  @statusbar = @frame.create_status_bar
38
38
 
39
39
  # This timer will cause the main thread to pass every 2 ms so that other threads
40
40
  # can get work done.
41
- timer = Wx::Timer.new(self, Wx::ID_ANY)
42
- evt_timer(timer.id) {Thread.pass}
43
- timer.start(2)
41
+ # timer = Wx::Timer.new(self, Wx::ID_ANY)
42
+ # evt_timer(timer.id) {Thread.pass}
43
+ # timer.start(2)
44
44
 
45
45
  # Initialize the selection
46
46
  @selection = {}
@@ -113,7 +113,7 @@ class AppController < Wx::App
113
113
  @menubar.append(fileMenu, "File")
114
114
  @menubar.append(editMenu, "Edit")
115
115
  @menubar.append(viewMenu, "Views")
116
- @menubar.append(toolsMenu, "Tools")
116
+ # @menubar.append(toolsMenu, "Tools")
117
117
 
118
118
  evt_menu @menubar, :process_menu_event
119
119
  end
@@ -225,11 +225,11 @@ class CrystalViewer < Wx::Panel
225
225
 
226
226
  def init_clip_planes
227
227
 
228
- Thread.new(self) { |evtHandler|
229
- @unit_cell_corrected = @unit_cell.correct
230
- evt = ThreadCallbackEvent.new
231
- evtHandler.add_pending_event(evt)
232
- }
228
+ # Thread.new(self) { |evtHandler|
229
+ # @unit_cell_corrected = @unit_cell.correct
230
+ # evt = ThreadCallbackEvent.new
231
+ # evtHandler.add_pending_event(evt)
232
+ # }
233
233
 
234
234
  return unless (@unit_cell and @unit_cell.is_valid?)
235
235
 
@@ -762,7 +762,7 @@ class CrystalViewer < Wx::Panel
762
762
  return unless self.unit_cell
763
763
 
764
764
  atoms = if @options.correct
765
- @unit_cell_corrected
765
+ @unit_cell.correct
766
766
  else
767
767
  @unit_cell
768
768
  end
@@ -1,4 +1,3 @@
1
-
2
1
  module AimsProject
3
2
 
4
3
  class CommandHistory
@@ -38,7 +37,7 @@ module AimsProject
38
37
  def initialize(app, window)
39
38
  super(window)
40
39
  @app = app
41
- @text_ctrl = RichTextCtrl.new(self)
40
+ @text_ctrl = RichTextCtrl.new(self, :style => Wx::WANTS_CHARS)
42
41
  @history = CommandHistory.new
43
42
  sizer = BoxSizer.new(VERTICAL)
44
43
  sizer.add_item(@text_ctrl, :proportion => 1, :flag => EXPAND | ALL, :border => 5)
@@ -114,7 +113,7 @@ module AimsProject
114
113
  end
115
114
 
116
115
  def prompt
117
- @text_ctrl.append_text(">> ")
116
+ print(">> ")
118
117
  @text_ctrl.move_end
119
118
  @line_start = @text_ctrl.get_caret_position + 1
120
119
  @text_ctrl.show_position(@line_start)
@@ -125,6 +124,7 @@ module AimsProject
125
124
  @text_ctrl.append_text(str)
126
125
  stop = @text_ctrl.get_caret_position
127
126
  @text_ctrl.set_style(start..stop, RichTextAttr.new(color))
127
+
128
128
  end
129
129
 
130
130
  def echo(str, color=Wx::BLACK)
@@ -152,4 +152,4 @@ module AimsProject
152
152
  end
153
153
 
154
154
  end
155
- end
155
+ end
@@ -111,7 +111,8 @@ module AimsProject
111
111
  puts "Selection:"
112
112
  puts @selection[:atoms].each{|a| puts a.format_geometry_in}
113
113
  @geomEditor.select_atom(atom)
114
- @console.echo(atom.to_s)
114
+ @console.echo("\n" + atom.to_s)
115
+ @console.prompt
115
116
  end
116
117
 
117
118
  def nudge_selected_atoms(x,y,z)
@@ -26,8 +26,9 @@ EOS
26
26
 
27
27
  def initialize(app, frame)
28
28
 
29
- super(frame, :style => (CLOSE_BOX | CAPTION | FRAME_FLOAT_ON_PARENT))
30
-
29
+ super(frame, :style => (SYSTEM_MENU | CAPTION | CLOSE_BOX | FRAME_FLOAT_ON_PARENT))
30
+ enable_close_button
31
+
31
32
  @app = app
32
33
 
33
34
  # Array to track the inspector windows being shown
@@ -180,4 +181,4 @@ EOS
180
181
  end
181
182
 
182
183
  end
183
- end
184
+ end
@@ -0,0 +1,3 @@
1
+ module AimsProject
2
+ VERSION="0.3.4"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aims_project_windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-30 00:00:00.000000000Z
12
+ date: 2013-06-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wxruby-ruby19
16
- requirement: &5407500 !ruby/object:Gem::Requirement
16
+ requirement: &5465660 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *5407500
24
+ version_requirements: *5465660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby-opengl
27
- requirement: &5407270 !ruby/object:Gem::Requirement
27
+ requirement: &5465430 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.61.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *5407270
35
+ version_requirements: *5465430
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: aims
38
- requirement: &5407040 !ruby/object:Gem::Requirement
38
+ requirement: &5465200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.3.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *5407040
46
+ version_requirements: *5465200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: highline
49
- requirement: &5406810 !ruby/object:Gem::Requirement
49
+ requirement: &5464970 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.11
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *5406810
57
+ version_requirements: *5464970
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: capistrano
60
- requirement: &5406580 !ruby/object:Gem::Requirement
60
+ requirement: &5464740 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 2.11.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *5406580
68
+ version_requirements: *5464740
69
69
  description: This gem simplifies and streamlines the calculation pipeline for FHI-AIMS.
70
70
  email: joshua.shapiro@gmail.com
71
71
  executables:
@@ -94,6 +94,7 @@ files:
94
94
  - lib/aims_project/project.rb
95
95
  - lib/aims_project/project_tree.rb
96
96
  - lib/aims_project/thread_callback_event.rb
97
+ - lib/aims_project/version.rb
97
98
  - lib/aims_project.rb
98
99
  - lib/aims_project/pan.gif
99
100
  - lib/aims_project/rotate.gif