Selaa lähdekoodia

Avoid printing the outputs table if there are no outputs

Baglio Tabifata 4 vuotta sitten
vanhempi
commit
d3a15265a7
1 muutettua tiedostoa jossa 11 lisäystä ja 7 poistoa
  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() {
         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 {