package gunav2.keymon.com.mx;


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, "gunav2.keymon.com.mx.escposprinter");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", gunav2.keymon.com.mx.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 gunav2.keymon.com.mx.main _main = null;
public gunav2.keymon.com.mx.starter _starter = null;
public gunav2.keymon.com.mx.subs _subs = null;
public gunav2.keymon.com.mx.appupdater _appupdater = null;
public gunav2.keymon.com.mx.tracker _tracker = null;
public gunav2.keymon.com.mx.firebasemessaging _firebasemessaging = null;
public gunav2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public gunav2.keymon.com.mx.newinst2 _newinst2 = null;
public gunav2.keymon.com.mx.b4xpages _b4xpages = null;
public gunav2.keymon.com.mx.b4xcollections _b4xcollections = null;
public gunav2.keymon.com.mx.httputils2service _httputils2service = null;
public gunav2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _initialize(gunav2.keymon.com.mx.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=88342528;
 //BA.debugLineNum = 88342528;BA.debugLine="Public Sub Initialize(vCallback As Object, vEventN";
RDebugUtils.currentLine=88342529;
 //BA.debugLineNum = 88342529;BA.debugLine="EventName = vEventName";
__ref._eventname /*String*/  = _veventname;
RDebugUtils.currentLine=88342530;
 //BA.debugLineNum = 88342530;BA.debugLine="CallBack = vCallback";
__ref._callback /*Object*/  = _vcallback;
RDebugUtils.currentLine=88342531;
 //BA.debugLineNum = 88342531;BA.debugLine="Serial1.Initialize(\"Serial1\")";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Initialize("Serial1");
RDebugUtils.currentLine=88342532;
 //BA.debugLineNum = 88342532;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=88342533;
 //BA.debugLineNum = 88342533;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=88342534;
 //BA.debugLineNum = 88342534;BA.debugLine="End Sub";
return "";
}
public boolean  _isconnected(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "isconnected", false))
	 {return ((Boolean) Debug.delegate(ba, "isconnected", null));}
RDebugUtils.currentLine=88473600;
 //BA.debugLineNum = 88473600;BA.debugLine="Public Sub IsConnected As Boolean";
RDebugUtils.currentLine=88473601;
 //BA.debugLineNum = 88473601;BA.debugLine="Return Connected";
if (true) return __ref._connected /*boolean*/ ;
RDebugUtils.currentLine=88473602;
 //BA.debugLineNum = 88473602;BA.debugLine="End Sub";
return false;
}
public String  _disconnect(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "disconnect", false))
	 {return ((String) Debug.delegate(ba, "disconnect", null));}
RDebugUtils.currentLine=88670208;
 //BA.debugLineNum = 88670208;BA.debugLine="Public Sub DisConnect";
RDebugUtils.currentLine=88670209;
 //BA.debugLineNum = 88670209;BA.debugLine="Serial1.Disconnect";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
RDebugUtils.currentLine=88670210;
 //BA.debugLineNum = 88670210;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=88670211;
 //BA.debugLineNum = 88670211;BA.debugLine="End Sub";
return "";
}
public boolean  _connect(gunav2.keymon.com.mx.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=88604672;
 //BA.debugLineNum = 88604672;BA.debugLine="Public Sub Connect As Boolean";
RDebugUtils.currentLine=88604676;
 //BA.debugLineNum = 88604676;BA.debugLine="Try";
try {RDebugUtils.currentLine=88604677;
 //BA.debugLineNum = 88604677;BA.debugLine="If Starter.MAC_IMPRESORA = \"0\" Then";
if ((_starter._mac_impresora /*String*/ ).equals("0")) { 
RDebugUtils.currentLine=88604678;
 //BA.debugLineNum = 88604678;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=88604679;
 //BA.debugLineNum = 88604679;BA.debugLine="PairedDevices = Serial1.GetPairedDevices";
_paireddevices = __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .GetPairedDevices();
RDebugUtils.currentLine=88604680;
 //BA.debugLineNum = 88604680;BA.debugLine="Dim l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=88604681;
 //BA.debugLineNum = 88604681;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=88604682;
 //BA.debugLineNum = 88604682;BA.debugLine="Log(\"aqui 1\")";
__c.LogImpl("088604682","aqui 1",0);
RDebugUtils.currentLine=88604683;
 //BA.debugLineNum = 88604683;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=88604684;
 //BA.debugLineNum = 88604684;BA.debugLine="l.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
RDebugUtils.currentLine=88604685;
 //BA.debugLineNum = 88604685;BA.debugLine="Log(\"aqui 2\")";
__c.LogImpl("088604685","aqui 2",0);
RDebugUtils.currentLine=88604686;
 //BA.debugLineNum = 88604686;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
 }
};
RDebugUtils.currentLine=88604688;
 //BA.debugLineNum = 88604688;BA.debugLine="Dim Res As Int";
_res = 0;
RDebugUtils.currentLine=88604689;
 //BA.debugLineNum = 88604689;BA.debugLine="Res = InputList(l, \"Choose a printer\", -1) 'sho";
_res = __c.InputList(_l,BA.ObjectToCharSequence("Choose a printer"),(int) (-1),getActivityBA());
RDebugUtils.currentLine=88604690;
 //BA.debugLineNum = 88604690;BA.debugLine="If Res <> DialogResponse.CANCEL Then";
if (_res!=__c.DialogResponse.CANCEL) { 
RDebugUtils.currentLine=88604691;
 //BA.debugLineNum = 88604691;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=88604693;
 //BA.debugLineNum = 88604693;BA.debugLine="Starter.mac_impresora = PairedDevices.Get(l.Ge";
_starter._mac_impresora /*String*/  = BA.ObjectToString(_paireddevices.Get(_l.Get(_res)));
RDebugUtils.currentLine=88604694;
 //BA.debugLineNum = 88604694;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=88604695;
 //BA.debugLineNum = 88604695;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=88604696;
 //BA.debugLineNum = 88604696;BA.debugLine="Log(\"aqui 3\")";
__c.LogImpl("088604696","aqui 3",0);
 };
RDebugUtils.currentLine=88604698;
 //BA.debugLineNum = 88604698;BA.debugLine="Log(\"aqui 4\")";
__c.LogImpl("088604698","aqui 4",0);
RDebugUtils.currentLine=88604699;
 //BA.debugLineNum = 88604699;BA.debugLine="Return False";
if (true) return __c.False;
 }else {
RDebugUtils.currentLine=88604701;
 //BA.debugLineNum = 88604701;BA.debugLine="Serial1.Connect(Starter.mac_impresora)";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,_starter._mac_impresora /*String*/ );
RDebugUtils.currentLine=88604703;
 //BA.debugLineNum = 88604703;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=88604704;
 //BA.debugLineNum = 88604704;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=88604705;
 //BA.debugLineNum = 88604705;BA.debugLine="Log(\"aqui 5\")";
__c.LogImpl("088604705","aqui 5",0);
 };
 } 
       catch (Exception e31) {
			ba.setLastException(e31);RDebugUtils.currentLine=88604708;
 //BA.debugLineNum = 88604708;BA.debugLine="Log(LastException)";
__c.LogImpl("088604708",BA.ObjectToString(__c.LastException(getActivityBA())),0);
RDebugUtils.currentLine=88604709;
 //BA.debugLineNum = 88604709;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=88604711;
 //BA.debugLineNum = 88604711;BA.debugLine="End Sub";
return false;
}
public String  _writestring(gunav2.keymon.com.mx.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=89587712;
 //BA.debugLineNum = 89587712;BA.debugLine="Public Sub WriteString(data As String)";
RDebugUtils.currentLine=89587713;
 //BA.debugLineNum = 89587713;BA.debugLine="WriteString2(data, \"IBM437\")";
__ref._writestring2 /*String*/ (null,_data,"IBM437");
RDebugUtils.currentLine=89587714;
 //BA.debugLineNum = 89587714;BA.debugLine="End Sub";
return "";
}
public String  _astream_error(gunav2.keymon.com.mx.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=91815936;
 //BA.debugLineNum = 91815936;BA.debugLine="Private Sub AStream_Error";
RDebugUtils.currentLine=91815937;
 //BA.debugLineNum = 91815937;BA.debugLine="If SubExists(CallBack, EventName & \"_Error\") Then";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error")) { 
RDebugUtils.currentLine=91815938;
 //BA.debugLineNum = 91815938;BA.debugLine="CallSub(CallBack, EventName & \"_Error\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error");
 };
RDebugUtils.currentLine=91815940;
 //BA.debugLineNum = 91815940;BA.debugLine="End Sub";
return "";
}
public String  _astream_newdata(gunav2.keymon.com.mx.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=91750400;
 //BA.debugLineNum = 91750400;BA.debugLine="Private Sub AStream_NewData (Buffer() As Byte)";
RDebugUtils.currentLine=91750401;
 //BA.debugLineNum = 91750401;BA.debugLine="If SubExists(CallBack, EventName & \"_NewData\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData")) { 
RDebugUtils.currentLine=91750402;
 //BA.debugLineNum = 91750402;BA.debugLine="CallSub2(CallBack, EventName & \"_NewData\", Buffe";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData",(Object)(_buffer));
 };
RDebugUtils.currentLine=91750404;
 //BA.debugLineNum = 91750404;BA.debugLine="Log(\"Data \" & Buffer(0))";
__c.LogImpl("091750404","Data "+BA.NumberToString(_buffer[(int) (0)]),0);
RDebugUtils.currentLine=91750405;
 //BA.debugLineNum = 91750405;BA.debugLine="End Sub";
return "";
}
public String  _astream_terminated(gunav2.keymon.com.mx.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=91881472;
 //BA.debugLineNum = 91881472;BA.debugLine="Private Sub AStream_Terminated";
RDebugUtils.currentLine=91881473;
 //BA.debugLineNum = 91881473;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=91881474;
 //BA.debugLineNum = 91881474;BA.debugLine="If SubExists(CallBack, EventName & \"_Terminated\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated")) { 
RDebugUtils.currentLine=91881475;
 //BA.debugLineNum = 91881475;BA.debugLine="CallSub(CallBack, EventName & \"_Terminated\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated");
 };
RDebugUtils.currentLine=91881477;
 //BA.debugLineNum = 91881477;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
RDebugUtils.currentLine=88276992;
 //BA.debugLineNum = 88276992;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=88276999;
 //BA.debugLineNum = 88276999;BA.debugLine="Private Version As Double = 2.0 ' Printer class v";
_version = 2.0;
RDebugUtils.currentLine=88277001;
 //BA.debugLineNum = 88277001;BA.debugLine="Type AnImage(Width As Int, Height As Int, Data()";
;
RDebugUtils.currentLine=88277003;
 //BA.debugLineNum = 88277003;BA.debugLine="Private EventName As String 'ignore";
_eventname = "";
RDebugUtils.currentLine=88277004;
 //BA.debugLineNum = 88277004;BA.debugLine="Private CallBack As Object 'ignore";
_callback = new Object();
RDebugUtils.currentLine=88277006;
 //BA.debugLineNum = 88277006;BA.debugLine="Private Serial1 As Serial";
_serial1 = new anywheresoftware.b4a.objects.Serial();
RDebugUtils.currentLine=88277007;
 //BA.debugLineNum = 88277007;BA.debugLine="Private Astream As AsyncStreams";
_astream = new anywheresoftware.b4a.randomaccessfile.AsyncStreams();
RDebugUtils.currentLine=88277008;
 //BA.debugLineNum = 88277008;BA.debugLine="Private Connected As Boolean";
_connected = false;
RDebugUtils.currentLine=88277009;
 //BA.debugLineNum = 88277009;BA.debugLine="Private ConnectedError As String";
_connectederror = "";
RDebugUtils.currentLine=88277011;
 //BA.debugLineNum = 88277011;BA.debugLine="Dim ESC As String = Chr(27)";
_esc = BA.ObjectToString(__c.Chr((int) (27)));
RDebugUtils.currentLine=88277012;
 //BA.debugLineNum = 88277012;BA.debugLine="Dim FS As String = Chr(28)";
_fs = BA.ObjectToString(__c.Chr((int) (28)));
RDebugUtils.currentLine=88277013;
 //BA.debugLineNum = 88277013;BA.debugLine="Dim GS As String = Chr(29)";
_gs = BA.ObjectToString(__c.Chr((int) (29)));
RDebugUtils.currentLine=88277016;
 //BA.debugLineNum = 88277016;BA.debugLine="Dim UNREVERSE As String  = GS & \"B\" & Chr(0)";
_unreverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=88277017;
 //BA.debugLineNum = 88277017;BA.debugLine="Dim REVERSE As String = GS & \"B\" & Chr(1)";
_reverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=88277020;
 //BA.debugLineNum = 88277020;BA.debugLine="Dim UNINVERT As String = ESC & \"{0\"";
_uninvert = __ref._esc /*String*/ +"{0";
RDebugUtils.currentLine=88277021;
 //BA.debugLineNum = 88277021;BA.debugLine="Dim INVERT As String = ESC & \"{1\"";
_invert = __ref._esc /*String*/ +"{1";
RDebugUtils.currentLine=88277024;
 //BA.debugLineNum = 88277024;BA.debugLine="Dim UNROTATE As String = ESC & \"V0\"";
_unrotate = __ref._esc /*String*/ +"V0";
RDebugUtils.currentLine=88277025;
 //BA.debugLineNum = 88277025;BA.debugLine="Dim ROTATE As String = ESC & \"V1\"";
_rotate = __ref._esc /*String*/ +"V1";
RDebugUtils.currentLine=88277028;
 //BA.debugLineNum = 88277028;BA.debugLine="Dim HT As String = Chr(9)";
_ht = BA.ObjectToString(__c.Chr((int) (9)));
RDebugUtils.currentLine=88277031;
 //BA.debugLineNum = 88277031;BA.debugLine="Dim ULINE0 As String = ESC & \"-0\"";
_uline0 = __ref._esc /*String*/ +"-0";
RDebugUtils.currentLine=88277032;
 //BA.debugLineNum = 88277032;BA.debugLine="Dim ULINE1 As String = ESC & \"-1\"";
_uline1 = __ref._esc /*String*/ +"-1";
RDebugUtils.currentLine=88277033;
 //BA.debugLineNum = 88277033;BA.debugLine="Dim ULINE2 As String = ESC & \"-2\"";
_uline2 = __ref._esc /*String*/ +"-2";
RDebugUtils.currentLine=88277036;
 //BA.debugLineNum = 88277036;BA.debugLine="Dim BOLD As String = ESC & \"E1\"";
_bold = __ref._esc /*String*/ +"E1";
RDebugUtils.currentLine=88277037;
 //BA.debugLineNum = 88277037;BA.debugLine="Dim NOBOLD As String = ESC & \"E0\"";
_nobold = __ref._esc /*String*/ +"E0";
RDebugUtils.currentLine=88277040;
 //BA.debugLineNum = 88277040;BA.debugLine="Dim SINGLE As String = GS & \"!\" & Chr(0x00)";
_single = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x00)));
RDebugUtils.currentLine=88277041;
 //BA.debugLineNum = 88277041;BA.debugLine="Dim HIGH As String = GS & \"!\" & Chr(0x01)";
_high = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x01)));
RDebugUtils.currentLine=88277042;
 //BA.debugLineNum = 88277042;BA.debugLine="Dim WIDE As String = GS & \"!\" & Chr(0x10)";
_wide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x10)));
RDebugUtils.currentLine=88277043;
 //BA.debugLineNum = 88277043;BA.debugLine="Dim HIGHWIDE As String = GS & \"!\" & Chr(0x11)";
_highwide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x11)));
RDebugUtils.currentLine=88277046;
 //BA.debugLineNum = 88277046;BA.debugLine="Private LEFTJUSTIFY As String = ESC & \"a0\"";
_leftjustify = __ref._esc /*String*/ +"a0";
RDebugUtils.currentLine=88277047;
 //BA.debugLineNum = 88277047;BA.debugLine="Private LINEDEFAULT As String = ESC & \"2\"";
_linedefault = __ref._esc /*String*/ +"2";
RDebugUtils.currentLine=88277048;
 //BA.debugLineNum = 88277048;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=88277049;
 //BA.debugLineNum = 88277049;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=88277050;
 //BA.debugLineNum = 88277050;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=88277051;
 //BA.debugLineNum = 88277051;BA.debugLine="Private CHARSPACING0 As String = ESC & \" \" & Chr(";
_charspacing0 = __ref._esc /*String*/ +" "+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=88277052;
 //BA.debugLineNum = 88277052;BA.debugLine="Private CHARFONT0 As String = ESC & \"M\" & Chr(0)";
_charfont0 = __ref._esc /*String*/ +"M"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=88277053;
 //BA.debugLineNum = 88277053;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=88277056;
 //BA.debugLineNum = 88277056;BA.debugLine="End Sub";
return "";
}
public String  _connectederrormsg(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "connectederrormsg", false))
	 {return ((String) Debug.delegate(ba, "connectederrormsg", null));}
RDebugUtils.currentLine=88408064;
 //BA.debugLineNum = 88408064;BA.debugLine="Public Sub ConnectedErrorMsg As String";
RDebugUtils.currentLine=88408065;
 //BA.debugLineNum = 88408065;BA.debugLine="Return ConnectedError";
if (true) return __ref._connectederror /*String*/ ;
RDebugUtils.currentLine=88408066;
 //BA.debugLineNum = 88408066;BA.debugLine="End Sub";
return "";
}
public int  _createbox(gunav2.keymon.com.mx.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=90177536;
 //BA.debugLineNum = 90177536;BA.debugLine="Public Sub CreateBox(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=90177537;
 //BA.debugLineNum = 90177537;BA.debugLine="Dim box As Int = 0x10000000";
_box = ((int)0x10000000);
RDebugUtils.currentLine=90177538;
 //BA.debugLineNum = 90177538;BA.debugLine="If fill Then box = box + 0x80000000";
if (_fill) { 
_box = (int) (_box+((int)0x80000000));};
RDebugUtils.currentLine=90177539;
 //BA.debugLineNum = 90177539;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=90177540;
 //BA.debugLineNum = 90177540;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=90177541;
 //BA.debugLineNum = 90177541;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=90177542;
 //BA.debugLineNum = 90177542;BA.debugLine="box = box + Bit.And(0x1f,y1)";
_box = (int) (_box+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=90177543;
 //BA.debugLineNum = 90177543;BA.debugLine="Return box";
if (true) return _box;
RDebugUtils.currentLine=90177544;
 //BA.debugLineNum = 90177544;BA.debugLine="End Sub";
return 0;
}
public int  _createcircle(gunav2.keymon.com.mx.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=90046464;
 //BA.debugLineNum = 90046464;BA.debugLine="Public Sub CreateCircle(radius As Int, quadrants A";
RDebugUtils.currentLine=90046465;
 //BA.debugLineNum = 90046465;BA.debugLine="Dim circle As Int = 0x20000000";
_circle = ((int)0x20000000);
RDebugUtils.currentLine=90046466;
 //BA.debugLineNum = 90046466;BA.debugLine="If fill Then circle = circle + 0x80000000";
if (_fill) { 
_circle = (int) (_circle+((int)0x80000000));};
RDebugUtils.currentLine=90046467;
 //BA.debugLineNum = 90046467;BA.debugLine="circle = circle + Bit.ShiftLeft(radius, 24)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_radius,(int) (24)));
RDebugUtils.currentLine=90046468;
 //BA.debugLineNum = 90046468;BA.debugLine="circle = circle + Bit.ShiftLeft(quadrants, 16)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_quadrants,(int) (16)));
RDebugUtils.currentLine=90046469;
 //BA.debugLineNum = 90046469;BA.debugLine="circle = circle + Bit.ShiftLeft(x1, 8)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_x1,(int) (8)));
RDebugUtils.currentLine=90046470;
 //BA.debugLineNum = 90046470;BA.debugLine="circle = circle + y1";
_circle = (int) (_circle+_y1);
RDebugUtils.currentLine=90046471;
 //BA.debugLineNum = 90046471;BA.debugLine="Return circle";
if (true) return _circle;
RDebugUtils.currentLine=90046472;
 //BA.debugLineNum = 90046472;BA.debugLine="End Sub";
return 0;
}
public byte[]  _createcustomcharacter(gunav2.keymon.com.mx.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=89915392;
 //BA.debugLineNum = 89915392;BA.debugLine="Public Sub CreateCustomCharacter(shapes() As Int,";
RDebugUtils.currentLine=89915393;
 //BA.debugLineNum = 89915393;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=89915394;
 //BA.debugLineNum = 89915394;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=89915395;
 //BA.debugLineNum = 89915395;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=89915396;
 //BA.debugLineNum = 89915396;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=89915397;
 //BA.debugLineNum = 89915397;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=89915398;
 //BA.debugLineNum = 89915398;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=89915399;
 //BA.debugLineNum = 89915399;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=89915400;
 //BA.debugLineNum = 89915400;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=89915401;
 //BA.debugLineNum = 89915401;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=89915404;
 //BA.debugLineNum = 89915404;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=89915406;
 //BA.debugLineNum = 89915406;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=89915407;
 //BA.debugLineNum = 89915407;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=89915408;
 //BA.debugLineNum = 89915408;BA.debugLine="points(x,y) = 0";
_points[_x][_y] = (byte) (0);
 }
};
 }
};
RDebugUtils.currentLine=89915411;
 //BA.debugLineNum = 89915411;BA.debugLine="Dim size As Int = 12";
_size = (int) (12);
RDebugUtils.currentLine=89915412;
 //BA.debugLineNum = 89915412;BA.debugLine="If characterfont = 1 Then size = 9";
if (_characterfont==1) { 
_size = (int) (9);};
RDebugUtils.currentLine=89915413;
 //BA.debugLineNum = 89915413;BA.debugLine="Dim charbyes(size * 3) As Byte";
_charbyes = new byte[(int) (_size*3)];
;
RDebugUtils.currentLine=89915414;
 //BA.debugLineNum = 89915414;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=89915415;
 //BA.debugLineNum = 89915415;BA.debugLine="charbyes(c) = 0";
_charbyes[_c] = (byte) (0);
 }
};
RDebugUtils.currentLine=89915418;
 //BA.debugLineNum = 89915418;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=89915419;
 //BA.debugLineNum = 89915419;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=89915420;
 //BA.debugLineNum = 89915420;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=89915421;
 //BA.debugLineNum = 89915421;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=89915422;
 //BA.debugLineNum = 89915422;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=89915423;
 //BA.debugLineNum = 89915423;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=89915424;
 //BA.debugLineNum = 89915424;BA.debugLine="Dim y1 As Int = Bit.And(0x0000001f, shapes(i))";
_y1 = __c.Bit.And(((int)0x0000001f),_shapes[_i]);
RDebugUtils.currentLine=89915425;
 //BA.debugLineNum = 89915425;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=89915426;
 //BA.debugLineNum = 89915426;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=89915432;
 //BA.debugLineNum = 89915432;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=89915433;
 //BA.debugLineNum = 89915433;BA.debugLine="If shape = 3 Then";
if (_shape==3) { 
RDebugUtils.currentLine=89915434;
 //BA.debugLineNum = 89915434;BA.debugLine="Log(\"Triangle \" & logmsg)";
__c.LogImpl("089915434","Triangle "+_logmsg,0);
RDebugUtils.currentLine=89915435;
 //BA.debugLineNum = 89915435;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=89915436;
 //BA.debugLineNum = 89915436;BA.debugLine="else If shape = 2 Then";
if (_shape==2) { 
RDebugUtils.currentLine=89915437;
 //BA.debugLineNum = 89915437;BA.debugLine="Log(\"Circle \" & logmsg)";
__c.LogImpl("089915437","Circle "+_logmsg,0);
RDebugUtils.currentLine=89915438;
 //BA.debugLineNum = 89915438;BA.debugLine="PlotCircle(x0, y0, x1, y1, points, fill)";
__ref._plotcircle /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else 
{RDebugUtils.currentLine=89915439;
 //BA.debugLineNum = 89915439;BA.debugLine="Else If shape = 1 Then";
if (_shape==1) { 
RDebugUtils.currentLine=89915440;
 //BA.debugLineNum = 89915440;BA.debugLine="Log(\"Box \" & logmsg)";
__c.LogImpl("089915440","Box "+_logmsg,0);
RDebugUtils.currentLine=89915441;
 //BA.debugLineNum = 89915441;BA.debugLine="PlotBox(x0, y0, x1, y1, points, fill)";
__ref._plotbox /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else {
RDebugUtils.currentLine=89915443;
 //BA.debugLineNum = 89915443;BA.debugLine="Log(\"Line \" & logmsg)";
__c.LogImpl("089915443","Line "+_logmsg,0);
RDebugUtils.currentLine=89915444;
 //BA.debugLineNum = 89915444;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 }}}
;
RDebugUtils.currentLine=89915447;
 //BA.debugLineNum = 89915447;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=89915448;
 //BA.debugLineNum = 89915448;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=89915449;
 //BA.debugLineNum = 89915449;BA.debugLine="Dim bits As Byte = 0";
_bits = (byte) (0);
RDebugUtils.currentLine=89915450;
 //BA.debugLineNum = 89915450;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=89915451;
 //BA.debugLineNum = 89915451;BA.debugLine="If points(x, y*8+b) <> 0 Then";
if (_points[_x][(int) (_y*8+_b)]!=0) { 
RDebugUtils.currentLine=89915452;
 //BA.debugLineNum = 89915452;BA.debugLine="bits = Bit.Or(bits, masks(b))";
_bits = (byte) (__c.Bit.Or((int) (_bits),(int) (_masks[_b])));
 };
 }
};
RDebugUtils.currentLine=89915455;
 //BA.debugLineNum = 89915455;BA.debugLine="charbyes(x*3+y) = bits";
_charbyes[(int) (_x*3+_y)] = _bits;
 }
};
 }
};
 }
};
RDebugUtils.currentLine=89915459;
 //BA.debugLineNum = 89915459;BA.debugLine="Return charbyes";
if (true) return _charbyes;
RDebugUtils.currentLine=89915460;
 //BA.debugLineNum = 89915460;BA.debugLine="End Sub";
return null;
}
public String  _plottriangle(gunav2.keymon.com.mx.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=90243072;
 //BA.debugLineNum = 90243072;BA.debugLine="Private Sub PlotTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=90243074;
 //BA.debugLineNum = 90243074;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=90243075;
 //BA.debugLineNum = 90243075;BA.debugLine="PlotLine(x1, y1, x2, y2, points)";
__ref._plotline /*String*/ (null,_x1,_y1,_x2,_y2,_points);
RDebugUtils.currentLine=90243076;
 //BA.debugLineNum = 90243076;BA.debugLine="PlotLine(x2, y2, x0, y0, points)";
__ref._plotline /*String*/ (null,_x2,_y2,_x0,_y0,_points);
RDebugUtils.currentLine=90243077;
 //BA.debugLineNum = 90243077;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=90243078;
 //BA.debugLineNum = 90243078;BA.debugLine="FillTriangle(x0, y0, x1, y1, x2, y2, points)";
__ref._filltriangle /*String*/ (null,_x0,_y0,_x1,_y1,_x2,_y2,_points);
 };
RDebugUtils.currentLine=90243080;
 //BA.debugLineNum = 90243080;BA.debugLine="End Sub";
return "";
}
public String  _plotcircle(gunav2.keymon.com.mx.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=90439680;
 //BA.debugLineNum = 90439680;BA.debugLine="Private Sub PlotCircle(radius As Int, quadrants As";
RDebugUtils.currentLine=90439682;
 //BA.debugLineNum = 90439682;BA.debugLine="Dim mask As Int = 1";
_mask = (int) (1);
RDebugUtils.currentLine=90439683;
 //BA.debugLineNum = 90439683;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=90439684;
 //BA.debugLineNum = 90439684;BA.debugLine="If Bit.And(quadrants, mask) <> 0 Then";
if (__c.Bit.And(_quadrants,_mask)!=0) { 
RDebugUtils.currentLine=90439685;
 //BA.debugLineNum = 90439685;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=90439686;
 //BA.debugLineNum = 90439686;BA.debugLine="Dim x,y As Double";
_x = 0;
_y = 0;
RDebugUtils.currentLine=90439687;
 //BA.debugLineNum = 90439687;BA.debugLine="x = x1 - SinD(i)*radius";
_x = _x1-__c.SinD(_i)*_radius;
RDebugUtils.currentLine=90439688;
 //BA.debugLineNum = 90439688;BA.debugLine="y = y1 - CosD(i)*radius";
_y = _y1-__c.CosD(_i)*_radius;
RDebugUtils.currentLine=90439689;
 //BA.debugLineNum = 90439689;BA.debugLine="If fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=90439690;
 //BA.debugLineNum = 90439690;BA.debugLine="PlotLine(x1, y1, x, y, points)";
__ref._plotline /*String*/ (null,_x1,_y1,(int) (_x),(int) (_y),_points);
 }else {
RDebugUtils.currentLine=90439692;
 //BA.debugLineNum = 90439692;BA.debugLine="points(Round(x), Round(y)) = 1";
_points[(int) (__c.Round(_x))][(int) (__c.Round(_y))] = (byte) (1);
 };
 }
};
 };
RDebugUtils.currentLine=90439696;
 //BA.debugLineNum = 90439696;BA.debugLine="mask = Bit.ShiftLeft(mask, 1)";
_mask = __c.Bit.ShiftLeft(_mask,(int) (1));
 }
};
RDebugUtils.currentLine=90439698;
 //BA.debugLineNum = 90439698;BA.debugLine="End Sub";
return "";
}
public String  _plotbox(gunav2.keymon.com.mx.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=90374144;
 //BA.debugLineNum = 90374144;BA.debugLine="Private Sub PlotBox(x0 As Int, y0 As Int, x1 As In";
RDebugUtils.currentLine=90374146;
 //BA.debugLineNum = 90374146;BA.debugLine="PlotLine(x0, y0, x0, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x0,_y1,_points);
RDebugUtils.currentLine=90374147;
 //BA.debugLineNum = 90374147;BA.debugLine="PlotLine(x0, y0, x1, y0, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y0,_points);
RDebugUtils.currentLine=90374148;
 //BA.debugLineNum = 90374148;BA.debugLine="PlotLine(x1, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x1,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=90374149;
 //BA.debugLineNum = 90374149;BA.debugLine="PlotLine(x0, y1, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y1,_x1,_y1,_points);
RDebugUtils.currentLine=90374150;
 //BA.debugLineNum = 90374150;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=90374151;
 //BA.debugLineNum = 90374151;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=90374152;
 //BA.debugLineNum = 90374152;BA.debugLine="PlotLine(x, y0, x, y1, points)";
__ref._plotline /*String*/ (null,_x,_y0,_x,_y1,_points);
 }
};
 };
RDebugUtils.currentLine=90374155;
 //BA.debugLineNum = 90374155;BA.debugLine="End Sub";
return "";
}
public String  _plotline(gunav2.keymon.com.mx.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=90505216;
 //BA.debugLineNum = 90505216;BA.debugLine="Private Sub PlotLine(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=90505217;
 //BA.debugLineNum = 90505217;BA.debugLine="If Abs(y1 - y0) < Abs(x1 - x0) Then";
if (__c.Abs(_y1-_y0)<__c.Abs(_x1-_x0)) { 
RDebugUtils.currentLine=90505218;
 //BA.debugLineNum = 90505218;BA.debugLine="If x0 > x1 Then";
if (_x0>_x1) { 
RDebugUtils.currentLine=90505219;
 //BA.debugLineNum = 90505219;BA.debugLine="PlotLineLow(x1, y1, x0, y0, points)";
__ref._plotlinelow /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=90505221;
 //BA.debugLineNum = 90505221;BA.debugLine="PlotLineLow(x0, y0, x1, y1, points)";
__ref._plotlinelow /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 }else {
RDebugUtils.currentLine=90505224;
 //BA.debugLineNum = 90505224;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=90505225;
 //BA.debugLineNum = 90505225;BA.debugLine="PlotLineHigh(x1, y1, x0, y0, points)";
__ref._plotlinehigh /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=90505227;
 //BA.debugLineNum = 90505227;BA.debugLine="PlotLineHigh(x0, y0, x1, y1, points)";
__ref._plotlinehigh /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 };
RDebugUtils.currentLine=90505230;
 //BA.debugLineNum = 90505230;BA.debugLine="End Sub";
return "";
}
public int  _createline(gunav2.keymon.com.mx.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=89980928;
 //BA.debugLineNum = 89980928;BA.debugLine="Public Sub CreateLine(x0 As Int, y0 As Int, x1 As";
RDebugUtils.currentLine=89980929;
 //BA.debugLineNum = 89980929;BA.debugLine="Dim line As Int = 0";
_line = (int) (0);
RDebugUtils.currentLine=89980930;
 //BA.debugLineNum = 89980930;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=89980931;
 //BA.debugLineNum = 89980931;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=89980932;
 //BA.debugLineNum = 89980932;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=89980933;
 //BA.debugLineNum = 89980933;BA.debugLine="line = line + Bit.And(0x1f,y1)";
_line = (int) (_line+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=89980934;
 //BA.debugLineNum = 89980934;BA.debugLine="Return line";
if (true) return _line;
RDebugUtils.currentLine=89980935;
 //BA.debugLineNum = 89980935;BA.debugLine="End Sub";
return 0;
}
public int  _createtriangle(gunav2.keymon.com.mx.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=90112000;
 //BA.debugLineNum = 90112000;BA.debugLine="Public Sub CreateTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=90112001;
 //BA.debugLineNum = 90112001;BA.debugLine="Dim triangle As Int = 0x30000000";
_triangle = ((int)0x30000000);
RDebugUtils.currentLine=90112002;
 //BA.debugLineNum = 90112002;BA.debugLine="If fill Then triangle = triangle + 0x80000000";
if (_fill) { 
_triangle = (int) (_triangle+((int)0x80000000));};
RDebugUtils.currentLine=90112003;
 //BA.debugLineNum = 90112003;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=90112004;
 //BA.debugLineNum = 90112004;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=90112005;
 //BA.debugLineNum = 90112005;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=90112006;
 //BA.debugLineNum = 90112006;BA.debugLine="triangle = triangle + Bit.And(0x1f,y1)";
_triangle = (int) (_triangle+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=90112007;
 //BA.debugLineNum = 90112007;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=90112008;
 //BA.debugLineNum = 90112008;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=90112009;
 //BA.debugLineNum = 90112009;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=90112010;
 //BA.debugLineNum = 90112010;BA.debugLine="Return triangle";
if (true) return _triangle;
RDebugUtils.currentLine=90112011;
 //BA.debugLineNum = 90112011;BA.debugLine="End Sub";
return 0;
}
public int  _definecustomcharacter(gunav2.keymon.com.mx.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=89849856;
 //BA.debugLineNum = 89849856;BA.debugLine="Public Sub DefineCustomCharacter(charcode As Int,";
RDebugUtils.currentLine=89849857;
 //BA.debugLineNum = 89849857;BA.debugLine="Dim excess As Int = bitdata.Length Mod 3";
_excess = (int) (_bitdata.length%3);
RDebugUtils.currentLine=89849858;
 //BA.debugLineNum = 89849858;BA.debugLine="If excess <> 0 Then Return -1";
if (_excess!=0) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=89849859;
 //BA.debugLineNum = 89849859;BA.debugLine="Dim size As Int = bitdata.Length / 3";
_size = (int) (_bitdata.length/(double)3);
RDebugUtils.currentLine=89849860;
 //BA.debugLineNum = 89849860;BA.debugLine="WriteString(ESC & \"&\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"&");
RDebugUtils.currentLine=89849861;
 //BA.debugLineNum = 89849861;BA.debugLine="Dim params(4) As Byte";
_params = new byte[(int) (4)];
;
RDebugUtils.currentLine=89849862;
 //BA.debugLineNum = 89849862;BA.debugLine="params(0) = 3";
_params[(int) (0)] = (byte) (3);
RDebugUtils.currentLine=89849863;
 //BA.debugLineNum = 89849863;BA.debugLine="params(1) = charcode";
_params[(int) (1)] = (byte) (_charcode);
RDebugUtils.currentLine=89849864;
 //BA.debugLineNum = 89849864;BA.debugLine="params(2) = charcode";
_params[(int) (2)] = (byte) (_charcode);
RDebugUtils.currentLine=89849865;
 //BA.debugLineNum = 89849865;BA.debugLine="params(3) = size";
_params[(int) (3)] = (byte) (_size);
RDebugUtils.currentLine=89849866;
 //BA.debugLineNum = 89849866;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=89849867;
 //BA.debugLineNum = 89849867;BA.debugLine="WriteBytes(bitdata)";
__ref._writebytes /*String*/ (null,_bitdata);
RDebugUtils.currentLine=89849868;
 //BA.debugLineNum = 89849868;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=89849869;
 //BA.debugLineNum = 89849869;BA.debugLine="End Sub";
return 0;
}
public String  _writebytes(gunav2.keymon.com.mx.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=89522176;
 //BA.debugLineNum = 89522176;BA.debugLine="Public Sub WriteBytes(data() As Byte)";
RDebugUtils.currentLine=89522177;
 //BA.debugLineNum = 89522177;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=89522178;
 //BA.debugLineNum = 89522178;BA.debugLine="Astream.Write(data)";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Write(_data);
 };
RDebugUtils.currentLine=89522180;
 //BA.debugLineNum = 89522180;BA.debugLine="End Sub";
return "";
}
public String  _deletecustomcharacter(gunav2.keymon.com.mx.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=89718784;
 //BA.debugLineNum = 89718784;BA.debugLine="Public Sub DeleteCustomCharacter(charcode As Int)";
RDebugUtils.currentLine=89718785;
 //BA.debugLineNum = 89718785;BA.debugLine="WriteString(ESC & \"?\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"?");
RDebugUtils.currentLine=89718786;
 //BA.debugLineNum = 89718786;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=89718787;
 //BA.debugLineNum = 89718787;BA.debugLine="params(0) = charcode";
_params[(int) (0)] = (byte) (_charcode);
RDebugUtils.currentLine=89718788;
 //BA.debugLineNum = 89718788;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=89718789;
 //BA.debugLineNum = 89718789;BA.debugLine="End Sub";
return "";
}
public gunav2.keymon.com.mx.escposprinter._animage  _ditherimage1d(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage1d", false))
	 {return ((gunav2.keymon.com.mx.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;
gunav2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=90832896;
 //BA.debugLineNum = 90832896;BA.debugLine="Sub DitherImage1D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=90832897;
 //BA.debugLineNum = 90832897;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=90832898;
 //BA.debugLineNum = 90832898;BA.debugLine="Dim error As Int";
_error = 0;
RDebugUtils.currentLine=90832899;
 //BA.debugLineNum = 90832899;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=90832900;
 //BA.debugLineNum = 90832900;BA.debugLine="error = 0 ' reset on each new line";
_error = (int) (0);
RDebugUtils.currentLine=90832901;
 //BA.debugLineNum = 90832901;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=90832902;
 //BA.debugLineNum = 90832902;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=90832903;
 //BA.debugLineNum = 90832903;BA.debugLine="lum = lum + error";
_lum = (int) (_lum+_error);
RDebugUtils.currentLine=90832904;
 //BA.debugLineNum = 90832904;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=90832905;
 //BA.debugLineNum = 90832905;BA.debugLine="error = lum";
_error = _lum;
RDebugUtils.currentLine=90832906;
 //BA.debugLineNum = 90832906;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=90832908;
 //BA.debugLineNum = 90832908;BA.debugLine="error = lum - 255";
_error = (int) (_lum-255);
RDebugUtils.currentLine=90832909;
 //BA.debugLineNum = 90832909;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=90832911;
 //BA.debugLineNum = 90832911;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=90832914;
 //BA.debugLineNum = 90832914;BA.debugLine="Dim ret As AnImage";
_ret = new gunav2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=90832915;
 //BA.debugLineNum = 90832915;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=90832916;
 //BA.debugLineNum = 90832916;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=90832917;
 //BA.debugLineNum = 90832917;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=90832918;
 //BA.debugLineNum = 90832918;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=90832919;
 //BA.debugLineNum = 90832919;BA.debugLine="End Sub";
return null;
}
public gunav2.keymon.com.mx.escposprinter._animage  _ditherimage2d(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage2d", false))
	 {return ((gunav2.keymon.com.mx.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;
gunav2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=90898432;
 //BA.debugLineNum = 90898432;BA.debugLine="Sub DitherImage2D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=90898433;
 //BA.debugLineNum = 90898433;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=90898434;
 //BA.debugLineNum = 90898434;BA.debugLine="Dim xerror As Int";
_xerror = 0;
RDebugUtils.currentLine=90898435;
 //BA.debugLineNum = 90898435;BA.debugLine="Dim yerrors(img.Width) As Int";
_yerrors = new int[_img.Width /*int*/ ];
;
RDebugUtils.currentLine=90898436;
 //BA.debugLineNum = 90898436;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=90898437;
 //BA.debugLineNum = 90898437;BA.debugLine="yerrors(0) = 0";
_yerrors[(int) (0)] = (int) (0);
 }
};
RDebugUtils.currentLine=90898439;
 //BA.debugLineNum = 90898439;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=90898440;
 //BA.debugLineNum = 90898440;BA.debugLine="xerror = 0 ' reset on each new line";
_xerror = (int) (0);
RDebugUtils.currentLine=90898441;
 //BA.debugLineNum = 90898441;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=90898442;
 //BA.debugLineNum = 90898442;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=90898443;
 //BA.debugLineNum = 90898443;BA.debugLine="lum = lum + xerror + yerrors(x)";
_lum = (int) (_lum+_xerror+_yerrors[_x]);
RDebugUtils.currentLine=90898444;
 //BA.debugLineNum = 90898444;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=90898445;
 //BA.debugLineNum = 90898445;BA.debugLine="xerror = lum/2";
_xerror = (int) (_lum/(double)2);
RDebugUtils.currentLine=90898446;
 //BA.debugLineNum = 90898446;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=90898447;
 //BA.debugLineNum = 90898447;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=90898449;
 //BA.debugLineNum = 90898449;BA.debugLine="xerror = (lum - 255)/2";
_xerror = (int) ((_lum-255)/(double)2);
RDebugUtils.currentLine=90898450;
 //BA.debugLineNum = 90898450;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=90898451;
 //BA.debugLineNum = 90898451;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=90898453;
 //BA.debugLineNum = 90898453;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=90898456;
 //BA.debugLineNum = 90898456;BA.debugLine="Dim ret As AnImage";
_ret = new gunav2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=90898457;
 //BA.debugLineNum = 90898457;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=90898458;
 //BA.debugLineNum = 90898458;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=90898459;
 //BA.debugLineNum = 90898459;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=90898460;
 //BA.debugLineNum = 90898460;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=90898461;
 //BA.debugLineNum = 90898461;BA.debugLine="End Sub";
return null;
}
public String  _filltriangle(gunav2.keymon.com.mx.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=90308608;
 //BA.debugLineNum = 90308608;BA.debugLine="Private Sub FillTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=90308610;
 //BA.debugLineNum = 90308610;BA.debugLine="Dim tx, ty As Int";
_tx = 0;
_ty = 0;
RDebugUtils.currentLine=90308611;
 //BA.debugLineNum = 90308611;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=90308612;
 //BA.debugLineNum = 90308612;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=90308612;
 //BA.debugLineNum = 90308612;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=90308613;
 //BA.debugLineNum = 90308613;BA.debugLine="x0 = x1 : y0 = y1";
_x0 = _x1;
RDebugUtils.currentLine=90308613;
 //BA.debugLineNum = 90308613;BA.debugLine="x0 = x1 : y0 = y1";
_y0 = _y1;
RDebugUtils.currentLine=90308614;
 //BA.debugLineNum = 90308614;BA.debugLine="x1 = tx : y1 = ty";
_x1 = _tx;
RDebugUtils.currentLine=90308614;
 //BA.debugLineNum = 90308614;BA.debugLine="x1 = tx : y1 = ty";
_y1 = _ty;
 };
RDebugUtils.currentLine=90308616;
 //BA.debugLineNum = 90308616;BA.debugLine="If y0 > y2 Then";
if (_y0>_y2) { 
RDebugUtils.currentLine=90308617;
 //BA.debugLineNum = 90308617;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=90308617;
 //BA.debugLineNum = 90308617;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=90308618;
 //BA.debugLineNum = 90308618;BA.debugLine="x0 = x2 : y0 = y2";
_x0 = _x2;
RDebugUtils.currentLine=90308618;
 //BA.debugLineNum = 90308618;BA.debugLine="x0 = x2 : y0 = y2";
_y0 = _y2;
RDebugUtils.currentLine=90308619;
 //BA.debugLineNum = 90308619;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=90308619;
 //BA.debugLineNum = 90308619;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=90308621;
 //BA.debugLineNum = 90308621;BA.debugLine="If y1 > y2 Then";
if (_y1>_y2) { 
RDebugUtils.currentLine=90308622;
 //BA.debugLineNum = 90308622;BA.debugLine="tx = x1 : ty = y1";
_tx = _x1;
RDebugUtils.currentLine=90308622;
 //BA.debugLineNum = 90308622;BA.debugLine="tx = x1 : ty = y1";
_ty = _y1;
RDebugUtils.currentLine=90308623;
 //BA.debugLineNum = 90308623;BA.debugLine="x1 = x2 : y1 = y2";
_x1 = _x2;
RDebugUtils.currentLine=90308623;
 //BA.debugLineNum = 90308623;BA.debugLine="x1 = x2 : y1 = y2";
_y1 = _y2;
RDebugUtils.currentLine=90308624;
 //BA.debugLineNum = 90308624;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=90308624;
 //BA.debugLineNum = 90308624;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=90308627;
 //BA.debugLineNum = 90308627;BA.debugLine="Dim dx0, dx1, dx2 As Double";
_dx0 = 0;
_dx1 = 0;
_dx2 = 0;
RDebugUtils.currentLine=90308628;
 //BA.debugLineNum = 90308628;BA.debugLine="Dim x3, x4, y3, y4 As Double";
_x3 = 0;
_x4 = 0;
_y3 = 0;
_y4 = 0;
RDebugUtils.currentLine=90308629;
 //BA.debugLineNum = 90308629;BA.debugLine="Dim inc As Int";
_inc = 0;
RDebugUtils.currentLine=90308631;
 //BA.debugLineNum = 90308631;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=90308632;
 //BA.debugLineNum = 90308632;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=90308633;
 //BA.debugLineNum = 90308633;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=90308634;
 //BA.debugLineNum = 90308634;BA.debugLine="x3 = x0 : x4 = x0";
_x3 = _x0;
RDebugUtils.currentLine=90308634;
 //BA.debugLineNum = 90308634;BA.debugLine="x3 = x0 : x4 = x0";
_x4 = _x0;
RDebugUtils.currentLine=90308635;
 //BA.debugLineNum = 90308635;BA.debugLine="y3 = y0 : y4 = y0";
_y3 = _y0;
RDebugUtils.currentLine=90308635;
 //BA.debugLineNum = 90308635;BA.debugLine="y3 = y0 : y4 = y0";
_y4 = _y0;
RDebugUtils.currentLine=90308636;
 //BA.debugLineNum = 90308636;BA.debugLine="If dx0 > dx1 Then";
if (_dx0>_dx1) { 
RDebugUtils.currentLine=90308637;
 //BA.debugLineNum = 90308637;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=90308638;
 //BA.debugLineNum = 90308638;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=90308639;
 //BA.debugLineNum = 90308639;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=90308640;
 //BA.debugLineNum = 90308640;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=90308641;
 //BA.debugLineNum = 90308641;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=90308643;
 //BA.debugLineNum = 90308643;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=90308643;
 //BA.debugLineNum = 90308643;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=90308643;
 //BA.debugLineNum = 90308643;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=90308643;
 //BA.debugLineNum = 90308643;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx0;
 }
;
RDebugUtils.currentLine=90308645;
 //BA.debugLineNum = 90308645;BA.debugLine="x4=x1";
_x4 = _x1;
RDebugUtils.currentLine=90308646;
 //BA.debugLineNum = 90308646;BA.debugLine="y4=y1";
_y4 = _y1;
RDebugUtils.currentLine=90308647;
 //BA.debugLineNum = 90308647;BA.debugLine="Do While y3 <= y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=90308648;
 //BA.debugLineNum = 90308648;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=90308649;
 //BA.debugLineNum = 90308649;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=90308650;
 //BA.debugLineNum = 90308650;BA.debugLine="points(x ,y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=90308652;
 //BA.debugLineNum = 90308652;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=90308652;
 //BA.debugLineNum = 90308652;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=90308652;
 //BA.debugLineNum = 90308652;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=90308652;
 //BA.debugLineNum = 90308652;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx2;
 }
;
 }else {
RDebugUtils.currentLine=90308655;
 //BA.debugLineNum = 90308655;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=90308656;
 //BA.debugLineNum = 90308656;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=90308657;
 //BA.debugLineNum = 90308657;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=90308658;
 //BA.debugLineNum = 90308658;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=90308659;
 //BA.debugLineNum = 90308659;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=90308661;
 //BA.debugLineNum = 90308661;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=90308661;
 //BA.debugLineNum = 90308661;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=90308661;
 //BA.debugLineNum = 90308661;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x3 = _x3+_dx0;
RDebugUtils.currentLine=90308661;
 //BA.debugLineNum = 90308661;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x4 = _x4+_dx1;
 }
;
RDebugUtils.currentLine=90308663;
 //BA.debugLineNum = 90308663;BA.debugLine="x3=x1";
_x3 = _x1;
RDebugUtils.currentLine=90308664;
 //BA.debugLineNum = 90308664;BA.debugLine="y3=y1";
_y3 = _y1;
RDebugUtils.currentLine=90308665;
 //BA.debugLineNum = 90308665;BA.debugLine="Do While y3<=y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=90308666;
 //BA.debugLineNum = 90308666;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=90308667;
 //BA.debugLineNum = 90308667;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=90308668;
 //BA.debugLineNum = 90308668;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=90308670;
 //BA.debugLineNum = 90308670;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=90308670;
 //BA.debugLineNum = 90308670;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=90308670;
 //BA.debugLineNum = 90308670;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x3 = _x3+_dx2;
RDebugUtils.currentLine=90308670;
 //BA.debugLineNum = 90308670;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x4 = _x4+_dx1;
 }
;
 };
RDebugUtils.currentLine=90308673;
 //BA.debugLineNum = 90308673;BA.debugLine="End Sub";
return "";
}
public gunav2.keymon.com.mx.escposprinter._animage  _imagetobwimage(gunav2.keymon.com.mx.escposprinter __ref,anywheresoftware.b4a.objects.drawable.CanvasWrapper.BitmapWrapper _bmp) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "imagetobwimage", false))
	 {return ((gunav2.keymon.com.mx.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;
gunav2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=90701824;
 //BA.debugLineNum = 90701824;BA.debugLine="Sub ImageToBWIMage(bmp As Bitmap) As AnImage";
RDebugUtils.currentLine=90701825;
 //BA.debugLineNum = 90701825;BA.debugLine="Dim BC As BitmapCreator 'ignore";
_bc = new b4a.example.bitmapcreator();
RDebugUtils.currentLine=90701826;
 //BA.debugLineNum = 90701826;BA.debugLine="Dim W As Int = bmp.Width";
_w = _bmp.getWidth();
RDebugUtils.currentLine=90701827;
 //BA.debugLineNum = 90701827;BA.debugLine="Dim H As Int = bmp.Height";
_h = _bmp.getHeight();
RDebugUtils.currentLine=90701828;
 //BA.debugLineNum = 90701828;BA.debugLine="Dim pixels(W * H) As Byte";
_pixels = new byte[(int) (_w*_h)];
;
RDebugUtils.currentLine=90701830;
 //BA.debugLineNum = 90701830;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=90701831;
 //BA.debugLineNum = 90701831;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=90701832;
 //BA.debugLineNum = 90701832;BA.debugLine="Dim j As Int = bmp.GetPixel(x, y)";
_j = _bmp.GetPixel(_x,_y);
RDebugUtils.currentLine=90701834;
 //BA.debugLineNum = 90701834;BA.debugLine="Dim col As ARGBColor";
_col = new b4a.example.bitmapcreator._argbcolor();
RDebugUtils.currentLine=90701835;
 //BA.debugLineNum = 90701835;BA.debugLine="BC.ColorToARGB(j, col )";
_bc._colortoargb(_j,_col);
RDebugUtils.currentLine=90701836;
 //BA.debugLineNum = 90701836;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=90701837;
 //BA.debugLineNum = 90701837;BA.debugLine="If lum> 255 Then lum = 255";
if (_lum>255) { 
_lum = (int) (255);};
RDebugUtils.currentLine=90701839;
 //BA.debugLineNum = 90701839;BA.debugLine="pixels(y*W + x) = lum";
_pixels[(int) (_y*_w+_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=90701842;
 //BA.debugLineNum = 90701842;BA.debugLine="Dim ret As AnImage";
_ret = new gunav2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=90701843;
 //BA.debugLineNum = 90701843;BA.debugLine="ret.Width = bmp.Width";
_ret.Width /*int*/  = _bmp.getWidth();
RDebugUtils.currentLine=90701844;
 //BA.debugLineNum = 90701844;BA.debugLine="ret.Height = bmp.Height";
_ret.Height /*int*/  = _bmp.getHeight();
RDebugUtils.currentLine=90701845;
 //BA.debugLineNum = 90701845;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=90701846;
 //BA.debugLineNum = 90701846;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=90701847;
 //BA.debugLineNum = 90701847;BA.debugLine="End Sub";
return null;
}
public boolean  _isbluetoothon(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "isbluetoothon", false))
	 {return ((Boolean) Debug.delegate(ba, "isbluetoothon", null));}
RDebugUtils.currentLine=88539136;
 //BA.debugLineNum = 88539136;BA.debugLine="Public Sub IsBluetoothOn As Boolean";
RDebugUtils.currentLine=88539137;
 //BA.debugLineNum = 88539137;BA.debugLine="Return Serial1.IsEnabled";
if (true) return __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .IsEnabled();
RDebugUtils.currentLine=88539138;
 //BA.debugLineNum = 88539138;BA.debugLine="End Sub";
return false;
}
public gunav2.keymon.com.mx.escposprinter._animage  _packimage(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.escposprinter._animage _imagedata) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "packimage", false))
	 {return ((gunav2.keymon.com.mx.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;
gunav2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=91029504;
 //BA.debugLineNum = 91029504;BA.debugLine="Public Sub PackImage(imagedata As AnImage) As AnIm";
RDebugUtils.currentLine=91029505;
 //BA.debugLineNum = 91029505;BA.debugLine="Dim xbytes As Int = imagedata.width/8";
_xbytes = (int) (_imagedata.Width /*int*/ /(double)8);
RDebugUtils.currentLine=91029506;
 //BA.debugLineNum = 91029506;BA.debugLine="Dim pixels(xbytes * imagedata.height) As Byte";
_pixels = new byte[(int) (_xbytes*_imagedata.Height /*int*/ )];
;
RDebugUtils.currentLine=91029507;
 //BA.debugLineNum = 91029507;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=91029508;
 //BA.debugLineNum = 91029508;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=91029509;
 //BA.debugLineNum = 91029509;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=91029510;
 //BA.debugLineNum = 91029510;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=91029511;
 //BA.debugLineNum = 91029511;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=91029512;
 //BA.debugLineNum = 91029512;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=91029513;
 //BA.debugLineNum = 91029513;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=91029514;
 //BA.debugLineNum = 91029514;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=91029515;
 //BA.debugLineNum = 91029515;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=91029516;
 //BA.debugLineNum = 91029516;BA.debugLine="Dim index As Int = 0";
_index = (int) (0);
RDebugUtils.currentLine=91029517;
 //BA.debugLineNum = 91029517;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=91029518;
 //BA.debugLineNum = 91029518;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=91029519;
 //BA.debugLineNum = 91029519;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=91029520;
 //BA.debugLineNum = 91029520;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=91029522;
 //BA.debugLineNum = 91029522;BA.debugLine="Dim pix As Byte = imagedata.Data(index)";
_pix = _imagedata.Data /*byte[]*/ [_index];
RDebugUtils.currentLine=91029523;
 //BA.debugLineNum = 91029523;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=91029524;
 //BA.debugLineNum = 91029524;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
RDebugUtils.currentLine=91029526;
 //BA.debugLineNum = 91029526;BA.debugLine="index = index + 1";
_index = (int) (_index+1);
 }
};
RDebugUtils.currentLine=91029528;
 //BA.debugLineNum = 91029528;BA.debugLine="pixels(y*xbytes + x) = xbyte";
_pixels[(int) (_y*_xbytes+_x)] = _xbyte;
 }
};
 }
};
RDebugUtils.currentLine=91029531;
 //BA.debugLineNum = 91029531;BA.debugLine="Dim ret As AnImage";
_ret = new gunav2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=91029532;
 //BA.debugLineNum = 91029532;BA.debugLine="ret.Width = xbytes";
_ret.Width /*int*/  = _xbytes;
RDebugUtils.currentLine=91029533;
 //BA.debugLineNum = 91029533;BA.debugLine="ret.Height = imagedata.Height";
_ret.Height /*int*/  = _imagedata.Height /*int*/ ;
RDebugUtils.currentLine=91029534;
 //BA.debugLineNum = 91029534;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=91029535;
 //BA.debugLineNum = 91029535;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=91029536;
 //BA.debugLineNum = 91029536;BA.debugLine="End Sub";
return null;
}
public byte[]  _packimageslice(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.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=91160576;
 //BA.debugLineNum = 91160576;BA.debugLine="Public Sub PackImageSlice(img As AnImage, slice As";
RDebugUtils.currentLine=91160577;
 //BA.debugLineNum = 91160577;BA.debugLine="Dim bytes As Int = img.width";
_bytes = _img.Width /*int*/ ;
RDebugUtils.currentLine=91160578;
 //BA.debugLineNum = 91160578;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=91160579;
 //BA.debugLineNum = 91160579;BA.debugLine="Dim pixels(bytes * 3) As Byte";
_pixels = new byte[(int) (_bytes*3)];
;
RDebugUtils.currentLine=91160580;
 //BA.debugLineNum = 91160580;BA.debugLine="Dim slicestart As Int = slice * bytes * 8 * 3";
_slicestart = (int) (_slice*_bytes*8*3);
 }else {
RDebugUtils.currentLine=91160582;
 //BA.debugLineNum = 91160582;BA.debugLine="Dim pixels(bytes) As Byte";
_pixels = new byte[_bytes];
;
RDebugUtils.currentLine=91160583;
 //BA.debugLineNum = 91160583;BA.debugLine="Dim slicestart As Int = slice * bytes * 8";
_slicestart = (int) (_slice*_bytes*8);
 };
RDebugUtils.currentLine=91160586;
 //BA.debugLineNum = 91160586;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=91160587;
 //BA.debugLineNum = 91160587;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=91160588;
 //BA.debugLineNum = 91160588;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=91160589;
 //BA.debugLineNum = 91160589;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=91160590;
 //BA.debugLineNum = 91160590;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=91160591;
 //BA.debugLineNum = 91160591;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=91160592;
 //BA.debugLineNum = 91160592;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=91160593;
 //BA.debugLineNum = 91160593;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=91160594;
 //BA.debugLineNum = 91160594;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=91160596;
 //BA.debugLineNum = 91160596;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=91160597;
 //BA.debugLineNum = 91160597;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=91160598;
 //BA.debugLineNum = 91160598;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=91160599;
 //BA.debugLineNum = 91160599;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=91160600;
 //BA.debugLineNum = 91160600;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=91160602;
 //BA.debugLineNum = 91160602;BA.debugLine="Dim pix As Byte = img.Data(slicestart + ((b +";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+((_b+_s*8)*_bytes)+_x)];
RDebugUtils.currentLine=91160603;
 //BA.debugLineNum = 91160603;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=91160604;
 //BA.debugLineNum = 91160604;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=91160607;
 //BA.debugLineNum = 91160607;BA.debugLine="pixels(x*3+s) = xbyte";
_pixels[(int) (_x*3+_s)] = _xbyte;
 }
};
 }
};
 }else {
RDebugUtils.currentLine=91160611;
 //BA.debugLineNum = 91160611;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=91160612;
 //BA.debugLineNum = 91160612;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=91160613;
 //BA.debugLineNum = 91160613;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=91160615;
 //BA.debugLineNum = 91160615;BA.debugLine="Dim pix As Byte = img.Data(slicestart + (b * b";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+(_b*_bytes)+_x)];
RDebugUtils.currentLine=91160616;
 //BA.debugLineNum = 91160616;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=91160617;
 //BA.debugLineNum = 91160617;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=91160620;
 //BA.debugLineNum = 91160620;BA.debugLine="pixels(x) = xbyte";
_pixels[_x] = _xbyte;
 }
};
 };
RDebugUtils.currentLine=91160623;
 //BA.debugLineNum = 91160623;BA.debugLine="Return pixels";
if (true) return _pixels;
RDebugUtils.currentLine=91160624;
 //BA.debugLineNum = 91160624;BA.debugLine="End Sub";
return null;
}
public String  _plotlinelow(gunav2.keymon.com.mx.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=90636288;
 //BA.debugLineNum = 90636288;BA.debugLine="Private Sub	PlotLineLow(x0 As Int, y0 As Int, x1 A";
RDebugUtils.currentLine=90636289;
 //BA.debugLineNum = 90636289;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=90636290;
 //BA.debugLineNum = 90636290;BA.debugLine="Dim dy As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=90636291;
 //BA.debugLineNum = 90636291;BA.debugLine="Dim yi As Int = 1";
_yi = (int) (1);
RDebugUtils.currentLine=90636292;
 //BA.debugLineNum = 90636292;BA.debugLine="If dy < 0 Then";
if (_dy<0) { 
RDebugUtils.currentLine=90636293;
 //BA.debugLineNum = 90636293;BA.debugLine="yi = -1";
_yi = (int) (-1);
RDebugUtils.currentLine=90636294;
 //BA.debugLineNum = 90636294;BA.debugLine="dy = -dy";
_dy = (int) (-_dy);
 };
RDebugUtils.currentLine=90636296;
 //BA.debugLineNum = 90636296;BA.debugLine="Dim D As Int = 2*dy - dx";
_d = (int) (2*_dy-_dx);
RDebugUtils.currentLine=90636297;
 //BA.debugLineNum = 90636297;BA.debugLine="Dim y As Int = y0";
_y = _y0;
RDebugUtils.currentLine=90636298;
 //BA.debugLineNum = 90636298;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=90636299;
 //BA.debugLineNum = 90636299;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=90636300;
 //BA.debugLineNum = 90636300;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=90636301;
 //BA.debugLineNum = 90636301;BA.debugLine="y = y + yi";
_y = (int) (_y+_yi);
RDebugUtils.currentLine=90636302;
 //BA.debugLineNum = 90636302;BA.debugLine="D = D - 2*dx";
_d = (int) (_d-2*_dx);
 };
RDebugUtils.currentLine=90636304;
 //BA.debugLineNum = 90636304;BA.debugLine="D = D + 2*dy";
_d = (int) (_d+2*_dy);
 }
};
RDebugUtils.currentLine=90636306;
 //BA.debugLineNum = 90636306;BA.debugLine="End Sub";
return "";
}
public String  _plotlinehigh(gunav2.keymon.com.mx.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=90570752;
 //BA.debugLineNum = 90570752;BA.debugLine="Private Sub PlotLineHigh(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=90570753;
 //BA.debugLineNum = 90570753;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=90570754;
 //BA.debugLineNum = 90570754;BA.debugLine="Dim dy  As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=90570755;
 //BA.debugLineNum = 90570755;BA.debugLine="Dim xi As Int = 1";
_xi = (int) (1);
RDebugUtils.currentLine=90570756;
 //BA.debugLineNum = 90570756;BA.debugLine="If dx < 0 Then";
if (_dx<0) { 
RDebugUtils.currentLine=90570757;
 //BA.debugLineNum = 90570757;BA.debugLine="xi = -1";
_xi = (int) (-1);
RDebugUtils.currentLine=90570758;
 //BA.debugLineNum = 90570758;BA.debugLine="dx = -dx";
_dx = (int) (-_dx);
 };
RDebugUtils.currentLine=90570760;
 //BA.debugLineNum = 90570760;BA.debugLine="Dim D As Int = 2*dx - dy";
_d = (int) (2*_dx-_dy);
RDebugUtils.currentLine=90570761;
 //BA.debugLineNum = 90570761;BA.debugLine="Dim x As Int = x0";
_x = _x0;
RDebugUtils.currentLine=90570762;
 //BA.debugLineNum = 90570762;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=90570763;
 //BA.debugLineNum = 90570763;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=90570764;
 //BA.debugLineNum = 90570764;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=90570765;
 //BA.debugLineNum = 90570765;BA.debugLine="x = x + xi";
_x = (int) (_x+_xi);
RDebugUtils.currentLine=90570766;
 //BA.debugLineNum = 90570766;BA.debugLine="D = D - 2*dy";
_d = (int) (_d-2*_dy);
 };
RDebugUtils.currentLine=90570768;
 //BA.debugLineNum = 90570768;BA.debugLine="D = D + 2*dx";
_d = (int) (_d+2*_dx);
 }
};
RDebugUtils.currentLine=90570770;
 //BA.debugLineNum = 90570770;BA.debugLine="End Sub";
return "";
}
public String  _printandfeedpaper(gunav2.keymon.com.mx.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=88801280;
 //BA.debugLineNum = 88801280;BA.debugLine="Public Sub PrintAndFeedPaper(units As Int)";
RDebugUtils.currentLine=88801281;
 //BA.debugLineNum = 88801281;BA.debugLine="WriteString(ESC & \"J\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"J");
RDebugUtils.currentLine=88801282;
 //BA.debugLineNum = 88801282;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=88801283;
 //BA.debugLineNum = 88801283;BA.debugLine="params(0) = units";
_params[(int) (0)] = (byte) (_units);
RDebugUtils.currentLine=88801284;
 //BA.debugLineNum = 88801284;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=88801285;
 //BA.debugLineNum = 88801285;BA.debugLine="End Sub";
return "";
}
public int  _printimage(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.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=90963968;
 //BA.debugLineNum = 90963968;BA.debugLine="Public Sub PrintImage(img As AnImage) As Int";
RDebugUtils.currentLine=90963971;
 //BA.debugLineNum = 90963971;BA.debugLine="If img.width > 72 Then Return -1";
if (_img.Width /*int*/ >72) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=90963972;
 //BA.debugLineNum = 90963972;BA.debugLine="If img.height > 512 Then Return -2";
if (_img.Height /*int*/ >512) { 
if (true) return (int) (-2);};
RDebugUtils.currentLine=90963973;
 //BA.debugLineNum = 90963973;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=90963974;
 //BA.debugLineNum = 90963974;BA.debugLine="Dim xh As Int = img.width / 256";
_xh = (int) (_img.Width /*int*/ /(double)256);
RDebugUtils.currentLine=90963975;
 //BA.debugLineNum = 90963975;BA.debugLine="Dim xl As Int = img.width - xh * 256";
_xl = (int) (_img.Width /*int*/ -_xh*256);
RDebugUtils.currentLine=90963976;
 //BA.debugLineNum = 90963976;BA.debugLine="Dim yh As Int = img.height / 256";
_yh = (int) (_img.Height /*int*/ /(double)256);
RDebugUtils.currentLine=90963977;
 //BA.debugLineNum = 90963977;BA.debugLine="Dim yl As Int = img.height - yh * 256";
_yl = (int) (_img.Height /*int*/ -_yh*256);
RDebugUtils.currentLine=90963978;
 //BA.debugLineNum = 90963978;BA.debugLine="Dim params(5) As Byte";
_params = new byte[(int) (5)];
;
RDebugUtils.currentLine=90963979;
 //BA.debugLineNum = 90963979;BA.debugLine="params(0) = 0 '";
_params[(int) (0)] = (byte) (0);
RDebugUtils.currentLine=90963980;
 //BA.debugLineNum = 90963980;BA.debugLine="params(1) = xl";
_params[(int) (1)] = (byte) (_xl);
RDebugUtils.currentLine=90963981;
 //BA.debugLineNum = 90963981;BA.debugLine="params(2) = xh";
_params[(int) (2)] = (byte) (_xh);
RDebugUtils.currentLine=90963982;
 //BA.debugLineNum = 90963982;BA.debugLine="params(3) = yl";
_params[(int) (3)] = (byte) (_yl);
RDebugUtils.currentLine=90963983;
 //BA.debugLineNum = 90963983;BA.debugLine="params(4) = yh";
_params[(int) (4)] = (byte) (_yh);
RDebugUtils.currentLine=90963984;
 //BA.debugLineNum = 90963984;BA.debugLine="WriteString(GS & \"v0\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"v0");
RDebugUtils.currentLine=90963985;
 //BA.debugLineNum = 90963985;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=90963986;
 //BA.debugLineNum = 90963986;BA.debugLine="WriteBytes(img.data)";
__ref._writebytes /*String*/ (null,_img.Data /*byte[]*/ );
RDebugUtils.currentLine=90963987;
 //BA.debugLineNum = 90963987;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=90963988;
 //BA.debugLineNum = 90963988;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=90963989;
 //BA.debugLineNum = 90963989;BA.debugLine="End Sub";
return 0;
}
public int  _printimage2(gunav2.keymon.com.mx.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=91095040;
 //BA.debugLineNum = 91095040;BA.debugLine="Public Sub PrintImage2(width As Int, data() As Byt";
RDebugUtils.currentLine=91095041;
 //BA.debugLineNum = 91095041;BA.debugLine="Dim d As String = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=91095042;
 //BA.debugLineNum = 91095042;BA.debugLine="If Not(highdensity) And Not(dotds24 )	 Then";
if (__c.Not(_highdensity) && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=91095043;
 //BA.debugLineNum = 91095043;BA.debugLine="d = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=91095044;
 //BA.debugLineNum = 91095044;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=91095045;
 //BA.debugLineNum = 91095045;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=91095046;
 //BA.debugLineNum = 91095046;BA.debugLine="Else If highdensity And Not(dotds24) 	 Then";
if (_highdensity && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=91095047;
 //BA.debugLineNum = 91095047;BA.debugLine="d = Chr(1)";
_d = BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=91095048;
 //BA.debugLineNum = 91095048;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=91095049;
 //BA.debugLineNum = 91095049;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=91095050;
 //BA.debugLineNum = 91095050;BA.debugLine="Else 	If Not(highdensity) And dotds24 	 Then";
if (__c.Not(_highdensity) && _dotds24) { 
RDebugUtils.currentLine=91095051;
 //BA.debugLineNum = 91095051;BA.debugLine="d = Chr(32)";
_d = BA.ObjectToString(__c.Chr((int) (32)));
RDebugUtils.currentLine=91095052;
 //BA.debugLineNum = 91095052;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=91095053;
 //BA.debugLineNum = 91095053;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }else {
RDebugUtils.currentLine=91095055;
 //BA.debugLineNum = 91095055;BA.debugLine="d = Chr(33)";
_d = BA.ObjectToString(__c.Chr((int) (33)));
RDebugUtils.currentLine=91095056;
 //BA.debugLineNum = 91095056;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=91095057;
 //BA.debugLineNum = 91095057;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }}}
;
RDebugUtils.currentLine=91095059;
 //BA.debugLineNum = 91095059;BA.debugLine="Dim xh As Int = width / 256";
_xh = (int) (_width/(double)256);
RDebugUtils.currentLine=91095060;
 //BA.debugLineNum = 91095060;BA.debugLine="Dim xl As Int = width - xh * 256";
_xl = (int) (_width-_xh*256);
RDebugUtils.currentLine=91095061;
 //BA.debugLineNum = 91095061;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=91095062;
 //BA.debugLineNum = 91095062;BA.debugLine="params(0) = xl";
_params[(int) (0)] = (byte) (_xl);
RDebugUtils.currentLine=91095063;
 //BA.debugLineNum = 91095063;BA.debugLine="params(1) = xh";
_params[(int) (1)] = (byte) (_xh);
RDebugUtils.currentLine=91095064;
 //BA.debugLineNum = 91095064;BA.debugLine="WriteString(ESC & \"*\" & d)";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"*"+_d);
RDebugUtils.currentLine=91095065;
 //BA.debugLineNum = 91095065;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91095066;
 //BA.debugLineNum = 91095066;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=91095067;
 //BA.debugLineNum = 91095067;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=91095068;
 //BA.debugLineNum = 91095068;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=91095069;
 //BA.debugLineNum = 91095069;BA.debugLine="End Sub";
return 0;
}
public String  _reset(gunav2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "reset", false))
	 {return ((String) Debug.delegate(ba, "reset", null));}
RDebugUtils.currentLine=88735744;
 //BA.debugLineNum = 88735744;BA.debugLine="Public Sub Reset";
RDebugUtils.currentLine=88735745;
 //BA.debugLineNum = 88735745;BA.debugLine="WriteString(ESC & \"@\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"@");
RDebugUtils.currentLine=88735746;
 //BA.debugLineNum = 88735746;BA.debugLine="End Sub";
return "";
}
public String  _serial1_connected(gunav2.keymon.com.mx.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=91684864;
 //BA.debugLineNum = 91684864;BA.debugLine="Private Sub Serial1_Connected (Success As Boolean)";
RDebugUtils.currentLine=91684865;
 //BA.debugLineNum = 91684865;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=91684866;
 //BA.debugLineNum = 91684866;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=91684867;
 //BA.debugLineNum = 91684867;BA.debugLine="Connected = True";
__ref._connected /*boolean*/  = __c.True;
RDebugUtils.currentLine=91684868;
 //BA.debugLineNum = 91684868;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=91684869;
 //BA.debugLineNum = 91684869;BA.debugLine="Serial1.Listen";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Listen(ba);
 }else {
RDebugUtils.currentLine=91684871;
 //BA.debugLineNum = 91684871;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=91684872;
 //BA.debugLineNum = 91684872;BA.debugLine="ConnectedError = LastException.Message";
__ref._connectederror /*String*/  = __c.LastException(getActivityBA()).getMessage();
 };
RDebugUtils.currentLine=91684874;
 //BA.debugLineNum = 91684874;BA.debugLine="If SubExists(CallBack, EventName & \"_Connected\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected")) { 
RDebugUtils.currentLine=91684875;
 //BA.debugLineNum = 91684875;BA.debugLine="CallSub2(CallBack, EventName & \"_Connected\", Suc";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected",(Object)(_success));
 };
RDebugUtils.currentLine=91684877;
 //BA.debugLineNum = 91684877;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeheight(gunav2.keymon.com.mx.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=91226112;
 //BA.debugLineNum = 91226112;BA.debugLine="Public Sub setBarCodeHeight(height As Int)";
RDebugUtils.currentLine=91226113;
 //BA.debugLineNum = 91226113;BA.debugLine="WriteString(GS & \"h\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"h");
RDebugUtils.currentLine=91226114;
 //BA.debugLineNum = 91226114;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=91226115;
 //BA.debugLineNum = 91226115;BA.debugLine="params(0) = height";
_params[(int) (0)] = (byte) (_height);
RDebugUtils.currentLine=91226116;
 //BA.debugLineNum = 91226116;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91226117;
 //BA.debugLineNum = 91226117;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeleft(gunav2.keymon.com.mx.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=91291648;
 //BA.debugLineNum = 91291648;BA.debugLine="Public Sub setBarCodeLeft(left As Int)";
RDebugUtils.currentLine=91291649;
 //BA.debugLineNum = 91291649;BA.debugLine="WriteString(GS & \"x\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"x");
RDebugUtils.currentLine=91291650;
 //BA.debugLineNum = 91291650;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=91291651;
 //BA.debugLineNum = 91291651;BA.debugLine="params(0) = left";
_params[(int) (0)] = (byte) (_left);
RDebugUtils.currentLine=91291652;
 //BA.debugLineNum = 91291652;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91291653;
 //BA.debugLineNum = 91291653;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodewidth(gunav2.keymon.com.mx.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=91357184;
 //BA.debugLineNum = 91357184;BA.debugLine="Public Sub setBarCodeWidth(width As Int)";
RDebugUtils.currentLine=91357185;
 //BA.debugLineNum = 91357185;BA.debugLine="WriteString(GS & \"w\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"w");
RDebugUtils.currentLine=91357186;
 //BA.debugLineNum = 91357186;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=91357187;
 //BA.debugLineNum = 91357187;BA.debugLine="params(0) = width";
_params[(int) (0)] = (byte) (_width);
RDebugUtils.currentLine=91357188;
 //BA.debugLineNum = 91357188;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91357189;
 //BA.debugLineNum = 91357189;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterfont(gunav2.keymon.com.mx.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=89325568;
 //BA.debugLineNum = 89325568;BA.debugLine="Public Sub setCharacterFont(font As Int)";
RDebugUtils.currentLine=89325569;
 //BA.debugLineNum = 89325569;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=89325570;
 //BA.debugLineNum = 89325570;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterspacing(gunav2.keymon.com.mx.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=88866816;
 //BA.debugLineNum = 88866816;BA.debugLine="Public Sub setCharacterSpacing(spacing As Int)";
RDebugUtils.currentLine=88866817;
 //BA.debugLineNum = 88866817;BA.debugLine="WriteString(ESC & \" \")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +" ");
RDebugUtils.currentLine=88866818;
 //BA.debugLineNum = 88866818;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=88866819;
 //BA.debugLineNum = 88866819;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=88866820;
 //BA.debugLineNum = 88866820;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=88866821;
 //BA.debugLineNum = 88866821;BA.debugLine="End Sub";
return "";
}
public String  _setcodepage(gunav2.keymon.com.mx.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=89260032;
 //BA.debugLineNum = 89260032;BA.debugLine="Public Sub setCodePage(codepage As Int)";
RDebugUtils.currentLine=89260033;
 //BA.debugLineNum = 89260033;BA.debugLine="WriteString(ESC & \"t\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"t");
RDebugUtils.currentLine=89260034;
 //BA.debugLineNum = 89260034;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=89260035;
 //BA.debugLineNum = 89260035;BA.debugLine="params(0) = codepage";
_params[(int) (0)] = (byte) (_codepage);
RDebugUtils.currentLine=89260036;
 //BA.debugLineNum = 89260036;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=89260037;
 //BA.debugLineNum = 89260037;BA.debugLine="End Sub";
return "";
}
public String  _sethrifont(gunav2.keymon.com.mx.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=91488256;
 //BA.debugLineNum = 91488256;BA.debugLine="Public Sub setHriFont(font As Int)";
RDebugUtils.currentLine=91488257;
 //BA.debugLineNum = 91488257;BA.debugLine="WriteString(GS & \"f\" & Chr(font))";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"f"+BA.ObjectToString(__c.Chr(_font)));
RDebugUtils.currentLine=91488258;
 //BA.debugLineNum = 91488258;BA.debugLine="End Sub";
return "";
}
public String  _sethriposn(gunav2.keymon.com.mx.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=91422720;
 //BA.debugLineNum = 91422720;BA.debugLine="Public Sub setHriPosn(posn As Int)";
RDebugUtils.currentLine=91422721;
 //BA.debugLineNum = 91422721;BA.debugLine="WriteString(GS & \"H\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"H");
RDebugUtils.currentLine=91422722;
 //BA.debugLineNum = 91422722;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=91422723;
 //BA.debugLineNum = 91422723;BA.debugLine="params(0) = posn";
_params[(int) (0)] = (byte) (_posn);
RDebugUtils.currentLine=91422724;
 //BA.debugLineNum = 91422724;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91422725;
 //BA.debugLineNum = 91422725;BA.debugLine="End Sub";
return "";
}
public String  _setjustify(gunav2.keymon.com.mx.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=89194496;
 //BA.debugLineNum = 89194496;BA.debugLine="Public Sub setJustify(justify As Int)";
RDebugUtils.currentLine=89194497;
 //BA.debugLineNum = 89194497;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=89194498;
 //BA.debugLineNum = 89194498;BA.debugLine="End Sub";
return "";
}
public String  _setleftinset(gunav2.keymon.com.mx.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=88932352;
 //BA.debugLineNum = 88932352;BA.debugLine="Public Sub setLeftInset(inset As Int)";
RDebugUtils.currentLine=88932353;
 //BA.debugLineNum = 88932353;BA.debugLine="Dim dh As Int = inset / 256";
_dh = (int) (_inset/(double)256);
RDebugUtils.currentLine=88932354;
 //BA.debugLineNum = 88932354;BA.debugLine="Dim dl As Int = inset - dh";
_dl = (int) (_inset-_dh);
RDebugUtils.currentLine=88932355;
 //BA.debugLineNum = 88932355;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=88932356;
 //BA.debugLineNum = 88932356;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=88932357;
 //BA.debugLineNum = 88932357;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=88932358;
 //BA.debugLineNum = 88932358;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=88932359;
 //BA.debugLineNum = 88932359;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=88932360;
 //BA.debugLineNum = 88932360;BA.debugLine="End Sub";
return "";
}
public String  _setleftmargin(gunav2.keymon.com.mx.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=88997888;
 //BA.debugLineNum = 88997888;BA.debugLine="Public Sub setLeftMargin(margin As Int)";
RDebugUtils.currentLine=88997889;
 //BA.debugLineNum = 88997889;BA.debugLine="Dim dh As Int = margin / 256";
_dh = (int) (_margin/(double)256);
RDebugUtils.currentLine=88997890;
 //BA.debugLineNum = 88997890;BA.debugLine="Dim dl As Int = margin - dh";
_dl = (int) (_margin-_dh);
RDebugUtils.currentLine=88997891;
 //BA.debugLineNum = 88997891;BA.debugLine="WriteString(GS & \"L\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"L");
RDebugUtils.currentLine=88997892;
 //BA.debugLineNum = 88997892;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=88997893;
 //BA.debugLineNum = 88997893;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=88997894;
 //BA.debugLineNum = 88997894;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=88997895;
 //BA.debugLineNum = 88997895;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=88997896;
 //BA.debugLineNum = 88997896;BA.debugLine="End Sub";
return "";
}
public String  _setlinespacing(gunav2.keymon.com.mx.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=89128960;
 //BA.debugLineNum = 89128960;BA.debugLine="Public Sub setLineSpacing(spacing As Int)";
RDebugUtils.currentLine=89128961;
 //BA.debugLineNum = 89128961;BA.debugLine="If spacing < 0 Then";
if (_spacing<0) { 
RDebugUtils.currentLine=89128962;
 //BA.debugLineNum = 89128962;BA.debugLine="WriteString(ESC & \"2\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"2");
 }else {
RDebugUtils.currentLine=89128964;
 //BA.debugLineNum = 89128964;BA.debugLine="WriteString(ESC & \"3\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"3");
RDebugUtils.currentLine=89128965;
 //BA.debugLineNum = 89128965;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=89128966;
 //BA.debugLineNum = 89128966;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=89128967;
 //BA.debugLineNum = 89128967;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
 };
RDebugUtils.currentLine=89128969;
 //BA.debugLineNum = 89128969;BA.debugLine="End Sub";
return "";
}
public String  _setprintwidth(gunav2.keymon.com.mx.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=89063424;
 //BA.debugLineNum = 89063424;BA.debugLine="Public Sub setPrintWidth(width As Int)";
RDebugUtils.currentLine=89063425;
 //BA.debugLineNum = 89063425;BA.debugLine="Dim dh As Int = width / 256";
_dh = (int) (_width/(double)256);
RDebugUtils.currentLine=89063426;
 //BA.debugLineNum = 89063426;BA.debugLine="Dim dl As Int = width - dh";
_dl = (int) (_width-_dh);
RDebugUtils.currentLine=89063427;
 //BA.debugLineNum = 89063427;BA.debugLine="WriteString(GS & \"W\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"W");
RDebugUtils.currentLine=89063428;
 //BA.debugLineNum = 89063428;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=89063429;
 //BA.debugLineNum = 89063429;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=89063430;
 //BA.debugLineNum = 89063430;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=89063431;
 //BA.debugLineNum = 89063431;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=89063432;
 //BA.debugLineNum = 89063432;BA.debugLine="End Sub";
return "";
}
public String  _setrelativeprintposn(gunav2.keymon.com.mx.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=89456640;
 //BA.debugLineNum = 89456640;BA.debugLine="Public Sub setRelativePrintPosn(relposn As Int)";
RDebugUtils.currentLine=89456641;
 //BA.debugLineNum = 89456641;BA.debugLine="Dim dh As Int = relposn / 256";
_dh = (int) (_relposn/(double)256);
RDebugUtils.currentLine=89456642;
 //BA.debugLineNum = 89456642;BA.debugLine="Dim dl As Int = relposn - dh";
_dl = (int) (_relposn-_dh);
RDebugUtils.currentLine=89456643;
 //BA.debugLineNum = 89456643;BA.debugLine="WriteString(ESC & \"\\\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"\\");
RDebugUtils.currentLine=89456644;
 //BA.debugLineNum = 89456644;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=89456645;
 //BA.debugLineNum = 89456645;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=89456646;
 //BA.debugLineNum = 89456646;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=89456647;
 //BA.debugLineNum = 89456647;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=89456648;
 //BA.debugLineNum = 89456648;BA.debugLine="End Sub";
return "";
}
public String  _settabpositions(gunav2.keymon.com.mx.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=89391104;
 //BA.debugLineNum = 89391104;BA.debugLine="Public Sub setTabPositions(tabs() As Int)";
RDebugUtils.currentLine=89391105;
 //BA.debugLineNum = 89391105;BA.debugLine="WriteString(ESC & \"D\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"D");
RDebugUtils.currentLine=89391106;
 //BA.debugLineNum = 89391106;BA.debugLine="Dim data(tabs.Length+1) As Byte";
_data = new byte[(int) (_tabs.length+1)];
;
RDebugUtils.currentLine=89391107;
 //BA.debugLineNum = 89391107;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=89391108;
 //BA.debugLineNum = 89391108;BA.debugLine="data(i) = tabs(i)";
_data[_i] = (byte) (_tabs[_i]);
 }
};
RDebugUtils.currentLine=89391110;
 //BA.debugLineNum = 89391110;BA.debugLine="data(tabs.Length) = 0";
_data[_tabs.length] = (byte) (0);
RDebugUtils.currentLine=89391111;
 //BA.debugLineNum = 89391111;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=89391112;
 //BA.debugLineNum = 89391112;BA.debugLine="End Sub";
return "";
}
public String  _setusecustomcharacters(gunav2.keymon.com.mx.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=89784320;
 //BA.debugLineNum = 89784320;BA.debugLine="Public Sub setUseCustomCharacters(custom As Boolea";
RDebugUtils.currentLine=89784321;
 //BA.debugLineNum = 89784321;BA.debugLine="If custom Then";
if (_custom) { 
RDebugUtils.currentLine=89784322;
 //BA.debugLineNum = 89784322;BA.debugLine="WriteString(ESC & \"%1\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%1");
 }else {
RDebugUtils.currentLine=89784324;
 //BA.debugLineNum = 89784324;BA.debugLine="WriteString(ESC & \"%0\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%0");
 };
RDebugUtils.currentLine=89784326;
 //BA.debugLineNum = 89784326;BA.debugLine="End Sub";
return "";
}
public gunav2.keymon.com.mx.escposprinter._animage  _thresholdimage(gunav2.keymon.com.mx.escposprinter __ref,gunav2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "thresholdimage", false))
	 {return ((gunav2.keymon.com.mx.escposprinter._animage) Debug.delegate(ba, "thresholdimage", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _i = 0;
int _lum = 0;
gunav2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=90767360;
 //BA.debugLineNum = 90767360;BA.debugLine="Sub ThresholdImage(img As AnImage, threshold As In";
RDebugUtils.currentLine=90767361;
 //BA.debugLineNum = 90767361;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=90767362;
 //BA.debugLineNum = 90767362;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=90767363;
 //BA.debugLineNum = 90767363;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=90767364;
 //BA.debugLineNum = 90767364;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=90767365;
 //BA.debugLineNum = 90767365;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=90767367;
 //BA.debugLineNum = 90767367;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=90767369;
 //BA.debugLineNum = 90767369;BA.debugLine="pixels(i) = lum";
_pixels[_i] = (byte) (_lum);
 }
};
RDebugUtils.currentLine=90767371;
 //BA.debugLineNum = 90767371;BA.debugLine="Dim ret As AnImage";
_ret = new gunav2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=90767372;
 //BA.debugLineNum = 90767372;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=90767373;
 //BA.debugLineNum = 90767373;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=90767374;
 //BA.debugLineNum = 90767374;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=90767375;
 //BA.debugLineNum = 90767375;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=90767376;
 //BA.debugLineNum = 90767376;BA.debugLine="End Sub";
return null;
}
public String  _writebarcode(gunav2.keymon.com.mx.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=91553792;
 //BA.debugLineNum = 91553792;BA.debugLine="Public Sub WriteBarCode(bartype As String, data As";
RDebugUtils.currentLine=91553793;
 //BA.debugLineNum = 91553793;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ASCII\")";
_databytes = _data.getBytes("ASCII");
RDebugUtils.currentLine=91553794;
 //BA.debugLineNum = 91553794;BA.debugLine="Dim dlow As Int = databytes.Length";
_dlow = _databytes.length;
RDebugUtils.currentLine=91553795;
 //BA.debugLineNum = 91553795;BA.debugLine="Log(\"Barcode \" & bartype & \", Size \" & dlow & \",";
__c.LogImpl("091553795","Barcode "+_bartype+", Size "+BA.NumberToString(_dlow)+", "+_data,0);
RDebugUtils.currentLine=91553796;
 //BA.debugLineNum = 91553796;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=91553797;
 //BA.debugLineNum = 91553797;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=91553798;
 //BA.debugLineNum = 91553798;BA.debugLine="params(0) = dlow";
_params[(int) (0)] = (byte) (_dlow);
RDebugUtils.currentLine=91553799;
 //BA.debugLineNum = 91553799;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91553800;
 //BA.debugLineNum = 91553800;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=91553801;
 //BA.debugLineNum = 91553801;BA.debugLine="End Sub";
return "";
}
public String  _writeqrcode(gunav2.keymon.com.mx.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=91619328;
 //BA.debugLineNum = 91619328;BA.debugLine="Public Sub WriteQRCode(size As Int, EC As String,";
RDebugUtils.currentLine=91619329;
 //BA.debugLineNum = 91619329;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ISO-8859";
_databytes = _data.getBytes("ISO-8859-1");
RDebugUtils.currentLine=91619330;
 //BA.debugLineNum = 91619330;BA.debugLine="Dim dhigh As Int = databytes.Length / 256";
_dhigh = (int) (_databytes.length/(double)256);
RDebugUtils.currentLine=91619331;
 //BA.debugLineNum = 91619331;BA.debugLine="Dim dlow As Int = databytes.Length - dhigh*256";
_dlow = (int) (_databytes.length-_dhigh*256);
RDebugUtils.currentLine=91619332;
 //BA.debugLineNum = 91619332;BA.debugLine="Log(\"QR Code : Size \" & size & \", EC \" & EC & \",";
__c.LogImpl("091619332","QR Code : Size "+BA.NumberToString(_size)+", EC "+_ec+", Scale "+BA.NumberToString(_scale)+", Size "+BA.NumberToString(_dlow)+" "+BA.NumberToString(_dhigh)+" : Data = "+_data,0);
RDebugUtils.currentLine=91619333;
 //BA.debugLineNum = 91619333;BA.debugLine="Dim params(3) As Byte";
_params = new byte[(int) (3)];
;
RDebugUtils.currentLine=91619334;
 //BA.debugLineNum = 91619334;BA.debugLine="params(0) = scale";
_params[(int) (0)] = (byte) (_scale);
RDebugUtils.currentLine=91619335;
 //BA.debugLineNum = 91619335;BA.debugLine="params(1) = dlow";
_params[(int) (1)] = (byte) (_dlow);
RDebugUtils.currentLine=91619336;
 //BA.debugLineNum = 91619336;BA.debugLine="params(2) = dhigh";
_params[(int) (2)] = (byte) (_dhigh);
RDebugUtils.currentLine=91619337;
 //BA.debugLineNum = 91619337;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=91619338;
 //BA.debugLineNum = 91619338;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=91619339;
 //BA.debugLineNum = 91619339;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=91619340;
 //BA.debugLineNum = 91619340;BA.debugLine="End Sub";
return "";
}
public String  _writestring2(gunav2.keymon.com.mx.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=89653248;
 //BA.debugLineNum = 89653248;BA.debugLine="Public Sub WriteString2(data As String, encoding A";
RDebugUtils.currentLine=89653249;
 //BA.debugLineNum = 89653249;BA.debugLine="Try";
try {RDebugUtils.currentLine=89653250;
 //BA.debugLineNum = 89653250;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=89653251;
 //BA.debugLineNum = 89653251;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=89653254;
 //BA.debugLineNum = 89653254;BA.debugLine="Log(\"Printer error : \" & LastException.Message)";
__c.LogImpl("089653254","Printer error : "+__c.LastException(getActivityBA()).getMessage(),0);
RDebugUtils.currentLine=89653255;
 //BA.debugLineNum = 89653255;BA.debugLine="AStream_Error";
__ref._astream_error /*String*/ (null);
 };
RDebugUtils.currentLine=89653257;
 //BA.debugLineNum = 89653257;BA.debugLine="End Sub";
return "";
}
}