diff --git a/python/logInspector/logInspector.py b/python/logInspector/logInspector.py index c2ddaa709..4114de1c7 100644 --- a/python/logInspector/logInspector.py +++ b/python/logInspector/logInspector.py @@ -286,7 +286,7 @@ def closeEvent(self, event): super().closeEvent(event) def popPlot(self): - print("Pop Plot") + print("New Plot") mp = MPlotter(len(self.mplots), self, True, self.nameList[self.selectedIndex] + " - " + self.deviceInfo()) mp.dialogClosed.connect(self.on_mplotter_closed) # Connect the custom signal to a slot mp.show() @@ -427,14 +427,12 @@ def setupUi(self): self.setAcceptDrops(True) def createListSystem(self): - self.addListSection('SYSTEM') self.addListItem('Flash Config', lambda: self.showFlashConfig()) self.addListItem('Device Info', lambda: self.showDeviceInfo()) self.addListItem('INS Status', 'insStatus') self.addListItem('HDW Status', 'hdwStatus') def createListIns(self): - self.addListSection('INS/AHRS') self.addListItem('Pos NED Map', 'posNEDMap') self.addListItem('Pos NED', 'posNED') self.addListItem('Pos LLA', 'posLLA') @@ -446,7 +444,6 @@ def createListIns(self): self.addListItem('Climb Rate', 'climbRate') def createListSensors(self): - self.addListSection('SENSORS') self.addListItem('IMU PQR', 'imuPQR') self.addListItem('IMU Accel', 'imuAcc') self.addListItem('PSD PQR', 'gyroPSD') @@ -456,7 +453,6 @@ def createListSensors(self): self.addListItem('Temp', 'temp') def createListGps(self): - self.addListSection('GPS') self.addListItem('GPS LLA', 'gpsLLA') self.addListItem('GPS 1 Stats', 'gpsStats') self.addListItem('GPS 2 Stats', 'gps2Stats') @@ -474,7 +470,7 @@ def createListGps(self): self.addListItem('GPS Velocity NED', 'gpsVelNED') def createListGeneral(self): - self.addListSection('GENERAL') + None def setCurrentListRow(self, row): if row < self.modelList.rowCount() and row < len(self.functionList): @@ -509,10 +505,19 @@ def createPlotSelection(self): groupBox.setLayout(LayoutList) self.controlLayout.addWidget(groupBox) + self.addListSection('SYSTEM') self.createListSystem() + + self.addListSection('INS/AHRS') self.createListIns() + + self.addListSection('SENSORS') self.createListSensors() + + self.addListSection('GPS') self.createListGps() + + self.addListSection('GENERAL') self.createListGeneral() self.checkboxResidual = QCheckBox("Residual", self) @@ -616,14 +621,16 @@ def createBottomToolbar(self): self.toolLayout = QHBoxLayout() self.toolLayout.addWidget(self.mplots[0].toolbar) - self.popPlotButton = QPushButton("Pop Plot") - self.popPlotButton.setToolTip("Open current plot in separate dialog window.") - self.popPlotButton.clicked.connect(self.popPlot) - self.toolLayout.addWidget(self.popPlotButton) self.hideControlButton = QPushButton("Hide Panel") self.hideControlButton.setToolTip("Hide/show left side control panel of the LogInspector.") self.hideControlButton.clicked.connect(self.hideControl) self.toolLayout.addWidget(self.hideControlButton) + + self.popPlotButton = QPushButton("New Plot") + self.popPlotButton.setToolTip("Open current plot in separate dialog window.") + self.popPlotButton.clicked.connect(self.popPlot) + self.toolLayout.addWidget(self.popPlotButton) + self.newAppButton = QPushButton("New App") self.newAppButton.setToolTip("Open a new instance of the LogInspector.") self.newAppButton.clicked.connect(self.newWindow) diff --git a/python/logInspector/logInspectorInternal.py b/python/logInspector/logInspectorInternal.py index 979e67567..f12d34019 100644 --- a/python/logInspector/logInspectorInternal.py +++ b/python/logInspector/logInspectorInternal.py @@ -79,6 +79,8 @@ def createListIns(self): self.addListItem('EKF Biases', 'ekfBiases') def createListSensors(self): + self.addListItem('IMU 3 PQR', 'imu3PQR') + self.addListItem('IMU 3 Accel', 'imu3Acc') super(logInspectorInternal, self).createListSensors() self.addListItem('Allan Var. PQR', 'allanVariancePQR') self.addListItem('Allan Var. Accel', 'allanVarianceAcc') diff --git a/python/logInspector/logPlotter.py b/python/logInspector/logPlotter.py index 31516de3a..a22cc4172 100644 --- a/python/logInspector/logPlotter.py +++ b/python/logInspector/logPlotter.py @@ -2064,13 +2064,13 @@ def gnssEphemeris(self, fig=None, axs=None): b.yaxis.set_major_locator(MaxNLocator(integer=True)) - def loadGyros(self, device): - return self.loadIMU(device, 0) + def loadGyros(self, device, forceImu3=False): + return self.loadIMU(device, accelSensor=0, forceImu3=forceImu3) - def loadAccels(self, device): - return self.loadIMU(device, 1) + def loadAccels(self, device, forceImu3=False): + return self.loadIMU(device, accelSensor=1, forceImu3=forceImu3) - def loadIMU(self, device, accelSensor): # 0 = gyro, 1 = accelerometer + def loadIMU(self, device, accelSensor, forceImu3=False): # 0 = gyro, 1 = accelerometer imu1 = None imu2 = None imu3 = None @@ -2085,7 +2085,7 @@ def loadIMU(self, device, accelSensor): # 0 = gyro, 1 = accelerometer else: imu1 = np.copy(self.getData(device, DID_PIMU, 'vel')) - if np.shape(imu1)[0] != 0: # DID_PIMU + if np.shape(imu1)[0] != 0 and not forceImu3: # DID_PIMU # time = self.getData(device, DID_IMU_RAW, 'time') # to plot raw gyro data time = self.getData(device, DID_PIMU, 'time') dt = self.getData(device, DID_PIMU, 'dt') @@ -2118,7 +2118,7 @@ def loadIMU(self, device, accelSensor): # 0 = gyro, 1 = accelerometer else: time = self.getData(device, DID_IMU, 'time') - if len(time) != 0: # DID_IMU + if len(time) != 0 and not forceImu3: # DID_IMU I = self.getData(device, DID_IMU, 'I') dt = time[1:] - time[:-1] dt = np.append(dt, dt[-1]) @@ -2166,7 +2166,13 @@ def loadIMU(self, device, accelSensor): # 0 = gyro, 1 = accelerometer return (time, dt, imu1, imu2, imu3, imuCount) - def imuPQR(self, fig=None, axs=None): + def imu3PQR(self, fig=None, axs=None): + self.imuPQR(fig, axs, forceImu3=True) + + def imu3Acc(self, fig=None, axs=None): + self.imuAcc(fig, axs, forceImu3=True) + + def imuPQR(self, fig=None, axs=None, forceImu3=False): if fig is None: fig = plt.figure() @@ -2182,7 +2188,7 @@ def imuPQR(self, fig=None, axs=None): refTime.append(refTime_) fig.suptitle('PQR - ' + os.path.basename(os.path.normpath(self.log.directory))) - (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(0) + (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(0, forceImu3) plotResidual = pqrCount==1 and self.residual if pqrCount: @@ -2190,13 +2196,13 @@ def imuPQR(self, fig=None, axs=None): if plotResidual: for d in self.active_devs: if self.log.serials[d] == 'Ref INS': - (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(d) + (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(d, forceImu3) refTime = time refPqr = pqr0 continue for dev_idx, d in enumerate(self.active_devs): - (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(d) + (time, dt, pqr0, pqr1, pqr2, pqrCount) = self.loadGyros(d, forceImu3) if pqrCount: for i in range(3): axislable = 'P' if (i == 0) else 'Q' if (i==1) else 'R' @@ -2243,7 +2249,7 @@ def imuPQR(self, fig=None, axs=None): self.setup_and_wire_legend() return self.saveFigJoinAxes(ax, axs, fig, 'pqrIMU') - def imuAcc(self, fig=None, axs=None): + def imuAcc(self, fig=None, axs=None, forceImu3=False): if fig is None: fig = plt.figure() @@ -2258,7 +2264,7 @@ def imuAcc(self, fig=None, axs=None): refTime.append(refTime_) fig.suptitle('Accelerometer - ' + os.path.basename(os.path.normpath(self.log.directory))) - (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(0) + (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(0, forceImu3) plotResidual = accCount==1 and self.residual if accCount: @@ -2266,13 +2272,13 @@ def imuAcc(self, fig=None, axs=None): if plotResidual: for d in self.active_devs: if self.log.serials[d] == 'Ref INS': - (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(d) + (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(d, forceImu3) refTime = time refAcc = acc0 continue for dev_idx, d in enumerate(self.active_devs): - (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(d) + (time, dt, acc0, acc1, acc2, accCount) = self.loadAccels(d, forceImu3) if accCount: for i in range(3): axislable = 'X' if (i == 0) else 'Y' if (i==1) else 'Z'