예제 #1
0
void boardRegThread::run()
{
    can_fd = open("/dev/can", O_RDWR);
    if(can_fd < 0)
    {
        qDebug()<<"in boardreg thread: can't open  can_dev ,can_fd = "<< can_fd <<endl;
        emit regFault();
        return;
    }
    else
        qDebug() <<"In boardRegThread:in boardreg thread: open  can_dev successfully!,can_fd = "<< can_fd <<endl;

    emit regStart();//start ,1 means nothing...forget it .just for the following board info show.
    //it is signal and slot.see regStartMessage()in boardRegDialog
    qDebug() << "board registing start..." << endl;

    if(isSingleBoardRegFlag)
    {
        signalBoardReg(singleBoardNum);
        updateBoardRegFlagToDB(singleBoardNum);
        close(can_fd);
        emit singleRegOver(singleBoardNum);
        qDebug() <<"In boardRegThread:emit singleRegOver signal--- board-flag is :"<< boardRegFlag[singleBoardNum -1];
        //after single board regover,isSingleBoardRegFlag=false
        isSingleBoardRegFlag = false;
    }
    else
    {
        i = 1;//boardnum ,use as global variable
        boardRegSum = 0;
        memset(&boardRegFlag,0,sizeof(boardRegFlag));

        sendBroadcast();

        /****   single board request registration information command frame */
        for( i = 1; i <= BOARDMAXINUM ; i++ )//i = 1; i <= BOARDMAXINUM ; i++
        {
            signalBoardReg(i);
        }

        //   if( !isReRegisterFlag )
        //   {
        saveBoardRegFlagToDB(boardRegFlag);
        close(can_fd);
        emit(regAllOver(boardRegSum));
        qDebug() <<"In boardRegThread:emit regAllOver signal-----total registerd board number is :"<< boardRegSum;

        //    }
        //    else
        //    {
        //        close(can_fd);
        //        qDebug()<<"IN boardRegThread::run():response system reset !";
        //    }
        //     qDebug()<<"IN boardRegThread::run(): run() !";
    }

}
예제 #2
0
BOOL CMonitorOptionsDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();

    CRegString regStart(L"Software\\Microsoft\\Windows\\CurrentVersion\\Run\\TortoiseSVN Monitor");
    m_bStartWithWindows = !CString(regStart).IsEmpty();

    UpdateData(FALSE);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
예제 #3
0
void CMonitorOptionsDlg::OnOK()
{
    UpdateData();

    CRegString regStart(L"Software\\Microsoft\\Windows\\CurrentVersion\\Run\\TortoiseSVN Monitor");

    if (m_bStartWithWindows)
    {
        regStart = CPathUtils::GetAppPath() + L" /tray";
    }
    else
    {
        regStart.removeValue();
    }
    CDialogEx::OnOK();
}