targets/Xenomai/__init__.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 18 Apr 2016 19:15:55 +0300
changeset 1481 5b294dcaae18
parent 1323 a2b1af39385c
child 1511 91538d0c242c
permissions -rwxr-xr-x
fix issue, then it wasn't possible to view FBD programs

the reason for that is possible wx-3.0-gtk2 bug that happens if
ALWAYS_SHOW_SB is set.

Traceback (most recent call last):
File "Beremiz.py", line 1045, in OnProjectTreeItemActivated
IDEFrame.OnProjectTreeItemActivated(self, event)
File "IDEFrame.py", line 1667, in OnProjectTreeItemActivated
self.EditProjectElement(item_infos["type"], item_infos["tagname"])
File "IDEFrame.py", line 1752, in EditProjectElement
new_window = Viewer(self.TabsOpened, tagname, self, self.Controler)
File "editors/Viewer.py", line 611, in __init__
EditorPanel.__init__(self, parent, tagname, window, controler, debug)
File "editors/EditorPanel.py", line 68, in __init__
self._init_ctrls(parent)
File "editors/EditorPanel.py", line 52, in _init_ctrls
self._init_Editor(self)
File "editors/Viewer.py", line 603, in _init_Editor
style=wx.HSCROLL | wx.VSCROLL | wx.ALWAYS_SHOW_SB)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_windows.py", line 296, in __init__
_windows_.ScrolledWindow_swiginit(self,_windows_.new_ScrolledWindow(*args, **kwargs))
PyAssertionError: C++ assertion "scrolled" failed at ../src/gtk/scrolwin.cpp(205) in DoShowScrollbars(): window must be created
642
cd7ccbbbf471 various cleanups in /targets
Edouard Tisserant
parents: 635
diff changeset
     1
from ..toolchain_gcc import toolchain_gcc
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     2
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     3
class Xenomai_target(toolchain_gcc):
1279
0eb9f8af479f Added 'dlopen_prefix' class attributes to targets, in order to handle dlopen of shared object passed to runtime as extra file, and then in PWD (was working with windows only)
Edouard Tisserant
parents: 726
diff changeset
     4
    dlopen_prefix = "./"
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     5
    extension = ".so"
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
     6
    def getXenoConfig(self, flagsname):
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
     7
        """ Get xeno-config from target parameters """
1323
a2b1af39385c Fixed Xenomai target according to new xmlclass
Laurent Bessard
parents: 1279
diff changeset
     8
        xeno_config=self.CTRInstance.GetTarget().getcontent().getXenoConfig()
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
     9
        if xeno_config:
726
ae63ccc29444 refactoring
Edouard Tisserant
parents: 725
diff changeset
    10
            from util.ProcessLogger import ProcessLogger
725
31dade089db5 refactoring
Edouard Tisserant
parents: 722
diff changeset
    11
            status, result, err_result = ProcessLogger(self.CTRInstance.logger,
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    12
                                                       xeno_config + " --skin=native --"+flagsname,
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    13
                                                       no_stdout=True).spin()
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    14
            if status:
725
31dade089db5 refactoring
Edouard Tisserant
parents: 722
diff changeset
    15
                self.CTRInstance.logger.write_error(_("Unable to get Xenomai's %s \n")%flagsname)
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    16
            return [result.strip()]
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    17
        return []
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    18
    
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    19
    def getBuilderLDFLAGS(self):
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    20
        xeno_ldflags = self.getXenoConfig("ldflags")
634
5b925a1d8fed fixed redondant ldflag and a typo in xenomai build
Edouard Tisserant
parents: 633
diff changeset
    21
        return toolchain_gcc.getBuilderLDFLAGS(self) + xeno_ldflags + ["-shared"]
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    22
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    23
    def getBuilderCFLAGS(self):
633
70c84e6ff92c Xenomai build now ignores xeno-config if not set
Edouard Tisserant
parents: 615
diff changeset
    24
        xeno_cflags = self.getXenoConfig("cflags")
635
fcdb60cacb2c added -fPIC to satisfy X86_64 build
Edouard Tisserant
parents: 634
diff changeset
    25
        return toolchain_gcc.getBuilderCFLAGS(self) + xeno_cflags + ["-fPIC"]
321
5a4e6278a18b Adding support for Xenomai targets.
lbessard
parents: 203
diff changeset
    26