Example #1
0
QState EOSConsole::ChangeExpCompMenu(EOSConsole *me, QEvt const *e) 
{
    switch (e->sig) 
    {
        case Q_ENTRY_SIG:
            PrintMenuTitles(2, menuUpDown);
            return Q_HANDLED();
        case MENU_SELECT_SIG: 
        {
            uint8_t new_value;
            
            switch (((MenuSelectEvt*)e)->item_index)
            {
            case 0:
                return Q_TRAN(&EOSConsole::ChangeSettingsMenu);
            
            case 2:
                if (vlExpCompensation.GetSize() > 0)
                {
                    new_value = vlExpCompensation.GetNext(dpExpComp, 1); 
                    Eos.SetProperty(EOS_DPC_ExposureCompensation, new_value);
                }
                return Q_HANDLED();
            case 1:
                if (vlExpCompensation.GetSize() > 0)
                {
                    new_value = vlExpCompensation.GetPrev(dpExpComp, 1); 
                    Eos.SetProperty(EOS_DPC_ExposureCompensation, new_value);
                }
                return Q_HANDLED();
            } // switch (((MenuSelectEvt*)e)->item_index)
        } // case MENU_SELECT_SIG:
    }
    return Q_SUPER(&EOSConsole::Active);
}
Example #2
0
QState EOSConsole::MainMenu(EOSConsole *me, QEvt const *e) 
{
    switch (e->sig) 
    {
        case Q_ENTRY_SIG:
            PrintMenuTitles(3, menuMain);
            return Q_HANDLED();
        case MENU_SELECT_SIG: 
        {
            switch (((MenuSelectEvt*)e)->item_index)
            {
                case 0:
                    PrintMenuTitles(3, menuMain);
                    return Q_HANDLED();
                case 1:
                    Eos.Capture();
                    return Q_HANDLED();
                case 2:
                    ShowParams();
                    PrintMenuTitles(3, menuMain);
                    return Q_HANDLED();
                case 3:
                    return Q_TRAN(&EOSConsole::ChangeSettingsMenu);
            }
        }
    }
    return Q_SUPER(&EOSConsole::Active);
}
Example #3
0
void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
{
    uint16_t ptp_error;

    if (stateConnected == stDisconnected || stateConnected == stInitial) {
        stateConnected = stConnected;

    if((ptp_error = Eos.SetProperty(EOS_DPC_LiveView, 0)) != PTP_RC_OK) {    //turn off live view
        PTPTRACE2("AO Camera: LiveView off failed", ptp_error);
    }

    if((ptp_error = Eos.SetProperty(EOS_DPC_LiveView, 2)) != PTP_RC_OK) {    //turn on live view
        PTPTRACE2("AO Camera: LiveView mode 2 failed", ptp_error);
    }

        AO_Camera->postFIFO(Q_NEW(QEvent, CAM_READY_SIG));
    }//if(stateConnected...
}
Example #4
0
// $(AOs::Commands::Statechart::focus_move) ..................................
QState Commands::focus_move(Commands *me, QEvent const *e) {
    switch (e->sig) {
        // @(/2/4/4/2)
        case Q_ENTRY_SIG: {
            //Notify(PSTR("AO_Commands: Focus Move Entry\r\n"));
            uint16_t ptp_error;
            if((ptp_error = Eos.MoveFocus(me->fstep_cmd)) != PTP_RC_OK) {    //one step towards the camera
                PTPTRACE2("AO_Commands: Focus Step failed", ptp_error);
                AO_Lights->postFIFO(Q_NEW(QEvent, LED_ERROR_SIG));
            }

            if(me->fstep_cmd == NSTEP) {
                --me->focus_position;
                }
                else {
                    ++me->focus_position;
                }
            me->cmd_delay.disarm();
            me->cmd_delay.postIn(me, FM_CMD_DELAY);
            return Q_HANDLED();
        }
        // @(/2/4/4/2)
        case Q_EXIT_SIG: {
            //Notify(PSTR("AO_Commands: Focus Move Exit\r\n"));

            return Q_HANDLED();
        }
        // @(/2/4/4/2/0)
        case CMD_DELAY_SIG: {
            //Notify(PSTR("AO_Commands: Focus Move: CMD_DELAY_SIG\r\n"));

            FocusMovedEvt *fme = Q_NEW( FocusMovedEvt, FOCUS_MOVED_SIG );
            fme->focus_position = me->focus_position;

            AO_Lights->postFIFO(Q_NEW(QEvent, LED_WORKING_SIG));

            AO_Camera->postFIFO( fme );
            return Q_TRAN(&Commands::idle);
        }
    }
    return Q_SUPER(&QHsm::top);
}
Example #5
0
// $(AOs::Commands::Statechart::capture) .....................................
QState Commands::capture(Commands *me, QEvent const *e) {
    switch (e->sig) {
        // @(/2/4/4/3)
        case Q_ENTRY_SIG: {
            //Notify(PSTR("AO_Commands: Capture Entry\r\n"));
            //AO_Lights->postLIFO(Q_NEW(QEvent, ALL_LEDS_OFF_SIG));
            //me->cap_delay.postIn(me, CAP_CMD_DELAY);

            //uint16_t ptp_error = Eos.MoveFocus(me->fstep_cmd); /* Eos.Capture(); */
            uint16_t ptp_error = Eos.Capture();
            me->cmd_delay.postIn(me, CAP_CMD_DELAY);
            //me->cap_delay.postIn(me, CAP_CMD_DELAY);
            //AO_Camera->postFIFO(Q_NEW(QEvent, CAP_COMPLETE_SIG));
            /*
            if (ptp_error != PTP_RC_OK) {
                PTPTRACE2("Capture Error", ptp_error);
            }
            */
            //me->postFIFO(Q_NEW(QEvent, CMD_DELAY_SIG));
            //me->cap_delay.disarm();



            return Q_HANDLED();
        }
        // @(/2/4/4/3)
        case Q_EXIT_SIG: {
            //Notify(PSTR("AO_Commands: Capture Exit\r\n"));
            AO_Camera->postFIFO(Q_NEW(QEvent, CAP_COMPLETE_SIG));
            return Q_HANDLED();
        }
        // @(/2/4/4/3/0)
        case CMD_DELAY_SIG: {
            //Notify(PSTR("AO_Commands: Capture Cmd Delay\r\n"));
            return Q_TRAN(&Commands::idle);
        }
    }
    return Q_SUPER(&QHsm::top);
}