本文整理汇总了C++中Alarm函数的典型用法代码示例。如果您正苦于以下问题:C++ Alarm函数的具体用法?C++ Alarm怎么用?C++ Alarm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Alarm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Prot_set_down_queue
void Prot_set_down_queue( int queue_type )
{
switch(queue_type) {
case NORMAL_DOWNQUEUE:
Down_queue_ptr = &Protocol_down_queue[NORMAL_DOWNQUEUE];
break;
case GROUPS_DOWNQUEUE:
Down_queue_ptr = &Protocol_down_queue[GROUPS_DOWNQUEUE];
break;
default:
Alarm(EXIT, "Prot_set_down_queue: Illegal queue_type (%d)\n", queue_type);
}
}
示例2: step
//vrider borren 1 steg
int step(void){
if(ML4IN &(2)){
//är i toppläge
Outone(1);
Outone(0);
hold((time_type)250);
Outzero(0);
hold((time_type)500);
return 1;
}
Alarm(2);
return 0;
}
示例3: LOGERROR
int CMFPI::N_Close()
{
int ret = m_apiCtrl.LFSAsyncClose(&m_CurrRequestID);
if(LFS_SUCCESS!=ret)
{
LOGERROR("%s,关闭失败!错误码:ret = %d",__FUNCTION__,ret);
Alarm("07000000");
emit CloseFailed();
}
return ret;
}
示例4: IdentifyFailed
//执行LFS_CMD_IDC_Get_RAW_DATA
int CMFPI::N_ReadRawData(WORD readData,LONG timeout)
{
m_FingerData = "";
timeout = (-1==timeout) ? 0 : timeout;//
if(timeout<0)
{
if ( readData == LFS_IDC_TRACK1)
{
emit IdentifyFailed();
}
else
{
emit DataAcquireFailed();
}
LOGERROR("%s,时间参数错误。设置了-1之外的负数,timeout = %d",__FUNCTION__,timeout);
Alarm("07000001");
return HM_PARAM_ERROR;
}
int ret=m_apiCtrl.LFSAsyncExecute(LFS_CMD_IDC_READ_RAW_DATA,&readData,timeout,&m_CurrRequestID);
if(LFS_SUCCESS!=ret)
{
if ( readData == LFS_IDC_TRACK1)
{
emit IdentifyFailed();
}
else
{
emit DataAcquireFailed();
}
LOGERROR("%s,执行错误,错误码:ret = %d",__FUNCTION__,ret);
Alarm("07000001");
}
return ret;
}
示例5: E_sub_time
sp_time E_sub_time( sp_time t, sp_time delta_t )
{
sp_time res;
res.sec = t.sec - delta_t.sec;
res.usec = t.usec - delta_t.usec;
if ( res.usec < 0 )
{
res.usec = res.usec + 1000000;
res.sec--;
}
if ( res.sec < 0 ) Alarm( EVENTS, "E_sub_time: negative time result.\n");
return ( res );
}
示例6: Log
void ErrorHandler::CreateErrorMsg(const char *ArcName,const wchar *ArcNameW,const char *FileName,const wchar *FileNameW)
{
#ifndef SILENT
if (FileName!=NULL)
Log(ArcName,St(MCannotCreate),FileName);
Alarm();
#if defined(_WIN_ALL) && !defined(_WIN_CE) && defined(MAX_PATH)
CheckLongPathErrMsg(FileName,FileNameW);
#endif
SysErrMsg();
#endif
}
示例7: E_get_time_monotonic
static sp_time E_get_time_monotonic(void)
#ifdef HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC
{
struct timespec t;
if (clock_gettime(CLOCK_MONOTONIC, &t) != 0) {
Alarm( EXIT, "E_get_time_monotonic: clock_gettime problems: %d '%s'\n", errno, strerror(errno) );
}
Now.sec = t.tv_sec;
Now.usec = (t.tv_nsec + 500) / 1000;
return Now;
}
示例8: N_Close
// 收到打开完成消息后调用该函数
void CMFPI::WR_OpenComplete(DWORD dwCommand, HRESULT hResult, LPVOID lpBuffer)
{
//异步打开成功
if(LFS_SUCCESS == hResult)
{
DWORD dwEvent = SERVICE_EVENTS | USER_EVENTS | SYSTEM_EVENTS | EXECUTE_EVENTS;
int ret = m_apiCtrl.LFSAsyncRegister(dwEvent,&m_CurrRequestID);
if(LFS_SUCCESS != ret)
{
N_Close();
emit OpenFailed();
LOGERROR("%s,注册事件失败,错误码:ret = %d",__FUNCTION__,ret);
Alarm("07000000");
}
}
else
{
emit OpenFailed();
LOGERROR("%s,打开失败,错误码:hResult = %d",__FUNCTION__,hResult);
Alarm("07000000");
}
}
示例9: while
void bhvm::execute_program (void)
{
try{
while (program_counter < int(program.size()))
{
//std::cout << program[program_counter] << std::endl; // debug... traza todo
exec_instruction(program[program_counter]);
++program_counter;
}
signal_debug(Alarm(MTK_HERE, "bhvm", MTK_SS("end of program." << std::endl << get_status()), alPriorDebug));
} catch(const mtk::Alarm& error) {
Alarm al(MTK_HERE, "bhvm", get_status(), alPriorCritic);
al.Add(error);
signal_error(al);
} catch (std::exception& e) {
signal_error(Alarm(MTK_HERE, "bhvm", MTK_SS("c++ exception " << e.what() << get_status()), alPriorCritic));
} catch(...) {
signal_error(Alarm(MTK_HERE, "bhvm", MTK_SS("unknown error " << get_status()), alPriorCritic));
}
}
示例10: handler
void handler(int sig)
{
static int beeps = 0;
if( beeps++ <5)
{
printf("beef\n");
Alarm(1);
}
else
{
printf("boom!\n");
exit(0);
}
}
示例11: ConnectionClosed
// 收到关闭完成消息后调用该函数
void CMFPI::WR_CloseComplete(DWORD dwCommand, HRESULT hResult, LPVOID lpBuffer)
{
if(LFS_SUCCESS == hResult)
{
m_bOpened = false;
emit ConnectionClosed();
LOGINFO("%s,事件:ConnectionClosed()",__FUNCTION__);
}
else
{
emit CloseFailed();
LOGERROR("%s,关闭设备失败,错误码:hResult = %d",__FUNCTION__,hResult);
Alarm("07000000");
}
}
示例12: Alarm
Property& Property::operator=(const Property& value) {
if (type==value.type || type==propTypeNone) {
name = value.name;
number=value.number;
text = value.text;
type = value.type;
date = value.date;
return *this;
}
else
throw Alarm (
MTK_HERE, "property",
"Tipos no compatibles",
alPriorError, alTypeNoPermisions
);
}
示例13: make_cptr
CountPtr< Signal<bhvm*> >
bhvm::register_external_command (const std::string& command)
{
CountPtr< Signal<bhvm*> > new_signal = make_cptr(new Signal<bhvm*>());
std::map <std::string, CountPtr < Signal<bhvm*> > >::iterator it = map_signal_external_commands.find(command);
if (it == map_signal_external_commands.end())
{
map_signal_external_commands.insert(std::make_pair(command, new_signal));
map_signal_external_commands[command].DANGEROUS_ThisInstance_NOT_Delete();
}
else
throw Alarm(MTK_HERE, "bhvm", MTK_SS("command already registered "), alPriorCritic);
return new_signal;
}
示例14: Nstep
int Nstep(int a){ //a == antal steg att steppa
int i;
for(i = 0; i<a; i++){ //steppa a gånger
if(0 == (BORR_STATUS & 0x2)){ //borren uppe?
Alarm(2);
return 0;
}
OutOne(1);
hold((time_type)250); //250 ms delay
OutOne(0);
hold((time_type)500);
OutZero(0);
}
return 1;
}
示例15: Ask
int Ask(const wchar *AskStr)
{
Alarm();
const int MaxItems=10;
wchar Item[MaxItems][40];
int ItemKeyPos[MaxItems],NumItems=0;
for (const wchar *NextItem=AskStr;NextItem!=NULL;NextItem=wcschr(NextItem+1,'_'))
{
wchar *CurItem=Item[NumItems];
wcsncpyz(CurItem,NextItem+1,ASIZE(Item[0]));
wchar *EndItem=wcschr(CurItem,'_');
if (EndItem!=NULL)
*EndItem=0;
int KeyPos=0,CurKey;
while ((CurKey=CurItem[KeyPos])!=0)
{
bool Found=false;
for (int I=0;I<NumItems && !Found;I++)
if (toupperw(Item[I][ItemKeyPos[I]])==toupperw(CurKey))
Found=true;
if (!Found && CurKey!=' ')
break;
KeyPos++;
}
ItemKeyPos[NumItems]=KeyPos;
NumItems++;
}
for (int I=0;I<NumItems;I++)
{
eprintf(I==0 ? (NumItems>4 ? L"\n":L" "):L", ");
int KeyPos=ItemKeyPos[I];
for (int J=0;J<KeyPos;J++)
eprintf(L"%c",Item[I][J]);
eprintf(L"[%c]%ls",Item[I][KeyPos],&Item[I][KeyPos+1]);
}
eprintf(L" ");
wchar Str[50];
getwstr(Str,ASIZE(Str));
wchar Ch=toupperw(Str[0]);
for (int I=0;I<NumItems;I++)
if (Ch==Item[I][ItemKeyPos[I]])
return I+1;
return 0;
}