Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Изменения необходимые для сборки пакета в дистрибутивы Linux #2

Merged
merged 1 commit into from
Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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