//
/***************************************************
***************************************************
TickTockTrigger.cpp -- interface of the 'TickTockTrigger' general purpose TickTock Trigger
version 1.0.8, Jan 15th, 2016
Copyright (C) 2015-2016 Acheld CHEN
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Acheld CHEN
http://blog.csdn.net/acheld
***************************************************
****************************************************/
#include "stdafx.h"
#include "TickTockTrigger.h"
#include "Log.h"
//CLog* g_plog = NULL;
extern CLog* g_plog;
CTrigger* g_Trigger;
void TockTrigger( LPVOID lpParam, DWORD_PTR dwPtr )
{
if (!lpParam || !dwPtr){
return;
}
pQpartTime Qpart1Time = (pQpartTime)lpParam;
LONGLONG Qpart1 = Qpart1Time->Qpart1;
char lpSpendTimes[256]= "\0";
strcpy(lpSpendTimes,Qpart1Time->lpSpendTime);
CTimeCount::Tock(Qpart1,lpSpendTimes);
//write message to txt file
if (!g_plog){
CLog::Init(g_plog);
}
if (g_plog){
g_plog->Log(lpSpendTimes);
}
}
void TickTrigger( LPVOID lpParam, DWORD_PTR dwPtr )
{
if (!lpParam || !dwPtr){
return;
}
pQpartTime Qpart1Time = (pQpartTime)lpParam;
LONGLONG Qpart1 = Qpart1Time->Qpart1;
CTimeCount::Tick(Qpart1,Qpart1Time->lpSpendTime);
pQpartTime ptrQpart1Time = new QpartTime();
ptrQpart1Time->Qpart1 = Qpart1;
strcpy(ptrQpart1Time->lpSpendTime,Qpart1Time->lpSpendTime);
g_Trigger->SetlpParam((LPVOID)ptrQpart1Time);
}
//
//
/***************************************************
TickTockTrigger.h -- interface of the 'TickTockTrigger' general purpose TickTock Trigger
version 1.0.8, Jan 15th, 2016
Acheld CHEN
http://blog.csdn.net/acheld
****************************************************/
#pragma once
#include "Trigger.h"
typedef struct strQpartTime
{
LONGLONG Qpart1;
char lpSpendTime[256];
strQpartTime()
{
Qpart1 = 0;
memset((void*)lpSpendTime,0,sizeof(lpSpendTime));
}
}QpartTime;
typedef QpartTime* pQpartTime;
void TockTrigger( LPVOID lpParam, DWORD_PTR dwPtr );
void TickTrigger( LPVOID lpParam, DWORD_PTR dwPtr );