Ver Mensaje Individual
  #25  
Viejo 15/01/16, 10:26:25
Array

[xs_avatar]
Fitoma
Usuario invitado
 
Mensajes: n/a

Buenas,

Retomo el mensaje (que dejo oculto) con la solución a mi duda.
(Click para mostrar/ocultar)

---------------------------------------------------------------------------------------------------------------
Muy buenas,

no sé si esto va aquí (si no, edito y vuelvo cuando lo tenga en marcha) pero estoy haciéndome una taréa para las salidas en bici y me he atascado con una cosa.

La idea es que, desde el Pebble, la tarea active el GPS (resuelto), abra el Oruxmaps (hecho) y comience a grabar la ruta. Según la documentación de Oruxmaps, tan solo hay que lanzar el intent de la imagen, pero no sé si lo pongo donde no debo o si falta algún parámetro, pero no llega a hacerlo (tampoco da error y la tarea sigue)



Para más adelante dejo el hacer un bucle que espere a tener fijada la posición del GPS, me avise y empiece a grabar, otra tarea para meter waypoints, para seguir una ruta cargada, etc, etc

Saludos!

Edito: estoy empanao! En la imagen se ve que falta un punto!! Hice copia pega del pdf del manual de oruxmaps y se perdió por el camino. Cuando tenga probadas la diversas opciones las pondré por aquí.
---------------------------------------------------------------------------------------------------------------


La idea era empezar a grabar una ruta con Oruxmaps con un sólo botón del pebble (steel, en mi caso) La tarea hace lo siguiente:

- Enciende el GPS (con Secure Settings)
- Intenta obtener una posición.
- Espera hasta que la fija (y es reciente)
- Abre Oruxmpas (esto no es necesario)
- Inicia la grabación.
- Hace sonar un pitido en el móvil y manda notificación al Pebble.

Os dejo el XML exportado:

(Click para mostrar/ocultar)

Código:
<TaskerData sr="" dvi="1" tv="4.8">
    <Task sr="task9">
        <cdate>1452962709251</cdate>
        <edate>1453125880208</edate>
        <id>9</id>
        <nme>BICI ON</nme>
        <pri>100</pri>
        <Action sr="act0" ve="7">
            <code>11820</code>
            <Bundle sr="arg0">
                <Vals sr="val">
                    <com.intangibleobject.securesettings.plugin.extra.BLURB>GPS Enabled</com.intangibleobject.securesettings.plugin.extra.BLURB>
                    <com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type>
                    <com.intangibleobject.securesettings.plugin.extra.ENABLED>true</com.intangibleobject.securesettings.plugin.extra.ENABLED>
                    <com.intangibleobject.securesettings.plugin.extra.ENABLED-type>java.lang.Boolean</com.intangibleobject.securesettings.plugin.extra.ENABLED-type>
                    <com.intangibleobject.securesettings.plugin.extra.SETTING>gps</com.intangibleobject.securesettings.plugin.extra.SETTING>
                    <com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type>
                    <com.twofortyfouram.locale.intent.extra.BLURB>GPS Enabled</com.twofortyfouram.locale.intent.extra.BLURB>
                    <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
                    <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
                    <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
                </Vals>
            </Bundle>
            <Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str>
            <Str sr="arg2" ve="3">Secure Settings</Str>
            <Int sr="arg3" val="0" />
        </Action>
        <Action sr="act1" ve="7">
            <code>902</code>
            <Int sr="arg0" val="0" />
            <Int sr="arg1" val="10" />
            <Int sr="arg2" val="1" />
            <Int sr="arg3" val="1" />
        </Action>
        <Action sr="act2" ve="7">
            <code>35</code>
            <Int sr="arg0" val="1" />
            <Int sr="arg1" val="0" />
            <Int sr="arg2" val="0" />
            <Int sr="arg3" val="0" />
            <Int sr="arg4" val="0" />
            <ConditionList sr="if">
                <bool0>And</bool0>
                <Condition sr="c0" ve="3">
                    <lhs>%LOCTMS</lhs>
                    <op>12</op>
                    <rhs></rhs>
                </Condition>
                <Condition sr="c1" ve="3">
                    <lhs>%TIMES - %LOCTMS</lhs>
                    <op>6</op>
                    <rhs>10</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act3" ve="7">
            <code>20</code>
            <App sr="arg0">
                <appClass>com.orux.oruxmaps.actividades.ActivityMap2</appClass>
                <appPkg>com.orux.oruxmaps</appPkg>
                <label>OruxMaps</label>
            </App>
            <Str sr="arg1" ve="3" />
            <Int sr="arg2" val="0" />
            <Int sr="arg3" val="0" />
        </Action>
        <Action sr="act4" ve="7">
            <code>30</code>
            <Int sr="arg0" val="0" />
            <Int sr="arg1" val="2" />
            <Int sr="arg2" val="0" />
            <Int sr="arg3" val="0" />
            <Int sr="arg4" val="0" />
        </Action>
        <Action sr="act5" ve="7">
            <code>877</code>
            <Str sr="arg0" ve="3">com.oruxmaps.INTENT_START_RECORD_NEWTRACK</Str>
            <Int sr="arg1" val="0" />
            <Str sr="arg2" ve="3" />
            <Str sr="arg3" ve="3" />
            <Str sr="arg4" ve="3" />
            <Str sr="arg5" ve="3" />
            <Str sr="arg6" ve="3" />
            <Str sr="arg7" ve="3" />
            <Str sr="arg8" ve="3" />
            <Int sr="arg9" val="0" />
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%LOCACC</lhs>
                    <op>6</op>
                    <rhs>20</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act6" ve="7">
            <code>171</code>
            <Int sr="arg0" val="10000" />
            <Int sr="arg1" val="200" />
            <Int sr="arg2" val="100" />
            <Int sr="arg3" val="4" />
        </Action>
        <Action sr="act7" ve="7">
            <code>171</code>
            <Int sr="arg0" val="10000" />
            <Int sr="arg1" val="200" />
            <Int sr="arg2" val="100" />
            <Int sr="arg3" val="4" />
        </Action>
        <Action sr="act8" ve="7">
            <code>523</code>
            <Str sr="arg0" ve="3">COMIENZO GRABACIÓN RUTA.</Str>
            <Str sr="arg1" ve="3" />
            <Img sr="arg2" ve="2" />
            <Int sr="arg3" val="0" />
            <Int sr="arg4" val="0" />
            <Int sr="arg5" val="3" />
        </Action>
    </Task>
</TaskerData>
A la hora de comprobar que ha fijado posición miro que haya un %LOCTMS (fecha de la localización) y que sea de hace menos de 10 segundos, por si acaso tiene una posición "antigua" guardada.


De paso me he hecho el botón de parar grabación, que se ha quedado en lo más básico: parar la grabación, pitar y notificar.

(Click para mostrar/ocultar)

Código:
<TaskerData sr="" dvi="1" tv="4.8">
    <Task sr="task3">
        <cdate>1452898686535</cdate>
        <edate>1453125933562</edate>
        <id>3</id>
        <nme>BICI OFF</nme>
        <pri>100</pri>
        <Action sr="act0" ve="7">
            <code>877</code>
            <Str sr="arg0" ve="3">com.oruxmaps.INTENT_STOP_RECORD</Str>
            <Int sr="arg1" val="0" />
            <Str sr="arg2" ve="3" />
            <Str sr="arg3" ve="3" />
            <Str sr="arg4" ve="3" />
            <Str sr="arg5" ve="3" />
            <Str sr="arg6" ve="3" />
            <Str sr="arg7" ve="3" />
            <Str sr="arg8" ve="3" />
            <Int sr="arg9" val="0" />
        </Action>
        <Action sr="act1" ve="7">
            <code>171</code>
            <Int sr="arg0" val="9263" />
            <Int sr="arg1" val="500" />
            <Int sr="arg2" val="50" />
            <Int sr="arg3" val="4" />
        </Action>
        <Action sr="act2" ve="7">
            <code>523</code>
            <Str sr="arg0" ve="3">GRABACIÓN PARADA.</Str>
            <Str sr="arg1" ve="3" />
            <Img sr="arg2" ve="2" />
            <Int sr="arg3" val="0" />
            <Int sr="arg4" val="0" />
            <Int sr="arg5" val="3" />
        </Action>
    </Task>
</TaskerData>
También tengo una tarea para continuar una ruta parada, que es básicamente como esta pero con el intent com.oruxmaps.INTENT_START_RECORD_CONTINUE, y otra que pone una marca en el mapa, otra vez igual, pero con el intent com.oruxmaps.INTENT_NEW_WAYPOINT.


Es mi primera tarea de Tasker, así que seguro que es muy mejorable (sobre todo en cuanto a optimización y a la "seguridad" de que consiga una posición buena) pero bueno, ahí queda, por si a alguien le es útil.

Saludos.

Última edición por Fitoma Día 18/01/16 a las 15:33:27.
Responder Con Cita