editors/IECCodeViewer.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 18 Apr 2016 18:59:11 +0300
changeset 1479 8f41aa88aa46
parent 1262 7b9259945453
child 1511 91538d0c242c
permissions -rw-r--r--
fix many compilation warnings about static variables used by non-static functions

[CC] plc_main.c -> plc_main.o
/tmp/be/build/plc_main.c:396:40: warning: ?LogBuff? is static but used in inline function ?copy_from_log? which is not static
memcpy((char*)buf + remaining, LogBuff[level], size - remaining);
^
/tmp/be/build/plc_main.c:395:22: warning: ?LogBuff? is static but used in inline function ?copy_from_log? which is not static
memcpy(buf, &LogBuff[level][buffpos], remaining);
^
...

^
/tmp/be/build/plc_debugger.c:825:20: warning: ?retain_offset? is static but used in inline function ?BufferIterator? which is not static
Retain(retain_offset, size, real_value_p);
^
/tmp/be/build/plc_debugger.c:823:47: warning: ?retain_offset? is static but used in inline function ?BufferIterator? which is not static
unsigned int next_retain_offset = retain_offset + size;
^
^
815
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     1
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     2
from editors.TextViewer import TextViewer
1057
3837e165b3f9 Added support for search in PythonEditor and IECCodeViewer
Laurent Bessard
parents: 815
diff changeset
     3
from plcopen.plcopen import TestTextElement
815
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     4
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     5
class IECCodeViewer(TextViewer):
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     6
    
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     7
    def __del__(self):
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     8
        TextViewer.__del__(self)
e4f24593a758 Adding support for extending internationalization to extensions
laurent
parents:
diff changeset
     9
        if getattr(self, "_OnClose"):
1057
3837e165b3f9 Added support for search in PythonEditor and IECCodeViewer
Laurent Bessard
parents: 815
diff changeset
    10
            self._OnClose(self)
1262
7b9259945453 Fixed bug with Copy/Paste in generated ST code Viewer
Laurent Bessard
parents: 1057
diff changeset
    11
    
7b9259945453 Fixed bug with Copy/Paste in generated ST code Viewer
Laurent Bessard
parents: 1057
diff changeset
    12
    def Paste(self):
7b9259945453 Fixed bug with Copy/Paste in generated ST code Viewer
Laurent Bessard
parents: 1057
diff changeset
    13
        if self.Controler is not None:
7b9259945453 Fixed bug with Copy/Paste in generated ST code Viewer
Laurent Bessard
parents: 1057
diff changeset
    14
            TextViewer.Paste(self)
7b9259945453 Fixed bug with Copy/Paste in generated ST code Viewer
Laurent Bessard
parents: 1057
diff changeset
    15
    
1057
3837e165b3f9 Added support for search in PythonEditor and IECCodeViewer
Laurent Bessard
parents: 815
diff changeset
    16
    def Search(self, criteria):
3837e165b3f9 Added support for search in PythonEditor and IECCodeViewer
Laurent Bessard
parents: 815
diff changeset
    17
        return [((self.TagName, "body", 0),) + result for result in TestTextElement(self.Editor.GetText(), criteria)]