Skip to content

Commit

Permalink
gifler ve map
Browse files Browse the repository at this point in the history
  • Loading branch information
YusufOnatYilmaz committed Oct 9, 2022
1 parent a90a97f commit a4a1689
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 38 deletions.
Binary file added assets/ezgif.com-gif-maker (1).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ezgif.com-gif-maker (2).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ezgif.com-gif-maker (4).gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ezgif.com-gif-maker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 33 additions & 1 deletion metu_gui_v2/camera_input.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
from PyQt5.QtGui import QMovie
from PyQt5.QtCore import QSize
import folium
from PyQt5 import QtWidgets, QtWebEngineWidgets
import io

"""
To be implemented.
"""

class CameraI:
def __init__(self, ui) -> None:
self.ui = ui
self.ui = ui

self.ui.movie = QMovie("/home/yoy/Desktop/metu_rover/src/metu_gui_v2/assets/ezgif.com-gif-maker.gif")
self.ui.MainCamera.setMovie(self.ui.movie)
self.ui.movie.start()

self.ui.movie2 = QMovie("/home/yoy/Desktop/metu_rover/src/metu_gui_v2/assets/ezgif.com-gif-maker (1).gif")
self.ui.EndEffectorCamera.setMovie(self.ui.movie2)
self.ui.movie2.start()

self.ui.movie3 = QMovie("/home/yoy/Desktop/metu_rover/src/metu_gui_v2/assets/ezgif.com-gif-maker (2).gif")
self.ui.ScienceHubCamera.setMovie(self.ui.movie3)
self.ui.movie3.start()


self.ui.movie4 = QMovie("/home/yoy/Desktop/metu_rover/src/metu_gui_v2/assets/ezgif.com-gif-maker (4).gif")
self.ui.BatteryShow.setMovie(self.ui.movie4)
self.ui.movie4.start()

m = folium.Map(location=[39.889011,32.7801363], tiles="Stamen Toner", zoom_start=13)

data = io.BytesIO()
m.save(data, close_file=False)

w = QtWebEngineWidgets.QWebEngineView()
w.setHtml(data.getvalue().decode())
self.ui.GPSMapLayout.addWidget(w)
56 changes: 40 additions & 16 deletions metu_gui_v2/ui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'v1.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


Expand All @@ -18,11 +28,12 @@ def setupUi(self, MainWindow):
font.setPointSize(16)
self.GPSMapGroupBox.setFont(font)
self.GPSMapGroupBox.setObjectName("GPSMapGroupBox")
self.GPSMap = QtWidgets.QLabel(self.GPSMapGroupBox)
self.GPSMap.setGeometry(QtCore.QRect(10, 40, 641, 421))
self.GPSMap.setStyleSheet("background : green")
self.GPSMap.setText("")
self.GPSMap.setObjectName("GPSMap")
self.gridLayoutWidget_2 = QtWidgets.QWidget(self.GPSMapGroupBox)
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 40, 641, 431))
self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
self.GPSMapLayout = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
self.GPSMapLayout.setContentsMargins(0, 0, 0, 0)
self.GPSMapLayout.setObjectName("GPSMapLayout")
self.VelocityGroupBox = QtWidgets.QGroupBox(self.MainTab)
self.VelocityGroupBox.setGeometry(QtCore.QRect(10, 520, 661, 241))
font = QtGui.QFont()
Expand Down Expand Up @@ -113,6 +124,10 @@ def setupUi(self, MainWindow):
font.setPointSize(16)
self.BatteryGroupBox.setFont(font)
self.BatteryGroupBox.setObjectName("BatteryGroupBox")
self.BatteryShow = QtWidgets.QLabel(self.BatteryGroupBox)
self.BatteryShow.setGeometry(QtCore.QRect(60, 30, 541, 191))
self.BatteryShow.setText("")
self.BatteryShow.setObjectName("BatteryShow")
self.CommunicationGroupBox = QtWidgets.QGroupBox(self.MainTab)
self.CommunicationGroupBox.setGeometry(QtCore.QRect(690, 520, 661, 241))
font = QtGui.QFont()
Expand Down Expand Up @@ -197,16 +212,6 @@ def setupUi(self, MainWindow):
self.ScienceGraphGrid = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.ScienceGraphGrid.setContentsMargins(0, 0, 0, 0)
self.ScienceGraphGrid.setObjectName("ScienceGraphGrid")
self.Graph3 = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph3.setStyleSheet("background: red; margin: 20px")
self.Graph3.setText("")
self.Graph3.setObjectName("Graph3")
self.ScienceGraphGrid.addWidget(self.Graph3, 0, 2, 1, 1)
self.Graph6 = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph6.setStyleSheet("background: red; margin: 20px")
self.Graph6.setText("")
self.Graph6.setObjectName("Graph6")
self.ScienceGraphGrid.addWidget(self.Graph6, 1, 2, 1, 1)
self.Graph4 = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph4.setStyleSheet("background: red; margin: 20px")
self.Graph4.setText("")
Expand All @@ -217,6 +222,11 @@ def setupUi(self, MainWindow):
self.Graph5.setText("")
self.Graph5.setObjectName("Graph5")
self.ScienceGraphGrid.addWidget(self.Graph5, 1, 1, 1, 1)
self.Graph3 = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph3.setStyleSheet("background: red; margin: 20px")
self.Graph3.setText("")
self.Graph3.setObjectName("Graph3")
self.ScienceGraphGrid.addWidget(self.Graph3, 0, 2, 1, 1)
self.Graph = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph.setStyleSheet("background: red; margin: 20px")
self.Graph.setText("")
Expand All @@ -227,14 +237,19 @@ def setupUi(self, MainWindow):
self.Graph2.setText("")
self.Graph2.setObjectName("Graph2")
self.ScienceGraphGrid.addWidget(self.Graph2, 0, 1, 1, 1)
self.Graph6 = QtWidgets.QLabel(self.gridLayoutWidget)
self.Graph6.setStyleSheet("background: red; margin: 20px")
self.Graph6.setText("")
self.Graph6.setObjectName("Graph6")
self.ScienceGraphGrid.addWidget(self.Graph6, 1, 2, 1, 1)
self.TheTab.addTab(self.ScienceTab, "")
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)
self.TheTab.setCurrentIndex(2)
self.TheTab.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
Expand Down Expand Up @@ -264,3 +279,12 @@ def retranslateUi(self, MainWindow):
self.TheTab.setTabText(self.TheTab.indexOf(self.CameraTab), _translate("MainWindow", "Camera"))
self.TheTab.setTabText(self.TheTab.indexOf(self.ScienceTab), _translate("MainWindow", "Science Unit"))


if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
50 changes: 29 additions & 21 deletions ui_files/v1.ui
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</rect>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="MainTab">
<attribute name="title">
Expand All @@ -47,21 +47,16 @@
<property name="title">
<string>GPS Map</string>
</property>
<widget class="QLabel" name="GPSMap">
<widget class="QWidget" name="gridLayoutWidget_2">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>641</width>
<height>421</height>
<height>431</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background : green</string>
</property>
<property name="text">
<string/>
</property>
<layout class="QGridLayout" name="GPSMapLayout"/>
</widget>
</widget>
<widget class="QGroupBox" name="VelocityGroupBox">
Expand Down Expand Up @@ -341,6 +336,19 @@
<property name="title">
<string>Battery</string>
</property>
<widget class="QLabel" name="BatteryShow">
<property name="geometry">
<rect>
<x>60</x>
<y>30</y>
<width>541</width>
<height>191</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QGroupBox" name="CommunicationGroupBox">
<property name="geometry">
Expand Down Expand Up @@ -579,8 +587,8 @@
</rect>
</property>
<layout class="QGridLayout" name="ScienceGraphGrid">
<item row="0" column="2">
<widget class="QLabel" name="Graph3">
<item row="1" column="0">
<widget class="QLabel" name="Graph4">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand All @@ -589,8 +597,8 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="Graph6">
<item row="1" column="1">
<widget class="QLabel" name="Graph5">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand All @@ -599,8 +607,8 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="Graph4">
<item row="0" column="2">
<widget class="QLabel" name="Graph3">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand All @@ -609,8 +617,8 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="Graph5">
<item row="0" column="0">
<widget class="QLabel" name="Graph">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand All @@ -619,8 +627,8 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="Graph">
<item row="0" column="1">
<widget class="QLabel" name="Graph2">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand All @@ -629,8 +637,8 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="Graph2">
<item row="1" column="2">
<widget class="QLabel" name="Graph6">
<property name="styleSheet">
<string notr="true">background: red; margin: 20px</string>
</property>
Expand Down

0 comments on commit a4a1689

Please sign in to comment.