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 651 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:06
....
IF gbThreadAtivada = False THEN
gbThreadAtivada = True
IF ThreadState(loopthread) = threadUnknown THEN

ThreadExecute(loopthread,threadNormal,WS_MultiThread_Loop)

END
END
.....
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 20 novembre 2014 - 22:06
Procedure WS_MultiThread_Loop()

WS_MarcadorDadosCorrida()

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

ok is boolean = False

IF gloNumCorrida > 0 THEN

ok = WS_Taxi_ConsultarCorrida(gloNumCorrida,"")

IF ok = True

ok = WS_Taxi_ConsultarPosicao(gloNumCorrida,"")

END

END
Membre enregistré
3 651 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 651 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:29
Procedure Timer_Break()

//Suspend the stopwatch
gbPause = True

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

duDurationis Duration //Duration (difference) to display

IF gbPause THEN
RETURN
END

//Time passed
duDuration = ChronoValue(1)

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

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

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

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

//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 651 messages
Popularité : +175 (223 votes)
Posté le 21 novembre 2014 - 13:30
Procedure Timer_Stop()

//Stop the stopwatch
EndTimerSys(gnTimerNum)

IF gbChronoStarted = True THEN
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 651 messages
Popularité : +175 (223 votes)
Posté le 28 août 2017 - 15:46
HCS.Timeout & HCS.FrameSize
Um variável HCS.Timeout é usado para modificar o tempo limite de conexão:
Para como conexões estabelecidas pelo HOpenConnection.
Para como aberturas de conexão automática.
Nota: Um variável HCS.Timeout é ignorado para os acessos ao servidor que não é uma conexão. Um pedido de execução é maior DO que o valor específico na variável HCS.Timeout não seria interrompida, por exemplo. Esse tempo limite deve ser especificado No aplicativo cliente, antes que seja uma conexão aberta sem servidor.
Exemplo

HCS.Timeout = INTRANET

Um variável HCS.FrameSize é usado para redimensionar o quadro de dados de saída. Em alguns casos, o redimensionamento dos quadros pode ser usado para adaptar o fluxo de dados de saída e de entrada aos desempenhos DO hardware usado. Por exemplo, se uma conexão entre os computadores e o cliente HFSQL Client / Server para através de redes de configuração (placa de rede, 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/