コード例 #1
0
    def __init__(self, source, sink):
        Drawable.__init__(self)

        self._sink = sink
        self._source = source

        return
コード例 #2
0
ファイル: Graph.py プロジェクト: zliu72/Combustion
    def __init__(self, name):
        Drawable.__init__(self)

        self._graph = ""
        self._nodes = []
        self._edges = []
        self._id = name

        return
コード例 #3
0
	def __init__(self, pos=[0,0], col=(0,0,0)):
		super(Moveable, self).__init__(pos, col, layer=1)
		Updateable.__init__(self)
		self.move_limit = 1 # Total distance moveable can travel in a single update.
		self.move_count = 0 # Total distance moveable has moved in this update

		if(self.collides()[0]):
			raise Exception("Don't stack the boxes, this is a 2D game! Collision at: " + str(self.position))
			Drawable.delete(self)
		else:
			Moveable.moveables[tuple(pos)] = self
コード例 #4
0
    def __init__(self, error_msg = None, desc = {}, job_id = None, job_date = None):
        Resultable.__init__(self)
        Drawable.__init__(self)

        if error_msg is not None:
            self.error_message = error_msg
            self.set_title("Error-Result: %s" % error_msg)
        else:
            self.error_message = error_msg
        self.description = desc
        self.job_id = job_id
        self.job_date = job_date
コード例 #5
0
    def __init__(self, x = None, y = None, desc = None, job_id = None, job_date = None):
        Resultable.__init__(self)
        Drawable.__init__(self)
     

        if (x is None) and (y is None) and (desc is None) and (job_id is None) and (job_date is None):
            pass

        elif (x is not None) and (y is not None) and (desc is not None) and (job_id is not None) and (job_date is not None):
            pass

        else:
            raise ValueError("Wrong usage of __init__!")
コード例 #6
0
    def __init__(self, x=None, y=None, y_2=None, n=None, index=None, sampl_freq=None, error=False):
        Errorable.__init__(self)
        Drawable.__init__(self)

        # Title of this accumulation (plotted in GUI -> look Drawable)
        self.__title_pattern = "Accumulation: n = %d"

        # Axis-Labels (inherited from Drawable)
        self.xlabel = "Time (s)"
        self.ylabel = "Avg. Samples [Digits]"
        self.lock = threading.RLock()

        self.common_descriptions = None
        self.time_period = []

        self.use_error = error

        if self.uses_statistics():
            if y_2 is not None:
                self.y_square = y_2
            elif y_2 is None:
                self.y_square = []
            else:
                raise ValueError("Wrong usage of __init__!")

        if (x is None) and (y is None) and (index is None) and (sampl_freq is None) and (n is None):
            self.sampling_rate = 0

            self.n = 0
            self.set_title(self.__title_pattern % self.n)

            self.cont_data = False
            self.index = []
            self.x = []
            self.y = []

        elif (
            (x is not None) and (y is not None) and (index is not None) and (sampl_freq is not None) and (n is not None)
        ):
            self.x = x
            self.y = y
            self.sampling_rate = sampl_freq

            self.n = n
            self.set_title(self.__title_pattern % self.n)

            self.index = index
            self.cont_data = True

        else:
            raise ValueError("Wrong usage of __init__!")
コード例 #7
0
	def __init__(self, pos, instruction="(1,,w->2/a->3/s->4/d->5)(2,w,)(3,a,)(4,s,)(5,d,)", current_instruction=0, recursion=0):

		super(Program_Visualiser, self).__init__(instruction)
		Drawable.__init__(self, pos, (120, 10, 120), 1)

		Program_Visualiser.total_visualisers += 1

		self.recursion = recursion + 1
		self.children = []
		self.sensor_val = [0000]
		self.sensor_combination(0)

		if current_instruction:
			self.current_instruction = current_instruction.copy()
		else:
			super(Program_Visualiser, self).set_instruction(instruction)

		print("\nNew Program Visualiser\nPosition: " + str(pos) + "\nInstruction: " + instruction +  "\nCurrent Instruction: " + str(self.current_instruction) + "\nRecursion Level: " + str(recursion) + "\nTotal Visualisers: " + str(Program_Visualiser.total_visualisers)) if visualiser_debug else 0
		
		if recursion < Program_Visualiser.max_recursion:
			self.run()
コード例 #8
0
    def __init__(self, x = None, y = None, index = None, sampl_freq = None, desc = None, job_id = None, job_date = None):
        Resultable.__init__(self)
        Drawable.__init__(self)
     
        # Title of this accumulation: set Values: Job-ID and Description (plotted in GUI -> look Drawable)
        # Is set in ResultReader.py (or in copy-construktor)
        self.__title_pattern = "ADC-Result: job_id = %s, desc = %s"
        
        # Axis-Labels (inherited from Drawable)
        self.xlabel = "Time (s)"
        self.ylabel = "Samples [Digits]"
        self.lock=threading.RLock()
        self.nChannels = 0

        if (x is None) and (y is None) and (index is None) and (sampl_freq is None) and (desc is None) and (job_id is None) and (job_date is None):
            self.cont_data = False
            self.sampling_rate = 0
            self.index = []
            self.x = []
            self.y = []

        elif (x is not None) and (y is not None) and (index is not None) and (sampl_freq is not None) and (desc is not None) and (job_id is not None) and (job_date is not None):
            self.x = x
            self.y = y
            self.index = index
            self.sampling_rate = sampl_freq
            self.cont_data = True
            self.description = desc
            self.job_id = job_id
            self.job_date = job_date
            title="ADC-Result: job-id=%d"%int(self.job_id)
            if len(self.description)>0:
                for k,v in self.description.iteritems():
                    # string keys can be made invisible by adding two underscores in front of them
                    if not (type(k) in types.StringTypes and k[0] == '_' and k[1] == '_'):
                        title+=", %s=%s"%(k,v)
            self.set_title(title)

        else:
            raise ValueError("Wrong usage of __init__!")
コード例 #9
0
    def __init__(self, x = None, y = None, index = None, sampl_freq = None, desc = None, job_id = None, job_date = None):
        Resultable.__init__(self)
        Drawable.__init__(self)
     
        # Title of this accumulation: set Values: Job-ID and Description (plotted in GUI -> look Drawable)
        # Is set in ResultReader.py (or in copy-construktor)
        self.__title_pattern = "ADC-Result: job_id = %s, desc = %s"
        
        # Axis-Labels (inherited from Drawable)
        self.xlabel = "Time (s)"
        self.ylabel = "Samples [Digits]"


        if (x is None) and (y is None) and (index is None) and (sampl_freq is None) and (desc is None) and (job_id is None) and (job_date is None):
            self.cont_data = False
            self.sampling_rate = 0
            self.index = []
            self.x = []
            self.y = []

        elif (x is not None) and (y is not None) and (index is not None) and (sampl_freq is not None) and (desc is not None) and (job_id is not None) and (job_date is not None):
            self.x = x
            self.y = y
            self.index = index
            self.sampling_rate = sampl_freq
            self.cont_data = True
            self.description = desc
            self.job_id = job_id
            self.job_date = job_date
            title="ADC-Result: job-id = %d"%int(self.job_id)
            if len(self.description)>0:
                for k,v in self.description.iteritems():
                    title+=", %s=%s"%(k,v)
            self.set_title(title)

        else:
            raise ValueError("Wrong usage of __init__!")
コード例 #10
0
	def delete(self):
		Drawable.delete(self)
		Updateable.delete(self)
		del Programmer.programmers[tuple(self.position)]
コード例 #11
0
	def delete(self):
		Drawable.delete(self)
		Updateable.delete(self)
		del Delivery_Block.delivery_blocks[tuple(self.position)]
コード例 #12
0
ファイル: Node.py プロジェクト: zliu72/Combustion
 def __init__(self, id):
     Drawable.__init__(self)
     self._id = id
     return
コード例 #13
0
	def delete(self):
		print("Program Visualiser deleted at: " + str(self.position) + "  With Children at:") if visualiser_debug else 0
		for c in self.children:
			print("  " + str(c.position)) if visualiser_debug else 0
			c.delete()
		Drawable.delete(self)
コード例 #14
0
	def delete(self):
		Drawable.delete(self)
		Updateable.delete(self)
		del Conveyor.conveyors[tuple(self.position)]
コード例 #15
0
	def delete(self):
		Drawable.delete(self)
		del Moveable.moveables[tuple(self.position)]