Forcing pythonInterp version to be the same that pythonLibs version

This commit is contained in:
Cedric Boudinet 2017-02-13 22:37:34 +01:00
parent 9dc1a36568
commit 8432ea8a13
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
FIND_PACKAGE(SWIG REQUIRED) FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE}) INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(PythonLibs REQUIRED) FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE ( PythonInterp REQUIRED ) FIND_PACKAGE ( PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED )
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "") SET(CMAKE_SWIG_FLAGS "")

View file

@ -55,20 +55,20 @@ def testClient():
theVal = "testmodelSENSORS/TTMP1.TmpSp.setMag.f" theVal = "testmodelSENSORS/TTMP1.TmpSp.setMag.f"
theValType = iec61850.IEC61850_FC_SP theValType = iec61850.IEC61850_FC_SP
temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType)
print temperatureSetpoint print(temperatureSetpoint)
assert(temperatureValue[1]==0) assert(temperatureValue[1]==0)
newValue= temperatureValue[0]+10 newValue= temperatureValue[0]+10
err = iec61850.IedConnection_writeFloatValue(con, theVal, theValType, newValue) err = iec61850.IedConnection_writeFloatValue(con, theVal, theValType, newValue)
assert(err==0) assert(err==0)
temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType)
print temperatureSetpoint print(temperatureSetpoint)
assert(temperatureSetpoint[0]==newValue) assert(temperatureSetpoint[0]==newValue)
iec61850.IedConnection_close(con) iec61850.IedConnection_close(con)
else: else:
print "Connection error" print("Connection error")
sys.exit(-1) sys.exit(-1)
iec61850.IedConnection_destroy(con) iec61850.IedConnection_destroy(con)
print "client ok" print("client ok")
try: try:
srv=myIECServer() srv=myIECServer()
srvThread = threading.Thread(target = srv.run) srvThread = threading.Thread(target = srv.run)
@ -78,6 +78,6 @@ try:
#signal.pause() #signal.pause()
except: except:
running = 0 running = 0
print "Error :" print("Error :")
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
sys.exit(-1) sys.exit(-1)