Cette calculatrice ne paye pas de mine mais permet d'utiliser une formule de rendement pour les VMC Double-flux.
Je suis fier de participer à la communauté Purebasic en présentant ici ce humble programme.
Code : Tout sélectionner
Enumeration #PB_Compiler_EnumerationValue
#Window_0
EndEnumeration
Enumeration #PB_Compiler_EnumerationValue
#Image_0
#Vinout
#Vdf_out
#Voutin
#Rendement
#Text_0
#Text_1
#Text_2
#Text_3
#Text_4
#Text_5
EndEnumeration
Enumeration #PB_Compiler_EnumerationValue
#Img_0
EndEnumeration
UseJPEGImageDecoder()
CatchImage(#Img_0, ?Img_0)
Procedure InitWindow_0()
OpenWindow(#Window_0, 0, 0, 410, 250, "Calcul rendement VMC Double-Flux", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowColor(#Window_0, RGB(255,255,255))
ImageGadget(#Image_0 , 100, 30 , 237, 213, ImageID(#Img_0))
;
StringGadget(#Vinout , 160, 210, 30 , 20, "20")
StringGadget(#Vdf_out , 80 , 150, 30 , 20, "17")
StringGadget(#Voutin , 260, 10 , 30 , 20, "6")
StringGadget(#Rendement, 340, 170, 30 , 20, "78.6")
;
SetGadgetColor(#Rendement, #PB_Gadget_BackColor,RGB(255,255,0))
DisableGadget(#Rendement, 1)
TextGadget(#Text_0, 10, 150, 60, 20, "T In (°C)")
SetGadgetColor(#Text_0, #PB_Gadget_BackColor,RGB(255,255,255))
TextGadget(#Text_1, 190, 10, 60, 20, "T Ext (°C)")
SetGadgetColor(#Text_1, #PB_Gadget_BackColor,RGB(255,255,255))
TextGadget(#Text_2, 90, 210, 60, 20, "T Out (°C)")
SetGadgetColor(#Text_2, #PB_Gadget_BackColor,RGB(255,255,255))
TextGadget(#Text_3, 310, 140, 90, 20, "Rendement (%)")
SetGadgetColor(#Text_3, #PB_Gadget_BackColor,RGB(255,255,255))
TextGadget(#Text_5, 0, 10, 120, 20, "Rendement VMC DF")
SetGadgetColor(#Text_5, #PB_Gadget_FrontColor,RGB(255,255,255))
SetGadgetColor(#Text_5, #PB_Gadget_BackColor,RGB(0,128,192))
HyperLinkGadget(#Text_4, 0, 30,120,20,"(c) D. ROUMANET 2012", RGB(0,50,125))
SetGadgetColor(#Text_4, #PB_Gadget_BackColor,RGB(255,255,255))
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Gadget
; R = (Tinsufl - Text) / (Tin - Text)
Vin = Val(GetGadgetText(#Vinout))
VExt = Val(GetGadgetText(#Voutin))
Vout = Val(GetGadgetText(#Vdf_out))
If Vin-Vext <> 0
r.d = (Vout-VExt)/(Vin-Vext)*100
EndIf
Debug r
SetGadgetText(#Rendement,StrD(r,1))
Select EventGadget()
Case #Text_4
RunProgram("http://david.roumanet.free.fr/")
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
InitWindow_0()
Repeat
event = WaitWindowEvent(20)
Until Window_0_Events(event) = #False
DataSection
Img_0: IncludeBinary "C:\Users\parents\Downloads\vmc_DF.jpg"
EndDataSection

Le résultat final est disponible ici :
http://golfy.free.fr/Purebasic/RDF/RDF.exe
(les éléments constitutifs sont dans http://golfy.free.fr/Purebasic/RDF/)