Ejemplo n.º 1
0
AxesInformer::AxesInformer()
{    
    // set topics for arm axes sense
    ArmNode2 oArmNode;
    tron::SectionInformer::tune4Node(oArmNode, ArmNode2::eSECTION_AXES);

    if (isTuned())
    {
        // store channel pointers for faster access
        pPanChannel = oComsSender.getChannel(ArmNode2::eAXES_PAN);
        pTiltChannel = oComsSender.getChannel(ArmNode2::eAXES_TILT);
        pRadialChannel = oComsSender.getChannel(ArmNode2::eAXES_RAD);
        pPanSpeedChannel = oComsSender.getChannel(ArmNode2::eAXES_PAN_SPEED);
        pTiltSpeedChannel = oComsSender.getChannel(ArmNode2::eAXES_TILT_SPEED);    
        pRadialSpeedChannel = oComsSender.getChannel(ArmNode2::eAXES_RAD_SPEED);    
    }
}
Ejemplo n.º 2
0
bool CyclerServer::tune2Cycler(int i)
{
    if (i < 1 || i > 2)
    {
        LOG4CXX_WARN(logger2, serverName + ": invalid target, must be tuned to cycler 1 or 2");
        return false;
    }
    
    targetCycler = i;
    serverName += std::to_string(targetCycler);

    // set proper section
    int section = (targetCycler == 1) ? ArmNode2::eSECTION_CYCLER1 : ArmNode2::eSECTION_CYCLER2;
    
    ArmNode2 oArmNode;
    // set topics for arm cycler control
    tron::SectionServer::tune4Node(oArmNode, section);
    
    if (isTuned())
    {
        // store channel pointers for faster access
        pFreq1Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_MAIN_FREQ);
        pAmp1Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_MAIN_AMP);
        pAngle1Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_MAIN_ANGLE);
        pPhase1Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_MAIN_PHASE);

        pFreq2Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_SEC_FREQ);
        pAmp2Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_SEC_AMP);
        pAngle2Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_SEC_ANGLE);
        pPhase2Channel = oComsReceiver.getChannel(ArmNode2::eCYCLER_SEC_PHASE);

        pRunChannel = oComsReceiver.getChannel(ArmNode2::eCYCLER_ACTION);        
    }
    
    return btuned;
}
Ejemplo n.º 3
0
bool DvbStream::startBroadcast( QPtrList<ChannelDesc> *list, Ts2Rtp *rtp )
{
	int i, j;
	bool stop=false, newout;
	DVBout *o=0;
	int no=0;
	ChannelDesc *chan=list->at(0);
	QPtrList<ChannelDesc> broadcastList;
	broadcastList.setAutoDelete( true );

	if ( !isTuned() ) {
		for ( i=0; i<MAXTUNETRY; i++ ) {
			if ( tuneDvb( chan ) ) {
				i = -1;
				break;
			}
			else
				usleep(100000);
		}
		if ( i<0 )
			stop = true;
		else
			return false;
	}

	for ( i=0; i<(int)list->count(); i++ ) {
		newout = false;
		o = 0;
		for ( j=0; j<(int)out.count(); j++ ) {
			if ( out.at(j)->channel.name==list->at(i)->name )
				o = out.at(j);
		}

		if ( !o ) {
			o = new DVBout( *list->at(i), dvbDevice->adapter, dvbDevice->tuner, plug );
			connect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) );
			connect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) );
			connect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) );
			out.append( o );
			if ( !setPids( o ) ) {
				removePids( o );
				removeOut( o );
				o = 0;
			}
			else
				newout = true;
		}

		if ( o ) {
			if ( !o->goBroadcast( rtp ) ) {
				if ( newout ) {
					removePids( o );
					removeOut( o );
				}
			}
			else {
				broadcastList.append( new ChannelDesc( *list->at(i) ) );
				no++;
				if ( list->at(i)->fta && cam )
					cam->startService( list->at(i) );
			}
		}
	}