package reparto_intmex.keymon.lat;


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

public class escposprinter 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.escposprinter");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_intmex.keymon.lat.escposprinter.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 static class _animage{
public boolean IsInitialized;
public int Width;
public int Height;
public byte[] Data;
public void Initialize() {
IsInitialized = true;
Width = 0;
Height = 0;
Data = new byte[0];
;
}
@Override
		public String toString() {
			return BA.TypeToString(this, false);
		}}
public anywheresoftware.b4a.keywords.Common __c = null;
public double _version = 0;
public String _eventname = "";
public Object _callback = null;
public anywheresoftware.b4a.objects.Serial _serial1 = null;
public anywheresoftware.b4a.randomaccessfile.AsyncStreams _astream = null;
public boolean _connected = false;
public String _connectederror = "";
public String _esc = "";
public String _fs = "";
public String _gs = "";
public String _unreverse = "";
public String _reverse = "";
public String _uninvert = "";
public String _invert = "";
public String _unrotate = "";
public String _rotate = "";
public String _ht = "";
public String _uline0 = "";
public String _uline1 = "";
public String _uline2 = "";
public String _bold = "";
public String _nobold = "";
public String _single = "";
public String _high = "";
public String _wide = "";
public String _highwide = "";
public String _leftjustify = "";
public String _linedefault = "";
public String _linset0 = "";
public String _lmargin0 = "";
public String _width0 = "";
public String _charspacing0 = "";
public String _charfont0 = "";
public String _defaults = "";
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 String  _initialize(reparto_intmex.keymon.lat.escposprinter __ref,anywheresoftware.b4a.BA _ba,Object _vcallback,String _veventname) throws Exception{
__ref = this;
innerInitialize(_ba);
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "initialize", false))
	 {return ((String) Debug.delegate(ba, "initialize", new Object[] {_ba,_vcallback,_veventname}));}
RDebugUtils.currentLine=59572224;
 //BA.debugLineNum = 59572224;BA.debugLine="Public Sub Initialize(vCallback As Object, vEventN";
RDebugUtils.currentLine=59572225;
 //BA.debugLineNum = 59572225;BA.debugLine="EventName = vEventName";
__ref._eventname /*String*/  = _veventname;
RDebugUtils.currentLine=59572226;
 //BA.debugLineNum = 59572226;BA.debugLine="CallBack = vCallback";
__ref._callback /*Object*/  = _vcallback;
RDebugUtils.currentLine=59572227;
 //BA.debugLineNum = 59572227;BA.debugLine="Serial1.Initialize(\"Serial1\")";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Initialize("Serial1");
RDebugUtils.currentLine=59572228;
 //BA.debugLineNum = 59572228;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=59572229;
 //BA.debugLineNum = 59572229;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=59572230;
 //BA.debugLineNum = 59572230;BA.debugLine="End Sub";
return "";
}
public boolean  _isconnected(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "isconnected", false))
	 {return ((Boolean) Debug.delegate(ba, "isconnected", null));}
RDebugUtils.currentLine=59703296;
 //BA.debugLineNum = 59703296;BA.debugLine="Public Sub IsConnected As Boolean";
RDebugUtils.currentLine=59703297;
 //BA.debugLineNum = 59703297;BA.debugLine="Return Connected";
if (true) return __ref._connected /*boolean*/ ;
RDebugUtils.currentLine=59703298;
 //BA.debugLineNum = 59703298;BA.debugLine="End Sub";
return false;
}
public String  _disconnect(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "disconnect", false))
	 {return ((String) Debug.delegate(ba, "disconnect", null));}
RDebugUtils.currentLine=59899904;
 //BA.debugLineNum = 59899904;BA.debugLine="Public Sub DisConnect";
RDebugUtils.currentLine=59899905;
 //BA.debugLineNum = 59899905;BA.debugLine="Serial1.Disconnect";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
RDebugUtils.currentLine=59899906;
 //BA.debugLineNum = 59899906;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=59899907;
 //BA.debugLineNum = 59899907;BA.debugLine="End Sub";
return "";
}
public boolean  _connect(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "connect", false))
	 {return ((Boolean) Debug.delegate(ba, "connect", null));}
anywheresoftware.b4a.objects.collections.Map _paireddevices = null;
anywheresoftware.b4a.objects.collections.List _l = null;
int _i = 0;
int _res = 0;
RDebugUtils.currentLine=59834368;
 //BA.debugLineNum = 59834368;BA.debugLine="Public Sub Connect As Boolean";
RDebugUtils.currentLine=59834372;
 //BA.debugLineNum = 59834372;BA.debugLine="Try";
try {RDebugUtils.currentLine=59834373;
 //BA.debugLineNum = 59834373;BA.debugLine="If Starter.MAC_IMPRESORA = \"0\" Then";
if ((_starter._mac_impresora /*String*/ ).equals("0")) { 
RDebugUtils.currentLine=59834374;
 //BA.debugLineNum = 59834374;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=59834375;
 //BA.debugLineNum = 59834375;BA.debugLine="PairedDevices = Serial1.GetPairedDevices";
_paireddevices = __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .GetPairedDevices();
RDebugUtils.currentLine=59834376;
 //BA.debugLineNum = 59834376;BA.debugLine="Dim l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=59834377;
 //BA.debugLineNum = 59834377;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=59834378;
 //BA.debugLineNum = 59834378;BA.debugLine="Log(\"aqui 1\")";
__c.LogImpl("259834378","aqui 1",0);
RDebugUtils.currentLine=59834379;
 //BA.debugLineNum = 59834379;BA.debugLine="For i = 0 To PairedDevices.Size - 1";
{
final int step8 = 1;
final int limit8 = (int) (_paireddevices.getSize()-1);
_i = (int) (0) ;
for (;_i <= limit8 ;_i = _i + step8 ) {
RDebugUtils.currentLine=59834380;
 //BA.debugLineNum = 59834380;BA.debugLine="l.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
RDebugUtils.currentLine=59834381;
 //BA.debugLineNum = 59834381;BA.debugLine="Log(\"aqui 2\")";
__c.LogImpl("259834381","aqui 2",0);
RDebugUtils.currentLine=59834382;
 //BA.debugLineNum = 59834382;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
 }
};
RDebugUtils.currentLine=59834384;
 //BA.debugLineNum = 59834384;BA.debugLine="Dim Res As Int";
_res = 0;
RDebugUtils.currentLine=59834385;
 //BA.debugLineNum = 59834385;BA.debugLine="Res = InputList(l, \"Choose a printer\", -1) 'sho";
_res = __c.InputList(_l,BA.ObjectToCharSequence("Choose a printer"),(int) (-1),getActivityBA());
RDebugUtils.currentLine=59834386;
 //BA.debugLineNum = 59834386;BA.debugLine="If Res <> DialogResponse.CANCEL Then";
if (_res!=__c.DialogResponse.CANCEL) { 
RDebugUtils.currentLine=59834387;
 //BA.debugLineNum = 59834387;BA.debugLine="Serial1.Connect(PairedDevices.Get(l.Get(Res)))";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,BA.ObjectToString(_paireddevices.Get(_l.Get(_res))));
RDebugUtils.currentLine=59834389;
 //BA.debugLineNum = 59834389;BA.debugLine="Starter.mac_impresora = PairedDevices.Get(l.Ge";
_starter._mac_impresora /*String*/  = BA.ObjectToString(_paireddevices.Get(_l.Get(_res)));
RDebugUtils.currentLine=59834390;
 //BA.debugLineNum = 59834390;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=59834391;
 //BA.debugLineNum = 59834391;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=59834392;
 //BA.debugLineNum = 59834392;BA.debugLine="Log(\"aqui 3\")";
__c.LogImpl("259834392","aqui 3",0);
 };
RDebugUtils.currentLine=59834394;
 //BA.debugLineNum = 59834394;BA.debugLine="Log(\"aqui 4\")";
__c.LogImpl("259834394","aqui 4",0);
RDebugUtils.currentLine=59834395;
 //BA.debugLineNum = 59834395;BA.debugLine="Return False";
if (true) return __c.False;
 }else {
RDebugUtils.currentLine=59834397;
 //BA.debugLineNum = 59834397;BA.debugLine="Serial1.Connect(Starter.mac_impresora)";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,_starter._mac_impresora /*String*/ );
RDebugUtils.currentLine=59834399;
 //BA.debugLineNum = 59834399;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=59834400;
 //BA.debugLineNum = 59834400;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=59834401;
 //BA.debugLineNum = 59834401;BA.debugLine="Log(\"aqui 5\")";
__c.LogImpl("259834401","aqui 5",0);
 };
 } 
       catch (Exception e31) {
			ba.setLastException(e31);RDebugUtils.currentLine=59834404;
 //BA.debugLineNum = 59834404;BA.debugLine="Log(LastException)";
__c.LogImpl("259834404",BA.ObjectToString(__c.LastException(getActivityBA())),0);
RDebugUtils.currentLine=59834405;
 //BA.debugLineNum = 59834405;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=59834407;
 //BA.debugLineNum = 59834407;BA.debugLine="End Sub";
return false;
}
public String  _astream_error(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "astream_error", false))
	 {return ((String) Debug.delegate(ba, "astream_error", null));}
RDebugUtils.currentLine=63045632;
 //BA.debugLineNum = 63045632;BA.debugLine="Private Sub AStream_Error";
RDebugUtils.currentLine=63045633;
 //BA.debugLineNum = 63045633;BA.debugLine="If SubExists(CallBack, EventName & \"_Error\") Then";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error")) { 
RDebugUtils.currentLine=63045634;
 //BA.debugLineNum = 63045634;BA.debugLine="CallSub(CallBack, EventName & \"_Error\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error");
 };
RDebugUtils.currentLine=63045636;
 //BA.debugLineNum = 63045636;BA.debugLine="End Sub";
return "";
}
public String  _astream_newdata(reparto_intmex.keymon.lat.escposprinter __ref,byte[] _buffer) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "astream_newdata", false))
	 {return ((String) Debug.delegate(ba, "astream_newdata", new Object[] {_buffer}));}
RDebugUtils.currentLine=62980096;
 //BA.debugLineNum = 62980096;BA.debugLine="Private Sub AStream_NewData (Buffer() As Byte)";
RDebugUtils.currentLine=62980097;
 //BA.debugLineNum = 62980097;BA.debugLine="If SubExists(CallBack, EventName & \"_NewData\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData")) { 
RDebugUtils.currentLine=62980098;
 //BA.debugLineNum = 62980098;BA.debugLine="CallSub2(CallBack, EventName & \"_NewData\", Buffe";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData",(Object)(_buffer));
 };
RDebugUtils.currentLine=62980100;
 //BA.debugLineNum = 62980100;BA.debugLine="Log(\"Data \" & Buffer(0))";
__c.LogImpl("262980100","Data "+BA.NumberToString(_buffer[(int) (0)]),0);
RDebugUtils.currentLine=62980101;
 //BA.debugLineNum = 62980101;BA.debugLine="End Sub";
return "";
}
public String  _astream_terminated(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "astream_terminated", false))
	 {return ((String) Debug.delegate(ba, "astream_terminated", null));}
RDebugUtils.currentLine=63111168;
 //BA.debugLineNum = 63111168;BA.debugLine="Private Sub AStream_Terminated";
RDebugUtils.currentLine=63111169;
 //BA.debugLineNum = 63111169;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=63111170;
 //BA.debugLineNum = 63111170;BA.debugLine="If SubExists(CallBack, EventName & \"_Terminated\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated")) { 
RDebugUtils.currentLine=63111171;
 //BA.debugLineNum = 63111171;BA.debugLine="CallSub(CallBack, EventName & \"_Terminated\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated");
 };
RDebugUtils.currentLine=63111173;
 //BA.debugLineNum = 63111173;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
RDebugUtils.currentLine=59506688;
 //BA.debugLineNum = 59506688;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=59506695;
 //BA.debugLineNum = 59506695;BA.debugLine="Private Version As Double = 2.0 ' Printer class v";
_version = 2.0;
RDebugUtils.currentLine=59506697;
 //BA.debugLineNum = 59506697;BA.debugLine="Type AnImage(Width As Int, Height As Int, Data()";
;
RDebugUtils.currentLine=59506699;
 //BA.debugLineNum = 59506699;BA.debugLine="Private EventName As String 'ignore";
_eventname = "";
RDebugUtils.currentLine=59506700;
 //BA.debugLineNum = 59506700;BA.debugLine="Private CallBack As Object 'ignore";
_callback = new Object();
RDebugUtils.currentLine=59506702;
 //BA.debugLineNum = 59506702;BA.debugLine="Private Serial1 As Serial";
_serial1 = new anywheresoftware.b4a.objects.Serial();
RDebugUtils.currentLine=59506703;
 //BA.debugLineNum = 59506703;BA.debugLine="Private Astream As AsyncStreams";
_astream = new anywheresoftware.b4a.randomaccessfile.AsyncStreams();
RDebugUtils.currentLine=59506704;
 //BA.debugLineNum = 59506704;BA.debugLine="Private Connected As Boolean";
_connected = false;
RDebugUtils.currentLine=59506705;
 //BA.debugLineNum = 59506705;BA.debugLine="Private ConnectedError As String";
_connectederror = "";
RDebugUtils.currentLine=59506707;
 //BA.debugLineNum = 59506707;BA.debugLine="Dim ESC As String = Chr(27)";
_esc = BA.ObjectToString(__c.Chr((int) (27)));
RDebugUtils.currentLine=59506708;
 //BA.debugLineNum = 59506708;BA.debugLine="Dim FS As String = Chr(28)";
_fs = BA.ObjectToString(__c.Chr((int) (28)));
RDebugUtils.currentLine=59506709;
 //BA.debugLineNum = 59506709;BA.debugLine="Dim GS As String = Chr(29)";
_gs = BA.ObjectToString(__c.Chr((int) (29)));
RDebugUtils.currentLine=59506712;
 //BA.debugLineNum = 59506712;BA.debugLine="Dim UNREVERSE As String  = GS & \"B\" & Chr(0)";
_unreverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=59506713;
 //BA.debugLineNum = 59506713;BA.debugLine="Dim REVERSE As String = GS & \"B\" & Chr(1)";
_reverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=59506716;
 //BA.debugLineNum = 59506716;BA.debugLine="Dim UNINVERT As String = ESC & \"{0\"";
_uninvert = __ref._esc /*String*/ +"{0";
RDebugUtils.currentLine=59506717;
 //BA.debugLineNum = 59506717;BA.debugLine="Dim INVERT As String = ESC & \"{1\"";
_invert = __ref._esc /*String*/ +"{1";
RDebugUtils.currentLine=59506720;
 //BA.debugLineNum = 59506720;BA.debugLine="Dim UNROTATE As String = ESC & \"V0\"";
_unrotate = __ref._esc /*String*/ +"V0";
RDebugUtils.currentLine=59506721;
 //BA.debugLineNum = 59506721;BA.debugLine="Dim ROTATE As String = ESC & \"V1\"";
_rotate = __ref._esc /*String*/ +"V1";
RDebugUtils.currentLine=59506724;
 //BA.debugLineNum = 59506724;BA.debugLine="Dim HT As String = Chr(9)";
_ht = BA.ObjectToString(__c.Chr((int) (9)));
RDebugUtils.currentLine=59506727;
 //BA.debugLineNum = 59506727;BA.debugLine="Dim ULINE0 As String = ESC & \"-0\"";
_uline0 = __ref._esc /*String*/ +"-0";
RDebugUtils.currentLine=59506728;
 //BA.debugLineNum = 59506728;BA.debugLine="Dim ULINE1 As String = ESC & \"-1\"";
_uline1 = __ref._esc /*String*/ +"-1";
RDebugUtils.currentLine=59506729;
 //BA.debugLineNum = 59506729;BA.debugLine="Dim ULINE2 As String = ESC & \"-2\"";
_uline2 = __ref._esc /*String*/ +"-2";
RDebugUtils.currentLine=59506732;
 //BA.debugLineNum = 59506732;BA.debugLine="Dim BOLD As String = ESC & \"E1\"";
_bold = __ref._esc /*String*/ +"E1";
RDebugUtils.currentLine=59506733;
 //BA.debugLineNum = 59506733;BA.debugLine="Dim NOBOLD As String = ESC & \"E0\"";
_nobold = __ref._esc /*String*/ +"E0";
RDebugUtils.currentLine=59506736;
 //BA.debugLineNum = 59506736;BA.debugLine="Dim SINGLE As String = GS & \"!\" & Chr(0x00)";
_single = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x00)));
RDebugUtils.currentLine=59506737;
 //BA.debugLineNum = 59506737;BA.debugLine="Dim HIGH As String = GS & \"!\" & Chr(0x01)";
_high = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x01)));
RDebugUtils.currentLine=59506738;
 //BA.debugLineNum = 59506738;BA.debugLine="Dim WIDE As String = GS & \"!\" & Chr(0x10)";
_wide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x10)));
RDebugUtils.currentLine=59506739;
 //BA.debugLineNum = 59506739;BA.debugLine="Dim HIGHWIDE As String = GS & \"!\" & Chr(0x11)";
_highwide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x11)));
RDebugUtils.currentLine=59506742;
 //BA.debugLineNum = 59506742;BA.debugLine="Private LEFTJUSTIFY As String = ESC & \"a0\"";
_leftjustify = __ref._esc /*String*/ +"a0";
RDebugUtils.currentLine=59506743;
 //BA.debugLineNum = 59506743;BA.debugLine="Private LINEDEFAULT As String = ESC & \"2\"";
_linedefault = __ref._esc /*String*/ +"2";
RDebugUtils.currentLine=59506744;
 //BA.debugLineNum = 59506744;BA.debugLine="Private LINSET0 As String = ESC & \"$\" & Chr(0x0)";
_linset0 = __ref._esc /*String*/ +"$"+BA.ObjectToString(__c.Chr(((int)0x0)))+BA.ObjectToString(__c.Chr(((int)0x0)));
RDebugUtils.currentLine=59506745;
 //BA.debugLineNum = 59506745;BA.debugLine="Private LMARGIN0 As String = GS & \"L\" & Chr(0x0)";
_lmargin0 = __ref._gs /*String*/ +"L"+BA.ObjectToString(__c.Chr(((int)0x0)))+BA.ObjectToString(__c.Chr(((int)0x0)));
RDebugUtils.currentLine=59506746;
 //BA.debugLineNum = 59506746;BA.debugLine="Private WIDTH0 As String = GS & \"W\" & Chr(0xff) &";
_width0 = __ref._gs /*String*/ +"W"+BA.ObjectToString(__c.Chr(((int)0xff)))+BA.ObjectToString(__c.Chr(((int)0xff)));
RDebugUtils.currentLine=59506747;
 //BA.debugLineNum = 59506747;BA.debugLine="Private CHARSPACING0 As String = ESC & \" \" & Chr(";
_charspacing0 = __ref._esc /*String*/ +" "+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=59506748;
 //BA.debugLineNum = 59506748;BA.debugLine="Private CHARFONT0 As String = ESC & \"M\" & Chr(0)";
_charfont0 = __ref._esc /*String*/ +"M"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=59506749;
 //BA.debugLineNum = 59506749;BA.debugLine="Dim DEFAULTS As String =  CHARSPACING0 & CHARFONT";
_defaults = __ref._charspacing0 /*String*/ +__ref._charfont0 /*String*/ +__ref._lmargin0 /*String*/ +__ref._width0 /*String*/ +__ref._linset0 /*String*/ +__ref._linedefault /*String*/ +__ref._leftjustify /*String*/ +__ref._uninvert /*String*/ +__ref._unrotate /*String*/ +__ref._unreverse /*String*/ +__ref._nobold /*String*/ +__ref._uline0 /*String*/ ;
RDebugUtils.currentLine=59506752;
 //BA.debugLineNum = 59506752;BA.debugLine="End Sub";
return "";
}
public String  _connectederrormsg(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "connectederrormsg", false))
	 {return ((String) Debug.delegate(ba, "connectederrormsg", null));}
RDebugUtils.currentLine=59637760;
 //BA.debugLineNum = 59637760;BA.debugLine="Public Sub ConnectedErrorMsg As String";
RDebugUtils.currentLine=59637761;
 //BA.debugLineNum = 59637761;BA.debugLine="Return ConnectedError";
if (true) return __ref._connectederror /*String*/ ;
RDebugUtils.currentLine=59637762;
 //BA.debugLineNum = 59637762;BA.debugLine="End Sub";
return "";
}
public int  _createbox(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,boolean _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "createbox", false))
	 {return ((Integer) Debug.delegate(ba, "createbox", new Object[] {_x0,_y0,_x1,_y1,_fill}));}
int _box = 0;
RDebugUtils.currentLine=61407232;
 //BA.debugLineNum = 61407232;BA.debugLine="Public Sub CreateBox(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=61407233;
 //BA.debugLineNum = 61407233;BA.debugLine="Dim box As Int = 0x10000000";
_box = ((int)0x10000000);
RDebugUtils.currentLine=61407234;
 //BA.debugLineNum = 61407234;BA.debugLine="If fill Then box = box + 0x80000000";
if (_fill) { 
_box = (int) (_box+((int)0x80000000));};
RDebugUtils.currentLine=61407235;
 //BA.debugLineNum = 61407235;BA.debugLine="box = box + Bit.ShiftLeft(Bit.And(0xf,x0), 24)";
_box = (int) (_box+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x0),(int) (24)));
RDebugUtils.currentLine=61407236;
 //BA.debugLineNum = 61407236;BA.debugLine="box = box + Bit.ShiftLeft(Bit.And(0x1f,y0), 16)";
_box = (int) (_box+__c.Bit.ShiftLeft(__c.Bit.And(((int)0x1f),_y0),(int) (16)));
RDebugUtils.currentLine=61407237;
 //BA.debugLineNum = 61407237;BA.debugLine="box = box + Bit.ShiftLeft(Bit.And(0xf,x1), 8)";
_box = (int) (_box+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x1),(int) (8)));
RDebugUtils.currentLine=61407238;
 //BA.debugLineNum = 61407238;BA.debugLine="box = box + Bit.And(0x1f,y1)";
_box = (int) (_box+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=61407239;
 //BA.debugLineNum = 61407239;BA.debugLine="Return box";
if (true) return _box;
RDebugUtils.currentLine=61407240;
 //BA.debugLineNum = 61407240;BA.debugLine="End Sub";
return 0;
}
public int  _createcircle(reparto_intmex.keymon.lat.escposprinter __ref,int _radius,int _quadrants,int _x1,int _y1,boolean _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "createcircle", false))
	 {return ((Integer) Debug.delegate(ba, "createcircle", new Object[] {_radius,_quadrants,_x1,_y1,_fill}));}
int _circle = 0;
RDebugUtils.currentLine=61276160;
 //BA.debugLineNum = 61276160;BA.debugLine="Public Sub CreateCircle(radius As Int, quadrants A";
RDebugUtils.currentLine=61276161;
 //BA.debugLineNum = 61276161;BA.debugLine="Dim circle As Int = 0x20000000";
_circle = ((int)0x20000000);
RDebugUtils.currentLine=61276162;
 //BA.debugLineNum = 61276162;BA.debugLine="If fill Then circle = circle + 0x80000000";
if (_fill) { 
_circle = (int) (_circle+((int)0x80000000));};
RDebugUtils.currentLine=61276163;
 //BA.debugLineNum = 61276163;BA.debugLine="circle = circle + Bit.ShiftLeft(radius, 24)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_radius,(int) (24)));
RDebugUtils.currentLine=61276164;
 //BA.debugLineNum = 61276164;BA.debugLine="circle = circle + Bit.ShiftLeft(quadrants, 16)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_quadrants,(int) (16)));
RDebugUtils.currentLine=61276165;
 //BA.debugLineNum = 61276165;BA.debugLine="circle = circle + Bit.ShiftLeft(x1, 8)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_x1,(int) (8)));
RDebugUtils.currentLine=61276166;
 //BA.debugLineNum = 61276166;BA.debugLine="circle = circle + y1";
_circle = (int) (_circle+_y1);
RDebugUtils.currentLine=61276167;
 //BA.debugLineNum = 61276167;BA.debugLine="Return circle";
if (true) return _circle;
RDebugUtils.currentLine=61276168;
 //BA.debugLineNum = 61276168;BA.debugLine="End Sub";
return 0;
}
public byte[]  _createcustomcharacter(reparto_intmex.keymon.lat.escposprinter __ref,int[] _shapes,int _characterfont) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "createcustomcharacter", false))
	 {return ((byte[]) Debug.delegate(ba, "createcustomcharacter", new Object[] {_shapes,_characterfont}));}
byte[] _masks = null;
byte[][] _points = null;
int _x = 0;
int _y = 0;
int _size = 0;
byte[] _charbyes = null;
int _c = 0;
int _i = 0;
int _fill = 0;
int _shape = 0;
int _x0 = 0;
int _y0 = 0;
int _x1 = 0;
int _y1 = 0;
int _x2 = 0;
int _y2 = 0;
String _logmsg = "";
byte _bits = (byte)0;
int _b = 0;
RDebugUtils.currentLine=61145088;
 //BA.debugLineNum = 61145088;BA.debugLine="Public Sub CreateCustomCharacter(shapes() As Int,";
RDebugUtils.currentLine=61145089;
 //BA.debugLineNum = 61145089;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=61145090;
 //BA.debugLineNum = 61145090;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=61145091;
 //BA.debugLineNum = 61145091;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=61145092;
 //BA.debugLineNum = 61145092;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=61145093;
 //BA.debugLineNum = 61145093;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=61145094;
 //BA.debugLineNum = 61145094;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=61145095;
 //BA.debugLineNum = 61145095;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=61145096;
 //BA.debugLineNum = 61145096;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=61145097;
 //BA.debugLineNum = 61145097;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=61145100;
 //BA.debugLineNum = 61145100;BA.debugLine="Dim points(16,32) As Byte";
_points = new byte[(int) (16)][];
{
int d0 = _points.length;
int d1 = (int) (32);
for (int i0 = 0;i0 < d0;i0++) {
_points[i0] = new byte[d1];
}
}
;
RDebugUtils.currentLine=61145102;
 //BA.debugLineNum = 61145102;BA.debugLine="For x = 0 To 15";
{
final int step11 = 1;
final int limit11 = (int) (15);
_x = (int) (0) ;
for (;_x <= limit11 ;_x = _x + step11 ) {
RDebugUtils.currentLine=61145103;
 //BA.debugLineNum = 61145103;BA.debugLine="For y = 0 To 31";
{
final int step12 = 1;
final int limit12 = (int) (31);
_y = (int) (0) ;
for (;_y <= limit12 ;_y = _y + step12 ) {
RDebugUtils.currentLine=61145104;
 //BA.debugLineNum = 61145104;BA.debugLine="points(x,y) = 0";
_points[_x][_y] = (byte) (0);
 }
};
 }
};
RDebugUtils.currentLine=61145107;
 //BA.debugLineNum = 61145107;BA.debugLine="Dim size As Int = 12";
_size = (int) (12);
RDebugUtils.currentLine=61145108;
 //BA.debugLineNum = 61145108;BA.debugLine="If characterfont = 1 Then size = 9";
if (_characterfont==1) { 
_size = (int) (9);};
RDebugUtils.currentLine=61145109;
 //BA.debugLineNum = 61145109;BA.debugLine="Dim charbyes(size * 3) As Byte";
_charbyes = new byte[(int) (_size*3)];
;
RDebugUtils.currentLine=61145110;
 //BA.debugLineNum = 61145110;BA.debugLine="For c = 0 To charbyes.Length - 1";
{
final int step19 = 1;
final int limit19 = (int) (_charbyes.length-1);
_c = (int) (0) ;
for (;_c <= limit19 ;_c = _c + step19 ) {
RDebugUtils.currentLine=61145111;
 //BA.debugLineNum = 61145111;BA.debugLine="charbyes(c) = 0";
_charbyes[_c] = (byte) (0);
 }
};
RDebugUtils.currentLine=61145114;
 //BA.debugLineNum = 61145114;BA.debugLine="For i = 0 To shapes.Length -1";
{
final int step22 = 1;
final int limit22 = (int) (_shapes.length-1);
_i = (int) (0) ;
for (;_i <= limit22 ;_i = _i + step22 ) {
RDebugUtils.currentLine=61145115;
 //BA.debugLineNum = 61145115;BA.debugLine="Dim fill As Int =  Bit.UnsignedShiftRight(Bit.An";
_fill = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x80000000),_shapes[_i]),(int) (31));
RDebugUtils.currentLine=61145116;
 //BA.debugLineNum = 61145116;BA.debugLine="Dim shape As Int = Bit.UnsignedShiftRight(Bit.An";
_shape = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x70000000),_shapes[_i]),(int) (28));
RDebugUtils.currentLine=61145117;
 //BA.debugLineNum = 61145117;BA.debugLine="Dim x0 As Int = Bit.UnsignedShiftRight(Bit.And(0";
_x0 = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x0f000000),_shapes[_i]),(int) (24));
RDebugUtils.currentLine=61145118;
 //BA.debugLineNum = 61145118;BA.debugLine="Dim y0 As Int = Bit.UnsignedShiftRight(Bit.And(0";
_y0 = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x001f0000),_shapes[_i]),(int) (16));
RDebugUtils.currentLine=61145119;
 //BA.debugLineNum = 61145119;BA.debugLine="Dim x1 As Int = Bit.UnsignedShiftRight(Bit.And(0";
_x1 = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x00000f00),_shapes[_i]),(int) (8));
RDebugUtils.currentLine=61145120;
 //BA.debugLineNum = 61145120;BA.debugLine="Dim y1 As Int = Bit.And(0x0000001f, shapes(i))";
_y1 = __c.Bit.And(((int)0x0000001f),_shapes[_i]);
RDebugUtils.currentLine=61145121;
 //BA.debugLineNum = 61145121;BA.debugLine="Dim x2 As Int = Bit.UnsignedShiftRight(Bit.And(0";
_x2 = __c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x0000f000),_shapes[_i]),(int) (12));
RDebugUtils.currentLine=61145122;
 //BA.debugLineNum = 61145122;BA.debugLine="Dim y2 As Int = Bit.UnsignedShiftRight(Bit.And(0";
_y2 = (int) (__c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x00e00000),_shapes[_i]),(int) (18))+__c.Bit.UnsignedShiftRight(__c.Bit.And(((int)0x000000e0),_shapes[_i]),(int) (5)));
RDebugUtils.currentLine=61145128;
 //BA.debugLineNum = 61145128;BA.debugLine="Dim logmsg As String = \": Fill=\" & fill & \" : Po";
_logmsg = ": Fill="+BA.NumberToString(_fill)+" : Points "+BA.NumberToString(_x0)+","+BA.NumberToString(_y0)+"  "+BA.NumberToString(_x1)+","+BA.NumberToString(_y1)+"  "+BA.NumberToString(_x2)+","+BA.NumberToString(_y2);
RDebugUtils.currentLine=61145129;
 //BA.debugLineNum = 61145129;BA.debugLine="If shape = 3 Then";
if (_shape==3) { 
RDebugUtils.currentLine=61145130;
 //BA.debugLineNum = 61145130;BA.debugLine="Log(\"Triangle \" & logmsg)";
__c.LogImpl("261145130","Triangle "+_logmsg,0);
RDebugUtils.currentLine=61145131;
 //BA.debugLineNum = 61145131;BA.debugLine="PlotTriangle(x0, y0, x1, y1, x2, y2, points, fi";
__ref._plottriangle /*String*/ (null,_x0,_y0,_x1,_y1,_x2,_y2,_points,_fill);
 }else 
{RDebugUtils.currentLine=61145132;
 //BA.debugLineNum = 61145132;BA.debugLine="else If shape = 2 Then";
if (_shape==2) { 
RDebugUtils.currentLine=61145133;
 //BA.debugLineNum = 61145133;BA.debugLine="Log(\"Circle \" & logmsg)";
__c.LogImpl("261145133","Circle "+_logmsg,0);
RDebugUtils.currentLine=61145134;
 //BA.debugLineNum = 61145134;BA.debugLine="PlotCircle(x0, y0, x1, y1, points, fill)";
__ref._plotcircle /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else 
{RDebugUtils.currentLine=61145135;
 //BA.debugLineNum = 61145135;BA.debugLine="Else If shape = 1 Then";
if (_shape==1) { 
RDebugUtils.currentLine=61145136;
 //BA.debugLineNum = 61145136;BA.debugLine="Log(\"Box \" & logmsg)";
__c.LogImpl("261145136","Box "+_logmsg,0);
RDebugUtils.currentLine=61145137;
 //BA.debugLineNum = 61145137;BA.debugLine="PlotBox(x0, y0, x1, y1, points, fill)";
__ref._plotbox /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else {
RDebugUtils.currentLine=61145139;
 //BA.debugLineNum = 61145139;BA.debugLine="Log(\"Line \" & logmsg)";
__c.LogImpl("261145139","Line "+_logmsg,0);
RDebugUtils.currentLine=61145140;
 //BA.debugLineNum = 61145140;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 }}}
;
RDebugUtils.currentLine=61145143;
 //BA.debugLineNum = 61145143;BA.debugLine="For x = 0 To size -1 ' 9 or 12 horizontal bytes";
{
final int step45 = 1;
final int limit45 = (int) (_size-1);
_x = (int) (0) ;
for (;_x <= limit45 ;_x = _x + step45 ) {
RDebugUtils.currentLine=61145144;
 //BA.debugLineNum = 61145144;BA.debugLine="For y = 0 To 2 ' 3 vertical bytes";
{
final int step46 = 1;
final int limit46 = (int) (2);
_y = (int) (0) ;
for (;_y <= limit46 ;_y = _y + step46 ) {
RDebugUtils.currentLine=61145145;
 //BA.debugLineNum = 61145145;BA.debugLine="Dim bits As Byte = 0";
_bits = (byte) (0);
RDebugUtils.currentLine=61145146;
 //BA.debugLineNum = 61145146;BA.debugLine="For b = 0 To 7 ' 8 vertical bits";
{
final int step48 = 1;
final int limit48 = (int) (7);
_b = (int) (0) ;
for (;_b <= limit48 ;_b = _b + step48 ) {
RDebugUtils.currentLine=61145147;
 //BA.debugLineNum = 61145147;BA.debugLine="If points(x, y*8+b) <> 0 Then";
if (_points[_x][(int) (_y*8+_b)]!=0) { 
RDebugUtils.currentLine=61145148;
 //BA.debugLineNum = 61145148;BA.debugLine="bits = Bit.Or(bits, masks(b))";
_bits = (byte) (__c.Bit.Or((int) (_bits),(int) (_masks[_b])));
 };
 }
};
RDebugUtils.currentLine=61145151;
 //BA.debugLineNum = 61145151;BA.debugLine="charbyes(x*3+y) = bits";
_charbyes[(int) (_x*3+_y)] = _bits;
 }
};
 }
};
 }
};
RDebugUtils.currentLine=61145155;
 //BA.debugLineNum = 61145155;BA.debugLine="Return charbyes";
if (true) return _charbyes;
RDebugUtils.currentLine=61145156;
 //BA.debugLineNum = 61145156;BA.debugLine="End Sub";
return null;
}
public String  _plottriangle(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,int _x2,int _y2,byte[][] _points,int _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plottriangle", false))
	 {return ((String) Debug.delegate(ba, "plottriangle", new Object[] {_x0,_y0,_x1,_y1,_x2,_y2,_points,_fill}));}
RDebugUtils.currentLine=61472768;
 //BA.debugLineNum = 61472768;BA.debugLine="Private Sub PlotTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=61472770;
 //BA.debugLineNum = 61472770;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=61472771;
 //BA.debugLineNum = 61472771;BA.debugLine="PlotLine(x1, y1, x2, y2, points)";
__ref._plotline /*String*/ (null,_x1,_y1,_x2,_y2,_points);
RDebugUtils.currentLine=61472772;
 //BA.debugLineNum = 61472772;BA.debugLine="PlotLine(x2, y2, x0, y0, points)";
__ref._plotline /*String*/ (null,_x2,_y2,_x0,_y0,_points);
RDebugUtils.currentLine=61472773;
 //BA.debugLineNum = 61472773;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=61472774;
 //BA.debugLineNum = 61472774;BA.debugLine="FillTriangle(x0, y0, x1, y1, x2, y2, points)";
__ref._filltriangle /*String*/ (null,_x0,_y0,_x1,_y1,_x2,_y2,_points);
 };
RDebugUtils.currentLine=61472776;
 //BA.debugLineNum = 61472776;BA.debugLine="End Sub";
return "";
}
public String  _plotcircle(reparto_intmex.keymon.lat.escposprinter __ref,int _radius,int _quadrants,int _x1,int _y1,byte[][] _points,int _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plotcircle", false))
	 {return ((String) Debug.delegate(ba, "plotcircle", new Object[] {_radius,_quadrants,_x1,_y1,_points,_fill}));}
int _mask = 0;
int _q = 0;
int _i = 0;
double _x = 0;
double _y = 0;
RDebugUtils.currentLine=61669376;
 //BA.debugLineNum = 61669376;BA.debugLine="Private Sub PlotCircle(radius As Int, quadrants As";
RDebugUtils.currentLine=61669378;
 //BA.debugLineNum = 61669378;BA.debugLine="Dim mask As Int = 1";
_mask = (int) (1);
RDebugUtils.currentLine=61669379;
 //BA.debugLineNum = 61669379;BA.debugLine="For q = 3 To 0 Step -1";
{
final int step2 = -1;
final int limit2 = (int) (0);
_q = (int) (3) ;
for (;_q >= limit2 ;_q = _q + step2 ) {
RDebugUtils.currentLine=61669380;
 //BA.debugLineNum = 61669380;BA.debugLine="If Bit.And(quadrants, mask) <> 0 Then";
if (__c.Bit.And(_quadrants,_mask)!=0) { 
RDebugUtils.currentLine=61669381;
 //BA.debugLineNum = 61669381;BA.debugLine="For i = q*90 To q*90+90 Step 1";
{
final int step4 = 1;
final int limit4 = (int) (_q*90+90);
_i = (int) (_q*90) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=61669382;
 //BA.debugLineNum = 61669382;BA.debugLine="Dim x,y As Double";
_x = 0;
_y = 0;
RDebugUtils.currentLine=61669383;
 //BA.debugLineNum = 61669383;BA.debugLine="x = x1 - SinD(i)*radius";
_x = _x1-__c.SinD(_i)*_radius;
RDebugUtils.currentLine=61669384;
 //BA.debugLineNum = 61669384;BA.debugLine="y = y1 - CosD(i)*radius";
_y = _y1-__c.CosD(_i)*_radius;
RDebugUtils.currentLine=61669385;
 //BA.debugLineNum = 61669385;BA.debugLine="If fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=61669386;
 //BA.debugLineNum = 61669386;BA.debugLine="PlotLine(x1, y1, x, y, points)";
__ref._plotline /*String*/ (null,_x1,_y1,(int) (_x),(int) (_y),_points);
 }else {
RDebugUtils.currentLine=61669388;
 //BA.debugLineNum = 61669388;BA.debugLine="points(Round(x), Round(y)) = 1";
_points[(int) (__c.Round(_x))][(int) (__c.Round(_y))] = (byte) (1);
 };
 }
};
 };
RDebugUtils.currentLine=61669392;
 //BA.debugLineNum = 61669392;BA.debugLine="mask = Bit.ShiftLeft(mask, 1)";
_mask = __c.Bit.ShiftLeft(_mask,(int) (1));
 }
};
RDebugUtils.currentLine=61669394;
 //BA.debugLineNum = 61669394;BA.debugLine="End Sub";
return "";
}
public String  _plotbox(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,byte[][] _points,int _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plotbox", false))
	 {return ((String) Debug.delegate(ba, "plotbox", new Object[] {_x0,_y0,_x1,_y1,_points,_fill}));}
int _x = 0;
RDebugUtils.currentLine=61603840;
 //BA.debugLineNum = 61603840;BA.debugLine="Private Sub PlotBox(x0 As Int, y0 As Int, x1 As In";
RDebugUtils.currentLine=61603842;
 //BA.debugLineNum = 61603842;BA.debugLine="PlotLine(x0, y0, x0, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x0,_y1,_points);
RDebugUtils.currentLine=61603843;
 //BA.debugLineNum = 61603843;BA.debugLine="PlotLine(x0, y0, x1, y0, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y0,_points);
RDebugUtils.currentLine=61603844;
 //BA.debugLineNum = 61603844;BA.debugLine="PlotLine(x1, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x1,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=61603845;
 //BA.debugLineNum = 61603845;BA.debugLine="PlotLine(x0, y1, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y1,_x1,_y1,_points);
RDebugUtils.currentLine=61603846;
 //BA.debugLineNum = 61603846;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=61603847;
 //BA.debugLineNum = 61603847;BA.debugLine="For x = x0 To x1";
{
final int step6 = 1;
final int limit6 = _x1;
_x = _x0 ;
for (;_x <= limit6 ;_x = _x + step6 ) {
RDebugUtils.currentLine=61603848;
 //BA.debugLineNum = 61603848;BA.debugLine="PlotLine(x, y0, x, y1, points)";
__ref._plotline /*String*/ (null,_x,_y0,_x,_y1,_points);
 }
};
 };
RDebugUtils.currentLine=61603851;
 //BA.debugLineNum = 61603851;BA.debugLine="End Sub";
return "";
}
public String  _plotline(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,byte[][] _points) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plotline", false))
	 {return ((String) Debug.delegate(ba, "plotline", new Object[] {_x0,_y0,_x1,_y1,_points}));}
RDebugUtils.currentLine=61734912;
 //BA.debugLineNum = 61734912;BA.debugLine="Private Sub PlotLine(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=61734913;
 //BA.debugLineNum = 61734913;BA.debugLine="If Abs(y1 - y0) < Abs(x1 - x0) Then";
if (__c.Abs(_y1-_y0)<__c.Abs(_x1-_x0)) { 
RDebugUtils.currentLine=61734914;
 //BA.debugLineNum = 61734914;BA.debugLine="If x0 > x1 Then";
if (_x0>_x1) { 
RDebugUtils.currentLine=61734915;
 //BA.debugLineNum = 61734915;BA.debugLine="PlotLineLow(x1, y1, x0, y0, points)";
__ref._plotlinelow /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=61734917;
 //BA.debugLineNum = 61734917;BA.debugLine="PlotLineLow(x0, y0, x1, y1, points)";
__ref._plotlinelow /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 }else {
RDebugUtils.currentLine=61734920;
 //BA.debugLineNum = 61734920;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=61734921;
 //BA.debugLineNum = 61734921;BA.debugLine="PlotLineHigh(x1, y1, x0, y0, points)";
__ref._plotlinehigh /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=61734923;
 //BA.debugLineNum = 61734923;BA.debugLine="PlotLineHigh(x0, y0, x1, y1, points)";
__ref._plotlinehigh /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 };
RDebugUtils.currentLine=61734926;
 //BA.debugLineNum = 61734926;BA.debugLine="End Sub";
return "";
}
public int  _createline(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "createline", false))
	 {return ((Integer) Debug.delegate(ba, "createline", new Object[] {_x0,_y0,_x1,_y1}));}
int _line = 0;
RDebugUtils.currentLine=61210624;
 //BA.debugLineNum = 61210624;BA.debugLine="Public Sub CreateLine(x0 As Int, y0 As Int, x1 As";
RDebugUtils.currentLine=61210625;
 //BA.debugLineNum = 61210625;BA.debugLine="Dim line As Int = 0";
_line = (int) (0);
RDebugUtils.currentLine=61210626;
 //BA.debugLineNum = 61210626;BA.debugLine="line = line + Bit.ShiftLeft(Bit.And(0xf,x0), 24)";
_line = (int) (_line+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x0),(int) (24)));
RDebugUtils.currentLine=61210627;
 //BA.debugLineNum = 61210627;BA.debugLine="line = line + Bit.ShiftLeft(Bit.And(0x1f,y0), 16)";
_line = (int) (_line+__c.Bit.ShiftLeft(__c.Bit.And(((int)0x1f),_y0),(int) (16)));
RDebugUtils.currentLine=61210628;
 //BA.debugLineNum = 61210628;BA.debugLine="line = line + Bit.ShiftLeft(Bit.And(0xf,x1), 8)";
_line = (int) (_line+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x1),(int) (8)));
RDebugUtils.currentLine=61210629;
 //BA.debugLineNum = 61210629;BA.debugLine="line = line + Bit.And(0x1f,y1)";
_line = (int) (_line+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=61210630;
 //BA.debugLineNum = 61210630;BA.debugLine="Return line";
if (true) return _line;
RDebugUtils.currentLine=61210631;
 //BA.debugLineNum = 61210631;BA.debugLine="End Sub";
return 0;
}
public int  _createtriangle(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,int _x2,int _y2,boolean _fill) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "createtriangle", false))
	 {return ((Integer) Debug.delegate(ba, "createtriangle", new Object[] {_x0,_y0,_x1,_y1,_x2,_y2,_fill}));}
int _triangle = 0;
RDebugUtils.currentLine=61341696;
 //BA.debugLineNum = 61341696;BA.debugLine="Public Sub CreateTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=61341697;
 //BA.debugLineNum = 61341697;BA.debugLine="Dim triangle As Int = 0x30000000";
_triangle = ((int)0x30000000);
RDebugUtils.currentLine=61341698;
 //BA.debugLineNum = 61341698;BA.debugLine="If fill Then triangle = triangle + 0x80000000";
if (_fill) { 
_triangle = (int) (_triangle+((int)0x80000000));};
RDebugUtils.currentLine=61341699;
 //BA.debugLineNum = 61341699;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x0),(int) (24)));
RDebugUtils.currentLine=61341700;
 //BA.debugLineNum = 61341700;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0x1f,";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0x1f),_y0),(int) (16)));
RDebugUtils.currentLine=61341701;
 //BA.debugLineNum = 61341701;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x1),(int) (8)));
RDebugUtils.currentLine=61341702;
 //BA.debugLineNum = 61341702;BA.debugLine="triangle = triangle + Bit.And(0x1f,y1)";
_triangle = (int) (_triangle+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=61341703;
 //BA.debugLineNum = 61341703;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0xf,x";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0xf),_x2),(int) (12)));
RDebugUtils.currentLine=61341704;
 //BA.debugLineNum = 61341704;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0x7,y";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0x7),_y2),(int) (5)));
RDebugUtils.currentLine=61341705;
 //BA.debugLineNum = 61341705;BA.debugLine="triangle = triangle + Bit.ShiftLeft(Bit.And(0x18,";
_triangle = (int) (_triangle+__c.Bit.ShiftLeft(__c.Bit.And(((int)0x18),_y2),(int) (18)));
RDebugUtils.currentLine=61341706;
 //BA.debugLineNum = 61341706;BA.debugLine="Return triangle";
if (true) return _triangle;
RDebugUtils.currentLine=61341707;
 //BA.debugLineNum = 61341707;BA.debugLine="End Sub";
return 0;
}
public int  _definecustomcharacter(reparto_intmex.keymon.lat.escposprinter __ref,int _charcode,byte[] _bitdata) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "definecustomcharacter", false))
	 {return ((Integer) Debug.delegate(ba, "definecustomcharacter", new Object[] {_charcode,_bitdata}));}
int _excess = 0;
int _size = 0;
byte[] _params = null;
RDebugUtils.currentLine=61079552;
 //BA.debugLineNum = 61079552;BA.debugLine="Public Sub DefineCustomCharacter(charcode As Int,";
RDebugUtils.currentLine=61079553;
 //BA.debugLineNum = 61079553;BA.debugLine="Dim excess As Int = bitdata.Length Mod 3";
_excess = (int) (_bitdata.length%3);
RDebugUtils.currentLine=61079554;
 //BA.debugLineNum = 61079554;BA.debugLine="If excess <> 0 Then Return -1";
if (_excess!=0) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=61079555;
 //BA.debugLineNum = 61079555;BA.debugLine="Dim size As Int = bitdata.Length / 3";
_size = (int) (_bitdata.length/(double)3);
RDebugUtils.currentLine=61079556;
 //BA.debugLineNum = 61079556;BA.debugLine="WriteString(ESC & \"&\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"&");
RDebugUtils.currentLine=61079557;
 //BA.debugLineNum = 61079557;BA.debugLine="Dim params(4) As Byte";
_params = new byte[(int) (4)];
;
RDebugUtils.currentLine=61079558;
 //BA.debugLineNum = 61079558;BA.debugLine="params(0) = 3";
_params[(int) (0)] = (byte) (3);
RDebugUtils.currentLine=61079559;
 //BA.debugLineNum = 61079559;BA.debugLine="params(1) = charcode";
_params[(int) (1)] = (byte) (_charcode);
RDebugUtils.currentLine=61079560;
 //BA.debugLineNum = 61079560;BA.debugLine="params(2) = charcode";
_params[(int) (2)] = (byte) (_charcode);
RDebugUtils.currentLine=61079561;
 //BA.debugLineNum = 61079561;BA.debugLine="params(3) = size";
_params[(int) (3)] = (byte) (_size);
RDebugUtils.currentLine=61079562;
 //BA.debugLineNum = 61079562;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=61079563;
 //BA.debugLineNum = 61079563;BA.debugLine="WriteBytes(bitdata)";
__ref._writebytes /*String*/ (null,_bitdata);
RDebugUtils.currentLine=61079564;
 //BA.debugLineNum = 61079564;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=61079565;
 //BA.debugLineNum = 61079565;BA.debugLine="End Sub";
return 0;
}
public String  _writestring(reparto_intmex.keymon.lat.escposprinter __ref,String _data) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "writestring", false))
	 {return ((String) Debug.delegate(ba, "writestring", new Object[] {_data}));}
RDebugUtils.currentLine=60817408;
 //BA.debugLineNum = 60817408;BA.debugLine="Public Sub WriteString(data As String)";
RDebugUtils.currentLine=60817409;
 //BA.debugLineNum = 60817409;BA.debugLine="WriteString2(data, \"IBM437\")";
__ref._writestring2 /*String*/ (null,_data,"IBM437");
RDebugUtils.currentLine=60817410;
 //BA.debugLineNum = 60817410;BA.debugLine="End Sub";
return "";
}
public String  _writebytes(reparto_intmex.keymon.lat.escposprinter __ref,byte[] _data) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "writebytes", false))
	 {return ((String) Debug.delegate(ba, "writebytes", new Object[] {_data}));}
RDebugUtils.currentLine=60751872;
 //BA.debugLineNum = 60751872;BA.debugLine="Public Sub WriteBytes(data() As Byte)";
RDebugUtils.currentLine=60751873;
 //BA.debugLineNum = 60751873;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=60751874;
 //BA.debugLineNum = 60751874;BA.debugLine="Astream.Write(data)";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Write(_data);
 };
RDebugUtils.currentLine=60751876;
 //BA.debugLineNum = 60751876;BA.debugLine="End Sub";
return "";
}
public String  _deletecustomcharacter(reparto_intmex.keymon.lat.escposprinter __ref,int _charcode) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "deletecustomcharacter", false))
	 {return ((String) Debug.delegate(ba, "deletecustomcharacter", new Object[] {_charcode}));}
byte[] _params = null;
RDebugUtils.currentLine=60948480;
 //BA.debugLineNum = 60948480;BA.debugLine="Public Sub DeleteCustomCharacter(charcode As Int)";
RDebugUtils.currentLine=60948481;
 //BA.debugLineNum = 60948481;BA.debugLine="WriteString(ESC & \"?\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"?");
RDebugUtils.currentLine=60948482;
 //BA.debugLineNum = 60948482;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=60948483;
 //BA.debugLineNum = 60948483;BA.debugLine="params(0) = charcode";
_params[(int) (0)] = (byte) (_charcode);
RDebugUtils.currentLine=60948484;
 //BA.debugLineNum = 60948484;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60948485;
 //BA.debugLineNum = 60948485;BA.debugLine="End Sub";
return "";
}
public reparto_intmex.keymon.lat.escposprinter._animage  _ditherimage1d(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage1d", false))
	 {return ((reparto_intmex.keymon.lat.escposprinter._animage) Debug.delegate(ba, "ditherimage1d", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _error = 0;
int _y = 0;
int _x = 0;
int _lum = 0;
reparto_intmex.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=62062592;
 //BA.debugLineNum = 62062592;BA.debugLine="Sub DitherImage1D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=62062593;
 //BA.debugLineNum = 62062593;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=62062594;
 //BA.debugLineNum = 62062594;BA.debugLine="Dim error As Int";
_error = 0;
RDebugUtils.currentLine=62062595;
 //BA.debugLineNum = 62062595;BA.debugLine="For y = 0 To img.Height - 1";
{
final int step3 = 1;
final int limit3 = (int) (_img.Height /*int*/ -1);
_y = (int) (0) ;
for (;_y <= limit3 ;_y = _y + step3 ) {
RDebugUtils.currentLine=62062596;
 //BA.debugLineNum = 62062596;BA.debugLine="error = 0 ' reset on each new line";
_error = (int) (0);
RDebugUtils.currentLine=62062597;
 //BA.debugLineNum = 62062597;BA.debugLine="For x = 0 To img.Width - 1";
{
final int step5 = 1;
final int limit5 = (int) (_img.Width /*int*/ -1);
_x = (int) (0) ;
for (;_x <= limit5 ;_x = _x + step5 ) {
RDebugUtils.currentLine=62062598;
 //BA.debugLineNum = 62062598;BA.debugLine="Dim lum As Int = Bit.And(img.Data(y*img.Width +";
_lum = __c.Bit.And((int) (_img.Data /*byte[]*/ [(int) (_y*_img.Width /*int*/ +_x)]),((int)0xff));
RDebugUtils.currentLine=62062599;
 //BA.debugLineNum = 62062599;BA.debugLine="lum = lum + error";
_lum = (int) (_lum+_error);
RDebugUtils.currentLine=62062600;
 //BA.debugLineNum = 62062600;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=62062601;
 //BA.debugLineNum = 62062601;BA.debugLine="error = lum";
_error = _lum;
RDebugUtils.currentLine=62062602;
 //BA.debugLineNum = 62062602;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=62062604;
 //BA.debugLineNum = 62062604;BA.debugLine="error = lum - 255";
_error = (int) (_lum-255);
RDebugUtils.currentLine=62062605;
 //BA.debugLineNum = 62062605;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=62062607;
 //BA.debugLineNum = 62062607;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=62062610;
 //BA.debugLineNum = 62062610;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_intmex.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=62062611;
 //BA.debugLineNum = 62062611;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=62062612;
 //BA.debugLineNum = 62062612;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=62062613;
 //BA.debugLineNum = 62062613;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=62062614;
 //BA.debugLineNum = 62062614;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=62062615;
 //BA.debugLineNum = 62062615;BA.debugLine="End Sub";
return null;
}
public reparto_intmex.keymon.lat.escposprinter._animage  _ditherimage2d(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage2d", false))
	 {return ((reparto_intmex.keymon.lat.escposprinter._animage) Debug.delegate(ba, "ditherimage2d", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _xerror = 0;
int[] _yerrors = null;
int _i = 0;
int _y = 0;
int _x = 0;
int _lum = 0;
reparto_intmex.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=62128128;
 //BA.debugLineNum = 62128128;BA.debugLine="Sub DitherImage2D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=62128129;
 //BA.debugLineNum = 62128129;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=62128130;
 //BA.debugLineNum = 62128130;BA.debugLine="Dim xerror As Int";
_xerror = 0;
RDebugUtils.currentLine=62128131;
 //BA.debugLineNum = 62128131;BA.debugLine="Dim yerrors(img.Width) As Int";
_yerrors = new int[_img.Width /*int*/ ];
;
RDebugUtils.currentLine=62128132;
 //BA.debugLineNum = 62128132;BA.debugLine="For i = 0 To yerrors.Length -1";
{
final int step4 = 1;
final int limit4 = (int) (_yerrors.length-1);
_i = (int) (0) ;
for (;_i <= limit4 ;_i = _i + step4 ) {
RDebugUtils.currentLine=62128133;
 //BA.debugLineNum = 62128133;BA.debugLine="yerrors(0) = 0";
_yerrors[(int) (0)] = (int) (0);
 }
};
RDebugUtils.currentLine=62128135;
 //BA.debugLineNum = 62128135;BA.debugLine="For y = 0 To img.Height - 1";
{
final int step7 = 1;
final int limit7 = (int) (_img.Height /*int*/ -1);
_y = (int) (0) ;
for (;_y <= limit7 ;_y = _y + step7 ) {
RDebugUtils.currentLine=62128136;
 //BA.debugLineNum = 62128136;BA.debugLine="xerror = 0 ' reset on each new line";
_xerror = (int) (0);
RDebugUtils.currentLine=62128137;
 //BA.debugLineNum = 62128137;BA.debugLine="For x = 0 To img.Width - 1";
{
final int step9 = 1;
final int limit9 = (int) (_img.Width /*int*/ -1);
_x = (int) (0) ;
for (;_x <= limit9 ;_x = _x + step9 ) {
RDebugUtils.currentLine=62128138;
 //BA.debugLineNum = 62128138;BA.debugLine="Dim lum As Int = Bit.And(img.Data(y*img.Width +";
_lum = __c.Bit.And((int) (_img.Data /*byte[]*/ [(int) (_y*_img.Width /*int*/ +_x)]),((int)0xff));
RDebugUtils.currentLine=62128139;
 //BA.debugLineNum = 62128139;BA.debugLine="lum = lum + xerror + yerrors(x)";
_lum = (int) (_lum+_xerror+_yerrors[_x]);
RDebugUtils.currentLine=62128140;
 //BA.debugLineNum = 62128140;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=62128141;
 //BA.debugLineNum = 62128141;BA.debugLine="xerror = lum/2";
_xerror = (int) (_lum/(double)2);
RDebugUtils.currentLine=62128142;
 //BA.debugLineNum = 62128142;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=62128143;
 //BA.debugLineNum = 62128143;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=62128145;
 //BA.debugLineNum = 62128145;BA.debugLine="xerror = (lum - 255)/2";
_xerror = (int) ((_lum-255)/(double)2);
RDebugUtils.currentLine=62128146;
 //BA.debugLineNum = 62128146;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=62128147;
 //BA.debugLineNum = 62128147;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=62128149;
 //BA.debugLineNum = 62128149;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=62128152;
 //BA.debugLineNum = 62128152;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_intmex.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=62128153;
 //BA.debugLineNum = 62128153;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=62128154;
 //BA.debugLineNum = 62128154;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=62128155;
 //BA.debugLineNum = 62128155;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=62128156;
 //BA.debugLineNum = 62128156;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=62128157;
 //BA.debugLineNum = 62128157;BA.debugLine="End Sub";
return null;
}
public String  _filltriangle(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,int _x2,int _y2,byte[][] _points) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "filltriangle", false))
	 {return ((String) Debug.delegate(ba, "filltriangle", new Object[] {_x0,_y0,_x1,_y1,_x2,_y2,_points}));}
int _tx = 0;
int _ty = 0;
double _dx0 = 0;
double _dx1 = 0;
double _dx2 = 0;
double _x3 = 0;
double _x4 = 0;
double _y3 = 0;
double _y4 = 0;
int _inc = 0;
int _x = 0;
RDebugUtils.currentLine=61538304;
 //BA.debugLineNum = 61538304;BA.debugLine="Private Sub FillTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=61538306;
 //BA.debugLineNum = 61538306;BA.debugLine="Dim tx, ty As Int";
_tx = 0;
_ty = 0;
RDebugUtils.currentLine=61538307;
 //BA.debugLineNum = 61538307;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=61538308;
 //BA.debugLineNum = 61538308;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=61538308;
 //BA.debugLineNum = 61538308;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=61538309;
 //BA.debugLineNum = 61538309;BA.debugLine="x0 = x1 : y0 = y1";
_x0 = _x1;
RDebugUtils.currentLine=61538309;
 //BA.debugLineNum = 61538309;BA.debugLine="x0 = x1 : y0 = y1";
_y0 = _y1;
RDebugUtils.currentLine=61538310;
 //BA.debugLineNum = 61538310;BA.debugLine="x1 = tx : y1 = ty";
_x1 = _tx;
RDebugUtils.currentLine=61538310;
 //BA.debugLineNum = 61538310;BA.debugLine="x1 = tx : y1 = ty";
_y1 = _ty;
 };
RDebugUtils.currentLine=61538312;
 //BA.debugLineNum = 61538312;BA.debugLine="If y0 > y2 Then";
if (_y0>_y2) { 
RDebugUtils.currentLine=61538313;
 //BA.debugLineNum = 61538313;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=61538313;
 //BA.debugLineNum = 61538313;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=61538314;
 //BA.debugLineNum = 61538314;BA.debugLine="x0 = x2 : y0 = y2";
_x0 = _x2;
RDebugUtils.currentLine=61538314;
 //BA.debugLineNum = 61538314;BA.debugLine="x0 = x2 : y0 = y2";
_y0 = _y2;
RDebugUtils.currentLine=61538315;
 //BA.debugLineNum = 61538315;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=61538315;
 //BA.debugLineNum = 61538315;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=61538317;
 //BA.debugLineNum = 61538317;BA.debugLine="If y1 > y2 Then";
if (_y1>_y2) { 
RDebugUtils.currentLine=61538318;
 //BA.debugLineNum = 61538318;BA.debugLine="tx = x1 : ty = y1";
_tx = _x1;
RDebugUtils.currentLine=61538318;
 //BA.debugLineNum = 61538318;BA.debugLine="tx = x1 : ty = y1";
_ty = _y1;
RDebugUtils.currentLine=61538319;
 //BA.debugLineNum = 61538319;BA.debugLine="x1 = x2 : y1 = y2";
_x1 = _x2;
RDebugUtils.currentLine=61538319;
 //BA.debugLineNum = 61538319;BA.debugLine="x1 = x2 : y1 = y2";
_y1 = _y2;
RDebugUtils.currentLine=61538320;
 //BA.debugLineNum = 61538320;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=61538320;
 //BA.debugLineNum = 61538320;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=61538323;
 //BA.debugLineNum = 61538323;BA.debugLine="Dim dx0, dx1, dx2 As Double";
_dx0 = 0;
_dx1 = 0;
_dx2 = 0;
RDebugUtils.currentLine=61538324;
 //BA.debugLineNum = 61538324;BA.debugLine="Dim x3, x4, y3, y4 As Double";
_x3 = 0;
_x4 = 0;
_y3 = 0;
_y4 = 0;
RDebugUtils.currentLine=61538325;
 //BA.debugLineNum = 61538325;BA.debugLine="Dim inc As Int";
_inc = 0;
RDebugUtils.currentLine=61538327;
 //BA.debugLineNum = 61538327;BA.debugLine="If y1 - y0 > 0 Then	dx0=(x1-x0)/(y1-y0) Else	dx0=";
if (_y1-_y0>0) { 
_dx0 = (_x1-_x0)/(double)(_y1-_y0);}
else {
_dx0 = 0;};
RDebugUtils.currentLine=61538328;
 //BA.debugLineNum = 61538328;BA.debugLine="If y2 - y0 > 0 Then dx1=(x2-x0)/(y2-y0) Else dx1=";
if (_y2-_y0>0) { 
_dx1 = (_x2-_x0)/(double)(_y2-_y0);}
else {
_dx1 = 0;};
RDebugUtils.currentLine=61538329;
 //BA.debugLineNum = 61538329;BA.debugLine="If y2 - y1 > 0 Then dx2=(x2-x1)/(y2-y1) Else dx2=";
if (_y2-_y1>0) { 
_dx2 = (_x2-_x1)/(double)(_y2-_y1);}
else {
_dx2 = 0;};
RDebugUtils.currentLine=61538330;
 //BA.debugLineNum = 61538330;BA.debugLine="x3 = x0 : x4 = x0";
_x3 = _x0;
RDebugUtils.currentLine=61538330;
 //BA.debugLineNum = 61538330;BA.debugLine="x3 = x0 : x4 = x0";
_x4 = _x0;
RDebugUtils.currentLine=61538331;
 //BA.debugLineNum = 61538331;BA.debugLine="y3 = y0 : y4 = y0";
_y3 = _y0;
RDebugUtils.currentLine=61538331;
 //BA.debugLineNum = 61538331;BA.debugLine="y3 = y0 : y4 = y0";
_y4 = _y0;
RDebugUtils.currentLine=61538332;
 //BA.debugLineNum = 61538332;BA.debugLine="If dx0 > dx1 Then";
if (_dx0>_dx1) { 
RDebugUtils.currentLine=61538333;
 //BA.debugLineNum = 61538333;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=61538334;
 //BA.debugLineNum = 61538334;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=61538335;
 //BA.debugLineNum = 61538335;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=61538336;
 //BA.debugLineNum = 61538336;BA.debugLine="For x = x3 To x4 Step inc";
{
final int step40 = _inc;
final int limit40 = (int) (_x4);
_x = (int) (_x3) ;
for (;(step40 > 0 && _x <= limit40) || (step40 < 0 && _x >= limit40) ;_x = ((int)(0 + _x + step40))  ) {
RDebugUtils.currentLine=61538337;
 //BA.debugLineNum = 61538337;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=61538339;
 //BA.debugLineNum = 61538339;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=61538339;
 //BA.debugLineNum = 61538339;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=61538339;
 //BA.debugLineNum = 61538339;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=61538339;
 //BA.debugLineNum = 61538339;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx0;
 }
;
RDebugUtils.currentLine=61538341;
 //BA.debugLineNum = 61538341;BA.debugLine="x4=x1";
_x4 = _x1;
RDebugUtils.currentLine=61538342;
 //BA.debugLineNum = 61538342;BA.debugLine="y4=y1";
_y4 = _y1;
RDebugUtils.currentLine=61538343;
 //BA.debugLineNum = 61538343;BA.debugLine="Do While y3 <= y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=61538344;
 //BA.debugLineNum = 61538344;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=61538345;
 //BA.debugLineNum = 61538345;BA.debugLine="For x = x3 To x4 Step inc";
{
final int step52 = _inc;
final int limit52 = (int) (_x4);
_x = (int) (_x3) ;
for (;(step52 > 0 && _x <= limit52) || (step52 < 0 && _x >= limit52) ;_x = ((int)(0 + _x + step52))  ) {
RDebugUtils.currentLine=61538346;
 //BA.debugLineNum = 61538346;BA.debugLine="points(x ,y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=61538348;
 //BA.debugLineNum = 61538348;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=61538348;
 //BA.debugLineNum = 61538348;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=61538348;
 //BA.debugLineNum = 61538348;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=61538348;
 //BA.debugLineNum = 61538348;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx2;
 }
;
 }else {
RDebugUtils.currentLine=61538351;
 //BA.debugLineNum = 61538351;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=61538352;
 //BA.debugLineNum = 61538352;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=61538353;
 //BA.debugLineNum = 61538353;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=61538354;
 //BA.debugLineNum = 61538354;BA.debugLine="For x = x3 To x4 Step inc";
{
final int step64 = _inc;
final int limit64 = (int) (_x4);
_x = (int) (_x3) ;
for (;(step64 > 0 && _x <= limit64) || (step64 < 0 && _x >= limit64) ;_x = ((int)(0 + _x + step64))  ) {
RDebugUtils.currentLine=61538355;
 //BA.debugLineNum = 61538355;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=61538357;
 //BA.debugLineNum = 61538357;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=61538357;
 //BA.debugLineNum = 61538357;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=61538357;
 //BA.debugLineNum = 61538357;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x3 = _x3+_dx0;
RDebugUtils.currentLine=61538357;
 //BA.debugLineNum = 61538357;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x4 = _x4+_dx1;
 }
;
RDebugUtils.currentLine=61538359;
 //BA.debugLineNum = 61538359;BA.debugLine="x3=x1";
_x3 = _x1;
RDebugUtils.currentLine=61538360;
 //BA.debugLineNum = 61538360;BA.debugLine="y3=y1";
_y3 = _y1;
RDebugUtils.currentLine=61538361;
 //BA.debugLineNum = 61538361;BA.debugLine="Do While y3<=y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=61538362;
 //BA.debugLineNum = 61538362;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=61538363;
 //BA.debugLineNum = 61538363;BA.debugLine="For x = x3 To x4 Step inc";
{
final int step76 = _inc;
final int limit76 = (int) (_x4);
_x = (int) (_x3) ;
for (;(step76 > 0 && _x <= limit76) || (step76 < 0 && _x >= limit76) ;_x = ((int)(0 + _x + step76))  ) {
RDebugUtils.currentLine=61538364;
 //BA.debugLineNum = 61538364;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=61538366;
 //BA.debugLineNum = 61538366;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=61538366;
 //BA.debugLineNum = 61538366;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=61538366;
 //BA.debugLineNum = 61538366;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x3 = _x3+_dx2;
RDebugUtils.currentLine=61538366;
 //BA.debugLineNum = 61538366;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x4 = _x4+_dx1;
 }
;
 };
RDebugUtils.currentLine=61538369;
 //BA.debugLineNum = 61538369;BA.debugLine="End Sub";
return "";
}
public reparto_intmex.keymon.lat.escposprinter._animage  _imagetobwimage(reparto_intmex.keymon.lat.escposprinter __ref,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _bmp) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "imagetobwimage", false))
	 {return ((reparto_intmex.keymon.lat.escposprinter._animage) Debug.delegate(ba, "imagetobwimage", new Object[] {_bmp}));}
b4a.example.bitmapcreator _bc = null;
int _w = 0;
int _h = 0;
byte[] _pixels = null;
int _y = 0;
int _x = 0;
int _j = 0;
b4a.example.bitmapcreator._argbcolor _col = null;
int _lum = 0;
reparto_intmex.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=61931520;
 //BA.debugLineNum = 61931520;BA.debugLine="Sub ImageToBWIMage(bmp As Bitmap) As AnImage";
RDebugUtils.currentLine=61931521;
 //BA.debugLineNum = 61931521;BA.debugLine="Dim BC As BitmapCreator 'ignore";
_bc = new b4a.example.bitmapcreator();
RDebugUtils.currentLine=61931522;
 //BA.debugLineNum = 61931522;BA.debugLine="Dim W As Int = bmp.Width";
_w = _bmp.getWidth();
RDebugUtils.currentLine=61931523;
 //BA.debugLineNum = 61931523;BA.debugLine="Dim H As Int = bmp.Height";
_h = _bmp.getHeight();
RDebugUtils.currentLine=61931524;
 //BA.debugLineNum = 61931524;BA.debugLine="Dim pixels(W * H) As Byte";
_pixels = new byte[(int) (_w*_h)];
;
RDebugUtils.currentLine=61931526;
 //BA.debugLineNum = 61931526;BA.debugLine="For y = 0 To H - 1";
{
final int step5 = 1;
final int limit5 = (int) (_h-1);
_y = (int) (0) ;
for (;_y <= limit5 ;_y = _y + step5 ) {
RDebugUtils.currentLine=61931527;
 //BA.debugLineNum = 61931527;BA.debugLine="For x = 0 To W - 1";
{
final int step6 = 1;
final int limit6 = (int) (_w-1);
_x = (int) (0) ;
for (;_x <= limit6 ;_x = _x + step6 ) {
RDebugUtils.currentLine=61931528;
 //BA.debugLineNum = 61931528;BA.debugLine="Dim j As Int = bmp.GetPixel(x, y)";
_j = _bmp.GetPixel(_x,_y);
RDebugUtils.currentLine=61931530;
 //BA.debugLineNum = 61931530;BA.debugLine="Dim col As ARGBColor";
_col = new b4a.example.bitmapcreator._argbcolor();
RDebugUtils.currentLine=61931531;
 //BA.debugLineNum = 61931531;BA.debugLine="BC.ColorToARGB(j, col )";
_bc._colortoargb(_j,_col);
RDebugUtils.currentLine=61931532;
 //BA.debugLineNum = 61931532;BA.debugLine="Dim lum As Int = col.r * 0.2 + col.b*0.1 + col.";
_lum = (int) (_col.r*0.2+_col.b*0.1+_col.g*0.7);
RDebugUtils.currentLine=61931533;
 //BA.debugLineNum = 61931533;BA.debugLine="If lum> 255 Then lum = 255";
if (_lum>255) { 
_lum = (int) (255);};
RDebugUtils.currentLine=61931535;
 //BA.debugLineNum = 61931535;BA.debugLine="pixels(y*W + x) = lum";
_pixels[(int) (_y*_w+_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=61931538;
 //BA.debugLineNum = 61931538;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_intmex.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=61931539;
 //BA.debugLineNum = 61931539;BA.debugLine="ret.Width = bmp.Width";
_ret.Width /*int*/  = _bmp.getWidth();
RDebugUtils.currentLine=61931540;
 //BA.debugLineNum = 61931540;BA.debugLine="ret.Height = bmp.Height";
_ret.Height /*int*/  = _bmp.getHeight();
RDebugUtils.currentLine=61931541;
 //BA.debugLineNum = 61931541;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=61931542;
 //BA.debugLineNum = 61931542;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=61931543;
 //BA.debugLineNum = 61931543;BA.debugLine="End Sub";
return null;
}
public boolean  _isbluetoothon(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "isbluetoothon", false))
	 {return ((Boolean) Debug.delegate(ba, "isbluetoothon", null));}
RDebugUtils.currentLine=59768832;
 //BA.debugLineNum = 59768832;BA.debugLine="Public Sub IsBluetoothOn As Boolean";
RDebugUtils.currentLine=59768833;
 //BA.debugLineNum = 59768833;BA.debugLine="Return Serial1.IsEnabled";
if (true) return __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .IsEnabled();
RDebugUtils.currentLine=59768834;
 //BA.debugLineNum = 59768834;BA.debugLine="End Sub";
return false;
}
public reparto_intmex.keymon.lat.escposprinter._animage  _packimage(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _imagedata) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "packimage", false))
	 {return ((reparto_intmex.keymon.lat.escposprinter._animage) Debug.delegate(ba, "packimage", new Object[] {_imagedata}));}
int _xbytes = 0;
byte[] _pixels = null;
byte[] _masks = null;
int _index = 0;
int _y = 0;
int _x = 0;
byte _xbyte = (byte)0;
int _b = 0;
byte _pix = (byte)0;
reparto_intmex.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=62259200;
 //BA.debugLineNum = 62259200;BA.debugLine="Public Sub PackImage(imagedata As AnImage) As AnIm";
RDebugUtils.currentLine=62259201;
 //BA.debugLineNum = 62259201;BA.debugLine="Dim xbytes As Int = imagedata.width/8";
_xbytes = (int) (_imagedata.Width /*int*/ /(double)8);
RDebugUtils.currentLine=62259202;
 //BA.debugLineNum = 62259202;BA.debugLine="Dim pixels(xbytes * imagedata.height) As Byte";
_pixels = new byte[(int) (_xbytes*_imagedata.Height /*int*/ )];
;
RDebugUtils.currentLine=62259203;
 //BA.debugLineNum = 62259203;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=62259204;
 //BA.debugLineNum = 62259204;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=62259205;
 //BA.debugLineNum = 62259205;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=62259206;
 //BA.debugLineNum = 62259206;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=62259207;
 //BA.debugLineNum = 62259207;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=62259208;
 //BA.debugLineNum = 62259208;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=62259209;
 //BA.debugLineNum = 62259209;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=62259210;
 //BA.debugLineNum = 62259210;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=62259211;
 //BA.debugLineNum = 62259211;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=62259212;
 //BA.debugLineNum = 62259212;BA.debugLine="Dim index As Int = 0";
_index = (int) (0);
RDebugUtils.currentLine=62259213;
 //BA.debugLineNum = 62259213;BA.debugLine="For y = 0 To imagedata.Height - 1";
{
final int step13 = 1;
final int limit13 = (int) (_imagedata.Height /*int*/ -1);
_y = (int) (0) ;
for (;_y <= limit13 ;_y = _y + step13 ) {
RDebugUtils.currentLine=62259214;
 //BA.debugLineNum = 62259214;BA.debugLine="For x = 0 To xbytes - 1";
{
final int step14 = 1;
final int limit14 = (int) (_xbytes-1);
_x = (int) (0) ;
for (;_x <= limit14 ;_x = _x + step14 ) {
RDebugUtils.currentLine=62259215;
 //BA.debugLineNum = 62259215;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=62259216;
 //BA.debugLineNum = 62259216;BA.debugLine="For b = 0 To 7";
{
final int step16 = 1;
final int limit16 = (int) (7);
_b = (int) (0) ;
for (;_b <= limit16 ;_b = _b + step16 ) {
RDebugUtils.currentLine=62259218;
 //BA.debugLineNum = 62259218;BA.debugLine="Dim pix As Byte = imagedata.Data(index)";
_pix = _imagedata.Data /*byte[]*/ [_index];
RDebugUtils.currentLine=62259219;
 //BA.debugLineNum = 62259219;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=62259220;
 //BA.debugLineNum = 62259220;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
RDebugUtils.currentLine=62259222;
 //BA.debugLineNum = 62259222;BA.debugLine="index = index + 1";
_index = (int) (_index+1);
 }
};
RDebugUtils.currentLine=62259224;
 //BA.debugLineNum = 62259224;BA.debugLine="pixels(y*xbytes + x) = xbyte";
_pixels[(int) (_y*_xbytes+_x)] = _xbyte;
 }
};
 }
};
RDebugUtils.currentLine=62259227;
 //BA.debugLineNum = 62259227;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_intmex.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=62259228;
 //BA.debugLineNum = 62259228;BA.debugLine="ret.Width = xbytes";
_ret.Width /*int*/  = _xbytes;
RDebugUtils.currentLine=62259229;
 //BA.debugLineNum = 62259229;BA.debugLine="ret.Height = imagedata.Height";
_ret.Height /*int*/  = _imagedata.Height /*int*/ ;
RDebugUtils.currentLine=62259230;
 //BA.debugLineNum = 62259230;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=62259231;
 //BA.debugLineNum = 62259231;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=62259232;
 //BA.debugLineNum = 62259232;BA.debugLine="End Sub";
return null;
}
public byte[]  _packimageslice(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _img,int _slice,boolean _dots24) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "packimageslice", false))
	 {return ((byte[]) Debug.delegate(ba, "packimageslice", new Object[] {_img,_slice,_dots24}));}
int _bytes = 0;
byte[] _pixels = null;
int _slicestart = 0;
byte[] _masks = null;
int _x = 0;
int _s = 0;
byte _xbyte = (byte)0;
int _b = 0;
byte _pix = (byte)0;
RDebugUtils.currentLine=62390272;
 //BA.debugLineNum = 62390272;BA.debugLine="Public Sub PackImageSlice(img As AnImage, slice As";
RDebugUtils.currentLine=62390273;
 //BA.debugLineNum = 62390273;BA.debugLine="Dim bytes As Int = img.width";
_bytes = _img.Width /*int*/ ;
RDebugUtils.currentLine=62390274;
 //BA.debugLineNum = 62390274;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=62390275;
 //BA.debugLineNum = 62390275;BA.debugLine="Dim pixels(bytes * 3) As Byte";
_pixels = new byte[(int) (_bytes*3)];
;
RDebugUtils.currentLine=62390276;
 //BA.debugLineNum = 62390276;BA.debugLine="Dim slicestart As Int = slice * bytes * 8 * 3";
_slicestart = (int) (_slice*_bytes*8*3);
 }else {
RDebugUtils.currentLine=62390278;
 //BA.debugLineNum = 62390278;BA.debugLine="Dim pixels(bytes) As Byte";
_pixels = new byte[_bytes];
;
RDebugUtils.currentLine=62390279;
 //BA.debugLineNum = 62390279;BA.debugLine="Dim slicestart As Int = slice * bytes * 8";
_slicestart = (int) (_slice*_bytes*8);
 };
RDebugUtils.currentLine=62390282;
 //BA.debugLineNum = 62390282;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=62390283;
 //BA.debugLineNum = 62390283;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=62390284;
 //BA.debugLineNum = 62390284;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=62390285;
 //BA.debugLineNum = 62390285;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=62390286;
 //BA.debugLineNum = 62390286;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=62390287;
 //BA.debugLineNum = 62390287;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=62390288;
 //BA.debugLineNum = 62390288;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=62390289;
 //BA.debugLineNum = 62390289;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=62390290;
 //BA.debugLineNum = 62390290;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=62390292;
 //BA.debugLineNum = 62390292;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=62390293;
 //BA.debugLineNum = 62390293;BA.debugLine="For x = 0 To bytes - 1";
{
final int step19 = 1;
final int limit19 = (int) (_bytes-1);
_x = (int) (0) ;
for (;_x <= limit19 ;_x = _x + step19 ) {
RDebugUtils.currentLine=62390294;
 //BA.debugLineNum = 62390294;BA.debugLine="For s = 0 To 2";
{
final int step20 = 1;
final int limit20 = (int) (2);
_s = (int) (0) ;
for (;_s <= limit20 ;_s = _s + step20 ) {
RDebugUtils.currentLine=62390295;
 //BA.debugLineNum = 62390295;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=62390296;
 //BA.debugLineNum = 62390296;BA.debugLine="For b = 0 To 7";
{
final int step22 = 1;
final int limit22 = (int) (7);
_b = (int) (0) ;
for (;_b <= limit22 ;_b = _b + step22 ) {
RDebugUtils.currentLine=62390298;
 //BA.debugLineNum = 62390298;BA.debugLine="Dim pix As Byte = img.Data(slicestart + ((b +";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+((_b+_s*8)*_bytes)+_x)];
RDebugUtils.currentLine=62390299;
 //BA.debugLineNum = 62390299;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=62390300;
 //BA.debugLineNum = 62390300;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=62390303;
 //BA.debugLineNum = 62390303;BA.debugLine="pixels(x*3+s) = xbyte";
_pixels[(int) (_x*3+_s)] = _xbyte;
 }
};
 }
};
 }else {
RDebugUtils.currentLine=62390307;
 //BA.debugLineNum = 62390307;BA.debugLine="For x = 0 To bytes - 1";
{
final int step32 = 1;
final int limit32 = (int) (_bytes-1);
_x = (int) (0) ;
for (;_x <= limit32 ;_x = _x + step32 ) {
RDebugUtils.currentLine=62390308;
 //BA.debugLineNum = 62390308;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=62390309;
 //BA.debugLineNum = 62390309;BA.debugLine="For b = 0 To 7";
{
final int step34 = 1;
final int limit34 = (int) (7);
_b = (int) (0) ;
for (;_b <= limit34 ;_b = _b + step34 ) {
RDebugUtils.currentLine=62390311;
 //BA.debugLineNum = 62390311;BA.debugLine="Dim pix As Byte = img.Data(slicestart + (b * b";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+(_b*_bytes)+_x)];
RDebugUtils.currentLine=62390312;
 //BA.debugLineNum = 62390312;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=62390313;
 //BA.debugLineNum = 62390313;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=62390316;
 //BA.debugLineNum = 62390316;BA.debugLine="pixels(x) = xbyte";
_pixels[_x] = _xbyte;
 }
};
 };
RDebugUtils.currentLine=62390319;
 //BA.debugLineNum = 62390319;BA.debugLine="Return pixels";
if (true) return _pixels;
RDebugUtils.currentLine=62390320;
 //BA.debugLineNum = 62390320;BA.debugLine="End Sub";
return null;
}
public String  _plotlinelow(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,byte[][] _points) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plotlinelow", false))
	 {return ((String) Debug.delegate(ba, "plotlinelow", new Object[] {_x0,_y0,_x1,_y1,_points}));}
int _dx = 0;
int _dy = 0;
int _yi = 0;
int _d = 0;
int _y = 0;
int _x = 0;
RDebugUtils.currentLine=61865984;
 //BA.debugLineNum = 61865984;BA.debugLine="Private Sub	PlotLineLow(x0 As Int, y0 As Int, x1 A";
RDebugUtils.currentLine=61865985;
 //BA.debugLineNum = 61865985;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=61865986;
 //BA.debugLineNum = 61865986;BA.debugLine="Dim dy As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=61865987;
 //BA.debugLineNum = 61865987;BA.debugLine="Dim yi As Int = 1";
_yi = (int) (1);
RDebugUtils.currentLine=61865988;
 //BA.debugLineNum = 61865988;BA.debugLine="If dy < 0 Then";
if (_dy<0) { 
RDebugUtils.currentLine=61865989;
 //BA.debugLineNum = 61865989;BA.debugLine="yi = -1";
_yi = (int) (-1);
RDebugUtils.currentLine=61865990;
 //BA.debugLineNum = 61865990;BA.debugLine="dy = -dy";
_dy = (int) (-_dy);
 };
RDebugUtils.currentLine=61865992;
 //BA.debugLineNum = 61865992;BA.debugLine="Dim D As Int = 2*dy - dx";
_d = (int) (2*_dy-_dx);
RDebugUtils.currentLine=61865993;
 //BA.debugLineNum = 61865993;BA.debugLine="Dim y As Int = y0";
_y = _y0;
RDebugUtils.currentLine=61865994;
 //BA.debugLineNum = 61865994;BA.debugLine="For x = x0 To x1";
{
final int step10 = 1;
final int limit10 = _x1;
_x = _x0 ;
for (;_x <= limit10 ;_x = _x + step10 ) {
RDebugUtils.currentLine=61865995;
 //BA.debugLineNum = 61865995;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=61865996;
 //BA.debugLineNum = 61865996;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=61865997;
 //BA.debugLineNum = 61865997;BA.debugLine="y = y + yi";
_y = (int) (_y+_yi);
RDebugUtils.currentLine=61865998;
 //BA.debugLineNum = 61865998;BA.debugLine="D = D - 2*dx";
_d = (int) (_d-2*_dx);
 };
RDebugUtils.currentLine=61866000;
 //BA.debugLineNum = 61866000;BA.debugLine="D = D + 2*dy";
_d = (int) (_d+2*_dy);
 }
};
RDebugUtils.currentLine=61866002;
 //BA.debugLineNum = 61866002;BA.debugLine="End Sub";
return "";
}
public String  _plotlinehigh(reparto_intmex.keymon.lat.escposprinter __ref,int _x0,int _y0,int _x1,int _y1,byte[][] _points) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "plotlinehigh", false))
	 {return ((String) Debug.delegate(ba, "plotlinehigh", new Object[] {_x0,_y0,_x1,_y1,_points}));}
int _dx = 0;
int _dy = 0;
int _xi = 0;
int _d = 0;
int _x = 0;
int _y = 0;
RDebugUtils.currentLine=61800448;
 //BA.debugLineNum = 61800448;BA.debugLine="Private Sub PlotLineHigh(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=61800449;
 //BA.debugLineNum = 61800449;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=61800450;
 //BA.debugLineNum = 61800450;BA.debugLine="Dim dy  As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=61800451;
 //BA.debugLineNum = 61800451;BA.debugLine="Dim xi As Int = 1";
_xi = (int) (1);
RDebugUtils.currentLine=61800452;
 //BA.debugLineNum = 61800452;BA.debugLine="If dx < 0 Then";
if (_dx<0) { 
RDebugUtils.currentLine=61800453;
 //BA.debugLineNum = 61800453;BA.debugLine="xi = -1";
_xi = (int) (-1);
RDebugUtils.currentLine=61800454;
 //BA.debugLineNum = 61800454;BA.debugLine="dx = -dx";
_dx = (int) (-_dx);
 };
RDebugUtils.currentLine=61800456;
 //BA.debugLineNum = 61800456;BA.debugLine="Dim D As Int = 2*dx - dy";
_d = (int) (2*_dx-_dy);
RDebugUtils.currentLine=61800457;
 //BA.debugLineNum = 61800457;BA.debugLine="Dim x As Int = x0";
_x = _x0;
RDebugUtils.currentLine=61800458;
 //BA.debugLineNum = 61800458;BA.debugLine="For y = y0 To y1";
{
final int step10 = 1;
final int limit10 = _y1;
_y = _y0 ;
for (;_y <= limit10 ;_y = _y + step10 ) {
RDebugUtils.currentLine=61800459;
 //BA.debugLineNum = 61800459;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=61800460;
 //BA.debugLineNum = 61800460;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=61800461;
 //BA.debugLineNum = 61800461;BA.debugLine="x = x + xi";
_x = (int) (_x+_xi);
RDebugUtils.currentLine=61800462;
 //BA.debugLineNum = 61800462;BA.debugLine="D = D - 2*dy";
_d = (int) (_d-2*_dy);
 };
RDebugUtils.currentLine=61800464;
 //BA.debugLineNum = 61800464;BA.debugLine="D = D + 2*dx";
_d = (int) (_d+2*_dx);
 }
};
RDebugUtils.currentLine=61800466;
 //BA.debugLineNum = 61800466;BA.debugLine="End Sub";
return "";
}
public String  _printandfeedpaper(reparto_intmex.keymon.lat.escposprinter __ref,int _units) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "printandfeedpaper", false))
	 {return ((String) Debug.delegate(ba, "printandfeedpaper", new Object[] {_units}));}
byte[] _params = null;
RDebugUtils.currentLine=60030976;
 //BA.debugLineNum = 60030976;BA.debugLine="Public Sub PrintAndFeedPaper(units As Int)";
RDebugUtils.currentLine=60030977;
 //BA.debugLineNum = 60030977;BA.debugLine="WriteString(ESC & \"J\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"J");
RDebugUtils.currentLine=60030978;
 //BA.debugLineNum = 60030978;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=60030979;
 //BA.debugLineNum = 60030979;BA.debugLine="params(0) = units";
_params[(int) (0)] = (byte) (_units);
RDebugUtils.currentLine=60030980;
 //BA.debugLineNum = 60030980;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60030981;
 //BA.debugLineNum = 60030981;BA.debugLine="End Sub";
return "";
}
public int  _printimage(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _img) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "printimage", false))
	 {return ((Integer) Debug.delegate(ba, "printimage", new Object[] {_img}));}
int _xh = 0;
int _xl = 0;
int _yh = 0;
int _yl = 0;
byte[] _params = null;
RDebugUtils.currentLine=62193664;
 //BA.debugLineNum = 62193664;BA.debugLine="Public Sub PrintImage(img As AnImage) As Int";
RDebugUtils.currentLine=62193667;
 //BA.debugLineNum = 62193667;BA.debugLine="If img.width > 72 Then Return -1";
if (_img.Width /*int*/ >72) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=62193668;
 //BA.debugLineNum = 62193668;BA.debugLine="If img.height > 512 Then Return -2";
if (_img.Height /*int*/ >512) { 
if (true) return (int) (-2);};
RDebugUtils.currentLine=62193669;
 //BA.debugLineNum = 62193669;BA.debugLine="If img.data.Length < img.width * img.height Then";
if (_img.Data /*byte[]*/ .length<_img.Width /*int*/ *_img.Height /*int*/ ) { 
if (true) return (int) (-3);};
RDebugUtils.currentLine=62193670;
 //BA.debugLineNum = 62193670;BA.debugLine="Dim xh As Int = img.width / 256";
_xh = (int) (_img.Width /*int*/ /(double)256);
RDebugUtils.currentLine=62193671;
 //BA.debugLineNum = 62193671;BA.debugLine="Dim xl As Int = img.width - xh * 256";
_xl = (int) (_img.Width /*int*/ -_xh*256);
RDebugUtils.currentLine=62193672;
 //BA.debugLineNum = 62193672;BA.debugLine="Dim yh As Int = img.height / 256";
_yh = (int) (_img.Height /*int*/ /(double)256);
RDebugUtils.currentLine=62193673;
 //BA.debugLineNum = 62193673;BA.debugLine="Dim yl As Int = img.height - yh * 256";
_yl = (int) (_img.Height /*int*/ -_yh*256);
RDebugUtils.currentLine=62193674;
 //BA.debugLineNum = 62193674;BA.debugLine="Dim params(5) As Byte";
_params = new byte[(int) (5)];
;
RDebugUtils.currentLine=62193675;
 //BA.debugLineNum = 62193675;BA.debugLine="params(0) = 0 '";
_params[(int) (0)] = (byte) (0);
RDebugUtils.currentLine=62193676;
 //BA.debugLineNum = 62193676;BA.debugLine="params(1) = xl";
_params[(int) (1)] = (byte) (_xl);
RDebugUtils.currentLine=62193677;
 //BA.debugLineNum = 62193677;BA.debugLine="params(2) = xh";
_params[(int) (2)] = (byte) (_xh);
RDebugUtils.currentLine=62193678;
 //BA.debugLineNum = 62193678;BA.debugLine="params(3) = yl";
_params[(int) (3)] = (byte) (_yl);
RDebugUtils.currentLine=62193679;
 //BA.debugLineNum = 62193679;BA.debugLine="params(4) = yh";
_params[(int) (4)] = (byte) (_yh);
RDebugUtils.currentLine=62193680;
 //BA.debugLineNum = 62193680;BA.debugLine="WriteString(GS & \"v0\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"v0");
RDebugUtils.currentLine=62193681;
 //BA.debugLineNum = 62193681;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62193682;
 //BA.debugLineNum = 62193682;BA.debugLine="WriteBytes(img.data)";
__ref._writebytes /*String*/ (null,_img.Data /*byte[]*/ );
RDebugUtils.currentLine=62193683;
 //BA.debugLineNum = 62193683;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=62193684;
 //BA.debugLineNum = 62193684;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=62193685;
 //BA.debugLineNum = 62193685;BA.debugLine="End Sub";
return 0;
}
public int  _printimage2(reparto_intmex.keymon.lat.escposprinter __ref,int _width,byte[] _data,boolean _highdensity,boolean _dotds24) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "printimage2", false))
	 {return ((Integer) Debug.delegate(ba, "printimage2", new Object[] {_width,_data,_highdensity,_dotds24}));}
String _d = "";
int _xh = 0;
int _xl = 0;
byte[] _params = null;
RDebugUtils.currentLine=62324736;
 //BA.debugLineNum = 62324736;BA.debugLine="Public Sub PrintImage2(width As Int, data() As Byt";
RDebugUtils.currentLine=62324737;
 //BA.debugLineNum = 62324737;BA.debugLine="Dim d As String = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=62324738;
 //BA.debugLineNum = 62324738;BA.debugLine="If Not(highdensity) And Not(dotds24 )	 Then";
if (__c.Not(_highdensity) && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=62324739;
 //BA.debugLineNum = 62324739;BA.debugLine="d = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=62324740;
 //BA.debugLineNum = 62324740;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=62324741;
 //BA.debugLineNum = 62324741;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=62324742;
 //BA.debugLineNum = 62324742;BA.debugLine="Else If highdensity And Not(dotds24) 	 Then";
if (_highdensity && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=62324743;
 //BA.debugLineNum = 62324743;BA.debugLine="d = Chr(1)";
_d = BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=62324744;
 //BA.debugLineNum = 62324744;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=62324745;
 //BA.debugLineNum = 62324745;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=62324746;
 //BA.debugLineNum = 62324746;BA.debugLine="Else 	If Not(highdensity) And dotds24 	 Then";
if (__c.Not(_highdensity) && _dotds24) { 
RDebugUtils.currentLine=62324747;
 //BA.debugLineNum = 62324747;BA.debugLine="d = Chr(32)";
_d = BA.ObjectToString(__c.Chr((int) (32)));
RDebugUtils.currentLine=62324748;
 //BA.debugLineNum = 62324748;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=62324749;
 //BA.debugLineNum = 62324749;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }else {
RDebugUtils.currentLine=62324751;
 //BA.debugLineNum = 62324751;BA.debugLine="d = Chr(33)";
_d = BA.ObjectToString(__c.Chr((int) (33)));
RDebugUtils.currentLine=62324752;
 //BA.debugLineNum = 62324752;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=62324753;
 //BA.debugLineNum = 62324753;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }}}
;
RDebugUtils.currentLine=62324755;
 //BA.debugLineNum = 62324755;BA.debugLine="Dim xh As Int = width / 256";
_xh = (int) (_width/(double)256);
RDebugUtils.currentLine=62324756;
 //BA.debugLineNum = 62324756;BA.debugLine="Dim xl As Int = width - xh * 256";
_xl = (int) (_width-_xh*256);
RDebugUtils.currentLine=62324757;
 //BA.debugLineNum = 62324757;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=62324758;
 //BA.debugLineNum = 62324758;BA.debugLine="params(0) = xl";
_params[(int) (0)] = (byte) (_xl);
RDebugUtils.currentLine=62324759;
 //BA.debugLineNum = 62324759;BA.debugLine="params(1) = xh";
_params[(int) (1)] = (byte) (_xh);
RDebugUtils.currentLine=62324760;
 //BA.debugLineNum = 62324760;BA.debugLine="WriteString(ESC & \"*\" & d)";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"*"+_d);
RDebugUtils.currentLine=62324761;
 //BA.debugLineNum = 62324761;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62324762;
 //BA.debugLineNum = 62324762;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=62324763;
 //BA.debugLineNum = 62324763;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=62324764;
 //BA.debugLineNum = 62324764;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=62324765;
 //BA.debugLineNum = 62324765;BA.debugLine="End Sub";
return 0;
}
public String  _reset(reparto_intmex.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "reset", false))
	 {return ((String) Debug.delegate(ba, "reset", null));}
RDebugUtils.currentLine=59965440;
 //BA.debugLineNum = 59965440;BA.debugLine="Public Sub Reset";
RDebugUtils.currentLine=59965441;
 //BA.debugLineNum = 59965441;BA.debugLine="WriteString(ESC & \"@\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"@");
RDebugUtils.currentLine=59965442;
 //BA.debugLineNum = 59965442;BA.debugLine="End Sub";
return "";
}
public String  _serial1_connected(reparto_intmex.keymon.lat.escposprinter __ref,boolean _success) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "serial1_connected", false))
	 {return ((String) Debug.delegate(ba, "serial1_connected", new Object[] {_success}));}
RDebugUtils.currentLine=62914560;
 //BA.debugLineNum = 62914560;BA.debugLine="Private Sub Serial1_Connected (Success As Boolean)";
RDebugUtils.currentLine=62914561;
 //BA.debugLineNum = 62914561;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=62914562;
 //BA.debugLineNum = 62914562;BA.debugLine="Astream.Initialize(Serial1.InputStream, Serial1.";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Initialize(ba,__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .getInputStream(),__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .getOutputStream(),"astream");
RDebugUtils.currentLine=62914563;
 //BA.debugLineNum = 62914563;BA.debugLine="Connected = True";
__ref._connected /*boolean*/  = __c.True;
RDebugUtils.currentLine=62914564;
 //BA.debugLineNum = 62914564;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=62914565;
 //BA.debugLineNum = 62914565;BA.debugLine="Serial1.Listen";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Listen(ba);
 }else {
RDebugUtils.currentLine=62914567;
 //BA.debugLineNum = 62914567;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=62914568;
 //BA.debugLineNum = 62914568;BA.debugLine="ConnectedError = LastException.Message";
__ref._connectederror /*String*/  = __c.LastException(getActivityBA()).getMessage();
 };
RDebugUtils.currentLine=62914570;
 //BA.debugLineNum = 62914570;BA.debugLine="If SubExists(CallBack, EventName & \"_Connected\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected")) { 
RDebugUtils.currentLine=62914571;
 //BA.debugLineNum = 62914571;BA.debugLine="CallSub2(CallBack, EventName & \"_Connected\", Suc";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected",(Object)(_success));
 };
RDebugUtils.currentLine=62914573;
 //BA.debugLineNum = 62914573;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeheight(reparto_intmex.keymon.lat.escposprinter __ref,int _height) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setbarcodeheight", false))
	 {return ((String) Debug.delegate(ba, "setbarcodeheight", new Object[] {_height}));}
byte[] _params = null;
RDebugUtils.currentLine=62455808;
 //BA.debugLineNum = 62455808;BA.debugLine="Public Sub setBarCodeHeight(height As Int)";
RDebugUtils.currentLine=62455809;
 //BA.debugLineNum = 62455809;BA.debugLine="WriteString(GS & \"h\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"h");
RDebugUtils.currentLine=62455810;
 //BA.debugLineNum = 62455810;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=62455811;
 //BA.debugLineNum = 62455811;BA.debugLine="params(0) = height";
_params[(int) (0)] = (byte) (_height);
RDebugUtils.currentLine=62455812;
 //BA.debugLineNum = 62455812;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62455813;
 //BA.debugLineNum = 62455813;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeleft(reparto_intmex.keymon.lat.escposprinter __ref,int _left) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setbarcodeleft", false))
	 {return ((String) Debug.delegate(ba, "setbarcodeleft", new Object[] {_left}));}
byte[] _params = null;
RDebugUtils.currentLine=62521344;
 //BA.debugLineNum = 62521344;BA.debugLine="Public Sub setBarCodeLeft(left As Int)";
RDebugUtils.currentLine=62521345;
 //BA.debugLineNum = 62521345;BA.debugLine="WriteString(GS & \"x\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"x");
RDebugUtils.currentLine=62521346;
 //BA.debugLineNum = 62521346;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=62521347;
 //BA.debugLineNum = 62521347;BA.debugLine="params(0) = left";
_params[(int) (0)] = (byte) (_left);
RDebugUtils.currentLine=62521348;
 //BA.debugLineNum = 62521348;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62521349;
 //BA.debugLineNum = 62521349;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodewidth(reparto_intmex.keymon.lat.escposprinter __ref,int _width) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setbarcodewidth", false))
	 {return ((String) Debug.delegate(ba, "setbarcodewidth", new Object[] {_width}));}
byte[] _params = null;
RDebugUtils.currentLine=62586880;
 //BA.debugLineNum = 62586880;BA.debugLine="Public Sub setBarCodeWidth(width As Int)";
RDebugUtils.currentLine=62586881;
 //BA.debugLineNum = 62586881;BA.debugLine="WriteString(GS & \"w\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"w");
RDebugUtils.currentLine=62586882;
 //BA.debugLineNum = 62586882;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=62586883;
 //BA.debugLineNum = 62586883;BA.debugLine="params(0) = width";
_params[(int) (0)] = (byte) (_width);
RDebugUtils.currentLine=62586884;
 //BA.debugLineNum = 62586884;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62586885;
 //BA.debugLineNum = 62586885;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterfont(reparto_intmex.keymon.lat.escposprinter __ref,int _font) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setcharacterfont", false))
	 {return ((String) Debug.delegate(ba, "setcharacterfont", new Object[] {_font}));}
RDebugUtils.currentLine=60555264;
 //BA.debugLineNum = 60555264;BA.debugLine="Public Sub setCharacterFont(font As Int)";
RDebugUtils.currentLine=60555265;
 //BA.debugLineNum = 60555265;BA.debugLine="WriteString(ESC & \"M\" & Chr(Bit.And(1,font)))";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"M"+BA.ObjectToString(__c.Chr(__c.Bit.And((int) (1),_font))));
RDebugUtils.currentLine=60555266;
 //BA.debugLineNum = 60555266;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterspacing(reparto_intmex.keymon.lat.escposprinter __ref,int _spacing) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setcharacterspacing", false))
	 {return ((String) Debug.delegate(ba, "setcharacterspacing", new Object[] {_spacing}));}
byte[] _params = null;
RDebugUtils.currentLine=60096512;
 //BA.debugLineNum = 60096512;BA.debugLine="Public Sub setCharacterSpacing(spacing As Int)";
RDebugUtils.currentLine=60096513;
 //BA.debugLineNum = 60096513;BA.debugLine="WriteString(ESC & \" \")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +" ");
RDebugUtils.currentLine=60096514;
 //BA.debugLineNum = 60096514;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=60096515;
 //BA.debugLineNum = 60096515;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=60096516;
 //BA.debugLineNum = 60096516;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60096517;
 //BA.debugLineNum = 60096517;BA.debugLine="End Sub";
return "";
}
public String  _setcodepage(reparto_intmex.keymon.lat.escposprinter __ref,int _codepage) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setcodepage", false))
	 {return ((String) Debug.delegate(ba, "setcodepage", new Object[] {_codepage}));}
byte[] _params = null;
RDebugUtils.currentLine=60489728;
 //BA.debugLineNum = 60489728;BA.debugLine="Public Sub setCodePage(codepage As Int)";
RDebugUtils.currentLine=60489729;
 //BA.debugLineNum = 60489729;BA.debugLine="WriteString(ESC & \"t\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"t");
RDebugUtils.currentLine=60489730;
 //BA.debugLineNum = 60489730;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=60489731;
 //BA.debugLineNum = 60489731;BA.debugLine="params(0) = codepage";
_params[(int) (0)] = (byte) (_codepage);
RDebugUtils.currentLine=60489732;
 //BA.debugLineNum = 60489732;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60489733;
 //BA.debugLineNum = 60489733;BA.debugLine="End Sub";
return "";
}
public String  _sethrifont(reparto_intmex.keymon.lat.escposprinter __ref,int _font) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "sethrifont", false))
	 {return ((String) Debug.delegate(ba, "sethrifont", new Object[] {_font}));}
RDebugUtils.currentLine=62717952;
 //BA.debugLineNum = 62717952;BA.debugLine="Public Sub setHriFont(font As Int)";
RDebugUtils.currentLine=62717953;
 //BA.debugLineNum = 62717953;BA.debugLine="WriteString(GS & \"f\" & Chr(font))";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"f"+BA.ObjectToString(__c.Chr(_font)));
RDebugUtils.currentLine=62717954;
 //BA.debugLineNum = 62717954;BA.debugLine="End Sub";
return "";
}
public String  _sethriposn(reparto_intmex.keymon.lat.escposprinter __ref,int _posn) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "sethriposn", false))
	 {return ((String) Debug.delegate(ba, "sethriposn", new Object[] {_posn}));}
byte[] _params = null;
RDebugUtils.currentLine=62652416;
 //BA.debugLineNum = 62652416;BA.debugLine="Public Sub setHriPosn(posn As Int)";
RDebugUtils.currentLine=62652417;
 //BA.debugLineNum = 62652417;BA.debugLine="WriteString(GS & \"H\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"H");
RDebugUtils.currentLine=62652418;
 //BA.debugLineNum = 62652418;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=62652419;
 //BA.debugLineNum = 62652419;BA.debugLine="params(0) = posn";
_params[(int) (0)] = (byte) (_posn);
RDebugUtils.currentLine=62652420;
 //BA.debugLineNum = 62652420;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62652421;
 //BA.debugLineNum = 62652421;BA.debugLine="End Sub";
return "";
}
public String  _setjustify(reparto_intmex.keymon.lat.escposprinter __ref,int _justify) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setjustify", false))
	 {return ((String) Debug.delegate(ba, "setjustify", new Object[] {_justify}));}
RDebugUtils.currentLine=60424192;
 //BA.debugLineNum = 60424192;BA.debugLine="Public Sub setJustify(justify As Int)";
RDebugUtils.currentLine=60424193;
 //BA.debugLineNum = 60424193;BA.debugLine="WriteString(ESC & \"a\" & Chr(justify + 48))";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"a"+BA.ObjectToString(__c.Chr((int) (_justify+48))));
RDebugUtils.currentLine=60424194;
 //BA.debugLineNum = 60424194;BA.debugLine="End Sub";
return "";
}
public String  _setleftinset(reparto_intmex.keymon.lat.escposprinter __ref,int _inset) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setleftinset", false))
	 {return ((String) Debug.delegate(ba, "setleftinset", new Object[] {_inset}));}
int _dh = 0;
int _dl = 0;
byte[] _params = null;
RDebugUtils.currentLine=60162048;
 //BA.debugLineNum = 60162048;BA.debugLine="Public Sub setLeftInset(inset As Int)";
RDebugUtils.currentLine=60162049;
 //BA.debugLineNum = 60162049;BA.debugLine="Dim dh As Int = inset / 256";
_dh = (int) (_inset/(double)256);
RDebugUtils.currentLine=60162050;
 //BA.debugLineNum = 60162050;BA.debugLine="Dim dl As Int = inset - dh";
_dl = (int) (_inset-_dh);
RDebugUtils.currentLine=60162051;
 //BA.debugLineNum = 60162051;BA.debugLine="WriteString(ESC & \"$\" & Chr(dl) & Chr(dh))";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"$"+BA.ObjectToString(__c.Chr(_dl))+BA.ObjectToString(__c.Chr(_dh)));
RDebugUtils.currentLine=60162052;
 //BA.debugLineNum = 60162052;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=60162053;
 //BA.debugLineNum = 60162053;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=60162054;
 //BA.debugLineNum = 60162054;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=60162055;
 //BA.debugLineNum = 60162055;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60162056;
 //BA.debugLineNum = 60162056;BA.debugLine="End Sub";
return "";
}
public String  _setleftmargin(reparto_intmex.keymon.lat.escposprinter __ref,int _margin) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setleftmargin", false))
	 {return ((String) Debug.delegate(ba, "setleftmargin", new Object[] {_margin}));}
int _dh = 0;
int _dl = 0;
byte[] _params = null;
RDebugUtils.currentLine=60227584;
 //BA.debugLineNum = 60227584;BA.debugLine="Public Sub setLeftMargin(margin As Int)";
RDebugUtils.currentLine=60227585;
 //BA.debugLineNum = 60227585;BA.debugLine="Dim dh As Int = margin / 256";
_dh = (int) (_margin/(double)256);
RDebugUtils.currentLine=60227586;
 //BA.debugLineNum = 60227586;BA.debugLine="Dim dl As Int = margin - dh";
_dl = (int) (_margin-_dh);
RDebugUtils.currentLine=60227587;
 //BA.debugLineNum = 60227587;BA.debugLine="WriteString(GS & \"L\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"L");
RDebugUtils.currentLine=60227588;
 //BA.debugLineNum = 60227588;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=60227589;
 //BA.debugLineNum = 60227589;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=60227590;
 //BA.debugLineNum = 60227590;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=60227591;
 //BA.debugLineNum = 60227591;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60227592;
 //BA.debugLineNum = 60227592;BA.debugLine="End Sub";
return "";
}
public String  _setlinespacing(reparto_intmex.keymon.lat.escposprinter __ref,int _spacing) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setlinespacing", false))
	 {return ((String) Debug.delegate(ba, "setlinespacing", new Object[] {_spacing}));}
byte[] _params = null;
RDebugUtils.currentLine=60358656;
 //BA.debugLineNum = 60358656;BA.debugLine="Public Sub setLineSpacing(spacing As Int)";
RDebugUtils.currentLine=60358657;
 //BA.debugLineNum = 60358657;BA.debugLine="If spacing < 0 Then";
if (_spacing<0) { 
RDebugUtils.currentLine=60358658;
 //BA.debugLineNum = 60358658;BA.debugLine="WriteString(ESC & \"2\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"2");
 }else {
RDebugUtils.currentLine=60358660;
 //BA.debugLineNum = 60358660;BA.debugLine="WriteString(ESC & \"3\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"3");
RDebugUtils.currentLine=60358661;
 //BA.debugLineNum = 60358661;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=60358662;
 //BA.debugLineNum = 60358662;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=60358663;
 //BA.debugLineNum = 60358663;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
 };
RDebugUtils.currentLine=60358665;
 //BA.debugLineNum = 60358665;BA.debugLine="End Sub";
return "";
}
public String  _setprintwidth(reparto_intmex.keymon.lat.escposprinter __ref,int _width) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setprintwidth", false))
	 {return ((String) Debug.delegate(ba, "setprintwidth", new Object[] {_width}));}
int _dh = 0;
int _dl = 0;
byte[] _params = null;
RDebugUtils.currentLine=60293120;
 //BA.debugLineNum = 60293120;BA.debugLine="Public Sub setPrintWidth(width As Int)";
RDebugUtils.currentLine=60293121;
 //BA.debugLineNum = 60293121;BA.debugLine="Dim dh As Int = width / 256";
_dh = (int) (_width/(double)256);
RDebugUtils.currentLine=60293122;
 //BA.debugLineNum = 60293122;BA.debugLine="Dim dl As Int = width - dh";
_dl = (int) (_width-_dh);
RDebugUtils.currentLine=60293123;
 //BA.debugLineNum = 60293123;BA.debugLine="WriteString(GS & \"W\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"W");
RDebugUtils.currentLine=60293124;
 //BA.debugLineNum = 60293124;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=60293125;
 //BA.debugLineNum = 60293125;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=60293126;
 //BA.debugLineNum = 60293126;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=60293127;
 //BA.debugLineNum = 60293127;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60293128;
 //BA.debugLineNum = 60293128;BA.debugLine="End Sub";
return "";
}
public String  _setrelativeprintposn(reparto_intmex.keymon.lat.escposprinter __ref,int _relposn) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setrelativeprintposn", false))
	 {return ((String) Debug.delegate(ba, "setrelativeprintposn", new Object[] {_relposn}));}
int _dh = 0;
int _dl = 0;
byte[] _params = null;
RDebugUtils.currentLine=60686336;
 //BA.debugLineNum = 60686336;BA.debugLine="Public Sub setRelativePrintPosn(relposn As Int)";
RDebugUtils.currentLine=60686337;
 //BA.debugLineNum = 60686337;BA.debugLine="Dim dh As Int = relposn / 256";
_dh = (int) (_relposn/(double)256);
RDebugUtils.currentLine=60686338;
 //BA.debugLineNum = 60686338;BA.debugLine="Dim dl As Int = relposn - dh";
_dl = (int) (_relposn-_dh);
RDebugUtils.currentLine=60686339;
 //BA.debugLineNum = 60686339;BA.debugLine="WriteString(ESC & \"\\\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"\\");
RDebugUtils.currentLine=60686340;
 //BA.debugLineNum = 60686340;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=60686341;
 //BA.debugLineNum = 60686341;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=60686342;
 //BA.debugLineNum = 60686342;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=60686343;
 //BA.debugLineNum = 60686343;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=60686344;
 //BA.debugLineNum = 60686344;BA.debugLine="End Sub";
return "";
}
public String  _settabpositions(reparto_intmex.keymon.lat.escposprinter __ref,int[] _tabs) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "settabpositions", false))
	 {return ((String) Debug.delegate(ba, "settabpositions", new Object[] {_tabs}));}
byte[] _data = null;
int _i = 0;
RDebugUtils.currentLine=60620800;
 //BA.debugLineNum = 60620800;BA.debugLine="Public Sub setTabPositions(tabs() As Int)";
RDebugUtils.currentLine=60620801;
 //BA.debugLineNum = 60620801;BA.debugLine="WriteString(ESC & \"D\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"D");
RDebugUtils.currentLine=60620802;
 //BA.debugLineNum = 60620802;BA.debugLine="Dim data(tabs.Length+1) As Byte";
_data = new byte[(int) (_tabs.length+1)];
;
RDebugUtils.currentLine=60620803;
 //BA.debugLineNum = 60620803;BA.debugLine="For i = 0 To tabs.Length - 1";
{
final int step3 = 1;
final int limit3 = (int) (_tabs.length-1);
_i = (int) (0) ;
for (;_i <= limit3 ;_i = _i + step3 ) {
RDebugUtils.currentLine=60620804;
 //BA.debugLineNum = 60620804;BA.debugLine="data(i) = tabs(i)";
_data[_i] = (byte) (_tabs[_i]);
 }
};
RDebugUtils.currentLine=60620806;
 //BA.debugLineNum = 60620806;BA.debugLine="data(tabs.Length) = 0";
_data[_tabs.length] = (byte) (0);
RDebugUtils.currentLine=60620807;
 //BA.debugLineNum = 60620807;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=60620808;
 //BA.debugLineNum = 60620808;BA.debugLine="End Sub";
return "";
}
public String  _setusecustomcharacters(reparto_intmex.keymon.lat.escposprinter __ref,boolean _custom) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "setusecustomcharacters", false))
	 {return ((String) Debug.delegate(ba, "setusecustomcharacters", new Object[] {_custom}));}
RDebugUtils.currentLine=61014016;
 //BA.debugLineNum = 61014016;BA.debugLine="Public Sub setUseCustomCharacters(custom As Boolea";
RDebugUtils.currentLine=61014017;
 //BA.debugLineNum = 61014017;BA.debugLine="If custom Then";
if (_custom) { 
RDebugUtils.currentLine=61014018;
 //BA.debugLineNum = 61014018;BA.debugLine="WriteString(ESC & \"%1\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%1");
 }else {
RDebugUtils.currentLine=61014020;
 //BA.debugLineNum = 61014020;BA.debugLine="WriteString(ESC & \"%0\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%0");
 };
RDebugUtils.currentLine=61014022;
 //BA.debugLineNum = 61014022;BA.debugLine="End Sub";
return "";
}
public reparto_intmex.keymon.lat.escposprinter._animage  _thresholdimage(reparto_intmex.keymon.lat.escposprinter __ref,reparto_intmex.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "thresholdimage", false))
	 {return ((reparto_intmex.keymon.lat.escposprinter._animage) Debug.delegate(ba, "thresholdimage", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _i = 0;
int _lum = 0;
reparto_intmex.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=61997056;
 //BA.debugLineNum = 61997056;BA.debugLine="Sub ThresholdImage(img As AnImage, threshold As In";
RDebugUtils.currentLine=61997057;
 //BA.debugLineNum = 61997057;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=61997058;
 //BA.debugLineNum = 61997058;BA.debugLine="For i = 0 To pixels.Length - 1";
{
final int step2 = 1;
final int limit2 = (int) (_pixels.length-1);
_i = (int) (0) ;
for (;_i <= limit2 ;_i = _i + step2 ) {
RDebugUtils.currentLine=61997059;
 //BA.debugLineNum = 61997059;BA.debugLine="Dim lum As Int = Bit.And(img.Data(i), 0xff) ' by";
_lum = __c.Bit.And((int) (_img.Data /*byte[]*/ [_i]),((int)0xff));
RDebugUtils.currentLine=61997060;
 //BA.debugLineNum = 61997060;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=61997061;
 //BA.debugLineNum = 61997061;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=61997063;
 //BA.debugLineNum = 61997063;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=61997065;
 //BA.debugLineNum = 61997065;BA.debugLine="pixels(i) = lum";
_pixels[_i] = (byte) (_lum);
 }
};
RDebugUtils.currentLine=61997067;
 //BA.debugLineNum = 61997067;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_intmex.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=61997068;
 //BA.debugLineNum = 61997068;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=61997069;
 //BA.debugLineNum = 61997069;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=61997070;
 //BA.debugLineNum = 61997070;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=61997071;
 //BA.debugLineNum = 61997071;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=61997072;
 //BA.debugLineNum = 61997072;BA.debugLine="End Sub";
return null;
}
public String  _writebarcode(reparto_intmex.keymon.lat.escposprinter __ref,String _bartype,String _data) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "writebarcode", false))
	 {return ((String) Debug.delegate(ba, "writebarcode", new Object[] {_bartype,_data}));}
byte[] _databytes = null;
int _dlow = 0;
byte[] _params = null;
RDebugUtils.currentLine=62783488;
 //BA.debugLineNum = 62783488;BA.debugLine="Public Sub WriteBarCode(bartype As String, data As";
RDebugUtils.currentLine=62783489;
 //BA.debugLineNum = 62783489;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ASCII\")";
_databytes = _data.getBytes("ASCII");
RDebugUtils.currentLine=62783490;
 //BA.debugLineNum = 62783490;BA.debugLine="Dim dlow As Int = databytes.Length";
_dlow = _databytes.length;
RDebugUtils.currentLine=62783491;
 //BA.debugLineNum = 62783491;BA.debugLine="Log(\"Barcode \" & bartype & \", Size \" & dlow & \",";
__c.LogImpl("262783491","Barcode "+_bartype+", Size "+BA.NumberToString(_dlow)+", "+_data,0);
RDebugUtils.currentLine=62783492;
 //BA.debugLineNum = 62783492;BA.debugLine="WriteString(GS & \"k\" & bartype.ToUpperCase.CharAt";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"k"+BA.ObjectToString(_bartype.toUpperCase().charAt((int) (0))));
RDebugUtils.currentLine=62783493;
 //BA.debugLineNum = 62783493;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=62783494;
 //BA.debugLineNum = 62783494;BA.debugLine="params(0) = dlow";
_params[(int) (0)] = (byte) (_dlow);
RDebugUtils.currentLine=62783495;
 //BA.debugLineNum = 62783495;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62783496;
 //BA.debugLineNum = 62783496;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=62783497;
 //BA.debugLineNum = 62783497;BA.debugLine="End Sub";
return "";
}
public String  _writeqrcode(reparto_intmex.keymon.lat.escposprinter __ref,int _size,String _ec,int _scale,String _data) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "writeqrcode", false))
	 {return ((String) Debug.delegate(ba, "writeqrcode", new Object[] {_size,_ec,_scale,_data}));}
byte[] _databytes = null;
int _dhigh = 0;
int _dlow = 0;
byte[] _params = null;
RDebugUtils.currentLine=62849024;
 //BA.debugLineNum = 62849024;BA.debugLine="Public Sub WriteQRCode(size As Int, EC As String,";
RDebugUtils.currentLine=62849025;
 //BA.debugLineNum = 62849025;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ISO-8859";
_databytes = _data.getBytes("ISO-8859-1");
RDebugUtils.currentLine=62849026;
 //BA.debugLineNum = 62849026;BA.debugLine="Dim dhigh As Int = databytes.Length / 256";
_dhigh = (int) (_databytes.length/(double)256);
RDebugUtils.currentLine=62849027;
 //BA.debugLineNum = 62849027;BA.debugLine="Dim dlow As Int = databytes.Length - dhigh*256";
_dlow = (int) (_databytes.length-_dhigh*256);
RDebugUtils.currentLine=62849028;
 //BA.debugLineNum = 62849028;BA.debugLine="Log(\"QR Code : Size \" & size & \", EC \" & EC & \",";
__c.LogImpl("262849028","QR Code : Size "+BA.NumberToString(_size)+", EC "+_ec+", Scale "+BA.NumberToString(_scale)+", Size "+BA.NumberToString(_dlow)+" "+BA.NumberToString(_dhigh)+" : Data = "+_data,0);
RDebugUtils.currentLine=62849029;
 //BA.debugLineNum = 62849029;BA.debugLine="Dim params(3) As Byte";
_params = new byte[(int) (3)];
;
RDebugUtils.currentLine=62849030;
 //BA.debugLineNum = 62849030;BA.debugLine="params(0) = scale";
_params[(int) (0)] = (byte) (_scale);
RDebugUtils.currentLine=62849031;
 //BA.debugLineNum = 62849031;BA.debugLine="params(1) = dlow";
_params[(int) (1)] = (byte) (_dlow);
RDebugUtils.currentLine=62849032;
 //BA.debugLineNum = 62849032;BA.debugLine="params(2) = dhigh";
_params[(int) (2)] = (byte) (_dhigh);
RDebugUtils.currentLine=62849033;
 //BA.debugLineNum = 62849033;BA.debugLine="WriteString(ESC & \"Z\" & Chr(size) & EC.ToUpperCas";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"Z"+BA.ObjectToString(__c.Chr(_size))+BA.ObjectToString(_ec.toUpperCase().charAt((int) (0))));
RDebugUtils.currentLine=62849034;
 //BA.debugLineNum = 62849034;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=62849035;
 //BA.debugLineNum = 62849035;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=62849036;
 //BA.debugLineNum = 62849036;BA.debugLine="End Sub";
return "";
}
public String  _writestring2(reparto_intmex.keymon.lat.escposprinter __ref,String _data,String _encoding) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "writestring2", false))
	 {return ((String) Debug.delegate(ba, "writestring2", new Object[] {_data,_encoding}));}
RDebugUtils.currentLine=60882944;
 //BA.debugLineNum = 60882944;BA.debugLine="Public Sub WriteString2(data As String, encoding A";
RDebugUtils.currentLine=60882945;
 //BA.debugLineNum = 60882945;BA.debugLine="Try";
try {RDebugUtils.currentLine=60882946;
 //BA.debugLineNum = 60882946;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=60882947;
 //BA.debugLineNum = 60882947;BA.debugLine="Astream.Write(data.GetBytes(encoding))";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Write(_data.getBytes(_encoding));
 };
 } 
       catch (Exception e6) {
			ba.setLastException(e6);RDebugUtils.currentLine=60882950;
 //BA.debugLineNum = 60882950;BA.debugLine="Log(\"Printer error : \" & LastException.Message)";
__c.LogImpl("260882950","Printer error : "+__c.LastException(getActivityBA()).getMessage(),0);
RDebugUtils.currentLine=60882951;
 //BA.debugLineNum = 60882951;BA.debugLine="AStream_Error";
__ref._astream_error /*String*/ (null);
 };
RDebugUtils.currentLine=60882953;
 //BA.debugLineNum = 60882953;BA.debugLine="End Sub";
return "";
}
}