瀏覽代碼

Avoid printing the outputs table if there are no outputs

Baglio Tabifata 4 年之前
父節點
當前提交
d3a15265a7
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11 7
      src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

+ 11 - 7
src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java

@@ -123,13 +123,17 @@ public class DuPALAnalyzer {
     private void printTables() {
     private void printTables() {
         FileOutputStream fout = null;
         FileOutputStream fout = null;
         
         
-        try {
-            fout = new FileOutputStream(tblPath_out);
-            printLogicTableOUTPUTS(fout, pspecs, additionalOUTs, IOasOUT_Mask, mStates);
-            fout.close();
-        } catch(IOException e) {
-            logger.error("Error printing out the outputs table.");
-            e.printStackTrace();
+        if(additionalOUTs >= 0) {
+            try {
+                fout = new FileOutputStream(tblPath_out);
+                printLogicTableOUTPUTS(fout, pspecs, additionalOUTs, IOasOUT_Mask, mStates);
+                fout.close();
+            } catch(IOException e) {
+                logger.error("Error printing out the outputs table.");
+                e.printStackTrace();
+            }
+        } else {
+            logger.warn("We have 0 outputs, will not print the OUTPUTs table.");
         }
         }
         
         
         try {
         try {