Commit 6cbe381f authored by Philipp Gast's avatar Philipp Gast
Browse files

the names of remote datasets are now recorded in the variable remote_rawdata...

the names of remote datasets are now recorded in the variable remote_rawdata of a myFig_client instance. Setting is performed via a set_rawdata() function similar to a local figure. No consistancy checking is implemented yet...
parent 8612e796
Pipeline #445 passed with stage
in 3 minutes and 4 seconds
......@@ -148,7 +148,7 @@ class MplClient2():
# try to create a figure of the same class on the client side
if isinstance(answer,Answer) :
print('trying to create a figure of the same class on the client side')
fig = figname( MyData(), *args, **kwargs)
fig = figname( dataname, *args, **kwargs)
# Link the temporary Sync Figure
fig.syncID = answer.content
fig.client = self
......
......@@ -83,7 +83,6 @@ class MyFig_client(Figure):
# (private variable can not be updated)
FIGSIZE = D_FIGSIZE
# CONSTRUCTOR --------------------------------------------------------
# CONSTRUCTOR --------------------------------------------------------
def __init__(self, rawdata, *args, **kwargs):
......@@ -110,6 +109,7 @@ class MyFig_client(Figure):
# initialise
self._initialize(*args, **kwargs)
self.set_rawdata(rawdata)
def deSyncFig(self):
if self.client is not None :
......@@ -154,7 +154,7 @@ class MyFig_client(Figure):
return state
def reSyncFig(self,datanames):
def reSyncFig(self):
if self.client is not None :
......@@ -162,7 +162,7 @@ class MyFig_client(Figure):
state = self.getState()
# call the client to create a new figure on the server side
newFig = self.client.newSyncFigure(self.__class__, datanames, **state)
newFig = self.client.newSyncFigure(self.__class__, self.remote_rawdata, **state)
# since the state matches the current instance. only the new syncID is kept.
self.syncID = newFig.syncID
......@@ -285,6 +285,13 @@ class MyFig_client(Figure):
#~ if unknownax == ax :
#~ return ax.name
# SET RAW DATA -----------------------------------------------------
def set_rawdata(self, rawdata):
''' This function sets loacally the names of the remote data in a similar way as a local figure would do.
Warning : No consitancy checking is done. The server side will report the errors.
'''
self.remote_rawdata = rawdata
# FORMAT RAW DATA --------------------------------------------------
def formatRawData(self):
# HEre comes a function that send a signal to the server
......
......@@ -20,7 +20,7 @@ server = mpl_server.MplServer2(port=12345, knownFunctions=SERVER_IOFUNCTIONS, kn
client = mpl_client.MplClient2()
server.run(as_daemon=True)
print "Server loop running in thread:", server.server_thread.name
print("Server loop running in thread:", server.server_thread.name)
client.connect(('localhost', 12345))
print("Client is now connected")
......@@ -45,5 +45,5 @@ sleep(2)
# desync resync test
fig1.deSyncFig()
fig1.reSyncFig(('data1',))
fig1.reSyncFig()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment