def captureSnapshot(self):
""" Logic to capture all the parameters for the data visualization """
print "Capturing the timepoints"
# Code graciously taken from the Qt website
msgBox = QtGui.QMessageBox()
msgBox.setText("Capturing the snapshot.")
msgBox.setInformativeText("Do you want to capture the parameters of the visualization?")
msgBox.setStandardButtons(QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel)
msgBox.setDefaultButton(QtGui.QMessageBox.Save)
ret = msgBox.exec_()
if ret == QtGui.QMessageBox.Save:
Sanpshots = dict()
print "Logic for capturing the paprameters of the visualizations"
Sanpshots["correlationMode"] = self.widget.ColorNodesBasedOnCorrelation
Sanpshots["nodeMapping"] = self.widget.nodeSizeFactor
Sanpshots["edgeThickness"] = self.widget.nodeSizeFactor
Sanpshots["onlyEdges:"] = self.widget.DisplayOnlyEdges
Sanpshots["transparentNodes"] = self.widget.setTransp
Sanpshots["highlightEdges"] = self.widget.HighlightedId
Sanpshots["communityGraphLevel"] = self.widget.level
Sanpshots["datasetLoaded"] = (self.matrix_filename,self.template_filename,self.parcelation_filename)
# Make a Directory
try:
os.makedirs(self.directory_path[0])
except OSError as exception:
pass
from time import gmtime, strftime
fileName = strftime("%Y-%m-%d %H:%M:%S", gmtime())
'2009-01-05 22:14:39'
with open(self.directory_path[0]+"/"+fileName, 'w') as outfile:
pickle.dump(Sanpshots, outfile)
评论列表
文章目录