Пример #1
0
void gkParentActuator::execute(void)
{

	if (isPulseOff())
		return;

	switch (m_mode)
	{
	case PA_SET:
		{
			gkScene* scene = m_object->getOwner();
			if (scene->hasObject(m_obj))
			{
				gkGameObject* par = scene->getObject(m_obj);

				if (m_object->getParent() != par)
				{
					if (m_object->getParent())
						m_object->clearParentInPlace();
					m_object->setParentInPlace(par);
				}
			}
			break;
		}
	case PA_CLEAR:
		m_object->clearParentInPlace();
		break;
	}
	setPulse(BM_OFF);

}
Пример #2
0
void gkVisibilityActuator::execute(void)
{
	if (isPulseOff())
		return;

	if (!m_object->isInstanced())
		return;

	m_object->getNode()->setVisible((m_flag & VA_INVIS_FLAG) == 0, (m_flag & VA_CHILDREN) != 0);

	setPulse(BM_OFF);

}
Пример #3
0
/** Resets the electometer, rebooting the device, sleeping for 1 second, and then downloading all of the settings.
  */
asynStatus drvAPS_EM::reset()
{
    int range;
    double integrationTime;
    
    getIntegerParam(P_Range, &range);
    getDoubleParam(P_IntegrationTime, &integrationTime);
    writeMeter(REBOOT_COMMAND, 0);
    epicsThreadSleep(1.0);
    setRange(range);
    epicsThreadSleep(0.01);
    setPulse();
    epicsThreadSleep(0.01);
    setPeriod();
    epicsThreadSleep(0.01);
    setIntegrationTime(integrationTime);
    epicsThreadSleep(0.01);
    setGo();
    return asynSuccess;
}
Пример #4
0
void gkPropertyActuator::execute(void)
{
	if (isPulseOff())
		return;

	if (!m_object->isInstanced())
		return;

	if (!m_init)
	{
		if (m_object->hasVariable(m_prop))
		{

			m_cur = m_object->getVariable(m_prop);
			m_init = true;

			if (m_value.find("\"") != m_value.npos)
				utStringUtils::trim(m_value, "\"");

			if (m_type == PA_TOGGLE)
				m_propVal.assign(*m_cur);
			else
				m_propVal.setValue(m_cur->getType(), m_value);

			if (m_type == PA_COPY)
			{
				if (!m_othOb.empty())
				{
					gkGameObject* ob = m_object->getOwner()->getObject(m_othOb);
					if (ob->hasVariable(m_value))
						m_oth = ob->getVariable(m_value);
				}
			}
		}
	}

	if (m_cur && !m_cur->isReadOnly())
	{
		switch (m_type)
		{
		case PA_ASSIGN:
			m_cur->assign(m_propVal);
			break;
		case PA_ADD:
			m_cur->add(m_propVal);
			break;
		case PA_TOGGLE:
			if (m_cur->hasInverse())
			{
				m_cur->toggle(m_propVal);
				m_propVal.assign(*m_cur);
			}
			break;
		case PA_COPY:
			if (m_oth) m_cur->assign(*m_oth);
			break;
		}
	}

	setPulse(BM_OFF);

}