Skip to content

Commit

Permalink
Merge pull request #9 from MissouriMRDT/rovecomm3
Browse files Browse the repository at this point in the history
Rovecomm3
  • Loading branch information
ThisIsBrady authored Apr 15, 2023
2 parents 04c90e4 + 91c32ef commit 5e111a7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions RoveComm_Tester/QtReciever.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ def __init__(self, rovecommUdp, rovecommTCP):
self.main_layout = QVBoxLayout()
self.UDP_subscribe = QHBoxLayout()
self.TCP_subscribe = QHBoxLayout()
self.UDP_subscribe.addWidget(QLabel("Subscribe to Octet 4:"))
self.UDP_subscribe.addWidget(QLabel("Subscribe to IP:"))
self.UDP_subscribe.addWidget(self.octet_input_udp)
self.UDP_subscribe.addWidget(self.subscribe_pb_udp)
self.main_layout.addLayout(self.UDP_subscribe)
self.TCP_subscribe.addWidget(QLabel("Subscribe to Octet 4:"))
self.TCP_subscribe.addWidget(QLabel("Subscribe to IP:"))
self.TCP_subscribe.addWidget(self.octet_input_tcp)
self.TCP_subscribe.addWidget(QLabel("Port Number:"))
self.TCP_subscribe.addWidget(self.port_input_tcp)
Expand All @@ -230,4 +230,4 @@ def subscribeEventUdp(self):
self.rovecommUdp.write(packet)

def subscribeEventTCP(self):
self.rovecommTCP.connect(("192.168.1." + self.octet_input_tcp.text(), int(self.port_input_tcp.text())))
self.rovecommTCP.connect((self.octet_input_tcp.text(), int(self.port_input_tcp.text())))
22 changes: 12 additions & 10 deletions RoveComm_Tester/QtSender.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from threading import currentThread

from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QIcon
Expand Down Expand Up @@ -43,7 +44,7 @@
"R Thumb",
)

data_types = {"Int8": "b", "uInt8": "B", "Int16": "h", "uInt16": "H", "Int32": "l", "uInt32": "L", "Float": "f"}
data_types = {"Int8": "b", "uInt8": "B", "Int16": "h", "uInt16": "H", "Int32": "l", "uInt32": "L", "Float": "f", "Double": "d", "Char": "c"}


# Class for window that allows a user to:
Expand Down Expand Up @@ -333,7 +334,7 @@ def __init__(self, rovecommUdp, xbox, parent=None, row_index=1):
self.main_layout = QGridLayout(self)

# Row for name headers
self.main_layout.addWidget(QLabel("IP Octet 4", self), 0, 1)
self.main_layout.addWidget(QLabel("IP", self), 0, 1)
self.main_layout.addWidget(QLabel("Data ID", self), 0, 2)
self.main_layout.addWidget(QLabel("Data Size", self), 0, 4)
self.main_layout.addWidget(QLabel("Data", self), 0, 5)
Expand Down Expand Up @@ -365,7 +366,7 @@ def sendEvent(self):
data = ()
try:
for i in range(0, self.data_length):
if self.data_type_cb.currentText() == "Float":
if self.data_type_cb.currentText() == "Float" or self.data_type_cb.currentText() == "Double":
data = (data) + (float(self.data_array[i].text()),)
else:
data = (data) + (int(self.data_array[i].text()),)
Expand Down Expand Up @@ -513,13 +514,14 @@ def update_le_is_float(self):

# Handler for octet, filter for valid input
def update_octet_le(self):
try:
if int(self.sender().text()) < 256:
self.update_text_color(True, self.sender())
else:
self.update_text_color(False, self.sender())
except:
self.update_text_color(False, self.sender())
# try:
# if int(self.sender().text()) < 256:
# self.update_text_color(True, self.sender())
# else:
# self.update_text_color(False, self.sender())
# except:
# self.update_text_color(False, self.sender())
self.update_text_color(True, self.sender())

# Updates text color on line edits to notify of bad input
def update_text_color(self, status, element):
Expand Down
2 changes: 1 addition & 1 deletion RoveComm_Tester/RoveComm_Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
file = open("0-Data Outputs/" + str(start_time).replace(":", "_") + ".csv", "w")
file.write("Time,Delta,Dela Prev,Data Id,Data Type,Data Count,Ip Address,Data\n")

ip_fourth_octet = input("IP Fourth Octet:")
ip_fourth_octet = input("IP:")
data_id = input("Data ID:")

# Subscribe
Expand Down
2 changes: 1 addition & 1 deletion RoveComm_Tester/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"UDP_PORT": 11000,
"TCP_PORT": 11111
"TCP_PORT": 12000
}
2 changes: 1 addition & 1 deletion RoveComm_Tester/rovecomm_module

0 comments on commit 5e111a7

Please sign in to comment.