• R/O
  • SSH
  • HTTPS

molby: Commit


Commit MetaInfo

Revision603 (tree)
Time2016-09-07 19:13:38
Authortoshinagata1964

Log Message

Show MO surface dialog now has 'Create Cube' button.

Change Summary

Incremental Difference

--- trunk/Scripts/commands.rb (revision 602)
+++ trunk/Scripts/commands.rb (revision 603)
@@ -459,11 +459,19 @@
459459 idx = 0
460460 mol.set_mo_coefficients(0, 0.0, coeffs)
461461 end
462- mol.create_surface(idx, :npoints=>grid, :color=>color, :thres=>thres, :expand=>expand, :color0=>color0)
463- mol.show_surface
464- on_action.call(it)
465- surface_dialog_attr["hidden"] = 0
466- on_update_attr.call
462+ if it[:tag] == "create_cube"
463+ basename = File.basename(mol.path || mol.name, ".*")
464+ fname1 = Dialog.save_panel("Cube file name", mol.dir || Dir.pwd, basename + ".cube", "Gaussian cube file (*.cube)|*.cube")
465+ if fname1
466+ mol.cubegen(fname1, idx, grid, true)
467+ end
468+ else
469+ mol.create_surface(idx, :npoints=>grid, :color=>color, :thres=>thres, :expand=>expand, :color0=>color0)
470+ mol.show_surface
471+ on_action.call(it)
472+ surface_dialog_attr["hidden"] = 0
473+ on_update_attr.call
474+ end
467475 }
468476 layout(1,
469477 layout(2,
@@ -507,6 +515,7 @@
507515 end
508516 on_update_attr.call
509517 } ),
518+ item(:button, :tag=>"create_cube", :title=>"Create Cube", :action=>on_update),
510519 :flex=>[0,1,0,0,0,0]),
511520 :flex=>[0,0,0,0,1,1]
512521 )
Show on old repository browser