本文整理匯總了Python中Plotter.Plotter.addData方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.addData方法的具體用法?Python Plotter.addData怎麽用?Python Plotter.addData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plotter.Plotter
的用法示例。
在下文中一共展示了Plotter.addData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Ui_MainWindow
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addData [as 別名]
class Ui_MainWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.plotHolder = Plotter()
self.layout = QtGui.QVBoxLayout()
self.data = 0
self.dataStr = 0
self.filePath = None
self.filePath2 = 0
self.setWindowTitle("FlightMadness")
self.setWindowIcon(QtGui.QIcon('phyton.ico'))
self.setupUi(self)
#Funkcja, ktora otwiera okno dialogowe i pozwala wybrac plik .CSV potrzebny do symulacji danych
def openFileForSimulation(self):
print '---------------------------'
print 'Opening file for simulation'
filter = "CSV (*.csv)"
filename = QtGui.QFileDialog.getOpenFileNameAndFilter(self,"Open File",'',filter)
self.filePath = filename[0]
if str(self.filePath) != "":
self.dataLoad_label.setText("<b>OK</b>")
self.start_Button.setEnabled(True)
self.start_label.setText("OCZEKIWANIE")
print 'File loaded'
else:
print 'Opening aborted'
#Funkcja, ktora otwiera okno dialogowe i pozwala wybrac plik .CSV potrzebny do wizualizacji danych
def openFileForVisualisation(self):
print '---------------------------'
print 'Opening file for visualisation'
filter = "CSV (*.csv)"
filename = QtGui.QFileDialog.getOpenFileNameAndFilter(self,"Open File",'',filter)
self.filePath2 = filename[0]
if str(self.filePath2) != "":
self.dataLoad_label_2.setText("<b>OK</b>")
self.start_Button_2.setEnabled(True)
self.start_label_2.setText("OCZEKIWANIE")
print 'File loaded'
else:
print 'Opening aborted'
#Funkcja inicjalizujaca symulacje danych
def StartFlight(self):
print '---------------------------'
print 'Starting simulation'
temp = FlightSimulator(self.filePath)
temp.openDataSimulation()
self.start_label.setText("<b>OK</b>")
self.start_Button.setEnabled(False)
#Funkcja inicjalizujaca prztwarzanie danych do wizualizacji
#Dane sa wczytywane do zmiennych, a na ich podstawie aktualizowane jest GUI oraz tworzone statystyki lotu
def LoadDataForVisualisation(self):
print 'Loading data for visualisation...'
Reader.read(self.filePath2)
self.data = Reader.load
self.dataStr = Reader.load2 #data i czas
self.data = Operations.CalculateToMetrics(self.data)
stat = Statistics(self.data,self.dataStr)
stat.makeStats()
self.UpdateStatsGUI(stat)
print 'All done.'
#Funkcja aktualizujaca statystyki w GUI po pobraniu danych do wizualizacji
def UpdateStatsGUI(self,obj):
self.stats = obj
self.spinBox_max.setValue(obj.timeFlight)
self.spinBox_min.setValue(0)
self.start_label_2.setText("<b>OK</b>")
self.start_Button_2.setEnabled(False)
self.plotHolder.addData(self.data)
self.pushButton.setEnabled(True)
self.pushButton_2.setEnabled(True)
self.pushButton_3.setEnabled(True)
self.pushButton_4.setEnabled(True)
self.pushButton_5.setEnabled(True)
self.pushButton_6.setEnabled(True)
self.label_visualisation_state.show()
#Stats
self.value_dateStart.setText(str(obj.dateStart) +' ' + str(obj.timeStart))
self.value_dateStart.adjustSize()
self.value_dateLand.setText(str(obj.dateLand) +' ' + str(obj.timeLand))
self.value_dateLand.adjustSize()
self.value_timeFlight.setText(str(obj.timeFlight))
self.value_startCoords.setText(str(obj.latitudeStart) + ' ' + str(obj.longitudeStart))
self.value_startCoords.adjustSize()
self.value_landCords.setText(str(obj.latitudeLand) + ' ' + str(obj.longitudeLand))
self.value_landCords.adjustSize()
self.value_maxHeight.setText(str(round(obj.maxAltitude,3)))
self.value_maxSpeed.setText(str(round(obj.maxSpeed,3)))
self.value_maxAcceleration.setText(str(round(obj.maxAcceleration,3)))
self.value_averageSpeed.setText(str(round(obj.averageSpeed,3)))
self.value_averageHeight.setText(str(round(obj.averageHeight,3)))
self.value_endPoint.setText(str(round(obj.endPoint,3)))
self.value_startPoint.setText(str(round(obj.startPoint,3)))
self.tabWidget.setCurrentIndex(1)
#.........這裏部分代碼省略.........