コード例 #1
0
static bool export_list(int _iH5File, int *_piVar, char* _pstName, int _iVarType)
{
    int iRet        = 0;
    bool bReturn    = false;
    int iItemNumber = 0;
    SciErr sciErr   = getListItemNumber(pvApiCtx, _piVar, &iItemNumber);
    if (sciErr.iErr)
    {
        printError(&sciErr, 0);
        return false;
    }


    //create groupe name
    char* pstGroupName	= createGroupName(_pstName);

    char pstMsg[256];
    sprintf(pstMsg, "list (%d)", iItemNumber);
    print_type(pstMsg);

    iLevel++;
    //open list
    void *pvList = openList(_iH5File, pstGroupName, iItemNumber);
    for (int i = 0 ; i < iItemNumber ; i++)
    {
        int *piNewVar = NULL;
        getListItemAddress(pvApiCtx, _piVar, i + 1, &piNewVar);//1 indexed
        char* pstPathName   = createPathName(pstGroupName, i);

        if (piNewVar == NULL)
        {
            //undefined item
            bReturn = export_undefined(_iH5File, piNewVar, pstPathName);
        }
        else
        {
            bReturn = export_data(_iH5File, piNewVar, pstPathName);
        }

        iRet = addItemInList(_iH5File, pvList, i, pstPathName);
        FREE(pstPathName);
        if (bReturn == false || iRet)
        {
            return false;
        }
    }
    iLevel--;
    closeList(_iH5File, pvList, _pstName, iItemNumber, _iVarType);
    FREE(pstGroupName);
    //close list
    return true;
}
コード例 #2
0
ファイル: dialog.cpp プロジェクト: code-cg/cgru
void Dialog::idReceived( int i_id, int i_uid)
{
	if( MonitorHost::id() > 0 )
	{
		if( i_id != MonitorHost::id())
		{
			connectionLost();
		}
	}
	else
	{
		if( i_id == 0)
		{
			connectionLost();
		}
		else
		{
			AFINFA("Dialog::idReceived: ID=%d UID=%d\n", i_id, i_uid)

			MonitorHost::connectionEstablished( i_id, i_uid);
			connectionEstablished();
			Watch::connectionEstablished();

			if( i_uid == -1 )
			{
				if( m_monitorType == Watch::WJobs )
				{
					ButtonMonitor::unset();
					closeList();
				}
				displayWarning("You are not exist.");
			}
			else
			{
				displayInfo("You have registered.");
				if( m_monitorType == Watch::WNONE )
				{
					ButtonMonitor::pushButton( Watch::WJobs);
				}
			}

			af::Msg * msg = new af::Msg( af::Msg::TMonitorUpdateId, i_id);
			m_qThreadClientUpdate.setUpMsg( msg);
		}
	}
}
コード例 #3
0
ファイル: dialog.cpp プロジェクト: code-cg/cgru
void Dialog::connectionLost()
{
    if( m_monitorType == Watch::WJobs )
    {
        if( afqt::QEnvironment::showOfflineNoise.n)
        {
            m_offlinescreen =  new OfflineScreen( m_listitems);
            m_vlayout_b->insertWidget( 0, m_offlinescreen);
        }
        closeList();
        ButtonMonitor::unset();
    }

    displayError("Connection lost.");
    m_connected = false;
    setWindowTitle( "Watch - " + afqt::stoq( af::Environment::getUserName()) + " (connecting...)");

	MonitorHost::connectionLost();

    sendRegister();

    Watch::connectionLost();
}