Пример #1
0
Monitor::Monitor()
{

    monitor_model = new QStandardItemModel();
    monitor_model->setObjectName("monitor_model");

    initHeader();

    monitor_model_proxy = new MonitorFilter();
    monitor_model_proxy->setSourceModel(monitor_model);
    initMas();
}
Пример #2
0
int main(int argc, char *argv[])
{
    char *tmpptr;
    sigset_t    blockmask;
    void processMsge(void*);

    strncpy(ProcName,argv[0],256);
    ProcName[255] = '\0';

    gethostname(HostName,sizeof(HostName));

#ifdef LOGMSG
    ErrLogOp = LOGIT;
#else
    ErrLogOp = NOLOG;
#endif

    DebugLevel = DEBUG_LEVEL;
    if ( ! access("/vnmr/acqbin/Maslog",F_OK) )
    {
       DebugLevel = 1;
    }
    DPRINT1(1,"Starting: '%s'\n", ProcName);

    /* clear file creation mode mask,so that open has control */
    umask(000);

    /* initialize environment parameter vnmrsystem value */
    tmpptr = getenv("vnmrsystem");      /* vnmrsystem */
    if (tmpptr != (char *) 0) {
        strcpy(systemdir,tmpptr);       /* copy value into global */
    }
    else {   
        strcpy(systemdir,"/vnmr");      /* use /vnmr as default value */
    }

    INIT_ACQ_COMM( systemdir );         /* to interact with Expproc */

#ifndef DEBUG
#ifndef LINUX
    /* Make this program a daemon */
    makeItaDaemon(1);  /* make this program a daemon */
#endif
#endif

    /* Lets use the syslog facility provided by the OS. */
    logSysInit("Roboproc", LOG_LOCAL0);

    /* initialize exception handlers */
    setupexcepthandler();
#ifdef LINUX
    ignoreSIGIO();
#endif

    /* initialize command parser */
    initCmdParser();

    /* Initialize the Event Handlers Queue */
    /* Block SIGALRM, SIGIO and SIGCHLD interrupts during Event handling */
    sigemptyset( &blockmask );
    sigaddset( &blockmask, SIGALRM );
    sigaddset( &blockmask, SIGIO );
    sigaddset( &blockmask, SIGCHLD );
    sigaddset( &blockmask, SIGQUIT );
    sigaddset( &blockmask, SIGPIPE );
    sigaddset( &blockmask, SIGALRM );
    sigaddset( &blockmask, SIGTERM );
    sigaddset( &blockmask, SIGUSR1 );
    sigaddset( &blockmask, SIGUSR2 );
    setupForAsync(20, &blockmask);

    /* setup key database, and Message Queue, facilities */
    pRecvMsgQ = createMsgQ("Roboproc", (int) ROBOPROC_MSGQ_KEY,
                           (int) ROBO_MSG_SIZE);
    if (pRecvMsgQ == NULL)
       exit(1);

    setMsgQAsync(pRecvMsgQ,processMsge);

    initMas();

    asyncMainLoop();

    /* Orderly shutdown of the comm port */
    shutdownComm();

    exit(0);
}