# HG changeset patch # User Edouard Tisserant # Date 1434749795 -7200 # Node ID 7df108e8cb18e06dbd10da2ab7b5efaa0be2e064 # Parent 68ba08b3a152ffe7233b69ec49c12de806df31e0# Parent 2b4a0d87becb10a6f632919b744226c3d768ade4 Merged diff -r 2b4a0d87becb -r 7df108e8cb18 runtime/PLCObject.py --- a/runtime/PLCObject.py Fri Jun 19 11:36:35 2015 +0200 +++ b/runtime/PLCObject.py Fri Jun 19 23:36:35 2015 +0200 @@ -142,9 +142,9 @@ self._PLClibraryHandle = dlopen(self._GetLibFileName()) self.PLClibraryHandle = ctypes.CDLL(self.CurrentPLCFilename, handle=self._PLClibraryHandle) - self.PLCID = ctypes.c_char_p.in_dll(self.PLClibraryHandle, "PLCID") + self.PLC_ID = ctypes.c_char_p.in_dll(self.PLClibraryHandle, "PLC_ID") if len(md5) == 32 : - self.PLCID.value = md5 + self.PLC_ID.value = md5 self._startPLC = self.PLClibraryHandle.startPLC self._startPLC.restype = ctypes.c_int diff -r 2b4a0d87becb -r 7df108e8cb18 targets/Win32/plc_Win32_main.c --- a/targets/Win32/plc_Win32_main.c Fri Jun 19 11:36:35 2015 +0200 +++ b/targets/Win32/plc_Win32_main.c Fri Jun 19 23:36:35 2015 +0200 @@ -76,8 +76,6 @@ BOOL tmp; setlocale(LC_NUMERIC, "C"); - InitializeCriticalSection(&Atomic64CS); - debug_sem = CreateSemaphore( NULL, // default security attributes 1, // initial count @@ -170,7 +168,6 @@ CloseHandle(PLC_timer); WaitForSingleObject(PLC_thread, INFINITE); __cleanup(); - DeleteCriticalSection(&Atomic64CS); CloseHandle(debug_wait_sem); CloseHandle(debug_sem); CloseHandle(python_wait_sem); @@ -279,3 +276,16 @@ { } +static void __attribute__((constructor)) +beremiz_dll_init(void) +{ + InitializeCriticalSection(&Atomic64CS); + +} + +static void __attribute__((destructor)) +beremiz_dll_destroy(void) +{ + DeleteCriticalSection(&Atomic64CS); +} + diff -r 2b4a0d87becb -r 7df108e8cb18 targets/plc_main_head.c --- a/targets/plc_main_head.c Fri Jun 19 11:36:35 2015 +0200 +++ b/targets/plc_main_head.c Fri Jun 19 23:36:35 2015 +0200 @@ -25,7 +25,7 @@ IEC_TIME __CURRENT_TIME; IEC_BOOL __DEBUG = 0; unsigned long __tick = 0; -char *PLCID = NULL; +char *PLC_ID = NULL; /* * Variable generated by C softPLC and plugins diff -r 2b4a0d87becb -r 7df108e8cb18 tests/python/c_code@c_ext/cfile.xml --- a/tests/python/c_code@c_ext/cfile.xml Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/python/c_code@c_ext/cfile.xml Fri Jun 19 23:36:35 2015 +0200 @@ -14,7 +14,7 @@ volatile char PtoC=1,CtoP=2; extern long AtomicCompareExchange(long*,long, long); -extern char *PLCID; +extern char *PLC_ID; int Simple_C_Call(int val){ return val+1; @@ -35,7 +35,7 @@ res=1; } printf("C code called by Python: toC %d fromC %d\n",toC,*fromC); - printf("PLCID id %s\n",PLCID); + printf("PLC_ID id %s\n",PLC_ID); return res; } diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxGlade/HMIFrame@wxglade_hmi/py_ext.xml --- a/tests/wxGlade/HMIFrame@wxglade_hmi/py_ext.xml Fri Jun 19 11:36:35 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - - diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxGlade/HMIFrame@wxglade_hmi/pyfile.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/wxGlade/HMIFrame@wxglade_hmi/pyfile.xml Fri Jun 19 23:36:35 2015 +0200 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/HMI@wxglade_hmi/baseconfnode.xml --- a/tests/wxHMI/HMI@wxglade_hmi/baseconfnode.xml Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/wxHMI/HMI@wxglade_hmi/baseconfnode.xml Fri Jun 19 23:36:35 2015 +0200 @@ -1,2 +1,2 @@ - - + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/HMI@wxglade_hmi/hmi.wxg --- a/tests/wxHMI/HMI@wxglade_hmi/hmi.wxg Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/wxHMI/HMI@wxglade_hmi/hmi.wxg Fri Jun 19 23:36:35 2015 +0200 @@ -1,72 +1,99 @@ - - - - - - - frame_1 - - 0 - 0 - 1 - 0 - 2 - 0 - - wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL - 0 - - - - $parent - $id - - 400,400 - - - - wxEXPAND - 0 - - - 0 - 0 - 2 - 1 - 0 - - wxEXPAND - 0 - - - wxVERTICAL - - - - - - - - wxEXPAND - 0 - - - 0 - 4 - 2 - 0 - - - - - - - - - - - - - - - + + + + + + + frame_1 + + 0 + 0 + 1 + 0 + 4 + 0 + + wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL + 0 + + + # WHERE IS THAT ?\nprint "hello"\n + + $parent + $id + + 400,400 + + + + wxEXPAND + 0 + + + 0 + 0 + 2 + 1 + 0 + + wxEXPAND + 0 + + + wxVERTICAL + + + + + + + + wxEXPAND + 0 + + + 0 + 4 + 2 + 0 + + + + + + + + + + + + + + 0 + + + + + SetPLCGlobalVar + + + "DrawTest" + + + + + 0 + + + + + SetPLCGlobalVar + + + "DrawEscher" + + + + + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/HMI@wxglade_hmi/pyfile.xml --- a/tests/wxHMI/HMI@wxglade_hmi/pyfile.xml Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/wxHMI/HMI@wxglade_hmi/pyfile.xml Fri Jun 19 23:36:35 2015 +0200 @@ -1,138 +1,134 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/beremiz.xml --- a/tests/wxHMI/beremiz.xml Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/wxHMI/beremiz.xml Fri Jun 19 23:36:35 2015 +0200 @@ -1,5 +1,5 @@ - - - - - + + + + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/plc.xml --- a/tests/wxHMI/plc.xml Fri Jun 19 11:36:35 2015 +0200 +++ b/tests/wxHMI/plc.xml Fri Jun 19 23:36:35 2015 +0200 @@ -1,410 +1,592 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Power_ON - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Power_OFF - - - - - - - - - - - - - power - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - XaxisPos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tmp - - - - - - - 1 - - - - - - - tmp - - - - - - - - - - - - - YaxisPos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - power - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LocalVar0 - - - - - - - - - - - - - LocalVar1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Power_ON + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Power_OFF + + + + + + + + + + + + + power + + + + + + + DrawTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ZaxisPos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + XaxisPos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tmp + + + + + + + 1 + + + + + + + tmp + + + + + + + + + + + + + YaxisPos + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + power + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BOOL#TRUE + + + + + + + 'wxglade_hmi.UpdPos()' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LocalVar0 + + + + + + + + + + + + + LocalVar1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/Detect_Circle.png Binary file tests/wxHMI/project_files/Detect_Circle.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/DrawEscher.png Binary file tests/wxHMI/project_files/DrawEscher.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/DrawLogo.png Binary file tests/wxHMI/project_files/DrawLogo.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/DrawTest.png Binary file tests/wxHMI/project_files/DrawTest.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/Power_OFF.png Binary file tests/wxHMI/project_files/Power_OFF.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/Power_ON.png Binary file tests/wxHMI/project_files/Power_ON.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/TaxisMinus.png Binary file tests/wxHMI/project_files/TaxisMinus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/TaxisPlus.png Binary file tests/wxHMI/project_files/TaxisPlus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/XaxisMinus.png Binary file tests/wxHMI/project_files/XaxisMinus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/XaxisPlus.png Binary file tests/wxHMI/project_files/XaxisPlus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/YaxisMinus.png Binary file tests/wxHMI/project_files/YaxisMinus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/YaxisPlus.png Binary file tests/wxHMI/project_files/YaxisPlus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/ZaxisMinus.png Binary file tests/wxHMI/project_files/ZaxisMinus.png has changed diff -r 2b4a0d87becb -r 7df108e8cb18 tests/wxHMI/project_files/ZaxisPlus.png Binary file tests/wxHMI/project_files/ZaxisPlus.png has changed