Beispiel #1
0
	def getodprc(self):
		result = glprc.odprc()
		result.name, result.gsyn = self.name, self.gsyn
		for item in  self.data.items():
			result.data.append( [float(item[1][0]),[],[] ] )
			returlt.data[-1][1] = map( float, item[1][1])
			returlt.data[-1][2] = map( float, item[1][2])
		result.data.sort()
		return result
Beispiel #2
0
	def getglprc(self):
		result = glprc.odprc()
		result.name, result.gsyn = self.name, self.gsyn
		result.data = []
		for item in  self.data.items():
			result.data.append( [item[0],item[1][0],item[1][1]] )
		result.data.sort()
		#print result.data
		if result.data[0][2] != []:
			result.f2 = True
		return result
Beispiel #3
0
	def preview(self):
		if self.prc == None: return
		sprc = self.glprc.getdata(self.prc.currentText().toUtf8().data())
		dprc = glprc.odprc()
		dprc.name = sprc.name
		dprc.gsyn = [ float(syn) for syn in sprc.gsyn]
		dprc.f2 = sprc.f2
		for data in sprc.data:
			dprc.data.append([ float(data[0]), [float(d1) for d1 in data[1] ], [float(d2) for d2 in data[2] ] ])
		viwer = prcviewdlg(dprc,self.sdedit.value(),parent=self)
		viwer.exec_()
Beispiel #4
0
	def preview(self):
		if self.prclst == None: return
		item = self.mainwnd.tree.currentItem()
		if item.data(1,QtCore.Qt.UserRole) != self.object: return
		prcid, ok = item.data(2,QtCore.Qt.UserRole).toInt()
		if not ok: return
		sprc = self.parent.glprc.getdata(self.prclst[prcid].prc)
		dprc = glprc.odprc()
		dprc.name = sprc.name
		dprc.gsyn = [ float(syn) for syn in sprc.gsyn]
		dprc.f2 = sprc.f2
		for data in sprc.data:
			dprc.data.append([ float(data[0]), [float(d1) for d1 in data[1] ], [float(d2) for d2 in data[2] ] ])
		viwer = prcviewdlg(dprc,self.prclst[prcid].sd,parent=self)
		viwer.exec_()
Beispiel #5
0
	def startElement(self, name, attr):
		if name =="prc":
			if self.prcfl: return
			if self.mode == "list" and attr.get("name", 0):
				self.prclst.append(attr["name"])
				return
			if attr.get("name", 0) == 0 or self.name == None or attr["name"] != self.name:
				return
			self.prcfl = True
			self.prc = glprc.odprc()
			self.prc.name = attr["name"]
			self.prc.gsyn = attr["gsyn"]
			return
		if name == "item" and self.prcfl:
			if not attr.get("ph",0): return
			if not attr.get("prc1",0): return
			if attr.get("prc2",0):
				self.prc.data.append([attr["ph"], str.split(attr["prc1"],','), str.split(attr["prc2"],',') ] )
				self.prc.f1 = True
			else:
				self.prc.data.append([attr["ph"], str.split(attr["prc1"],','), [] ] )
				self.prc.f2 = False