• R/O
  • HTTP
  • SSH
  • HTTPS

Molby: コミット

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

変更サマリ

差分

--- a/Documents/src/doc_source.html
+++ b/Documents/src/doc_source.html
@@ -935,9 +935,6 @@ The parameter table shows the molecular mechanics parameters in one table.
935935 </p>
936936 <p><img src="../etc/table_12.png" /></p>
937937 <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>
941938 The parameters are grouped in several classes, namely "VDWs", "Bonds", "Angles", "Dihedrals", "Impropers", and "VDW Pairs".
942939 </p>
943940 <p>
@@ -1028,9 +1025,6 @@ Bond, angle, dihedral, improper テーブルは、それぞれ結合・結合角
10281025 </p>
10291026 <p><img src="../etc/table_12.png" /></p>
10301027 <p>
1031-分子を新しく作成して、MM/MD に関連する操作を何もせずにパラメータテーブルを開くと、テーブルはおそらく空のままでしょう。分子力学パラメータは、"Molecular Dynamics..." または "Minimize..." メニューコマンドを実行したときか、Antechamber のような分子力学用ツール(第四段階参照)を使った時に初めて作成されます。これらの操作をした後には、パラメータがこのテーブルに表示されます。
1032-</p>
1033-<p>
10341028 パラメータはいくつかの種類にグループ分けされています。"VDWs", "Bonds", "Angles", "Dihedrals", "Impropers", そして "VDW Pairs" です。
10351029 </p>
10361030 <p>
@@ -1099,7 +1093,7 @@ Open the "MM/MD" menu, and select "Guess MM/MD Parameters..." command.
10991093 </p>
11001094 <p><img src="../etc/minimize_02.png" /></p>
11011095 <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.
11031097 </p>
11041098 <p><img src="../etc/minimize_03.png" /></p>
11051099 <p>
@@ -1188,7 +1182,7 @@ Molby の分子力学計算は、基本的な分子力場(結合の伸縮、
11881182 </p>
11891183 <p><img src="../etc/minimize_02.png" /></p>
11901184 <p>
1191-下のようなダイアログが現れます。これは現在の分子に対して Antechamber を実行するためのものです。一番上のチェックボックス (partial charge) をオフにしてください。"Log" ディレクトリは、AmberTools のプログラムが中間ファイルを保存するのに使います。デフォルトの位置で問題はないでしょうが、変更してもかまいません。
1185+下のようなダイアログが現れます。これは現在の分子に対して Antechamber を実行するためのものです。一番上のチェックボックス "Calculate partial charge" をオフ、その下の "Guess Atom Types" をオンにしてください。"Log" ディレクトリは、AmberTools のプログラムが中間ファイルを保存するのに使います。デフォルトの位置で問題はないでしょうが、変更してもかまいません。
11921186 </p>
11931187 <p><img src="../etc/minimize_03.png" /></p>
11941188 <p>
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ ifeq ($(TARGET_PLATFORM),MAC)
88 LD_EXTRA_FLAGS = -framework Accelerate -framework GLUT -L$(PWD)/../../fftw-3.3.2/osx-build/lib -lfftw3
99 RUBY_DIR = $(PWD)/../../ruby-1.8.7-p160
1010 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
1212 EXECUTABLE = Molby
1313 EXE_SUFFIX =
1414 endif
@@ -23,7 +23,7 @@ ifeq ($(TARGET_PLATFORM),MSW)
2323 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
2424 RUBY_DIR = $(PWD)/../../ruby-2.0.0-p353
2525 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
2727 EXECUTABLE = _Molby.exe_
2828 FINAL_EXECUTABLE = Molby.exe
2929 EXE_SUFFIX = .exe
--- a/MolLib/Ruby_bind/Molby_extern.h
+++ b/MolLib/Ruby_bind/Molby_extern.h
@@ -37,7 +37,7 @@ extern void Molby_showError(int status);
3737 extern RubyValue Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fname, int *status);
3838 /* extern RubyValue Molby_evalRubyScript(const char *script, int *status);
3939 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);
4141 extern int Ruby_UpdateUI(int index, Molecule *mol, int *outChecked, char **outTitle);
4242 /*extern int Ruby_methodType(const char *className, const char *methodName);*/
4343 extern void Molby_buildARGV(int argc, const char **argv);
--- a/MolLib/Ruby_bind/ruby_bind.c
+++ b/MolLib/Ruby_bind/ruby_bind.c
@@ -11065,7 +11065,11 @@ s_evalRubyScriptOnMoleculeSub(VALUE val)
1106511065 if (ptr[2] == NULL) {
1106611066 char *scr;
1106711067 /* 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
1106811071 asprintf(&scr, "#coding:utf-8\n%s", (char *)ptr[0]);
11072+#endif
1106911073 sval = rb_str_new2(scr);
1107011074 free(scr);
1107111075 fnval = rb_str_new2("(eval)");
@@ -11124,13 +11128,13 @@ Molby_evalRubyScriptOnMolecule(const char *script, Molecule *mol, const char *fn
1112411128 return retval;
1112511129 }
1112611130
11127-void
11131+int
1112811132 Molby_showRubyValue(RubyValue value, char **outValueString)
1112911133 {
1113011134 VALUE val = (VALUE)value;
1113111135 if (gMolbyIsCheckingInterrupt) {
1113211136 MolActionAlertRubyIsRunning();
11133- return;
11137+ return 0;
1113411138 }
1113511139 if (val != Qnil) {
1113611140 int status;
@@ -11138,11 +11142,17 @@ Molby_showRubyValue(RubyValue value, char **outValueString)
1113811142 gMolbyRunLevel++;
1113911143 val = rb_protect(rb_inspect, val, &status);
1114011144 gMolbyRunLevel--;
11145+ if (status != 0)
11146+ return status;
1114111147 str = StringValuePtr(val);
1114211148 if (outValueString != NULL)
1114311149 *outValueString = strdup(str);
1114411150 MyAppCallback_showScriptMessage("%s", str);
11151+ } else {
11152+ if (outValueString != NULL)
11153+ *outValueString = NULL;
1114511154 }
11155+ return 0;
1114611156 }
1114711157
1114811158 void
@@ -11301,6 +11311,11 @@ Molby_startup(const char *script, const char *dir)
1130111311 }
1130211312 #endif
1130311313 ruby_init();
11314+
11315+ {
11316+ extern void Init_shift_jis(void);
11317+ Init_shift_jis();
11318+ }
1130411319
1130511320 /* Initialize loadpath; the specified directory, "lib" subdirectory, and "." */
1130611321 ruby_incpush(".");
--- a/Scripts/crystal.rb
+++ b/Scripts/crystal.rb
@@ -1,4 +1,5 @@
1-#
1+# coding: utf-8
2+#
23 # crystal.rb
34 #
45 # Created by Toshi Nagata.
@@ -1807,7 +1808,8 @@ end
18071808 new_box = nil
18081809 hash = Dialog.run("Unit Cell") {
18091810 @mol = mol
1810- @box = @mol.box.dup
1811+ @box = @mol.box
1812+ @box = (@box ? @box.dup : nil)
18111813 @box_save = nil
18121814
18131815 def set_cell_value(item1)
--- a/Scripts/gamess.rb
+++ b/Scripts/gamess.rb
@@ -195,7 +195,12 @@ class Molecule
195195 fpout.print freebytes
196196
197197 # 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
199204 filecopy(inpname, scrprefix + ".F05")
200205
201206 # Prepare environmental variables
@@ -205,140 +210,140 @@ class Molecule
205210 ENV["BASPATH"] = "#{auxdir}#{sep}BASES"
206211 ENV["QUANPOL"] = "#{auxdir}#{sep}QUANPOL"
207212 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"
270275
271276 # next files are used only during coupled cluster runs, so let's
272277 # 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 "
300305 #
301306 # next are for TDHFX code, not used by current GAMESS
302307 #
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"
342347
343348 if $platform == "win"
344349 if ncpus < 2
@@ -355,7 +360,7 @@ class Molecule
355360 # File containing arguments to mpiexec
356361 procfil = "#{scrprefix}.processes.mpd"
357362 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"
359364 fp.close
360365 end
361366
--- a/Scripts/startup.rb
+++ b/Scripts/startup.rb
@@ -23,14 +23,15 @@ $startup_dir = Dir.pwd
2323 case RUBY_PLATFORM
2424 when /mswin|mingw|cygwin|bccwin/
2525 $platform = "win"
26-# $KCODE="SJIS"
26+ Encoding.default_external = "shift_jis"
2727 $home_directory = ENV['USERPROFILE'].gsub(/\\/, "/")
2828 when /darwin/
2929 $platform = "mac"
30-# $KCODE="UTF8"
30+ Encoding.default_external = "utf-8"
3131 $home_directory = ENV['HOME']
3232 else
3333 $platform = "other"
34+ Encoding.default_external = "locale"
3435 $home_directory = ENV['HOME']
3536 end
3637
--- a/Scripts/view.rb
+++ b/Scripts/view.rb
@@ -123,24 +123,24 @@ end
123123
124124 register_menu("View\t-", nil)
125125 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] } )
127127 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] } )
129129 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] } )
131131 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] } )
133133 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] } )
135135 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] } )
137137 register_menu("View\t-", nil)
138138 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?] } )
140140 register_menu("View\t-", nil)
141141 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] } )
143143 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] } )
145145 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] } )
--- a/how_to_build
+++ b/how_to_build
@@ -44,6 +44,7 @@ Get ruby-2.0.0-p353.tar.gz, unpack it, and move the resulting directory ruby-2.0
4444 $ cd $MOLBY/../ruby-2.0.0-p353
4545 $ 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
4646 $ 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
4748
4849 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.)
4950 $ 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
118119
119120 $ ./configure --prefix=$PWD/msw-build --disable-shared --with-ext=date --disable-install-rdoc --with-static-linked-ext
120121 $ make && make install
122+$ cp enc/libenc.a msw-build/lib # We need this for encoding support
121123
122124 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.)
123125 $ make clean # Remove configure files and intermediates; the msw-build directory remains intact
--- a/wxSources/ConsoleFrame.cpp
+++ b/wxSources/ConsoleFrame.cpp
@@ -364,10 +364,14 @@ ConsoleFrame::OnEnterPressed()
364364 Molby_showError(status);
365365 } else {
366366 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+ }
371375 }
372376 MyAppCallback_setConsoleColor(0);
373377 textCtrl->AppendText(wxT("\n"));
--- a/wxSources/MyApp.cpp
+++ b/wxSources/MyApp.cpp
@@ -43,6 +43,7 @@
4343 #include "wx/process.h"
4444 #include "wx/utils.h"
4545 #include "wx/sound.h"
46+#include "wx/time.h"
4647
4748 #include "MyApp.h"
4849 #include "MyDocument.h"
@@ -1238,6 +1239,7 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback)
12381239 char buf[256];
12391240 size_t len, len_total;
12401241 wxString cmdstr(cmdline, WX_DEFAULT_CONV);
1242+ wxLongLong startTime;
12411243
12421244 if (m_process != NULL)
12431245 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)
12511253 ShowProgressPanel(buf);
12521254 progress_panel = true;
12531255 }
1256+ startTime = wxGetUTCTimeMillis();
12541257
12551258 // Create log file in the document home directory
12561259 #if LOG_SUBPROCESS
@@ -1342,8 +1345,9 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback)
13421345 }
13431346 }
13441347 }
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) {
13471351 ShowProgressPanel("Running subprocess...");
13481352 progress_panel = true;
13491353 }
@@ -1431,7 +1435,7 @@ MyApp::CallSubProcess(const char *cmdline, const char *procname, int (*callback)
14311435 nn = 0;
14321436 }
14331437 #endif
1434- ::wxMilliSleep(10);
1438+ ::wxMilliSleep(25);
14351439 if (wxGetApp().IsInterrupted() || (callback != NULL && callback != DUMMY_CALLBACK && (callback_result = (*callback)(callback_data)) != 0)) {
14361440 /* User interrupt */
14371441 int kflag = wxKILL_CHILDREN;
@@ -1894,7 +1898,7 @@ MyAppCallback_executeScriptFromFile(const char *cpath, int *status)
18941898 }
18951899
18961900 /* Check the encoding specification, and if present convert it to default encoding */
1897- {
1901+ if (0) {
18981902 char *lp = script, *eolp;
18991903 int n = 0;
19001904 while (n < 2) { /* Check the first two lines */
--- a/xcode-build/Molby.xcodeproj/project.pbxproj
+++ b/xcode-build/Molby.xcodeproj/project.pbxproj
@@ -667,6 +667,7 @@
667667 "-liconv",
668668 "-lfftw3",
669669 "-lruby-static",
670+ "-lenc",
670671 );
671672 PRODUCT_NAME = Molby;
672673 SDKROOT = macosx10.5;
@@ -722,6 +723,7 @@
722723 "-liconv",
723724 "-lfftw3",
724725 "-lruby-static",
726+ "-lenc",
725727 );
726728 PRODUCT_NAME = Molby;
727729 SDKROOT = macosx10.5;
@@ -786,6 +788,7 @@
786788 OTHER_LDFLAGS = (
787789 "-lfftw3",
788790 "-lruby-static",
791+ "-lenc",
789792 );
790793 PREBINDING = NO;
791794 PRODUCT_NAME = Molby_command;
@@ -816,6 +819,7 @@
816819 OTHER_LDFLAGS = (
817820 "-lfftw3",
818821 "-lruby-static",
822+ "-lenc",
819823 );
820824 PREBINDING = NO;
821825 PRODUCT_NAME = Molby_command;
旧リポジトリブラウザで表示