Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

Problem with the touch panel framework

$
0
0

Hello I have this problema,

I am using SSP1.2.2 and GUIX Studio 5.3.3.

If I make very frequent clicks on the same element, I need to execute the action of the first press only and discard the rest.Executing this action takes quite some time, approximately 2 sec, after which I change the screen. So I have to dismiss the 'extra' clicks.

For doing this I activate a flag(EdicionData.fg_EventoEnCursoGUIX) that causes the touch to dismiss the events that come to it and ignore them until the flag is erased.The flag is erased when the action is finished and the new screen show is done.
To ignore the touch events I do: p_EventoGUIX->gx_event_type = 0.
But it happens that once the new screen is finished and painted, even after several seconds, if I click anywhere on the new screen, I get the event of pressing the key on the previous screen.As if the previous pulsations were waiting to be executed and i don`t want that, I only want to take the new clicks on the new screen.

This is my entry code:

static void GUIX_GenerarEventoGUIX(sf_touch_panel_payload_t *p_MensajeTouch, GX_EVENT *p_EventoGUIX)
{
    uint8  ui8_EstadoTimerActivado;
    uint8  *ui8_StrNombreTimer;
  
    /* Si evento GUIX en curso, no permitir mas eventos */
    if (EdicionData.fg_EventoEnCursoGUIX == 1)
    {
        p_EventoGUIX->gx_event_type = 0;
    }
    else
    {
        switch (p_MensajeTouch->event_type)
        {
            case SF_TOUCH_PANEL_EVENT_DOWN:
                p_EventoGUIX->gx_event_type = GX_EVENT_PEN_DOWN;
            break;
            case SF_TOUCH_PANEL_EVENT_UP:
                p_EventoGUIX->gx_event_type = GX_EVENT_PEN_UP;
            break;
            case SF_TOUCH_PANEL_EVENT_HOLD:
            case SF_TOUCH_PANEL_EVENT_MOVE:
                p_EventoGUIX->gx_event_type = GX_EVENT_PEN_DRAG; 
            break;
            default:
                p_EventoGUIX->gx_event_type = 0;
            break;
        }
    }
 
    /* Crear evento GUIX */
    if (p_EventoGUIX->gx_event_type != 0)
    {
        p_EventoGUIX->gx_event_sender = GX_ID_NONE;
        p_EventoGUIX->gx_event_target = GX_ID_NONE;
        p_EventoGUIX->gx_event_display_handle = 0;
 
        p_EventoGUIX->gx_event_payload.gx_event_pointdata.gx_point_x = p_MensajeTouch->y;
        p_EventoGUIX->gx_event_payload.gx_event_pointdata.gx_point_y = (800 - p_MensajeTouch->x);
    }
}
 
void GUIXTouch_Handler(void)
{
    GX_EVENT EventoGUIX;
    ssp_err_t RenesasSSPError;
    sf_message_header_t *p_MensajeTouch = NULL;
 
    /* En espera de recibir mensaje del touch, gestionado por MESSAGING_FRAMEWORK del SSP */
    RenesasSSPError = g_sf_message0.p_api->pend(g_sf_message0.p_ctrl, &FrwHmi_message_queue, (sf_message_header_t **) &p_MensajeTouch, TX_WAIT_FOREVER);
    if (RenesasSSPError == SSP_SUCCESS)
    {
        /* Seleccion clases de evento TOUCH, (SSP: MESSAGING_FRAMEWORK) */
        switch (p_MensajeTouch->event_b.class)
        {
            case SF_MESSAGE_EVENT_CLASS_TOUCH:
                /* Seleccion codigo de evento TOUCH, (SSP: MESSAGING_FRAMEWORK) */
                switch (p_MensajeTouch->event_b.code)
                {
                    case SF_MESSAGE_EVENT_NEW_DATA:
                        /* Convertir evento TOUCH en evento GUIX */
                        GUIX_GenerarEventoGUIX((sf_touch_panel_payload_t *) p_MensajeTouch, &EventoGUIX);
                    break;
                    default:
                        /* No ejecuta nada intencionadamente */
                    break;
                }
            break;
            default:
                /* No ejecuta nada intencionadamente */
            break;
        }
        /* Tras procesar mensaje de touch, liberar buffer de mensaje (SSP: MESSAGING_FRAMEWORK) */
        RenesasSSPError = g_sf_message0.p_api->bufferRelease(g_sf_message0.p_ctrl, (sf_message_header_t *) p_MensajeTouch, SF_MESSAGE_RELEASE_OPTION_FORCED_RELEASE);
        if (RenesasSSPError != SSP_SUCCESS)
        {
            BspIsr_RuntimeError(RENESASSSP_MESSAGE_ERROR, RenesasSSPError);
        }
 
        /* Enviar mensaje con evento GUIX */
        if (EventoGUIX.gx_event_type != 0)
        {
            gx_system_event_send(&EventoGUIX);
        }
    }

I hope someone can help me.

Regards

Amaia


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>