Molecular Modeling Software
リビジョン | 1cfe36ca707ed98020a1dbdb035935c3dc937885 (tree) |
---|---|
日時 | 2014-03-27 10:10:17 |
作者 | toshinagata1964 <toshinagata1964@a2be...> |
コミッター | toshinagata1964 |
Embedded Ruby: problems with encoding is being fixed (not complete yet?)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@513 a2be9bc6-48de-4e38-9406-05402d4bc13c
@@ -935,9 +935,6 @@ The parameter table shows the molecular mechanics parameters in one table. | ||
935 | 935 | </p> |
936 | 936 | <p><img src="../etc/table_12.png" /></p> |
937 | 937 | <p> |
938 | -When you build a molecule from scratch, and open the parameter table before doing any MM/MD operations, this table is likely to be empty. This is because the MM parameters are looked up only when "Molecular Dynamics..." or "Minimize..." menu command is invoked, or you use MM/MD tools like Antechamber (see Step 4 for details). After doing some of these operations, you will see a set of parameters shown in this table. | |
939 | -</p> | |
940 | -<p> | |
941 | 938 | The parameters are grouped in several classes, namely "VDWs", "Bonds", "Angles", "Dihedrals", "Impropers", and "VDW Pairs". |
942 | 939 | </p> |
943 | 940 | <p> |
@@ -1028,9 +1025,6 @@ Bond, angle, dihedral, improper テーブルは、それぞれ結合・結合角 | ||
1028 | 1025 | </p> |
1029 | 1026 | <p><img src="../etc/table_12.png" /></p> |
1030 | 1027 | <p> |
1031 | -分子を新しく作成して、MM/MD に関連する操作を何もせずにパラメータテーブルを開くと、テーブルはおそらく空のままでしょう。分子力学パラメータは、"Molecular Dynamics..." または "Minimize..." メニューコマンドを実行したときか、Antechamber のような分子力学用ツール(第四段階参照)を使った時に初めて作成されます。これらの操作をした後には、パラメータがこのテーブルに表示されます。 | |
1032 | -</p> | |
1033 | -<p> | |
1034 | 1028 | パラメータはいくつかの種類にグループ分けされています。"VDWs", "Bonds", "Angles", "Dihedrals", "Impropers", そして "VDW Pairs" です。 |
1035 | 1029 | </p> |
1036 | 1030 | <p> |
@@ -1099,7 +1093,7 @@ Open the "MM/MD" menu, and select "Guess MM/MD Parameters..." command. | ||
1099 | 1093 | </p> |
1100 | 1094 | <p><img src="../etc/minimize_02.png" /></p> |
1101 | 1095 | <p> |
1102 | -A dialog like below shows up. This is for execution of Antechamber on the current molecule. Turn off the "partial charge" checkbox. The "log" directory is used by AmberTools for storing intermediate files; the default value would be acceptable, but you can change it here. | |
1096 | +A dialog like below shows up. This is for execution of Antechamber on the current molecule. Turn off the "Calculate partial charges" checkbox, and turn on the "Guess atom types" checkbox. The "log" directory is used by AmberTools for storing intermediate files; the default value would be acceptable, but you can change it here. | |
1103 | 1097 | </p> |
1104 | 1098 | <p><img src="../etc/minimize_03.png" /></p> |
1105 | 1099 | <p> |
@@ -1188,7 +1182,7 @@ Molby の分子力学計算は、基本的な分子力場(結合の伸縮、 | ||
1188 | 1182 | </p> |
1189 | 1183 | <p><img src="../etc/minimize_02.png" /></p> |
1190 | 1184 | <p> |
1191 | -下のようなダイアログが現れます。これは現在の分子に対して Antechamber を実行するためのものです。一番上のチェックボックス (partial charge) をオフにしてください。"Log" ディレクトリは、AmberTools のプログラムが中間ファイルを保存するのに使います。デフォルトの位置で問題はないでしょうが、変更してもかまいません。 | |
1185 | +下のようなダイアログが現れます。これは現在の分子に対して Antechamber を実行するためのものです。一番上のチェックボックス "Calculate partial charge" をオフ、その下の "Guess Atom Types" をオンにしてください。"Log" ディレクトリは、AmberTools のプログラムが中間ファイルを保存するのに使います。デフォルトの位置で問題はないでしょうが、変更してもかまいません。 | |
1192 | 1186 | </p> |
1193 | 1187 | <p><img src="../etc/minimize_03.png" /></p> |
1194 | 1188 | <p> |
@@ -8,7 +8,7 @@ ifeq ($(TARGET_PLATFORM),MAC) | ||
8 | 8 | LD_EXTRA_FLAGS = -framework Accelerate -framework GLUT -L$(PWD)/../../fftw-3.3.2/osx-build/lib -lfftw3 |
9 | 9 | RUBY_DIR = $(PWD)/../../ruby-1.8.7-p160 |
10 | 10 | RUBY_CFLAGS = -isystem $(RUBY_DIR)/osx-build/include |
11 | - RUBY_LDFLAGS = -L$(RUBY_DIR)/osx-build/lib -lruby-static | |
11 | + RUBY_LDFLAGS = -L$(RUBY_DIR)/osx-build/lib -lruby-static -lenc | |
12 | 12 | EXECUTABLE = Molby |
13 | 13 | EXE_SUFFIX = |
14 | 14 | endif |
@@ -23,7 +23,7 @@ ifeq ($(TARGET_PLATFORM),MSW) | ||
23 | 23 | LD_EXTRA_FLAGS = -L$(PWD)/../../CLAPACK-3.1.1.1-mingw/lib -L$(PWD)/../../fftw-3.3.2/msw-build/lib -llapackMinGW -lblasMinGW -lf2c_nomain -lfftw3 |
24 | 24 | RUBY_DIR = $(PWD)/../../ruby-2.0.0-p353 |
25 | 25 | RUBY_CFLAGS = -isystem $(RUBY_DIR)/msw-build/include/ruby-2.0.0 -I$(RUBY_DIR) -I$(RUBY_DIR)/msw-build/include/ruby-2.0.0/i386-mingw32 |
26 | - RUBY_LDFLAGS = -L$(RUBY_DIR)/msw-build/lib -lmsvcrt-ruby200-static -lmsvcrt-ruby200 -lws2_32 -lshlwapi -limagehlp | |
26 | + RUBY_LDFLAGS = -L$(RUBY_DIR)/msw-build/lib -lmsvcrt-ruby200-static -lmsvcrt-ruby200 -lws2_32 -lshlwapi -limagehlp -lenc | |
27 | 27 | EXECUTABLE = _Molby.exe_ |
28 | 28 | FINAL_EXECUTABLE = Molby.exe |
29 | 29 | EXE_SUFFIX = .exe |
@@ -37,7 +37,7 @@ extern void Molby_showError(int status); | ||
37 | 37 | extern RubyValue Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fname, int *status); |
38 | 38 | /* extern RubyValue Molby_evalRubyScript(const char *script, int *status); |
39 | 39 | extern RubyValue Molby_evalRubyScriptOnActiveMoleculeWithInterrupt(const char *script, int *status); */ |
40 | -extern void Molby_showRubyValue(RubyValue value, char **outValueString); | |
40 | +extern int Molby_showRubyValue(RubyValue value, char **outValueString); | |
41 | 41 | extern int Ruby_UpdateUI(int index, Molecule *mol, int *outChecked, char **outTitle); |
42 | 42 | /*extern int Ruby_methodType(const char *className, const char *methodName);*/ |
43 | 43 | extern void Molby_buildARGV(int argc, const char **argv); |
@@ -11065,7 +11065,11 @@ s_evalRubyScriptOnMoleculeSub(VALUE val) | ||
11065 | 11065 | if (ptr[2] == NULL) { |
11066 | 11066 | char *scr; |
11067 | 11067 | /* String literal: we need to specify string encoding */ |
11068 | +#if defined(__WXMSW__) | |
11069 | + asprintf(&scr, "#coding:shift_jis\n%s", (char *)ptr[0]); | |
11070 | +#else | |
11068 | 11071 | asprintf(&scr, "#coding:utf-8\n%s", (char *)ptr[0]); |
11072 | +#endif | |
11069 | 11073 | sval = rb_str_new2(scr); |
11070 | 11074 | free(scr); |
11071 | 11075 | fnval = rb_str_new2("(eval)"); |
@@ -11124,13 +11128,13 @@ Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fn | ||
11124 | 11128 | return retval; |
11125 | 11129 | } |
11126 | 11130 | |
11127 | -void | |
11131 | +int | |
11128 | 11132 | Molby_showRubyValue(RubyValue value, char **outValueString) |
11129 | 11133 | { |
11130 | 11134 | VALUE val = (VALUE)value; |
11131 | 11135 | if (gMolbyIsCheckingInterrupt) { |
11132 | 11136 | MolActionAlertRubyIsRunning(); |
11133 | - return; | |
11137 | + return 0; | |
11134 | 11138 | } |
11135 | 11139 | if (val != Qnil) { |
11136 | 11140 | int status; |
@@ -11138,11 +11142,17 @@ Molby_showRubyValue(RubyValue value, char **outValueString) | ||
11138 | 11142 | gMolbyRunLevel++; |
11139 | 11143 | val = rb_protect(rb_inspect, val, &status); |
11140 | 11144 | gMolbyRunLevel--; |
11145 | + if (status != 0) | |
11146 | + return status; | |
11141 | 11147 | str = StringValuePtr(val); |
11142 | 11148 | if (outValueString != NULL) |
11143 | 11149 | *outValueString = strdup(str); |
11144 | 11150 | MyAppCallback_showScriptMessage("%s", str); |
11151 | + } else { | |
11152 | + if (outValueString != NULL) | |
11153 | + *outValueString = NULL; | |
11145 | 11154 | } |
11155 | + return 0; | |
11146 | 11156 | } |
11147 | 11157 | |
11148 | 11158 | void |
@@ -11301,6 +11311,11 @@ Molby_startup(const char *script, const char *dir) | ||
11301 | 11311 | } |
11302 | 11312 | #endif |
11303 | 11313 | ruby_init(); |
11314 | + | |
11315 | + { | |
11316 | + extern void Init_shift_jis(void); | |
11317 | + Init_shift_jis(); | |
11318 | + } | |
11304 | 11319 | |
11305 | 11320 | /* Initialize loadpath; the specified directory, "lib" subdirectory, and "." */ |
11306 | 11321 | ruby_incpush("."); |
@@ -1,4 +1,5 @@ | ||
1 | -# | |
1 | +# coding: utf-8 | |
2 | +# | |
2 | 3 | # crystal.rb |
3 | 4 | # |
4 | 5 | # Created by Toshi Nagata. |
@@ -1807,7 +1808,8 @@ end | ||
1807 | 1808 | new_box = nil |
1808 | 1809 | hash = Dialog.run("Unit Cell") { |
1809 | 1810 | @mol = mol |
1810 | - @box = @mol.box.dup | |
1811 | + @box = @mol.box | |
1812 | + @box = (@box ? @box.dup : nil) | |
1811 | 1813 | @box_save = nil |
1812 | 1814 | |
1813 | 1815 | def set_cell_value(item1) |
@@ -195,7 +195,12 @@ class Molecule | ||
195 | 195 | fpout.print freebytes |
196 | 196 | |
197 | 197 | # Copy the input file |
198 | - scrprefix = scrdir + sep + inpbody | |
198 | + scrprefix = scrdir + sep + inpbody | |
199 | + if $platform == "win" | |
200 | + scrbody = inpbody | |
201 | + else | |
202 | + scrbody = scrprefix | |
203 | + end | |
199 | 204 | filecopy(inpname, scrprefix + ".F05") |
200 | 205 | |
201 | 206 | # Prepare environmental variables |
@@ -205,140 +210,140 @@ class Molecule | ||
205 | 210 | ENV["BASPATH"] = "#{auxdir}#{sep}BASES" |
206 | 211 | ENV["QUANPOL"] = "#{auxdir}#{sep}QUANPOL" |
207 | 212 | ENV["EXTBAS"] = "/dev/null" |
208 | - ENV["IRCDATA"] = "#{scrprefix}.irc" | |
209 | - ENV["PUNCH"] = "#{scrprefix}.dat" | |
210 | - ENV["INPUT"] = "#{scrprefix}.F05" | |
211 | - ENV["AOINTS"] = "#{scrprefix}.F08" | |
212 | - ENV["MOINTS"] = "#{scrprefix}.F09" | |
213 | - ENV["DICTNRY"] = "#{scrprefix}.F10" | |
214 | - ENV["DRTFILE"] = "#{scrprefix}.F11" | |
215 | - ENV["CIVECTR"] = "#{scrprefix}.F12" | |
216 | - ENV["CASINTS"] = "#{scrprefix}.F13" | |
217 | - ENV["CIINTS"] = "#{scrprefix}.F14" | |
218 | - ENV["WORK15"] = "#{scrprefix}.F15" | |
219 | - ENV["WORK16"] = "#{scrprefix}.F16" | |
220 | - ENV["CSFSAVE"] = "#{scrprefix}.F17" | |
221 | - ENV["FOCKDER"] = "#{scrprefix}.F18" | |
222 | - ENV["WORK19"] = "#{scrprefix}.F19" | |
223 | - ENV["DASORT"] = "#{scrprefix}.F20" | |
224 | - ENV["DFTINTS"] = "#{scrprefix}.F21" | |
225 | - ENV["DFTGRID"] = "#{scrprefix}.F22" | |
226 | - ENV["JKFILE"] = "#{scrprefix}.F23" | |
227 | - ENV["ORDINT"] = "#{scrprefix}.F24" | |
228 | - ENV["EFPIND"] = "#{scrprefix}.F25" | |
229 | - ENV["PCMDATA"] = "#{scrprefix}.F26" | |
230 | - ENV["PCMINTS"] = "#{scrprefix}.F27" | |
231 | - ENV["MLTPL"] = "#{scrprefix}.F28" | |
232 | - ENV["MLTPLT"] = "#{scrprefix}.F29" | |
233 | - ENV["DAFL30"] = "#{scrprefix}.F30" | |
234 | - ENV["SOINTX"] = "#{scrprefix}.F31" | |
235 | - ENV["SOINTY"] = "#{scrprefix}.F32" | |
236 | - ENV["SOINTZ"] = "#{scrprefix}.F33" | |
237 | - ENV["SORESC"] = "#{scrprefix}.F34" | |
238 | - ENV["SIMEN"] = "#{scrprefix}.simen" | |
239 | - ENV["SIMCOR"] = "#{scrprefix}.simcor" | |
240 | - ENV["GCILIST"] = "#{scrprefix}.F37" | |
241 | - ENV["HESSIAN"] = "#{scrprefix}.F38" | |
242 | - ENV["SOCCDAT"] = "#{scrprefix}.F40" | |
243 | - ENV["AABB41"] = "#{scrprefix}.F41" | |
244 | - ENV["BBAA42"] = "#{scrprefix}.F42" | |
245 | - ENV["BBBB43"] = "#{scrprefix}.F43" | |
246 | - ENV["MCQD50"] = "#{scrprefix}.F50" | |
247 | - ENV["MCQD51"] = "#{scrprefix}.F51" | |
248 | - ENV["MCQD52"] = "#{scrprefix}.F52" | |
249 | - ENV["MCQD53"] = "#{scrprefix}.F53" | |
250 | - ENV["MCQD54"] = "#{scrprefix}.F54" | |
251 | - ENV["MCQD55"] = "#{scrprefix}.F55" | |
252 | - ENV["MCQD56"] = "#{scrprefix}.F56" | |
253 | - ENV["MCQD57"] = "#{scrprefix}.F57" | |
254 | - ENV["MCQD58"] = "#{scrprefix}.F58" | |
255 | - ENV["MCQD59"] = "#{scrprefix}.F59" | |
256 | - ENV["MCQD60"] = "#{scrprefix}.F60" | |
257 | - ENV["MCQD61"] = "#{scrprefix}.F61" | |
258 | - ENV["MCQD62"] = "#{scrprefix}.F62" | |
259 | - ENV["MCQD63"] = "#{scrprefix}.F63" | |
260 | - ENV["MCQD64"] = "#{scrprefix}.F64" | |
261 | - ENV["NMRINT1"] = "#{scrprefix}.F61" | |
262 | - ENV["NMRINT2"] = "#{scrprefix}.F62" | |
263 | - ENV["NMRINT3"] = "#{scrprefix}.F63" | |
264 | - ENV["NMRINT4"] = "#{scrprefix}.F64" | |
265 | - ENV["NMRINT5"] = "#{scrprefix}.F65" | |
266 | - ENV["NMRINT6"] = "#{scrprefix}.F66" | |
267 | - ENV["DCPHFH2"] = "#{scrprefix}.F67" | |
268 | - ENV["DCPHF21"] = "#{scrprefix}.F68" | |
269 | - ENV["GVVPT"] = "#{scrprefix}.F69" | |
213 | + ENV["IRCDATA"] = "#{scrbody}.irc" | |
214 | + ENV["PUNCH"] = "#{scrbody}.dat" | |
215 | + ENV["INPUT"] = "#{scrbody}.F05" | |
216 | + ENV["AOINTS"] = "#{scrbody}.F08" | |
217 | + ENV["MOINTS"] = "#{scrbody}.F09" | |
218 | + ENV["DICTNRY"] = "#{scrbody}.F10" | |
219 | + ENV["DRTFILE"] = "#{scrbody}.F11" | |
220 | + ENV["CIVECTR"] = "#{scrbody}.F12" | |
221 | + ENV["CASINTS"] = "#{scrbody}.F13" | |
222 | + ENV["CIINTS"] = "#{scrbody}.F14" | |
223 | + ENV["WORK15"] = "#{scrbody}.F15" | |
224 | + ENV["WORK16"] = "#{scrbody}.F16" | |
225 | + ENV["CSFSAVE"] = "#{scrbody}.F17" | |
226 | + ENV["FOCKDER"] = "#{scrbody}.F18" | |
227 | + ENV["WORK19"] = "#{scrbody}.F19" | |
228 | + ENV["DASORT"] = "#{scrbody}.F20" | |
229 | + ENV["DFTINTS"] = "#{scrbody}.F21" | |
230 | + ENV["DFTGRID"] = "#{scrbody}.F22" | |
231 | + ENV["JKFILE"] = "#{scrbody}.F23" | |
232 | + ENV["ORDINT"] = "#{scrbody}.F24" | |
233 | + ENV["EFPIND"] = "#{scrbody}.F25" | |
234 | + ENV["PCMDATA"] = "#{scrbody}.F26" | |
235 | + ENV["PCMINTS"] = "#{scrbody}.F27" | |
236 | + ENV["MLTPL"] = "#{scrbody}.F28" | |
237 | + ENV["MLTPLT"] = "#{scrbody}.F29" | |
238 | + ENV["DAFL30"] = "#{scrbody}.F30" | |
239 | + ENV["SOINTX"] = "#{scrbody}.F31" | |
240 | + ENV["SOINTY"] = "#{scrbody}.F32" | |
241 | + ENV["SOINTZ"] = "#{scrbody}.F33" | |
242 | + ENV["SORESC"] = "#{scrbody}.F34" | |
243 | + ENV["SIMEN"] = "#{scrbody}.simen" | |
244 | + ENV["SIMCOR"] = "#{scrbody}.simcor" | |
245 | + ENV["GCILIST"] = "#{scrbody}.F37" | |
246 | + ENV["HESSIAN"] = "#{scrbody}.F38" | |
247 | + ENV["SOCCDAT"] = "#{scrbody}.F40" | |
248 | + ENV["AABB41"] = "#{scrbody}.F41" | |
249 | + ENV["BBAA42"] = "#{scrbody}.F42" | |
250 | + ENV["BBBB43"] = "#{scrbody}.F43" | |
251 | + ENV["MCQD50"] = "#{scrbody}.F50" | |
252 | + ENV["MCQD51"] = "#{scrbody}.F51" | |
253 | + ENV["MCQD52"] = "#{scrbody}.F52" | |
254 | + ENV["MCQD53"] = "#{scrbody}.F53" | |
255 | + ENV["MCQD54"] = "#{scrbody}.F54" | |
256 | + ENV["MCQD55"] = "#{scrbody}.F55" | |
257 | + ENV["MCQD56"] = "#{scrbody}.F56" | |
258 | + ENV["MCQD57"] = "#{scrbody}.F57" | |
259 | + ENV["MCQD58"] = "#{scrbody}.F58" | |
260 | + ENV["MCQD59"] = "#{scrbody}.F59" | |
261 | + ENV["MCQD60"] = "#{scrbody}.F60" | |
262 | + ENV["MCQD61"] = "#{scrbody}.F61" | |
263 | + ENV["MCQD62"] = "#{scrbody}.F62" | |
264 | + ENV["MCQD63"] = "#{scrbody}.F63" | |
265 | + ENV["MCQD64"] = "#{scrbody}.F64" | |
266 | + ENV["NMRINT1"] = "#{scrbody}.F61" | |
267 | + ENV["NMRINT2"] = "#{scrbody}.F62" | |
268 | + ENV["NMRINT3"] = "#{scrbody}.F63" | |
269 | + ENV["NMRINT4"] = "#{scrbody}.F64" | |
270 | + ENV["NMRINT5"] = "#{scrbody}.F65" | |
271 | + ENV["NMRINT6"] = "#{scrbody}.F66" | |
272 | + ENV["DCPHFH2"] = "#{scrbody}.F67" | |
273 | + ENV["DCPHF21"] = "#{scrbody}.F68" | |
274 | + ENV["GVVPT"] = "#{scrbody}.F69" | |
270 | 275 | |
271 | 276 | # next files are used only during coupled cluster runs, so let's |
272 | 277 | # display the numerous definitions only if they are to be used. |
273 | - ENV["CCREST"] = "#{scrprefix}.F70" | |
274 | - ENV["CCDIIS"] = "#{scrprefix}.F71" | |
275 | - ENV["CCINTS"] = "#{scrprefix}.F72" | |
276 | - ENV["CCT1AMP"] = "#{scrprefix}.F73" | |
277 | - ENV["CCT2AMP"] = "#{scrprefix}.F74" | |
278 | - ENV["CCT3AMP"] = "#{scrprefix}.F75" | |
279 | - ENV["CCVM"] = "#{scrprefix}.F76" | |
280 | - ENV["CCVE"] = "#{scrprefix}.F77" | |
281 | - ENV["EOMSTAR"] = "#{scrprefix}.F80" | |
282 | - ENV["EOMVEC1"] = "#{scrprefix}.F81" | |
283 | - ENV["EOMVEC2"] = "#{scrprefix}.F82" | |
284 | - ENV["EOMHC1"] = "#{scrprefix}.F83" | |
285 | - ENV["EOMHC2"] = "#{scrprefix}.F84" | |
286 | - ENV["EOMHHHH"] = "#{scrprefix}.F85" | |
287 | - ENV["EOMPPPP"] = "#{scrprefix}.F86" | |
288 | - ENV["EOMRAMP"] = "#{scrprefix}.F87" | |
289 | - ENV["EOMRTMP"] = "#{scrprefix}.F88" | |
290 | - ENV["EOMDG12"] = "#{scrprefix}.F89" | |
291 | - ENV["MMPP"] = "#{scrprefix}.F90" | |
292 | - ENV["MMHPP"] = "#{scrprefix}.F91" | |
293 | - ENV["MMCIVEC"] = "#{scrprefix}.F92" | |
294 | - ENV["MMCIVC1"] = "#{scrprefix}.F93" | |
295 | - ENV["MMCIITR"] = "#{scrprefix}.F94" | |
296 | - ENV["MMNEXM"] = "#{scrprefix}.F95" | |
297 | - ENV["MMNEXE"] = "#{scrprefix}.F96" | |
298 | - ENV["MMNREXM"] = "#{scrprefix}.F97" | |
299 | - ENV["MMNREXE"] = "#{scrprefix}.F98 " | |
278 | + ENV["CCREST"] = "#{scrbody}.F70" | |
279 | + ENV["CCDIIS"] = "#{scrbody}.F71" | |
280 | + ENV["CCINTS"] = "#{scrbody}.F72" | |
281 | + ENV["CCT1AMP"] = "#{scrbody}.F73" | |
282 | + ENV["CCT2AMP"] = "#{scrbody}.F74" | |
283 | + ENV["CCT3AMP"] = "#{scrbody}.F75" | |
284 | + ENV["CCVM"] = "#{scrbody}.F76" | |
285 | + ENV["CCVE"] = "#{scrbody}.F77" | |
286 | + ENV["EOMSTAR"] = "#{scrbody}.F80" | |
287 | + ENV["EOMVEC1"] = "#{scrbody}.F81" | |
288 | + ENV["EOMVEC2"] = "#{scrbody}.F82" | |
289 | + ENV["EOMHC1"] = "#{scrbody}.F83" | |
290 | + ENV["EOMHC2"] = "#{scrbody}.F84" | |
291 | + ENV["EOMHHHH"] = "#{scrbody}.F85" | |
292 | + ENV["EOMPPPP"] = "#{scrbody}.F86" | |
293 | + ENV["EOMRAMP"] = "#{scrbody}.F87" | |
294 | + ENV["EOMRTMP"] = "#{scrbody}.F88" | |
295 | + ENV["EOMDG12"] = "#{scrbody}.F89" | |
296 | + ENV["MMPP"] = "#{scrbody}.F90" | |
297 | + ENV["MMHPP"] = "#{scrbody}.F91" | |
298 | + ENV["MMCIVEC"] = "#{scrbody}.F92" | |
299 | + ENV["MMCIVC1"] = "#{scrbody}.F93" | |
300 | + ENV["MMCIITR"] = "#{scrbody}.F94" | |
301 | + ENV["MMNEXM"] = "#{scrbody}.F95" | |
302 | + ENV["MMNEXE"] = "#{scrbody}.F96" | |
303 | + ENV["MMNREXM"] = "#{scrbody}.F97" | |
304 | + ENV["MMNREXE"] = "#{scrbody}.F98 " | |
300 | 305 | # |
301 | 306 | # next are for TDHFX code, not used by current GAMESS |
302 | 307 | # |
303 | - ENV["OLI201"] = "#{scrprefix}.F201" | |
304 | - ENV["OLI202"] = "#{scrprefix}.F202" | |
305 | - ENV["OLI203"] = "#{scrprefix}.F203" | |
306 | - ENV["OLI204"] = "#{scrprefix}.F204" | |
307 | - ENV["OLI205"] = "#{scrprefix}.F205" | |
308 | - ENV["OLI206"] = "#{scrprefix}.F206" | |
309 | - ENV["OLI207"] = "#{scrprefix}.F207" | |
310 | - ENV["OLI208"] = "#{scrprefix}.F208" | |
311 | - ENV["OLI209"] = "#{scrprefix}.F209" | |
312 | - ENV["OLI210"] = "#{scrprefix}.F210" | |
313 | - ENV["OLI211"] = "#{scrprefix}.F211" | |
314 | - ENV["OLI212"] = "#{scrprefix}.F212" | |
315 | - ENV["OLI213"] = "#{scrprefix}.F213" | |
316 | - ENV["OLI214"] = "#{scrprefix}.F214" | |
317 | - ENV["OLI215"] = "#{scrprefix}.F215" | |
318 | - ENV["OLI216"] = "#{scrprefix}.F216" | |
319 | - ENV["OLI217"] = "#{scrprefix}.F217" | |
320 | - ENV["OLI218"] = "#{scrprefix}.F218" | |
321 | - ENV["OLI219"] = "#{scrprefix}.F219" | |
322 | - ENV["OLI220"] = "#{scrprefix}.F220" | |
323 | - ENV["OLI221"] = "#{scrprefix}.F221" | |
324 | - ENV["OLI222"] = "#{scrprefix}.F222" | |
325 | - ENV["OLI223"] = "#{scrprefix}.F223" | |
326 | - ENV["OLI224"] = "#{scrprefix}.F224" | |
327 | - ENV["OLI225"] = "#{scrprefix}.F225" | |
328 | - ENV["OLI226"] = "#{scrprefix}.F226" | |
329 | - ENV["OLI227"] = "#{scrprefix}.F227" | |
330 | - ENV["OLI228"] = "#{scrprefix}.F228" | |
331 | - ENV["OLI229"] = "#{scrprefix}.F229" | |
332 | - ENV["OLI230"] = "#{scrprefix}.F230" | |
333 | - ENV["OLI231"] = "#{scrprefix}.F231" | |
334 | - ENV["OLI232"] = "#{scrprefix}.F232" | |
335 | - ENV["OLI233"] = "#{scrprefix}.F233" | |
336 | - ENV["OLI234"] = "#{scrprefix}.F234" | |
337 | - ENV["OLI235"] = "#{scrprefix}.F235" | |
338 | - ENV["OLI236"] = "#{scrprefix}.F236" | |
339 | - ENV["OLI237"] = "#{scrprefix}.F237" | |
340 | - ENV["OLI238"] = "#{scrprefix}.F238" | |
341 | - ENV["OLI239"] = "#{scrprefix}.F239" | |
308 | + ENV["OLI201"] = "#{scrbody}.F201" | |
309 | + ENV["OLI202"] = "#{scrbody}.F202" | |
310 | + ENV["OLI203"] = "#{scrbody}.F203" | |
311 | + ENV["OLI204"] = "#{scrbody}.F204" | |
312 | + ENV["OLI205"] = "#{scrbody}.F205" | |
313 | + ENV["OLI206"] = "#{scrbody}.F206" | |
314 | + ENV["OLI207"] = "#{scrbody}.F207" | |
315 | + ENV["OLI208"] = "#{scrbody}.F208" | |
316 | + ENV["OLI209"] = "#{scrbody}.F209" | |
317 | + ENV["OLI210"] = "#{scrbody}.F210" | |
318 | + ENV["OLI211"] = "#{scrbody}.F211" | |
319 | + ENV["OLI212"] = "#{scrbody}.F212" | |
320 | + ENV["OLI213"] = "#{scrbody}.F213" | |
321 | + ENV["OLI214"] = "#{scrbody}.F214" | |
322 | + ENV["OLI215"] = "#{scrbody}.F215" | |
323 | + ENV["OLI216"] = "#{scrbody}.F216" | |
324 | + ENV["OLI217"] = "#{scrbody}.F217" | |
325 | + ENV["OLI218"] = "#{scrbody}.F218" | |
326 | + ENV["OLI219"] = "#{scrbody}.F219" | |
327 | + ENV["OLI220"] = "#{scrbody}.F220" | |
328 | + ENV["OLI221"] = "#{scrbody}.F221" | |
329 | + ENV["OLI222"] = "#{scrbody}.F222" | |
330 | + ENV["OLI223"] = "#{scrbody}.F223" | |
331 | + ENV["OLI224"] = "#{scrbody}.F224" | |
332 | + ENV["OLI225"] = "#{scrbody}.F225" | |
333 | + ENV["OLI226"] = "#{scrbody}.F226" | |
334 | + ENV["OLI227"] = "#{scrbody}.F227" | |
335 | + ENV["OLI228"] = "#{scrbody}.F228" | |
336 | + ENV["OLI229"] = "#{scrbody}.F229" | |
337 | + ENV["OLI230"] = "#{scrbody}.F230" | |
338 | + ENV["OLI231"] = "#{scrbody}.F231" | |
339 | + ENV["OLI232"] = "#{scrbody}.F232" | |
340 | + ENV["OLI233"] = "#{scrbody}.F233" | |
341 | + ENV["OLI234"] = "#{scrbody}.F234" | |
342 | + ENV["OLI235"] = "#{scrbody}.F235" | |
343 | + ENV["OLI236"] = "#{scrbody}.F236" | |
344 | + ENV["OLI237"] = "#{scrbody}.F237" | |
345 | + ENV["OLI238"] = "#{scrbody}.F238" | |
346 | + ENV["OLI239"] = "#{scrbody}.F239" | |
342 | 347 | |
343 | 348 | if $platform == "win" |
344 | 349 | if ncpus < 2 |
@@ -355,7 +360,7 @@ class Molecule | ||
355 | 360 | # File containing arguments to mpiexec |
356 | 361 | procfil = "#{scrprefix}.processes.mpd" |
357 | 362 | fp = File.open(procfil, "w") |
358 | - fp.print "-env ENVFIL #{envfil} -n #{ncpus} #{gmsdir}#{sep}gamess.#{gmsvers}.exe\n" | |
363 | + fp.print "-env ENVFIL #{envfil} -wdir #{scrdir} -n #{ncpus} #{gmsdir}#{sep}gamess.#{gmsvers}.exe\n" | |
359 | 364 | fp.close |
360 | 365 | end |
361 | 366 |
@@ -23,14 +23,15 @@ $startup_dir = Dir.pwd | ||
23 | 23 | case RUBY_PLATFORM |
24 | 24 | when /mswin|mingw|cygwin|bccwin/ |
25 | 25 | $platform = "win" |
26 | -# $KCODE="SJIS" | |
26 | + Encoding.default_external = "shift_jis" | |
27 | 27 | $home_directory = ENV['USERPROFILE'].gsub(/\\/, "/") |
28 | 28 | when /darwin/ |
29 | 29 | $platform = "mac" |
30 | -# $KCODE="UTF8" | |
30 | + Encoding.default_external = "utf-8" | |
31 | 31 | $home_directory = ENV['HOME'] |
32 | 32 | else |
33 | 33 | $platform = "other" |
34 | + Encoding.default_external = "locale" | |
34 | 35 | $home_directory = ENV['HOME'] |
35 | 36 | end |
36 | 37 |
@@ -123,24 +123,24 @@ end | ||
123 | 123 | |
124 | 124 | register_menu("View\t-", nil) |
125 | 125 | register_menu("View\t^Show Unit Cell", :cmd_show_unit_cell, |
126 | - lambda { |m| [m != nil, m.show_unitcell] } ) | |
126 | + lambda { |m| [m != nil, m && m.show_unitcell] } ) | |
127 | 127 | register_menu("View\t^Show Hydrogen Atoms", :cmd_show_hydrogens, |
128 | - lambda { |m| [m != nil, m.show_hydrogens] } ) | |
128 | + lambda { |m| [m != nil, m && m.show_hydrogens] } ) | |
129 | 129 | register_menu("View\t^Show Dummy Atoms", :cmd_show_dummy_atoms, |
130 | - lambda { |m| [m != nil, m.show_dummy_atoms] } ) | |
130 | + lambda { |m| [m != nil, m && m.show_dummy_atoms] } ) | |
131 | 131 | register_menu("View\t^Show Expanded Atoms", :cmd_show_expanded, |
132 | - lambda { |m| [m != nil, m.show_expanded] } ) | |
132 | + lambda { |m| [m != nil, m && m.show_expanded] } ) | |
133 | 133 | register_menu("View\t^Show Ellipsoids", :cmd_show_ellipsoids, |
134 | - lambda { |m| [m != nil, m.show_ellipsoids] } ) | |
134 | + lambda { |m| [m != nil, m && m.show_ellipsoids] } ) | |
135 | 135 | register_menu("View\t^Show Rotation Center", :cmd_show_rotation_center, |
136 | - lambda { |m| [m != nil, m.show_rotation_center] } ) | |
136 | + lambda { |m| [m != nil, m && m.show_rotation_center] } ) | |
137 | 137 | register_menu("View\t-", nil) |
138 | 138 | register_menu("View\t^Show Graphite...", :cmd_show_graphite, |
139 | - lambda { |m| [m != nil, m.show_graphite?] } ) | |
139 | + lambda { |m| [m != nil, m && m.show_graphite?] } ) | |
140 | 140 | register_menu("View\t-", nil) |
141 | 141 | register_menu("View\tAppearance\t^Line", :cmd_line_mode, |
142 | - lambda { |m| [m != nil, m.line_mode] } ) | |
142 | + lambda { |m| [m != nil, m && m.line_mode] } ) | |
143 | 143 | register_menu("View\tAppearance\t^Ball and Stick", :cmd_ball_and_stick_mode, |
144 | - lambda { |m| [m != nil, !m.line_mode && m.atom_radius < 0.5] } ) | |
144 | + lambda { |m| [m != nil, m && !m.line_mode && m.atom_radius < 0.5] } ) | |
145 | 145 | register_menu("View\tAppearance\t^Space Filling", :cmd_space_filling_mode, |
146 | - lambda { |m| [m != nil, !m.line_mode && m.atom_radius >= 0.5] } ) | |
146 | + lambda { |m| [m != nil, m && !m.line_mode && m.atom_radius >= 0.5] } ) |
@@ -44,6 +44,7 @@ Get ruby-2.0.0-p353.tar.gz, unpack it, and move the resulting directory ruby-2.0 | ||
44 | 44 | $ cd $MOLBY/../ruby-2.0.0-p353 |
45 | 45 | $ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -O2' ./configure --prefix=$PWD/osx-build --with-arch=i386,ppc --disable-shared --with-ext=date --disable-install-rdoc |
46 | 46 | $ make && make install |
47 | +$ cd enc; ar -r libenc.a *.o; cp libenc.a ../osx-build/lib # We need shift_jis.o etc. for encoding support | |
47 | 48 | |
48 | 49 | The osx-build directory contains lib (which contains libruby-static.a) and include (which contains include files). (There are also bin and share directories, but these are not used for building Molby.) |
49 | 50 | $ make clean # Remove configure files and intermediates; the osx-build directory remains intact |
@@ -118,6 +119,7 @@ If you use gcc 4.6 or later, comment out the following line in cygwin/GNUmakefil | ||
118 | 119 | |
119 | 120 | $ ./configure --prefix=$PWD/msw-build --disable-shared --with-ext=date --disable-install-rdoc --with-static-linked-ext |
120 | 121 | $ make && make install |
122 | +$ cp enc/libenc.a msw-build/lib # We need this for encoding support | |
121 | 123 | |
122 | 124 | The msw-build directory contains lib (which contains libmsvcrt-ruby200-static.a and libmsvcrt-rubuy200.a) and include (which contains include files). (There are also bin and share directories, but these are not used for building Molby.) |
123 | 125 | $ make clean # Remove configure files and intermediates; the msw-build directory remains intact |
@@ -364,10 +364,14 @@ ConsoleFrame::OnEnterPressed() | ||
364 | 364 | Molby_showError(status); |
365 | 365 | } else { |
366 | 366 | textCtrl->AppendText(wxT("-->")); |
367 | - Molby_showRubyValue(val, &valueString); | |
368 | - AssignArray(&valueHistory, &nValueHistory, sizeof(char *), nValueHistory, &valueString); | |
369 | - if (nValueHistory >= MAX_HISTORY_LINES) | |
370 | - DeleteArray(&valueHistory, &nValueHistory, sizeof(char *), 0, 1, NULL); | |
367 | + status = Molby_showRubyValue(val, &valueString); | |
368 | + if (status != 0) { | |
369 | + Molby_showError(status); | |
370 | + } else { | |
371 | + AssignArray(&valueHistory, &nValueHistory, sizeof(char *), nValueHistory, &valueString); | |
372 | + if (nValueHistory >= MAX_HISTORY_LINES) | |
373 | + DeleteArray(&valueHistory, &nValueHistory, sizeof(char *), 0, 1, NULL); | |
374 | + } | |
371 | 375 | } |
372 | 376 | MyAppCallback_setConsoleColor(0); |
373 | 377 | textCtrl->AppendText(wxT("\n")); |
@@ -43,6 +43,7 @@ | ||
43 | 43 | #include "wx/process.h" |
44 | 44 | #include "wx/utils.h" |
45 | 45 | #include "wx/sound.h" |
46 | +#include "wx/time.h" | |
46 | 47 | |
47 | 48 | #include "MyApp.h" |
48 | 49 | #include "MyDocument.h" |
@@ -1238,6 +1239,7 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback) | ||
1238 | 1239 | char buf[256]; |
1239 | 1240 | size_t len, len_total; |
1240 | 1241 | wxString cmdstr(cmdline, WX_DEFAULT_CONV); |
1242 | + wxLongLong startTime; | |
1241 | 1243 | |
1242 | 1244 | if (m_process != NULL) |
1243 | 1245 | return -1; // Another process is already running (CallSubProcess() allows only one subprocess) |
@@ -1251,6 +1253,7 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback) | ||
1251 | 1253 | ShowProgressPanel(buf); |
1252 | 1254 | progress_panel = true; |
1253 | 1255 | } |
1256 | + startTime = wxGetUTCTimeMillis(); | |
1254 | 1257 | |
1255 | 1258 | // Create log file in the document home directory |
1256 | 1259 | #if LOG_SUBPROCESS |
@@ -1342,8 +1345,9 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback) | ||
1342 | 1345 | } |
1343 | 1346 | } |
1344 | 1347 | } |
1345 | - if (++count == 100) { | |
1346 | - if (progress_panel == false) { | |
1348 | + if (progress_panel == false) { | |
1349 | + ::wxSafeYield(NULL); // This seems necessary to get OnEndProcess called | |
1350 | + if (++count == 40) { | |
1347 | 1351 | ShowProgressPanel("Running subprocess..."); |
1348 | 1352 | progress_panel = true; |
1349 | 1353 | } |
@@ -1431,7 +1435,7 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback) | ||
1431 | 1435 | nn = 0; |
1432 | 1436 | } |
1433 | 1437 | #endif |
1434 | - ::wxMilliSleep(10); | |
1438 | + ::wxMilliSleep(25); | |
1435 | 1439 | if (wxGetApp().IsInterrupted() || (callback != NULL && callback != DUMMY_CALLBACK && (callback_result = (*callback)(callback_data)) != 0)) { |
1436 | 1440 | /* User interrupt */ |
1437 | 1441 | int kflag = wxKILL_CHILDREN; |
@@ -1894,7 +1898,7 @@ MyAppCallback_executeScriptFromFile(const char *cpath, int *status) | ||
1894 | 1898 | } |
1895 | 1899 | |
1896 | 1900 | /* Check the encoding specification, and if present convert it to default encoding */ |
1897 | - { | |
1901 | + if (0) { | |
1898 | 1902 | char *lp = script, *eolp; |
1899 | 1903 | int n = 0; |
1900 | 1904 | while (n < 2) { /* Check the first two lines */ |
@@ -667,6 +667,7 @@ | ||
667 | 667 | "-liconv", |
668 | 668 | "-lfftw3", |
669 | 669 | "-lruby-static", |
670 | + "-lenc", | |
670 | 671 | ); |
671 | 672 | PRODUCT_NAME = Molby; |
672 | 673 | SDKROOT = macosx10.5; |
@@ -722,6 +723,7 @@ | ||
722 | 723 | "-liconv", |
723 | 724 | "-lfftw3", |
724 | 725 | "-lruby-static", |
726 | + "-lenc", | |
725 | 727 | ); |
726 | 728 | PRODUCT_NAME = Molby; |
727 | 729 | SDKROOT = macosx10.5; |
@@ -786,6 +788,7 @@ | ||
786 | 788 | OTHER_LDFLAGS = ( |
787 | 789 | "-lfftw3", |
788 | 790 | "-lruby-static", |
791 | + "-lenc", | |
789 | 792 | ); |
790 | 793 | PREBINDING = NO; |
791 | 794 | PRODUCT_NAME = Molby_command; |
@@ -816,6 +819,7 @@ | ||
816 | 819 | OTHER_LDFLAGS = ( |
817 | 820 | "-lfftw3", |
818 | 821 | "-lruby-static", |
822 | + "-lenc", | |
819 | 823 | ); |
820 | 824 | PREBINDING = NO; |
821 | 825 | PRODUCT_NAME = Molby_command; |