Skip to content

Commit

Permalink
new debug try to catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
c4pointer committed Jan 18, 2023
1 parent 08e575e commit 7f705c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def calculate_total(self):
self.total_result_hfo.append(total_list_hfo[i])

except KeyError as err:
pass
print("eror string 147")



Expand All @@ -161,7 +161,7 @@ def calculate_total(self):
self.total_result_mdo.append(total_list_mdo[d])

except KeyError as err:
pass
print("eror string 164")

for i in self.total_result_mdo:
self.sum_mdo += float(i[4])
Expand Down Expand Up @@ -248,6 +248,7 @@ def start_thread(self, vessel):

except Exception as e:
print(e)
print("eror string 251")


def name_of_tank(self, vessel_db):
Expand Down Expand Up @@ -298,6 +299,7 @@ def add_tab(self,vessel):
except AttributeError:
self.root.get_screen('tab_screen').ids.tabs.add_widget(
Tab(title=f"Previous quantity: {prev_label_text}"))
print("eror string 302")

# afetr add text to label of first tab we delete here the last widget that is non correct
self.root.get_screen('tab_screen').ids.tabs.remove_widget(
Expand Down Expand Up @@ -360,7 +362,8 @@ def callback_Calc(self, *args):
try:
volume = str(db_editing.volume_in_m3[0])
except IndexError:
pass
print("eror string 365")
pass
# If tank is in MDO state than we make calcs for it and append to
# "total_list_mdo" for displaing in Totoal result screnn
if db_editing.state_of_tank[0] ==1:
Expand Down Expand Up @@ -400,7 +403,7 @@ def callback_Calc(self, *args):
# Printing on display the error and change the font-size
self.result.text = str("Wrong sounding value!")
self.result.font_size = "20dp"

print("eror string 406")
# Calculate if tank is NOT MDO but is HFO
else:

Expand Down Expand Up @@ -443,9 +446,10 @@ def callback_Calc(self, *args):
# Printing on display the error and change the font-size
self.result.text = str("Wrong sounding value!")
self.result.font_size = "20dp"
print("eror string 449")
except AttributeError:
self.root.get_screen("tab_screen").ids.select_vessel.text = "Select the vessel first"
pass
print("eror string 488")

def my_value(self, object_property, value): # <<<<<<<<<<< Value from Temp slider
self.slider_value={}
Expand Down Expand Up @@ -473,6 +477,7 @@ def temp_dens_extraction(self):
self.dens_new.text_color_normal = "#ff2233"
except Exception as e:
print(e)
print("eror string 476")

else:
self.dens_new.hint_text = "Density (example: 0.9588)"
Expand All @@ -482,6 +487,7 @@ def temp_dens_extraction(self):

except AttributeError as e:
self.temperature = def_temp
print("eror string 490")
if len(self.dens_new.text) == 0:
# If density is not inputed by user than we collect it from
# database
Expand All @@ -494,7 +500,7 @@ def temp_dens_extraction(self):
self.dens_new.text_color_normal = "#ff2233"
except Exception as e:
print(e)

print("eror string 498")
else:
self.dens_new.hint_text = "Density (example: 0.9588)"
self.dens_new.text_color_normal = 1, 1, 0.8, 1
Expand All @@ -507,6 +513,7 @@ def temp_dens_extraction(self):
self.real_volume = vol_coorection.result
except Exception as e:
print(e)
print("eror string 511")

return self.temperature, self.def_dens, self.real_volume

Expand Down
Binary file modified viking_ocean_prev.db
Binary file not shown.
Binary file modified viking_sea_prev.db
Binary file not shown.

0 comments on commit 7f705c1

Please sign in to comment.