示例#1
0
/*public*/ Positionable* LightIcon::finishClone(Positionable* p)
{
    LightIcon* pos = (LightIcon*)p;
    pos->setLight(getNameString());
    pos->setOffIcon(cloneIcon(getOffIcon(), pos));
    pos->setOnIcon(cloneIcon(getOnIcon(), pos));
    pos->setInconsistentIcon(cloneIcon(getInconsistentIcon(), pos));
    pos->setUnknownIcon(cloneIcon(getUnknownIcon(), pos));
    return PositionableLabel::finishClone((Positionable*)pos);
}
示例#2
0
void GeomScreen::s_select_gui() 
{
	vector<Geom*> selVec = getSelectedGeomVec();

	//==== Find Last Selected Geom ====//
	int last = geomUI->geomBrowser->value();
	if ( (last >= 2) && Fl::event_state(FL_ALT) )
	{	// select children
//		Geom* lastSel = aircraftPtr->getGeomVec()[last-2];
		Geom* lastSel = aircraftPtr->getDisplayGeomVec()[last-2];
		vector<Geom*> cVec;
		lastSel->loadChildren( cVec );
		for (int i = 0; i < (int)cVec.size(); i++)
		{
			selectGeomBrowser( cVec[i] );
			selVec.push_back(cVec[i]);
		}	
	}			

	//==== Check if Geom Already Selected ====//
	collaspeFlag = false;
	if ( lastSelectedGeom && selVec.size() == 1 )
	{
		Geom* lastSel = selVec[0];
		if ( lastSel == lastSelectedGeom )
		{
			collaspeFlag = true;
			lastSel->toggleDisplayChildrenFlag();
			if ( lastSel->getChildren().size() == 0 )
				lastSel->setDisplayChildrenFlag( 1 );
		}
	}
	lastSelectedGeom = NULL;
	if ( selVec.size() == 1 )
		lastSelectedGeom = selVec[0];


	aircraftPtr->setActiveGeomVec(selVec);
	loadActiveGeomOutput();
	screenMgrPtr->updateGeomScreens();
	aircraftPtr->flagActiveGeom();
	aircraftPtr->triggerDraw();
	loadGeomBrowser();

	if (selVec.size() == 0)
	{
		scriptMgr->addLine("select", "Aircraft");
		geomUI->geomBrowser->value(1);
	}
	else
	{
		scriptMgr->addLine("select", getNameString(selVec));
	}
}
示例#3
0
void GeomScreen::s_copy(int src, deque< Stringc > partVec)
{
	lastSelectedGeom = NULL;
	vector<Geom*> selVec;
	if (partVec.size() == 0)
		selVec = getSelectedGeomVec();
	else
		selVec = s_get_geom(partVec);
	
	aircraftPtr->copyGeomVec( selVec );

	if (src == ScriptMgr::GUI) scriptMgr->addLine("copy", getNameString(selVec));
}
static ClRcT gmsCliGroupsInfoListGet (
                    CL_IN   ClUint32T argc,
                    CL_IN   ClCharT** argv,
                    CL_OUT  ClCharT** ret)
{
    ClGmsGroupInfoT *groupInfoList  = NULL;
    ClUint32T        index          = 0;
    ClUint32T        numberOfGroups = 0;
    ClCharT          name[256]      = "";
    ClCharT          timeBuffer[256]= {0};
    ClTimeT          ti             = 0;
    ClInt32T maxBytes = 0;
    ClInt32T curBytes = 0;

    if (argc > 1)
    {
        _clGmsCliMakeError(ret, "Usage: allGroupsInfo\r");
        return CL_OK;
    }

    *ret = NULL;
    
    /* Take the lock on the database */
    clGmsMutexLock(gmsGlobalInfo.dbMutex);
    for (index = 0; index < gmsGlobalInfo.config.noOfGroups; index++)
    {
        if ((gmsGlobalInfo.db[index].view.isActive == CL_TRUE) &&
                (gmsGlobalInfo.db[index].viewType == CL_GMS_GROUP))
        {
            numberOfGroups++;
            groupInfoList = realloc(groupInfoList,
                                    sizeof(ClGmsGroupInfoT)*numberOfGroups);
            if (groupInfoList == NULL)
            {
                clGmsMutexUnlock(gmsGlobalInfo.dbMutex);
                return CL_ERR_NO_MEMORY;
            }
            memcpy(&groupInfoList[numberOfGroups-1],&gmsGlobalInfo.db[index].groupInfo, 
                    sizeof(ClGmsGroupInfoT));
        }
    }
    clGmsMutexUnlock(gmsGlobalInfo.dbMutex);

    clDebugPrintExtended(ret, &maxBytes, &curBytes, 
                         "-------------------------------------------------------------------------\n");
    clDebugPrintExtended(ret, &maxBytes, &curBytes,
                         "Total No Of Groups : %d\n",numberOfGroups);
    clDebugPrintExtended(ret, &maxBytes, &curBytes,
                         "-------------------------------------------------------------------------\n");
    if (numberOfGroups == 0)
    {
        goto done_ret;
    }

    clDebugPrintExtended(ret, &maxBytes, &curBytes,
                         "GroupName     GId  noOfMembers  setForDelete  IocMCAddr       creationTime\n");
    clDebugPrintExtended(ret, &maxBytes, &curBytes,
                         "-------------------------------------------------------------------------\n");
    for (index = 0; index < numberOfGroups; index++)
    {
        getNameString(&groupInfoList[index].groupName, name);
        ti = groupInfoList[index].creationTimestamp/CL_GMS_NANO_SEC;
        clDebugPrintExtended(ret, &maxBytes, &curBytes,
                             "%-13s %3d  %11d  %12s  %16llx %s",
                             name, groupInfoList[index].groupId, groupInfoList[index].noOfMembers,
                             groupInfoList[index].setForDelete == CL_TRUE ? "Yes": "No",
                             groupInfoList[index].iocMulticastAddr,
                             ctime_r((const time_t*)&ti,timeBuffer));
    }

done_ret:
    free(groupInfoList);
    return CL_OK;
}