Commit 511d78c8 authored by Yori Fournier's avatar Yori Fournier
Browse files

Correct to the new naming system

parent 9467f942
Pipeline #497 failed with stage
in 5 minutes and 43 seconds
......@@ -116,6 +116,8 @@ if D_HIERARCHY in ('CLIENT', 'client'):
# MplAxes: Overlay on matplotlib.Axes class
from .mpl_axes_client import MplAxesClient as MplAxes
from .mpl_grid import Grid, VerticalGrid, HorizontalGrid
# MplFig: Overlay on matplotlib.Figure class
from .mpl_fig_client import MplFigClient as MplFig
......@@ -128,6 +130,8 @@ elif(D_HIERARCHY in ('SERVER', 'server')):
# MplAxes: Overlay on matplotlib.Axes class
from .mpl_axes_server import MplAxesServer as MplAxes
from .mpl_grid import Grid, VerticalGrid, HorizontalGrid
# MplFig: Overlay on matplotlib.Figure class
from .mpl_fig_server import MplFigServer as MplFig
......
......@@ -50,7 +50,7 @@ from . import rcParams
# Class MyAxes Overwriting Matplotlib.figure.Axes
class MyAxesClient(Axes):
class MplAxesClient(Axes):
# CONSTRUCTOR --------------------------------------------------------
def __init__(self, fig, ratio, frame_rect, *args, **kwargs):
......
......@@ -47,7 +47,7 @@ from . import SEVR, DBUG
# Class MyAxes Overwriting Matplotlib.figure.Axes
class MyAxesServer(object):
class MplAxesServer(object):
# CONSTRUCTOR --------------------------------------------------------
def __init__(self, fig, ratio, frame_rect, *args, **kwargs):
......
......@@ -3,21 +3,20 @@ import pickle
from . import Query, Status, Answer, Signal
from . import DBUG, WARN, SPCE, SEVR, INFO
from . import MplUnpickler
# from . import MyData
from . import D_DEBUG
debug = D_DEBUG
class MplClient2():
class MplClient():
def __init__(self):
self.host, self.port = (None, None)
# just a list of names
self.currentRemoteData = []
self.current_remotedata = []
def connect(self, con):
......@@ -175,7 +174,7 @@ class MplClient2():
if not status:
print('something went wrong with the '
'sending of readData request...')
answer = self.waitForSignal()
answer = self.wait_for_signal()
self.disconnect()
......@@ -260,7 +259,7 @@ class MplClient2():
query = Query(Query.DELETESYNCFIGURE, sync_id)
status = self.send(query)
status_sig = self.waitForSignal()
status_sig = self.wait_for_signal()
self.disconnect()
......@@ -287,7 +286,7 @@ class MplClient2():
if not status:
print(INFO + 'Sent Signal')
formated_data = self.waitForSignal()
formated_data = self.wait_for_signal()
self.disconnect()
......
......@@ -78,7 +78,7 @@ from . import HorizontalGrid
# Class MyFig Overwriting Matplotlib.figure.Figure
class MyFigClient(Figure):
class MplFigClient(Figure):
# Set the size of the Figure in inch
# (private variable can not be updated)
......@@ -116,7 +116,7 @@ class MyFigClient(Figure):
def de_sync_fig(self):
if self.client is not None:
if self.client.deleteSyncFigure(self.sync_id):
if self.client.delete_sync_figure(self.sync_id):
print('The figure was successfully deleted on the server Side')
self.sync_id = -1
else:
......@@ -138,8 +138,8 @@ class MyFigClient(Figure):
# find aliases for this specific axes
masks = dict()
for alias in self.aliases.keys():
axes4alias, keyword = self.aliases[alias]
if axes4alias == ax:
axes_for_alias, keyword = self.aliases[alias]
if axes_for_alias == ax:
masks.update({keyword: alias})
# collect all keywords of the axes and replace the keys with the
......@@ -170,12 +170,12 @@ class MyFigClient(Figure):
state = self.get_state()
# call the client to create a new figure on the server side
newFig = self.client.new_sync_figure(
new_fig = self.client.new_sync_figure(
self.__class__, self.remote_rawdata, **state)
# since the state matches the current instance. only the new sync_id
# is kept.
self.sync_id = newFig.sync_id
self.sync_id = new_fig.sync_id
else:
print(
'The client is not connected to a server yet. Please use the client to set up a sync conection.')
......@@ -292,13 +292,6 @@ class MyFigClient(Figure):
print(SEVR + "The axes name ", name, " was not found")
return None
#~ def getAxesName(self,unknownax) :
#~ """ compares all axes against the function parameter and returns the name of that axes if found in figure"""
#~
#~ for ax in self.get_axes() :
#~ 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.
......
......@@ -72,11 +72,10 @@ from . import D_FIGSIZE, D_INPUTARG, D_DEBUG, D_REFORMAT, D_FORMATTED
from . import D_OFORMAT, D_OPATH
from . import DBUG, SEVR, INFO, SPCE, WARN
from . import MplData
#from . import MyAxes_server
# Class MyFig Overwriting Matplotlib.figure.Figure
class MyFigServer(object):
class MplFigServer(object):
# Set the size of the Figure in inch
# (private variable can not be updated)
......@@ -107,7 +106,7 @@ class MyFigServer(object):
self.set_rawdata(rawdata)
# count the global counter up by one
MyFigServer.G_FIGNUM += 1
MplFigServer.G_FIGNUM += 1
# INITIALIZE -------------------------------------------------------
def _initialize(self, *args, **kwargs):
......
......@@ -7,7 +7,7 @@ from . import Signal, Status, Query, Answer
from . import SERVER_IOFUNCTIONS
from . import SERVER_FIGURES
from . import MyFig
from . import MplFig
from . import DBUG, WARN, SPCE, SEVR, INFO
from . import MplUnpickler
......@@ -242,7 +242,7 @@ class MplHandler(SocketServer.StreamRequestHandler):
self.rfile.close()
class MplServer2(SocketServer.TCPServer):
class MplServer(SocketServer.TCPServer):
allow_reuse_address = True
......
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