package reparto_intmex.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_intmex.keymon.lat.c_clientes");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_intmex.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_intmex.keymon.lat.b4xorderedmap _distorderedmap = null;
public reparto_intmex.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 int _distanciacero = 0;
public b4a.example.dateutils _dateutils = null;
public reparto_intmex.keymon.lat.main _main = null;
public reparto_intmex.keymon.lat.appupdater _appupdater = null;
public reparto_intmex.keymon.lat.foto _foto = null;
public reparto_intmex.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_intmex.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_intmex.keymon.lat.starter _starter = null;
public reparto_intmex.keymon.lat.subs _subs = null;
public reparto_intmex.keymon.lat.tracker _tracker = null;
public reparto_intmex.keymon.lat.newinst2 _newinst2 = null;
public reparto_intmex.keymon.lat.b4xpages _b4xpages = null;
public reparto_intmex.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_intmex.keymon.lat.httputils2service _httputils2service = null;
public reparto_intmex.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public Object  _initialize(reparto_intmex.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=45416448;
 //BA.debugLineNum = 45416448;BA.debugLine="Public Sub Initialize As Object";
RDebugUtils.currentLine=45416449;
 //BA.debugLineNum = 45416449;BA.debugLine="Return Me";
if (true) return this;
RDebugUtils.currentLine=45416450;
 //BA.debugLineNum = 45416450;BA.debugLine="End Sub";
return null;
}
public boolean  _activity_keypress(reparto_intmex.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=45809664;
 //BA.debugLineNum = 45809664;BA.debugLine="Sub Activity_KeyPress (key As Int) As Boolean 'ign";
RDebugUtils.currentLine=45809666;
 //BA.debugLineNum = 45809666;BA.debugLine="If key=KeyCodes.KEYCODE_BACK Then";
if (_key==__c.KeyCodes.KEYCODE_BACK) { 
RDebugUtils.currentLine=45809667;
 //BA.debugLineNum = 45809667;BA.debugLine="If entro = 3 And Not(conMapa) Then";
if ((__ref._entro /*String*/ ).equals(BA.NumberToString(3)) && __c.Not(__ref._conmapa /*boolean*/ )) { 
RDebugUtils.currentLine=45809668;
 //BA.debugLineNum = 45809668;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=45809670;
 //BA.debugLineNum = 45809670;BA.debugLine="B4XPage_Created(Root)";
__ref._b4xpage_created /*String*/ (null,__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ );
RDebugUtils.currentLine=45809671;
 //BA.debugLineNum = 45809671;BA.debugLine="Return True";
if (true) return __c.True;
 };
RDebugUtils.currentLine=45809673;
 //BA.debugLineNum = 45809673;BA.debugLine="B4XPages.ShowPage(\"Principal\")";
_b4xpages._showpage /*String*/ (ba,"Principal");
RDebugUtils.currentLine=45809674;
 //BA.debugLineNum = 45809674;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=45809678;
 //BA.debugLineNum = 45809678;BA.debugLine="End Sub";
return false;
}
public String  _b4xpage_created(reparto_intmex.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=45481984;
 //BA.debugLineNum = 45481984;BA.debugLine="Private Sub B4XPage_Created (Root1 As B4XView)";
RDebugUtils.currentLine=45481985;
 //BA.debugLineNum = 45481985;BA.debugLine="Root = Root1";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/  = _root1;
RDebugUtils.currentLine=45481987;
 //BA.debugLineNum = 45481987;BA.debugLine="Root.LoadLayout(\"clientes\")";
__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .LoadLayout("clientes",ba);
RDebugUtils.currentLine=45481988;
 //BA.debugLineNum = 45481988;BA.debugLine="entro =\"2\"";
__ref._entro /*String*/  = "2";
RDebugUtils.currentLine=45481989;
 //BA.debugLineNum = 45481989;BA.debugLine="lv1Top = ListView1.Top";
__ref._lv1top /*String*/  = BA.NumberToString(__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTop());
RDebugUtils.currentLine=45481990;
 //BA.debugLineNum = 45481990;BA.debugLine="clientesMapaO.Initialize";
__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._initialize /*String*/ (null,ba);
RDebugUtils.currentLine=45481991;
 //BA.debugLineNum = 45481991;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoints\"";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=45481992;
 //BA.debugLineNum = 45481992;BA.debugLine="Log(\"Coordenadas del almacen: \" & Starter.cedisLo";
__c.LogImpl("245481992","Coordenadas del almacen: "+BA.NumberToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLongitude())+","+BA.NumberToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()),0);
RDebugUtils.currentLine=45481993;
 //BA.debugLineNum = 45481993;BA.debugLine="End Sub";
return "";
}
public void  _b_getdirs_click(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.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=46071809;
 //BA.debugLineNum = 46071809;BA.debugLine="ProgressDialogShow(\"Calculando distancias y tiemp";
parent.__c.ProgressDialogShow(ba,BA.ObjectToCharSequence("Calculando distancias y tiempos ..."));
RDebugUtils.currentLine=46071810;
 //BA.debugLineNum = 46071810;BA.debugLine="Private m2 As Map";
_m2 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46071811;
 //BA.debugLineNum = 46071811;BA.debugLine="Private f As Int = 0";
_f = (int) (0);
RDebugUtils.currentLine=46071812;
 //BA.debugLineNum = 46071812;BA.debugLine="For Each k As Object In distOrderedMap.Keys 'Trae";
if (true) break;

case 1:
//for
this.state = 30;
group4 = __ref._distorderedmap /*reparto_intmex.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=46071813;
 //BA.debugLineNum = 46071813;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_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=46071814;
 //BA.debugLineNum = 46071814;BA.debugLine="Private distancia2 As String = m2.Get(\"distancia";
_distancia2 = BA.ObjectToString(_m2.Get((Object)("distancia")));
RDebugUtils.currentLine=46071815;
 //BA.debugLineNum = 46071815;BA.debugLine="Private thisLoc1 As String = m2.Get(\"ubicacion\")";
_thisloc1 = BA.ObjectToString(_m2.Get((Object)("ubicacion")));
RDebugUtils.currentLine=46071816;
 //BA.debugLineNum = 46071816;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=46071817;
 //BA.debugLineNum = 46071817;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=46071818;
 //BA.debugLineNum = 46071818;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=46071819;
 //BA.debugLineNum = 46071819;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=46071820;
 //BA.debugLineNum = 46071820;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=46071821;
 //BA.debugLineNum = 46071821;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=46071823;
 //BA.debugLineNum = 46071823;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
 if (true) break;

case 11:
//C
this.state = 12;
;
RDebugUtils.currentLine=46071825;
 //BA.debugLineNum = 46071825;BA.debugLine="f = f+1";
_f = (int) (_f+1);
RDebugUtils.currentLine=46071826;
 //BA.debugLineNum = 46071826;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=46071827;
 //BA.debugLineNum = 46071827;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=46071828;
 //BA.debugLineNum = 46071828;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=46071829;
 //BA.debugLineNum = 46071829;BA.debugLine="f = 8";
_f = (int) (8);
 if (true) break;

case 18:
//C
this.state = 19;
;
RDebugUtils.currentLine=46071831;
 //BA.debugLineNum = 46071831;BA.debugLine="Log($\"locActual: ${locActual}, thisLoc1: ${this";
parent.__c.LogImpl("246071831",("locActual: "+parent.__c.SmartStringFormatter("",(Object)(_locactual))+", thisLoc1: "+parent.__c.SmartStringFormatter("",(Object)(_thisloc1))+""),0);
RDebugUtils.currentLine=46071832;
 //BA.debugLineNum = 46071832;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=46071833;
 //BA.debugLineNum = 46071833;BA.debugLine="LogColor($\"R: ${r.Get(0)} - ${r.Get(1)} - ${r.G";
parent.__c.LogImpl("246071833",("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=46071834;
 //BA.debugLineNum = 46071834;BA.debugLine="Private tId As Int = r.Get(0)";
_tid = (int)(BA.ObjectToNumber(_r.Get((int) (0))));
RDebugUtils.currentLine=46071835;
 //BA.debugLineNum = 46071835;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_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,(Object)(_tid))));
RDebugUtils.currentLine=46071836;
 //BA.debugLineNum = 46071836;BA.debugLine="LogColor(\"|\" & tId & \"| - \" &distOrderedMap.Get";
parent.__c.LogImpl("246071836","|"+BA.NumberToString(_tid)+"| - "+BA.ObjectToString(__ref._distorderedmap /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,(Object)(_tid))),parent.__c.Colors.Blue);
RDebugUtils.currentLine=46071837;
 //BA.debugLineNum = 46071837;BA.debugLine="Private tempNDD As String = tMap.Get(\"nomDirDis";
_tempndd = BA.ObjectToString(_tmap.Get((Object)("nomDirDist")));
RDebugUtils.currentLine=46071838;
 //BA.debugLineNum = 46071838;BA.debugLine="Private indexD As Int = tempNDD.IndexOf(\"Distan";
_indexd = _tempndd.indexOf("Distancia:");
RDebugUtils.currentLine=46071839;
 //BA.debugLineNum = 46071839;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=46071840;
 //BA.debugLineNum = 46071840;BA.debugLine="Log(tempNDD)";
parent.__c.LogImpl("246071840",_tempndd,0);
RDebugUtils.currentLine=46071841;
 //BA.debugLineNum = 46071841;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=46071842;
 //BA.debugLineNum = 46071842;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=46071843;
 //BA.debugLineNum = 46071843;BA.debugLine="distOrderedMap.Put(tId, esteCliente)";
__ref._distorderedmap /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._put /*String*/ (null,(Object)(_tid),(Object)(_estecliente.getObject()));
RDebugUtils.currentLine=46071844;
 //BA.debugLineNum = 46071844;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=46071845;
 //BA.debugLineNum = 46071845;BA.debugLine="Private m3 As Map";
_m3 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46071846;
 //BA.debugLineNum = 46071846;BA.debugLine="For Each k As Object In distOrderedMap.Keys  'G";
if (true) break;

case 25:
//for
this.state = 28;
group38 = __ref._distorderedmap /*reparto_intmex.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=46071847;
 //BA.debugLineNum = 46071847;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_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=46071848;
 //BA.debugLineNum = 46071848;BA.debugLine="m3.Get(\"codigo\")";
_m3.Get((Object)("codigo"));
RDebugUtils.currentLine=46071849;
 //BA.debugLineNum = 46071849;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=46071853;
 //BA.debugLineNum = 46071853;BA.debugLine="ProgressDialogHide";
parent.__c.ProgressDialogHide();
RDebugUtils.currentLine=46071854;
 //BA.debugLineNum = 46071854;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _distanciaentrecoords(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.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_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.keymon.lat.c_clientes parent;
String _id;
String _coords1;
String _coords2;
String _distanciatotal = "";
String _tiempo = "";
reparto_intmex.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=45940737;
 //BA.debugLineNum = 45940737;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=45940738;
 //BA.debugLineNum = 45940738;BA.debugLine="Private distanciaTotal As String = \"0\"";
_distanciatotal = "0";
RDebugUtils.currentLine=45940739;
 //BA.debugLineNum = 45940739;BA.debugLine="Private tiempo As String = \"0\"";
_tiempo = "0";
RDebugUtils.currentLine=45940740;
 //BA.debugLineNum = 45940740;BA.debugLine="Dim j As HttpJob";
_j = new reparto_intmex.keymon.lat.httpjob();
RDebugUtils.currentLine=45940741;
 //BA.debugLineNum = 45940741;BA.debugLine="j.Initialize(\"\", Me)";
_j._initialize /*String*/ (null,ba,"",parent);
RDebugUtils.currentLine=45940742;
 //BA.debugLineNum = 45940742;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=45940743;
 //BA.debugLineNum = 45940743;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_intmex.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=45940744;
 //BA.debugLineNum = 45940744;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=45940745;
 //BA.debugLineNum = 45940745;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=45940746;
 //BA.debugLineNum = 45940746;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=45940747;
 //BA.debugLineNum = 45940747;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=45940748;
 //BA.debugLineNum = 45940748;BA.debugLine="Log($\"Respuesta: ${m.Get(\"code\")}\"$)";
parent.__c.LogImpl("245940748",("Respuesta: "+parent.__c.SmartStringFormatter("",_m.Get((Object)("code")))+""),0);
RDebugUtils.currentLine=45940749;
 //BA.debugLineNum = 45940749;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=45940751;
 //BA.debugLineNum = 45940751;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=45940752;
 //BA.debugLineNum = 45940752;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=45940756;
 //BA.debugLineNum = 45940756;BA.debugLine="distanciaTotal = rutas2.Get(\"distance\")";
_distanciatotal = BA.ObjectToString(_rutas2.Get((Object)("distance")));
RDebugUtils.currentLine=45940757;
 //BA.debugLineNum = 45940757;BA.debugLine="tiempo = rutas2.Get(\"duration\")";
_tiempo = BA.ObjectToString(_rutas2.Get((Object)("duration")));
RDebugUtils.currentLine=45940758;
 //BA.debugLineNum = 45940758;BA.debugLine="Log($\"Distancia total: ${distanciaTotal}, Tiemp";
parent.__c.LogImpl("245940758",("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=45940761;
 //BA.debugLineNum = 45940761;BA.debugLine="Log(\"Error!\")";
parent.__c.LogImpl("245940761","Error!",0);
 if (true) break;

case 10:
//C
this.state = -1;
;
RDebugUtils.currentLine=45940763;
 //BA.debugLineNum = 45940763;BA.debugLine="j.Release";
_j._release /*String*/ (null);
RDebugUtils.currentLine=45940764;
 //BA.debugLineNum = 45940764;BA.debugLine="Private r As List";
_r = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=45940765;
 //BA.debugLineNum = 45940765;BA.debugLine="r.Initialize";
_r.Initialize();
RDebugUtils.currentLine=45940766;
 //BA.debugLineNum = 45940766;BA.debugLine="r.Add(id)";
_r.Add((Object)(_id));
RDebugUtils.currentLine=45940767;
 //BA.debugLineNum = 45940767;BA.debugLine="r.Add(distanciaTotal)";
_r.Add((Object)(_distanciatotal));
RDebugUtils.currentLine=45940768;
 //BA.debugLineNum = 45940768;BA.debugLine="r.Add(tiempo)";
_r.Add((Object)(_tiempo));
RDebugUtils.currentLine=45940769;
 //BA.debugLineNum = 45940769;BA.debugLine="Return r";
if (true) {
parent.__c.ReturnFromResumableSub(this,(Object)(_r));return;};
RDebugUtils.currentLine=45940770;
 //BA.debugLineNum = 45940770;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public String  _b_getrutainfo_click(reparto_intmex.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=46202880;
 //BA.debugLineNum = 46202880;BA.debugLine="Private Sub b_getRutaInfo_Click";
RDebugUtils.currentLine=46202882;
 //BA.debugLineNum = 46202882;BA.debugLine="caculaRutaGPS(todosAVisitar)";
__ref._cacularutagps /*void*/ (null,__ref._todosavisitar /*anywheresoftware.b4a.objects.collections.List*/ (null));
RDebugUtils.currentLine=46202883;
 //BA.debugLineNum = 46202883;BA.debugLine="End Sub";
return "";
}
public void  _cacularutagps(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.keymon.lat.c_clientes __ref,anywheresoftware.b4a.objects.collections.List _coords) {
this.parent = parent;
this.__ref = __ref;
this._coords = _coords;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.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_intmex.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=46399489;
 //BA.debugLineNum = 46399489;BA.debugLine="Private tmpList As List";
_tmplist = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=46399490;
 //BA.debugLineNum = 46399490;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=46399491;
 //BA.debugLineNum = 46399491;BA.debugLine="tmpList.Initialize";
_tmplist.Initialize();
RDebugUtils.currentLine=46399492;
 //BA.debugLineNum = 46399492;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=46399493;
 //BA.debugLineNum = 46399493;BA.debugLine="coords.InsertAt(0,tmpList)";
_coords.InsertAt((int) (0),(Object)(_tmplist.getObject()));
RDebugUtils.currentLine=46399494;
 //BA.debugLineNum = 46399494;BA.debugLine="Log(\"=================================\")";
parent.__c.LogImpl("246399494","=================================",0);
RDebugUtils.currentLine=46399496;
 //BA.debugLineNum = 46399496;BA.debugLine="Private coordsStr As String = \"\"";
_coordsstr = "";
RDebugUtils.currentLine=46399497;
 //BA.debugLineNum = 46399497;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=46399499;
 //BA.debugLineNum = 46399499;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=46399500;
 //BA.debugLineNum = 46399500;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=46399502;
 //BA.debugLineNum = 46399502;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=46399505;
 //BA.debugLineNum = 46399505;BA.debugLine="Log(coordsStr)";
parent.__c.LogImpl("246399505",_coordsstr,0);
RDebugUtils.currentLine=46399506;
 //BA.debugLineNum = 46399506;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=46399507;
 //BA.debugLineNum = 46399507;BA.debugLine="Dim j As HttpJob";
_j = new reparto_intmex.keymon.lat.httpjob();
RDebugUtils.currentLine=46399508;
 //BA.debugLineNum = 46399508;BA.debugLine="j.Initialize(\"trip\", Me) 'Calculamos el resto de";
_j._initialize /*String*/ (null,ba,"trip",parent);
RDebugUtils.currentLine=46399509;
 //BA.debugLineNum = 46399509;BA.debugLine="j.Download($\"http://keymon.lat:9002/ruteador?m=OS";
_j._download /*String*/ (null,("http://keymon.lat: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=46399510;
 //BA.debugLineNum = 46399510;BA.debugLine="Log($\"http://keymon.lat:9002/ruteador?m=OSRM&r=${";
parent.__c.LogImpl("246399510",("http://keymon.lat: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=46399511;
 //BA.debugLineNum = 46399511;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_intmex.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=46399512;
 //BA.debugLineNum = 46399512;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=46399513;
 //BA.debugLineNum = 46399513;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=46399514;
 //BA.debugLineNum = 46399514;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=46399515;
 //BA.debugLineNum = 46399515;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=46399516;
 //BA.debugLineNum = 46399516;BA.debugLine="Log(m)";
parent.__c.LogImpl("246399516",BA.ObjectToString(_m),0);
RDebugUtils.currentLine=46399517;
 //BA.debugLineNum = 46399517;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=46399518;
 //BA.debugLineNum = 46399518;BA.debugLine="Log(\"=====   OK\")";
parent.__c.LogImpl("246399518","=====   OK",0);
RDebugUtils.currentLine=46399519;
 //BA.debugLineNum = 46399519;BA.debugLine="rutaGenerada = True";
__ref._rutagenerada /*boolean*/  = parent.__c.True;
RDebugUtils.currentLine=46399520;
 //BA.debugLineNum = 46399520;BA.debugLine="Dim puntos As Int = m.Get(\"puntos\")";
_puntos = (int)(BA.ObjectToNumber(_m.Get((Object)("puntos"))));
RDebugUtils.currentLine=46399521;
 //BA.debugLineNum = 46399521;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=46399522;
 //BA.debugLineNum = 46399522;BA.debugLine="Private duration As String = m.Get(\"duration\")";
_duration = BA.ObjectToString(_m.Get((Object)("duration")));
RDebugUtils.currentLine=46399523;
 //BA.debugLineNum = 46399523;BA.debugLine="Private distance As String = m.Get(\"distance\")";
_distance = BA.ObjectToString(_m.Get((Object)("distance")));
RDebugUtils.currentLine=46399524;
 //BA.debugLineNum = 46399524;BA.debugLine="Private mensaje As String = m.Get(\"mensaje\")";
_mensaje = BA.ObjectToString(_m.Get((Object)("mensaje")));
RDebugUtils.currentLine=46399525;
 //BA.debugLineNum = 46399525;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoint";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=46399526;
 //BA.debugLineNum = 46399526;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=46399527;
 //BA.debugLineNum = 46399527;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=46399528;
 //BA.debugLineNum = 46399528;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=46399529;
 //BA.debugLineNum = 46399529;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=46399530;
 //BA.debugLineNum = 46399530;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=46399532;
 //BA.debugLineNum = 46399532;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=46399533;
 //BA.debugLineNum = 46399533;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=46399534;
 //BA.debugLineNum = 46399534;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=46399535;
 //BA.debugLineNum = 46399535;BA.debugLine="conMapa = True";
__ref._conmapa /*boolean*/  = parent.__c.True;
RDebugUtils.currentLine=46399536;
 //BA.debugLineNum = 46399536;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=46399537;
 //BA.debugLineNum = 46399537;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=46399538;
 //BA.debugLineNum = 46399538;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=46399539;
 //BA.debugLineNum = 46399539;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=46399540;
 //BA.debugLineNum = 46399540;BA.debugLine="c.Position = i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=46399541;
 //BA.debugLineNum = 46399541;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=46399542;
 //BA.debugLineNum = 46399542;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=46399543;
 //BA.debugLineNum = 46399543;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=46399546;
 //BA.debugLineNum = 46399546;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=46399547;
 //BA.debugLineNum = 46399547;BA.debugLine="Log($\"Distancia total: $1.1{distance/1000} kms,";
parent.__c.LogImpl("246399547",("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=46399548;
 //BA.debugLineNum = 46399548;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=46399549;
 //BA.debugLineNum = 46399549;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=46399550;
 //BA.debugLineNum = 46399550;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=46399551;
 //BA.debugLineNum = 46399551;BA.debugLine="l_rutaInfo.Visible = True";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.True);
RDebugUtils.currentLine=46399552;
 //BA.debugLineNum = 46399552;BA.debugLine="l_rutaInfo.BringToFront";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=46399553;
 //BA.debugLineNum = 46399553;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=46399556;
 //BA.debugLineNum = 46399556;BA.debugLine="LogColor(\"****************  Error!  ************";
parent.__c.LogImpl("246399556","****************  Error!  ******************",parent.__c.Colors.Red);
 if (true) break;

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

            }
        }
    }
}
public anywheresoftware.b4a.objects.collections.List  _todosavisitar(reparto_intmex.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=46465024;
 //BA.debugLineNum = 46465024;BA.debugLine="Sub todosAVisitar As List";
RDebugUtils.currentLine=46465025;
 //BA.debugLineNum = 46465025;BA.debugLine="Log(laRuta)";
__c.LogImpl("246465025",__ref._laruta /*String*/ ,0);
RDebugUtils.currentLine=46465026;
 //BA.debugLineNum = 46465026;BA.debugLine="Log(entro)";
__c.LogImpl("246465026",__ref._entro /*String*/ ,0);
RDebugUtils.currentLine=46465027;
 //BA.debugLineNum = 46465027;BA.debugLine="Private sqlDeRuta As String = \"\"";
_sqlderuta = "";
RDebugUtils.currentLine=46465028;
 //BA.debugLineNum = 46465028;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=46465029;
 //BA.debugLineNum = 46465029;BA.debugLine="Private aVisitar, tmpList As List";
_avisitar = new anywheresoftware.b4a.objects.collections.List();
_tmplist = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=46465030;
 //BA.debugLineNum = 46465030;BA.debugLine="aVisitar.Initialize";
_avisitar.Initialize();
RDebugUtils.currentLine=46465031;
 //BA.debugLineNum = 46465031;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=46465032;
 //BA.debugLineNum = 46465032;BA.debugLine="Do While coords.NextRow";
while (_coords.NextRow()) {
RDebugUtils.currentLine=46465033;
 //BA.debugLineNum = 46465033;BA.debugLine="tmpList.Initialize";
_tmplist.Initialize();
RDebugUtils.currentLine=46465034;
 //BA.debugLineNum = 46465034;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=46465035;
 //BA.debugLineNum = 46465035;BA.debugLine="aVisitar.Add(tmpList)";
_avisitar.Add((Object)(_tmplist.getObject()));
 }
;
RDebugUtils.currentLine=46465037;
 //BA.debugLineNum = 46465037;BA.debugLine="Log(aVisitar)";
__c.LogImpl("246465037",BA.ObjectToString(_avisitar),0);
RDebugUtils.currentLine=46465038;
 //BA.debugLineNum = 46465038;BA.debugLine="Return aVisitar";
if (true) return _avisitar;
RDebugUtils.currentLine=46465039;
 //BA.debugLineNum = 46465039;BA.debugLine="End Sub";
return null;
}
public String  _b_getrutainfo_longclick(reparto_intmex.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=46268416;
 //BA.debugLineNum = 46268416;BA.debugLine="Private Sub b_getRutaInfo_LongClick";
RDebugUtils.currentLine=46268417;
 //BA.debugLineNum = 46268417;BA.debugLine="If b_limpiarRuta.Visible Then";
if (__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .getVisible()) { 
RDebugUtils.currentLine=46268418;
 //BA.debugLineNum = 46268418;BA.debugLine="b_limpiarRuta.Visible = False";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
 }else {
RDebugUtils.currentLine=46268420;
 //BA.debugLineNum = 46268420;BA.debugLine="b_limpiarRuta.Visible = True";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
 };
RDebugUtils.currentLine=46268422;
 //BA.debugLineNum = 46268422;BA.debugLine="End Sub";
return "";
}
public String  _b_limpiarruta_click(reparto_intmex.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=46333952;
 //BA.debugLineNum = 46333952;BA.debugLine="Private Sub b_limpiarRuta_Click";
RDebugUtils.currentLine=46333953;
 //BA.debugLineNum = 46333953;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from waypoints\"";
_starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from waypoints");
RDebugUtils.currentLine=46333954;
 //BA.debugLineNum = 46333954;BA.debugLine="b_limpiarRuta.Visible = False";
__ref._b_limpiarruta /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=46333955;
 //BA.debugLineNum = 46333955;BA.debugLine="B4XPage_Appear";
__ref._b4xpage_appear /*String*/ (null);
RDebugUtils.currentLine=46333956;
 //BA.debugLineNum = 46333956;BA.debugLine="End Sub";
return "";
}
public String  _b4xpage_appear(reparto_intmex.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=45547520;
 //BA.debugLineNum = 45547520;BA.debugLine="Sub B4XPage_Appear";
RDebugUtils.currentLine=45547521;
 //BA.debugLineNum = 45547521;BA.debugLine="busca.Text = \"\"";
__ref._busca /*anywheresoftware.b4a.objects.EditTextWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=45547522;
 //BA.debugLineNum = 45547522;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.False);
RDebugUtils.currentLine=45547524;
 //BA.debugLineNum = 45547524;BA.debugLine="entro =\"2\"";
__ref._entro /*String*/  = "2";
RDebugUtils.currentLine=45547528;
 //BA.debugLineNum = 45547528;BA.debugLine="p_colonia.Width = Root.Width";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setWidth(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=45547529;
 //BA.debugLineNum = 45547529;BA.debugLine="p_colonia.Height = Root.Height";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setHeight(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getHeight());
RDebugUtils.currentLine=45547530;
 //BA.debugLineNum = 45547530;BA.debugLine="p_colonia.Top = 0";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setTop((int) (0));
RDebugUtils.currentLine=45547531;
 //BA.debugLineNum = 45547531;BA.debugLine="p_colonia.Left = 0";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setLeft((int) (0));
RDebugUtils.currentLine=45547532;
 //BA.debugLineNum = 45547532;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=45547533;
 //BA.debugLineNum = 45547533;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=45547534;
 //BA.debugLineNum = 45547534;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=45547535;
 //BA.debugLineNum = 45547535;BA.debugLine="If Not(l_rutaInfo.Visible) Then";
if (__c.Not(__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .getVisible())) { 
RDebugUtils.currentLine=45547536;
 //BA.debugLineNum = 45547536;BA.debugLine="ListView1.Top = lv1Top";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int)(Double.parseDouble(__ref._lv1top /*String*/ )));
 }else {
RDebugUtils.currentLine=45547538;
 //BA.debugLineNum = 45547538;BA.debugLine="ListView1.Top = lv1Top + 100";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .setTop((int) ((double)(Double.parseDouble(__ref._lv1top /*String*/ ))+100));
 };
RDebugUtils.currentLine=45547540;
 //BA.debugLineNum = 45547540;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=45547541;
 //BA.debugLineNum = 45547541;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=45547542;
 //BA.debugLineNum = 45547542;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=45547544;
 //BA.debugLineNum = 45547544;BA.debugLine="conMapa = True";
__ref._conmapa /*boolean*/  = __c.True;
RDebugUtils.currentLine=45547546;
 //BA.debugLineNum = 45547546;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45547547;
 //BA.debugLineNum = 45547547;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=45547548;
 //BA.debugLineNum = 45547548;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=45547550;
 //BA.debugLineNum = 45547550;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=45547551;
 //BA.debugLineNum = 45547551;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=45547552;
 //BA.debugLineNum = 45547552;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=45547553;
 //BA.debugLineNum = 45547553;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=45547557;
 //BA.debugLineNum = 45547557;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=45547560;
 //BA.debugLineNum = 45547560;BA.debugLine="generaListViewRutas";
__ref._generalistviewrutas /*void*/ (null);
 };
RDebugUtils.currentLine=45547562;
 //BA.debugLineNum = 45547562;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=45547563;
 //BA.debugLineNum = 45547563;BA.debugLine="p_colonia.Width = Root.Width";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setWidth(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getWidth());
RDebugUtils.currentLine=45547564;
 //BA.debugLineNum = 45547564;BA.debugLine="p_colonia.Height = Root.Height";
__ref._p_colonia /*anywheresoftware.b4a.objects.PanelWrapper*/ .setHeight(__ref._root /*anywheresoftware.b4a.objects.B4XViewWrapper*/ .getHeight());
RDebugUtils.currentLine=45547565;
 //BA.debugLineNum = 45547565;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=45547566;
 //BA.debugLineNum = 45547566;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=45547567;
 //BA.debugLineNum = 45547567;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=45547568;
 //BA.debugLineNum = 45547568;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=45547569;
 //BA.debugLineNum = 45547569;BA.debugLine="b_getRutaInfo.Visible = True";
__ref._b_getrutainfo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(__c.True);
RDebugUtils.currentLine=45547570;
 //BA.debugLineNum = 45547570;BA.debugLine="b_getRutaInfo.BringToFront";
__ref._b_getrutainfo /*anywheresoftware.b4a.objects.ButtonWrapper*/ .BringToFront();
RDebugUtils.currentLine=45547571;
 //BA.debugLineNum = 45547571;BA.debugLine="If Starter.cedisLocation.Latitude = \"0\" Then";
if (_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ .getLatitude()==(double)(Double.parseDouble("0"))) { 
RDebugUtils.currentLine=45547572;
 //BA.debugLineNum = 45547572;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=45547573;
 //BA.debugLineNum = 45547573;BA.debugLine="If x.RowCount > 0 Then";
if (_x.getRowCount()>0) { 
RDebugUtils.currentLine=45547574;
 //BA.debugLineNum = 45547574;BA.debugLine="x.Position = 0";
_x.setPosition((int) (0));
RDebugUtils.currentLine=45547575;
 //BA.debugLineNum = 45547575;BA.debugLine="Private y() As String";
_y = new String[(int) (0)];
java.util.Arrays.fill(_y,"");
RDebugUtils.currentLine=45547576;
 //BA.debugLineNum = 45547576;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=45547577;
 //BA.debugLineNum = 45547577;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=45547580;
 //BA.debugLineNum = 45547580;BA.debugLine="Log(Starter.cedisLocation)";
__c.LogImpl("245547580",BA.ObjectToString(_starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ ),0);
RDebugUtils.currentLine=45547581;
 //BA.debugLineNum = 45547581;BA.debugLine="End Sub";
return "";
}
public void  _generalistviewrutas(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.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=45744129;
 //BA.debugLineNum = 45744129;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45744130;
 //BA.debugLineNum = 45744130;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=45744131;
 //BA.debugLineNum = 45744131;BA.debugLine="lfila.Text = \"RUTA PREVENTA\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("RUTA PREVENTA"));
RDebugUtils.currentLine=45744132;
 //BA.debugLineNum = 45744132;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45744133;
 //BA.debugLineNum = 45744133;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=45744134;
 //BA.debugLineNum = 45744134;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=45744135;
 //BA.debugLineNum = 45744135;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=45744136;
 //BA.debugLineNum = 45744136;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45744137;
 //BA.debugLineNum = 45744137;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=45744138;
 //BA.debugLineNum = 45744138;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=45744139;
 //BA.debugLineNum = 45744139;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=45744140;
 //BA.debugLineNum = 45744140;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 60dip";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().setItemHeight(parent.__c.DipToCurrent((int) (60)));
RDebugUtils.currentLine=45744141;
 //BA.debugLineNum = 45744141;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=45744142;
 //BA.debugLineNum = 45744142;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=45744143;
 //BA.debugLineNum = 45744143;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45744144;
 //BA.debugLineNum = 45744144;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=45744145;
 //BA.debugLineNum = 45744145;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=45744146;
 //BA.debugLineNum = 45744146;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=45744149;
 //BA.debugLineNum = 45744149;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=45744150;
 //BA.debugLineNum = 45744150;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public anywheresoftware.b4a.keywords.Common.ResumableSubWrapper  _b4xpage_closerequest(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.keymon.lat.c_clientes __ref) {
this.parent = parent;
this.__ref = __ref;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.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=45613059;
 //BA.debugLineNum = 45613059;BA.debugLine="Log(entro)";
parent.__c.LogImpl("245613059",__ref._entro /*String*/ ,0);
RDebugUtils.currentLine=45613060;
 //BA.debugLineNum = 45613060;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=45613064;
 //BA.debugLineNum = 45613064;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=45613061;
 //BA.debugLineNum = 45613061;BA.debugLine="b_limpiarRuta_Click";
__ref._b_limpiarruta_click /*String*/ (null);
RDebugUtils.currentLine=45613062;
 //BA.debugLineNum = 45613062;BA.debugLine="l_rutaInfo.Text = \"\"";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence(""));
RDebugUtils.currentLine=45613063;
 //BA.debugLineNum = 45613063;BA.debugLine="rutaGenerada = False";
__ref._rutagenerada /*boolean*/  = parent.__c.False;
 if (true) break;

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

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

            }
        }
    }
}
public String  _busca_textchanged(reparto_intmex.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=45875200;
 //BA.debugLineNum = 45875200;BA.debugLine="Sub BUSCA_TextChanged (Old As String, New As Strin";
RDebugUtils.currentLine=45875201;
 //BA.debugLineNum = 45875201;BA.debugLine="q_buscar = \"%\" & busca.Text & \"%\"";
__ref._q_buscar /*String*/  = "%"+__ref._busca /*anywheresoftware.b4a.objects.EditTextWrapper*/ .getText()+"%";
RDebugUtils.currentLine=45875202;
 //BA.debugLineNum = 45875202;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=45875203;
 //BA.debugLineNum = 45875203;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45875204;
 //BA.debugLineNum = 45875204;BA.debugLine="lfila.text = \"Nombre y Calle\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Nombre y Calle"));
RDebugUtils.currentLine=45875205;
 //BA.debugLineNum = 45875205;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=45875206;
 //BA.debugLineNum = 45875206;BA.debugLine="If c2.RowCount>0 Then";
if (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=45875207;
 //BA.debugLineNum = 45875207;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=45875208;
 //BA.debugLineNum = 45875208;BA.debugLine="c2.Position=i";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=45875209;
 //BA.debugLineNum = 45875209;BA.debugLine="Dim label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45875210;
 //BA.debugLineNum = 45875210;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=45875211;
 //BA.debugLineNum = 45875211;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=45875212;
 //BA.debugLineNum = 45875212;BA.debugLine="label1.TextColor = Colors.Black";
_label1.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=45875213;
 //BA.debugLineNum = 45875213;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45875214;
 //BA.debugLineNum = 45875214;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=45875215;
 //BA.debugLineNum = 45875215;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=45875216;
 //BA.debugLineNum = 45875216;BA.debugLine="label2.TextColor = Colors.Black";
_label2.setTextColor(__c.Colors.Black);
RDebugUtils.currentLine=45875217;
 //BA.debugLineNum = 45875217;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=45875220;
 //BA.debugLineNum = 45875220;BA.debugLine="entro = \"3\"";
__ref._entro /*String*/  = "3";
RDebugUtils.currentLine=45875221;
 //BA.debugLineNum = 45875221;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=45875222;
 //BA.debugLineNum = 45875222;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_intmex.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
RDebugUtils.currentLine=45350912;
 //BA.debugLineNum = 45350912;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=45350913;
 //BA.debugLineNum = 45350913;BA.debugLine="Private Root As B4XView 'ignore";
_root = new anywheresoftware.b4a.objects.B4XViewWrapper();
RDebugUtils.currentLine=45350914;
 //BA.debugLineNum = 45350914;BA.debugLine="Private xui As XUI 'ignore";
_xui = new anywheresoftware.b4a.objects.B4XViewWrapper.XUI();
RDebugUtils.currentLine=45350915;
 //BA.debugLineNum = 45350915;BA.debugLine="Dim q_buscar As String";
_q_buscar = "";
RDebugUtils.currentLine=45350917;
 //BA.debugLineNum = 45350917;BA.debugLine="Dim entro As String";
_entro = "";
RDebugUtils.currentLine=45350918;
 //BA.debugLineNum = 45350918;BA.debugLine="Dim c As Cursor";
_c = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=45350919;
 //BA.debugLineNum = 45350919;BA.debugLine="Dim c2 As Cursor";
_c2 = new anywheresoftware.b4a.sql.SQL.CursorWrapper();
RDebugUtils.currentLine=45350920;
 //BA.debugLineNum = 45350920;BA.debugLine="Dim ListView1 As ListView";
_listview1 = new anywheresoftware.b4a.objects.ListViewWrapper();
RDebugUtils.currentLine=45350922;
 //BA.debugLineNum = 45350922;BA.debugLine="Dim lfila As Label";
_lfila = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45350923;
 //BA.debugLineNum = 45350923;BA.debugLine="Dim busca As EditText";
_busca = new anywheresoftware.b4a.objects.EditTextWrapper();
RDebugUtils.currentLine=45350924;
 //BA.debugLineNum = 45350924;BA.debugLine="Private p_colonia As Panel";
_p_colonia = new anywheresoftware.b4a.objects.PanelWrapper();
RDebugUtils.currentLine=45350927;
 //BA.debugLineNum = 45350927;BA.debugLine="Dim laRuta As String";
_laruta = "";
RDebugUtils.currentLine=45350928;
 //BA.debugLineNum = 45350928;BA.debugLine="Private b_GetDirs As Button";
_b_getdirs = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=45350929;
 //BA.debugLineNum = 45350929;BA.debugLine="Private distOrderedMap, clientesMapaO As B4XOrder";
_distorderedmap = new reparto_intmex.keymon.lat.b4xorderedmap();
_clientesmapao = new reparto_intmex.keymon.lat.b4xorderedmap();
RDebugUtils.currentLine=45350930;
 //BA.debugLineNum = 45350930;BA.debugLine="Private img_getDirs As ImageView";
_img_getdirs = new anywheresoftware.b4a.objects.ImageViewWrapper();
RDebugUtils.currentLine=45350931;
 //BA.debugLineNum = 45350931;BA.debugLine="Private l_rutaInfo As Label";
_l_rutainfo = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45350932;
 //BA.debugLineNum = 45350932;BA.debugLine="Private b_getRutaInfo As Button";
_b_getrutainfo = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=45350933;
 //BA.debugLineNum = 45350933;BA.debugLine="Private conMapa As Boolean = False";
_conmapa = __c.False;
RDebugUtils.currentLine=45350934;
 //BA.debugLineNum = 45350934;BA.debugLine="Dim listaWayPoints As List";
_listawaypoints = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=45350935;
 //BA.debugLineNum = 45350935;BA.debugLine="Dim lv1Top As String";
_lv1top = "";
RDebugUtils.currentLine=45350936;
 //BA.debugLineNum = 45350936;BA.debugLine="Private b_limpiarRuta As Button";
_b_limpiarruta = new anywheresoftware.b4a.objects.ButtonWrapper();
RDebugUtils.currentLine=45350937;
 //BA.debugLineNum = 45350937;BA.debugLine="Dim rutaGenerada As Boolean = False";
_rutagenerada = __c.False;
RDebugUtils.currentLine=45350938;
 //BA.debugLineNum = 45350938;BA.debugLine="Dim rutaacambiar As String";
_rutaacambiar = "";
RDebugUtils.currentLine=45350939;
 //BA.debugLineNum = 45350939;BA.debugLine="Dim distanciacero as Int = 0";
_distanciacero = (int) (0);
RDebugUtils.currentLine=45350940;
 //BA.debugLineNum = 45350940;BA.debugLine="End Sub";
return "";
}
public void  _listview1_itemclick(reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.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_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.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 group47;
int index47;
int groupLen47;

@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=45678594;
 //BA.debugLineNum = 45678594;BA.debugLine="Log(Value)";
parent.__c.LogImpl("245678594",BA.ObjectToString(_value),0);
RDebugUtils.currentLine=45678595;
 //BA.debugLineNum = 45678595;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45678596;
 //BA.debugLineNum = 45678596;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=45678597;
 //BA.debugLineNum = 45678597;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=45678598;
 //BA.debugLineNum = 45678598;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=45678599;
 //BA.debugLineNum = 45678599;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=45678601;
 //BA.debugLineNum = 45678601;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=45678603;
 //BA.debugLineNum = 45678603;BA.debugLine="l_rutaInfo.Visible = False";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.False);
RDebugUtils.currentLine=45678604;
 //BA.debugLineNum = 45678604;BA.debugLine="b_GetDirs.Visible = False";
__ref._b_getdirs /*anywheresoftware.b4a.objects.ButtonWrapper*/ .setVisible(parent.__c.False);
RDebugUtils.currentLine=45678605;
 //BA.debugLineNum = 45678605;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=45678665;
 //BA.debugLineNum = 45678665;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=45678609;
 //BA.debugLineNum = 45678609;BA.debugLine="Private lrt As String";
_lrt = "";
RDebugUtils.currentLine=45678610;
 //BA.debugLineNum = 45678610;BA.debugLine="lrt = Value";
_lrt = BA.ObjectToString(_value);
RDebugUtils.currentLine=45678611;
 //BA.debugLineNum = 45678611;BA.debugLine="laRuta = lrt.SubString(6) 'Quitamos el texto \"Ru";
__ref._laruta /*String*/  = _lrt.substring((int) (6));
RDebugUtils.currentLine=45678612;
 //BA.debugLineNum = 45678612;BA.debugLine="Log($\"Original: ${Value} - Mod: |${lrt.SubString";
parent.__c.LogImpl("245678612",("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=45678613;
 //BA.debugLineNum = 45678613;BA.debugLine="rutaacambiar = laRuta";
__ref._rutaacambiar /*String*/  = __ref._laruta /*String*/ ;
RDebugUtils.currentLine=45678614;
 //BA.debugLineNum = 45678614;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=45678615;
 //BA.debugLineNum = 45678615;BA.debugLine="Private thisLoc As Location";
_thisloc = new anywheresoftware.b4a.gps.LocationWrapper();
RDebugUtils.currentLine=45678616;
 //BA.debugLineNum = 45678616;BA.debugLine="Private label1 As Label";
_label1 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45678617;
 //BA.debugLineNum = 45678617;BA.debugLine="Private label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=45678618;
 //BA.debugLineNum = 45678618;BA.debugLine="label1 = ListView1.TwoLinesLayout.Label";
_label1 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().Label;
RDebugUtils.currentLine=45678619;
 //BA.debugLineNum = 45678619;BA.debugLine="label1.TextSize = 15";
_label1.setTextSize((float) (15));
RDebugUtils.currentLine=45678620;
 //BA.debugLineNum = 45678620;BA.debugLine="label1.TextColor = Colors.black";
_label1.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=45678621;
 //BA.debugLineNum = 45678621;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=45678622;
 //BA.debugLineNum = 45678622;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=45678623;
 //BA.debugLineNum = 45678623;BA.debugLine="label2.TextColor = Colors.black";
_label2.setTextColor(parent.__c.Colors.Black);
RDebugUtils.currentLine=45678624;
 //BA.debugLineNum = 45678624;BA.debugLine="label2.Height = 57dip";
_label2.setHeight(parent.__c.DipToCurrent((int) (57)));
RDebugUtils.currentLine=45678625;
 //BA.debugLineNum = 45678625;BA.debugLine="thisLoc.Initialize";
_thisloc.Initialize();
RDebugUtils.currentLine=45678626;
 //BA.debugLineNum = 45678626;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=45678627;
 //BA.debugLineNum = 45678627;BA.debugLine="lfila.text = \"Nombre y Calle\"";
__ref._lfila /*anywheresoftware.b4a.objects.LabelWrapper*/ .setText(BA.ObjectToCharSequence("Nombre y Calle"));
RDebugUtils.currentLine=45678628;
 //BA.debugLineNum = 45678628;BA.debugLine="distOrderedMap.Initialize";
__ref._distorderedmap /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._initialize /*String*/ (null,ba);
RDebugUtils.currentLine=45678630;
 //BA.debugLineNum = 45678630;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=45678631;
 //BA.debugLineNum = 45678631;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=45678632;
 //BA.debugLineNum = 45678632;BA.debugLine="c2.Position = i";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=45678633;
 //BA.debugLineNum = 45678633;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=45678634;
 //BA.debugLineNum = 45678634;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=45678636;
 //BA.debugLineNum = 45678636;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=45678638;
 //BA.debugLineNum = 45678638;BA.debugLine="distancia = distancia + i";
_distancia = (int) (_distancia+_i);
RDebugUtils.currentLine=45678647;
 //BA.debugLineNum = 45678647;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=45678649;
 //BA.debugLineNum = 45678649;BA.debugLine="distOrderedMap.Put(distancia, esteCliente)";
__ref._distorderedmap /*reparto_intmex.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=45678652;
 //BA.debugLineNum = 45678652;BA.debugLine="distOrderedMap.Keys.Sort(True) 'Ordenamos la ma";
__ref._distorderedmap /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).Sort(parent.__c.True);
RDebugUtils.currentLine=45678653;
 //BA.debugLineNum = 45678653;BA.debugLine="Log(distOrderedMap)";
parent.__c.LogImpl("245678653",BA.ObjectToString(__ref._distorderedmap /*reparto_intmex.keymon.lat.b4xorderedmap*/ ),0);
RDebugUtils.currentLine=45678654;
 //BA.debugLineNum = 45678654;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=45678655;
 //BA.debugLineNum = 45678655;BA.debugLine="Private m1 As Map";
_m1 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=45678656;
 //BA.debugLineNum = 45678656;BA.debugLine="For Each k As Object In distOrderedMap.Keys  'G";
if (true) break;

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

case 34:
//C
this.state = 26;
if (index47 < groupLen47) {
this.state = 25;
_k = group47.Get(index47);}
if (true) break;

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

case 25:
//C
this.state = 35;
RDebugUtils.currentLine=45678657;
 //BA.debugLineNum = 45678657;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_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=45678658;
 //BA.debugLineNum = 45678658;BA.debugLine="m1.Get(\"codigo\")";
_m1.Get((Object)("codigo"));
RDebugUtils.currentLine=45678660;
 //BA.debugLineNum = 45678660;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=45678663;
 //BA.debugLineNum = 45678663;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=45678664;
 //BA.debugLineNum = 45678664;BA.debugLine="entro = \"3\"";
__ref._entro /*String*/  = "3";
 if (true) break;

case 29:
//C
this.state = 30;
RDebugUtils.currentLine=45678667;
 //BA.debugLineNum = 45678667;BA.debugLine="Starter.skmt.ExecNonQuery(\"delete from CUENTAA\")";
parent._starter._skmt /*anywheresoftware.b4a.sql.SQL*/ .ExecNonQuery("delete from CUENTAA");
RDebugUtils.currentLine=45678668;
 //BA.debugLineNum = 45678668;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=45678669;
 //BA.debugLineNum = 45678669;BA.debugLine="B4XPages.ShowPage(\"Cliente\")";
parent._b4xpages._showpage /*String*/ (ba,"Cliente");
 if (true) break;

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

            }
        }
    }
}
public void  _traerutadia(reparto_intmex.keymon.lat.c_clientes __ref,reparto_intmex.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_intmex.keymon.lat.c_clientes parent,reparto_intmex.keymon.lat.c_clientes __ref,reparto_intmex.keymon.lat.b4xorderedmap _avisitar) {
this.parent = parent;
this.__ref = __ref;
this._avisitar = _avisitar;
this.__ref = parent;
}
reparto_intmex.keymon.lat.c_clientes __ref;
reparto_intmex.keymon.lat.c_clientes parent;
reparto_intmex.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_intmex.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_intmex.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=46006273;
 //BA.debugLineNum = 46006273;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=46006274;
 //BA.debugLineNum = 46006274;BA.debugLine="Log($\"Coordenadas de inicio: ${Starter.cedisLocat";
parent.__c.LogImpl("246006274",("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=46006275;
 //BA.debugLineNum = 46006275;BA.debugLine="Private rutaCompleta As String = coordsInicio";
_rutacompleta = _coordsinicio;
RDebugUtils.currentLine=46006276;
 //BA.debugLineNum = 46006276;BA.debugLine="Private preRuta As String = coordsInicio";
_preruta = _coordsinicio;
RDebugUtils.currentLine=46006277;
 //BA.debugLineNum = 46006277;BA.debugLine="Private distanciaTotal, distanciaTotal0, tiempo0,";
_distanciatotal = 0;
_distanciatotal0 = 0;
_tiempo0 = 0;
_tiempo = 0;
RDebugUtils.currentLine=46006278;
 //BA.debugLineNum = 46006278;BA.debugLine="Private masDe100 As Boolean";
_masde100 = false;
RDebugUtils.currentLine=46006279;
 //BA.debugLineNum = 46006279;BA.debugLine="Private m4 As Map";
_m4 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46006280;
 //BA.debugLineNum = 46006280;BA.debugLine="Private visitaActual As Int = 0";
_visitaactual = (int) (0);
RDebugUtils.currentLine=46006281;
 //BA.debugLineNum = 46006281;BA.debugLine="Private cuantosAntes As Int = 0";
_cuantosantes = (int) (0);
RDebugUtils.currentLine=46006282;
 //BA.debugLineNum = 46006282;BA.debugLine="listaWayPoints.Initialize";
__ref._listawaypoints /*anywheresoftware.b4a.objects.collections.List*/ .Initialize();
RDebugUtils.currentLine=46006283;
 //BA.debugLineNum = 46006283;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=46006284;
 //BA.debugLineNum = 46006284;BA.debugLine="cuantosAntes = aVisitar.Keys.Size - 98 'Definimo";
_cuantosantes = (int) (_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()-98);
RDebugUtils.currentLine=46006285;
 //BA.debugLineNum = 46006285;BA.debugLine="preRuta = coordsInicio 'Ponemos las coordenadas";
_preruta = _coordsinicio;
RDebugUtils.currentLine=46006286;
 //BA.debugLineNum = 46006286;BA.debugLine="rutaCompleta = \"\"";
_rutacompleta = "";
RDebugUtils.currentLine=46006287;
 //BA.debugLineNum = 46006287;BA.debugLine="masDe100 = True";
_masde100 = parent.__c.True;
 if (true) break;

case 4:
//C
this.state = 5;
;
RDebugUtils.currentLine=46006289;
 //BA.debugLineNum = 46006289;BA.debugLine="Log($\"a visitar: ${aVisitar.Keys.Size}\"$)";
parent.__c.LogImpl("246006289",("a visitar: "+parent.__c.SmartStringFormatter("",(Object)(_avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()))+""),0);
RDebugUtils.currentLine=46006290;
 //BA.debugLineNum = 46006290;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=46006291;
 //BA.debugLineNum = 46006291;BA.debugLine="visitaActual = visitaActual + 1";
_visitaactual = (int) (_visitaactual+1);
RDebugUtils.currentLine=46006292;
 //BA.debugLineNum = 46006292;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=46006294;
 //BA.debugLineNum = 46006294;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=46006295;
 //BA.debugLineNum = 46006295;BA.debugLine="preRuta = preRuta & \";\" & m4.Get(\"coords\")";
_preruta = _preruta+";"+BA.ObjectToString(_m4.Get((Object)("coords")));
 if (true) break;
;
RDebugUtils.currentLine=46006298;
 //BA.debugLineNum = 46006298;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=46006299;
 //BA.debugLineNum = 46006299;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=46006303;
 //BA.debugLineNum = 46006303;BA.debugLine="rutaCompleta = rutaCompleta & \";\" & coordsInicio";
_rutacompleta = _rutacompleta+";"+_coordsinicio;
RDebugUtils.currentLine=46006305;
 //BA.debugLineNum = 46006305;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=46006308;
 //BA.debugLineNum = 46006308;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=46006309;
 //BA.debugLineNum = 46006309;BA.debugLine="Private tiempoVisitas As Double 'TIMEPO DE 4 MINU";
_tiempovisitas = 0;
RDebugUtils.currentLine=46006310;
 //BA.debugLineNum = 46006310;BA.debugLine="tiempoVisitas = aVisitar.Keys.Size * 4 * 60 'Aqui";
_tiempovisitas = _avisitar._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).getSize()*4*60;
RDebugUtils.currentLine=46006311;
 //BA.debugLineNum = 46006311;BA.debugLine="tiempo0 = 0";
_tiempo0 = 0;
RDebugUtils.currentLine=46006312;
 //BA.debugLineNum = 46006312;BA.debugLine="distanciaTotal0 = 0";
_distanciatotal0 = 0;
RDebugUtils.currentLine=46006313;
 //BA.debugLineNum = 46006313;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=46006314;
 //BA.debugLineNum = 46006314;BA.debugLine="Dim j0 As HttpJob";
_j0 = new reparto_intmex.keymon.lat.httpjob();
RDebugUtils.currentLine=46006315;
 //BA.debugLineNum = 46006315;BA.debugLine="j0.Initialize(\"trip0\", Me)";
_j0._initialize /*String*/ (null,ba,"trip0",parent);
RDebugUtils.currentLine=46006316;
 //BA.debugLineNum = 46006316;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=46006318;
 //BA.debugLineNum = 46006318;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_intmex.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=46006319;
 //BA.debugLineNum = 46006319;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=46006320;
 //BA.debugLineNum = 46006320;BA.debugLine="Dim jp0 As JSONParser";
_jp0 = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=46006321;
 //BA.debugLineNum = 46006321;BA.debugLine="jp0.Initialize(j0.GetString)";
_jp0.Initialize(_j0._getstring /*String*/ (null));
RDebugUtils.currentLine=46006322;
 //BA.debugLineNum = 46006322;BA.debugLine="Dim m0 As Map = jp0.NextObject";
_m0 = new anywheresoftware.b4a.objects.collections.Map();
_m0 = _jp0.NextObject();
RDebugUtils.currentLine=46006323;
 //BA.debugLineNum = 46006323;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=46006324;
 //BA.debugLineNum = 46006324;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=46006325;
 //BA.debugLineNum = 46006325;BA.debugLine="Private esteWayPoint0 As Map";
_estewaypoint0 = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46006326;
 //BA.debugLineNum = 46006326;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=46006327;
 //BA.debugLineNum = 46006327;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=46006330;
 //BA.debugLineNum = 46006330;BA.debugLine="esteWayPoint0.Remove(\"hint\")";
_estewaypoint0.Remove((Object)("hint"));
RDebugUtils.currentLine=46006331;
 //BA.debugLineNum = 46006331;BA.debugLine="esteWayPoint0.Remove(\"distance\")";
_estewaypoint0.Remove((Object)("distance"));
RDebugUtils.currentLine=46006332;
 //BA.debugLineNum = 46006332;BA.debugLine="esteWayPoint0.Remove(\"trips_index\")";
_estewaypoint0.Remove((Object)("trips_index"));
RDebugUtils.currentLine=46006333;
 //BA.debugLineNum = 46006333;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=46006336;
 //BA.debugLineNum = 46006336;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=46006337;
 //BA.debugLineNum = 46006337;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=46006340;
 //BA.debugLineNum = 46006340;BA.debugLine="distanciaTotal0 = rutas20.Get(\"distance\")";
_distanciatotal0 = (double)(BA.ObjectToNumber(_rutas20.Get((Object)("distance"))));
RDebugUtils.currentLine=46006341;
 //BA.debugLineNum = 46006341;BA.debugLine="tiempo0 = rutas20.Get(\"duration\")";
_tiempo0 = (double)(BA.ObjectToNumber(_rutas20.Get((Object)("duration"))));
RDebugUtils.currentLine=46006342;
 //BA.debugLineNum = 46006342;BA.debugLine="tiempo0 = ((tiempo0 * 2) ) 'Tiempo X 2 (es muy";
_tiempo0 = ((_tiempo0*2));
RDebugUtils.currentLine=46006343;
 //BA.debugLineNum = 46006343;BA.debugLine="Log($\"Distancia total ruta inicial: $1.1{dista";
parent.__c.LogImpl("246006343",("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=46006347;
 //BA.debugLineNum = 46006347;BA.debugLine="Log(\"Error!\")";
parent.__c.LogImpl("246006347","Error!",0);
 if (true) break;

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

case 39:
//C
this.state = 40;
;
RDebugUtils.currentLine=46006352;
 //BA.debugLineNum = 46006352;BA.debugLine="Dim j As HttpJob";
_j = new reparto_intmex.keymon.lat.httpjob();
RDebugUtils.currentLine=46006353;
 //BA.debugLineNum = 46006353;BA.debugLine="j.Initialize(\"trip\", Me) 'Calculamos el resto de";
_j._initialize /*String*/ (null,ba,"trip",parent);
RDebugUtils.currentLine=46006354;
 //BA.debugLineNum = 46006354;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=46006356;
 //BA.debugLineNum = 46006356;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_intmex.keymon.lat.httpjob) result[1];
;
RDebugUtils.currentLine=46006357;
 //BA.debugLineNum = 46006357;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=46006358;
 //BA.debugLineNum = 46006358;BA.debugLine="Dim jp As JSONParser";
_jp = new anywheresoftware.b4a.objects.collections.JSONParser();
RDebugUtils.currentLine=46006359;
 //BA.debugLineNum = 46006359;BA.debugLine="jp.Initialize(j.GetString)";
_jp.Initialize(_j._getstring /*String*/ (null));
RDebugUtils.currentLine=46006360;
 //BA.debugLineNum = 46006360;BA.debugLine="Dim m As Map = jp.NextObject";
_m = new anywheresoftware.b4a.objects.collections.Map();
_m = _jp.NextObject();
RDebugUtils.currentLine=46006361;
 //BA.debugLineNum = 46006361;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=46006362;
 //BA.debugLineNum = 46006362;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=46006363;
 //BA.debugLineNum = 46006363;BA.debugLine="Private esteWayPoint As Map";
_estewaypoint = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=46006364;
 //BA.debugLineNum = 46006364;BA.debugLine="Dim twpi As Int";
_twpi = 0;
RDebugUtils.currentLine=46006365;
 //BA.debugLineNum = 46006365;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=46006366;
 //BA.debugLineNum = 46006366;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=46006369;
 //BA.debugLineNum = 46006369;BA.debugLine="esteWayPoint.Remove(\"hint\")";
_estewaypoint.Remove((Object)("hint"));
RDebugUtils.currentLine=46006370;
 //BA.debugLineNum = 46006370;BA.debugLine="esteWayPoint.Remove(\"distance\")";
_estewaypoint.Remove((Object)("distance"));
RDebugUtils.currentLine=46006371;
 //BA.debugLineNum = 46006371;BA.debugLine="esteWayPoint.Remove(\"trips_index\")";
_estewaypoint.Remove((Object)("trips_index"));
RDebugUtils.currentLine=46006372;
 //BA.debugLineNum = 46006372;BA.debugLine="twpi = esteWayPoint.Get(\"waypoint_index\")";
_twpi = (int)(BA.ObjectToNumber(_estewaypoint.Get((Object)("waypoint_index"))));
RDebugUtils.currentLine=46006373;
 //BA.debugLineNum = 46006373;BA.debugLine="esteWayPoint.Remove(\"waypoint_index\")";
_estewaypoint.Remove((Object)("waypoint_index"));
RDebugUtils.currentLine=46006374;
 //BA.debugLineNum = 46006374;BA.debugLine="esteWayPoint.Put(\"waypoint_index\", (twpi + cua";
_estewaypoint.Put((Object)("waypoint_index"),(Object)((_twpi+_cuantosantes+2)));
RDebugUtils.currentLine=46006375;
 //BA.debugLineNum = 46006375;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=46006378;
 //BA.debugLineNum = 46006378;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=46006379;
 //BA.debugLineNum = 46006379;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=46006380;
 //BA.debugLineNum = 46006380;BA.debugLine="distanciaTotal = rutas2.Get(\"distance\")";
_distanciatotal = (double)(BA.ObjectToNumber(_rutas2.Get((Object)("distance"))));
RDebugUtils.currentLine=46006381;
 //BA.debugLineNum = 46006381;BA.debugLine="Log(\"distancia ruta 2:\" & (distanciaTotal) & \"|";
parent.__c.LogImpl("246006381","distancia ruta 2:"+BA.NumberToString((_distanciatotal))+"|"+BA.ObjectToString(_rutas2.Get((Object)("distance"))),0);
RDebugUtils.currentLine=46006382;
 //BA.debugLineNum = 46006382;BA.debugLine="distanciaTotal = distanciaTotal + distanciaTota";
_distanciatotal = _distanciatotal+_distanciatotal0;
RDebugUtils.currentLine=46006383;
 //BA.debugLineNum = 46006383;BA.debugLine="tiempo = rutas2.Get(\"duration\")";
_tiempo = (double)(BA.ObjectToNumber(_rutas2.Get((Object)("duration"))));
RDebugUtils.currentLine=46006384;
 //BA.debugLineNum = 46006384;BA.debugLine="tiempo = (((tiempo + tiempo0) * 2) + tiempoVisi";
_tiempo = (((_tiempo+_tiempo0)*2)+_tiempovisitas);
RDebugUtils.currentLine=46006385;
 //BA.debugLineNum = 46006385;BA.debugLine="Log($\"Distancia total: $1.1{distanciaTotal/1000";
parent.__c.LogImpl("246006385",("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=46006386;
 //BA.debugLineNum = 46006386;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=46006387;
 //BA.debugLineNum = 46006387;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=46006388;
 //BA.debugLineNum = 46006388;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=46006389;
 //BA.debugLineNum = 46006389;BA.debugLine="l_rutaInfo.Visible = True";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .setVisible(parent.__c.True);
RDebugUtils.currentLine=46006390;
 //BA.debugLineNum = 46006390;BA.debugLine="l_rutaInfo.BringToFront";
__ref._l_rutainfo /*anywheresoftware.b4a.objects.LabelWrapper*/ .BringToFront();
RDebugUtils.currentLine=46006391;
 //BA.debugLineNum = 46006391;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=46006394;
 //BA.debugLineNum = 46006394;BA.debugLine="LogColor(\"****************  Error!  ************";
parent.__c.LogImpl("246006394","****************  Error!  ******************",parent.__c.Colors.Red);
 if (true) break;

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

case 54:
//for
this.state = 61;
group112 = __ref._clientesmapao /*reparto_intmex.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=46006404;
 //BA.debugLineNum = 46006404;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=46006405;
 //BA.debugLineNum = 46006405;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_intmex.keymon.lat.b4xorderedmap*/ ._get /*Object*/ (null,_k)));
RDebugUtils.currentLine=46006406;
 //BA.debugLineNum = 46006406;BA.debugLine="r1.Get(\"codigo\")";
_r1.Get((Object)("codigo"));
RDebugUtils.currentLine=46006407;
 //BA.debugLineNum = 46006407;BA.debugLine="Log(listaWayPoints.Get(r) & \"|\" & r1.Get(\"coord";
parent.__c.LogImpl("246006407",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=46006408;
 //BA.debugLineNum = 46006408;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=46006409;
 //BA.debugLineNum = 46006409;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=46006410;
 //BA.debugLineNum = 46006410;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=46006411;
 //BA.debugLineNum = 46006411;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=46006414;
 //BA.debugLineNum = 46006414;BA.debugLine="ListView1.Clear";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .Clear();
RDebugUtils.currentLine=46006415;
 //BA.debugLineNum = 46006415;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=46006416;
 //BA.debugLineNum = 46006416;BA.debugLine="Dim label2 As Label";
_label2 = new anywheresoftware.b4a.objects.LabelWrapper();
RDebugUtils.currentLine=46006417;
 //BA.debugLineNum = 46006417;BA.debugLine="label2 = ListView1.TwoLinesLayout.SecondLabel";
_label2 = __ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().SecondLabel;
RDebugUtils.currentLine=46006418;
 //BA.debugLineNum = 46006418;BA.debugLine="label2.TextSize = 15";
_label2.setTextSize((float) (15));
RDebugUtils.currentLine=46006419;
 //BA.debugLineNum = 46006419;BA.debugLine="label2.Height = 100dip";
_label2.setHeight(parent.__c.DipToCurrent((int) (100)));
RDebugUtils.currentLine=46006420;
 //BA.debugLineNum = 46006420;BA.debugLine="ListView1.TwoLinesLayout.ItemHeight = 70dip";
__ref._listview1 /*anywheresoftware.b4a.objects.ListViewWrapper*/ .getTwoLinesLayout().setItemHeight(parent.__c.DipToCurrent((int) (70)));
RDebugUtils.currentLine=46006421;
 //BA.debugLineNum = 46006421;BA.debugLine="Dim cs, cs2 As CSBuilder";
_cs = new anywheresoftware.b4a.objects.CSBuilder();
_cs2 = new anywheresoftware.b4a.objects.CSBuilder();
RDebugUtils.currentLine=46006422;
 //BA.debugLineNum = 46006422;BA.debugLine="entro = 3";
__ref._entro /*String*/  = BA.NumberToString(3);
RDebugUtils.currentLine=46006423;
 //BA.debugLineNum = 46006423;BA.debugLine="Log(\"Generamos ListView1 en traeRutaDia\")";
parent.__c.LogImpl("246006423","Generamos ListView1 en traeRutaDia",0);
RDebugUtils.currentLine=46006425;
 //BA.debugLineNum = 46006425;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=46006426;
 //BA.debugLineNum = 46006426;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=46006427;
 //BA.debugLineNum = 46006427;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=46006428;
 //BA.debugLineNum = 46006428;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=46006429;
 //BA.debugLineNum = 46006429;BA.debugLine="cs.Initialize";
_cs.Initialize();
RDebugUtils.currentLine=46006430;
 //BA.debugLineNum = 46006430;BA.debugLine="cs2.Initialize";
_cs2.Initialize();
RDebugUtils.currentLine=46006431;
 //BA.debugLineNum = 46006431;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=46006434;
 //BA.debugLineNum = 46006434;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=46006435;
 //BA.debugLineNum = 46006435;BA.debugLine="End Sub";
if (true) break;

            }
        }
    }
}
public reparto_intmex.keymon.lat.b4xorderedmap  _traetodosavisitar(reparto_intmex.keymon.lat.c_clientes __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="c_clientes";
if (Debug.shouldDelegate(ba, "traetodosavisitar", false))
	 {return ((reparto_intmex.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=46137344;
 //BA.debugLineNum = 46137344;BA.debugLine="Sub traeTodosAVisitar As B4XOrderedMap 'ignore";
RDebugUtils.currentLine=46137345;
 //BA.debugLineNum = 46137345;BA.debugLine="Log(\"Iniciamos traeTodosAVisitar\")";
__c.LogImpl("246137345","Iniciamos traeTodosAVisitar",0);
RDebugUtils.currentLine=46137348;
 //BA.debugLineNum = 46137348;BA.debugLine="Private thisLoc, ubicacionInicial As Location";
_thisloc = new anywheresoftware.b4a.gps.LocationWrapper();
_ubicacioninicial = new anywheresoftware.b4a.gps.LocationWrapper();
RDebugUtils.currentLine=46137349;
 //BA.debugLineNum = 46137349;BA.debugLine="ubicacionInicial = Starter.cedisLocation";
_ubicacioninicial = _starter._cedislocation /*anywheresoftware.b4a.gps.LocationWrapper*/ ;
RDebugUtils.currentLine=46137350;
 //BA.debugLineNum = 46137350;BA.debugLine="LogColor(ubicacionInicial, Colors.Gray)";
__c.LogImpl("246137350",BA.ObjectToString(_ubicacioninicial),__c.Colors.Gray);
RDebugUtils.currentLine=46137351;
 //BA.debugLineNum = 46137351;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=46137352;
 //BA.debugLineNum = 46137352;BA.debugLine="If c.RowCount > 0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=46137353;
 //BA.debugLineNum = 46137353;BA.debugLine="c.Position = 0";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition((int) (0));
RDebugUtils.currentLine=46137355;
 //BA.debugLineNum = 46137355;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=46137357;
 //BA.debugLineNum = 46137357;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=46137358;
 //BA.debugLineNum = 46137358;BA.debugLine="LogColor(ubicacionInicial, Colors.Red)";
__c.LogImpl("246137358",BA.ObjectToString(_ubicacioninicial),__c.Colors.Red);
RDebugUtils.currentLine=46137359;
 //BA.debugLineNum = 46137359;BA.debugLine="thisLoc.Initialize";
_thisloc.Initialize();
RDebugUtils.currentLine=46137360;
 //BA.debugLineNum = 46137360;BA.debugLine="clientesMapaO.Clear";
__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._clear /*String*/ (null);
RDebugUtils.currentLine=46137362;
 //BA.debugLineNum = 46137362;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=46137363;
 //BA.debugLineNum = 46137363;BA.debugLine="If c.RowCount>0 Then";
if (__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=46137365;
 //BA.debugLineNum = 46137365;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=46137366;
 //BA.debugLineNum = 46137366;BA.debugLine="c.Position=i";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_i);
RDebugUtils.currentLine=46137368;
 //BA.debugLineNum = 46137368;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=46137369;
 //BA.debugLineNum = 46137369;BA.debugLine="If c2.RowCount>0 Then";
if (__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount()>0) { 
RDebugUtils.currentLine=46137370;
 //BA.debugLineNum = 46137370;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=46137371;
 //BA.debugLineNum = 46137371;BA.debugLine="c2.Position=j";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .setPosition(_j);
RDebugUtils.currentLine=46137373;
 //BA.debugLineNum = 46137373;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=46137374;
 //BA.debugLineNum = 46137374;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=46137375;
 //BA.debugLineNum = 46137375;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=46137376;
 //BA.debugLineNum = 46137376;BA.debugLine="Private distancia As Int = ubicacionInicial.";
_distancia = (int) (_ubicacioninicial.DistanceTo((android.location.Location)(_thisloc.getObject())));
RDebugUtils.currentLine=46137377;
 //BA.debugLineNum = 46137377;BA.debugLine="If clientesMapaO.ContainsKey(distancia) Then";
if (__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._containskey /*boolean*/ (null,(Object)(_distancia))) { 
_distancia = (int) (_distancia+1);};
RDebugUtils.currentLine=46137378;
 //BA.debugLineNum = 46137378;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=46137379;
 //BA.debugLineNum = 46137379;BA.debugLine="clientesMapaO.Put(distancia, esteCliente)";
__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._put /*String*/ (null,(Object)(_distancia),(Object)(_estecliente.getObject()));
 }else {
RDebugUtils.currentLine=46137381;
 //BA.debugLineNum = 46137381;BA.debugLine="ToastMessageShow(\"Hay tiendas SIN coordenada";
__c.ToastMessageShow(BA.ObjectToCharSequence("Hay tiendas SIN coordenadas, fueron excluidas!!"),__c.False);
 };
 }
};
 };
 }
};
 };
RDebugUtils.currentLine=46137389;
 //BA.debugLineNum = 46137389;BA.debugLine="clientesMapaO.Keys.Sort(True) 'Ordenamos la lista";
__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._getkeys /*anywheresoftware.b4a.objects.collections.List*/ (null).Sort(__c.True);
RDebugUtils.currentLine=46137390;
 //BA.debugLineNum = 46137390;BA.debugLine="c.Close";
__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=46137391;
 //BA.debugLineNum = 46137391;BA.debugLine="c2.Close";
__ref._c2 /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .Close();
RDebugUtils.currentLine=46137392;
 //BA.debugLineNum = 46137392;BA.debugLine="Log(c.RowCount & \" rutas, \" & clientesMapaO.Size";
__c.LogImpl("246137392",BA.NumberToString(__ref._c /*anywheresoftware.b4a.sql.SQL.CursorWrapper*/ .getRowCount())+" rutas, "+BA.NumberToString(__ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ._getsize /*int*/ (null))+" clientes",0);
RDebugUtils.currentLine=46137395;
 //BA.debugLineNum = 46137395;BA.debugLine="Return clientesMapaO";
if (true) return __ref._clientesmapao /*reparto_intmex.keymon.lat.b4xorderedmap*/ ;
RDebugUtils.currentLine=46137396;
 //BA.debugLineNum = 46137396;BA.debugLine="End Sub";
return null;
}
}