package reparto_izca.keymon.lat;


import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.B4AClass;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.debug.*;

public class c_clientes extends B4AClass.ImplB4AClass implements BA.SubDelegator{
    private static java.util.HashMap<String, java.lang.reflect.Method> htSubs;
    private void innerInitialize(BA _ba) throws Exception {
        if (ba == null) {
            ba = new anywheresoftware.b4a.ShellBA(_ba, this, htSubs, "reparto_izca.keymon.lat.c_clientes");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_izca.keymon.lat.c_clientes.class).invoke(this, new Object[] {null});
        else
            ba.raiseEvent2(null, true, "class_globals", false);
    }

 
    public void  innerInitializeHelper(anywheresoftware.b4a.BA _ba) throws Exception{
        innerInitialize(_ba);
    }
    public Object callSub(String sub, Object sender, Object[] args) throws Exception {
        return BA.SubDelegator.SubNotFound;
    }
public anywheresoftware.b4a.keywords.Common __c = null;
public anywheresoftware.b4a.objects.B4XViewWrapper _root = null;
public anywheresoftware.b4a.objects.B4XViewWrapper.XUI _xui = null;
public String _q_buscar = "";
public String _entro = "";
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c = null;
public anywheresoftware.b4a.sql.SQL.CursorWrapper _c2 = null;
public anywheresoftware.b4a.objects.ListViewWrapper _listview1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _lfila = null;
public anywheresoftware.b4a.objects.EditTextWrapper _busca = null;
public anywheresoftware.b4a.objects.PanelWrapper _p_colonia = null;
public String _laruta = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_getdirs = null;
public reparto_izca.keymon.lat.b4xorderedmap _distorderedmap = null;
public reparto_izca.keymon.lat.b4xorderedmap _clientesmapao = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _img_getdirs = null;
public anywheresoftware.b4a.objects.LabelWrapper _l_rutainfo = null;
public anywheresoftware.b4a.objects.ButtonWrapper _b_getrutainfo = null;
public boolean _conmapa = false;
public anywheresoftware.b4a.objects.collections.List _listawaypoints = null;
public String _lv1top = "";
public anywheresoftware.b4a.objects.ButtonWrapper _b_limpiarruta = null;
public boolean _rutagenerada = false;
public String _rutaacambiar = "";
public b4a.example.dateutils _dateutils = null;
public reparto_izca.keymon.lat.main _main = null;
public reparto_izca.keymon.lat.appupdater _appupdater = null;
public reparto_izca.keymon.lat.subs _subs = null;
public reparto_izca.keymon.lat.foto _foto = null;
public reparto_izca.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_izca.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_izca.keymon.lat.starter _starter = null;
public reparto_izca.keymon.lat.tracker _tracker = null;
public reparto_izca.keymon.lat.newinst2 _newinst2 = null;
public reparto_izca.keymon.lat.b4xpages _b4xpages = null;
public reparto_izca.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_izca.keymon.lat.httputils2service _httputils2service = null;
public reparto_izca.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public Object  _initialize(reparto_izca.keymon.lat.c_clientes __ref,anywheresoftware.b4a.BA _ba) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((Object) Debug.delegate(ba, "initialize", new Object[] {_ba}));}
RDebugUtils.currentLine=10092544;
 //BA.debugLineNum = 10092544;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=10092545;
 //BA.debugLineNum = 10092545;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=10092546;
 //BA.debugLineNum = 10092546;BA.debugLine="End Sub";
return null;
}
public boolean  _activity_keypress(reparto_izca.keymon.lat.c_clientes __ref,int _key) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "activity_keypress", false))
	 {return ((Boolean) Debug.delegate(ba, "activity_keypress", new Object[] {_key}));}
RDebugUtils.currentLine=10485760;
 //BA.debugLineNum = 10485760;BA.debugLine="Sub Activity_KeyPress (key As Int) As Boolean 'ign";
RDebugUtils.currentLine=10485762;
 //BA.debugLineNum = 10485762;BA.debugLine="If key=KeyCodes.KEYCODE_BACK Then";
if (_key==__c.KeyCodes.KEYCODE_BACK) { 
RDebugUtils.currentLine=10485763;
 //BA.debugLineNum = 10485763;BA.debugLine="If entro = 3 And Not(conMapa) Then";
if ((__ref._entro /*String*/ ).equals(BA.NumberToString(3)) && __c.Not(__ref._conmapa /*boolean*/ )) { 
RDebugUtils.currentLine=10485764;
 //BA.debugLineNum = 10485764;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=10485766;
 //BA.debugLineNum = 10485766;BA.debugLine="B4XPage_Created(Root)";
__ref._b4xpage_created /*String*/ (null,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ );
RDebugUtils.currentLine=10485767;
 //BA.debugLineNum = 10485767;BA.debugLine="Return True";
if (true) return __c.True;
 };
RDebugUtils.currentLine=10485769;
 //BA.debugLineNum = 10485769;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
RDebugUtils.currentLine=10485770;
 //BA.debugLineNum = 10485770;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=10485774;
 //BA.debugLineNum = 10485774;BA.debugLine="End Sub";
return false;
}
public String  _b4xpage_created(reparto_izca.keymon.lat.c_clientes __ref,anywheresoftware.b4a.objects.B4XViewWrapper _root1) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b4xpage_created", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_created", new Object[] {_root1}));}
RDebugUtils.currentLine=10158080;
 //BA.debugLineNum = 10158080;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=10158081;
 //BA.debugLineNum = 10158081;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=10158083;
 //BA.debugLineNum = 10158083;BA.debugLine="Root.LoadLayout(\"clientes\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("clientes",ba);
RDebugUtils.currentLine=10158084;
 //BA.debugLineNum = 10158084;BA.debugLine="entro =\"2\"";
__ref._entro /*String*/  = "2";
RDebugUtils.currentLine=10158085;
 //BA.debugLineNum = 10158085;BA.debugLine="lv1Top = ListView1.Top";
__ref._lv1top /*String*/  = BA.NumberToString(__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTop());
RDebugUtils.currentLine=10158086;
 //BA.debugLineNum = 10158086;BA.debugLine="clientesMapaO.Initialize";
__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._initialize /*String*/ (null,ba);
RDebugUtils.currentLine=10158087;
 //BA.debugLineNum = 10158087;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoints\"";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=10158088;
 //BA.debugLineNum = 10158088;BA.debugLine="Log(\"Coordenadas del almacen: \" & Starter.cedisLo";
__c.LogImpl("810158088","Coordenadas del almacen: "+BA.NumberToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude())+","+BA.NumberToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()),0);
RDebugUtils.currentLine=10158089;
 //BA.debugLineNum = 10158089;BA.debugLine="End Sub";
return "";
}
public void  _b_getdirs_click(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b_getdirs_click", false))
	 {Debug.delegate(ba, "b_getdirs_click", null); return;}
ResumableSub_b_GetDirs_Click rsub = new ResumableSub_b_GetDirs_Click(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_b_GetDirs_Click extends BA.ResumableSub {
public ResumableSub_b_GetDirs_Click(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
anywheresoftware.b4a.objects.collections.Map _m2 = null;
int _f = 0;
Object _k = null;
String _distancia2 = "";
String _thisloc1 = "";
String _locactual = "";
anywheresoftware.b4a.objects.collections.List _r = null;
int _tid = 0;
anywheresoftware.b4a.objects.collections.Map _tmap = null;
String _tempndd = "";
int _indexd = 0;
anywheresoftware.b4a.objects.collections.Map _estecliente = null;
anywheresoftware.b4a.objects.collections.Map _m3 = null;
anywheresoftware.b4a.BA.IterableList group4;
int index4;
int groupLen4;
anywheresoftware.b4a.BA.IterableList group38;
int index38;
int groupLen38;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10747905;
 //BA.debugLineNum = 10747905;BA.debugLine="ProgressDialogShow(\"Calculando distancias y tiemp";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Calculando distancias y tiempos ..."));
RDebugUtils.currentLine=10747906;
 //BA.debugLineNum = 10747906;BA.debugLine="Private m2 As Map";
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10747907;
 //BA.debugLineNum = 10747907;BA.debugLine="Private f As Int = 0";
_f = (int) (0);
RDebugUtils.currentLine=10747908;
 //BA.debugLineNum = 10747908;BA.debugLine="For Each k As Object In distOrderedMap.Keys 'Trae";
if (true) break;

case 1:
//for
this.state = 30;
group4 = __ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null);
index4 = 0;
groupLen4 = group4.getSize();
this.state = 31;
if (true) break;

case 31:
//C
this.state = 30;
if (index4 < groupLen4) {
this.state = 3;
_k = group4.Get(index4);}
if (true) break;

case 32:
//C
this.state = 31;
index4++;
if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=10747909;
 //BA.debugLineNum = 10747909;BA.debugLine="m2 = distOrderedMap.Get(k)";
_m2 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=10747910;
 //BA.debugLineNum = 10747910;BA.debugLine="Private distancia2 As String = m2.Get(\"distancia";
_distancia2 = BA.ObjectToString(_m2.Get((Object)("distancia")));
RDebugUtils.currentLine=10747911;
 //BA.debugLineNum = 10747911;BA.debugLine="Private thisLoc1 As String = m2.Get(\"ubicacion\")";
_thisloc1 = BA.ObjectToString(_m2.Get((Object)("ubicacion")));
RDebugUtils.currentLine=10747912;
 //BA.debugLineNum = 10747912;BA.debugLine="Private locActual As String = Tracker.UUGCoords.";
_locactual = BA.NumberToString(parent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude())+","+BA.NumberToString(parent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude());
RDebugUtils.currentLine=10747913;
 //BA.debugLineNum = 10747913;BA.debugLine="If locActual = \"0,0\" Then 'Si no tenemos ubicaci";
if (true) break;

case 4:
//if
this.state = 11;
if ((_locactual).equals("0,0")) { 
this.state = 6;
}if (true) break;

case 6:
//C
this.state = 7;
RDebugUtils.currentLine=10747914;
 //BA.debugLineNum = 10747914;BA.debugLine="c = Starter.skmt.ExecQuery(\"select * from hist_";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select * from hist_gps")));
RDebugUtils.currentLine=10747915;
 //BA.debugLineNum = 10747915;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 7:
//if
this.state = 10;
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
this.state = 9;
}if (true) break;

case 9:
//C
this.state = 10;
RDebugUtils.currentLine=10747916;
 //BA.debugLineNum = 10747916;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10747917;
 //BA.debugLineNum = 10747917;BA.debugLine="locActual = c.GetString(\"hglon\") & \",\" & c.Get";
_locactual = __ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("hglon")+","+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("hglat");
 if (true) break;

case 10:
//C
this.state = 11;
;
RDebugUtils.currentLine=10747919;
 //BA.debugLineNum = 10747919;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 if (true) break;

case 11:
//C
this.state = 12;
;
RDebugUtils.currentLine=10747921;
 //BA.debugLineNum = 10747921;BA.debugLine="f = f+1";
_f = (int) (_f+1);
RDebugUtils.currentLine=10747922;
 //BA.debugLineNum = 10747922;BA.debugLine="If f < 8 Then";
if (true) break;

case 12:
//if
this.state = 29;
if (_f<8) { 
this.state = 14;
}if (true) break;

case 14:
//C
this.state = 15;
RDebugUtils.currentLine=10747923;
 //BA.debugLineNum = 10747923;BA.debugLine="If locActual = \"0,0\" Then 'Si todavia no tenemo";
if (true) break;

case 15:
//if
this.state = 18;
if ((_locactual).equals("0,0")) { 
this.state = 17;
}if (true) break;

case 17:
//C
this.state = 18;
RDebugUtils.currentLine=10747924;
 //BA.debugLineNum = 10747924;BA.debugLine="ToastMessageShow(\"No se pudo obtener la ubicac";
parent.__c.ToastMessageShow(BA.ObjectToCharSequence("No se pudo obtener la ubicacion actual!!"),parent.__c.True);
RDebugUtils.currentLine=10747925;
 //BA.debugLineNum = 10747925;BA.debugLine="f = 8";
_f = (int) (8);
 if (true) break;

case 18:
//C
this.state = 19;
;
RDebugUtils.currentLine=10747927;
 //BA.debugLineNum = 10747927;BA.debugLine="Log($\"locActual: ${locActual}, thisLoc1: ${this";
parent.__c.LogImpl("810747927",("locActual: "+parent.__c.SmartStringFormatter("",(Object)(_locactual))+", thisLoc1: "+parent.__c.SmartStringFormatter("",(Object)(_thisloc1))+""),0);
RDebugUtils.currentLine=10747928;
 //BA.debugLineNum = 10747928;BA.debugLine="Wait For(distanciaEntreCoords(distancia2, locAc";
parent.__c.WaitFor("complete", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "b_getdirs_click"), __ref._distanciaentrecoords /*anywheresoftware.b4a.keywords.Common.ResumableSubWrapper*/ (null,_distancia2,_locactual,_thisloc1));
this.state = 33;
return;
case 33:
//C
this.state = 19;
_r = (anywheresoftware.b4a.objects.collections.List) result[1];
;
RDebugUtils.currentLine=10747929;
 //BA.debugLineNum = 10747929;BA.debugLine="LogColor($\"R: ${r.Get(0)} - ${r.Get(1)} - ${r.G";
parent.__c.LogImpl("810747929",("R: "+parent.__c.SmartStringFormatter("",_r.Get((int) (0)))+" - "+parent.__c.SmartStringFormatter("",_r.Get((int) (1)))+" - "+parent.__c.SmartStringFormatter("",_r.Get((int) (2)))+""),parent.__c.Colors.Green);
RDebugUtils.currentLine=10747930;
 //BA.debugLineNum = 10747930;BA.debugLine="Private tId As Int = r.Get(0)";
_tid = (int)(BA.ObjectToNumber(_r.Get((int) (0))));
RDebugUtils.currentLine=10747931;
 //BA.debugLineNum = 10747931;BA.debugLine="Private tMap As Map = distOrderedMap.Get(tId)";
_tmap = new anywheresoftware.b4a.objects.collections.Map();
_tmap = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,(Object)(_tid))));
RDebugUtils.currentLine=10747932;
 //BA.debugLineNum = 10747932;BA.debugLine="LogColor(\"|\" & tId & \"| - \" &distOrderedMap.Get";
parent.__c.LogImpl("810747932","|"+BA.NumberToString(_tid)+"| - "+BA.ObjectToString(__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,(Object)(_tid))),parent.__c.Colors.Blue);
RDebugUtils.currentLine=10747933;
 //BA.debugLineNum = 10747933;BA.debugLine="Private tempNDD As String = tMap.Get(\"nomDirDis";
_tempndd = BA.ObjectToString(_tmap.Get((Object)("nomDirDist")));
RDebugUtils.currentLine=10747934;
 //BA.debugLineNum = 10747934;BA.debugLine="Private indexD As Int = tempNDD.IndexOf(\"Distan";
_indexd = _tempndd.indexOf("Distancia:");
RDebugUtils.currentLine=10747935;
 //BA.debugLineNum = 10747935;BA.debugLine="If indexD > -1 Then tempNDD = tempNDD.SubString";
if (true) break;

case 19:
//if
this.state = 24;
if (_indexd>-1) { 
this.state = 21;
;}if (true) break;

case 21:
//C
this.state = 24;
_tempndd = _tempndd.substring((int) (0),_indexd);
if (true) break;

case 24:
//C
this.state = 25;
;
RDebugUtils.currentLine=10747936;
 //BA.debugLineNum = 10747936;BA.debugLine="Log(tempNDD)";
parent.__c.LogImpl("810747936",_tempndd,0);
RDebugUtils.currentLine=10747937;
 //BA.debugLineNum = 10747937;BA.debugLine="tempNDD = tempNDD & $\"Dist: $1.1{(r.Get(1)/1000";
_tempndd = _tempndd+("Dist: "+parent.__c.SmartStringFormatter("1.1",(Object)(((double)(BA.ObjectToNumber(_r.Get((int) (1))))/(double)1000)))+" kms, Tiempo aprox: "+parent.__c.SmartStringFormatter("1.0",(Object)((((double)(BA.ObjectToNumber(_r.Get((int) (2))))*2)/(double)60)))+" min.");
RDebugUtils.currentLine=10747938;
 //BA.debugLineNum = 10747938;BA.debugLine="Private esteCliente As Map = CreateMap(\"distanc";
_estecliente = new anywheresoftware.b4a.objects.collections.Map();
_estecliente = parent.__c.createMap(new Object[] {(Object)("distancia"),(Object)(_distancia2),(Object)("ubicacion"),_tmap.Get((Object)("ubicacion")),(Object)("codigo"),_tmap.Get((Object)("codigo")),(Object)("nomDirDist"),(Object)(_tempndd)});
RDebugUtils.currentLine=10747939;
 //BA.debugLineNum = 10747939;BA.debugLine="distOrderedMap.Put(tId, esteCliente)";
__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._put /*String*/ (null,(Object)(_tid),(Object)(_estecliente.getObject()));
RDebugUtils.currentLine=10747940;
 //BA.debugLineNum = 10747940;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10747941;
 //BA.debugLineNum = 10747941;BA.debugLine="Private m3 As Map";
_m3 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10747942;
 //BA.debugLineNum = 10747942;BA.debugLine="For Each k As Object In distOrderedMap.Keys  'G";
if (true) break;

case 25:
//for
this.state = 28;
group38 = __ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null);
index38 = 0;
groupLen38 = group38.getSize();
this.state = 34;
if (true) break;

case 34:
//C
this.state = 28;
if (index38 < groupLen38) {
this.state = 27;
_k = group38.Get(index38);}
if (true) break;

case 35:
//C
this.state = 34;
index38++;
if (true) break;

case 27:
//C
this.state = 35;
RDebugUtils.currentLine=10747943;
 //BA.debugLineNum = 10747943;BA.debugLine="m3 = distOrderedMap.Get(k)";
_m3 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=10747944;
 //BA.debugLineNum = 10747944;BA.debugLine="m3.Get(\"codigo\")";
_m3.Get((Object)("codigo"));
RDebugUtils.currentLine=10747945;
 //BA.debugLineNum = 10747945;BA.debugLine="ListView1.AddTwoLines(m3.Get(\"codigo\"), m3.Get";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_m3.Get((Object)("codigo"))),BA.ObjectToCharSequence(_m3.Get((Object)("nomDirDist"))));
 if (true) break;
if (true) break;

case 28:
//C
this.state = 29;
;
 if (true) break;

case 29:
//C
this.state = 32;
;
 if (true) break;
if (true) break;

case 30:
//C
this.state = -1;
;
RDebugUtils.currentLine=10747949;
 //BA.debugLineNum = 10747949;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
RDebugUtils.currentLine=10747950;
 //BA.debugLineNum = 10747950;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _distanciaentrecoords(reparto_izca.keymon.lat.c_clientes __ref,String _id,String _coords1,String _coords2) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "distanciaentrecoords", false))
	 {return ((anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) Debug.delegate(ba, "distanciaentrecoords", new Object[] {_id,_coords1,_coords2}));}
ResumableSub_distanciaEntreCoords rsub = new ResumableSub_distanciaEntreCoords(this,__ref,_id,_coords1,_coords2);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_distanciaEntreCoords extends BA.ResumableSub {
public ResumableSub_distanciaEntreCoords(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref,String _id,String _coords1,String _coords2) {
this.parent = parent;
this.__ref = __ref;
this._id = _id;
this._coords1 = _coords1;
this._coords2 = _coords2;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
String _id;
String _coords1;
String _coords2;
String _distanciatotal = "";
String _tiempo = "";
reparto_izca.keymon.lat.httpjob _j = null;
anywheresoftware.b4a.objects.collections.JSONParser _jp = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
anywheresoftware.b4a.objects.collections.List _rutas = null;
anywheresoftware.b4a.objects.collections.Map _rutas2 = null;
anywheresoftware.b4a.objects.collections.List _r = null;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10616833;
 //BA.debugLineNum = 10616833;BA.debugLine="Sleep(1050)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "distanciaentrecoords"),(int) (1050));
this.state = 11;
return;
case 11:
//C
this.state = 1;
;
RDebugUtils.currentLine=10616834;
 //BA.debugLineNum = 10616834;BA.debugLine="Private distanciaTotal As String = \"0\"";
_distanciatotal = "0";
RDebugUtils.currentLine=10616835;
 //BA.debugLineNum = 10616835;BA.debugLine="Private tiempo As String = \"0\"";
_tiempo = "0";
RDebugUtils.currentLine=10616836;
 //BA.debugLineNum = 10616836;BA.debugLine="Dim j As HttpJob";
_j = new reparto_izca.keymon.lat.httpjob();
RDebugUtils.currentLine=10616837;
 //BA.debugLineNum = 10616837;BA.debugLine="j.Initialize(\"\", Me)";
_j._initialize /*String*/ (null,ba,"",parent);
RDebugUtils.currentLine=10616838;
 //BA.debugLineNum = 10616838;BA.debugLine="j.Download(\"https://router.project-osrm.org/route";
_j._download /*String*/ (null,"https://router.project-osrm.org/route/v1/driving/"+_coords1+";"+_coords2+"?overview=false");
RDebugUtils.currentLine=10616839;
 //BA.debugLineNum = 10616839;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "distanciaentrecoords"), (Object)(_j));
this.state = 12;
return;
case 12:
//C
this.state = 1;
_j = (reparto_izca.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=10616840;
 //BA.debugLineNum = 10616840;BA.debugLine="If j.Success Then";
if (true) break;

case 1:
//if
this.state = 10;
if (_j._success /*boolean*/ ) { 
this.state = 3;
}else {
this.state = 9;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=10616841;
 //BA.debugLineNum = 10616841;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=10616842;
 //BA.debugLineNum = 10616842;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=10616843;
 //BA.debugLineNum = 10616843;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=10616844;
 //BA.debugLineNum = 10616844;BA.debugLine="Log($\"Respuesta: ${m.Get(\"code\")}\"$)";
parent.__c.LogImpl("810616844",("Respuesta: "+parent.__c.SmartStringFormatter("",_m.Get((Object)("code")))+""),0);
RDebugUtils.currentLine=10616845;
 //BA.debugLineNum = 10616845;BA.debugLine="If m.Get(\"code\") = \"Ok\" Then";
if (true) break;

case 4:
//if
this.state = 7;
if ((_m.Get((Object)("code"))).equals((Object)("Ok"))) { 
this.state = 6;
}if (true) break;

case 6:
//C
this.state = 7;
RDebugUtils.currentLine=10616847;
 //BA.debugLineNum = 10616847;BA.debugLine="Dim rutas As List = m.Get(\"routes\")";
_rutas = new anywheresoftware.b4a.objects.collections.List();
_rutas = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m.Get((Object)("routes"))));
RDebugUtils.currentLine=10616848;
 //BA.debugLineNum = 10616848;BA.debugLine="Dim rutas2 As Map = rutas.Get(0)";
_rutas2 = new anywheresoftware.b4a.objects.collections.Map();
_rutas2 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_rutas.Get((int) (0))));
RDebugUtils.currentLine=10616852;
 //BA.debugLineNum = 10616852;BA.debugLine="distanciaTotal = rutas2.Get(\"distance\")";
_distanciatotal = BA.ObjectToString(_rutas2.Get((Object)("distance")));
RDebugUtils.currentLine=10616853;
 //BA.debugLineNum = 10616853;BA.debugLine="tiempo = rutas2.Get(\"duration\")";
_tiempo = BA.ObjectToString(_rutas2.Get((Object)("duration")));
RDebugUtils.currentLine=10616854;
 //BA.debugLineNum = 10616854;BA.debugLine="Log($\"Distancia total: ${distanciaTotal}, Tiemp";
parent.__c.LogImpl("810616854",("Distancia total: "+parent.__c.SmartStringFormatter("",(Object)(_distanciatotal))+", Tiempo: "+parent.__c.SmartStringFormatter("",(Object)(_tiempo))+""),0);
 if (true) break;

case 7:
//C
this.state = 10;
;
 if (true) break;

case 9:
//C
this.state = 10;
RDebugUtils.currentLine=10616857;
 //BA.debugLineNum = 10616857;BA.debugLine="Log(\"Error!\")";
parent.__c.LogImpl("810616857","Error!",0);
 if (true) break;

case 10:
//C
this.state = -1;
;
RDebugUtils.currentLine=10616859;
 //BA.debugLineNum = 10616859;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=10616860;
 //BA.debugLineNum = 10616860;BA.debugLine="Private r As List";
_r = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=10616861;
 //BA.debugLineNum = 10616861;BA.debugLine="r.Initialize";
_r.Initialize();
RDebugUtils.currentLine=10616862;
 //BA.debugLineNum = 10616862;BA.debugLine="r.Add(id)";
_r.Add((Object)(_id));
RDebugUtils.currentLine=10616863;
 //BA.debugLineNum = 10616863;BA.debugLine="r.Add(distanciaTotal)";
_r.Add((Object)(_distanciatotal));
RDebugUtils.currentLine=10616864;
 //BA.debugLineNum = 10616864;BA.debugLine="r.Add(tiempo)";
_r.Add((Object)(_tiempo));
RDebugUtils.currentLine=10616865;
 //BA.debugLineNum = 10616865;BA.debugLine="Return r";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(_r));return;};
RDebugUtils.currentLine=10616866;
 //BA.debugLineNum = 10616866;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b_getrutainfo_click(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b_getrutainfo_click", false))
	 {return ((String) Debug.delegate(ba, "b_getrutainfo_click", null));}
RDebugUtils.currentLine=10878976;
 //BA.debugLineNum = 10878976;BA.debugLine="Private Sub b_getRutaInfo_Click";
RDebugUtils.currentLine=10878978;
 //BA.debugLineNum = 10878978;BA.debugLine="caculaRutaGPS(todosAVisitar)";
__ref._cacularutagps /*void*/ (null,__ref._todosavisitar /*anywheresoftware.b4a.objects.collections.List*/ (null));
RDebugUtils.currentLine=10878979;
 //BA.debugLineNum = 10878979;BA.debugLine="End Sub";
return "";
}
public void  _cacularutagps(reparto_izca.keymon.lat.c_clientes __ref,anywheresoftware.b4a.objects.collections.List _coords) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "cacularutagps", false))
	 {Debug.delegate(ba, "cacularutagps", new Object[] {_coords}); return;}
ResumableSub_caculaRutaGPS rsub = new ResumableSub_caculaRutaGPS(this,__ref,_coords);
rsub.resume(ba, null);
}
public static class ResumableSub_caculaRutaGPS extends BA.ResumableSub {
public ResumableSub_caculaRutaGPS(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref,anywheresoftware.b4a.objects.collections.List _coords) {
this.parent = parent;
this.__ref = __ref;
this._coords = _coords;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
anywheresoftware.b4a.objects.collections.List _coords;
anywheresoftware.b4a.objects.collections.List _tmplist = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.objects.CSBuilder _cs2 = null;
String _coordsstr = "";
anywheresoftware.b4a.objects.collections.List _tienda = null;
reparto_izca.keymon.lat.httpjob _j = null;
anywheresoftware.b4a.objects.collections.JSONParser _jp = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
int _puntos = 0;
String _duration = "";
String _distance = "";
String _mensaje = "";
int _i = 0;
anywheresoftware.b4a.objects.collections.Map _ti = null;
anywheresoftware.b4a.BA.IterableList group8;
int index8;
int groupLen8;
int step37;
int limit37;
int step49;
int limit49;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=11075585;
 //BA.debugLineNum = 11075585;BA.debugLine="Private tmpList As List";
_tmplist = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=11075586;
 //BA.debugLineNum = 11075586;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=11075587;
 //BA.debugLineNum = 11075587;BA.debugLine="tmpList.Initialize";
_tmplist.Initialize();
RDebugUtils.currentLine=11075588;
 //BA.debugLineNum = 11075588;BA.debugLine="tmpList.AddAll(Array As String(\"ACTUAL\", Tracker.";
_tmplist.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"ACTUAL",BA.NumberToString(parent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()),BA.NumberToString(parent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude())}));
RDebugUtils.currentLine=11075589;
 //BA.debugLineNum = 11075589;BA.debugLine="coords.InsertAt(0,tmpList)";
_coords.InsertAt((int) (0),(Object)(_tmplist.getObject()));
RDebugUtils.currentLine=11075590;
 //BA.debugLineNum = 11075590;BA.debugLine="Log(\"=================================\")";
parent.__c.LogImpl("811075590","=================================",0);
RDebugUtils.currentLine=11075592;
 //BA.debugLineNum = 11075592;BA.debugLine="Private coordsStr As String = \"\"";
_coordsstr = "";
RDebugUtils.currentLine=11075593;
 //BA.debugLineNum = 11075593;BA.debugLine="For Each tienda As List In coords";
if (true) break;

case 1:
//for
this.state = 10;
_tienda = new anywheresoftware.b4a.objects.collections.List();
group8 = _coords;
index8 = 0;
groupLen8 = group8.getSize();
this.state = 33;
if (true) break;

case 33:
//C
this.state = 10;
if (index8 < groupLen8) {
this.state = 3;
_tienda = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(group8.Get(index8)));}
if (true) break;

case 34:
//C
this.state = 33;
index8++;
if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=11075595;
 //BA.debugLineNum = 11075595;BA.debugLine="If coordsStr = \"\" Then";
if (true) break;

case 4:
//if
this.state = 9;
if ((_coordsstr).equals("")) { 
this.state = 6;
}else {
this.state = 8;
}if (true) break;

case 6:
//C
this.state = 9;
RDebugUtils.currentLine=11075596;
 //BA.debugLineNum = 11075596;BA.debugLine="coordsStr = $\"${tienda.get(0)},${tienda.get(1)}";
_coordsstr = (""+parent.__c.SmartStringFormatter("",_tienda.Get((int) (0)))+","+parent.__c.SmartStringFormatter("",_tienda.Get((int) (1)))+","+parent.__c.SmartStringFormatter("",_tienda.Get((int) (2)))+"");
 if (true) break;

case 8:
//C
this.state = 9;
RDebugUtils.currentLine=11075598;
 //BA.debugLineNum = 11075598;BA.debugLine="coordsStr = $\"${coordsStr};${tienda.get(0)},${t";
_coordsstr = (""+parent.__c.SmartStringFormatter("",(Object)(_coordsstr))+";"+parent.__c.SmartStringFormatter("",_tienda.Get((int) (0)))+","+parent.__c.SmartStringFormatter("",_tienda.Get((int) (1)))+","+parent.__c.SmartStringFormatter("",_tienda.Get((int) (2)))+"");
 if (true) break;

case 9:
//C
this.state = 34;
;
 if (true) break;
if (true) break;

case 10:
//C
this.state = 11;
;
RDebugUtils.currentLine=11075601;
 //BA.debugLineNum = 11075601;BA.debugLine="Log(coordsStr)";
parent.__c.LogImpl("811075601",_coordsstr,0);
RDebugUtils.currentLine=11075602;
 //BA.debugLineNum = 11075602;BA.debugLine="ProgressDialogShow2(\"Calculando distancia y tiemp";
parent.__c.ProgressDialogShow2(ba,BA.ObjectToCharSequence("Calculando distancia y tiempo, un momento por favor."),parent.__c.False);
RDebugUtils.currentLine=11075603;
 //BA.debugLineNum = 11075603;BA.debugLine="Dim j As HttpJob";
_j = new reparto_izca.keymon.lat.httpjob();
RDebugUtils.currentLine=11075604;
 //BA.debugLineNum = 11075604;BA.debugLine="j.Initialize(\"trip\", Me) 'Calculamos el resto de";
_j._initialize /*String*/ (null,ba,"trip",parent);
RDebugUtils.currentLine=11075605;
 //BA.debugLineNum = 11075605;BA.debugLine="j.Download($\"http://keymon.net:9002/ruteador?m=OS";
_j._download /*String*/ (null,("http://keymon.net:9002/ruteador?m=OSRM&r="+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traerutareparto /*String*/ (ba)))+"&a="+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traealmacen /*String*/ (ba)))+"&f=CEDIS,"+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()))+","+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()))+"&c="+parent.__c.SmartStringFormatter("",(Object)(_coordsstr))+""));
RDebugUtils.currentLine=11075606;
 //BA.debugLineNum = 11075606;BA.debugLine="Log($\"http://keymon.net:9002/ruteador?m=OSRM&r=${";
parent.__c.LogImpl("811075606",("http://keymon.net:9002/ruteador?m=OSRM&r="+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traerutareparto /*String*/ (ba)))+"&a="+parent.__c.SmartStringFormatter("",(Object)(parent._subs._traealmacen /*String*/ (ba)))+"&f=CEDIS,"+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()))+","+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()))+"&c="+parent.__c.SmartStringFormatter("",(Object)(_coordsstr))+""),0);
RDebugUtils.currentLine=11075607;
 //BA.debugLineNum = 11075607;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "cacularutagps"), (Object)(_j));
this.state = 35;
return;
case 35:
//C
this.state = 11;
_j = (reparto_izca.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=11075608;
 //BA.debugLineNum = 11075608;BA.debugLine="If j.Success Then";
if (true) break;

case 11:
//if
this.state = 32;
if (_j._success /*boolean*/ ) { 
this.state = 13;
}else {
this.state = 31;
}if (true) break;

case 13:
//C
this.state = 14;
RDebugUtils.currentLine=11075609;
 //BA.debugLineNum = 11075609;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=11075610;
 //BA.debugLineNum = 11075610;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=11075611;
 //BA.debugLineNum = 11075611;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=11075612;
 //BA.debugLineNum = 11075612;BA.debugLine="Log(m)";
parent.__c.LogImpl("811075612",BA.ObjectToString(_m),0);
RDebugUtils.currentLine=11075613;
 //BA.debugLineNum = 11075613;BA.debugLine="If m.Get(\"code\") = \"OK\" Then";
if (true) break;

case 14:
//if
this.state = 29;
if ((_m.Get((Object)("code"))).equals((Object)("OK"))) { 
this.state = 16;
}if (true) break;

case 16:
//C
this.state = 17;
RDebugUtils.currentLine=11075614;
 //BA.debugLineNum = 11075614;BA.debugLine="Log(\"=====   OK\")";
parent.__c.LogImpl("811075614","=====   OK",0);
RDebugUtils.currentLine=11075615;
 //BA.debugLineNum = 11075615;BA.debugLine="rutaGenerada = True";
__ref._rutagenerada /*boolean*/  = parent.__c.True;
RDebugUtils.currentLine=11075616;
 //BA.debugLineNum = 11075616;BA.debugLine="Dim puntos As Int = m.Get(\"puntos\")";
_puntos = (int)(BA.ObjectToNumber(_m.Get((Object)("puntos"))));
RDebugUtils.currentLine=11075617;
 //BA.debugLineNum = 11075617;BA.debugLine="Private coords As List = m.Get(\"coords\")";
_coords = new anywheresoftware.b4a.objects.collections.List();
_coords = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m.Get((Object)("coords"))));
RDebugUtils.currentLine=11075618;
 //BA.debugLineNum = 11075618;BA.debugLine="Private duration As String = m.Get(\"duration\")";
_duration = BA.ObjectToString(_m.Get((Object)("duration")));
RDebugUtils.currentLine=11075619;
 //BA.debugLineNum = 11075619;BA.debugLine="Private distance As String = m.Get(\"distance\")";
_distance = BA.ObjectToString(_m.Get((Object)("distance")));
RDebugUtils.currentLine=11075620;
 //BA.debugLineNum = 11075620;BA.debugLine="Private mensaje As String = m.Get(\"mensaje\")";
_mensaje = BA.ObjectToString(_m.Get((Object)("mensaje")));
RDebugUtils.currentLine=11075621;
 //BA.debugLineNum = 11075621;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoint";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=11075622;
 //BA.debugLineNum = 11075622;BA.debugLine="Starter.skmt.ExecNonQuery(\"update kmt_info set";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("update kmt_info set SECUENCIA = 0");
RDebugUtils.currentLine=11075623;
 //BA.debugLineNum = 11075623;BA.debugLine="For i = 0 To coords.Size - 1";
if (true) break;

case 17:
//for
this.state = 20;
step37 = 1;
limit37 = (int) (_coords.getSize()-1);
_i = (int) (0) ;
this.state = 36;
if (true) break;

case 36:
//C
this.state = 20;
if ((step37 > 0 && _i <= limit37) || (step37 < 0 && _i >= limit37)) this.state = 19;
if (true) break;

case 37:
//C
this.state = 36;
_i = ((int)(0 + _i + step37)) ;
if (true) break;

case 19:
//C
this.state = 37;
RDebugUtils.currentLine=11075624;
 //BA.debugLineNum = 11075624;BA.debugLine="Private ti As Map = coords.Get(i)";
_ti = new anywheresoftware.b4a.objects.collections.Map();
_ti = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_coords.Get(_i)));
RDebugUtils.currentLine=11075625;
 //BA.debugLineNum = 11075625;BA.debugLine="Starter.skmt.ExecNonQuery($\"update kmt_info se";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update kmt_info set SECUENCIA = "+parent.__c.SmartStringFormatter("",_ti.Get((Object)("pos")))+" where CAT_CL_CODIGO = '"+parent.__c.SmartStringFormatter("",(Object)((BA.ObjectToString(_ti.Get((Object)("id")))).substring((int) (1))))+"'"));
RDebugUtils.currentLine=11075626;
 //BA.debugLineNum = 11075626;BA.debugLine="Starter.skmt.ExecNonQuery($\"insert into waypoi";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("insert into waypoints (codigo, indice) values ('"+parent.__c.SmartStringFormatter("",(Object)((BA.ObjectToString(_ti.Get((Object)("id")))).substring((int) (1))))+"', '"+parent.__c.SmartStringFormatter("",_ti.Get((Object)("pos")))+"')"));
 if (true) break;
if (true) break;

case 20:
//C
this.state = 21;
;
RDebugUtils.currentLine=11075628;
 //BA.debugLineNum = 11075628;BA.debugLine="c = Starter.skmt.ExecQuery(\"select codigo, indi";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select codigo, indice, CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_NOEXT from waypoints inner join kmt_info on waypoints.codigo = kmt_info.CAT_CL_CODIGO where gestion = 0 AND CAT_CL_RUTA <> 1000 order by indice")));
RDebugUtils.currentLine=11075629;
 //BA.debugLineNum = 11075629;BA.debugLine="If c.RowCount > 0 Then 'Ya hay waypoints en la";
if (true) break;

case 21:
//if
this.state = 28;
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
this.state = 23;
}if (true) break;

case 23:
//C
this.state = 24;
RDebugUtils.currentLine=11075630;
 //BA.debugLineNum = 11075630;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=11075631;
 //BA.debugLineNum = 11075631;BA.debugLine="conMapa = True";
__ref._conmapa /*boolean*/  = parent.__c.True;
RDebugUtils.currentLine=11075632;
 //BA.debugLineNum = 11075632;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=11075633;
 //BA.debugLineNum = 11075633;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=11075634;
 //BA.debugLineNum = 11075634;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=11075635;
 //BA.debugLineNum = 11075635;BA.debugLine="For i=0 To c.RowCount -1 'Generamos el listVie";
if (true) break;

case 24:
//for
this.state = 27;
step49 = 1;
limit49 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
this.state = 38;
if (true) break;

case 38:
//C
this.state = 27;
if ((step49 > 0 && _i <= limit49) || (step49 < 0 && _i >= limit49)) this.state = 26;
if (true) break;

case 39:
//C
this.state = 38;
_i = ((int)(0 + _i + step49)) ;
if (true) break;

case 26:
//C
this.state = 39;
RDebugUtils.currentLine=11075636;
 //BA.debugLineNum = 11075636;BA.debugLine="c.Position = i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=11075637;
 //BA.debugLineNum = 11075637;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=11075638;
 //BA.debugLineNum = 11075638;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=11075639;
 //BA.debugLineNum = 11075639;BA.debugLine="ListView1.AddTwoLines(cs.Color(Colors.RGB(100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_cs.Color(parent.__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("codigo"))).PopAll().getObject()),BA.ObjectToCharSequence(_cs2.Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE"))).Color(parent.__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(" Calle: ")).Pop().Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE").trim()+" "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOEXT"))).PopAll().getObject()));
 if (true) break;
if (true) break;

case 27:
//C
this.state = 28;
;
 if (true) break;

case 28:
//C
this.state = 29;
;
RDebugUtils.currentLine=11075642;
 //BA.debugLineNum = 11075642;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=11075643;
 //BA.debugLineNum = 11075643;BA.debugLine="Log($\"Distancia total: $1.1{distance/1000} kms,";
parent.__c.LogImpl("811075643",("Distancia total: "+parent.__c.SmartStringFormatter("1.1",(Object)((double)(Double.parseDouble(_distance))/(double)1000))+" kms, tiempo aprox: "+parent.__c.SmartStringFormatter("1.1",(Object)((double)(Double.parseDouble(_duration))/(double)60))+" mins. ("+parent.__c.SmartStringFormatter("1.1",(Object)((double)(Double.parseDouble(_duration))/(double)60/(double)60))+" hrs)"),0);
RDebugUtils.currentLine=11075644;
 //BA.debugLineNum = 11075644;BA.debugLine="l_rutaInfo.Text = $\"Distancia: $1.1{distance/10";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(("Distancia: "+parent.__c.SmartStringFormatter("1.1",(Object)((double)(Double.parseDouble(_distance))/(double)1000))+" kms, tiempo aprox: "+parent.__c.SmartStringFormatter("1.1",(Object)((double)(Double.parseDouble(_duration))/(double)60/(double)60))+" hrs"+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+"Visitas restantes: "+parent.__c.SmartStringFormatter("",(Object)(_puntos-1))+"")));
RDebugUtils.currentLine=11075645;
 //BA.debugLineNum = 11075645;BA.debugLine="l_rutaInfo.Width = Root.Width * 0.9";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setWidth((int) (__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth()*0.9));
RDebugUtils.currentLine=11075646;
 //BA.debugLineNum = 11075646;BA.debugLine="Subs.centraEtiqueta(l_rutaInfo, Root.Width)";
parent._subs._centraetiqueta /*String*/ (ba,__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ ,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=11075647;
 //BA.debugLineNum = 11075647;BA.debugLine="l_rutaInfo.Visible = True";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.True);
RDebugUtils.currentLine=11075648;
 //BA.debugLineNum = 11075648;BA.debugLine="l_rutaInfo.BringToFront";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=11075649;
 //BA.debugLineNum = 11075649;BA.debugLine="ListView1.Top = lv1Top + 100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int) ((double)(Double.parseDouble(__ref._lv1top /*String*/ ))+100));
 if (true) break;

case 29:
//C
this.state = 32;
;
 if (true) break;

case 31:
//C
this.state = 32;
RDebugUtils.currentLine=11075652;
 //BA.debugLineNum = 11075652;BA.debugLine="LogColor(\"****************  Error!  ************";
parent.__c.LogImpl("811075652","****************  Error!  ******************",parent.__c.Colors.Red);
 if (true) break;

case 32:
//C
this.state = -1;
;
RDebugUtils.currentLine=11075654;
 //BA.debugLineNum = 11075654;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=11075655;
 //BA.debugLineNum = 11075655;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
RDebugUtils.currentLine=11075656;
 //BA.debugLineNum = 11075656;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.objects.collections.List  _todosavisitar(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "todosavisitar", false))
	 {return ((anywheresoftware.b4a.objects.collections.List) Debug.delegate(ba, "todosavisitar", null));}
String _sqlderuta = "";
anywheresoftware.b4a.objects.collections.List _avisitar = null;
anywheresoftware.b4a.objects.collections.List _tmplist = null;
anywheresoftware.b4a.sql.SQL.ResultSetWrapper _coords = null;
RDebugUtils.currentLine=11141120;
 //BA.debugLineNum = 11141120;BA.debugLine="Sub todosAVisitar As List";
RDebugUtils.currentLine=11141121;
 //BA.debugLineNum = 11141121;BA.debugLine="Log(laRuta)";
__c.LogImpl("811141121",__ref._laruta /*String*/ ,0);
RDebugUtils.currentLine=11141122;
 //BA.debugLineNum = 11141122;BA.debugLine="Log(entro)";
__c.LogImpl("811141122",__ref._entro /*String*/ ,0);
RDebugUtils.currentLine=11141123;
 //BA.debugLineNum = 11141123;BA.debugLine="Private sqlDeRuta As String = \"\"";
_sqlderuta = "";
RDebugUtils.currentLine=11141124;
 //BA.debugLineNum = 11141124;BA.debugLine="If entro = 3 Then sqlDeRuta = $\"and CAT_CL_RUTA =";
if ((__ref._entro /*String*/ ).equals(BA.NumberToString(3))) { 
_sqlderuta = ("and CAT_CL_RUTA = '"+__c.SmartStringFormatter("",(Object)(__ref._laruta /*String*/ ))+"'");};
RDebugUtils.currentLine=11141125;
 //BA.debugLineNum = 11141125;BA.debugLine="Private aVisitar, tmpList As List";
_avisitar = new anywheresoftware.b4a.objects.collections.List();
_tmplist = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=11141126;
 //BA.debugLineNum = 11141126;BA.debugLine="aVisitar.Initialize";
_avisitar.Initialize();
RDebugUtils.currentLine=11141127;
 //BA.debugLineNum = 11141127;BA.debugLine="Private coords As ResultSet = Starter.skmt.ExecQu";
_coords = new anywheresoftware.b4a.sql.SQL.ResultSetWrapper();
_coords = (anywheresoftware.b4a.sql.SQL.ResultSetWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.ResultSetWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery(("select CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where gestion = 0 AND CAT_CL_RUTA <> 1000 "+__c.SmartStringFormatter("",(Object)(_sqlderuta))+""))));
RDebugUtils.currentLine=11141128;
 //BA.debugLineNum = 11141128;BA.debugLine="Do While coords.NextRow";
while (_coords.NextRow()) {
RDebugUtils.currentLine=11141129;
 //BA.debugLineNum = 11141129;BA.debugLine="tmpList.Initialize";
_tmplist.Initialize();
RDebugUtils.currentLine=11141130;
 //BA.debugLineNum = 11141130;BA.debugLine="tmpList.AddAll(Array As String(coords.GetString(";
_tmplist.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{_coords.GetString("CAT_CL_CODIGO"),_coords.GetString("CAT_CL_LONG"),_coords.GetString("CAT_CL_LAT")}));
RDebugUtils.currentLine=11141131;
 //BA.debugLineNum = 11141131;BA.debugLine="aVisitar.Add(tmpList)";
_avisitar.Add((Object)(_tmplist.getObject()));
 }
;
RDebugUtils.currentLine=11141133;
 //BA.debugLineNum = 11141133;BA.debugLine="Log(aVisitar)";
__c.LogImpl("811141133",BA.ObjectToString(_avisitar),0);
RDebugUtils.currentLine=11141134;
 //BA.debugLineNum = 11141134;BA.debugLine="Return aVisitar";
if (true) return _avisitar;
RDebugUtils.currentLine=11141135;
 //BA.debugLineNum = 11141135;BA.debugLine="End Sub";
return null;
}
public String  _b_getrutainfo_longclick(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b_getrutainfo_longclick", false))
	 {return ((String) Debug.delegate(ba, "b_getrutainfo_longclick", null));}
RDebugUtils.currentLine=10944512;
 //BA.debugLineNum = 10944512;BA.debugLine="Private Sub b_getRutaInfo_LongClick";
RDebugUtils.currentLine=10944513;
 //BA.debugLineNum = 10944513;BA.debugLine="If b_limpiarRuta.Visible Then";
if (__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .getVisible()) { 
RDebugUtils.currentLine=10944514;
 //BA.debugLineNum = 10944514;BA.debugLine="b_limpiarRuta.Visible = False";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
 }else {
RDebugUtils.currentLine=10944516;
 //BA.debugLineNum = 10944516;BA.debugLine="b_limpiarRuta.Visible = True";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
 };
RDebugUtils.currentLine=10944518;
 //BA.debugLineNum = 10944518;BA.debugLine="End Sub";
return "";
}
public String  _b_limpiarruta_click(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b_limpiarruta_click", false))
	 {return ((String) Debug.delegate(ba, "b_limpiarruta_click", null));}
RDebugUtils.currentLine=11010048;
 //BA.debugLineNum = 11010048;BA.debugLine="Private Sub b_limpiarRuta_Click";
RDebugUtils.currentLine=11010049;
 //BA.debugLineNum = 11010049;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoints\"";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=11010050;
 //BA.debugLineNum = 11010050;BA.debugLine="b_limpiarRuta.Visible = False";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=11010051;
 //BA.debugLineNum = 11010051;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
RDebugUtils.currentLine=11010052;
 //BA.debugLineNum = 11010052;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b4xpage_appear", false))
	 {return ((String) Debug.delegate(ba, "b4xpage_appear", null));}
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.objects.CSBuilder _cs2 = null;
int _i = 0;
anywheresoftware.b4a.sql.SQL.CursorWrapper _x = null;
String[] _y = null;
RDebugUtils.currentLine=10223616;
 //BA.debugLineNum = 10223616;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=10223617;
 //BA.debugLineNum = 10223617;BA.debugLine="busca.Text = \"\"";
__ref._busca /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=10223618;
 //BA.debugLineNum = 10223618;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=10223620;
 //BA.debugLineNum = 10223620;BA.debugLine="entro =\"2\"";
__ref._entro /*String*/  = "2";
RDebugUtils.currentLine=10223624;
 //BA.debugLineNum = 10223624;BA.debugLine="p_colonia.Width = Root.Width";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setWidth(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=10223625;
 //BA.debugLineNum = 10223625;BA.debugLine="p_colonia.Height = Root.Height";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setHeight(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getHeight());
RDebugUtils.currentLine=10223626;
 //BA.debugLineNum = 10223626;BA.debugLine="p_colonia.Top = 0";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setTop((int) (0));
RDebugUtils.currentLine=10223627;
 //BA.debugLineNum = 10223627;BA.debugLine="p_colonia.Left = 0";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setLeft((int) (0));
RDebugUtils.currentLine=10223628;
 //BA.debugLineNum = 10223628;BA.debugLine="Subs.centraListView(ListView1, p_colonia.Width)";
_subs._centralistview /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .getWidth());
RDebugUtils.currentLine=10223629;
 //BA.debugLineNum = 10223629;BA.debugLine="ListView1.Height = p_colonia.Height * 0.75";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setHeight((int) (__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .getHeight()*0.75));
RDebugUtils.currentLine=10223630;
 //BA.debugLineNum = 10223630;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__c.Colors.LightGray,(int) (2));
RDebugUtils.currentLine=10223631;
 //BA.debugLineNum = 10223631;BA.debugLine="If Not(l_rutaInfo.Visible) Then";
if (__c.Not(__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getVisible())) { 
RDebugUtils.currentLine=10223632;
 //BA.debugLineNum = 10223632;BA.debugLine="ListView1.Top = lv1Top";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int)(Double.parseDouble(__ref._lv1top /*String*/ )));
 }else {
RDebugUtils.currentLine=10223634;
 //BA.debugLineNum = 10223634;BA.debugLine="ListView1.Top = lv1Top + 100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int) ((double)(Double.parseDouble(__ref._lv1top /*String*/ ))+100));
 };
RDebugUtils.currentLine=10223636;
 //BA.debugLineNum = 10223636;BA.debugLine="c=Starter.skmt.ExecQuery(\"select codigo, indice,";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select codigo, indice, CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_NOEXT from waypoints inner join kmt_info on waypoints.codigo = kmt_info.CAT_CL_CODIGO where gestion = 0 AND CAT_CL_RUTA <> 1000 order by indice")));
RDebugUtils.currentLine=10223637;
 //BA.debugLineNum = 10223637;BA.debugLine="If c.RowCount > 0 Then 'Ya hay waypoints en la ba";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10223638;
 //BA.debugLineNum = 10223638;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10223640;
 //BA.debugLineNum = 10223640;BA.debugLine="conMapa = True";
__ref._conmapa /*boolean*/  = __c.True;
RDebugUtils.currentLine=10223642;
 //BA.debugLineNum = 10223642;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10223643;
 //BA.debugLineNum = 10223643;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=10223644;
 //BA.debugLineNum = 10223644;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=10223646;
 //BA.debugLineNum = 10223646;BA.debugLine="For i=0 To c.RowCount -1 'Generamos el listView";
{
final int step23 = 1;
final int limit23 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit23 ;_i = _i + step23 ) {
RDebugUtils.currentLine=10223647;
 //BA.debugLineNum = 10223647;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10223648;
 //BA.debugLineNum = 10223648;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=10223649;
 //BA.debugLineNum = 10223649;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=10223653;
 //BA.debugLineNum = 10223653;BA.debugLine="ListView1.AddTwoLines(cs.Color(Colors.RGB(100,1";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_cs.Color(__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("codigo"))).PopAll().getObject()),BA.ObjectToCharSequence(_cs2.Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE"))).Color(__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(" Calle: ")).Pop().Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE").trim()+" "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOEXT"))).PopAll().getObject()));
 }
};
 }else {
RDebugUtils.currentLine=10223656;
 //BA.debugLineNum = 10223656;BA.debugLine="generaListViewRutas";
__ref._generalistviewrutas /*void*/ (null);
 };
RDebugUtils.currentLine=10223658;
 //BA.debugLineNum = 10223658;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10223659;
 //BA.debugLineNum = 10223659;BA.debugLine="p_colonia.Width = Root.Width";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setWidth(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=10223660;
 //BA.debugLineNum = 10223660;BA.debugLine="p_colonia.Height = Root.Height";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setHeight(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getHeight());
RDebugUtils.currentLine=10223661;
 //BA.debugLineNum = 10223661;BA.debugLine="Subs.centraEtiqueta(l_rutaInfo, Root.Width)";
_subs._centraetiqueta /*String*/ (ba,__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ ,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=10223662;
 //BA.debugLineNum = 10223662;BA.debugLine="Subs.centraListView(ListView1, p_colonia.Width)";
_subs._centralistview /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .getWidth());
RDebugUtils.currentLine=10223663;
 //BA.debugLineNum = 10223663;BA.debugLine="ListView1.Height = p_colonia.Height * 0.70";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setHeight((int) (__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .getHeight()*0.70));
RDebugUtils.currentLine=10223664;
 //BA.debugLineNum = 10223664;BA.debugLine="Subs.centraEtiqueta(lfila, Root.Width)";
_subs._centraetiqueta /*String*/ (ba,__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ ,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=10223665;
 //BA.debugLineNum = 10223665;BA.debugLine="b_getRutaInfo.Visible = True";
__ref._b_getrutainfo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=10223666;
 //BA.debugLineNum = 10223666;BA.debugLine="b_getRutaInfo.BringToFront";
__ref._b_getrutainfo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .BringToFront();
RDebugUtils.currentLine=10223667;
 //BA.debugLineNum = 10223667;BA.debugLine="If Starter.cedisLocation.Latitude = \"0\" Then";
if (_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()==(double)(Double.parseDouble("0"))) { 
RDebugUtils.currentLine=10223668;
 //BA.debugLineNum = 10223668;BA.debugLine="Private x As Cursor = Starter.skmt.ExecQuery(\"se";
_x = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
_x = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select * from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'COORDS_ALMACEN'")));
RDebugUtils.currentLine=10223669;
 //BA.debugLineNum = 10223669;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=10223670;
 //BA.debugLineNum = 10223670;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=10223671;
 //BA.debugLineNum = 10223671;BA.debugLine="Private y() As String";
_y = new String[(int) (0)];
java.util.Arrays.fill(_y,"");
RDebugUtils.currentLine=10223672;
 //BA.debugLineNum = 10223672;BA.debugLine="Starter.cedisLocation.Latitude = Regex.Split(\",";
_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .setLatitude((double)(Double.parseDouble(__c.Regex.Split(",",_x.GetString("CAT_VA_VALOR"))[(int) (1)])));
RDebugUtils.currentLine=10223673;
 //BA.debugLineNum = 10223673;BA.debugLine="Starter.cedisLocation.Longitude = Regex.Split(\"";
_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .setLongitude((double)(Double.parseDouble(__c.Regex.Split(",",_x.GetString("CAT_VA_VALOR"))[(int) (0)])));
 };
 };
RDebugUtils.currentLine=10223676;
 //BA.debugLineNum = 10223676;BA.debugLine="Log(Starter.cedisLocation)";
__c.LogImpl("810223676",BA.ObjectToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ ),0);
RDebugUtils.currentLine=10223677;
 //BA.debugLineNum = 10223677;BA.debugLine="End Sub";
return "";
}
public void  _generalistviewrutas(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "generalistviewrutas", false))
	 {Debug.delegate(ba, "generalistviewrutas", null); return;}
ResumableSub_generaListViewRutas rsub = new ResumableSub_generaListViewRutas(this,__ref);
rsub.resume(ba, null);
}
public static class ResumableSub_generaListViewRutas extends BA.ResumableSub {
public ResumableSub_generaListViewRutas(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
int _i = 0;
int step16;
int limit16;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10420225;
 //BA.debugLineNum = 10420225;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10420226;
 //BA.debugLineNum = 10420226;BA.debugLine="Sleep(110)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "generalistviewrutas"),(int) (110));
this.state = 9;
return;
case 9:
//C
this.state = 1;
;
RDebugUtils.currentLine=10420227;
 //BA.debugLineNum = 10420227;BA.debugLine="lfila.Text = \"RUTA PREVENTA\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("RUTA PREVENTA"));
RDebugUtils.currentLine=10420228;
 //BA.debugLineNum = 10420228;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10420229;
 //BA.debugLineNum = 10420229;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=10420230;
 //BA.debugLineNum = 10420230;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=10420231;
 //BA.debugLineNum = 10420231;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=10420232;
 //BA.debugLineNum = 10420232;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10420233;
 //BA.debugLineNum = 10420233;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=10420234;
 //BA.debugLineNum = 10420234;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=10420235;
 //BA.debugLineNum = 10420235;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=10420236;
 //BA.debugLineNum = 10420236;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 60dip";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().setItemHeight(parent.__c.DipToCurrent((int) (60)));
RDebugUtils.currentLine=10420237;
 //BA.debugLineNum = 10420237;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_CL_RUTA, cou";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA, count(*) as cuantos from kmt_info where gestion = 0 AND CAT_CL_RUTA <> 1000 group by CAT_CL_RUTA order by CAT_CL_RUTA asc")));
RDebugUtils.currentLine=10420238;
 //BA.debugLineNum = 10420238;BA.debugLine="If c.RowCount>0 Then";
if (true) break;

case 1:
//if
this.state = 8;
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=10420239;
 //BA.debugLineNum = 10420239;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10420240;
 //BA.debugLineNum = 10420240;BA.debugLine="For i=0 To c.RowCount -1";
if (true) break;

case 4:
//for
this.state = 7;
step16 = 1;
limit16 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
this.state = 10;
if (true) break;

case 10:
//C
this.state = 7;
if ((step16 > 0 && _i <= limit16) || (step16 < 0 && _i >= limit16)) this.state = 6;
if (true) break;

case 11:
//C
this.state = 10;
_i = ((int)(0 + _i + step16)) ;
if (true) break;

case 6:
//C
this.state = 11;
RDebugUtils.currentLine=10420241;
 //BA.debugLineNum = 10420241;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10420242;
 //BA.debugLineNum = 10420242;BA.debugLine="ListView1.AddTwoLines(\"Ruta: \" & c.GetString(\"C";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence("Ruta: "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA")),BA.ObjectToCharSequence("Por visitar:  "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("cuantos")));
 if (true) break;
if (true) break;

case 7:
//C
this.state = 8;
;
 if (true) break;

case 8:
//C
this.state = -1;
;
RDebugUtils.currentLine=10420245;
 //BA.debugLineNum = 10420245;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10420246;
 //BA.debugLineNum = 10420246;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "b4xpage_closerequest", false))
	 {return ((anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) Debug.delegate(ba, "b4xpage_closerequest", null));}
ResumableSub_B4XPage_CloseRequest rsub = new ResumableSub_B4XPage_CloseRequest(this,__ref);
rsub.resume(ba, null);
return (anywheresoftware.b4a.keywords.Common.ResumableSubWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.keywords.Common.ResumableSubWrapper(), rsub);
}
public static class ResumableSub_B4XPage_CloseRequest extends BA.ResumableSub {
public ResumableSub_B4XPage_CloseRequest(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
{
parent.__c.ReturnFromResumableSub(this,null);return;}
case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10289155;
 //BA.debugLineNum = 10289155;BA.debugLine="Log(entro)";
parent.__c.LogImpl("810289155",__ref._entro /*String*/ ,0);
RDebugUtils.currentLine=10289156;
 //BA.debugLineNum = 10289156;BA.debugLine="If rutaGenerada Or entro = 3 Then ' Si ya generam";
if (true) break;

case 1:
//if
this.state = 6;
if (__ref._rutagenerada /*boolean*/  || (__ref._entro /*String*/ ).equals(BA.NumberToString(3))) { 
this.state = 3;
}else 
{RDebugUtils.currentLine=10289160;
 //BA.debugLineNum = 10289160;BA.debugLine="else if entro = 2 Then ' Si estamos mostrando las";
if ((__ref._entro /*String*/ ).equals(BA.NumberToString(2))) { 
this.state = 5;
}}
if (true) break;

case 3:
//C
this.state = 6;
RDebugUtils.currentLine=10289157;
 //BA.debugLineNum = 10289157;BA.debugLine="b_limpiarRuta_Click";
__ref._b_limpiarruta_click /*String*/ (null);
RDebugUtils.currentLine=10289158;
 //BA.debugLineNum = 10289158;BA.debugLine="l_rutaInfo.Text = \"\"";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=10289159;
 //BA.debugLineNum = 10289159;BA.debugLine="rutaGenerada = False";
__ref._rutagenerada /*boolean*/  = parent.__c.False;
 if (true) break;

case 5:
//C
this.state = 6;
RDebugUtils.currentLine=10289161;
 //BA.debugLineNum = 10289161;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
parent._b4xpages._showpage /*String*/ (ba,"Principal");
 if (true) break;

case 6:
//C
this.state = -1;
;
RDebugUtils.currentLine=10289163;
 //BA.debugLineNum = 10289163;BA.debugLine="Return False";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(parent.__c.False));return;};
RDebugUtils.currentLine=10289164;
 //BA.debugLineNum = 10289164;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _busca_textchanged(reparto_izca.keymon.lat.c_clientes __ref,String _old,String _new) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "busca_textchanged", false))
	 {return ((String) Debug.delegate(ba, "busca_textchanged", new Object[] {_old,_new}));}
int _i = 0;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
RDebugUtils.currentLine=10551296;
 //BA.debugLineNum = 10551296;BA.debugLine="Sub BUSCA_TextChanged (Old As String, New As Strin";
RDebugUtils.currentLine=10551297;
 //BA.debugLineNum = 10551297;BA.debugLine="q_buscar = \"%\" & busca.Text & \"%\"";
__ref._q_buscar /*String*/  = "%"+__ref._busca /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()+"%";
RDebugUtils.currentLine=10551298;
 //BA.debugLineNum = 10551298;BA.debugLine="c2=Starter.skmt.ExecQuery2(\"select  CAT_CL_NOMBRE";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select  CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where CAT_CL_NOMBRE like ? and gestion = 0 AND CAT_CL_RUTA <> 1000 order by CAT_CL_CODIGO ",new String[]{__ref._q_buscar /*String*/ })));
RDebugUtils.currentLine=10551299;
 //BA.debugLineNum = 10551299;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10551300;
 //BA.debugLineNum = 10551300;BA.debugLine="lfila.text = \"Nombre y Calle\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Nombre y Calle"));
RDebugUtils.currentLine=10551301;
 //BA.debugLineNum = 10551301;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
_subs._setdivider /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,__c.Colors.LightGray,(int) (2));
RDebugUtils.currentLine=10551302;
 //BA.debugLineNum = 10551302;BA.debugLine="If c2.RowCount>0 Then";
if (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10551303;
 //BA.debugLineNum = 10551303;BA.debugLine="For i=0 To c2.RowCount -1";
{
final int step7 = 1;
final int limit7 = (int) (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit7 ;_i = _i + step7 ) {
RDebugUtils.currentLine=10551304;
 //BA.debugLineNum = 10551304;BA.debugLine="c2.Position=i";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10551305;
 //BA.debugLineNum = 10551305;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10551306;
 //BA.debugLineNum = 10551306;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=10551307;
 //BA.debugLineNum = 10551307;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=10551308;
 //BA.debugLineNum = 10551308;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=10551309;
 //BA.debugLineNum = 10551309;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10551310;
 //BA.debugLineNum = 10551310;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=10551311;
 //BA.debugLineNum = 10551311;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=10551312;
 //BA.debugLineNum = 10551312;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=10551313;
 //BA.debugLineNum = 10551313;BA.debugLine="ListView1.AddTwoLines(c2.GetString(\"CAT_CL_CODI";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CODIGO")),BA.ObjectToCharSequence(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE")+" CALLE:  "+__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE")));
 }
};
 };
RDebugUtils.currentLine=10551316;
 //BA.debugLineNum = 10551316;BA.debugLine="entro = \"3\"";
__ref._entro /*String*/  = "3";
RDebugUtils.currentLine=10551317;
 //BA.debugLineNum = 10551317;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10551318;
 //BA.debugLineNum = 10551318;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
RDebugUtils.currentLine=10027008;
 //BA.debugLineNum = 10027008;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=10027009;
 //BA.debugLineNum = 10027009;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=10027010;
 //BA.debugLineNum = 10027010;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=10027011;
 //BA.debugLineNum = 10027011;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
RDebugUtils.currentLine=10027013;
 //BA.debugLineNum = 10027013;BA.debugLine="Dim entro As String";
_entro = "";
RDebugUtils.currentLine=10027014;
 //BA.debugLineNum = 10027014;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=10027015;
 //BA.debugLineNum = 10027015;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=10027016;
 //BA.debugLineNum = 10027016;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=10027018;
 //BA.debugLineNum = 10027018;BA.debugLine="Dim lfila As Label";
_lfila = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10027019;
 //BA.debugLineNum = 10027019;BA.debugLine="Dim busca As EditText";
_busca = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=10027020;
 //BA.debugLineNum = 10027020;BA.debugLine="Private p_colonia As Panel";
_p_colonia = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=10027023;
 //BA.debugLineNum = 10027023;BA.debugLine="Dim laRuta As String";
_laruta = "";
RDebugUtils.currentLine=10027024;
 //BA.debugLineNum = 10027024;BA.debugLine="Private b_GetDirs As Button";
_b_getdirs = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=10027025;
 //BA.debugLineNum = 10027025;BA.debugLine="Private distOrderedMap, clientesMapaO As B4XOrder";
_distorderedmap = new reparto_izca.keymon.lat.b4xorderedmap();
_clientesmapao = new reparto_izca.keymon.lat.b4xorderedmap();
RDebugUtils.currentLine=10027026;
 //BA.debugLineNum = 10027026;BA.debugLine="Private img_getDirs As ImageView";
_img_getdirs = new anywheresoftware.b4a.objects.ImageViewWrapper();
RDebugUtils.currentLine=10027027;
 //BA.debugLineNum = 10027027;BA.debugLine="Private l_rutaInfo As Label";
_l_rutainfo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10027028;
 //BA.debugLineNum = 10027028;BA.debugLine="Private b_getRutaInfo As Button";
_b_getrutainfo = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=10027029;
 //BA.debugLineNum = 10027029;BA.debugLine="Private conMapa As Boolean = False";
_conmapa = __c.False;
RDebugUtils.currentLine=10027030;
 //BA.debugLineNum = 10027030;BA.debugLine="Dim listaWayPoints As List";
_listawaypoints = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=10027031;
 //BA.debugLineNum = 10027031;BA.debugLine="Dim lv1Top As String";
_lv1top = "";
RDebugUtils.currentLine=10027032;
 //BA.debugLineNum = 10027032;BA.debugLine="Private b_limpiarRuta As Button";
_b_limpiarruta = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=10027033;
 //BA.debugLineNum = 10027033;BA.debugLine="Dim rutaGenerada As Boolean = False";
_rutagenerada = __c.False;
RDebugUtils.currentLine=10027034;
 //BA.debugLineNum = 10027034;BA.debugLine="Dim rutaacambiar As String";
_rutaacambiar = "";
RDebugUtils.currentLine=10027035;
 //BA.debugLineNum = 10027035;BA.debugLine="End Sub";
return "";
}
public void  _listview1_itemclick(reparto_izca.keymon.lat.c_clientes __ref,int _position,Object _value) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "listview1_itemclick", false))
	 {Debug.delegate(ba, "listview1_itemclick", new Object[] {_position,_value}); return;}
ResumableSub_ListView1_ItemClick rsub = new ResumableSub_ListView1_ItemClick(this,__ref,_position,_value);
rsub.resume(ba, null);
}
public static class ResumableSub_ListView1_ItemClick extends BA.ResumableSub {
public ResumableSub_ListView1_ItemClick(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref,int _position,Object _value) {
this.parent = parent;
this.__ref = __ref;
this._position = _position;
this._value = _value;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
int _position;
Object _value;
String _lrt = "";
anywheresoftware.b4a.gps.LocationWrapper _thisloc = null;
anywheresoftware.b4a.objects.LabelWrapper _label1 = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
int _i = 0;
int _distancia = 0;
anywheresoftware.b4a.objects.collections.Map _estecliente = null;
anywheresoftware.b4a.objects.collections.Map _m1 = null;
Object _k = null;
int step34;
int limit34;
anywheresoftware.b4a.BA.IterableList group45;
int index45;
int groupLen45;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10354690;
 //BA.debugLineNum = 10354690;BA.debugLine="Log(Value)";
parent.__c.LogImpl("810354690",BA.ObjectToString(_value),0);
RDebugUtils.currentLine=10354691;
 //BA.debugLineNum = 10354691;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10354692;
 //BA.debugLineNum = 10354692;BA.debugLine="Sleep(50)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "listview1_itemclick"),(int) (50));
this.state = 31;
return;
case 31:
//C
this.state = 1;
;
RDebugUtils.currentLine=10354693;
 //BA.debugLineNum = 10354693;BA.debugLine="Subs.SetDivider(ListView1, Colors.LightGray, 2)";
parent._subs._setdivider /*String*/ (ba,__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ ,parent.__c.Colors.LightGray,(int) (2));
RDebugUtils.currentLine=10354694;
 //BA.debugLineNum = 10354694;BA.debugLine="If Not(l_rutaInfo.Visible) Then";
if (true) break;

case 1:
//if
this.state = 6;
if (parent.__c.Not(__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getVisible())) { 
this.state = 3;
}else {
this.state = 5;
}if (true) break;

case 3:
//C
this.state = 6;
RDebugUtils.currentLine=10354695;
 //BA.debugLineNum = 10354695;BA.debugLine="ListView1.Top = lv1Top";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int)(Double.parseDouble(__ref._lv1top /*String*/ )));
 if (true) break;

case 5:
//C
this.state = 6;
RDebugUtils.currentLine=10354697;
 //BA.debugLineNum = 10354697;BA.debugLine="ListView1.Top = lv1Top + 100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int) ((double)(Double.parseDouble(__ref._lv1top /*String*/ ))+100));
 if (true) break;

case 6:
//C
this.state = 7;
;
RDebugUtils.currentLine=10354699;
 //BA.debugLineNum = 10354699;BA.debugLine="l_rutaInfo.Visible = False";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.False);
RDebugUtils.currentLine=10354700;
 //BA.debugLineNum = 10354700;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(parent.__c.False);
RDebugUtils.currentLine=10354701;
 //BA.debugLineNum = 10354701;BA.debugLine="If entro = \"2\" Then";
if (true) break;

case 7:
//if
this.state = 30;
if ((__ref._entro /*String*/ ).equals("2")) { 
this.state = 9;
}else 
{RDebugUtils.currentLine=10354747;
 //BA.debugLineNum = 10354747;BA.debugLine="Else If entro = \"3\" Then";
if ((__ref._entro /*String*/ ).equals("3")) { 
this.state = 29;
}}
if (true) break;

case 9:
//C
this.state = 10;
RDebugUtils.currentLine=10354705;
 //BA.debugLineNum = 10354705;BA.debugLine="Private lrt As String";
_lrt = "";
RDebugUtils.currentLine=10354706;
 //BA.debugLineNum = 10354706;BA.debugLine="lrt = Value";
_lrt = BA.ObjectToString(_value);
RDebugUtils.currentLine=10354707;
 //BA.debugLineNum = 10354707;BA.debugLine="laRuta = lrt.SubString(6) 'Quitamos el texto \"Ru";
__ref._laruta /*String*/  = _lrt.substring((int) (6));
RDebugUtils.currentLine=10354708;
 //BA.debugLineNum = 10354708;BA.debugLine="Log($\"Original: ${Value} - Mod: |${lrt.SubString";
parent.__c.LogImpl("810354708",("Original: "+parent.__c.SmartStringFormatter("",_value)+" - Mod: |"+parent.__c.SmartStringFormatter("",(Object)(_lrt.substring((int) (6))))+"| - laRuta: "+parent.__c.SmartStringFormatter("",(Object)(__ref._laruta /*String*/ ))+""),0);
RDebugUtils.currentLine=10354709;
 //BA.debugLineNum = 10354709;BA.debugLine="rutaacambiar = laRuta";
__ref._rutaacambiar /*String*/  = __ref._laruta /*String*/ ;
RDebugUtils.currentLine=10354710;
 //BA.debugLineNum = 10354710;BA.debugLine="c2 = Starter.skmt.ExecQuery2(\"select CAT_CL_NOMB";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where CAT_CL_RUTA = ? and gestion = 0 AND CAT_CL_RUTA <> 1000 order by CAT_CL_NOMBRE ",new String[]{__ref._laruta /*String*/ })));
RDebugUtils.currentLine=10354711;
 //BA.debugLineNum = 10354711;BA.debugLine="Private thisLoc As Location";
_thisloc = new anywheresoftware.b4a.gps.LocationWrapper();
RDebugUtils.currentLine=10354712;
 //BA.debugLineNum = 10354712;BA.debugLine="Private label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10354713;
 //BA.debugLineNum = 10354713;BA.debugLine="Private label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10354714;
 //BA.debugLineNum = 10354714;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=10354715;
 //BA.debugLineNum = 10354715;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=10354716;
 //BA.debugLineNum = 10354716;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=10354717;
 //BA.debugLineNum = 10354717;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=10354718;
 //BA.debugLineNum = 10354718;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=10354719;
 //BA.debugLineNum = 10354719;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=10354720;
 //BA.debugLineNum = 10354720;BA.debugLine="label2.Height = 57dip";
_label2.setHeight(parent.__c.DipToCurrent((int) (57)));
RDebugUtils.currentLine=10354721;
 //BA.debugLineNum = 10354721;BA.debugLine="thisLoc.Initialize";
_thisloc.Initialize();
RDebugUtils.currentLine=10354722;
 //BA.debugLineNum = 10354722;BA.debugLine="If entro = 2 Then ListView1.TwoLinesLayout.ItemH";
if (true) break;

case 10:
//if
this.state = 15;
if ((__ref._entro /*String*/ ).equals(BA.NumberToString(2))) { 
this.state = 12;
;}if (true) break;

case 12:
//C
this.state = 15;
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().setItemHeight(parent.__c.DipToCurrent((int) (90)));
if (true) break;

case 15:
//C
this.state = 16;
;
RDebugUtils.currentLine=10354723;
 //BA.debugLineNum = 10354723;BA.debugLine="lfila.text = \"Nombre y Calle\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Nombre y Calle"));
RDebugUtils.currentLine=10354724;
 //BA.debugLineNum = 10354724;BA.debugLine="distOrderedMap.Initialize";
__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._initialize /*String*/ (null,ba);
RDebugUtils.currentLine=10354725;
 //BA.debugLineNum = 10354725;BA.debugLine="If c2.RowCount > 0 Then";
if (true) break;

case 16:
//if
this.state = 27;
if (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
this.state = 18;
}if (true) break;

case 18:
//C
this.state = 19;
RDebugUtils.currentLine=10354726;
 //BA.debugLineNum = 10354726;BA.debugLine="For i = 0 To c2.RowCount -1 'Generamos mapa de";
if (true) break;

case 19:
//for
this.state = 22;
step34 = 1;
limit34 = (int) (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
this.state = 32;
if (true) break;

case 32:
//C
this.state = 22;
if ((step34 > 0 && _i <= limit34) || (step34 < 0 && _i >= limit34)) this.state = 21;
if (true) break;

case 33:
//C
this.state = 32;
_i = ((int)(0 + _i + step34)) ;
if (true) break;

case 21:
//C
this.state = 33;
RDebugUtils.currentLine=10354727;
 //BA.debugLineNum = 10354727;BA.debugLine="c2.Position = i";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10354728;
 //BA.debugLineNum = 10354728;BA.debugLine="thisLoc.Latitude = c2.GetString(\"CAT_CL_LAT\")";
_thisloc.setLatitude((double)(Double.parseDouble(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LAT"))));
RDebugUtils.currentLine=10354729;
 //BA.debugLineNum = 10354729;BA.debugLine="thisLoc.Longitude = c2.GetString(\"CAT_CL_LONG\"";
_thisloc.setLongitude((double)(Double.parseDouble(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LONG"))));
RDebugUtils.currentLine=10354731;
 //BA.debugLineNum = 10354731;BA.debugLine="Private distancia As Int = Tracker.UUGCoords.D";
_distancia = (int) (parent._tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ .DistanceTo((android.location.Location)(_thisloc.getObject())));
RDebugUtils.currentLine=10354732;
 //BA.debugLineNum = 10354732;BA.debugLine="Private esteCliente As Map = CreateMap(\"distan";
_estecliente = new anywheresoftware.b4a.objects.collections.Map();
_estecliente = parent.__c.createMap(new Object[] {(Object)("distancia"),(Object)(_distancia),(Object)("ubicacion"),(Object)(BA.NumberToString(_thisloc.getLongitude())+","+BA.NumberToString(_thisloc.getLatitude())),(Object)("codigo"),(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CODIGO")),(Object)("nomDirDist"),(Object)((""+parent.__c.SmartStringFormatter("",(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE")))+" CALLE: "+parent.__c.SmartStringFormatter("",(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE")))+" "+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+"Distancia: "+parent.__c.SmartStringFormatter("1.1",(Object)((_distancia/(double)1000)))+" kms"))});
RDebugUtils.currentLine=10354733;
 //BA.debugLineNum = 10354733;BA.debugLine="distOrderedMap.Put(distancia, esteCliente)";
__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._put /*String*/ (null,(Object)(_distancia),(Object)(_estecliente.getObject()));
 if (true) break;
if (true) break;

case 22:
//C
this.state = 23;
;
RDebugUtils.currentLine=10354735;
 //BA.debugLineNum = 10354735;BA.debugLine="distOrderedMap.Keys.Sort(True) 'Ordenamos la ma";
__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).Sort(parent.__c.True);
RDebugUtils.currentLine=10354736;
 //BA.debugLineNum = 10354736;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10354737;
 //BA.debugLineNum = 10354737;BA.debugLine="Private m1 As Map";
_m1 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10354738;
 //BA.debugLineNum = 10354738;BA.debugLine="For Each k As Object In distOrderedMap.Keys  'G";
if (true) break;

case 23:
//for
this.state = 26;
group45 = __ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null);
index45 = 0;
groupLen45 = group45.getSize();
this.state = 34;
if (true) break;

case 34:
//C
this.state = 26;
if (index45 < groupLen45) {
this.state = 25;
_k = group45.Get(index45);}
if (true) break;

case 35:
//C
this.state = 34;
index45++;
if (true) break;

case 25:
//C
this.state = 35;
RDebugUtils.currentLine=10354739;
 //BA.debugLineNum = 10354739;BA.debugLine="m1 = distOrderedMap.Get(k)";
_m1 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._distorderedmap /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=10354740;
 //BA.debugLineNum = 10354740;BA.debugLine="m1.Get(\"codigo\")";
_m1.Get((Object)("codigo"));
RDebugUtils.currentLine=10354742;
 //BA.debugLineNum = 10354742;BA.debugLine="ListView1.AddTwoLines(m1.Get(\"codigo\"), m1.Get";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_m1.Get((Object)("codigo"))),BA.ObjectToCharSequence(_m1.Get((Object)("nomDirDist"))));
 if (true) break;
if (true) break;

case 26:
//C
this.state = 27;
;
 if (true) break;

case 27:
//C
this.state = 30;
;
RDebugUtils.currentLine=10354745;
 //BA.debugLineNum = 10354745;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10354746;
 //BA.debugLineNum = 10354746;BA.debugLine="entro = \"3\"";
__ref._entro /*String*/  = "3";
 if (true) break;

case 29:
//C
this.state = 30;
RDebugUtils.currentLine=10354749;
 //BA.debugLineNum = 10354749;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from CUENTAA\")";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
RDebugUtils.currentLine=10354750;
 //BA.debugLineNum = 10354750;BA.debugLine="Starter.skmt.ExecNonQuery2(\"INSERT INTO CUENTAA";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("INSERT INTO CUENTAA VALUES (?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_value}));
RDebugUtils.currentLine=10354751;
 //BA.debugLineNum = 10354751;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 if (true) break;

case 30:
//C
this.state = -1;
;
RDebugUtils.currentLine=10354753;
 //BA.debugLineNum = 10354753;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public void  _traerutadia(reparto_izca.keymon.lat.c_clientes __ref,reparto_izca.keymon.lat.b4xorderedmap _avisitar) throws Exception{
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "traerutadia", false))
	 {Debug.delegate(ba, "traerutadia", new Object[] {_avisitar}); return;}
ResumableSub_traeRutaDia rsub = new ResumableSub_traeRutaDia(this,__ref,_avisitar);
rsub.resume(ba, null);
}
public static class ResumableSub_traeRutaDia extends BA.ResumableSub {
public ResumableSub_traeRutaDia(reparto_izca.keymon.lat.c_clientes parent,reparto_izca.keymon.lat.c_clientes __ref,reparto_izca.keymon.lat.b4xorderedmap _avisitar) {
this.parent = parent;
this.__ref = __ref;
this._avisitar = _avisitar;
this.__ref = parent;
}
reparto_izca.keymon.lat.c_clientes __ref;
reparto_izca.keymon.lat.c_clientes parent;
reparto_izca.keymon.lat.b4xorderedmap _avisitar;
String _coordsinicio = "";
String _rutacompleta = "";
String _preruta = "";
double _distanciatotal = 0;
double _distanciatotal0 = 0;
double _tiempo0 = 0;
double _tiempo = 0;
boolean _masde100 = false;
anywheresoftware.b4a.objects.collections.Map _m4 = null;
int _visitaactual = 0;
int _cuantosantes = 0;
Object _k = null;
double _tiempovisitas = 0;
reparto_izca.keymon.lat.httpjob _j0 = null;
anywheresoftware.b4a.objects.collections.JSONParser _jp0 = null;
anywheresoftware.b4a.objects.collections.Map _m0 = null;
anywheresoftware.b4a.objects.collections.List _puntos0 = null;
anywheresoftware.b4a.objects.collections.Map _estewaypoint0 = null;
int _p = 0;
anywheresoftware.b4a.objects.collections.List _rutas0 = null;
anywheresoftware.b4a.objects.collections.Map _rutas20 = null;
reparto_izca.keymon.lat.httpjob _j = null;
anywheresoftware.b4a.objects.collections.JSONParser _jp = null;
anywheresoftware.b4a.objects.collections.Map _m = null;
anywheresoftware.b4a.objects.collections.List _puntos = null;
anywheresoftware.b4a.objects.collections.Map _estewaypoint = null;
int _twpi = 0;
anywheresoftware.b4a.objects.collections.List _rutas = null;
anywheresoftware.b4a.objects.collections.Map _rutas2 = null;
int _r = 0;
anywheresoftware.b4a.objects.collections.Map _r1 = null;
anywheresoftware.b4a.objects.collections.Map _wps = null;
anywheresoftware.b4a.objects.LabelWrapper _label2 = null;
anywheresoftware.b4a.objects.CSBuilder _cs = null;
anywheresoftware.b4a.objects.CSBuilder _cs2 = null;
int _i = 0;
anywheresoftware.b4a.BA.IterableList group18;
int index18;
int groupLen18;
int step47;
int limit47;
int step78;
int limit78;
anywheresoftware.b4a.BA.IterableList group112;
int index112;
int groupLen112;
int step135;
int limit135;

@Override
public void resume(BA ba, Object[] result) throws Exception{
RDebugUtils.currentModule="c_clientes";

    while (true) {
        switch (state) {
            case -1:
return;

case 0:
//C
this.state = 1;
RDebugUtils.currentLine=10682369;
 //BA.debugLineNum = 10682369;BA.debugLine="Private coordsInicio As String = $\"${Starter.cedi";
_coordsinicio = (""+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()))+","+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()))+"");
RDebugUtils.currentLine=10682370;
 //BA.debugLineNum = 10682370;BA.debugLine="Log($\"Coordenadas de inicio: ${Starter.cedisLocat";
parent.__c.LogImpl("810682370",("Coordenadas de inicio: "+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude()))+","+parent.__c.SmartStringFormatter("",(Object)(parent._starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()))+""),0);
RDebugUtils.currentLine=10682371;
 //BA.debugLineNum = 10682371;BA.debugLine="Private rutaCompleta As String = coordsInicio";
_rutacompleta = _coordsinicio;
RDebugUtils.currentLine=10682372;
 //BA.debugLineNum = 10682372;BA.debugLine="Private preRuta As String = coordsInicio";
_preruta = _coordsinicio;
RDebugUtils.currentLine=10682373;
 //BA.debugLineNum = 10682373;BA.debugLine="Private distanciaTotal, distanciaTotal0, tiempo0,";
_distanciatotal = 0;
_distanciatotal0 = 0;
_tiempo0 = 0;
_tiempo = 0;
RDebugUtils.currentLine=10682374;
 //BA.debugLineNum = 10682374;BA.debugLine="Private masDe100 As Boolean";
_masde100 = false;
RDebugUtils.currentLine=10682375;
 //BA.debugLineNum = 10682375;BA.debugLine="Private m4 As Map";
_m4 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10682376;
 //BA.debugLineNum = 10682376;BA.debugLine="Private visitaActual As Int = 0";
_visitaactual = (int) (0);
RDebugUtils.currentLine=10682377;
 //BA.debugLineNum = 10682377;BA.debugLine="Private cuantosAntes As Int = 0";
_cuantosantes = (int) (0);
RDebugUtils.currentLine=10682378;
 //BA.debugLineNum = 10682378;BA.debugLine="listaWayPoints.Initialize";
__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=10682379;
 //BA.debugLineNum = 10682379;BA.debugLine="If aVisitar.Keys.Size > 98 Then 'Si los clientes";
if (true) break;

case 1:
//if
this.state = 4;
if (_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()>98) { 
this.state = 3;
}if (true) break;

case 3:
//C
this.state = 4;
RDebugUtils.currentLine=10682380;
 //BA.debugLineNum = 10682380;BA.debugLine="cuantosAntes = aVisitar.Keys.Size - 98 'Definimo";
_cuantosantes = (int) (_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()-98);
RDebugUtils.currentLine=10682381;
 //BA.debugLineNum = 10682381;BA.debugLine="preRuta = coordsInicio 'Ponemos las coordenadas";
_preruta = _coordsinicio;
RDebugUtils.currentLine=10682382;
 //BA.debugLineNum = 10682382;BA.debugLine="rutaCompleta = \"\"";
_rutacompleta = "";
RDebugUtils.currentLine=10682383;
 //BA.debugLineNum = 10682383;BA.debugLine="masDe100 = True";
_masde100 = parent.__c.True;
 if (true) break;

case 4:
//C
this.state = 5;
;
RDebugUtils.currentLine=10682385;
 //BA.debugLineNum = 10682385;BA.debugLine="Log($\"a visitar: ${aVisitar.Keys.Size}\"$)";
parent.__c.LogImpl("810682385",("a visitar: "+parent.__c.SmartStringFormatter("",(Object)(_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()))+""),0);
RDebugUtils.currentLine=10682386;
 //BA.debugLineNum = 10682386;BA.debugLine="For Each k As Object In aVisitar.Keys";
if (true) break;

case 5:
//for
this.state = 15;
group18 = _avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null);
index18 = 0;
groupLen18 = group18.getSize();
this.state = 70;
if (true) break;

case 70:
//C
this.state = 15;
if (index18 < groupLen18) {
this.state = 7;
_k = group18.Get(index18);}
if (true) break;

case 71:
//C
this.state = 70;
index18++;
if (true) break;

case 7:
//C
this.state = 8;
RDebugUtils.currentLine=10682387;
 //BA.debugLineNum = 10682387;BA.debugLine="visitaActual = visitaActual + 1";
_visitaactual = (int) (_visitaactual+1);
RDebugUtils.currentLine=10682388;
 //BA.debugLineNum = 10682388;BA.debugLine="m4 = aVisitar.Get(k)";
_m4 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_avisitar._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=10682390;
 //BA.debugLineNum = 10682390;BA.debugLine="If visitaActual < cuantosAntes + 2 Then 'Si esta";
if (true) break;

case 8:
//if
this.state = 11;
if (_visitaactual<_cuantosantes+2) { 
this.state = 10;
}if (true) break;

case 10:
//C
this.state = 11;
RDebugUtils.currentLine=10682391;
 //BA.debugLineNum = 10682391;BA.debugLine="preRuta = preRuta & \";\" & m4.Get(\"coords\")";
_preruta = _preruta+";"+BA.ObjectToString(_m4.Get((Object)("coords")));
 if (true) break;
;
RDebugUtils.currentLine=10682394;
 //BA.debugLineNum = 10682394;BA.debugLine="If visitaActual >= cuantosAntes + 2 Then 'Si est";

case 11:
//if
this.state = 14;
if (_visitaactual>=_cuantosantes+2) { 
this.state = 13;
}if (true) break;

case 13:
//C
this.state = 14;
RDebugUtils.currentLine=10682395;
 //BA.debugLineNum = 10682395;BA.debugLine="rutaCompleta = rutaCompleta & \";\" & m4.Get(\"coo";
_rutacompleta = _rutacompleta+";"+BA.ObjectToString(_m4.Get((Object)("coords")));
 if (true) break;

case 14:
//C
this.state = 71;
;
 if (true) break;
if (true) break;

case 15:
//C
this.state = 16;
;
RDebugUtils.currentLine=10682399;
 //BA.debugLineNum = 10682399;BA.debugLine="rutaCompleta = rutaCompleta & \";\" & coordsInicio";
_rutacompleta = _rutacompleta+";"+_coordsinicio;
RDebugUtils.currentLine=10682401;
 //BA.debugLineNum = 10682401;BA.debugLine="If rutaCompleta.StartsWith(\";\") Then rutaCompleta";
if (true) break;

case 16:
//if
this.state = 21;
if (_rutacompleta.startsWith(";")) { 
this.state = 18;
;}if (true) break;

case 18:
//C
this.state = 21;
_rutacompleta = _rutacompleta.substring((int) (1));
if (true) break;

case 21:
//C
this.state = 22;
;
RDebugUtils.currentLine=10682404;
 //BA.debugLineNum = 10682404;BA.debugLine="ProgressDialogShow2(\"Calculando distancia y tiemp";
parent.__c.ProgressDialogShow2(ba,BA.ObjectToCharSequence("Calculando distancia y tiempo, un momento por favor."),parent.__c.False);
RDebugUtils.currentLine=10682405;
 //BA.debugLineNum = 10682405;BA.debugLine="Private tiempoVisitas As Double 'TIMEPO DE 4 MINU";
_tiempovisitas = 0;
RDebugUtils.currentLine=10682406;
 //BA.debugLineNum = 10682406;BA.debugLine="tiempoVisitas = aVisitar.Keys.Size * 4 * 60 'Aqui";
_tiempovisitas = _avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()*4*60;
RDebugUtils.currentLine=10682407;
 //BA.debugLineNum = 10682407;BA.debugLine="tiempo0 = 0";
_tiempo0 = 0;
RDebugUtils.currentLine=10682408;
 //BA.debugLineNum = 10682408;BA.debugLine="distanciaTotal0 = 0";
_distanciatotal0 = 0;
RDebugUtils.currentLine=10682409;
 //BA.debugLineNum = 10682409;BA.debugLine="If masDe100 Then 'Si son mas de 100, entonces pri";
if (true) break;

case 22:
//if
this.state = 39;
if (_masde100) { 
this.state = 24;
}if (true) break;

case 24:
//C
this.state = 25;
RDebugUtils.currentLine=10682410;
 //BA.debugLineNum = 10682410;BA.debugLine="Dim j0 As HttpJob";
_j0 = new reparto_izca.keymon.lat.httpjob();
RDebugUtils.currentLine=10682411;
 //BA.debugLineNum = 10682411;BA.debugLine="j0.Initialize(\"trip0\", Me)";
_j0._initialize /*String*/ (null,ba,"trip0",parent);
RDebugUtils.currentLine=10682412;
 //BA.debugLineNum = 10682412;BA.debugLine="j0.Download(\"https://router.project-osrm.org/tri";
_j0._download /*String*/ (null,"https://router.project-osrm.org/trip/v1/driving/"+_preruta+"?source=first&destination=last&roundtrip=false&geometries=geojson");
RDebugUtils.currentLine=10682414;
 //BA.debugLineNum = 10682414;BA.debugLine="Wait For (j0) JobDone(j0 As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "traerutadia"), (Object)(_j0));
this.state = 72;
return;
case 72:
//C
this.state = 25;
_j0 = (reparto_izca.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=10682415;
 //BA.debugLineNum = 10682415;BA.debugLine="If j0.Success Then";
if (true) break;

case 25:
//if
this.state = 38;
if (_j0._success /*boolean*/ ) { 
this.state = 27;
}else {
this.state = 37;
}if (true) break;

case 27:
//C
this.state = 28;
RDebugUtils.currentLine=10682416;
 //BA.debugLineNum = 10682416;BA.debugLine="Dim jp0 As JSONParser";
_jp0 = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=10682417;
 //BA.debugLineNum = 10682417;BA.debugLine="jp0.Initialize(j0.GetString)";
_jp0.Initialize(_j0._getstring /*String*/ (null));
RDebugUtils.currentLine=10682418;
 //BA.debugLineNum = 10682418;BA.debugLine="Dim m0 As Map = jp0.NextObject";
_m0 = new anywheresoftware.b4a.objects.collections.Map();
_m0 = _jp0.NextObject();
RDebugUtils.currentLine=10682419;
 //BA.debugLineNum = 10682419;BA.debugLine="If m0.Get(\"code\") = \"Ok\" Then";
if (true) break;

case 28:
//if
this.state = 35;
if ((_m0.Get((Object)("code"))).equals((Object)("Ok"))) { 
this.state = 30;
}if (true) break;

case 30:
//C
this.state = 31;
RDebugUtils.currentLine=10682420;
 //BA.debugLineNum = 10682420;BA.debugLine="Dim puntos0 As List = m0.Get(\"waypoints\")";
_puntos0 = new anywheresoftware.b4a.objects.collections.List();
_puntos0 = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m0.Get((Object)("waypoints"))));
RDebugUtils.currentLine=10682421;
 //BA.debugLineNum = 10682421;BA.debugLine="Private esteWayPoint0 As Map";
_estewaypoint0 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10682422;
 //BA.debugLineNum = 10682422;BA.debugLine="For p = 0 To puntos0.Size -1";
if (true) break;

case 31:
//for
this.state = 34;
step47 = 1;
limit47 = (int) (_puntos0.getSize()-1);
_p = (int) (0) ;
this.state = 73;
if (true) break;

case 73:
//C
this.state = 34;
if ((step47 > 0 && _p <= limit47) || (step47 < 0 && _p >= limit47)) this.state = 33;
if (true) break;

case 74:
//C
this.state = 73;
_p = ((int)(0 + _p + step47)) ;
if (true) break;

case 33:
//C
this.state = 74;
RDebugUtils.currentLine=10682423;
 //BA.debugLineNum = 10682423;BA.debugLine="esteWayPoint0 = puntos0.Get(p)";
_estewaypoint0 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_puntos0.Get(_p)));
RDebugUtils.currentLine=10682426;
 //BA.debugLineNum = 10682426;BA.debugLine="esteWayPoint0.Remove(\"hint\")";
_estewaypoint0.Remove((Object)("hint"));
RDebugUtils.currentLine=10682427;
 //BA.debugLineNum = 10682427;BA.debugLine="esteWayPoint0.Remove(\"distance\")";
_estewaypoint0.Remove((Object)("distance"));
RDebugUtils.currentLine=10682428;
 //BA.debugLineNum = 10682428;BA.debugLine="esteWayPoint0.Remove(\"trips_index\")";
_estewaypoint0.Remove((Object)("trips_index"));
RDebugUtils.currentLine=10682429;
 //BA.debugLineNum = 10682429;BA.debugLine="listaWayPoints.Add(esteWayPoint0)";
__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(_estewaypoint0.getObject()));
 if (true) break;
if (true) break;

case 34:
//C
this.state = 35;
;
RDebugUtils.currentLine=10682432;
 //BA.debugLineNum = 10682432;BA.debugLine="Dim rutas0 As List = m0.Get(\"trips\")";
_rutas0 = new anywheresoftware.b4a.objects.collections.List();
_rutas0 = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m0.Get((Object)("trips"))));
RDebugUtils.currentLine=10682433;
 //BA.debugLineNum = 10682433;BA.debugLine="Dim rutas20 As Map = rutas0.Get(0)";
_rutas20 = new anywheresoftware.b4a.objects.collections.Map();
_rutas20 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_rutas0.Get((int) (0))));
RDebugUtils.currentLine=10682436;
 //BA.debugLineNum = 10682436;BA.debugLine="distanciaTotal0 = rutas20.Get(\"distance\")";
_distanciatotal0 = (double)(BA.ObjectToNumber(_rutas20.Get((Object)("distance"))));
RDebugUtils.currentLine=10682437;
 //BA.debugLineNum = 10682437;BA.debugLine="tiempo0 = rutas20.Get(\"duration\")";
_tiempo0 = (double)(BA.ObjectToNumber(_rutas20.Get((Object)("duration"))));
RDebugUtils.currentLine=10682438;
 //BA.debugLineNum = 10682438;BA.debugLine="tiempo0 = ((tiempo0 * 2) ) 'Tiempo X 2 (es muy";
_tiempo0 = ((_tiempo0*2));
RDebugUtils.currentLine=10682439;
 //BA.debugLineNum = 10682439;BA.debugLine="Log($\"Distancia total ruta inicial: $1.1{dista";
parent.__c.LogImpl("810682439",("Distancia total ruta inicial: "+parent.__c.SmartStringFormatter("1.1",(Object)(_distanciatotal0/(double)1000))+" kms, tiempo aprox: "+parent.__c.SmartStringFormatter("1.1",(Object)(_tiempo0/(double)60))+" mins. ("+parent.__c.SmartStringFormatter("1.1",(Object)(_tiempo0/(double)60/(double)60))+" hrs)"),0);
 if (true) break;

case 35:
//C
this.state = 38;
;
 if (true) break;

case 37:
//C
this.state = 38;
RDebugUtils.currentLine=10682443;
 //BA.debugLineNum = 10682443;BA.debugLine="Log(\"Error!\")";
parent.__c.LogImpl("810682443","Error!",0);
 if (true) break;

case 38:
//C
this.state = 39;
;
RDebugUtils.currentLine=10682445;
 //BA.debugLineNum = 10682445;BA.debugLine="j0.Release";
_j0._release /*String*/ (null);
 if (true) break;

case 39:
//C
this.state = 40;
;
RDebugUtils.currentLine=10682448;
 //BA.debugLineNum = 10682448;BA.debugLine="Dim j As HttpJob";
_j = new reparto_izca.keymon.lat.httpjob();
RDebugUtils.currentLine=10682449;
 //BA.debugLineNum = 10682449;BA.debugLine="j.Initialize(\"trip\", Me) 'Calculamos el resto de";
_j._initialize /*String*/ (null,ba,"trip",parent);
RDebugUtils.currentLine=10682450;
 //BA.debugLineNum = 10682450;BA.debugLine="j.Download(\"https://router.project-osrm.org/trip/";
_j._download /*String*/ (null,"https://router.project-osrm.org/trip/v1/driving/"+_rutacompleta+"?source=first&destination=last&roundtrip=false&geometries=geojson");
RDebugUtils.currentLine=10682452;
 //BA.debugLineNum = 10682452;BA.debugLine="Wait For (j) JobDone(j As HttpJob)";
parent.__c.WaitFor("jobdone", ba, new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "traerutadia"), (Object)(_j));
this.state = 75;
return;
case 75:
//C
this.state = 40;
_j = (reparto_izca.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=10682453;
 //BA.debugLineNum = 10682453;BA.debugLine="If j.Success Then";
if (true) break;

case 40:
//if
this.state = 53;
if (_j._success /*boolean*/ ) { 
this.state = 42;
}else {
this.state = 52;
}if (true) break;

case 42:
//C
this.state = 43;
RDebugUtils.currentLine=10682454;
 //BA.debugLineNum = 10682454;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=10682455;
 //BA.debugLineNum = 10682455;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=10682456;
 //BA.debugLineNum = 10682456;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=10682457;
 //BA.debugLineNum = 10682457;BA.debugLine="If m.Get(\"code\") = \"Ok\" Then";
if (true) break;

case 43:
//if
this.state = 50;
if ((_m.Get((Object)("code"))).equals((Object)("Ok"))) { 
this.state = 45;
}if (true) break;

case 45:
//C
this.state = 46;
RDebugUtils.currentLine=10682458;
 //BA.debugLineNum = 10682458;BA.debugLine="Dim puntos As List = m.Get(\"waypoints\")";
_puntos = new anywheresoftware.b4a.objects.collections.List();
_puntos = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m.Get((Object)("waypoints"))));
RDebugUtils.currentLine=10682459;
 //BA.debugLineNum = 10682459;BA.debugLine="Private esteWayPoint As Map";
_estewaypoint = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10682460;
 //BA.debugLineNum = 10682460;BA.debugLine="Dim twpi As Int";
_twpi = 0;
RDebugUtils.currentLine=10682461;
 //BA.debugLineNum = 10682461;BA.debugLine="For p = 0 To puntos.Size -1";
if (true) break;

case 46:
//for
this.state = 49;
step78 = 1;
limit78 = (int) (_puntos.getSize()-1);
_p = (int) (0) ;
this.state = 76;
if (true) break;

case 76:
//C
this.state = 49;
if ((step78 > 0 && _p <= limit78) || (step78 < 0 && _p >= limit78)) this.state = 48;
if (true) break;

case 77:
//C
this.state = 76;
_p = ((int)(0 + _p + step78)) ;
if (true) break;

case 48:
//C
this.state = 77;
RDebugUtils.currentLine=10682462;
 //BA.debugLineNum = 10682462;BA.debugLine="esteWayPoint = puntos.Get(p)";
_estewaypoint = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_puntos.Get(_p)));
RDebugUtils.currentLine=10682465;
 //BA.debugLineNum = 10682465;BA.debugLine="esteWayPoint.Remove(\"hint\")";
_estewaypoint.Remove((Object)("hint"));
RDebugUtils.currentLine=10682466;
 //BA.debugLineNum = 10682466;BA.debugLine="esteWayPoint.Remove(\"distance\")";
_estewaypoint.Remove((Object)("distance"));
RDebugUtils.currentLine=10682467;
 //BA.debugLineNum = 10682467;BA.debugLine="esteWayPoint.Remove(\"trips_index\")";
_estewaypoint.Remove((Object)("trips_index"));
RDebugUtils.currentLine=10682468;
 //BA.debugLineNum = 10682468;BA.debugLine="twpi = esteWayPoint.Get(\"waypoint_index\")";
_twpi = (int)(BA.ObjectToNumber(_estewaypoint.Get((Object)("waypoint_index"))));
RDebugUtils.currentLine=10682469;
 //BA.debugLineNum = 10682469;BA.debugLine="esteWayPoint.Remove(\"waypoint_index\")";
_estewaypoint.Remove((Object)("waypoint_index"));
RDebugUtils.currentLine=10682470;
 //BA.debugLineNum = 10682470;BA.debugLine="esteWayPoint.Put(\"waypoint_index\", (twpi + cua";
_estewaypoint.Put((Object)("waypoint_index"),(Object)((_twpi+_cuantosantes+2)));
RDebugUtils.currentLine=10682471;
 //BA.debugLineNum = 10682471;BA.debugLine="listaWayPoints.Add(esteWayPoint)";
__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Add((Object)(_estewaypoint.getObject()));
 if (true) break;
if (true) break;

case 49:
//C
this.state = 50;
;
RDebugUtils.currentLine=10682474;
 //BA.debugLineNum = 10682474;BA.debugLine="Dim rutas As List = m.Get(\"trips\")";
_rutas = new anywheresoftware.b4a.objects.collections.List();
_rutas = (anywheresoftware.b4a.objects.collections.List) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.List(), (java.util.List)(_m.Get((Object)("trips"))));
RDebugUtils.currentLine=10682475;
 //BA.debugLineNum = 10682475;BA.debugLine="Dim rutas2 As Map = rutas.Get(0)";
_rutas2 = new anywheresoftware.b4a.objects.collections.Map();
_rutas2 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(_rutas.Get((int) (0))));
RDebugUtils.currentLine=10682476;
 //BA.debugLineNum = 10682476;BA.debugLine="distanciaTotal = rutas2.Get(\"distance\")";
_distanciatotal = (double)(BA.ObjectToNumber(_rutas2.Get((Object)("distance"))));
RDebugUtils.currentLine=10682477;
 //BA.debugLineNum = 10682477;BA.debugLine="Log(\"distancia ruta 2:\" & (distanciaTotal) & \"|";
parent.__c.LogImpl("810682477","distancia ruta 2:"+BA.NumberToString((_distanciatotal))+"|"+BA.ObjectToString(_rutas2.Get((Object)("distance"))),0);
RDebugUtils.currentLine=10682478;
 //BA.debugLineNum = 10682478;BA.debugLine="distanciaTotal = distanciaTotal + distanciaTota";
_distanciatotal = _distanciatotal+_distanciatotal0;
RDebugUtils.currentLine=10682479;
 //BA.debugLineNum = 10682479;BA.debugLine="tiempo = rutas2.Get(\"duration\")";
_tiempo = (double)(BA.ObjectToNumber(_rutas2.Get((Object)("duration"))));
RDebugUtils.currentLine=10682480;
 //BA.debugLineNum = 10682480;BA.debugLine="tiempo = (((tiempo + tiempo0) * 2) + tiempoVisi";
_tiempo = (((_tiempo+_tiempo0)*2)+_tiempovisitas);
RDebugUtils.currentLine=10682481;
 //BA.debugLineNum = 10682481;BA.debugLine="Log($\"Distancia total: $1.1{distanciaTotal/1000";
parent.__c.LogImpl("810682481",("Distancia total: "+parent.__c.SmartStringFormatter("1.1",(Object)(_distanciatotal/(double)1000))+" kms, tiempo aprox: "+parent.__c.SmartStringFormatter("1.1",(Object)(_tiempo/(double)60))+" mins. ("+parent.__c.SmartStringFormatter("1.1",(Object)(_tiempo/(double)60/(double)60))+" hrs)"),0);
RDebugUtils.currentLine=10682482;
 //BA.debugLineNum = 10682482;BA.debugLine="l_rutaInfo.Text = $\"Distancia: $1.1{distanciaTo";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(("Distancia: "+parent.__c.SmartStringFormatter("1.1",(Object)(_distanciatotal/(double)1000))+" kms, tiempo aprox: "+parent.__c.SmartStringFormatter("1.1",(Object)(_tiempo/(double)60/(double)60))+" hrs"+parent.__c.SmartStringFormatter("",(Object)(parent.__c.CRLF))+"Visitas restantes: "+parent.__c.SmartStringFormatter("",(Object)(_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()))+"")));
RDebugUtils.currentLine=10682483;
 //BA.debugLineNum = 10682483;BA.debugLine="l_rutaInfo.Width = Root.Width * 0.9";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setWidth((int) (__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth()*0.9));
RDebugUtils.currentLine=10682484;
 //BA.debugLineNum = 10682484;BA.debugLine="Subs.centraEtiqueta(l_rutaInfo, Root.Width)";
parent._subs._centraetiqueta /*String*/ (ba,__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ ,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=10682485;
 //BA.debugLineNum = 10682485;BA.debugLine="l_rutaInfo.Visible = True";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.True);
RDebugUtils.currentLine=10682486;
 //BA.debugLineNum = 10682486;BA.debugLine="l_rutaInfo.BringToFront";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=10682487;
 //BA.debugLineNum = 10682487;BA.debugLine="ListView1.Top = lv1Top + 100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int) ((double)(Double.parseDouble(__ref._lv1top /*String*/ ))+100));
 if (true) break;

case 50:
//C
this.state = 53;
;
 if (true) break;

case 52:
//C
this.state = 53;
RDebugUtils.currentLine=10682490;
 //BA.debugLineNum = 10682490;BA.debugLine="LogColor(\"****************  Error!  ************";
parent.__c.LogImpl("810682490","****************  Error!  ******************",parent.__c.Colors.Red);
 if (true) break;

case 53:
//C
this.state = 54;
;
RDebugUtils.currentLine=10682492;
 //BA.debugLineNum = 10682492;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=10682493;
 //BA.debugLineNum = 10682493;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
RDebugUtils.currentLine=10682495;
 //BA.debugLineNum = 10682495;BA.debugLine="Private r As Int = 1";
_r = (int) (1);
RDebugUtils.currentLine=10682496;
 //BA.debugLineNum = 10682496;BA.debugLine="Private r1, wps As Map";
_r1 = new anywheresoftware.b4a.objects.collections.Map();
_wps = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=10682497;
 //BA.debugLineNum = 10682497;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoints\"";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=10682498;
 //BA.debugLineNum = 10682498;BA.debugLine="Log(\"BORRAMOS WAYPOINTS\")";
parent.__c.LogImpl("810682498","BORRAMOS WAYPOINTS",0);
RDebugUtils.currentLine=10682499;
 //BA.debugLineNum = 10682499;BA.debugLine="For Each k As Object In clientesMapaO.Keys 'Guard";
if (true) break;

case 54:
//for
this.state = 61;
group112 = __ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null);
index112 = 0;
groupLen112 = group112.getSize();
this.state = 78;
if (true) break;

case 78:
//C
this.state = 61;
if (index112 < groupLen112) {
this.state = 56;
_k = group112.Get(index112);}
if (true) break;

case 79:
//C
this.state = 78;
index112++;
if (true) break;

case 56:
//C
this.state = 57;
RDebugUtils.currentLine=10682500;
 //BA.debugLineNum = 10682500;BA.debugLine="If listaWayPoints.Size > 0 Then";
if (true) break;

case 57:
//if
this.state = 60;
if (__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .getSize()>0) { 
this.state = 59;
}if (true) break;

case 59:
//C
this.state = 60;
RDebugUtils.currentLine=10682501;
 //BA.debugLineNum = 10682501;BA.debugLine="r1 = clientesMapaO.Get(k)";
_r1 = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=10682502;
 //BA.debugLineNum = 10682502;BA.debugLine="r1.Get(\"codigo\")";
_r1.Get((Object)("codigo"));
RDebugUtils.currentLine=10682503;
 //BA.debugLineNum = 10682503;BA.debugLine="Log(listaWayPoints.Get(r) & \"|\" & r1.Get(\"coord";
parent.__c.LogImpl("810682503",BA.ObjectToString(__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Get(_r))+"|"+BA.ObjectToString(_r1.Get((Object)("coords")))+"|"+BA.ObjectToString(_r1.Get((Object)("calle"))),0);
RDebugUtils.currentLine=10682504;
 //BA.debugLineNum = 10682504;BA.debugLine="wps = listaWayPoints.Get(r)";
_wps = (anywheresoftware.b4a.objects.collections.Map) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.collections.Map(), (java.util.Map)(__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Get(_r)));
RDebugUtils.currentLine=10682505;
 //BA.debugLineNum = 10682505;BA.debugLine="Starter.skmt.ExecNonQuery($\"update kmt_info set";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery(("update kmt_info set SECUENCIA = "+parent.__c.SmartStringFormatter("",_wps.Get((Object)("waypoint_index")))+" where CAT_CL_CODIGO = '"+parent.__c.SmartStringFormatter("",_r1.Get((Object)("codigo")))+"'"));
RDebugUtils.currentLine=10682506;
 //BA.debugLineNum = 10682506;BA.debugLine="Starter.skmt.ExecNonQuery2(\"insert into waypoin";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery2("insert into waypoints values (?,?)",anywheresoftware.b4a.keywords.Common.ArrayToList(new Object[]{_r1.Get((Object)("codigo")),_wps.Get((Object)("waypoint_index"))}));
RDebugUtils.currentLine=10682507;
 //BA.debugLineNum = 10682507;BA.debugLine="r = r + 1";
_r = (int) (_r+1);
 if (true) break;

case 60:
//C
this.state = 79;
;
 if (true) break;
if (true) break;

case 61:
//C
this.state = 62;
;
RDebugUtils.currentLine=10682510;
 //BA.debugLineNum = 10682510;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=10682511;
 //BA.debugLineNum = 10682511;BA.debugLine="Sleep(100)";
parent.__c.Sleep(ba,new anywheresoftware.b4a.shell.DebugResumableSub.DelegatableResumableSub(this, "c_clientes", "traerutadia"),(int) (100));
this.state = 80;
return;
case 80:
//C
this.state = 62;
;
RDebugUtils.currentLine=10682512;
 //BA.debugLineNum = 10682512;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=10682513;
 //BA.debugLineNum = 10682513;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=10682514;
 //BA.debugLineNum = 10682514;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=10682515;
 //BA.debugLineNum = 10682515;BA.debugLine="label2.Height = 100dip";
_label2.setHeight(parent.__c.DipToCurrent((int) (100)));
RDebugUtils.currentLine=10682516;
 //BA.debugLineNum = 10682516;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 70dip";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().setItemHeight(parent.__c.DipToCurrent((int) (70)));
RDebugUtils.currentLine=10682517;
 //BA.debugLineNum = 10682517;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=10682518;
 //BA.debugLineNum = 10682518;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=10682519;
 //BA.debugLineNum = 10682519;BA.debugLine="Log(\"Generamos ListView1 en traeRutaDia\")";
parent.__c.LogImpl("810682519","Generamos ListView1 en traeRutaDia",0);
RDebugUtils.currentLine=10682521;
 //BA.debugLineNum = 10682521;BA.debugLine="c=Starter.skmt.ExecQuery(\"select codigo, indice,";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select codigo, indice, CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_NOEXT from  waypoints inner join kmt_info on waypoints.codigo = kmt_info.CAT_CL_CODIGO where gestion = 0 AND CAT_CL_RUTA <> 1000 order by indice")));
RDebugUtils.currentLine=10682522;
 //BA.debugLineNum = 10682522;BA.debugLine="If c.RowCount > 0 Then";
if (true) break;

case 62:
//if
this.state = 69;
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
this.state = 64;
}if (true) break;

case 64:
//C
this.state = 65;
RDebugUtils.currentLine=10682523;
 //BA.debugLineNum = 10682523;BA.debugLine="For i=0 To c.RowCount -1 'Generamos el listView";
if (true) break;

case 65:
//for
this.state = 68;
step135 = 1;
limit135 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
this.state = 81;
if (true) break;

case 81:
//C
this.state = 68;
if ((step135 > 0 && _i <= limit135) || (step135 < 0 && _i >= limit135)) this.state = 67;
if (true) break;

case 82:
//C
this.state = 81;
_i = ((int)(0 + _i + step135)) ;
if (true) break;

case 67:
//C
this.state = 82;
RDebugUtils.currentLine=10682524;
 //BA.debugLineNum = 10682524;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10682525;
 //BA.debugLineNum = 10682525;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=10682526;
 //BA.debugLineNum = 10682526;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=10682527;
 //BA.debugLineNum = 10682527;BA.debugLine="ListView1.AddTwoLines(cs.Color(Colors.RGB(100,1";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .AddTwoLines(BA.ObjectToCharSequence(_cs.Color(parent.__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("codigo"))).PopAll().getObject()),BA.ObjectToCharSequence(_cs2.Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE"))).Color(parent.__c.Colors.RGB((int) (100),(int) (149),(int) (237))).Append(BA.ObjectToCharSequence(" Calle: ")).Pop().Append(BA.ObjectToCharSequence(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE").trim()+" "+__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOEXT"))).PopAll().getObject()));
 if (true) break;
if (true) break;

case 68:
//C
this.state = 69;
;
 if (true) break;

case 69:
//C
this.state = -1;
;
RDebugUtils.currentLine=10682530;
 //BA.debugLineNum = 10682530;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10682531;
 //BA.debugLineNum = 10682531;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public reparto_izca.keymon.lat.b4xorderedmap  _traetodosavisitar(reparto_izca.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "traetodosavisitar", false))
	 {return ((reparto_izca.keymon.lat.b4xorderedmap) Debug.delegate(ba, "traetodosavisitar", null));}
anywheresoftware.b4a.gps.LocationWrapper _thisloc = null;
anywheresoftware.b4a.gps.LocationWrapper _ubicacioninicial = null;
int _i = 0;
int _j = 0;
int _distancia = 0;
anywheresoftware.b4a.objects.collections.Map _estecliente = null;
RDebugUtils.currentLine=10813440;
 //BA.debugLineNum = 10813440;BA.debugLine="Sub traeTodosAVisitar As B4XOrderedMap 'ignore";
RDebugUtils.currentLine=10813441;
 //BA.debugLineNum = 10813441;BA.debugLine="Log(\"Iniciamos traeTodosAVisitar\")";
__c.LogImpl("810813441","Iniciamos traeTodosAVisitar",0);
RDebugUtils.currentLine=10813444;
 //BA.debugLineNum = 10813444;BA.debugLine="Private thisLoc, ubicacionInicial As Location";
_thisloc = new anywheresoftware.b4a.gps.LocationWrapper();
_ubicacioninicial = new anywheresoftware.b4a.gps.LocationWrapper();
RDebugUtils.currentLine=10813445;
 //BA.debugLineNum = 10813445;BA.debugLine="ubicacionInicial = Starter.cedisLocation";
_ubicacioninicial = _starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ ;
RDebugUtils.currentLine=10813446;
 //BA.debugLineNum = 10813446;BA.debugLine="LogColor(ubicacionInicial, Colors.Gray)";
__c.LogImpl("810813446",BA.ObjectToString(_ubicacioninicial),__c.Colors.Gray);
RDebugUtils.currentLine=10813447;
 //BA.debugLineNum = 10813447;BA.debugLine="c=Starter.skmt.ExecQuery(\"select sum(gestion) as";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select sum(gestion) as hayVisitados from kmt_info")));
RDebugUtils.currentLine=10813448;
 //BA.debugLineNum = 10813448;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10813449;
 //BA.debugLineNum = 10813449;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=10813451;
 //BA.debugLineNum = 10813451;BA.debugLine="If c.GetString(\"hayVisitados\") > 0 Then ubicacio";
if ((double)(Double.parseDouble(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("hayVisitados")))>0) { 
_ubicacioninicial = _tracker._uugcoords /*anywheresoftware.b4a.gps.LocationWrapper*/ ;};
 };
RDebugUtils.currentLine=10813453;
 //BA.debugLineNum = 10813453;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10813454;
 //BA.debugLineNum = 10813454;BA.debugLine="LogColor(ubicacionInicial, Colors.Red)";
__c.LogImpl("810813454",BA.ObjectToString(_ubicacioninicial),__c.Colors.Red);
RDebugUtils.currentLine=10813455;
 //BA.debugLineNum = 10813455;BA.debugLine="thisLoc.Initialize";
_thisloc.Initialize();
RDebugUtils.currentLine=10813456;
 //BA.debugLineNum = 10813456;BA.debugLine="clientesMapaO.Clear";
__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._clear /*String*/ (null);
RDebugUtils.currentLine=10813458;
 //BA.debugLineNum = 10813458;BA.debugLine="c=Starter.skmt.ExecQuery(\"select CAT_CL_RUTA, cou";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery("select CAT_CL_RUTA, count(*) as cuantos from kmt_info where gestion = 0  AND CAT_CL_RUTA <> 1000 group by CAT_CL_RUTA order by CAT_CL_RUTA asc")));
RDebugUtils.currentLine=10813459;
 //BA.debugLineNum = 10813459;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10813461;
 //BA.debugLineNum = 10813461;BA.debugLine="For i=0 To c.RowCount -1";
{
final int step16 = 1;
final int limit16 = (int) (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_i = (int) (0) ;
for (;_i <= limit16 ;_i = _i + step16 ) {
RDebugUtils.currentLine=10813462;
 //BA.debugLineNum = 10813462;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=10813464;
 //BA.debugLineNum = 10813464;BA.debugLine="c2=Starter.skmt.ExecQuery2(\"select  CAT_CL_NOMB";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/  = (anywheresoftware.b4a.sql.SQL.CursorWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.sql.SQL.CursorWrapper(), (android.database.Cursor)(_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecQuery2("select  CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO, CAT_CL_LAT, CAT_CL_LONG from kmt_info where CAT_CL_RUTA = ? and gestion = 0 AND CAT_CL_RUTA <> 1000 order by CAT_CL_NOMBRE ",new String[]{__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_RUTA")})));
RDebugUtils.currentLine=10813465;
 //BA.debugLineNum = 10813465;BA.debugLine="If c2.RowCount>0 Then";
if (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=10813466;
 //BA.debugLineNum = 10813466;BA.debugLine="For j=0 To c2.RowCount -1 'Generamos lista de";
{
final int step20 = 1;
final int limit20 = (int) (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()-1);
_j = (int) (0) ;
for (;_j <= limit20 ;_j = _j + step20 ) {
RDebugUtils.currentLine=10813467;
 //BA.debugLineNum = 10813467;BA.debugLine="c2.Position=j";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_j);
RDebugUtils.currentLine=10813469;
 //BA.debugLineNum = 10813469;BA.debugLine="thisLoc.Latitude = c2.GetString(\"CAT_CL_LAT\")";
_thisloc.setLatitude((double)(Double.parseDouble(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LAT"))));
RDebugUtils.currentLine=10813470;
 //BA.debugLineNum = 10813470;BA.debugLine="thisLoc.Longitude = c2.GetString(\"CAT_CL_LONG";
_thisloc.setLongitude((double)(Double.parseDouble(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LONG"))));
RDebugUtils.currentLine=10813471;
 //BA.debugLineNum = 10813471;BA.debugLine="If Not(thisLoc.Latitude = 0.0) And Not(thisLo";
if (__c.Not(_thisloc.getLatitude()==0.0) && __c.Not(_thisloc.getLatitude()==0)) { 
RDebugUtils.currentLine=10813472;
 //BA.debugLineNum = 10813472;BA.debugLine="Private distancia As Int = ubicacionInicial.";
_distancia = (int) (_ubicacioninicial.DistanceTo((android.location.Location)(_thisloc.getObject())));
RDebugUtils.currentLine=10813473;
 //BA.debugLineNum = 10813473;BA.debugLine="If clientesMapaO.ContainsKey(distancia) Then";
if (__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._containskey /*boolean*/ (null,(Object)(_distancia))) { 
_distancia = (int) (_distancia+1);};
RDebugUtils.currentLine=10813474;
 //BA.debugLineNum = 10813474;BA.debugLine="Private esteCliente As Map = CreateMap(\"dist";
_estecliente = new anywheresoftware.b4a.objects.collections.Map();
_estecliente = __c.createMap(new Object[] {(Object)("distancia"),(Object)(_distancia),(Object)("ordenDist"),(Object)(_j),(Object)("coords"),(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LONG")+","+__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_LAT")),(Object)("codigo"),(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CODIGO")),(Object)("nombre"),(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_NOMBRE")),(Object)("calle"),(Object)(__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .GetString("CAT_CL_CALLE"))});
RDebugUtils.currentLine=10813475;
 //BA.debugLineNum = 10813475;BA.debugLine="clientesMapaO.Put(distancia, esteCliente)";
__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._put /*String*/ (null,(Object)(_distancia),(Object)(_estecliente.getObject()));
 }else {
RDebugUtils.currentLine=10813477;
 //BA.debugLineNum = 10813477;BA.debugLine="ToastMessageShow(\"Hay tiendas SIN coordenada";
__c.ToastMessageShow(BA.ObjectToCharSequence("Hay tiendas SIN coordenadas, fueron excluidas!!"),__c.False);
 };
 }
};
 };
 }
};
 };
RDebugUtils.currentLine=10813485;
 //BA.debugLineNum = 10813485;BA.debugLine="clientesMapaO.Keys.Sort(True) 'Ordenamos la lista";
__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).Sort(__c.True);
RDebugUtils.currentLine=10813486;
 //BA.debugLineNum = 10813486;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10813487;
 //BA.debugLineNum = 10813487;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=10813488;
 //BA.debugLineNum = 10813488;BA.debugLine="Log(c.RowCount & \" rutas, \" & clientesMapaO.Size";
__c.LogImpl("810813488",BA.NumberToString(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount())+" rutas, "+BA.NumberToString(__ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ._getsize /*int*/ (null))+" clientes",0);
RDebugUtils.currentLine=10813491;
 //BA.debugLineNum = 10813491;BA.debugLine="Return clientesMapaO";
if (true) return __ref._clientesmapao /*reparto_izca.keymon.lat.b4xorderedmap*/ ;
RDebugUtils.currentLine=10813492;
 //BA.debugLineNum = 10813492;BA.debugLine="End Sub";
return null;
}
}