@@ -190,9 +190,9 @@ def screen2(self):
190
190
# Display total results for MDO and HFO
191
191
self .root .get_screen ("total_screen" ).ids .right_action .text = "Tank sounding"
192
192
self .root .get_screen ("total_screen" ).ids .total_hfo .text = str (round (self .sum_hfo , 3 )) + str (" m3 HFO" ) \
193
- + str (f"\n { round (self .sum_hfo_tons )} MT HFO" + f"\n ___________________" )
193
+ + str (f"\n { round (( self .sum_hfo_tons ), 2 )} MT HFO" + f"\n ___________________" )
194
194
self .root .get_screen ("total_screen" ).ids .total_mdo .text = str (round (self .sum_mdo , 3 )) + str (" m3 MDO" ) \
195
- + str (f"\n { round (self .sum_mdo_tons )} MT MDO" )
195
+ + str (f"\n { round (( self .sum_mdo_tons ), 2 )} MT MDO" )
196
196
else :
197
197
self .root .current = "tab_screen"
198
198
@@ -350,8 +350,8 @@ def on_tab_switch(
350
350
self .root .get_screen ('tab_screen' ).ids .tabs .add_widget (
351
351
Tab (title = f"Previous quantity: { prev_label_text } " ))
352
352
except Exception as e :
353
- print (str (e ) + " error string 346" )
354
-
353
+ # print(str(e) + " error string 346")
354
+ pass
355
355
356
356
357
357
def callback_Calc (self , * args ):
@@ -448,14 +448,14 @@ def callback_Calc(self, *args):
448
448
self .result .font_size = "20dp"
449
449
except AttributeError as e :
450
450
self .root .get_screen ("tab_screen" ).ids .select_vessel .text = "Select the vessel first"
451
- print (e )
451
+ print (str ( e ) + str ( "error string 451" ) )
452
452
453
453
def my_value (self , * args ): # <<<<<<<<<<< Value from Temp slider
454
454
try :
455
455
self .slider_value = {}
456
- self .slider_value [str (self .tank_name .text .removesuffix ('mdo' )).strip (' ' )]= str (float (args [1 ]))
456
+ self .slider_value [str (self .tank_name .text .removesuffix ('mdo' )).strip (' ' )] = round (float (( args [1 ])), 0 )
457
457
except Exception as e :
458
- print (e )
458
+ print (e + str ( "error string 458" ) )
459
459
return self .slider_value
460
460
461
461
def temp_dens_extraction (self ):
@@ -508,15 +508,34 @@ def temp_dens_extraction(self):
508
508
self .dens_new .hint_text = "Density (example: 0.9588)"
509
509
self .dens_new .text_color_normal = 1 , 1 , 0.8 , 1
510
510
self .def_dens = self .dens_new .text
511
-
511
+ except KeyError :
512
+ self .temperature = def_temp
513
+ print ("eror string 513" )
514
+ if len (self .dens_new .text ) == 0 :
515
+ # If density is not inputed by user than we collect it from
516
+ # database
517
+ self .def_dens = db_editing .select_DefDens (str (super .tank_name .text .removesuffix ('mdo' )).strip (' ' ), super .name_of_vessel_db )
518
+ else :
519
+ # if is inputed than put that what user inputed
520
+ if float (self .dens_new .text ) >= 1.1 :
521
+ try :
522
+ self .dens_new .hint_text = "Wrong Density"
523
+ self .dens_new .text_color_normal = "#ff2233"
524
+ except Exception as e :
525
+ print (e )
526
+ print ("eror string 526" )
527
+ else :
528
+ self .dens_new .hint_text = "Density (example: 0.9588)"
529
+ self .dens_new .text_color_normal = 1 , 1 , 0.8 , 1
530
+ self .def_dens = self .dens_new .text
512
531
513
532
try :
514
533
self .converted_density = ((float (self .def_dens )/ 2 )* 1000 )* 2
515
534
vol_coorection .vol_correction_factor_calc (self .converted_density , self .result .text , self .temperature )
516
535
self .real_volume = vol_coorection .result
517
536
except Exception as e :
518
537
print (e )
519
- print ("eror string 511 " )
538
+ print ("eror string 538 " )
520
539
521
540
return self .temperature , self .def_dens , self .real_volume
522
541
0 commit comments