Commit ad9d2ded authored by Philipp Gast's avatar Philipp Gast
Browse files

newSyncFigure now accepts the data from the server. The data has still to be...

newSyncFigure now accepts the data from the server. The data has still to be set on client side with syncFigFormatRawData
parent 4ad28a59
......@@ -18,7 +18,7 @@ class MplClient(object):
self.ip = ip
self.port = port
# just a list of names
self.currentRemoteData = []
#~ self.currentRemoteData = []
# PACK SIGNAL ------------------------------------------------------
def packSignal(self, unpackedSignal):
......
......@@ -3,11 +3,11 @@ import pickle
#from .signal import Signal, Status, Answer
#from .signal import Query as Server_Query
from . import Query, Status, Answer, Signal
debug = True
from . import DBUG,WARN,SPCE,SEVR,INFO
from . import MplUnpickler
from . import MyData
debug = True
class MplClient2():
......@@ -118,9 +118,14 @@ class MplClient2():
if not status :
print('something went wrong with the sending of newSincFigure request...')
statusSig = self.waitForSignal()
# try to create a figure of the same class on the client side
if self.testStatusSig(query,statusSig) :
fig = figname(dataname,*args,**kwargs)
print('trying to create a figure of the same class on the client side')
fig = figname((MyData(),),*args,**kwargs)
# Link the temporary Sync Figure
fig.syncID = '26042017'
fig.client = self
return fig
#~ def updateSyncFigure()
......
......@@ -84,8 +84,6 @@ class MplHandler(SocketServer.StreamRequestHandler):
if FigID in G_FIGURES :
return Status(True,"SERVER: I created the requested Figure with following instructions"+str(FigClass.__name__)+str(datas)+'('+str(args)+', '+str(kwargs)+')')
return False #should never get here
def treatUpdateSyncFigure(self,content) :
pass
......
......@@ -30,7 +30,7 @@ class Query(Signal) :
pass
elif queryType == Query.SYNCFIGFORMATRAWDATA :
pass
self.content = content
......
# IMPORT ---------------------------------------------------------------
from .. import D_HIERARCHY
from .. import SEVR, DBUG, INFO
from myplotlib import MyFig
from axTest import AxTest
if D_HIERARCHY in ('SERVER', 'server'):
print(INFO+"Testing the server.")
else:
print(SEVR+"This is atest for the server, the imports are not correct.")
raise ImportError
from .. import MyFig
from . import AxTestServer
class FigTestServer(MyFig):
class FigTest(MyFig):
FIGSIZE = (8., 6.)
......@@ -20,4 +11,4 @@ class FigTestServer(MyFig):
ratio = 6. / 8. # height/width of the axes (in inch)
frame1 = [0.1, 0.1, 0.8, 0.8] # part of the fig that is available
self.add_axes(AxTestServer(self, ratio, frame1), "p1")
self.add_axes(AxTest(self, ratio, frame1), "p1")
from myplotlib import INFO, DBUG, WARN, SEVR, SPCE
......@@ -42,6 +42,7 @@
#
#
# IMPORT ---------------------------------------------------------------
from . import INFO, DBUG, WARN, SEVR, SPCE
from myplotlib import MyAxes
D_XRANGE = None
......
import threading
from serverside.myIOs import readStupidData
from serverside.figTest import FigTest
from serverside.figTest import FigTest as FigTests
from clientside.figTest import FigTest as FigTestc
SERVER_IOFUNCTIONS = {'readStupidData': readStupidData}
SERVER_FIGURES = {'FigTest': FigTest}
SERVER_FIGURES = {'FigTest': FigTests}
import serverside.myplotlib as mpl_server
import clientside.myplotlib as mpl_client
......@@ -22,7 +23,6 @@ print "Server loop running in thread:", server_thread.name
client.connect(('', 50803))
#query = mpl_client.Query(0, None)
#print(query.__class__)
client.readData('readStupidData', 'data1')
fig = client.newSyncFigure(FigTestc, ('data1',))
win=mpl_client.MyWin(fig)
Supports Markdown
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