本文整理汇总了Python中PyMca.QtBlissGraph.QtBlissGraph.delcurve方法的典型用法代码示例。如果您正苦于以下问题:Python QtBlissGraph.delcurve方法的具体用法?Python QtBlissGraph.delcurve怎么用?Python QtBlissGraph.delcurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyMca.QtBlissGraph.QtBlissGraph
的用法示例。
在下文中一共展示了QtBlissGraph.delcurve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LakeshoreBrick
# 需要导入模块: from PyMca.QtBlissGraph import QtBlissGraph [as 别名]
# 或者: from PyMca.QtBlissGraph.QtBlissGraph import delcurve [as 别名]
#.........这里部分代码省略.........
self.data[i]=None
def checkbox_cb(state, channel=i):
if state == QButton.On:
self.data[channel]={ "x":[], "y":[], "t0": None }
else:
self.data[channel]=None
self.channelCheckboxCb[newCheckbox] = checkbox_cb
QObject.connect(newCheckbox, SIGNAL("stateChanged(int)"), checkbox_cb)
newValueDisplayBrick = ValueDisplayBrick.ValueDisplayBrick(self.channelsBox, "channel%d" % i)
self.lstChannelValueDisplay.append(newValueDisplayBrick)
self.lstChannelWidgets.append(self.lstChannelValueDisplay[-1])
newValueDisplayBrick["unit"] = self["unit"]
newValueDisplayBrick["valueLabel"]=""
newValueDisplayBrick["showSynoptic"] = False
newValueDisplayBrick["showTitle"] = False
newValueDisplayBrick["formatString"]="+####.##"
newValueDisplayBrick.show()
self.connect(self.lakeshore, "statusChanged", self.setStatus)
self.connect(self.lakeshore, "channelsUpdate", self.lsChannelsUpdated)
self.connect(self.lakeshore, "intervalChanged", self.updateFrequency)
elif property == "unit":
if self.lakeshore is not None:
self.lakeshore.setUnit(newValue)
elif property == "baseTime":
for channel, curve_data in self.data.items():
if curve_data is None:
continue
self.graph.delcurve("channel %d" % (channel+1))
curve_data["x"]=[]
curve_data["y"]=[]
curve_data["t0"]=None
def saveGraph(self):
filename = str(QFileDialog.getSaveFileName(os.environ["HOME"],
"Data file (*.dat *.txt)",
self,
"Save file",
"Choose a filename to save under"))
if len(filename) == 0:
return
try:
f = open(filename, "w")
except:
logging.getLogger().exception("An error occured while trying to open file %s", filename)
QMessageBox.warning(self, "Error", "Could not open file %s for writing !" % filename, QMessageBox.Ok)
else:
contents = ["#F Lakeshore temperatures", "#D %s" % time.ctime(time.time())]
for channel, curve_data in self.data.items():
if curve_data is None:
continue
contents.append("\n#S %d %s" % (channel+1, "channel %d" % (channel+1)))
contents.append("#N 2")
contents.append("#L %s %s" % ("time (s)", "temperature"))