• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionb6aeff0fa5bce4d51bd80aad0ea490e88f5733d9 (tree)
Zeit2013-04-03 20:10:44
Autornekora <nekora@user...>
Commiternekora

Log Message

ログの出力先をlogディレクトリ配下に変更。処理終了時にBEEP。処理中は「実行」ボタンを無効化。

Ändern Zusammenfassung

Diff

--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@
66 /MDPSprocess3.log
77 /MDPSprocess4.log
88 /MDPSprocess5.log
9+/MDPSprocess6.log
10+/log
--- a/bin/.gitignore
+++ b/bin/.gitignore
@@ -1,2 +1 @@
11 /nekora
2-/makejar.bat
--- /dev/null
+++ b/bin/makejar.bat
@@ -0,0 +1 @@
1+jar cvf cwnprint.jar nekora
\ No newline at end of file
--- a/src/nekora/cwn/MDPSMain.java
+++ b/src/nekora/cwn/MDPSMain.java
@@ -1,7 +1,6 @@
11 package nekora.cwn;
22
33 import java.awt.Point;
4-import java.awt.Rectangle;
54 import java.io.File;
65 import java.io.IOException;
76 import java.util.ArrayList;
@@ -36,9 +35,7 @@ import javafx.scene.text.Text;
3635 import javafx.scene.text.TextAlignment;
3736 import javafx.stage.DirectoryChooser;
3837 import javafx.stage.Stage;
39-
4038 import jfx.messagebox.MessageBox;
41-
4239 import nekora.cwn.align.PageAlign;
4340 import nekora.cwn.align.PageAlignFactory;
4441 import nekora.cwn.ext.ExtCmd;
@@ -106,7 +103,7 @@ public class MDPSMain extends Application{
106103 Stage rootStage;
107104
108105 public MDPSMain(){
109- String logname ="MDPSprocess";
106+ String logname ="log/MDPSprocess";
110107 logger = Logger.getLogger(logname);
111108 try{
112109 Handler fileHandler = new FileHandler(logname+"%g.log", 100000, 9);
@@ -140,12 +137,10 @@ public class MDPSMain extends Application{
140137 // 入力画像ファイル設定一覧読み取り
141138 File dir = new File(INPUT_CONFIG_DIR);
142139 inputFileConfigs = dir.listFiles();
143- logger.info("inputfiles="+inputFileConfigs.toString());
144140
145141 // 出力用紙設定ファイル一覧予備撮り
146142 File diro = new File(OUTPUT_CONFIG_DIR);
147143 outputFileConfigs = diro.listFiles();
148- logger.info("outputfiles="+outputFileConfigs.toString());
149144
150145 this.rootStage = rootStage; // イベントハンドラから参照のため
151146 rootStage.setTitle(ROOT_TITLE);
@@ -535,20 +530,19 @@ public class MDPSMain extends Application{
535530 progressBar.progressProperty().bind(task.progressProperty());
536531 statusBar.textProperty().bind(task.messageProperty());
537532
538- //execButton.setDisable(true); //ボタンを無効化すると戻した後にループする。バグ。
539- executing_flg=true;
540- exec.submit(task);
541-
542533 task.addEventHandler(WorkerStateEvent.WORKER_STATE_SUCCEEDED,
543534 new EventHandler<WorkerStateEvent>(){
544535 @Override
545536 public void handle(WorkerStateEvent t){
546537 exec.shutdown();
547- // execButton.setDisable(false); //ボタンを無効化すると戻した後にループする。バグ。
538+ execButton.setDisable(false); //実行ボタンを有効化する。
548539 executing_flg=false;
549- //java.awt.Toolkit.getDefaultToolkit().beep();
540+ java.awt.Toolkit.getDefaultToolkit().beep();
550541 }
551542 });
543+ executing_flg=true;
544+ execButton.setDisable(true); //実行ボタンを無効化する
545+ exec.submit(task);
552546
553547 }
554548
--- a/src/nekora/cwn/MDPSTask.java
+++ b/src/nekora/cwn/MDPSTask.java
@@ -63,24 +63,29 @@ class MDPSTask extends Task<String> {
6363
6464 @Override
6565 protected String call() throws Exception {
66- logger.info("start");
66+ logger.info("start "+Thread.currentThread().getName());
6767 updateMessage("開始");
68+ logger.info("Before pa.exec "+pa);
6869 List<File> alignList = pa.exec();
6970 int max = alignList.size();
71+ logger.info("Before updateProgress");
7072 updateProgress(0, max);
7173
7274 File workDir = new File(outputDirName);
7375 ExecutorService exec = Executors.newFixedThreadPool(1); // 白黒化コマンドキック用プロセスを待つスレッド
7476 List<Future<String>> resultList = new ArrayList<Future<String>>();
77+ logger.info("Before createMixOut");
7578 MixOut mx = pa.createMixOut(ip, baseSize, max, logger);
7679
7780 int pagenum =1;
81+ logger.info("Before for loop. size="+alignList.size());
7882 for(int i=0; i<alignList.size(); i+=2){
7983 String outputFilePre = outputDirName+File.separator+ outsizeName+"_"+pa.getFileName(pagenum);
8084 File lastFile = new File(outputFilePre+cmd.getExt()); //最終的な目的の出力ファイル
8185 File fL = alignList.get(i);
8286 File fR = alignList.get(i+1);
8387 String msg = fL.getName()+" , "+fR.getName()+" ⇒ "+ pa.getFileName(pagenum)+cmd.getExt();
88+ logger.info(msg + " を処理中…");
8489 updateMessage(msg + " を処理中…");
8590 if(lastFile.lastModified()>fL.lastModified() && lastFile.lastModified()>fR.lastModified()){
8691 // 素材ファイルより、最終成果物ファイルの方が新しいなら処理はスキップ
--- a/src/nekora/cwn/align/PageAlignCenterBend.java
+++ b/src/nekora/cwn/align/PageAlignCenterBend.java
@@ -26,6 +26,7 @@ public class PageAlignCenterBend extends PageAlign {
2626 @Override
2727 public List<File> exec() {
2828 //左右反転して、ファイル数が4の倍数で無い場合は最後にnullを足す。
29+ logger.info(name + " 開始");
2930 int num = flist.size();
3031 if(num % 4 != 0){
3132 int add = 4-num%4;
@@ -36,6 +37,7 @@ public class PageAlignCenterBend extends PageAlign {
3637
3738 List<File> ret = new ArrayList<>();
3839 int count = flist.size();
40+ logger.info("回数="+count);
3941 for( int i=0; i< count; i+=4 ){
4042 File AL = flist.get(i);
4143 File AR = flist.get(count-1 -i);
@@ -48,6 +50,7 @@ public class PageAlignCenterBend extends PageAlign {
4850 ret.add(BR);
4951 }
5052
53+ logger.info(name + " 終了");
5154 return ret;
5255 }
5356
--- a/src/nekora/cwn/align/PageAlignCutDouble.java
+++ b/src/nekora/cwn/align/PageAlignCutDouble.java
@@ -25,6 +25,7 @@ public class PageAlignCutDouble extends PageAlign {
2525
2626 @Override
2727 public List<File> exec() {
28+ logger.info(name + " 開始");
2829 //基本的にそのままコピーするだけだが、ファイル数が2の倍数で無い場合は最後にnullを足す。
2930 int num = flist.size();
3031 if(num % 2 != 0){
@@ -36,6 +37,7 @@ public class PageAlignCutDouble extends PageAlign {
3637 ret.add(f);
3738 }
3839
40+ logger.info(name + " 終了");
3941 return ret;
4042 }
4143
@@ -49,7 +51,10 @@ public class PageAlignCutDouble extends PageAlign {
4951 InputPaper ip,
5052 Point baseSize, int borderPixel, Logger logger) {
5153 // 原稿2枚を1枚の紙にする
52- return new MixOut2in1( ip, baseSize, borderPixel, logger);
54+ logger.info("Before MixOut "+Thread.currentThread().getName());
55+ MixOut ret = new MixOut2in1( ip, baseSize, borderPixel, logger); //<--ここでストールしている
56+ logger.info("After MixOut");
57+ return ret;
5358 }
5459
5560 }
--- a/src/nekora/cwn/mix/MixOut.java
+++ b/src/nekora/cwn/mix/MixOut.java
@@ -1,7 +1,6 @@
11 package nekora.cwn.mix;
22
33 import java.awt.Point;
4-import java.awt.Rectangle;
54 import java.util.logging.Logger;
65
76 import nekora.cwn.paper.InputPaper;
@@ -23,10 +22,12 @@ public abstract class MixOut {
2322 InputPaper ip,
2423 Point baseSize, int borderPixel,
2524 Logger logger) {
25+ this.logger = logger;
26+ logger.info("start");
2627 this.ip = ip;
2728 this.baseSize = baseSize;
2829 this.borderPixel = borderPixel;
29- this.logger = logger;
30+ logger.info("end");
3031 }
3132
3233 public abstract String make(String outputFileName, String leftFileName, String rightFileName);
--- a/src/nekora/cwn/mix/MixOut2in1.java
+++ b/src/nekora/cwn/mix/MixOut2in1.java
@@ -25,7 +25,9 @@ public class MixOut2in1 extends MixOut {
2525 InputPaper ip,
2626 Point baseSize, int borderPixel, Logger logger) {
2727 super(ip, baseSize, borderPixel, logger);
28+ logger.info("start");
2829 this.ip.computeLR(this.baseSize.x , this.baseSize.y);
30+ logger.info("end");
2931 }
3032
3133 @Override
--- a/src/nekora/cwn/paper/PaperFormException.java
+++ b/src/nekora/cwn/paper/PaperFormException.java
@@ -3,6 +3,7 @@ package nekora.cwn.paper;
33 import java.io.File;
44
55 public class PaperFormException extends Exception {
6+ private static final long serialVersionUID = 429826601647993344L;
67 String filename;
78 int dpi;
89 String tag;