예제 #1
0
void TimepixProducer::OnStopRun()
{
	pixelmanCtrl->m_commHistRunCtrl.AddString(_T("End Of Run."));

	if ( GetRunStatusFlag() == TimepixProducer::RUN_STOPPED )
	{
		// give a warning to eudaq and do nothing
	    EUDAQ_WARN("StopRun requested when run not active");
		SetStatus(eudaq::Status::LVL_WARN, "StopRun requested when run not active");
	}
	else
	{
		// send STOP_RUN command to the daq thread
		PushCommand( STOP_RUN );

		// wait for the daq thread to lower the run active flag
		while ( GetRunStatusFlag() == RUN_ACTIVE )
		{
			Sleep(1);
		}
		
		//EUDAQ_DEBUG("Sending EORE");
		Sleep(1000);
		SendEvent(eudaq::RawDataEvent::EORE(_T("Timepix"),GetRunNumber(), GetEventNumber()));
		//std::cout << "Stop Run" << std::endl;
		//MessageBox(NULL, "End Of Run", "Message from Runcontrol",NULL);
		EUDAQ_INFO("Run Stopped");
		SetStatus(eudaq::Status::LVL_OK, "Run Stopped");

	}
}
예제 #2
0
    void ArAIProperty::CommandMoveTo(ArObjID targetID, float range /*= 0.0f*/)
    {
        if (!mAIList.empty())
        {
            if (mAIList.front()->GetType() == ENUM_AI_TYPE_MOVETOTARGET)
                return;
        }

        if (ArGameApp::Get()->GetEntityManager()->IsHero(GetEntity<ArGameEntity>()->GetID()))
        {
            double time = Driver->GetElapsedSecond();
            if (time - mLastMoveTime < DEF_AI_MOVE_REQUEST_MIN_TIME)
            {
                return;
            }
            mLastMoveTime = time;
        }
        if (GetEntity<ArGameEntity>()->IsDead())
        {
            return;
        }
        ClearAIList();

        auto pCmd = DI_NEW ArAIMoveToTargetCommand(mEntity, targetID, range);
        PushCommand(pCmd);
    }
예제 #3
0
void TimepixProducer::OnStartRun(unsigned param) 
{	
	pixelmanCtrl->m_commHistRunCtrl.AddString(_T("Start Of Run."));

	if ( GetRunStatusFlag() == TimepixProducer::RUN_ACTIVE )
	{
		// give a warning to eudaq and do nothing
	    EUDAQ_WARN("StartRun requested when run already active");
		SetStatus(eudaq::Status::LVL_WARN, "StartRun requested when run already active");
		return;
	}
	else
	{ 
		SetRunNumber( param );
		SetEventNumber( 1 ); // has to be 1 because BORE is event 0 :-(
		SendEvent(eudaq::RawDataEvent::BORE(_T("Timepix"), param )); // send param instead of GetRunNumber
		//std::cout << "Start Run: " << param << std::endl;
		//MessageBox(NULL, "Start of Run", "EudaqMessage", NULL);

		// send START_RUN command to the daq thread
		PushCommand( START_RUN );

		//SetStatus(eudaq::Status::LVL_OK, "Run Started1");
		// wait for the daq thread to raise the run active flag
		while ( GetRunStatusFlag() != RUN_ACTIVE )
		{
			Sleep(1);
		}

		EUDAQ_INFO("Run Started");
		SetStatus(eudaq::Status::LVL_OK, "Run Started");
			//Sleep(1);

	}
}
예제 #4
0
void System_AskForPermission(SystemPermission permission) {
	switch (permission) {
	case SYSTEM_PERMISSION_STORAGE:
		PushCommand("ask_permission", "storage");
		break;
	}
}
void UFlareSpacecraftNavigationSystem::PushCommandLinearBrake(const FVector& VelocityTarget)
{
	FFlareShipCommandData Command;
	Command.Type = EFlareCommandDataType::CDT_BrakeLocation;
	Command.VelocityTarget = VelocityTarget;
	PushCommand(Command);
}
void UFlareSpacecraftNavigationSystem::PushCommandDock(const FFlareDockingInfo& DockingInfo)
{
	FFlareShipCommandData Command;
	Command.Type = EFlareCommandDataType::CDT_Dock;
	Command.ActionTarget = DockingInfo.Station;
	Command.ActionTargetParam = DockingInfo.DockId;
	PushCommand(Command);
}
예제 #7
0
void TimepixProducer::OnReset()
{
	pixelmanCtrl->m_commHistRunCtrl.AddString(_T("Reset."));
	PushCommand( RESET );
	
	//std::cout << "Reset" << std::endl;
    //SetStatus(eudaq::Status::LVL_OK);
}
예제 #8
0
 void Controller::Resize(uint32_t width, uint32_t height) {
     if (mStatus == State::kRunning || mStatus == State::kPaused) {
         Command cmd(Cmd::kResize);
         cmd.arg1 = width;
         cmd.arg2 = height;
         PushCommand(cmd);
     }
 }
void UFlareSpacecraftNavigationSystem::PushCommandLocation(const FVector& Location, bool Precise)
{
	FFlareShipCommandData Command;
	Command.Type = EFlareCommandDataType::CDT_Location;
	Command.LocationTarget = Location;
	Command.PreciseApproach = Precise;
	PushCommand(Command);
}
예제 #10
0
 void Controller::Resume() {
     if (mStatus == State::kPaused) {
         std::unique_lock<std::mutex> locker(mConditionMutex);
         mStatus = State::kRunning;
         PushCommand(Cmd::kResume);
         mCondition.notify_all();
     }
 }
예제 #11
0
 void Controller::SeekTo(time_t milliseconds) {
     if (mStatus == State::kRunning || mStatus == State::kPaused) {
         Command cmd(Cmd::kSeek);
         cmd.arg1 = *reinterpret_cast<int*>(&milliseconds);
         cmd.arg2 = *(reinterpret_cast<int*>(&milliseconds) + 1);
         PushCommand(cmd);
     }
 }
예제 #12
0
internal rc_set_camera_matrix*
PushSetCameraMatrix(render_buffer* RenderBuffer, mat4 Matrix)
{
    rc_set_camera_matrix Command = {0};
    Command.Matrix               = Matrix;

    return (rc_set_camera_matrix*)PushCommand(RenderBuffer, RenderCommand_SetCameraMatrix, &Command);
}
예제 #13
0
internal rc_load_texture*
PushLoadTexture(render_buffer* RenderBuffer, texture_slot* TextureSlot, bool32 Interpolate, char* Filename)
{
    rc_load_texture Command = {0};
    Command.TextureSlot     = TextureSlot;
    Command.Filename        = Filename;

    return (rc_load_texture*)PushCommand(RenderBuffer, RenderCommand_LoadTexture, &Command);
}
예제 #14
0
void TimepixProducer::OnTerminate()
{	
	DEVID devId = pixelmanCtrl->mpxDevId[pixelmanCtrl->mpxCurrSel].deviceId;
	pixelmanCtrl->mpxCtrlAbortOperation(devId);
	pixelmanCtrl->m_commHistRunCtrl.AddString(_T("Terminated (I'll be back)"));
	//std::cout << "Terminate (press enter)" << std::endl;
    SetDone( true );
	PushCommand( TERMINATE );
	
}
예제 #15
0
internal rc_draw_rect_multitextured*
PushDrawRectMultitextured(render_buffer* RenderBuffer, vec2 Mid, vec2 Size)
{
    rc_draw_rect_multitextured Command = {0};
    Command.Mid                        = Mid;
    Command.Size                       = Size;
    Command.Color                      = Vec4i(1, 1, 1, 1);

    return (rc_draw_rect_multitextured*)PushCommand(RenderBuffer, RenderCommand_DrawRectMultitextured, &Command);
}
예제 #16
0
internal rc_draw_rect_outline*
PushDrawRectOutline(render_buffer* RenderBuffer, vec2 Mid, vec2 Size, vec4 Color)
{
    rc_draw_rect_outline Command = {0};
    Command.Mid                  = Mid;
    Command.Size                 = Size;
    Command.Color                = Color;

    return (rc_draw_rect_outline*)PushCommand(RenderBuffer, RenderCommand_DrawRectOutline, &Command);
}
예제 #17
0
internal rc_draw_line*
PushDrawLine(render_buffer* RenderBuffer, vec2 Start, vec2 End, vec4 Color)
{
    rc_draw_line Command = {0};
    Command.Start        = Start;
    Command.End          = End;
    Command.Color        = Color;

    return (rc_draw_line*)PushCommand(RenderBuffer, RenderCommand_DrawLine, &Command);
}
예제 #18
0
internal rc_load_font*
PushLoadFont(render_buffer* RenderBuffer, font_slot* FontSlot, char* Filename, float Height)
{
    rc_load_font Command = {0};
    Command.FontSlot     = FontSlot;
    Command.Filename     = Filename;
    Command.Height       = Height;
    Command.OversampleX  = 2;
    Command.OversampleY  = 2;

    return (rc_load_font*)PushCommand(RenderBuffer, RenderCommand_LoadFont, &Command);
}
예제 #19
0
    void Controller::Stop() {
        if (mStatus == State::kRunning || mStatus == State::kPaused) {
            if (mStatus == State::kPaused) {
                Resume();
            }

            PushCommand(Cmd::kStop);
            if (mWorker.joinable()) {
                mWorker.join();
            }
        }
    }
예제 #20
0
    void ArAIProperty::CommandAttack(ArObjID targetID)
    {
        if (!mAIList.empty())
        {
            if (mAIList.front()->GetType() == ENUM_AI_TYPE_ATTACK)
                return;
        }

        ClearAIList();
        auto pCmd = DI_NEW ArAIAttackCommand(mEntity, targetID);
        PushCommand(pCmd);
    }
예제 #21
0
    void ArAIProperty::CommandFollowTo(ArObjID targetID, float range /*= 0.0f*/)
    {
        if (!mAIList.empty())
        {
            if (mAIList.front()->GetType() == ENUM_AI_TYPE_FOLLOWTOTARGET)
                return;
        }

        ClearAIList();
        auto pCmd = DI_NEW ArAIFollowCommand(mEntity, targetID, range);
        PushCommand(pCmd);
    }
예제 #22
0
internal rc_draw_rect*
PushDrawRect(render_buffer* RenderBuffer, vec2 Mid, vec2 Size, texture_slot* TextureSlot)
{
    rc_draw_rect Command = {0};
    Command.Mid          = Mid;
    Command.Size         = Size;
    Command.Color        = Vec4i(1, 1, 1, 1);
    Command.TextureSlot  = TextureSlot;
    Command.MinUV        = Vec2i(0, 0);
    Command.MaxUV        = Vec2i(1, 1);

    return (rc_draw_rect*)PushCommand(RenderBuffer, RenderCommand_DrawRect, &Command);
}
void UFlareSpacecraftNavigationSystem::PushCommandRotation(const FVector& RotationTarget, const FVector& LocalShipAxis)
{
	if (RotationTarget.IsNearlyZero() || LocalShipAxis.IsNearlyZero())
	{
		return;
	}

	FFlareShipCommandData Command;
	Command.Type = EFlareCommandDataType::CDT_Rotation;
	Command.RotationTarget = RotationTarget;
	Command.LocalShipAxis = LocalShipAxis;
	FLOGV("UFlareSpacecraftNavigationSystem::PushCommandRotation RotationTarget '%s'", *RotationTarget.ToString());
	FLOGV("UFlareSpacecraftNavigationSystem::PushCommandRotation LocalShipAxis '%s'", *LocalShipAxis.ToString());
	PushCommand(Command);
}
예제 #24
0
internal rc_load_texture_raw*
PushLoadTextureRaw(render_buffer* RenderBuffer,
                   texture_slot* TextureSlot,
                   bool32 Interpolate,
                   uint8* Data,
                   uint32 Width,
                   uint32 Height)
{
    rc_load_texture_raw Command = {0};
    Command.TextureSlot         = TextureSlot;
    Command.Data                = Data;
    Command.Width               = Width;
    Command.Height              = Height;

    return (rc_load_texture_raw*)PushCommand(RenderBuffer, RenderCommand_LoadTextureRaw, &Command);
}
void ThreadCommandQueue::PushExitCommand(bool wait)
{
    // Exit is processed in two stages:
    //  - First, ExitEnqueued flag is set to block further commands from queuing up.
    //  - Second, the actual exit call is processed on the consumer thread, flushing
    //    any prior commands.
    //    IsExiting() only returns true after exit has flushed.
    {
        Lock::Locker lock(&pImpl->QueueLock);
        if (pImpl->ExitEnqueued)
            return;
        pImpl->ExitEnqueued = true;
    }

    PushCommand(ThreadCommandQueueImpl::ExitCommand(pImpl, wait));
}
예제 #26
0
internal rc_draw_string*
PushDrawString(render_buffer* RenderBuffer, font_slot* FontSlot, vec2 Pos, float Scale, char* String)
{
    rc_draw_string Command = {0};
    Command.FontSlot       = FontSlot;
    Command.Pos            = Pos;
    Command.Color          = Vec4(0.0f, 0.0f, 0.0f, 1.0f);
    Command.Scale          = Scale;

    rc_draw_string* Result = (rc_draw_string*)PushCommand(RenderBuffer, RenderCommand_DrawString, &Command);
    while(*String)
    {
        *RenderBuffer->Current = (u8)*String;
        ++RenderBuffer->Current;
        ++Result->CharCount;
    }
    return (Result);
}
예제 #27
0
internal rc_draw_string*
PushDrawStringSized(
    render_buffer* RenderBuffer, font_slot* FontSlot, vec2 Pos, float Scale, char* String, uint16 Length)
{
    rc_draw_string Command = {0};
    Command.FontSlot       = FontSlot;
    Command.Pos            = Pos;
    Command.Color          = Vec4(0.0f, 0.0f, 0.0f, 1.0f);
    Command.Scale          = Scale;

    rc_draw_string* Result = (rc_draw_string*)PushCommand(RenderBuffer, RenderCommand_DrawString, &Command);
    for(uint16 i = 0; i < Length; ++i)
    {
        *RenderBuffer->Current = (u8)String[i];
        ++RenderBuffer->Current;
    }
    Result->CharCount = Length;
    return (Result);
}
예제 #28
0
 void ArAIProperty::CommandMoveTo(const DiK2Pos& pos, float range /*= 0.0f*/)
 {
     if (ArGameApp::Get()->GetEntityManager()->IsHero(GetEntity<ArGameEntity>()->GetID()))
     {
         double time = Driver->GetElapsedSecond();
         if (time - mLastMoveTime < DEF_AI_MOVE_REQUEST_MIN_TIME)
         {
             return;
         }
         mLastMoveTime = time;
     }
     if (GetEntity<ArGameEntity>()->IsDead())
     {
         return;
     }
     ClearAIList();
     
     auto pCmd = DI_NEW ArAIMoveCommand(mEntity, pos, range);
     PushCommand(pCmd);
 }
예제 #29
0
void System_SendMessage(const char *command, const char *parameter) {
	PushCommand(command, parameter);
}
예제 #30
0
void LaunchEmail(const char *email_address) {
	PushCommand("launchEmail", email_address);
}