PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Example Multi Thread
Example Multi Thread
Débuté par adrianoboller, 20 nov. 2014 22:06 - 9 réponses
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:06
....
IFgbThreadAtivada=FalseTHEN
gbThreadAtivada=True
IFThreadState(loopthread) =threadUnknownTHEN

ThreadExecute(loopthread,threadNormal,WS_MultiThread_Loop)

END
END
.....
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:06
ProcedureWS_MultiThread_Loop()

WS_MarcadorDadosCorrida()

gbThreadAtivada=False
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:07
ProcedureWS_MarcadorDadosCorrida()

ok isboolean=False

IFgloNumCorrida>0THEN

ok=WS_Taxi_ConsultarCorrida(gloNumCorrida,"")

IFok=True

ok=WS_Taxi_ConsultarPosicao(gloNumCorrida,"")

END

END
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:09
// The first code posted it should be running on an equal Timer Clock example that comes along with Windev Mobile.

//No primeiro codigo postado o mesmo deve estar sendo executado sobre um timer igual do exemplo Clock que vem junto com o Windev Mobile.
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:29
ProcedureTimer_Break()

//Suspend the stopwatch
gbPause=True

//Time the time passed that must not be counted
ChronoStart(2)
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:30
ProcedureTimer_Loop()

duDurationis Duration//Duration (difference) to display

IFgbPauseTHEN
RETURN
END

//Time passed
duDuration=ChronoValue(1)

//Deduces the duration that must not be counted
duDuration=duDuration-gduTimeNotCounted

//------------------------------------------

//You code....................... HERE!!!!!
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:30
ProcedureTimer_Play()

//If there is a start time for the stopwatch, it means that time calculation resumes after a stop
IFgbPauseTHEN

//Duration not to count in milliseconds (it is a cumulated duration for all the stops performed)
duDuration is Duration=ChronoEnd(2)
gduTimeNotCounted+=duDuration
gbPause=False

ELSE

//Otherwise, initialize the beginning of the stopwatch
ChronoStart(1)
gbChronoStarted=True
gnTimerNum=TimerSys(Timer_Loop,20)

END
>
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:30
ProcedureTimer_Stop()

//Stop the stopwatch
EndTimerSys(gnTimerNum)

IFgbChronoStarted=TrueTHEN
ChronoEnd(1)
gbChronoStarted=False

END

//Re-initialization
gduTimeNotCounted=0
gbPause=False

//EDT_Duration = "00:00:00"
>
Posté le 11 mars 2016 - 20:39
Can I use this to run a thread that when the app is minimized can also read NFC tags? I got the following code but it doesn't work

Code of project initialization
ThreadExecute("NFC_Reader",threadGlobalContext,ReadTag)
Notif is Notification
Notif..ActivateApplication = True
Notif..Title = "Modo de lectura de NFC..."
ThreadPersistent("NFC_Reader",Notif)

PROCEDURE ReadTag()
Info("leer")
tag is nfcTag
tag = NFCReadTag()
IF NOT ErrorOccurred THEN
//Info(StringBuild("Reading a NFC tag of %1 type", tag..Type))
FOR EACH data OF tag..Data
SWITCH data..Content
CASE "WiFi"
IF WiFiStatus() THEN
WiFiActivate(False)
ELSE
WiFiActivate(True)
END
END
END
END

>Not even the Info in the procedure is showing, and the thread persistent returns true
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 28 août 2017 - 15:46
HCS.Timeout&HCS.FrameSize
Um variávelHCS.Timeouté usado para modificar o tempo limitedeconexão:
Para como conexões estabelecidas peloHOpenConnection.
Para como aberturasdeconexão automática.
Nota:Um variávelHCS.Timeouté ignorado para os acessos ao servidor que não é uma conexão.Um pedidodeexecução é maiorDOque o valor específico na variávelHCS.Timeoutnão seria interrompida,por exemplo.Esse tempo limite deve ser especificadoNoaplicativo cliente,antes que seja uma conexão aberta sem servidor.
Exemplo

HCS.Timeout=INTRANET

Um variávelHCS.FrameSizeé usado para redimensionar o quadrodedadosdesaída.Em alguns casos,o redimensionamento dos quadros pode ser usado para adaptar o fluxodedadosdesaída edeentrada aos desempenhosDOhardware usado.Por exemplo,se uma conexão entre os computadores e o cliente HFSQLClient/Server para atravésderedesdeconfiguração(placaderede,SWITCH,roteador,vpn, ...)

HCS.FrameSize=hInternetFrame


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/>