# HG changeset patch
# User laurent
# Date 1332885935 -7200
# Node ID 6880c88e499e2173ef26839bdcb86b80d9c230e8
# Parent  64a9b509973b832f34bf75cec91cb0c8087573d7
Fix bug in debugger when transfer without having build before and and opening debug view before running PLC

diff -r 64a9b509973b -r 6880c88e499e plugger.py
--- a/plugger.py	Wed Mar 28 00:05:15 2012 +0200
+++ b/plugger.py	Wed Mar 28 00:05:35 2012 +0200
@@ -1547,7 +1547,7 @@
         for infos, (start_row, start_col) in chunk_infos:
             start = (from_location[0] - start_row, from_location[1] - start_col)
             end = (to_location[0] - start_row, to_location[1] - start_col)
-            print from_location, to_location, start_row, start_col, start, end
+            #print from_location, to_location, start_row, start_col, start, end
             if self.AppFrame is not None:
                 self.AppFrame.ShowError(infos, start, end)
 
@@ -1986,7 +1986,7 @@
         if builder is not None:
             data = builder.GetBinaryCode()
             if data is not None :
-                if self._connector.NewPLC(MD5, data, extrafiles):
+                if self._connector.NewPLC(MD5, data, extrafiles) and self.GetIECProgramsAndVariables():
                     self.UnsubscribeAllDebugIECVariable()
                     self.ProgramTransferred()
                     if self.AppFrame is not None: