NativeLib.xml
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 25 Aug 2017 11:22:08 +0300
changeset 1789 492e2cd6157e
parent 1050 56bef276055e
permissions -rw-r--r--
fix problem when Beremiz is running without matiec installed

set matiec settings only once on first use of ProjectController class and give
user-friendly message on compilation about missing matiec
installation.


Traceback (most recent call last):
File "Beremiz.py", line 197, in <module>
beremiz.Start()
File "Beremiz.py", line 192, in Start
self.CreateApplication()
File "Beremiz.py", line 130, in CreateApplication
self.BackgroundInitialization()
File "Beremiz.py", line 137, in BackgroundInitialization
self.ImportModules()
File "Beremiz.py", line 176, in ImportModules
import BeremizIDE
File
"BeremizIDE.py", line 76, in <module>
from ProjectController import ProjectController, GetAddMenuItems,
MATIEC_ERROR_MODEL, ITEM_CONFNODE
File
"ProjectController.py", line 177, in <module>
iec2c_cfg = Iec2CSettings()
File
"ProjectController.py", line 101, in __init__
self.ieclib_c_path = self.findLibCPath()
File
"ProjectController.py", line 135, in findLibCPath
os.path.join(self.ieclib_path, "C"),
File "/usr/lib/python2.7/posixpath.py", line 70, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.plcopen.org/xml/tc6.xsd"
         xsi:schemaLocation="http://www.plcopen.org/xml/tc6.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <fileHeader companyName="Unknown"
              productName="Unnamed"
              productVersion="1"
              creationDateTime="2013-01-29T14:01:00"/>
  <contentHeader name="Unnamed"
                 modificationDateTime="2013-02-26T15:59:13">
    <coordinateInfo>
      <fbd>
        <scaling x="0" y="0"/>
      </fbd>
      <ld>
        <scaling x="0" y="0"/>
      </ld>
      <sfc>
        <scaling x="0" y="0"/>
      </sfc>
    </coordinateInfo>
  </contentHeader>
  <types>
    <dataTypes>
      <dataType name="LOGLEVEL">
        <baseType>
          <enum>
            <values>
              <value name="CRITICAL"/>
              <value name="WARNING"/>
              <value name="INFO"/>
              <value name="DEBUG"/>
            </values>
          </enum>
        </baseType>
        <initialValue>
          <simpleValue value="INFO"/>
        </initialValue>
      </dataType>
    </dataTypes>
    <pous>
      <pou name="LOGGER" pouType="functionBlock">
        <interface>
          <inputVars>
            <variable name="TRIG">
              <type>
                <BOOL/>
              </type>
            </variable>
            <variable name="MSG">
              <type>
                <string/>
              </type>
            </variable>
            <variable name="LEVEL">
              <type>
                <derived name="LOGLEVEL"/>
              </type>
              <initialValue>
                <simpleValue value="INFO"/>
              </initialValue>
            </variable>
          </inputVars>
          <localVars>
            <variable name="TRIG0">
              <type>
                <BOOL/>
              </type>
            </variable>
          </localVars>
        </interface>
        <body>
          <ST>
<![CDATA[IF TRIG AND NOT TRIG0 THEN
{{
 LogMessage(GetFbVar(LEVEL),(char*)GetFbVar(MSG, .body),GetFbVar(MSG, .len));
}}
END_IF;
TRIG0:=TRIG;
]]>
          </ST>
        </body>
      </pou>
    </pous>
  </types>
  <instances>
    <configurations/>
  </instances>
</project>