67 lines
1.4 KiB
C++
67 lines
1.4 KiB
C++
#include "stdafx.h"
|
|
#ifdef OLIVIA_COMPILA
|
|
//olivia
|
|
#include "olv_thr.h"
|
|
#include "olv.h"
|
|
#include "lock.h"
|
|
|
|
Colv_thr::Colv_thr(COlivia *olv)
|
|
{
|
|
this->olv=olv;
|
|
progreso=tarea=0;
|
|
msg_proce[0]=0;
|
|
}
|
|
|
|
Colv_thr::~Colv_thr(void)
|
|
{
|
|
}
|
|
//*************************************************************************************
|
|
/**
|
|
* Actualiza el progreso y la tarea por la que va
|
|
*/
|
|
void Colv_thr::pon_mi_progre(int tar, int prog)
|
|
{
|
|
tarea=tar;
|
|
progreso=prog;
|
|
|
|
pon_olv_progre();
|
|
}
|
|
//*************************************************************************************
|
|
/**
|
|
* Actualiza el mensaje de tarea
|
|
*/
|
|
void Colv_thr::pon_mi_msg(char *fmt, ...)
|
|
{
|
|
//formatea el string que llega
|
|
int k;
|
|
va_list arg_ptr;
|
|
|
|
if(strlen(fmt)==0)
|
|
{
|
|
msg_proce[0]=0;
|
|
return;
|
|
}
|
|
va_start(arg_ptr, fmt);
|
|
k = _vsnprintf(msg_proce,OLV_MAX_MSG_PROCE, fmt, arg_ptr);
|
|
va_end(arg_ptr);
|
|
if(k<0)
|
|
msg_proce[0]=0;
|
|
|
|
olvlog(LOG_TODO,"olv_limp_t",msg_proce);
|
|
|
|
pon_olv_progre();
|
|
}
|
|
//*************************************************************************************
|
|
/**
|
|
* Actualiza el progreso y la tarea por la que va al olivia general
|
|
*/
|
|
void Colv_thr::pon_olv_progre()
|
|
{
|
|
olv->lock->entro();
|
|
olv->progreso=progreso;
|
|
olv->tarea=tarea;
|
|
strcpy_s(olv->msg_proce,OLV_MAX_MSG_PROCE,msg_proce);
|
|
olv->lock->salgo();
|
|
}
|
|
//*************************************************************************************
|
|
#endif |