package reparto_mazapa.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_mazapa.keymon.lat.escposprinter");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", reparto_mazapa.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_mazapa.keymon.lat.main _main = null;
public reparto_mazapa.keymon.lat.appupdater _appupdater = null;
public reparto_mazapa.keymon.lat.tracker _tracker = null;
public reparto_mazapa.keymon.lat.starter _starter = null;
public reparto_mazapa.keymon.lat.subs _subs = null;
public reparto_mazapa.keymon.lat.firebasemessaging _firebasemessaging = null;
public reparto_mazapa.keymon.lat.foto _foto = null;
public reparto_mazapa.keymon.lat.mapa_cliente _mapa_cliente = null;
public reparto_mazapa.keymon.lat.mapa_rutas _mapa_rutas = null;
public reparto_mazapa.keymon.lat.newinst2 _newinst2 = null;
public reparto_mazapa.keymon.lat.b4xpages _b4xpages = null;
public reparto_mazapa.keymon.lat.b4xcollections _b4xcollections = null;
public reparto_mazapa.keymon.lat.httputils2service _httputils2service = null;
public reparto_mazapa.keymon.lat.xuiviewsutils _xuiviewsutils = null;
public String  _initialize(reparto_mazapa.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=65667072;
 //BA.debugLineNum = 65667072;BA.debugLine="Public Sub Initialize(vCallback As Object, vEventN";
RDebugUtils.currentLine=65667073;
 //BA.debugLineNum = 65667073;BA.debugLine="EventName = vEventName";
__ref._eventname /*String*/  = _veventname;
RDebugUtils.currentLine=65667074;
 //BA.debugLineNum = 65667074;BA.debugLine="CallBack = vCallback";
__ref._callback /*Object*/  = _vcallback;
RDebugUtils.currentLine=65667075;
 //BA.debugLineNum = 65667075;BA.debugLine="Serial1.Initialize(\"Serial1\")";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Initialize("Serial1");
RDebugUtils.currentLine=65667076;
 //BA.debugLineNum = 65667076;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=65667077;
 //BA.debugLineNum = 65667077;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=65667078;
 //BA.debugLineNum = 65667078;BA.debugLine="End Sub";
return "";
}
public boolean  _isconnected(reparto_mazapa.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=65798144;
 //BA.debugLineNum = 65798144;BA.debugLine="Public Sub IsConnected As Boolean";
RDebugUtils.currentLine=65798145;
 //BA.debugLineNum = 65798145;BA.debugLine="Return Connected";
if (true) return __ref._connected /*boolean*/ ;
RDebugUtils.currentLine=65798146;
 //BA.debugLineNum = 65798146;BA.debugLine="End Sub";
return false;
}
public String  _disconnect(reparto_mazapa.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=65994752;
 //BA.debugLineNum = 65994752;BA.debugLine="Public Sub DisConnect";
RDebugUtils.currentLine=65994753;
 //BA.debugLineNum = 65994753;BA.debugLine="Serial1.Disconnect";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
RDebugUtils.currentLine=65994754;
 //BA.debugLineNum = 65994754;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=65994755;
 //BA.debugLineNum = 65994755;BA.debugLine="End Sub";
return "";
}
public boolean  _connect(reparto_mazapa.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=65929216;
 //BA.debugLineNum = 65929216;BA.debugLine="Public Sub Connect As Boolean";
RDebugUtils.currentLine=65929220;
 //BA.debugLineNum = 65929220;BA.debugLine="Try";
try {RDebugUtils.currentLine=65929221;
 //BA.debugLineNum = 65929221;BA.debugLine="If Starter.MAC_IMPRESORA = \"0\" Then";
if ((_starter._mac_impresora /*String*/ ).equals("0")) { 
RDebugUtils.currentLine=65929222;
 //BA.debugLineNum = 65929222;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=65929223;
 //BA.debugLineNum = 65929223;BA.debugLine="PairedDevices = Serial1.GetPairedDevices";
_paireddevices = __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .GetPairedDevices();
RDebugUtils.currentLine=65929224;
 //BA.debugLineNum = 65929224;BA.debugLine="Dim l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=65929225;
 //BA.debugLineNum = 65929225;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=65929226;
 //BA.debugLineNum = 65929226;BA.debugLine="Log(\"aqui 1\")";
__c.LogImpl("365929226","aqui 1",0);
RDebugUtils.currentLine=65929227;
 //BA.debugLineNum = 65929227;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=65929228;
 //BA.debugLineNum = 65929228;BA.debugLine="l.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
RDebugUtils.currentLine=65929229;
 //BA.debugLineNum = 65929229;BA.debugLine="Log(\"aqui 2\")";
__c.LogImpl("365929229","aqui 2",0);
RDebugUtils.currentLine=65929230;
 //BA.debugLineNum = 65929230;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
 }
};
RDebugUtils.currentLine=65929232;
 //BA.debugLineNum = 65929232;BA.debugLine="Dim Res As Int";
_res = 0;
RDebugUtils.currentLine=65929233;
 //BA.debugLineNum = 65929233;BA.debugLine="Res = InputList(l, \"Choose a printer\", -1) 'sho";
_res = __c.InputList(_l,BA.ObjectToCharSequence("Choose a printer"),(int) (-1),getActivityBA());
RDebugUtils.currentLine=65929234;
 //BA.debugLineNum = 65929234;BA.debugLine="If Res <> DialogResponse.CANCEL Then";
if (_res!=__c.DialogResponse.CANCEL) { 
RDebugUtils.currentLine=65929235;
 //BA.debugLineNum = 65929235;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=65929237;
 //BA.debugLineNum = 65929237;BA.debugLine="Starter.mac_impresora = PairedDevices.Get(l.Ge";
_starter._mac_impresora /*String*/  = BA.ObjectToString(_paireddevices.Get(_l.Get(_res)));
RDebugUtils.currentLine=65929238;
 //BA.debugLineNum = 65929238;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=65929239;
 //BA.debugLineNum = 65929239;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=65929240;
 //BA.debugLineNum = 65929240;BA.debugLine="Log(\"aqui 3\")";
__c.LogImpl("365929240","aqui 3",0);
 };
RDebugUtils.currentLine=65929242;
 //BA.debugLineNum = 65929242;BA.debugLine="Log(\"aqui 4\")";
__c.LogImpl("365929242","aqui 4",0);
RDebugUtils.currentLine=65929243;
 //BA.debugLineNum = 65929243;BA.debugLine="Return False";
if (true) return __c.False;
 }else {
RDebugUtils.currentLine=65929245;
 //BA.debugLineNum = 65929245;BA.debugLine="Serial1.Connect(Starter.mac_impresora)";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,_starter._mac_impresora /*String*/ );
RDebugUtils.currentLine=65929247;
 //BA.debugLineNum = 65929247;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=65929248;
 //BA.debugLineNum = 65929248;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=65929249;
 //BA.debugLineNum = 65929249;BA.debugLine="Log(\"aqui 5\")";
__c.LogImpl("365929249","aqui 5",0);
 };
 } 
       catch (Exception e31) {
			ba.setLastException(e31);RDebugUtils.currentLine=65929252;
 //BA.debugLineNum = 65929252;BA.debugLine="Log(LastException)";
__c.LogImpl("365929252",BA.ObjectToString(__c.LastException(getActivityBA())),0);
RDebugUtils.currentLine=65929253;
 //BA.debugLineNum = 65929253;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=65929255;
 //BA.debugLineNum = 65929255;BA.debugLine="End Sub";
return false;
}
public String  _astream_error(reparto_mazapa.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=69140480;
 //BA.debugLineNum = 69140480;BA.debugLine="Private Sub AStream_Error";
RDebugUtils.currentLine=69140481;
 //BA.debugLineNum = 69140481;BA.debugLine="If SubExists(CallBack, EventName & \"_Error\") Then";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error")) { 
RDebugUtils.currentLine=69140482;
 //BA.debugLineNum = 69140482;BA.debugLine="CallSub(CallBack, EventName & \"_Error\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error");
 };
RDebugUtils.currentLine=69140484;
 //BA.debugLineNum = 69140484;BA.debugLine="End Sub";
return "";
}
public String  _astream_newdata(reparto_mazapa.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=69074944;
 //BA.debugLineNum = 69074944;BA.debugLine="Private Sub AStream_NewData (Buffer() As Byte)";
RDebugUtils.currentLine=69074945;
 //BA.debugLineNum = 69074945;BA.debugLine="If SubExists(CallBack, EventName & \"_NewData\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData")) { 
RDebugUtils.currentLine=69074946;
 //BA.debugLineNum = 69074946;BA.debugLine="CallSub2(CallBack, EventName & \"_NewData\", Buffe";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData",(Object)(_buffer));
 };
RDebugUtils.currentLine=69074948;
 //BA.debugLineNum = 69074948;BA.debugLine="Log(\"Data \" & Buffer(0))";
__c.LogImpl("369074948","Data "+BA.NumberToString(_buffer[(int) (0)]),0);
RDebugUtils.currentLine=69074949;
 //BA.debugLineNum = 69074949;BA.debugLine="End Sub";
return "";
}
public String  _astream_terminated(reparto_mazapa.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=69206016;
 //BA.debugLineNum = 69206016;BA.debugLine="Private Sub AStream_Terminated";
RDebugUtils.currentLine=69206017;
 //BA.debugLineNum = 69206017;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=69206018;
 //BA.debugLineNum = 69206018;BA.debugLine="If SubExists(CallBack, EventName & \"_Terminated\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated")) { 
RDebugUtils.currentLine=69206019;
 //BA.debugLineNum = 69206019;BA.debugLine="CallSub(CallBack, EventName & \"_Terminated\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated");
 };
RDebugUtils.currentLine=69206021;
 //BA.debugLineNum = 69206021;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(reparto_mazapa.keymon.lat.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
RDebugUtils.currentLine=65601536;
 //BA.debugLineNum = 65601536;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=65601543;
 //BA.debugLineNum = 65601543;BA.debugLine="Private Version As Double = 2.0 ' Printer class v";
_version = 2.0;
RDebugUtils.currentLine=65601545;
 //BA.debugLineNum = 65601545;BA.debugLine="Type AnImage(Width As Int, Height As Int, Data()";
;
RDebugUtils.currentLine=65601547;
 //BA.debugLineNum = 65601547;BA.debugLine="Private EventName As String 'ignore";
_eventname = "";
RDebugUtils.currentLine=65601548;
 //BA.debugLineNum = 65601548;BA.debugLine="Private CallBack As Object 'ignore";
_callback = new Object();
RDebugUtils.currentLine=65601550;
 //BA.debugLineNum = 65601550;BA.debugLine="Private Serial1 As Serial";
_serial1 = new anywheresoftware.b4a.objects.Serial();
RDebugUtils.currentLine=65601551;
 //BA.debugLineNum = 65601551;BA.debugLine="Private Astream As AsyncStreams";
_astream = new anywheresoftware.b4a.randomaccessfile.AsyncStreams();
RDebugUtils.currentLine=65601552;
 //BA.debugLineNum = 65601552;BA.debugLine="Private Connected As Boolean";
_connected = false;
RDebugUtils.currentLine=65601553;
 //BA.debugLineNum = 65601553;BA.debugLine="Private ConnectedError As String";
_connectederror = "";
RDebugUtils.currentLine=65601555;
 //BA.debugLineNum = 65601555;BA.debugLine="Dim ESC As String = Chr(27)";
_esc = BA.ObjectToString(__c.Chr((int) (27)));
RDebugUtils.currentLine=65601556;
 //BA.debugLineNum = 65601556;BA.debugLine="Dim FS As String = Chr(28)";
_fs = BA.ObjectToString(__c.Chr((int) (28)));
RDebugUtils.currentLine=65601557;
 //BA.debugLineNum = 65601557;BA.debugLine="Dim GS As String = Chr(29)";
_gs = BA.ObjectToString(__c.Chr((int) (29)));
RDebugUtils.currentLine=65601560;
 //BA.debugLineNum = 65601560;BA.debugLine="Dim UNREVERSE As String  = GS & \"B\" & Chr(0)";
_unreverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=65601561;
 //BA.debugLineNum = 65601561;BA.debugLine="Dim REVERSE As String = GS & \"B\" & Chr(1)";
_reverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=65601564;
 //BA.debugLineNum = 65601564;BA.debugLine="Dim UNINVERT As String = ESC & \"{0\"";
_uninvert = __ref._esc /*String*/ +"{0";
RDebugUtils.currentLine=65601565;
 //BA.debugLineNum = 65601565;BA.debugLine="Dim INVERT As String = ESC & \"{1\"";
_invert = __ref._esc /*String*/ +"{1";
RDebugUtils.currentLine=65601568;
 //BA.debugLineNum = 65601568;BA.debugLine="Dim UNROTATE As String = ESC & \"V0\"";
_unrotate = __ref._esc /*String*/ +"V0";
RDebugUtils.currentLine=65601569;
 //BA.debugLineNum = 65601569;BA.debugLine="Dim ROTATE As String = ESC & \"V1\"";
_rotate = __ref._esc /*String*/ +"V1";
RDebugUtils.currentLine=65601572;
 //BA.debugLineNum = 65601572;BA.debugLine="Dim HT As String = Chr(9)";
_ht = BA.ObjectToString(__c.Chr((int) (9)));
RDebugUtils.currentLine=65601575;
 //BA.debugLineNum = 65601575;BA.debugLine="Dim ULINE0 As String = ESC & \"-0\"";
_uline0 = __ref._esc /*String*/ +"-0";
RDebugUtils.currentLine=65601576;
 //BA.debugLineNum = 65601576;BA.debugLine="Dim ULINE1 As String = ESC & \"-1\"";
_uline1 = __ref._esc /*String*/ +"-1";
RDebugUtils.currentLine=65601577;
 //BA.debugLineNum = 65601577;BA.debugLine="Dim ULINE2 As String = ESC & \"-2\"";
_uline2 = __ref._esc /*String*/ +"-2";
RDebugUtils.currentLine=65601580;
 //BA.debugLineNum = 65601580;BA.debugLine="Dim BOLD As String = ESC & \"E1\"";
_bold = __ref._esc /*String*/ +"E1";
RDebugUtils.currentLine=65601581;
 //BA.debugLineNum = 65601581;BA.debugLine="Dim NOBOLD As String = ESC & \"E0\"";
_nobold = __ref._esc /*String*/ +"E0";
RDebugUtils.currentLine=65601584;
 //BA.debugLineNum = 65601584;BA.debugLine="Dim SINGLE As String = GS & \"!\" & Chr(0x00)";
_single = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x00)));
RDebugUtils.currentLine=65601585;
 //BA.debugLineNum = 65601585;BA.debugLine="Dim HIGH As String = GS & \"!\" & Chr(0x01)";
_high = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x01)));
RDebugUtils.currentLine=65601586;
 //BA.debugLineNum = 65601586;BA.debugLine="Dim WIDE As String = GS & \"!\" & Chr(0x10)";
_wide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x10)));
RDebugUtils.currentLine=65601587;
 //BA.debugLineNum = 65601587;BA.debugLine="Dim HIGHWIDE As String = GS & \"!\" & Chr(0x11)";
_highwide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x11)));
RDebugUtils.currentLine=65601590;
 //BA.debugLineNum = 65601590;BA.debugLine="Private LEFTJUSTIFY As String = ESC & \"a0\"";
_leftjustify = __ref._esc /*String*/ +"a0";
RDebugUtils.currentLine=65601591;
 //BA.debugLineNum = 65601591;BA.debugLine="Private LINEDEFAULT As String = ESC & \"2\"";
_linedefault = __ref._esc /*String*/ +"2";
RDebugUtils.currentLine=65601592;
 //BA.debugLineNum = 65601592;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=65601593;
 //BA.debugLineNum = 65601593;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=65601594;
 //BA.debugLineNum = 65601594;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=65601595;
 //BA.debugLineNum = 65601595;BA.debugLine="Private CHARSPACING0 As String = ESC & \" \" & Chr(";
_charspacing0 = __ref._esc /*String*/ +" "+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=65601596;
 //BA.debugLineNum = 65601596;BA.debugLine="Private CHARFONT0 As String = ESC & \"M\" & Chr(0)";
_charfont0 = __ref._esc /*String*/ +"M"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=65601597;
 //BA.debugLineNum = 65601597;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=65601600;
 //BA.debugLineNum = 65601600;BA.debugLine="End Sub";
return "";
}
public String  _connectederrormsg(reparto_mazapa.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=65732608;
 //BA.debugLineNum = 65732608;BA.debugLine="Public Sub ConnectedErrorMsg As String";
RDebugUtils.currentLine=65732609;
 //BA.debugLineNum = 65732609;BA.debugLine="Return ConnectedError";
if (true) return __ref._connectederror /*String*/ ;
RDebugUtils.currentLine=65732610;
 //BA.debugLineNum = 65732610;BA.debugLine="End Sub";
return "";
}
public int  _createbox(reparto_mazapa.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=67502080;
 //BA.debugLineNum = 67502080;BA.debugLine="Public Sub CreateBox(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=67502081;
 //BA.debugLineNum = 67502081;BA.debugLine="Dim box As Int = 0x10000000";
_box = ((int)0x10000000);
RDebugUtils.currentLine=67502082;
 //BA.debugLineNum = 67502082;BA.debugLine="If fill Then box = box + 0x80000000";
if (_fill) { 
_box = (int) (_box+((int)0x80000000));};
RDebugUtils.currentLine=67502083;
 //BA.debugLineNum = 67502083;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=67502084;
 //BA.debugLineNum = 67502084;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=67502085;
 //BA.debugLineNum = 67502085;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=67502086;
 //BA.debugLineNum = 67502086;BA.debugLine="box = box + Bit.And(0x1f,y1)";
_box = (int) (_box+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=67502087;
 //BA.debugLineNum = 67502087;BA.debugLine="Return box";
if (true) return _box;
RDebugUtils.currentLine=67502088;
 //BA.debugLineNum = 67502088;BA.debugLine="End Sub";
return 0;
}
public int  _createcircle(reparto_mazapa.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=67371008;
 //BA.debugLineNum = 67371008;BA.debugLine="Public Sub CreateCircle(radius As Int, quadrants A";
RDebugUtils.currentLine=67371009;
 //BA.debugLineNum = 67371009;BA.debugLine="Dim circle As Int = 0x20000000";
_circle = ((int)0x20000000);
RDebugUtils.currentLine=67371010;
 //BA.debugLineNum = 67371010;BA.debugLine="If fill Then circle = circle + 0x80000000";
if (_fill) { 
_circle = (int) (_circle+((int)0x80000000));};
RDebugUtils.currentLine=67371011;
 //BA.debugLineNum = 67371011;BA.debugLine="circle = circle + Bit.ShiftLeft(radius, 24)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_radius,(int) (24)));
RDebugUtils.currentLine=67371012;
 //BA.debugLineNum = 67371012;BA.debugLine="circle = circle + Bit.ShiftLeft(quadrants, 16)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_quadrants,(int) (16)));
RDebugUtils.currentLine=67371013;
 //BA.debugLineNum = 67371013;BA.debugLine="circle = circle + Bit.ShiftLeft(x1, 8)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_x1,(int) (8)));
RDebugUtils.currentLine=67371014;
 //BA.debugLineNum = 67371014;BA.debugLine="circle = circle + y1";
_circle = (int) (_circle+_y1);
RDebugUtils.currentLine=67371015;
 //BA.debugLineNum = 67371015;BA.debugLine="Return circle";
if (true) return _circle;
RDebugUtils.currentLine=67371016;
 //BA.debugLineNum = 67371016;BA.debugLine="End Sub";
return 0;
}
public byte[]  _createcustomcharacter(reparto_mazapa.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=67239936;
 //BA.debugLineNum = 67239936;BA.debugLine="Public Sub CreateCustomCharacter(shapes() As Int,";
RDebugUtils.currentLine=67239937;
 //BA.debugLineNum = 67239937;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=67239938;
 //BA.debugLineNum = 67239938;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=67239939;
 //BA.debugLineNum = 67239939;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=67239940;
 //BA.debugLineNum = 67239940;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=67239941;
 //BA.debugLineNum = 67239941;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=67239942;
 //BA.debugLineNum = 67239942;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=67239943;
 //BA.debugLineNum = 67239943;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=67239944;
 //BA.debugLineNum = 67239944;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=67239945;
 //BA.debugLineNum = 67239945;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=67239948;
 //BA.debugLineNum = 67239948;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=67239950;
 //BA.debugLineNum = 67239950;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=67239951;
 //BA.debugLineNum = 67239951;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=67239952;
 //BA.debugLineNum = 67239952;BA.debugLine="points(x,y) = 0";
_points[_x][_y] = (byte) (0);
 }
};
 }
};
RDebugUtils.currentLine=67239955;
 //BA.debugLineNum = 67239955;BA.debugLine="Dim size As Int = 12";
_size = (int) (12);
RDebugUtils.currentLine=67239956;
 //BA.debugLineNum = 67239956;BA.debugLine="If characterfont = 1 Then size = 9";
if (_characterfont==1) { 
_size = (int) (9);};
RDebugUtils.currentLine=67239957;
 //BA.debugLineNum = 67239957;BA.debugLine="Dim charbyes(size * 3) As Byte";
_charbyes = new byte[(int) (_size*3)];
;
RDebugUtils.currentLine=67239958;
 //BA.debugLineNum = 67239958;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=67239959;
 //BA.debugLineNum = 67239959;BA.debugLine="charbyes(c) = 0";
_charbyes[_c] = (byte) (0);
 }
};
RDebugUtils.currentLine=67239962;
 //BA.debugLineNum = 67239962;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=67239963;
 //BA.debugLineNum = 67239963;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=67239964;
 //BA.debugLineNum = 67239964;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=67239965;
 //BA.debugLineNum = 67239965;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=67239966;
 //BA.debugLineNum = 67239966;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=67239967;
 //BA.debugLineNum = 67239967;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=67239968;
 //BA.debugLineNum = 67239968;BA.debugLine="Dim y1 As Int = Bit.And(0x0000001f, shapes(i))";
_y1 = __c.Bit.And(((int)0x0000001f),_shapes[_i]);
RDebugUtils.currentLine=67239969;
 //BA.debugLineNum = 67239969;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=67239970;
 //BA.debugLineNum = 67239970;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=67239976;
 //BA.debugLineNum = 67239976;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=67239977;
 //BA.debugLineNum = 67239977;BA.debugLine="If shape = 3 Then";
if (_shape==3) { 
RDebugUtils.currentLine=67239978;
 //BA.debugLineNum = 67239978;BA.debugLine="Log(\"Triangle \" & logmsg)";
__c.LogImpl("367239978","Triangle "+_logmsg,0);
RDebugUtils.currentLine=67239979;
 //BA.debugLineNum = 67239979;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=67239980;
 //BA.debugLineNum = 67239980;BA.debugLine="else If shape = 2 Then";
if (_shape==2) { 
RDebugUtils.currentLine=67239981;
 //BA.debugLineNum = 67239981;BA.debugLine="Log(\"Circle \" & logmsg)";
__c.LogImpl("367239981","Circle "+_logmsg,0);
RDebugUtils.currentLine=67239982;
 //BA.debugLineNum = 67239982;BA.debugLine="PlotCircle(x0, y0, x1, y1, points, fill)";
__ref._plotcircle /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else 
{RDebugUtils.currentLine=67239983;
 //BA.debugLineNum = 67239983;BA.debugLine="Else If shape = 1 Then";
if (_shape==1) { 
RDebugUtils.currentLine=67239984;
 //BA.debugLineNum = 67239984;BA.debugLine="Log(\"Box \" & logmsg)";
__c.LogImpl("367239984","Box "+_logmsg,0);
RDebugUtils.currentLine=67239985;
 //BA.debugLineNum = 67239985;BA.debugLine="PlotBox(x0, y0, x1, y1, points, fill)";
__ref._plotbox /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else {
RDebugUtils.currentLine=67239987;
 //BA.debugLineNum = 67239987;BA.debugLine="Log(\"Line \" & logmsg)";
__c.LogImpl("367239987","Line "+_logmsg,0);
RDebugUtils.currentLine=67239988;
 //BA.debugLineNum = 67239988;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 }}}
;
RDebugUtils.currentLine=67239991;
 //BA.debugLineNum = 67239991;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=67239992;
 //BA.debugLineNum = 67239992;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=67239993;
 //BA.debugLineNum = 67239993;BA.debugLine="Dim bits As Byte = 0";
_bits = (byte) (0);
RDebugUtils.currentLine=67239994;
 //BA.debugLineNum = 67239994;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=67239995;
 //BA.debugLineNum = 67239995;BA.debugLine="If points(x, y*8+b) <> 0 Then";
if (_points[_x][(int) (_y*8+_b)]!=0) { 
RDebugUtils.currentLine=67239996;
 //BA.debugLineNum = 67239996;BA.debugLine="bits = Bit.Or(bits, masks(b))";
_bits = (byte) (__c.Bit.Or((int) (_bits),(int) (_masks[_b])));
 };
 }
};
RDebugUtils.currentLine=67239999;
 //BA.debugLineNum = 67239999;BA.debugLine="charbyes(x*3+y) = bits";
_charbyes[(int) (_x*3+_y)] = _bits;
 }
};
 }
};
 }
};
RDebugUtils.currentLine=67240003;
 //BA.debugLineNum = 67240003;BA.debugLine="Return charbyes";
if (true) return _charbyes;
RDebugUtils.currentLine=67240004;
 //BA.debugLineNum = 67240004;BA.debugLine="End Sub";
return null;
}
public String  _plottriangle(reparto_mazapa.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=67567616;
 //BA.debugLineNum = 67567616;BA.debugLine="Private Sub PlotTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=67567618;
 //BA.debugLineNum = 67567618;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=67567619;
 //BA.debugLineNum = 67567619;BA.debugLine="PlotLine(x1, y1, x2, y2, points)";
__ref._plotline /*String*/ (null,_x1,_y1,_x2,_y2,_points);
RDebugUtils.currentLine=67567620;
 //BA.debugLineNum = 67567620;BA.debugLine="PlotLine(x2, y2, x0, y0, points)";
__ref._plotline /*String*/ (null,_x2,_y2,_x0,_y0,_points);
RDebugUtils.currentLine=67567621;
 //BA.debugLineNum = 67567621;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=67567622;
 //BA.debugLineNum = 67567622;BA.debugLine="FillTriangle(x0, y0, x1, y1, x2, y2, points)";
__ref._filltriangle /*String*/ (null,_x0,_y0,_x1,_y1,_x2,_y2,_points);
 };
RDebugUtils.currentLine=67567624;
 //BA.debugLineNum = 67567624;BA.debugLine="End Sub";
return "";
}
public String  _plotcircle(reparto_mazapa.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=67764224;
 //BA.debugLineNum = 67764224;BA.debugLine="Private Sub PlotCircle(radius As Int, quadrants As";
RDebugUtils.currentLine=67764226;
 //BA.debugLineNum = 67764226;BA.debugLine="Dim mask As Int = 1";
_mask = (int) (1);
RDebugUtils.currentLine=67764227;
 //BA.debugLineNum = 67764227;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=67764228;
 //BA.debugLineNum = 67764228;BA.debugLine="If Bit.And(quadrants, mask) <> 0 Then";
if (__c.Bit.And(_quadrants,_mask)!=0) { 
RDebugUtils.currentLine=67764229;
 //BA.debugLineNum = 67764229;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=67764230;
 //BA.debugLineNum = 67764230;BA.debugLine="Dim x,y As Double";
_x = 0;
_y = 0;
RDebugUtils.currentLine=67764231;
 //BA.debugLineNum = 67764231;BA.debugLine="x = x1 - SinD(i)*radius";
_x = _x1-__c.SinD(_i)*_radius;
RDebugUtils.currentLine=67764232;
 //BA.debugLineNum = 67764232;BA.debugLine="y = y1 - CosD(i)*radius";
_y = _y1-__c.CosD(_i)*_radius;
RDebugUtils.currentLine=67764233;
 //BA.debugLineNum = 67764233;BA.debugLine="If fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=67764234;
 //BA.debugLineNum = 67764234;BA.debugLine="PlotLine(x1, y1, x, y, points)";
__ref._plotline /*String*/ (null,_x1,_y1,(int) (_x),(int) (_y),_points);
 }else {
RDebugUtils.currentLine=67764236;
 //BA.debugLineNum = 67764236;BA.debugLine="points(Round(x), Round(y)) = 1";
_points[(int) (__c.Round(_x))][(int) (__c.Round(_y))] = (byte) (1);
 };
 }
};
 };
RDebugUtils.currentLine=67764240;
 //BA.debugLineNum = 67764240;BA.debugLine="mask = Bit.ShiftLeft(mask, 1)";
_mask = __c.Bit.ShiftLeft(_mask,(int) (1));
 }
};
RDebugUtils.currentLine=67764242;
 //BA.debugLineNum = 67764242;BA.debugLine="End Sub";
return "";
}
public String  _plotbox(reparto_mazapa.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=67698688;
 //BA.debugLineNum = 67698688;BA.debugLine="Private Sub PlotBox(x0 As Int, y0 As Int, x1 As In";
RDebugUtils.currentLine=67698690;
 //BA.debugLineNum = 67698690;BA.debugLine="PlotLine(x0, y0, x0, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x0,_y1,_points);
RDebugUtils.currentLine=67698691;
 //BA.debugLineNum = 67698691;BA.debugLine="PlotLine(x0, y0, x1, y0, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y0,_points);
RDebugUtils.currentLine=67698692;
 //BA.debugLineNum = 67698692;BA.debugLine="PlotLine(x1, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x1,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=67698693;
 //BA.debugLineNum = 67698693;BA.debugLine="PlotLine(x0, y1, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y1,_x1,_y1,_points);
RDebugUtils.currentLine=67698694;
 //BA.debugLineNum = 67698694;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=67698695;
 //BA.debugLineNum = 67698695;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=67698696;
 //BA.debugLineNum = 67698696;BA.debugLine="PlotLine(x, y0, x, y1, points)";
__ref._plotline /*String*/ (null,_x,_y0,_x,_y1,_points);
 }
};
 };
RDebugUtils.currentLine=67698699;
 //BA.debugLineNum = 67698699;BA.debugLine="End Sub";
return "";
}
public String  _plotline(reparto_mazapa.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=67829760;
 //BA.debugLineNum = 67829760;BA.debugLine="Private Sub PlotLine(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=67829761;
 //BA.debugLineNum = 67829761;BA.debugLine="If Abs(y1 - y0) < Abs(x1 - x0) Then";
if (__c.Abs(_y1-_y0)<__c.Abs(_x1-_x0)) { 
RDebugUtils.currentLine=67829762;
 //BA.debugLineNum = 67829762;BA.debugLine="If x0 > x1 Then";
if (_x0>_x1) { 
RDebugUtils.currentLine=67829763;
 //BA.debugLineNum = 67829763;BA.debugLine="PlotLineLow(x1, y1, x0, y0, points)";
__ref._plotlinelow /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=67829765;
 //BA.debugLineNum = 67829765;BA.debugLine="PlotLineLow(x0, y0, x1, y1, points)";
__ref._plotlinelow /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 }else {
RDebugUtils.currentLine=67829768;
 //BA.debugLineNum = 67829768;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=67829769;
 //BA.debugLineNum = 67829769;BA.debugLine="PlotLineHigh(x1, y1, x0, y0, points)";
__ref._plotlinehigh /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=67829771;
 //BA.debugLineNum = 67829771;BA.debugLine="PlotLineHigh(x0, y0, x1, y1, points)";
__ref._plotlinehigh /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 };
RDebugUtils.currentLine=67829774;
 //BA.debugLineNum = 67829774;BA.debugLine="End Sub";
return "";
}
public int  _createline(reparto_mazapa.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=67305472;
 //BA.debugLineNum = 67305472;BA.debugLine="Public Sub CreateLine(x0 As Int, y0 As Int, x1 As";
RDebugUtils.currentLine=67305473;
 //BA.debugLineNum = 67305473;BA.debugLine="Dim line As Int = 0";
_line = (int) (0);
RDebugUtils.currentLine=67305474;
 //BA.debugLineNum = 67305474;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=67305475;
 //BA.debugLineNum = 67305475;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=67305476;
 //BA.debugLineNum = 67305476;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=67305477;
 //BA.debugLineNum = 67305477;BA.debugLine="line = line + Bit.And(0x1f,y1)";
_line = (int) (_line+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=67305478;
 //BA.debugLineNum = 67305478;BA.debugLine="Return line";
if (true) return _line;
RDebugUtils.currentLine=67305479;
 //BA.debugLineNum = 67305479;BA.debugLine="End Sub";
return 0;
}
public int  _createtriangle(reparto_mazapa.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=67436544;
 //BA.debugLineNum = 67436544;BA.debugLine="Public Sub CreateTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=67436545;
 //BA.debugLineNum = 67436545;BA.debugLine="Dim triangle As Int = 0x30000000";
_triangle = ((int)0x30000000);
RDebugUtils.currentLine=67436546;
 //BA.debugLineNum = 67436546;BA.debugLine="If fill Then triangle = triangle + 0x80000000";
if (_fill) { 
_triangle = (int) (_triangle+((int)0x80000000));};
RDebugUtils.currentLine=67436547;
 //BA.debugLineNum = 67436547;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=67436548;
 //BA.debugLineNum = 67436548;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=67436549;
 //BA.debugLineNum = 67436549;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=67436550;
 //BA.debugLineNum = 67436550;BA.debugLine="triangle = triangle + Bit.And(0x1f,y1)";
_triangle = (int) (_triangle+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=67436551;
 //BA.debugLineNum = 67436551;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=67436552;
 //BA.debugLineNum = 67436552;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=67436553;
 //BA.debugLineNum = 67436553;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=67436554;
 //BA.debugLineNum = 67436554;BA.debugLine="Return triangle";
if (true) return _triangle;
RDebugUtils.currentLine=67436555;
 //BA.debugLineNum = 67436555;BA.debugLine="End Sub";
return 0;
}
public int  _definecustomcharacter(reparto_mazapa.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=67174400;
 //BA.debugLineNum = 67174400;BA.debugLine="Public Sub DefineCustomCharacter(charcode As Int,";
RDebugUtils.currentLine=67174401;
 //BA.debugLineNum = 67174401;BA.debugLine="Dim excess As Int = bitdata.Length Mod 3";
_excess = (int) (_bitdata.length%3);
RDebugUtils.currentLine=67174402;
 //BA.debugLineNum = 67174402;BA.debugLine="If excess <> 0 Then Return -1";
if (_excess!=0) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=67174403;
 //BA.debugLineNum = 67174403;BA.debugLine="Dim size As Int = bitdata.Length / 3";
_size = (int) (_bitdata.length/(double)3);
RDebugUtils.currentLine=67174404;
 //BA.debugLineNum = 67174404;BA.debugLine="WriteString(ESC & \"&\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"&");
RDebugUtils.currentLine=67174405;
 //BA.debugLineNum = 67174405;BA.debugLine="Dim params(4) As Byte";
_params = new byte[(int) (4)];
;
RDebugUtils.currentLine=67174406;
 //BA.debugLineNum = 67174406;BA.debugLine="params(0) = 3";
_params[(int) (0)] = (byte) (3);
RDebugUtils.currentLine=67174407;
 //BA.debugLineNum = 67174407;BA.debugLine="params(1) = charcode";
_params[(int) (1)] = (byte) (_charcode);
RDebugUtils.currentLine=67174408;
 //BA.debugLineNum = 67174408;BA.debugLine="params(2) = charcode";
_params[(int) (2)] = (byte) (_charcode);
RDebugUtils.currentLine=67174409;
 //BA.debugLineNum = 67174409;BA.debugLine="params(3) = size";
_params[(int) (3)] = (byte) (_size);
RDebugUtils.currentLine=67174410;
 //BA.debugLineNum = 67174410;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=67174411;
 //BA.debugLineNum = 67174411;BA.debugLine="WriteBytes(bitdata)";
__ref._writebytes /*String*/ (null,_bitdata);
RDebugUtils.currentLine=67174412;
 //BA.debugLineNum = 67174412;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=67174413;
 //BA.debugLineNum = 67174413;BA.debugLine="End Sub";
return 0;
}
public String  _writestring(reparto_mazapa.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=66912256;
 //BA.debugLineNum = 66912256;BA.debugLine="Public Sub WriteString(data As String)";
RDebugUtils.currentLine=66912257;
 //BA.debugLineNum = 66912257;BA.debugLine="WriteString2(data, \"IBM437\")";
__ref._writestring2 /*String*/ (null,_data,"IBM437");
RDebugUtils.currentLine=66912258;
 //BA.debugLineNum = 66912258;BA.debugLine="End Sub";
return "";
}
public String  _writebytes(reparto_mazapa.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=66846720;
 //BA.debugLineNum = 66846720;BA.debugLine="Public Sub WriteBytes(data() As Byte)";
RDebugUtils.currentLine=66846721;
 //BA.debugLineNum = 66846721;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=66846722;
 //BA.debugLineNum = 66846722;BA.debugLine="Astream.Write(data)";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Write(_data);
 };
RDebugUtils.currentLine=66846724;
 //BA.debugLineNum = 66846724;BA.debugLine="End Sub";
return "";
}
public String  _deletecustomcharacter(reparto_mazapa.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=67043328;
 //BA.debugLineNum = 67043328;BA.debugLine="Public Sub DeleteCustomCharacter(charcode As Int)";
RDebugUtils.currentLine=67043329;
 //BA.debugLineNum = 67043329;BA.debugLine="WriteString(ESC & \"?\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"?");
RDebugUtils.currentLine=67043330;
 //BA.debugLineNum = 67043330;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=67043331;
 //BA.debugLineNum = 67043331;BA.debugLine="params(0) = charcode";
_params[(int) (0)] = (byte) (_charcode);
RDebugUtils.currentLine=67043332;
 //BA.debugLineNum = 67043332;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=67043333;
 //BA.debugLineNum = 67043333;BA.debugLine="End Sub";
return "";
}
public reparto_mazapa.keymon.lat.escposprinter._animage  _ditherimage1d(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage1d", false))
	 {return ((reparto_mazapa.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_mazapa.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=68157440;
 //BA.debugLineNum = 68157440;BA.debugLine="Sub DitherImage1D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=68157441;
 //BA.debugLineNum = 68157441;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=68157442;
 //BA.debugLineNum = 68157442;BA.debugLine="Dim error As Int";
_error = 0;
RDebugUtils.currentLine=68157443;
 //BA.debugLineNum = 68157443;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=68157444;
 //BA.debugLineNum = 68157444;BA.debugLine="error = 0 ' reset on each new line";
_error = (int) (0);
RDebugUtils.currentLine=68157445;
 //BA.debugLineNum = 68157445;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=68157446;
 //BA.debugLineNum = 68157446;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=68157447;
 //BA.debugLineNum = 68157447;BA.debugLine="lum = lum + error";
_lum = (int) (_lum+_error);
RDebugUtils.currentLine=68157448;
 //BA.debugLineNum = 68157448;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=68157449;
 //BA.debugLineNum = 68157449;BA.debugLine="error = lum";
_error = _lum;
RDebugUtils.currentLine=68157450;
 //BA.debugLineNum = 68157450;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=68157452;
 //BA.debugLineNum = 68157452;BA.debugLine="error = lum - 255";
_error = (int) (_lum-255);
RDebugUtils.currentLine=68157453;
 //BA.debugLineNum = 68157453;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=68157455;
 //BA.debugLineNum = 68157455;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=68157458;
 //BA.debugLineNum = 68157458;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_mazapa.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=68157459;
 //BA.debugLineNum = 68157459;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=68157460;
 //BA.debugLineNum = 68157460;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=68157461;
 //BA.debugLineNum = 68157461;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=68157462;
 //BA.debugLineNum = 68157462;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=68157463;
 //BA.debugLineNum = 68157463;BA.debugLine="End Sub";
return null;
}
public reparto_mazapa.keymon.lat.escposprinter._animage  _ditherimage2d(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage2d", false))
	 {return ((reparto_mazapa.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_mazapa.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=68222976;
 //BA.debugLineNum = 68222976;BA.debugLine="Sub DitherImage2D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=68222977;
 //BA.debugLineNum = 68222977;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=68222978;
 //BA.debugLineNum = 68222978;BA.debugLine="Dim xerror As Int";
_xerror = 0;
RDebugUtils.currentLine=68222979;
 //BA.debugLineNum = 68222979;BA.debugLine="Dim yerrors(img.Width) As Int";
_yerrors = new int[_img.Width /*int*/ ];
;
RDebugUtils.currentLine=68222980;
 //BA.debugLineNum = 68222980;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=68222981;
 //BA.debugLineNum = 68222981;BA.debugLine="yerrors(0) = 0";
_yerrors[(int) (0)] = (int) (0);
 }
};
RDebugUtils.currentLine=68222983;
 //BA.debugLineNum = 68222983;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=68222984;
 //BA.debugLineNum = 68222984;BA.debugLine="xerror = 0 ' reset on each new line";
_xerror = (int) (0);
RDebugUtils.currentLine=68222985;
 //BA.debugLineNum = 68222985;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=68222986;
 //BA.debugLineNum = 68222986;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=68222987;
 //BA.debugLineNum = 68222987;BA.debugLine="lum = lum + xerror + yerrors(x)";
_lum = (int) (_lum+_xerror+_yerrors[_x]);
RDebugUtils.currentLine=68222988;
 //BA.debugLineNum = 68222988;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=68222989;
 //BA.debugLineNum = 68222989;BA.debugLine="xerror = lum/2";
_xerror = (int) (_lum/(double)2);
RDebugUtils.currentLine=68222990;
 //BA.debugLineNum = 68222990;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=68222991;
 //BA.debugLineNum = 68222991;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=68222993;
 //BA.debugLineNum = 68222993;BA.debugLine="xerror = (lum - 255)/2";
_xerror = (int) ((_lum-255)/(double)2);
RDebugUtils.currentLine=68222994;
 //BA.debugLineNum = 68222994;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=68222995;
 //BA.debugLineNum = 68222995;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=68222997;
 //BA.debugLineNum = 68222997;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=68223000;
 //BA.debugLineNum = 68223000;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_mazapa.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=68223001;
 //BA.debugLineNum = 68223001;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=68223002;
 //BA.debugLineNum = 68223002;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=68223003;
 //BA.debugLineNum = 68223003;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=68223004;
 //BA.debugLineNum = 68223004;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=68223005;
 //BA.debugLineNum = 68223005;BA.debugLine="End Sub";
return null;
}
public String  _filltriangle(reparto_mazapa.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=67633152;
 //BA.debugLineNum = 67633152;BA.debugLine="Private Sub FillTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=67633154;
 //BA.debugLineNum = 67633154;BA.debugLine="Dim tx, ty As Int";
_tx = 0;
_ty = 0;
RDebugUtils.currentLine=67633155;
 //BA.debugLineNum = 67633155;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=67633156;
 //BA.debugLineNum = 67633156;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=67633156;
 //BA.debugLineNum = 67633156;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=67633157;
 //BA.debugLineNum = 67633157;BA.debugLine="x0 = x1 : y0 = y1";
_x0 = _x1;
RDebugUtils.currentLine=67633157;
 //BA.debugLineNum = 67633157;BA.debugLine="x0 = x1 : y0 = y1";
_y0 = _y1;
RDebugUtils.currentLine=67633158;
 //BA.debugLineNum = 67633158;BA.debugLine="x1 = tx : y1 = ty";
_x1 = _tx;
RDebugUtils.currentLine=67633158;
 //BA.debugLineNum = 67633158;BA.debugLine="x1 = tx : y1 = ty";
_y1 = _ty;
 };
RDebugUtils.currentLine=67633160;
 //BA.debugLineNum = 67633160;BA.debugLine="If y0 > y2 Then";
if (_y0>_y2) { 
RDebugUtils.currentLine=67633161;
 //BA.debugLineNum = 67633161;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=67633161;
 //BA.debugLineNum = 67633161;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=67633162;
 //BA.debugLineNum = 67633162;BA.debugLine="x0 = x2 : y0 = y2";
_x0 = _x2;
RDebugUtils.currentLine=67633162;
 //BA.debugLineNum = 67633162;BA.debugLine="x0 = x2 : y0 = y2";
_y0 = _y2;
RDebugUtils.currentLine=67633163;
 //BA.debugLineNum = 67633163;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=67633163;
 //BA.debugLineNum = 67633163;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=67633165;
 //BA.debugLineNum = 67633165;BA.debugLine="If y1 > y2 Then";
if (_y1>_y2) { 
RDebugUtils.currentLine=67633166;
 //BA.debugLineNum = 67633166;BA.debugLine="tx = x1 : ty = y1";
_tx = _x1;
RDebugUtils.currentLine=67633166;
 //BA.debugLineNum = 67633166;BA.debugLine="tx = x1 : ty = y1";
_ty = _y1;
RDebugUtils.currentLine=67633167;
 //BA.debugLineNum = 67633167;BA.debugLine="x1 = x2 : y1 = y2";
_x1 = _x2;
RDebugUtils.currentLine=67633167;
 //BA.debugLineNum = 67633167;BA.debugLine="x1 = x2 : y1 = y2";
_y1 = _y2;
RDebugUtils.currentLine=67633168;
 //BA.debugLineNum = 67633168;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=67633168;
 //BA.debugLineNum = 67633168;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=67633171;
 //BA.debugLineNum = 67633171;BA.debugLine="Dim dx0, dx1, dx2 As Double";
_dx0 = 0;
_dx1 = 0;
_dx2 = 0;
RDebugUtils.currentLine=67633172;
 //BA.debugLineNum = 67633172;BA.debugLine="Dim x3, x4, y3, y4 As Double";
_x3 = 0;
_x4 = 0;
_y3 = 0;
_y4 = 0;
RDebugUtils.currentLine=67633173;
 //BA.debugLineNum = 67633173;BA.debugLine="Dim inc As Int";
_inc = 0;
RDebugUtils.currentLine=67633175;
 //BA.debugLineNum = 67633175;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=67633176;
 //BA.debugLineNum = 67633176;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=67633177;
 //BA.debugLineNum = 67633177;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=67633178;
 //BA.debugLineNum = 67633178;BA.debugLine="x3 = x0 : x4 = x0";
_x3 = _x0;
RDebugUtils.currentLine=67633178;
 //BA.debugLineNum = 67633178;BA.debugLine="x3 = x0 : x4 = x0";
_x4 = _x0;
RDebugUtils.currentLine=67633179;
 //BA.debugLineNum = 67633179;BA.debugLine="y3 = y0 : y4 = y0";
_y3 = _y0;
RDebugUtils.currentLine=67633179;
 //BA.debugLineNum = 67633179;BA.debugLine="y3 = y0 : y4 = y0";
_y4 = _y0;
RDebugUtils.currentLine=67633180;
 //BA.debugLineNum = 67633180;BA.debugLine="If dx0 > dx1 Then";
if (_dx0>_dx1) { 
RDebugUtils.currentLine=67633181;
 //BA.debugLineNum = 67633181;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=67633182;
 //BA.debugLineNum = 67633182;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=67633183;
 //BA.debugLineNum = 67633183;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=67633184;
 //BA.debugLineNum = 67633184;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=67633185;
 //BA.debugLineNum = 67633185;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=67633187;
 //BA.debugLineNum = 67633187;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=67633187;
 //BA.debugLineNum = 67633187;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=67633187;
 //BA.debugLineNum = 67633187;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=67633187;
 //BA.debugLineNum = 67633187;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx0;
 }
;
RDebugUtils.currentLine=67633189;
 //BA.debugLineNum = 67633189;BA.debugLine="x4=x1";
_x4 = _x1;
RDebugUtils.currentLine=67633190;
 //BA.debugLineNum = 67633190;BA.debugLine="y4=y1";
_y4 = _y1;
RDebugUtils.currentLine=67633191;
 //BA.debugLineNum = 67633191;BA.debugLine="Do While y3 <= y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=67633192;
 //BA.debugLineNum = 67633192;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=67633193;
 //BA.debugLineNum = 67633193;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=67633194;
 //BA.debugLineNum = 67633194;BA.debugLine="points(x ,y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=67633196;
 //BA.debugLineNum = 67633196;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=67633196;
 //BA.debugLineNum = 67633196;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=67633196;
 //BA.debugLineNum = 67633196;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=67633196;
 //BA.debugLineNum = 67633196;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx2;
 }
;
 }else {
RDebugUtils.currentLine=67633199;
 //BA.debugLineNum = 67633199;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=67633200;
 //BA.debugLineNum = 67633200;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=67633201;
 //BA.debugLineNum = 67633201;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=67633202;
 //BA.debugLineNum = 67633202;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=67633203;
 //BA.debugLineNum = 67633203;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=67633205;
 //BA.debugLineNum = 67633205;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=67633205;
 //BA.debugLineNum = 67633205;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=67633205;
 //BA.debugLineNum = 67633205;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x3 = _x3+_dx0;
RDebugUtils.currentLine=67633205;
 //BA.debugLineNum = 67633205;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x4 = _x4+_dx1;
 }
;
RDebugUtils.currentLine=67633207;
 //BA.debugLineNum = 67633207;BA.debugLine="x3=x1";
_x3 = _x1;
RDebugUtils.currentLine=67633208;
 //BA.debugLineNum = 67633208;BA.debugLine="y3=y1";
_y3 = _y1;
RDebugUtils.currentLine=67633209;
 //BA.debugLineNum = 67633209;BA.debugLine="Do While y3<=y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=67633210;
 //BA.debugLineNum = 67633210;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=67633211;
 //BA.debugLineNum = 67633211;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=67633212;
 //BA.debugLineNum = 67633212;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=67633214;
 //BA.debugLineNum = 67633214;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=67633214;
 //BA.debugLineNum = 67633214;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=67633214;
 //BA.debugLineNum = 67633214;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x3 = _x3+_dx2;
RDebugUtils.currentLine=67633214;
 //BA.debugLineNum = 67633214;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x4 = _x4+_dx1;
 }
;
 };
RDebugUtils.currentLine=67633217;
 //BA.debugLineNum = 67633217;BA.debugLine="End Sub";
return "";
}
public reparto_mazapa.keymon.lat.escposprinter._animage  _imagetobwimage(reparto_mazapa.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_mazapa.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_mazapa.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=68026368;
 //BA.debugLineNum = 68026368;BA.debugLine="Sub ImageToBWIMage(bmp As Bitmap) As AnImage";
RDebugUtils.currentLine=68026369;
 //BA.debugLineNum = 68026369;BA.debugLine="Dim BC As BitmapCreator 'ignore";
_bc = new b4a.example.bitmapcreator();
RDebugUtils.currentLine=68026370;
 //BA.debugLineNum = 68026370;BA.debugLine="Dim W As Int = bmp.Width";
_w = _bmp.getWidth();
RDebugUtils.currentLine=68026371;
 //BA.debugLineNum = 68026371;BA.debugLine="Dim H As Int = bmp.Height";
_h = _bmp.getHeight();
RDebugUtils.currentLine=68026372;
 //BA.debugLineNum = 68026372;BA.debugLine="Dim pixels(W * H) As Byte";
_pixels = new byte[(int) (_w*_h)];
;
RDebugUtils.currentLine=68026374;
 //BA.debugLineNum = 68026374;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=68026375;
 //BA.debugLineNum = 68026375;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=68026376;
 //BA.debugLineNum = 68026376;BA.debugLine="Dim j As Int = bmp.GetPixel(x, y)";
_j = _bmp.GetPixel(_x,_y);
RDebugUtils.currentLine=68026378;
 //BA.debugLineNum = 68026378;BA.debugLine="Dim col As ARGBColor";
_col = new b4a.example.bitmapcreator._argbcolor();
RDebugUtils.currentLine=68026379;
 //BA.debugLineNum = 68026379;BA.debugLine="BC.ColorToARGB(j, col )";
_bc._colortoargb(_j,_col);
RDebugUtils.currentLine=68026380;
 //BA.debugLineNum = 68026380;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=68026381;
 //BA.debugLineNum = 68026381;BA.debugLine="If lum> 255 Then lum = 255";
if (_lum>255) { 
_lum = (int) (255);};
RDebugUtils.currentLine=68026383;
 //BA.debugLineNum = 68026383;BA.debugLine="pixels(y*W + x) = lum";
_pixels[(int) (_y*_w+_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=68026386;
 //BA.debugLineNum = 68026386;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_mazapa.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=68026387;
 //BA.debugLineNum = 68026387;BA.debugLine="ret.Width = bmp.Width";
_ret.Width /*int*/  = _bmp.getWidth();
RDebugUtils.currentLine=68026388;
 //BA.debugLineNum = 68026388;BA.debugLine="ret.Height = bmp.Height";
_ret.Height /*int*/  = _bmp.getHeight();
RDebugUtils.currentLine=68026389;
 //BA.debugLineNum = 68026389;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=68026390;
 //BA.debugLineNum = 68026390;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=68026391;
 //BA.debugLineNum = 68026391;BA.debugLine="End Sub";
return null;
}
public boolean  _isbluetoothon(reparto_mazapa.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=65863680;
 //BA.debugLineNum = 65863680;BA.debugLine="Public Sub IsBluetoothOn As Boolean";
RDebugUtils.currentLine=65863681;
 //BA.debugLineNum = 65863681;BA.debugLine="Return Serial1.IsEnabled";
if (true) return __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .IsEnabled();
RDebugUtils.currentLine=65863682;
 //BA.debugLineNum = 65863682;BA.debugLine="End Sub";
return false;
}
public reparto_mazapa.keymon.lat.escposprinter._animage  _packimage(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.keymon.lat.escposprinter._animage _imagedata) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "packimage", false))
	 {return ((reparto_mazapa.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_mazapa.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=68354048;
 //BA.debugLineNum = 68354048;BA.debugLine="Public Sub PackImage(imagedata As AnImage) As AnIm";
RDebugUtils.currentLine=68354049;
 //BA.debugLineNum = 68354049;BA.debugLine="Dim xbytes As Int = imagedata.width/8";
_xbytes = (int) (_imagedata.Width /*int*/ /(double)8);
RDebugUtils.currentLine=68354050;
 //BA.debugLineNum = 68354050;BA.debugLine="Dim pixels(xbytes * imagedata.height) As Byte";
_pixels = new byte[(int) (_xbytes*_imagedata.Height /*int*/ )];
;
RDebugUtils.currentLine=68354051;
 //BA.debugLineNum = 68354051;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=68354052;
 //BA.debugLineNum = 68354052;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=68354053;
 //BA.debugLineNum = 68354053;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=68354054;
 //BA.debugLineNum = 68354054;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=68354055;
 //BA.debugLineNum = 68354055;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=68354056;
 //BA.debugLineNum = 68354056;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=68354057;
 //BA.debugLineNum = 68354057;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=68354058;
 //BA.debugLineNum = 68354058;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=68354059;
 //BA.debugLineNum = 68354059;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=68354060;
 //BA.debugLineNum = 68354060;BA.debugLine="Dim index As Int = 0";
_index = (int) (0);
RDebugUtils.currentLine=68354061;
 //BA.debugLineNum = 68354061;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=68354062;
 //BA.debugLineNum = 68354062;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=68354063;
 //BA.debugLineNum = 68354063;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=68354064;
 //BA.debugLineNum = 68354064;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=68354066;
 //BA.debugLineNum = 68354066;BA.debugLine="Dim pix As Byte = imagedata.Data(index)";
_pix = _imagedata.Data /*byte[]*/ [_index];
RDebugUtils.currentLine=68354067;
 //BA.debugLineNum = 68354067;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=68354068;
 //BA.debugLineNum = 68354068;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
RDebugUtils.currentLine=68354070;
 //BA.debugLineNum = 68354070;BA.debugLine="index = index + 1";
_index = (int) (_index+1);
 }
};
RDebugUtils.currentLine=68354072;
 //BA.debugLineNum = 68354072;BA.debugLine="pixels(y*xbytes + x) = xbyte";
_pixels[(int) (_y*_xbytes+_x)] = _xbyte;
 }
};
 }
};
RDebugUtils.currentLine=68354075;
 //BA.debugLineNum = 68354075;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_mazapa.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=68354076;
 //BA.debugLineNum = 68354076;BA.debugLine="ret.Width = xbytes";
_ret.Width /*int*/  = _xbytes;
RDebugUtils.currentLine=68354077;
 //BA.debugLineNum = 68354077;BA.debugLine="ret.Height = imagedata.Height";
_ret.Height /*int*/  = _imagedata.Height /*int*/ ;
RDebugUtils.currentLine=68354078;
 //BA.debugLineNum = 68354078;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=68354079;
 //BA.debugLineNum = 68354079;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=68354080;
 //BA.debugLineNum = 68354080;BA.debugLine="End Sub";
return null;
}
public byte[]  _packimageslice(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.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=68485120;
 //BA.debugLineNum = 68485120;BA.debugLine="Public Sub PackImageSlice(img As AnImage, slice As";
RDebugUtils.currentLine=68485121;
 //BA.debugLineNum = 68485121;BA.debugLine="Dim bytes As Int = img.width";
_bytes = _img.Width /*int*/ ;
RDebugUtils.currentLine=68485122;
 //BA.debugLineNum = 68485122;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=68485123;
 //BA.debugLineNum = 68485123;BA.debugLine="Dim pixels(bytes * 3) As Byte";
_pixels = new byte[(int) (_bytes*3)];
;
RDebugUtils.currentLine=68485124;
 //BA.debugLineNum = 68485124;BA.debugLine="Dim slicestart As Int = slice * bytes * 8 * 3";
_slicestart = (int) (_slice*_bytes*8*3);
 }else {
RDebugUtils.currentLine=68485126;
 //BA.debugLineNum = 68485126;BA.debugLine="Dim pixels(bytes) As Byte";
_pixels = new byte[_bytes];
;
RDebugUtils.currentLine=68485127;
 //BA.debugLineNum = 68485127;BA.debugLine="Dim slicestart As Int = slice * bytes * 8";
_slicestart = (int) (_slice*_bytes*8);
 };
RDebugUtils.currentLine=68485130;
 //BA.debugLineNum = 68485130;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=68485131;
 //BA.debugLineNum = 68485131;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=68485132;
 //BA.debugLineNum = 68485132;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=68485133;
 //BA.debugLineNum = 68485133;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=68485134;
 //BA.debugLineNum = 68485134;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=68485135;
 //BA.debugLineNum = 68485135;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=68485136;
 //BA.debugLineNum = 68485136;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=68485137;
 //BA.debugLineNum = 68485137;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=68485138;
 //BA.debugLineNum = 68485138;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=68485140;
 //BA.debugLineNum = 68485140;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=68485141;
 //BA.debugLineNum = 68485141;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=68485142;
 //BA.debugLineNum = 68485142;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=68485143;
 //BA.debugLineNum = 68485143;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=68485144;
 //BA.debugLineNum = 68485144;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=68485146;
 //BA.debugLineNum = 68485146;BA.debugLine="Dim pix As Byte = img.Data(slicestart + ((b +";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+((_b+_s*8)*_bytes)+_x)];
RDebugUtils.currentLine=68485147;
 //BA.debugLineNum = 68485147;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=68485148;
 //BA.debugLineNum = 68485148;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=68485151;
 //BA.debugLineNum = 68485151;BA.debugLine="pixels(x*3+s) = xbyte";
_pixels[(int) (_x*3+_s)] = _xbyte;
 }
};
 }
};
 }else {
RDebugUtils.currentLine=68485155;
 //BA.debugLineNum = 68485155;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=68485156;
 //BA.debugLineNum = 68485156;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=68485157;
 //BA.debugLineNum = 68485157;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=68485159;
 //BA.debugLineNum = 68485159;BA.debugLine="Dim pix As Byte = img.Data(slicestart + (b * b";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+(_b*_bytes)+_x)];
RDebugUtils.currentLine=68485160;
 //BA.debugLineNum = 68485160;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=68485161;
 //BA.debugLineNum = 68485161;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=68485164;
 //BA.debugLineNum = 68485164;BA.debugLine="pixels(x) = xbyte";
_pixels[_x] = _xbyte;
 }
};
 };
RDebugUtils.currentLine=68485167;
 //BA.debugLineNum = 68485167;BA.debugLine="Return pixels";
if (true) return _pixels;
RDebugUtils.currentLine=68485168;
 //BA.debugLineNum = 68485168;BA.debugLine="End Sub";
return null;
}
public String  _plotlinelow(reparto_mazapa.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=67960832;
 //BA.debugLineNum = 67960832;BA.debugLine="Private Sub	PlotLineLow(x0 As Int, y0 As Int, x1 A";
RDebugUtils.currentLine=67960833;
 //BA.debugLineNum = 67960833;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=67960834;
 //BA.debugLineNum = 67960834;BA.debugLine="Dim dy As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=67960835;
 //BA.debugLineNum = 67960835;BA.debugLine="Dim yi As Int = 1";
_yi = (int) (1);
RDebugUtils.currentLine=67960836;
 //BA.debugLineNum = 67960836;BA.debugLine="If dy < 0 Then";
if (_dy<0) { 
RDebugUtils.currentLine=67960837;
 //BA.debugLineNum = 67960837;BA.debugLine="yi = -1";
_yi = (int) (-1);
RDebugUtils.currentLine=67960838;
 //BA.debugLineNum = 67960838;BA.debugLine="dy = -dy";
_dy = (int) (-_dy);
 };
RDebugUtils.currentLine=67960840;
 //BA.debugLineNum = 67960840;BA.debugLine="Dim D As Int = 2*dy - dx";
_d = (int) (2*_dy-_dx);
RDebugUtils.currentLine=67960841;
 //BA.debugLineNum = 67960841;BA.debugLine="Dim y As Int = y0";
_y = _y0;
RDebugUtils.currentLine=67960842;
 //BA.debugLineNum = 67960842;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=67960843;
 //BA.debugLineNum = 67960843;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=67960844;
 //BA.debugLineNum = 67960844;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=67960845;
 //BA.debugLineNum = 67960845;BA.debugLine="y = y + yi";
_y = (int) (_y+_yi);
RDebugUtils.currentLine=67960846;
 //BA.debugLineNum = 67960846;BA.debugLine="D = D - 2*dx";
_d = (int) (_d-2*_dx);
 };
RDebugUtils.currentLine=67960848;
 //BA.debugLineNum = 67960848;BA.debugLine="D = D + 2*dy";
_d = (int) (_d+2*_dy);
 }
};
RDebugUtils.currentLine=67960850;
 //BA.debugLineNum = 67960850;BA.debugLine="End Sub";
return "";
}
public String  _plotlinehigh(reparto_mazapa.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=67895296;
 //BA.debugLineNum = 67895296;BA.debugLine="Private Sub PlotLineHigh(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=67895297;
 //BA.debugLineNum = 67895297;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=67895298;
 //BA.debugLineNum = 67895298;BA.debugLine="Dim dy  As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=67895299;
 //BA.debugLineNum = 67895299;BA.debugLine="Dim xi As Int = 1";
_xi = (int) (1);
RDebugUtils.currentLine=67895300;
 //BA.debugLineNum = 67895300;BA.debugLine="If dx < 0 Then";
if (_dx<0) { 
RDebugUtils.currentLine=67895301;
 //BA.debugLineNum = 67895301;BA.debugLine="xi = -1";
_xi = (int) (-1);
RDebugUtils.currentLine=67895302;
 //BA.debugLineNum = 67895302;BA.debugLine="dx = -dx";
_dx = (int) (-_dx);
 };
RDebugUtils.currentLine=67895304;
 //BA.debugLineNum = 67895304;BA.debugLine="Dim D As Int = 2*dx - dy";
_d = (int) (2*_dx-_dy);
RDebugUtils.currentLine=67895305;
 //BA.debugLineNum = 67895305;BA.debugLine="Dim x As Int = x0";
_x = _x0;
RDebugUtils.currentLine=67895306;
 //BA.debugLineNum = 67895306;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=67895307;
 //BA.debugLineNum = 67895307;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=67895308;
 //BA.debugLineNum = 67895308;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=67895309;
 //BA.debugLineNum = 67895309;BA.debugLine="x = x + xi";
_x = (int) (_x+_xi);
RDebugUtils.currentLine=67895310;
 //BA.debugLineNum = 67895310;BA.debugLine="D = D - 2*dy";
_d = (int) (_d-2*_dy);
 };
RDebugUtils.currentLine=67895312;
 //BA.debugLineNum = 67895312;BA.debugLine="D = D + 2*dx";
_d = (int) (_d+2*_dx);
 }
};
RDebugUtils.currentLine=67895314;
 //BA.debugLineNum = 67895314;BA.debugLine="End Sub";
return "";
}
public String  _printandfeedpaper(reparto_mazapa.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=66125824;
 //BA.debugLineNum = 66125824;BA.debugLine="Public Sub PrintAndFeedPaper(units As Int)";
RDebugUtils.currentLine=66125825;
 //BA.debugLineNum = 66125825;BA.debugLine="WriteString(ESC & \"J\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"J");
RDebugUtils.currentLine=66125826;
 //BA.debugLineNum = 66125826;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=66125827;
 //BA.debugLineNum = 66125827;BA.debugLine="params(0) = units";
_params[(int) (0)] = (byte) (_units);
RDebugUtils.currentLine=66125828;
 //BA.debugLineNum = 66125828;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66125829;
 //BA.debugLineNum = 66125829;BA.debugLine="End Sub";
return "";
}
public int  _printimage(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.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=68288512;
 //BA.debugLineNum = 68288512;BA.debugLine="Public Sub PrintImage(img As AnImage) As Int";
RDebugUtils.currentLine=68288515;
 //BA.debugLineNum = 68288515;BA.debugLine="If img.width > 72 Then Return -1";
if (_img.Width /*int*/ >72) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=68288516;
 //BA.debugLineNum = 68288516;BA.debugLine="If img.height > 512 Then Return -2";
if (_img.Height /*int*/ >512) { 
if (true) return (int) (-2);};
RDebugUtils.currentLine=68288517;
 //BA.debugLineNum = 68288517;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=68288518;
 //BA.debugLineNum = 68288518;BA.debugLine="Dim xh As Int = img.width / 256";
_xh = (int) (_img.Width /*int*/ /(double)256);
RDebugUtils.currentLine=68288519;
 //BA.debugLineNum = 68288519;BA.debugLine="Dim xl As Int = img.width - xh * 256";
_xl = (int) (_img.Width /*int*/ -_xh*256);
RDebugUtils.currentLine=68288520;
 //BA.debugLineNum = 68288520;BA.debugLine="Dim yh As Int = img.height / 256";
_yh = (int) (_img.Height /*int*/ /(double)256);
RDebugUtils.currentLine=68288521;
 //BA.debugLineNum = 68288521;BA.debugLine="Dim yl As Int = img.height - yh * 256";
_yl = (int) (_img.Height /*int*/ -_yh*256);
RDebugUtils.currentLine=68288522;
 //BA.debugLineNum = 68288522;BA.debugLine="Dim params(5) As Byte";
_params = new byte[(int) (5)];
;
RDebugUtils.currentLine=68288523;
 //BA.debugLineNum = 68288523;BA.debugLine="params(0) = 0 '";
_params[(int) (0)] = (byte) (0);
RDebugUtils.currentLine=68288524;
 //BA.debugLineNum = 68288524;BA.debugLine="params(1) = xl";
_params[(int) (1)] = (byte) (_xl);
RDebugUtils.currentLine=68288525;
 //BA.debugLineNum = 68288525;BA.debugLine="params(2) = xh";
_params[(int) (2)] = (byte) (_xh);
RDebugUtils.currentLine=68288526;
 //BA.debugLineNum = 68288526;BA.debugLine="params(3) = yl";
_params[(int) (3)] = (byte) (_yl);
RDebugUtils.currentLine=68288527;
 //BA.debugLineNum = 68288527;BA.debugLine="params(4) = yh";
_params[(int) (4)] = (byte) (_yh);
RDebugUtils.currentLine=68288528;
 //BA.debugLineNum = 68288528;BA.debugLine="WriteString(GS & \"v0\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"v0");
RDebugUtils.currentLine=68288529;
 //BA.debugLineNum = 68288529;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68288530;
 //BA.debugLineNum = 68288530;BA.debugLine="WriteBytes(img.data)";
__ref._writebytes /*String*/ (null,_img.Data /*byte[]*/ );
RDebugUtils.currentLine=68288531;
 //BA.debugLineNum = 68288531;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=68288532;
 //BA.debugLineNum = 68288532;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=68288533;
 //BA.debugLineNum = 68288533;BA.debugLine="End Sub";
return 0;
}
public int  _printimage2(reparto_mazapa.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=68419584;
 //BA.debugLineNum = 68419584;BA.debugLine="Public Sub PrintImage2(width As Int, data() As Byt";
RDebugUtils.currentLine=68419585;
 //BA.debugLineNum = 68419585;BA.debugLine="Dim d As String = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=68419586;
 //BA.debugLineNum = 68419586;BA.debugLine="If Not(highdensity) And Not(dotds24 )	 Then";
if (__c.Not(_highdensity) && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=68419587;
 //BA.debugLineNum = 68419587;BA.debugLine="d = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=68419588;
 //BA.debugLineNum = 68419588;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=68419589;
 //BA.debugLineNum = 68419589;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=68419590;
 //BA.debugLineNum = 68419590;BA.debugLine="Else If highdensity And Not(dotds24) 	 Then";
if (_highdensity && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=68419591;
 //BA.debugLineNum = 68419591;BA.debugLine="d = Chr(1)";
_d = BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=68419592;
 //BA.debugLineNum = 68419592;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=68419593;
 //BA.debugLineNum = 68419593;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=68419594;
 //BA.debugLineNum = 68419594;BA.debugLine="Else 	If Not(highdensity) And dotds24 	 Then";
if (__c.Not(_highdensity) && _dotds24) { 
RDebugUtils.currentLine=68419595;
 //BA.debugLineNum = 68419595;BA.debugLine="d = Chr(32)";
_d = BA.ObjectToString(__c.Chr((int) (32)));
RDebugUtils.currentLine=68419596;
 //BA.debugLineNum = 68419596;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=68419597;
 //BA.debugLineNum = 68419597;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }else {
RDebugUtils.currentLine=68419599;
 //BA.debugLineNum = 68419599;BA.debugLine="d = Chr(33)";
_d = BA.ObjectToString(__c.Chr((int) (33)));
RDebugUtils.currentLine=68419600;
 //BA.debugLineNum = 68419600;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=68419601;
 //BA.debugLineNum = 68419601;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }}}
;
RDebugUtils.currentLine=68419603;
 //BA.debugLineNum = 68419603;BA.debugLine="Dim xh As Int = width / 256";
_xh = (int) (_width/(double)256);
RDebugUtils.currentLine=68419604;
 //BA.debugLineNum = 68419604;BA.debugLine="Dim xl As Int = width - xh * 256";
_xl = (int) (_width-_xh*256);
RDebugUtils.currentLine=68419605;
 //BA.debugLineNum = 68419605;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=68419606;
 //BA.debugLineNum = 68419606;BA.debugLine="params(0) = xl";
_params[(int) (0)] = (byte) (_xl);
RDebugUtils.currentLine=68419607;
 //BA.debugLineNum = 68419607;BA.debugLine="params(1) = xh";
_params[(int) (1)] = (byte) (_xh);
RDebugUtils.currentLine=68419608;
 //BA.debugLineNum = 68419608;BA.debugLine="WriteString(ESC & \"*\" & d)";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"*"+_d);
RDebugUtils.currentLine=68419609;
 //BA.debugLineNum = 68419609;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68419610;
 //BA.debugLineNum = 68419610;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=68419611;
 //BA.debugLineNum = 68419611;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=68419612;
 //BA.debugLineNum = 68419612;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=68419613;
 //BA.debugLineNum = 68419613;BA.debugLine="End Sub";
return 0;
}
public String  _reset(reparto_mazapa.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=66060288;
 //BA.debugLineNum = 66060288;BA.debugLine="Public Sub Reset";
RDebugUtils.currentLine=66060289;
 //BA.debugLineNum = 66060289;BA.debugLine="WriteString(ESC & \"@\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"@");
RDebugUtils.currentLine=66060290;
 //BA.debugLineNum = 66060290;BA.debugLine="End Sub";
return "";
}
public String  _serial1_connected(reparto_mazapa.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=69009408;
 //BA.debugLineNum = 69009408;BA.debugLine="Private Sub Serial1_Connected (Success As Boolean)";
RDebugUtils.currentLine=69009409;
 //BA.debugLineNum = 69009409;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=69009410;
 //BA.debugLineNum = 69009410;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=69009411;
 //BA.debugLineNum = 69009411;BA.debugLine="Connected = True";
__ref._connected /*boolean*/  = __c.True;
RDebugUtils.currentLine=69009412;
 //BA.debugLineNum = 69009412;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=69009413;
 //BA.debugLineNum = 69009413;BA.debugLine="Serial1.Listen";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Listen(ba);
 }else {
RDebugUtils.currentLine=69009415;
 //BA.debugLineNum = 69009415;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=69009416;
 //BA.debugLineNum = 69009416;BA.debugLine="ConnectedError = LastException.Message";
__ref._connectederror /*String*/  = __c.LastException(getActivityBA()).getMessage();
 };
RDebugUtils.currentLine=69009418;
 //BA.debugLineNum = 69009418;BA.debugLine="If SubExists(CallBack, EventName & \"_Connected\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected")) { 
RDebugUtils.currentLine=69009419;
 //BA.debugLineNum = 69009419;BA.debugLine="CallSub2(CallBack, EventName & \"_Connected\", Suc";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected",(Object)(_success));
 };
RDebugUtils.currentLine=69009421;
 //BA.debugLineNum = 69009421;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeheight(reparto_mazapa.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=68550656;
 //BA.debugLineNum = 68550656;BA.debugLine="Public Sub setBarCodeHeight(height As Int)";
RDebugUtils.currentLine=68550657;
 //BA.debugLineNum = 68550657;BA.debugLine="WriteString(GS & \"h\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"h");
RDebugUtils.currentLine=68550658;
 //BA.debugLineNum = 68550658;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=68550659;
 //BA.debugLineNum = 68550659;BA.debugLine="params(0) = height";
_params[(int) (0)] = (byte) (_height);
RDebugUtils.currentLine=68550660;
 //BA.debugLineNum = 68550660;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68550661;
 //BA.debugLineNum = 68550661;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeleft(reparto_mazapa.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=68616192;
 //BA.debugLineNum = 68616192;BA.debugLine="Public Sub setBarCodeLeft(left As Int)";
RDebugUtils.currentLine=68616193;
 //BA.debugLineNum = 68616193;BA.debugLine="WriteString(GS & \"x\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"x");
RDebugUtils.currentLine=68616194;
 //BA.debugLineNum = 68616194;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=68616195;
 //BA.debugLineNum = 68616195;BA.debugLine="params(0) = left";
_params[(int) (0)] = (byte) (_left);
RDebugUtils.currentLine=68616196;
 //BA.debugLineNum = 68616196;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68616197;
 //BA.debugLineNum = 68616197;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodewidth(reparto_mazapa.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=68681728;
 //BA.debugLineNum = 68681728;BA.debugLine="Public Sub setBarCodeWidth(width As Int)";
RDebugUtils.currentLine=68681729;
 //BA.debugLineNum = 68681729;BA.debugLine="WriteString(GS & \"w\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"w");
RDebugUtils.currentLine=68681730;
 //BA.debugLineNum = 68681730;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=68681731;
 //BA.debugLineNum = 68681731;BA.debugLine="params(0) = width";
_params[(int) (0)] = (byte) (_width);
RDebugUtils.currentLine=68681732;
 //BA.debugLineNum = 68681732;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68681733;
 //BA.debugLineNum = 68681733;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterfont(reparto_mazapa.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=66650112;
 //BA.debugLineNum = 66650112;BA.debugLine="Public Sub setCharacterFont(font As Int)";
RDebugUtils.currentLine=66650113;
 //BA.debugLineNum = 66650113;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=66650114;
 //BA.debugLineNum = 66650114;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterspacing(reparto_mazapa.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=66191360;
 //BA.debugLineNum = 66191360;BA.debugLine="Public Sub setCharacterSpacing(spacing As Int)";
RDebugUtils.currentLine=66191361;
 //BA.debugLineNum = 66191361;BA.debugLine="WriteString(ESC & \" \")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +" ");
RDebugUtils.currentLine=66191362;
 //BA.debugLineNum = 66191362;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=66191363;
 //BA.debugLineNum = 66191363;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=66191364;
 //BA.debugLineNum = 66191364;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66191365;
 //BA.debugLineNum = 66191365;BA.debugLine="End Sub";
return "";
}
public String  _setcodepage(reparto_mazapa.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=66584576;
 //BA.debugLineNum = 66584576;BA.debugLine="Public Sub setCodePage(codepage As Int)";
RDebugUtils.currentLine=66584577;
 //BA.debugLineNum = 66584577;BA.debugLine="WriteString(ESC & \"t\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"t");
RDebugUtils.currentLine=66584578;
 //BA.debugLineNum = 66584578;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=66584579;
 //BA.debugLineNum = 66584579;BA.debugLine="params(0) = codepage";
_params[(int) (0)] = (byte) (_codepage);
RDebugUtils.currentLine=66584580;
 //BA.debugLineNum = 66584580;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66584581;
 //BA.debugLineNum = 66584581;BA.debugLine="End Sub";
return "";
}
public String  _sethrifont(reparto_mazapa.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=68812800;
 //BA.debugLineNum = 68812800;BA.debugLine="Public Sub setHriFont(font As Int)";
RDebugUtils.currentLine=68812801;
 //BA.debugLineNum = 68812801;BA.debugLine="WriteString(GS & \"f\" & Chr(font))";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"f"+BA.ObjectToString(__c.Chr(_font)));
RDebugUtils.currentLine=68812802;
 //BA.debugLineNum = 68812802;BA.debugLine="End Sub";
return "";
}
public String  _sethriposn(reparto_mazapa.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=68747264;
 //BA.debugLineNum = 68747264;BA.debugLine="Public Sub setHriPosn(posn As Int)";
RDebugUtils.currentLine=68747265;
 //BA.debugLineNum = 68747265;BA.debugLine="WriteString(GS & \"H\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"H");
RDebugUtils.currentLine=68747266;
 //BA.debugLineNum = 68747266;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=68747267;
 //BA.debugLineNum = 68747267;BA.debugLine="params(0) = posn";
_params[(int) (0)] = (byte) (_posn);
RDebugUtils.currentLine=68747268;
 //BA.debugLineNum = 68747268;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68747269;
 //BA.debugLineNum = 68747269;BA.debugLine="End Sub";
return "";
}
public String  _setjustify(reparto_mazapa.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=66519040;
 //BA.debugLineNum = 66519040;BA.debugLine="Public Sub setJustify(justify As Int)";
RDebugUtils.currentLine=66519041;
 //BA.debugLineNum = 66519041;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=66519042;
 //BA.debugLineNum = 66519042;BA.debugLine="End Sub";
return "";
}
public String  _setleftinset(reparto_mazapa.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=66256896;
 //BA.debugLineNum = 66256896;BA.debugLine="Public Sub setLeftInset(inset As Int)";
RDebugUtils.currentLine=66256897;
 //BA.debugLineNum = 66256897;BA.debugLine="Dim dh As Int = inset / 256";
_dh = (int) (_inset/(double)256);
RDebugUtils.currentLine=66256898;
 //BA.debugLineNum = 66256898;BA.debugLine="Dim dl As Int = inset - dh";
_dl = (int) (_inset-_dh);
RDebugUtils.currentLine=66256899;
 //BA.debugLineNum = 66256899;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=66256900;
 //BA.debugLineNum = 66256900;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=66256901;
 //BA.debugLineNum = 66256901;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=66256902;
 //BA.debugLineNum = 66256902;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=66256903;
 //BA.debugLineNum = 66256903;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66256904;
 //BA.debugLineNum = 66256904;BA.debugLine="End Sub";
return "";
}
public String  _setleftmargin(reparto_mazapa.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=66322432;
 //BA.debugLineNum = 66322432;BA.debugLine="Public Sub setLeftMargin(margin As Int)";
RDebugUtils.currentLine=66322433;
 //BA.debugLineNum = 66322433;BA.debugLine="Dim dh As Int = margin / 256";
_dh = (int) (_margin/(double)256);
RDebugUtils.currentLine=66322434;
 //BA.debugLineNum = 66322434;BA.debugLine="Dim dl As Int = margin - dh";
_dl = (int) (_margin-_dh);
RDebugUtils.currentLine=66322435;
 //BA.debugLineNum = 66322435;BA.debugLine="WriteString(GS & \"L\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"L");
RDebugUtils.currentLine=66322436;
 //BA.debugLineNum = 66322436;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=66322437;
 //BA.debugLineNum = 66322437;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=66322438;
 //BA.debugLineNum = 66322438;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=66322439;
 //BA.debugLineNum = 66322439;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66322440;
 //BA.debugLineNum = 66322440;BA.debugLine="End Sub";
return "";
}
public String  _setlinespacing(reparto_mazapa.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=66453504;
 //BA.debugLineNum = 66453504;BA.debugLine="Public Sub setLineSpacing(spacing As Int)";
RDebugUtils.currentLine=66453505;
 //BA.debugLineNum = 66453505;BA.debugLine="If spacing < 0 Then";
if (_spacing<0) { 
RDebugUtils.currentLine=66453506;
 //BA.debugLineNum = 66453506;BA.debugLine="WriteString(ESC & \"2\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"2");
 }else {
RDebugUtils.currentLine=66453508;
 //BA.debugLineNum = 66453508;BA.debugLine="WriteString(ESC & \"3\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"3");
RDebugUtils.currentLine=66453509;
 //BA.debugLineNum = 66453509;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=66453510;
 //BA.debugLineNum = 66453510;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=66453511;
 //BA.debugLineNum = 66453511;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
 };
RDebugUtils.currentLine=66453513;
 //BA.debugLineNum = 66453513;BA.debugLine="End Sub";
return "";
}
public String  _setprintwidth(reparto_mazapa.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=66387968;
 //BA.debugLineNum = 66387968;BA.debugLine="Public Sub setPrintWidth(width As Int)";
RDebugUtils.currentLine=66387969;
 //BA.debugLineNum = 66387969;BA.debugLine="Dim dh As Int = width / 256";
_dh = (int) (_width/(double)256);
RDebugUtils.currentLine=66387970;
 //BA.debugLineNum = 66387970;BA.debugLine="Dim dl As Int = width - dh";
_dl = (int) (_width-_dh);
RDebugUtils.currentLine=66387971;
 //BA.debugLineNum = 66387971;BA.debugLine="WriteString(GS & \"W\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"W");
RDebugUtils.currentLine=66387972;
 //BA.debugLineNum = 66387972;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=66387973;
 //BA.debugLineNum = 66387973;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=66387974;
 //BA.debugLineNum = 66387974;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=66387975;
 //BA.debugLineNum = 66387975;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66387976;
 //BA.debugLineNum = 66387976;BA.debugLine="End Sub";
return "";
}
public String  _setrelativeprintposn(reparto_mazapa.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=66781184;
 //BA.debugLineNum = 66781184;BA.debugLine="Public Sub setRelativePrintPosn(relposn As Int)";
RDebugUtils.currentLine=66781185;
 //BA.debugLineNum = 66781185;BA.debugLine="Dim dh As Int = relposn / 256";
_dh = (int) (_relposn/(double)256);
RDebugUtils.currentLine=66781186;
 //BA.debugLineNum = 66781186;BA.debugLine="Dim dl As Int = relposn - dh";
_dl = (int) (_relposn-_dh);
RDebugUtils.currentLine=66781187;
 //BA.debugLineNum = 66781187;BA.debugLine="WriteString(ESC & \"\\\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"\\");
RDebugUtils.currentLine=66781188;
 //BA.debugLineNum = 66781188;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=66781189;
 //BA.debugLineNum = 66781189;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=66781190;
 //BA.debugLineNum = 66781190;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=66781191;
 //BA.debugLineNum = 66781191;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=66781192;
 //BA.debugLineNum = 66781192;BA.debugLine="End Sub";
return "";
}
public String  _settabpositions(reparto_mazapa.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=66715648;
 //BA.debugLineNum = 66715648;BA.debugLine="Public Sub setTabPositions(tabs() As Int)";
RDebugUtils.currentLine=66715649;
 //BA.debugLineNum = 66715649;BA.debugLine="WriteString(ESC & \"D\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"D");
RDebugUtils.currentLine=66715650;
 //BA.debugLineNum = 66715650;BA.debugLine="Dim data(tabs.Length+1) As Byte";
_data = new byte[(int) (_tabs.length+1)];
;
RDebugUtils.currentLine=66715651;
 //BA.debugLineNum = 66715651;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=66715652;
 //BA.debugLineNum = 66715652;BA.debugLine="data(i) = tabs(i)";
_data[_i] = (byte) (_tabs[_i]);
 }
};
RDebugUtils.currentLine=66715654;
 //BA.debugLineNum = 66715654;BA.debugLine="data(tabs.Length) = 0";
_data[_tabs.length] = (byte) (0);
RDebugUtils.currentLine=66715655;
 //BA.debugLineNum = 66715655;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=66715656;
 //BA.debugLineNum = 66715656;BA.debugLine="End Sub";
return "";
}
public String  _setusecustomcharacters(reparto_mazapa.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=67108864;
 //BA.debugLineNum = 67108864;BA.debugLine="Public Sub setUseCustomCharacters(custom As Boolea";
RDebugUtils.currentLine=67108865;
 //BA.debugLineNum = 67108865;BA.debugLine="If custom Then";
if (_custom) { 
RDebugUtils.currentLine=67108866;
 //BA.debugLineNum = 67108866;BA.debugLine="WriteString(ESC & \"%1\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%1");
 }else {
RDebugUtils.currentLine=67108868;
 //BA.debugLineNum = 67108868;BA.debugLine="WriteString(ESC & \"%0\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%0");
 };
RDebugUtils.currentLine=67108870;
 //BA.debugLineNum = 67108870;BA.debugLine="End Sub";
return "";
}
public reparto_mazapa.keymon.lat.escposprinter._animage  _thresholdimage(reparto_mazapa.keymon.lat.escposprinter __ref,reparto_mazapa.keymon.lat.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "thresholdimage", false))
	 {return ((reparto_mazapa.keymon.lat.escposprinter._animage) Debug.delegate(ba, "thresholdimage", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _i = 0;
int _lum = 0;
reparto_mazapa.keymon.lat.escposprinter._animage _ret = null;
RDebugUtils.currentLine=68091904;
 //BA.debugLineNum = 68091904;BA.debugLine="Sub ThresholdImage(img As AnImage, threshold As In";
RDebugUtils.currentLine=68091905;
 //BA.debugLineNum = 68091905;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=68091906;
 //BA.debugLineNum = 68091906;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=68091907;
 //BA.debugLineNum = 68091907;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=68091908;
 //BA.debugLineNum = 68091908;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=68091909;
 //BA.debugLineNum = 68091909;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=68091911;
 //BA.debugLineNum = 68091911;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=68091913;
 //BA.debugLineNum = 68091913;BA.debugLine="pixels(i) = lum";
_pixels[_i] = (byte) (_lum);
 }
};
RDebugUtils.currentLine=68091915;
 //BA.debugLineNum = 68091915;BA.debugLine="Dim ret As AnImage";
_ret = new reparto_mazapa.keymon.lat.escposprinter._animage();
RDebugUtils.currentLine=68091916;
 //BA.debugLineNum = 68091916;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=68091917;
 //BA.debugLineNum = 68091917;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=68091918;
 //BA.debugLineNum = 68091918;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=68091919;
 //BA.debugLineNum = 68091919;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=68091920;
 //BA.debugLineNum = 68091920;BA.debugLine="End Sub";
return null;
}
public String  _writebarcode(reparto_mazapa.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=68878336;
 //BA.debugLineNum = 68878336;BA.debugLine="Public Sub WriteBarCode(bartype As String, data As";
RDebugUtils.currentLine=68878337;
 //BA.debugLineNum = 68878337;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ASCII\")";
_databytes = _data.getBytes("ASCII");
RDebugUtils.currentLine=68878338;
 //BA.debugLineNum = 68878338;BA.debugLine="Dim dlow As Int = databytes.Length";
_dlow = _databytes.length;
RDebugUtils.currentLine=68878339;
 //BA.debugLineNum = 68878339;BA.debugLine="Log(\"Barcode \" & bartype & \", Size \" & dlow & \",";
__c.LogImpl("368878339","Barcode "+_bartype+", Size "+BA.NumberToString(_dlow)+", "+_data,0);
RDebugUtils.currentLine=68878340;
 //BA.debugLineNum = 68878340;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=68878341;
 //BA.debugLineNum = 68878341;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=68878342;
 //BA.debugLineNum = 68878342;BA.debugLine="params(0) = dlow";
_params[(int) (0)] = (byte) (_dlow);
RDebugUtils.currentLine=68878343;
 //BA.debugLineNum = 68878343;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68878344;
 //BA.debugLineNum = 68878344;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=68878345;
 //BA.debugLineNum = 68878345;BA.debugLine="End Sub";
return "";
}
public String  _writeqrcode(reparto_mazapa.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=68943872;
 //BA.debugLineNum = 68943872;BA.debugLine="Public Sub WriteQRCode(size As Int, EC As String,";
RDebugUtils.currentLine=68943873;
 //BA.debugLineNum = 68943873;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ISO-8859";
_databytes = _data.getBytes("ISO-8859-1");
RDebugUtils.currentLine=68943874;
 //BA.debugLineNum = 68943874;BA.debugLine="Dim dhigh As Int = databytes.Length / 256";
_dhigh = (int) (_databytes.length/(double)256);
RDebugUtils.currentLine=68943875;
 //BA.debugLineNum = 68943875;BA.debugLine="Dim dlow As Int = databytes.Length - dhigh*256";
_dlow = (int) (_databytes.length-_dhigh*256);
RDebugUtils.currentLine=68943876;
 //BA.debugLineNum = 68943876;BA.debugLine="Log(\"QR Code : Size \" & size & \", EC \" & EC & \",";
__c.LogImpl("368943876","QR Code : Size "+BA.NumberToString(_size)+", EC "+_ec+", Scale "+BA.NumberToString(_scale)+", Size "+BA.NumberToString(_dlow)+" "+BA.NumberToString(_dhigh)+" : Data = "+_data,0);
RDebugUtils.currentLine=68943877;
 //BA.debugLineNum = 68943877;BA.debugLine="Dim params(3) As Byte";
_params = new byte[(int) (3)];
;
RDebugUtils.currentLine=68943878;
 //BA.debugLineNum = 68943878;BA.debugLine="params(0) = scale";
_params[(int) (0)] = (byte) (_scale);
RDebugUtils.currentLine=68943879;
 //BA.debugLineNum = 68943879;BA.debugLine="params(1) = dlow";
_params[(int) (1)] = (byte) (_dlow);
RDebugUtils.currentLine=68943880;
 //BA.debugLineNum = 68943880;BA.debugLine="params(2) = dhigh";
_params[(int) (2)] = (byte) (_dhigh);
RDebugUtils.currentLine=68943881;
 //BA.debugLineNum = 68943881;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=68943882;
 //BA.debugLineNum = 68943882;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=68943883;
 //BA.debugLineNum = 68943883;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=68943884;
 //BA.debugLineNum = 68943884;BA.debugLine="End Sub";
return "";
}
public String  _writestring2(reparto_mazapa.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=66977792;
 //BA.debugLineNum = 66977792;BA.debugLine="Public Sub WriteString2(data As String, encoding A";
RDebugUtils.currentLine=66977793;
 //BA.debugLineNum = 66977793;BA.debugLine="Try";
try {RDebugUtils.currentLine=66977794;
 //BA.debugLineNum = 66977794;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=66977795;
 //BA.debugLineNum = 66977795;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=66977798;
 //BA.debugLineNum = 66977798;BA.debugLine="Log(\"Printer error : \" & LastException.Message)";
__c.LogImpl("366977798","Printer error : "+__c.LastException(getActivityBA()).getMessage(),0);
RDebugUtils.currentLine=66977799;
 //BA.debugLineNum = 66977799;BA.debugLine="AStream_Error";
__ref._astream_error /*String*/ (null);
 };
RDebugUtils.currentLine=66977801;
 //BA.debugLineNum = 66977801;BA.debugLine="End Sub";
return "";
}
}