SetGadgetState ou ReadQuad lent au bout d'un moment...
Re: SetGadgetState effroyablement lent...
Bon, j'ai trouvé une solution simple et efficace.
Encore merci pour votre temps
Encore merci pour votre temps
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: SetGadgetState effroyablement lent...
SPH a écrit :Bon, j'ai trouvé une solution simple et efficace.
Encore merci pour votre temps
Bin partage ta solution !¿
@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Re: [Résolu] SetGadgetState effroyablement lent...
Code : Tout sélectionner
OpenWindow(0, 0, 0, 749,60, "MutanteKey 2", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
longueur_q=10000000
ProgressBarGadget(99, 13, 30, 722, 15, 0, longueur_q)
z=0
For a=0 To longueur_q
z+1
If z>10000
SetGadgetState (99, a)
z=0
EndIf
quad_hazard2.q=q!quad_hazard
q=Random(65536*32768-1)
q*Random(65536*32768-1)
q*Random(65536*32768-1)
q*Random(65536*32768-1)
q*Random(65536*32768-1)
q+Random(65536*32768-1)
q+Random(65536*32768-1)
quad_hazard2!q
Next a
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
SetGadgetState effroyablement lent...
Bon, j'ai un probleme : quand on choisis un fichier un peu gros (pas tant que ca en fait : genre 30Mo), ca rame. Je ne sais pas si c'est le SetGadgetState(200, a) ou le ReadQuad(0) !
Code : Tout sélectionner
OpenWindow(0, 0, 0, 749, 596+27+20, "MutanteKey 2", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
Global Repertoire$
ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
ExplorerListGadget(2, 247,73,490,280, "*.*", #PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder)
Procedure Afficher_fichiers()
SetGadgetText(2, "") ; Vider la liste des fichiers
Repertoire$ = GetGadgetText(1) ; Voir quel est le répertoire sélectionné
SetGadgetText(2, Repertoire$) ; Remplir la liste avec le répertoire
SetGadgetText(100, Repertoire$) ; Remplir la liste avec le répertoire
EndProcedure
BindGadgetEvent(1, @Afficher_fichiers(), #PB_EventType_Change) ; #PB_EventType_LeftClick)
StringGadget(100,50,360,642,20,"") ; contient le chemin+fichier complet
ButtonGadget(16, 200, 450,342,20,"Lire le fichier + barre de progression")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
Case 2 ; Démarrer un d&d
; If EventType() = #PB_EventType_DragStart
; DragFiles(GetGadgetItemText(2, GetGadgetState(2)), #PB_Drag_Copy)
; EndIf
Select type
Case #PB_EventType_LeftClick
If GetGadgetItemText(2, GetGadgetState(2))<>"Nom"
Repertoire$=GetGadgetText(2)+GetGadgetItemText(2, GetGadgetState(2))
EndIf
SetGadgetText(100, Repertoire$)
EndSelect
Case 16
Gosub lecture
Select type
Case #PB_EventType_LeftClick
EndSelect
EndSelect
EndSelect
Until Evenement = #PB_Event_CloseWindow
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lecture:
ReadFile(0, GetGadgetText(100))
longueur_q=Lof(0)
ProgressBarGadget(200, 13, 400, 722, 15, 0, longueur_q)
z=0
For a=0 To longueur_q
z+1
If z>100000
SetGadgetState (200, a)
z=0
EndIf
q.q=ReadQuad(0)
;;;;; boucle vide mais ca n'empeche pas de ramer a mort au bout de 1 seconde pour un fichier lu de 60Mo
Next a
SetGadgetState (200,0)
CloseFile(0)
Beep_(500,500)
Return
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: SetGadgetState ou ReadQuad lent au bout d'un moment...
Essaye comme ça Mr Gosub
Code : Tout sélectionner
Declare Lis()
OpenWindow(0, 0, 0, 749, 596+27+20, "MutanteKey 2", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
Global Repertoire$
ExplorerTreeGadget(1, 11, 73, 230, 280, Repertoire$, #PB_Explorer_NoFiles)
ExplorerListGadget(2, 247,73,490,280, "*.*", #PB_Explorer_NoFolders|#PB_Explorer_NoParentFolder)
Procedure Afficher_fichiers()
SetGadgetText(2, "") ; Vider la liste des fichiers
Repertoire$ = GetGadgetText(1) ; Voir quel est le répertoire sélectionné
SetGadgetText(2, Repertoire$) ; Remplir la liste avec le répertoire
SetGadgetText(100, Repertoire$) ; Remplir la liste avec le répertoire
EndProcedure
BindGadgetEvent(1, @Afficher_fichiers(), #PB_EventType_Change) ; #PB_EventType_LeftClick)
StringGadget(100,50,360,642,20,"") ; contient le chemin+fichier complet
ButtonGadget(16, 200, 450,342,20,"Lire le fichier + barre de progression")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
Case 2 ; Démarrer un d&d
; If EventType() = #PB_EventType_DragStart
; DragFiles(GetGadgetItemText(2, GetGadgetState(2)), #PB_Drag_Copy)
; EndIf
Select type
Case #PB_EventType_LeftClick
If GetGadgetItemText(2, GetGadgetState(2))<>"Nom"
Repertoire$=GetGadgetText(2)+GetGadgetItemText(2, GetGadgetState(2))
EndIf
SetGadgetText(100, Repertoire$)
EndSelect
Case 16
Lis()
Select type
Case #PB_EventType_LeftClick
EndSelect
EndSelect
EndSelect
Until Evenement = #PB_Event_CloseWindow
End
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Procedure Lis()
If ReadFile(0, GetGadgetText(100))
longueur_q=Lof(0) : Debug "longueur_q " + longueur_q
ProgressBarGadget(200, 13, 400, 722, 15, 0, longueur_q)
z=0
For a = 0 To longueur_q
z+1
If z>100000
SetGadgetState (200, a)
z=0
EndIf
Next
q.q=ReadQuad(0)
CloseFile(0)
Beep_(500,500)
SetGadgetState (200, 0)
ProcedureReturn 1
Else
ProcedureReturn 0
EndIf
EndProcedure
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Re: SetGadgetState ou ReadQuad lent au bout d'un moment...
...je prend...
...mais, crois tu qu'une procedure elimine ce genre de bug ??
Peut tu essayer avec un fichier de 700Mo (un film koi) ?
Moi, la barre de progression se bloque au bout de 10 secondes...
...mais, crois tu qu'une procedure elimine ce genre de bug ??
Peut tu essayer avec un fichier de 700Mo (un film koi) ?
Moi, la barre de progression se bloque au bout de 10 secondes...
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Re: SetGadgetState ou ReadQuad lent au bout d'un moment...
Avec un 700 ça passe mais j'ai testé avec plus gros, ça coince effectivement.
Je rejoints tout de même le conseils de TazNormand pour ce qui est de ta progresse barre.. Tu l'as fait de 0 à 100 et tu affiches la progression au prorata de tes valeurs..
J'avoue que pour le moment ton code me pète la tête je fais une pause
Je rejoints tout de même le conseils de TazNormand pour ce qui est de ta progresse barre.. Tu l'as fait de 0 à 100 et tu affiches la progression au prorata de tes valeurs..
J'avoue que pour le moment ton code me pète la tête je fais une pause
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Re: SetGadgetState ou ReadQuad lent au bout d'un moment...
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits