@@ -931,7 +931,19 @@ def show_message():
931
931
self .update_frame ()
932
932
933
933
def resize (self , event ):
934
- pass
934
+ self .text_scale = self ._main_fr .winfo_width ()/ 1920
935
+ self ._text_size = {'Text 14 bold' : 'Verdana ' + str (int (14 * self .text_scale ))+ ' bold' ,
936
+ 'Text 16 bold' : 'Verdana ' + str (int (16 * self .text_scale )) + ' bold' ,
937
+ 'Text 18 bold' : 'Verdana ' + str (int (18 * self .text_scale )) + ' bold' ,
938
+ 'Text 12 bold' : 'Verdana ' + str (int (12 * self .text_scale )) + ' bold' ,
939
+ 'Text 10 bold' : 'Verdana ' + str (int (10 * self .text_scale ))+ ' bold' ,
940
+ 'Text 9 bold' : 'Verdana ' + str (int (9 * self .text_scale )) + ' bold' ,
941
+ 'Text 8 bold' : 'Verdana ' + str (int (8 * self .text_scale )) + ' bold' ,
942
+ 'Text 8' : 'Verdana ' + str (int (8 * self .text_scale )),
943
+ 'Text 9' : 'Verdana ' + str (int (8 * self .text_scale )),
944
+ 'Text 7' : 'Verdana ' + str (int (7 * self .text_scale )),
945
+ 'Text 10' : 'Verdana ' + str (int (10 * self .text_scale )),
946
+ 'Text 7 bold' : 'Verdana ' + str (int (7 * self .text_scale )) + ' bold' }
935
947
936
948
def gui_load_combinations (self ,event ):
937
949
'''
@@ -1673,44 +1685,44 @@ def color_code_text(self, state):
1673
1685
anchor = "nw" )
1674
1686
elif self ._new_colorcode_sigmax .get () == True :
1675
1687
for idx , value in enumerate (cc_state ['sigma x map' ]):
1676
- self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (value ) + ' MPa' ),
1688
+ self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1677
1689
font = self ._text_size ["Text 10 bold" ],
1678
1690
fill = 'black' ,
1679
1691
anchor = "nw" )
1680
- self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (value ) + ' MPa' ),
1692
+ self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1681
1693
font = self ._text_size ["Text 10 bold" ],
1682
1694
fill = matplotlib .colors .rgb2hex (
1683
1695
cmap_sections (value / cc_state ['max sigma x' ])),
1684
1696
anchor = "nw" )
1685
1697
elif self ._new_colorcode_sigmay1 .get () == True :
1686
1698
for idx , value in enumerate (cc_state ['sigma y1 map' ]):
1687
- self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (value ) + ' MPa' ),
1699
+ self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1688
1700
font = self ._text_size ["Text 10 bold" ],
1689
1701
fill = 'black' ,
1690
1702
anchor = "nw" )
1691
- self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (value ) + ' MPa' ),
1703
+ self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1692
1704
font = self ._text_size ["Text 10 bold" ],
1693
1705
fill = matplotlib .colors .rgb2hex (
1694
1706
cmap_sections (value / cc_state ['max sigma y1' ])),
1695
1707
anchor = "nw" )
1696
1708
elif self ._new_colorcode_sigmay2 .get () == True :
1697
1709
for idx , value in enumerate (cc_state ['sigma y2 map' ]):
1698
- self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (value ) + ' MPa' ),
1710
+ self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1699
1711
font = self ._text_size ["Text 10 bold" ],
1700
1712
fill = 'black' ,
1701
1713
anchor = "nw" )
1702
- self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (value ) + ' MPa' ),
1714
+ self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1703
1715
font = self ._text_size ["Text 10 bold" ],
1704
1716
fill = matplotlib .colors .rgb2hex (
1705
1717
cmap_sections (value / cc_state ['max sigma y2' ])),
1706
1718
anchor = "nw" )
1707
1719
elif self ._new_colorcode_tauxy .get () == True :
1708
1720
for idx , value in enumerate (cc_state ['tau xy map' ]):
1709
- self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (value ) + ' MPa' ),
1721
+ self ._main_canvas .create_text (11 , 111 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1710
1722
font = self ._text_size ["Text 10 bold" ],
1711
1723
fill = 'black' ,
1712
1724
anchor = "nw" )
1713
- self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (value ) + ' MPa' ),
1725
+ self ._main_canvas .create_text (10 , 110 + 20 * idx , text = str (str (round ( value , 5 ) ) + ' MPa' ),
1714
1726
font = self ._text_size ["Text 10 bold" ],
1715
1727
fill = matplotlib .colors .rgb2hex (
1716
1728
cmap_sections (value / cc_state ['max tau xy' ])),
@@ -1783,7 +1795,7 @@ def draw_prop(self):
1783
1795
1784
1796
# printing the properties to the active line
1785
1797
if self ._line_is_active :
1786
- self ._prop_canvas .create_text ([170 * self ._global_shrink , 120 * self ._global_shrink ],
1798
+ self ._prop_canvas .create_text ([175 * self ._global_shrink , 120 * self ._global_shrink ],
1787
1799
text = self ._line_to_struc [self ._active_line ][0 ],
1788
1800
font = self ._text_size ["Text 9" ])
1789
1801
@@ -1870,7 +1882,7 @@ def draw_results(self, state = None):
1870
1882
1871
1883
if self ._line_is_active :
1872
1884
if self ._active_line in self ._line_to_struc :
1873
- x , y , dx , dy = 20 , 15 , 15 , 14
1885
+ x , y , dx , dy = 0 , 15 , 15 , 14
1874
1886
m3_to_mm3 = float (math .pow (1000 ,3 ))
1875
1887
m2_to_mm2 = float (math .pow (1000 , 2 ))
1876
1888
@@ -1945,13 +1957,13 @@ def draw_results(self, state = None):
1945
1957
1946
1958
#minimum thickness for plate
1947
1959
1948
- self ._result_canvas .create_text ([20 * self ._global_shrink , (y + 6 * dy )* self ._global_shrink ],
1960
+ self ._result_canvas .create_text ([x * self ._global_shrink , (y + 6 * dy )* self ._global_shrink ],
1949
1961
text = 'Plate thickness: '
1950
1962
+ str (obj_structure .get_plate_thk ()* 1000 )+ ' [mm] ' ,
1951
1963
font = self ._text_size ["Text 9 bold" ],anchor = 'nw' )
1952
1964
text = 'Minimum plate thickness: ' + str (round (min_thk ,1 )) + ' [mm]' if not slm_text_pl_thk \
1953
1965
else 'Minimum plate thickness due to SLAMMING' + str (slm_min_pl_thk )+ ' [mm]'
1954
- self ._result_canvas .create_text ([20 * self ._global_shrink , (y + 7 * dy )* self ._global_shrink ],
1966
+ self ._result_canvas .create_text ([x * self ._global_shrink , (y + 7 * dy )* self ._global_shrink ],
1955
1967
text = text ,
1956
1968
font = self ._text_size ["Text 9 bold" ],anchor = 'nw' , fill = color_thk )
1957
1969
@@ -3530,9 +3542,6 @@ def on_close_load_window(self, returned_loads, counter, load_comb_dict):
3530
3542
3531
3543
for main_line in self ._line_dict .keys ():
3532
3544
for load_obj , load_line in self ._load_dict .values ():
3533
- # print(load_line, self._line_to_struc.keys())
3534
- # if load_line not in self._line_to_struc.keys():
3535
- # continue
3536
3545
if main_line in load_line and main_line in self ._line_to_struc .keys ():
3537
3546
self ._line_to_struc [main_line ][3 ].append (load_obj )
3538
3547
0 commit comments