Skip to content

Commit

Permalink
Merge pull request #2 from midyukov-anton/alt-integration
Browse files Browse the repository at this point in the history
Изменения необходимые для сборки пакета в дистрибутивы Linux
  • Loading branch information
nucleron authored Jun 29, 2017
2 parents 1d0ec52 + a5b2e9d commit e1d87d1
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yaplcconnectors/YAPLC/YAPLCObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ def __init__(self):
lib_ext = ".so"

TstLib = os.path.dirname(os.path.realpath(__file__)) + "/../../../YaPySerial/bin/libYaPySerial" + lib_ext
if (os.name == 'posix' and not os.path.isfile(TstLib)):
TstLib = "libYaPySerial" + lib_ext

TstRoot = TestRoot()
print "Construct PLC..."
Expand Down
2 changes: 2 additions & 0 deletions yaplcconnectors/YAPLC/YaPySerial.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def __del__(self):
lib_ext = ".so"

TestLib = os.path.dirname(os.path.realpath(__file__)) + "/../../../YaPySerial/bin/libYaPySerial" + lib_ext
if (os.name == 'posix' and not os.path.isfile(TestLib)):
TestLib = "libYaPySerial" + lib_ext

TestSerial = YaPySerial( TestLib )
TestSerial.Open( "COM256", 9600, "8N1", 2 )
Expand Down
2 changes: 2 additions & 0 deletions yaplcconnectors/YAPLC/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ def YAPLC_connector_factory(uri, confnodesroot):
lib_ext = ".so"

YaPySerialLib = os.path.dirname(os.path.realpath(__file__)) + "/../../../YaPySerial/bin/libYaPySerial" + lib_ext
if (os.name == 'posix' and not os.path.isfile(YaPySerialLib)):
YaPySerialLib = "libYaPySerial" + lib_ext

return YAPLCObject(YaPySerialLib,confnodesroot,comportstr)
2 changes: 2 additions & 0 deletions yaplctargets/nuc242/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
target_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(os.path.join(target_dir, ".."), ".."), "..")
plc_rt_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(plc_rt_dir)):
plc_rt_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class nuc242_target(toolchain_yaplc_stm32):
def __init__(self, CTRInstance):
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/nuc243/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
target_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(os.path.join(target_dir, ".."), ".."), "..")
plc_rt_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(plc_rt_dir)):
plc_rt_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class nuc243_target(toolchain_yaplc_stm32):
def __init__(self, CTRInstance):
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/nuc247/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
target_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(os.path.join(target_dir, ".."), ".."), "..")
plc_rt_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(plc_rt_dir)):
plc_rt_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class nuc247_target(toolchain_yaplc_stm32):
def __init__(self, CTRInstance):
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/nuc251/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
target_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(os.path.join(target_dir, ".."), ".."), "..")
plc_rt_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(plc_rt_dir)):
plc_rt_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class nuc251_target(toolchain_yaplc_stm32):
def __init__(self, CTRInstance):
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/toolchain_yaplc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
toolchain_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(toolchain_dir, ".."), "..")
runtime_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(runtime_dir)):
runtime_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class toolchain_yaplc(toolchain_gcc):
def __init__(self, CTRInstance):
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/toolchain_yaplc_stm32.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class toolchain_yaplc_stm32(toolchain_yaplc):
def GetBinaryCode(self):
if os.path.exists(self.exe_path):
yaplc_boot_loader = os.path.join(os.path.join(base_dir, "stm32flash"), "stm32flash")
if (os.name == 'posix' and not os.path.isfile(yaplc_boot_loader)):
yaplc_boot_loader = "stm32flash"
command = [yaplc_boot_loader, "-w", self.exe_path + ".hex", "-v", "-g", "0x0", "-S", self.load_addr, "%(serial_port)s"]
return command
else:
Expand Down
2 changes: 2 additions & 0 deletions yaplctargets/yaplc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
target_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(os.path.join(os.path.join(target_dir, ".."), ".."), "..")
plc_rt_dir = os.path.join(os.path.join(base_dir, "RTE"), "src")
if (os.name == 'posix' and not os.path.isfile(plc_rt_dir)):
plc_rt_dir = os.environ["HOME"]+"/YAPLC/RTE/src"

class yaplc_target(toolchain_yaplc_stm32):
def __init__(self, CTRInstance):
Expand Down

0 comments on commit e1d87d1

Please sign in to comment.