diff --git a/src/view/view.py b/src/view/view.py index 12b15b2..fbaa5ba 100644 --- a/src/view/view.py +++ b/src/view/view.py @@ -6,17 +6,12 @@ class RocketView: def display_data(self, data): # Print the headers -<<<<<<< HEAD self.write_data(data) - print("{:<15} {:<15} \t\t {:<15}".format("Sensor type", "Timestamp", "Sensor data")) -======= - print(data) print( "{:<15} {:<15} \t\t {:<15}".format( "Sensor type", "Timestamp", "Sensor data" ) ) ->>>>>>> 5c1abdc9c0852defc974838c4fb5025b56e5d746 # Loop through the data and print each item sensors = [ "Temp1", @@ -38,24 +33,15 @@ def display_data(self, data): i += 1 j += 1 while i < 7: -<<<<<<< HEAD - print(sensors[i] + "\t" + str(data[0]) + "\t", - '{0:.1f}'.format(data[j]), - '\t{0:.1f}'.format(data[j+1]), - '\t{0:.1f}'.format(data[j+2]), end="\n") - i+=1 - j+=3 -======= print( sensors[i] + "\t" + str(data[0]) + "\t", - "{0:.2f}".format(data[j]), - "\t{0:.2f}".format(data[j + 1]), - "\t{0:.2f}".format(data[j + 2]), + "{0:.1f}".format(data[j]), + "\t{0:.1f}".format(data[j + 1]), + "\t{0:.1f}".format(data[j + 2]), end="\n", ) i += 1 j += 3 ->>>>>>> 5c1abdc9c0852defc974838c4fb5025b56e5d746 """ print(sensors[i] + "\t" + str(data[0]), '{0:.2f}'.format(data[j]), @@ -84,6 +70,6 @@ def display_data(self, data): def write_data(self, data): with open(self.csv_file_name, mode="a", newline="") as file: - writer = csv.writer(file, delimiter = ',', quoting = csv.QUOTE_MINIMAL) + writer = csv.writer(file, delimiter=",", quoting=csv.QUOTE_MINIMAL) # Write the data writer.writerow(data)