コード例 #1
0
void CUniversalJoint::Init(PParams Desc)
{
	Anchor.x = Desc->Get<float>(CStrID("AnchorX"));
	Anchor.y = Desc->Get<float>(CStrID("AnchorY"));
	Anchor.z = Desc->Get<float>(CStrID("AnchorZ"));
	InitAxis(&AxisParams[0], Desc->Get<PParams>(CStrID("Axis0")));
	InitAxis(&AxisParams[1], Desc->Get<PParams>(CStrID("Axis1")));
}
コード例 #2
0
ファイル: Init.cpp プロジェクト: japgo/mygithub
	BOOL Init(void)
	{
		// PGM 중복 실행 체크
		HANDLE hEvent = ::OpenEventA(EVENT_ALL_ACCESS, FALSE, "KOSES_SEQUENCE");
		if (NULL != hEvent)
		{
			::MessageBoxA(NULL, "Another sequence is running!!", "Error" , MB_OK);
			return (FALSE);
		}	
		else
		{
			CreateEventA(NULL, FALSE, FALSE, "KOSES_SEQUENCE");
		}

		// Init Shared memory(kamelas)
		if(FALSE == g_mmi.Init())
		{
			::MessageBox(NULL, _T("Failed to Init Communication"), _T("Error") , MB_OK);
			return (FALSE);
		}

		// NV DATA Init..
		if(FALSE == g_nv.Init())
		{
			::MessageBoxA(NULL, "Failed to init nv file.", "Error", MB_OK);
			return (FALSE);
		}
		
		CAjinLib AjinLib;
		if(FALSE == AjinLib.Init())
		{
			::MessageBoxA(NULL, "Failed to init AjinLib.", "Error", MB_OK);
			return (FALSE);
		}

		g_input.m_nModuleCnt  = g_input.m_ioConfig.CreateInfo(AXT_SIO_RDI32);
		if(g_input.m_nModuleCnt != IN_MODULE_CNT)
		{
			::MessageBoxA(NULL, "D/I Module Count Error!!!", "Error", MB_OK);
			return (FALSE);
		}

		g_output.m_nModuleCnt = g_output.m_ioConfig.CreateInfo(AXT_SIO_RDO32);
		if(g_output.m_nModuleCnt != OUT_MODULE_CNT)
		{
			::MessageBoxA(NULL, "D/O Module Count Error!!!", "Error", MB_OK);
			return (FALSE);
		}

		pIOInst->m_pInAddr  = &g_input.m_ch[0];
		pIOInst->m_pOutAddr = &g_output.m_ch[0];

		g_output.Read();
		g_update.Input();

		InitAxis();
		InitPneumatic();

		g_LdMz.Init();
		g_InRail.Init();
		g_LdPicker.Init();
		STAGE::Init();
		g_UldPicker.Init();
		g_OutRail.Init();
		g_UldMz.Init();

		g_lampBuzzer.Init();
		g_tenkeyOpr.Init();

		g_opr.bStop			 = TRUE;
		g_opr.bEmg			 = FALSE;
		g_opr.bPaused		 = FALSE;
		g_opr.bCardInit		 = FALSE;
		g_opr.bCycleProgress = FALSE;

		// Lamp 초기화
		g_opr.bManual		= FALSE;
		g_opr.bAir			= IsOutOn(oMainAirSol);

		SetOut(oManualMkLamp, g_opr.bManual);
		SetOut(oAirSwLamp, IsOutOn(oMainAirSol)); 


		//timer 해상도 결정
		timeBeginPeriod(1);

		return (TRUE);
	}//------------------------------------------------------------------