Skip to content

Commit

Permalink
Agrego:
Browse files Browse the repository at this point in the history
Etiqueta de tipo Huracan
Formateo de numeros
Arreglo fuentes
  • Loading branch information
lucasdepetrisd committed Jun 15, 2023
1 parent 66a1bdb commit bc10fc7
Show file tree
Hide file tree
Showing 6 changed files with 110,711 additions and 97,012 deletions.
22 changes: 14 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# Simulacion
import simulacion.simulacion as simu

import locale
locale.setlocale(locale.LC_ALL, 'es_ES')

class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
Expand All @@ -36,7 +39,7 @@ def __init__(self):
## ==> END ##

## SET ==> WINDOW TITLE
self.setWindowTitle('Animal Kingdom Simulator')
self.setWindowTitle('Simulador Animal Kingdom')
UIFunctions.labelTitle(self, 'Animal Kingdom Simulator')
UIFunctions.labelDescription(self, 'Seleccione una opción')
## ==> END ##
Expand Down Expand Up @@ -76,7 +79,7 @@ def __init__(self):
## USER ICON ==> SHOW HIDE
UIFunctions.userIcon(self, "AK", "url(:/24x24/icons/24x24/logoak24.png)", True)
UIFunctions.labelCredits(self, "Desarrollado por: Lucas Depetris, Santiago Figueroa, Emanuel Haro y Maribel Masucci")
UIFunctions.labelVersion(self, "v1.1")
UIFunctions.labelVersion(self, "v1.2")
## ==> END ##

## ==> MOVE WINDOW / MAXIMIZE / RESTORE
Expand Down Expand Up @@ -237,10 +240,10 @@ def generarSimu(self):
datos = simu.Simulacion()
nrovisit, problluvia, tipolluvia, probhuracan, perpot = datos
# nrovisit, problluvia, probhuracan, perpot = [10500, 0.85, 0.1, 98213]
self.ui.visitantes_label.setText(str(nrovisit) + " visitantes")
self.ui.visitantes_label.setText(locale.format_string("%.0f", nrovisit, grouping=True) + " visitantes")
self.ui.lluvia_label.setText("{:.2f}".format(problluvia * 100) + "%")
self.ui.huracan_label.setText("{:.2f}".format(probhuracan * 100) + "%")
self.ui.perdidas_label.setText("$" + str(perpot))
self.ui.perdidas_label.setText("$" + locale.format_string("%.2f", perpot, grouping=True))

if tipolluvia == "NO LLUEVE":
self.ui.lluvia_label.setStyleSheet("color: #FFFFFF")
Expand All @@ -262,12 +265,15 @@ def generarSimu(self):
if probhuracan <= 0.2:
self.ui.huracan_label.setStyleSheet("color: #FFFFFF")
self.ui.huracan_frame.setStyleSheet("border-image: url(:/24x24/icons/24x24/sol-viento24.png) 0 0 0 0 stretch stretch;")
self.ui.label_25.setText("No Huracán")
elif probhuracan <= 0.8:
self.ui.huracan_label.setStyleSheet("color: #FBC400")
self.ui.huracan_frame.setStyleSheet("border-image: url(:/24x24/icons/24x24/tornado24.png) 0 0 0 0 stretch stretch;")
self.ui.label_25.setText("Huracán")
else:
self.ui.huracan_label.setStyleSheet("color: #FF0000")
self.ui.huracan_frame.setStyleSheet("border-image: url(:/24x24/icons/24x24/tornado24.png) 0 0 0 0 stretch stretch;")
self.ui.label_25.setText("Huracán")


########################################################################
Expand All @@ -283,10 +289,10 @@ def generarSimu(self):

if __name__ == "__main__":
app = QApplication(sys.argv)
QtGui.QFontDatabase.addApplicationFont('./ui/fonts/Satoshi-Black.ttf')
QtGui.QFontDatabase.addApplicationFont('./ui/fonts/segoeui.ttf')
QtGui.QFontDatabase.addApplicationFont('./ui/fonts/Satoshi-Light.ttf')
QtGui.QFontDatabase.addApplicationFont('./ui/fonts/Satoshi-Regular.ttf')
QtGui.QFontDatabase.addApplicationFont(':/fonts/fonts/Satoshi-Black.ttf')
# QtGui.QFontDatabase.addApplicationFont('./ui/fonts/segoeui.ttf')
QtGui.QFontDatabase.addApplicationFont(':/fonts/fonts/Satoshi-Light.ttf')
QtGui.QFontDatabase.addApplicationFont(':/fonts/fonts/Satoshi-Regular.ttf')
font = QFont("Satoshi Regular")
app.setFont(font, "*") # type: ignore
window = MainWindow()
Expand Down
4 changes: 1 addition & 3 deletions src/simulacion/simulacion.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import random

def Simulacion():
dias = 31
# dias = 31
u = CongruencialMixto()
P = int(20000 + 10000 * u)

Expand Down Expand Up @@ -42,8 +42,6 @@ def Simulacion():
i += 1
print("GT: " + str(GT))

# TODO: Hacer segundo while para adelante

u = CongruencialMixto()
PL=u
MM=0
Expand Down
9 changes: 5 additions & 4 deletions src/ui/GUI_BASE_AK.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,9 @@ background-repeat: no-repeat;
<font>
<family>Satoshi Black</family>
<pointsize>16</pointsize>
<weight>75</weight>
<weight>50</weight>
<italic>false</italic>
<bold>true</bold>
<bold>false</bold>
<underline>false</underline>
<strikeout>false</strikeout>
<kerning>true</kerning>
Expand All @@ -1106,6 +1106,7 @@ background-repeat: no-repeat;
</property>
<property name="styleSheet">
<string notr="true">background: transparent;
font: url(:/fonts/fonts/Satoshi-Black.ttf)
</string>
</property>
<property name="text">
Expand Down Expand Up @@ -2697,7 +2698,7 @@ border-radius: 29px;
<widget class="QLabel" name="label_tipo_lluvia">
<property name="maximumSize">
<size>
<width>175</width>
<width>180</width>
<height>16777215</height>
</size>
</property>
Expand Down Expand Up @@ -2847,7 +2848,7 @@ border-radius: 29px;
<widget class="QLabel" name="label_25">
<property name="maximumSize">
<size>
<width>100</width>
<width>150</width>
<height>16777215</height>
</size>
</property>
Expand Down
5 changes: 5 additions & 0 deletions src/ui/files.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<file>icons/bigSize/sigma-logo.png</file>
<file>icons/bigSize/treeak.png</file>
</qresource>
<qresource prefix="fonts">
<file>fonts/Satoshi-Black.ttf</file>
<file>fonts/Satoshi-Light.ttf</file>
<file>fonts/Satoshi-Regular.ttf</file>
</qresource>
<qresource prefix="16x16">
<file>icons/16x16/cil-3d.png</file>
<file>icons/16x16/cil-4k.png</file>
Expand Down
Loading

0 comments on commit bc10fc7

Please sign in to comment.