package SHARK2.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, "SHARK2.keymon.com.mx.escposprinter");
            if (htSubs == null) {
                ba.loadHtSubs(this.getClass());
                htSubs = ba.htSubs;
            }
            
        }
        if (BA.isShellModeRuntimeCheck(ba)) 
			   this.getClass().getMethod("_class_globals", SHARK2.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 SHARK2.keymon.com.mx.main _main = null;
public SHARK2.keymon.com.mx.appupdater _appupdater = null;
public SHARK2.keymon.com.mx.mapa_cliente _mapa_cliente = null;
public SHARK2.keymon.com.mx.mapa_rutas _mapa_rutas = null;
public SHARK2.keymon.com.mx.notificationservice _notificationservice = null;
public SHARK2.keymon.com.mx.pendientes _pendientes = null;
public SHARK2.keymon.com.mx.starter _starter = null;
public SHARK2.keymon.com.mx.subs _subs = null;
public SHARK2.keymon.com.mx.tracker _tracker = null;
public SHARK2.keymon.com.mx.newinst2 _newinst2 = null;
public SHARK2.keymon.com.mx.b4xpages _b4xpages = null;
public SHARK2.keymon.com.mx.b4xcollections _b4xcollections = null;
public SHARK2.keymon.com.mx.httputils2service _httputils2service = null;
public SHARK2.keymon.com.mx.xuiviewsutils _xuiviewsutils = null;
public String  _initialize(SHARK2.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=28311552;
 //BA.debugLineNum = 28311552;BA.debugLine="Public Sub Initialize(vCallback As Object, vEventN";
RDebugUtils.currentLine=28311553;
 //BA.debugLineNum = 28311553;BA.debugLine="EventName = vEventName";
__ref._eventname /*String*/  = _veventname;
RDebugUtils.currentLine=28311554;
 //BA.debugLineNum = 28311554;BA.debugLine="CallBack = vCallback";
__ref._callback /*Object*/  = _vcallback;
RDebugUtils.currentLine=28311555;
 //BA.debugLineNum = 28311555;BA.debugLine="Serial1.Initialize(\"Serial1\")";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Initialize("Serial1");
RDebugUtils.currentLine=28311556;
 //BA.debugLineNum = 28311556;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=28311557;
 //BA.debugLineNum = 28311557;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=28311558;
 //BA.debugLineNum = 28311558;BA.debugLine="End Sub";
return "";
}
public boolean  _isconnected(SHARK2.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=28442624;
 //BA.debugLineNum = 28442624;BA.debugLine="Public Sub IsConnected As Boolean";
RDebugUtils.currentLine=28442625;
 //BA.debugLineNum = 28442625;BA.debugLine="Return Connected";
if (true) return __ref._connected /*boolean*/ ;
RDebugUtils.currentLine=28442626;
 //BA.debugLineNum = 28442626;BA.debugLine="End Sub";
return false;
}
public String  _disconnect(SHARK2.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=28639232;
 //BA.debugLineNum = 28639232;BA.debugLine="Public Sub DisConnect";
RDebugUtils.currentLine=28639233;
 //BA.debugLineNum = 28639233;BA.debugLine="Serial1.Disconnect";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Disconnect();
RDebugUtils.currentLine=28639234;
 //BA.debugLineNum = 28639234;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=28639235;
 //BA.debugLineNum = 28639235;BA.debugLine="End Sub";
return "";
}
public boolean  _connect(SHARK2.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=28573696;
 //BA.debugLineNum = 28573696;BA.debugLine="Public Sub Connect As Boolean";
RDebugUtils.currentLine=28573700;
 //BA.debugLineNum = 28573700;BA.debugLine="Try";
try {RDebugUtils.currentLine=28573701;
 //BA.debugLineNum = 28573701;BA.debugLine="If Starter.MAC_IMPRESORA = \"0\" Then";
if ((_starter._mac_impresora /*String*/ ).equals("0")) { 
RDebugUtils.currentLine=28573702;
 //BA.debugLineNum = 28573702;BA.debugLine="Dim PairedDevices As Map";
_paireddevices = new anywheresoftware.b4a.objects.collections.Map();
RDebugUtils.currentLine=28573703;
 //BA.debugLineNum = 28573703;BA.debugLine="PairedDevices = Serial1.GetPairedDevices";
_paireddevices = __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .GetPairedDevices();
RDebugUtils.currentLine=28573704;
 //BA.debugLineNum = 28573704;BA.debugLine="Dim l As List";
_l = new anywheresoftware.b4a.objects.collections.List();
RDebugUtils.currentLine=28573705;
 //BA.debugLineNum = 28573705;BA.debugLine="l.Initialize";
_l.Initialize();
RDebugUtils.currentLine=28573706;
 //BA.debugLineNum = 28573706;BA.debugLine="Log(\"aqui 1\")";
__c.LogImpl("528573706","aqui 1",0);
RDebugUtils.currentLine=28573707;
 //BA.debugLineNum = 28573707;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=28573708;
 //BA.debugLineNum = 28573708;BA.debugLine="l.Add(PairedDevices.GetKeyAt(i))";
_l.Add(_paireddevices.GetKeyAt(_i));
RDebugUtils.currentLine=28573709;
 //BA.debugLineNum = 28573709;BA.debugLine="Log(\"aqui 2\")";
__c.LogImpl("528573709","aqui 2",0);
RDebugUtils.currentLine=28573710;
 //BA.debugLineNum = 28573710;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
 }
};
RDebugUtils.currentLine=28573712;
 //BA.debugLineNum = 28573712;BA.debugLine="Dim Res As Int";
_res = 0;
RDebugUtils.currentLine=28573713;
 //BA.debugLineNum = 28573713;BA.debugLine="Res = InputList(l, \"Choose a printer\", -1) 'sho";
_res = __c.InputList(_l,BA.ObjectToCharSequence("Choose a printer"),(int) (-1),getActivityBA());
RDebugUtils.currentLine=28573714;
 //BA.debugLineNum = 28573714;BA.debugLine="If Res <> DialogResponse.CANCEL Then";
if (_res!=__c.DialogResponse.CANCEL) { 
RDebugUtils.currentLine=28573715;
 //BA.debugLineNum = 28573715;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=28573717;
 //BA.debugLineNum = 28573717;BA.debugLine="Starter.mac_impresora = PairedDevices.Get(l.Ge";
_starter._mac_impresora /*String*/  = BA.ObjectToString(_paireddevices.Get(_l.Get(_res)));
RDebugUtils.currentLine=28573718;
 //BA.debugLineNum = 28573718;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=28573719;
 //BA.debugLineNum = 28573719;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=28573720;
 //BA.debugLineNum = 28573720;BA.debugLine="Log(\"aqui 3\")";
__c.LogImpl("528573720","aqui 3",0);
 };
RDebugUtils.currentLine=28573722;
 //BA.debugLineNum = 28573722;BA.debugLine="Log(\"aqui 4\")";
__c.LogImpl("528573722","aqui 4",0);
RDebugUtils.currentLine=28573723;
 //BA.debugLineNum = 28573723;BA.debugLine="Return False";
if (true) return __c.False;
 }else {
RDebugUtils.currentLine=28573725;
 //BA.debugLineNum = 28573725;BA.debugLine="Serial1.Connect(Starter.mac_impresora)";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Connect(ba,_starter._mac_impresora /*String*/ );
RDebugUtils.currentLine=28573727;
 //BA.debugLineNum = 28573727;BA.debugLine="Return True";
if (true) return __c.True;
RDebugUtils.currentLine=28573728;
 //BA.debugLineNum = 28573728;BA.debugLine="DisConnect";
__ref._disconnect /*String*/ (null);
RDebugUtils.currentLine=28573729;
 //BA.debugLineNum = 28573729;BA.debugLine="Log(\"aqui 5\")";
__c.LogImpl("528573729","aqui 5",0);
 };
 } 
       catch (Exception e31) {
			ba.setLastException(e31);RDebugUtils.currentLine=28573732;
 //BA.debugLineNum = 28573732;BA.debugLine="Log(LastException)";
__c.LogImpl("528573732",BA.ObjectToString(__c.LastException(getActivityBA())),0);
RDebugUtils.currentLine=28573733;
 //BA.debugLineNum = 28573733;BA.debugLine="Return False";
if (true) return __c.False;
 };
RDebugUtils.currentLine=28573735;
 //BA.debugLineNum = 28573735;BA.debugLine="End Sub";
return false;
}
public String  _writestring(SHARK2.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=29556736;
 //BA.debugLineNum = 29556736;BA.debugLine="Public Sub WriteString(data As String)";
RDebugUtils.currentLine=29556737;
 //BA.debugLineNum = 29556737;BA.debugLine="WriteString2(data, \"IBM437\")";
__ref._writestring2 /*String*/ (null,_data,"IBM437");
RDebugUtils.currentLine=29556738;
 //BA.debugLineNum = 29556738;BA.debugLine="End Sub";
return "";
}
public String  _setjustify(SHARK2.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=29163520;
 //BA.debugLineNum = 29163520;BA.debugLine="Public Sub setJustify(justify As Int)";
RDebugUtils.currentLine=29163521;
 //BA.debugLineNum = 29163521;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=29163522;
 //BA.debugLineNum = 29163522;BA.debugLine="End Sub";
return "";
}
public SHARK2.keymon.com.mx.escposprinter._animage  _imagetobwimage(SHARK2.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 ((SHARK2.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;
SHARK2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=30670848;
 //BA.debugLineNum = 30670848;BA.debugLine="Sub ImageToBWIMage(bmp As Bitmap) As AnImage";
RDebugUtils.currentLine=30670849;
 //BA.debugLineNum = 30670849;BA.debugLine="Dim BC As BitmapCreator 'ignore";
_bc = new b4a.example.bitmapcreator();
RDebugUtils.currentLine=30670850;
 //BA.debugLineNum = 30670850;BA.debugLine="Dim W As Int = bmp.Width";
_w = _bmp.getWidth();
RDebugUtils.currentLine=30670851;
 //BA.debugLineNum = 30670851;BA.debugLine="Dim H As Int = bmp.Height";
_h = _bmp.getHeight();
RDebugUtils.currentLine=30670852;
 //BA.debugLineNum = 30670852;BA.debugLine="Dim pixels(W * H) As Byte";
_pixels = new byte[(int) (_w*_h)];
;
RDebugUtils.currentLine=30670854;
 //BA.debugLineNum = 30670854;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=30670855;
 //BA.debugLineNum = 30670855;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=30670856;
 //BA.debugLineNum = 30670856;BA.debugLine="Dim j As Int = bmp.GetPixel(x, y)";
_j = _bmp.GetPixel(_x,_y);
RDebugUtils.currentLine=30670858;
 //BA.debugLineNum = 30670858;BA.debugLine="Dim col As ARGBColor";
_col = new b4a.example.bitmapcreator._argbcolor();
RDebugUtils.currentLine=30670859;
 //BA.debugLineNum = 30670859;BA.debugLine="BC.ColorToARGB(j, col )";
_bc._colortoargb(_j,_col);
RDebugUtils.currentLine=30670860;
 //BA.debugLineNum = 30670860;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=30670861;
 //BA.debugLineNum = 30670861;BA.debugLine="If lum> 255 Then lum = 255";
if (_lum>255) { 
_lum = (int) (255);};
RDebugUtils.currentLine=30670863;
 //BA.debugLineNum = 30670863;BA.debugLine="pixels(y*W + x) = lum";
_pixels[(int) (_y*_w+_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=30670866;
 //BA.debugLineNum = 30670866;BA.debugLine="Dim ret As AnImage";
_ret = new SHARK2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=30670867;
 //BA.debugLineNum = 30670867;BA.debugLine="ret.Width = bmp.Width";
_ret.Width /*int*/  = _bmp.getWidth();
RDebugUtils.currentLine=30670868;
 //BA.debugLineNum = 30670868;BA.debugLine="ret.Height = bmp.Height";
_ret.Height /*int*/  = _bmp.getHeight();
RDebugUtils.currentLine=30670869;
 //BA.debugLineNum = 30670869;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=30670870;
 //BA.debugLineNum = 30670870;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=30670871;
 //BA.debugLineNum = 30670871;BA.debugLine="End Sub";
return null;
}
public SHARK2.keymon.com.mx.escposprinter._animage  _ditherimage2d(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage2d", false))
	 {return ((SHARK2.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;
SHARK2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=30867456;
 //BA.debugLineNum = 30867456;BA.debugLine="Sub DitherImage2D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=30867457;
 //BA.debugLineNum = 30867457;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=30867458;
 //BA.debugLineNum = 30867458;BA.debugLine="Dim xerror As Int";
_xerror = 0;
RDebugUtils.currentLine=30867459;
 //BA.debugLineNum = 30867459;BA.debugLine="Dim yerrors(img.Width) As Int";
_yerrors = new int[_img.Width /*int*/ ];
;
RDebugUtils.currentLine=30867460;
 //BA.debugLineNum = 30867460;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=30867461;
 //BA.debugLineNum = 30867461;BA.debugLine="yerrors(0) = 0";
_yerrors[(int) (0)] = (int) (0);
 }
};
RDebugUtils.currentLine=30867463;
 //BA.debugLineNum = 30867463;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=30867464;
 //BA.debugLineNum = 30867464;BA.debugLine="xerror = 0 ' reset on each new line";
_xerror = (int) (0);
RDebugUtils.currentLine=30867465;
 //BA.debugLineNum = 30867465;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=30867466;
 //BA.debugLineNum = 30867466;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=30867467;
 //BA.debugLineNum = 30867467;BA.debugLine="lum = lum + xerror + yerrors(x)";
_lum = (int) (_lum+_xerror+_yerrors[_x]);
RDebugUtils.currentLine=30867468;
 //BA.debugLineNum = 30867468;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=30867469;
 //BA.debugLineNum = 30867469;BA.debugLine="xerror = lum/2";
_xerror = (int) (_lum/(double)2);
RDebugUtils.currentLine=30867470;
 //BA.debugLineNum = 30867470;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=30867471;
 //BA.debugLineNum = 30867471;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=30867473;
 //BA.debugLineNum = 30867473;BA.debugLine="xerror = (lum - 255)/2";
_xerror = (int) ((_lum-255)/(double)2);
RDebugUtils.currentLine=30867474;
 //BA.debugLineNum = 30867474;BA.debugLine="yerrors(x) = xerror";
_yerrors[_x] = _xerror;
RDebugUtils.currentLine=30867475;
 //BA.debugLineNum = 30867475;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=30867477;
 //BA.debugLineNum = 30867477;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=30867480;
 //BA.debugLineNum = 30867480;BA.debugLine="Dim ret As AnImage";
_ret = new SHARK2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=30867481;
 //BA.debugLineNum = 30867481;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=30867482;
 //BA.debugLineNum = 30867482;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=30867483;
 //BA.debugLineNum = 30867483;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=30867484;
 //BA.debugLineNum = 30867484;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=30867485;
 //BA.debugLineNum = 30867485;BA.debugLine="End Sub";
return null;
}
public SHARK2.keymon.com.mx.escposprinter._animage  _packimage(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.keymon.com.mx.escposprinter._animage _imagedata) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "packimage", false))
	 {return ((SHARK2.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;
SHARK2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=30998528;
 //BA.debugLineNum = 30998528;BA.debugLine="Public Sub PackImage(imagedata As AnImage) As AnIm";
RDebugUtils.currentLine=30998529;
 //BA.debugLineNum = 30998529;BA.debugLine="Dim xbytes As Int = imagedata.width/8";
_xbytes = (int) (_imagedata.Width /*int*/ /(double)8);
RDebugUtils.currentLine=30998530;
 //BA.debugLineNum = 30998530;BA.debugLine="Dim pixels(xbytes * imagedata.height) As Byte";
_pixels = new byte[(int) (_xbytes*_imagedata.Height /*int*/ )];
;
RDebugUtils.currentLine=30998531;
 //BA.debugLineNum = 30998531;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=30998532;
 //BA.debugLineNum = 30998532;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=30998533;
 //BA.debugLineNum = 30998533;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=30998534;
 //BA.debugLineNum = 30998534;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=30998535;
 //BA.debugLineNum = 30998535;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=30998536;
 //BA.debugLineNum = 30998536;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=30998537;
 //BA.debugLineNum = 30998537;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=30998538;
 //BA.debugLineNum = 30998538;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=30998539;
 //BA.debugLineNum = 30998539;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=30998540;
 //BA.debugLineNum = 30998540;BA.debugLine="Dim index As Int = 0";
_index = (int) (0);
RDebugUtils.currentLine=30998541;
 //BA.debugLineNum = 30998541;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=30998542;
 //BA.debugLineNum = 30998542;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=30998543;
 //BA.debugLineNum = 30998543;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=30998544;
 //BA.debugLineNum = 30998544;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=30998546;
 //BA.debugLineNum = 30998546;BA.debugLine="Dim pix As Byte = imagedata.Data(index)";
_pix = _imagedata.Data /*byte[]*/ [_index];
RDebugUtils.currentLine=30998547;
 //BA.debugLineNum = 30998547;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=30998548;
 //BA.debugLineNum = 30998548;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
RDebugUtils.currentLine=30998550;
 //BA.debugLineNum = 30998550;BA.debugLine="index = index + 1";
_index = (int) (_index+1);
 }
};
RDebugUtils.currentLine=30998552;
 //BA.debugLineNum = 30998552;BA.debugLine="pixels(y*xbytes + x) = xbyte";
_pixels[(int) (_y*_xbytes+_x)] = _xbyte;
 }
};
 }
};
RDebugUtils.currentLine=30998555;
 //BA.debugLineNum = 30998555;BA.debugLine="Dim ret As AnImage";
_ret = new SHARK2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=30998556;
 //BA.debugLineNum = 30998556;BA.debugLine="ret.Width = xbytes";
_ret.Width /*int*/  = _xbytes;
RDebugUtils.currentLine=30998557;
 //BA.debugLineNum = 30998557;BA.debugLine="ret.Height = imagedata.Height";
_ret.Height /*int*/  = _imagedata.Height /*int*/ ;
RDebugUtils.currentLine=30998558;
 //BA.debugLineNum = 30998558;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=30998559;
 //BA.debugLineNum = 30998559;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=30998560;
 //BA.debugLineNum = 30998560;BA.debugLine="End Sub";
return null;
}
public int  _printimage(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.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=30932992;
 //BA.debugLineNum = 30932992;BA.debugLine="Public Sub PrintImage(img As AnImage) As Int";
RDebugUtils.currentLine=30932995;
 //BA.debugLineNum = 30932995;BA.debugLine="If img.width > 72 Then Return -1";
if (_img.Width /*int*/ >72) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=30932996;
 //BA.debugLineNum = 30932996;BA.debugLine="If img.height > 512 Then Return -2";
if (_img.Height /*int*/ >512) { 
if (true) return (int) (-2);};
RDebugUtils.currentLine=30932997;
 //BA.debugLineNum = 30932997;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=30932998;
 //BA.debugLineNum = 30932998;BA.debugLine="Dim xh As Int = img.width / 256";
_xh = (int) (_img.Width /*int*/ /(double)256);
RDebugUtils.currentLine=30932999;
 //BA.debugLineNum = 30932999;BA.debugLine="Dim xl As Int = img.width - xh * 256";
_xl = (int) (_img.Width /*int*/ -_xh*256);
RDebugUtils.currentLine=30933000;
 //BA.debugLineNum = 30933000;BA.debugLine="Dim yh As Int = img.height / 256";
_yh = (int) (_img.Height /*int*/ /(double)256);
RDebugUtils.currentLine=30933001;
 //BA.debugLineNum = 30933001;BA.debugLine="Dim yl As Int = img.height - yh * 256";
_yl = (int) (_img.Height /*int*/ -_yh*256);
RDebugUtils.currentLine=30933002;
 //BA.debugLineNum = 30933002;BA.debugLine="Dim params(5) As Byte";
_params = new byte[(int) (5)];
;
RDebugUtils.currentLine=30933003;
 //BA.debugLineNum = 30933003;BA.debugLine="params(0) = 0 '";
_params[(int) (0)] = (byte) (0);
RDebugUtils.currentLine=30933004;
 //BA.debugLineNum = 30933004;BA.debugLine="params(1) = xl";
_params[(int) (1)] = (byte) (_xl);
RDebugUtils.currentLine=30933005;
 //BA.debugLineNum = 30933005;BA.debugLine="params(2) = xh";
_params[(int) (2)] = (byte) (_xh);
RDebugUtils.currentLine=30933006;
 //BA.debugLineNum = 30933006;BA.debugLine="params(3) = yl";
_params[(int) (3)] = (byte) (_yl);
RDebugUtils.currentLine=30933007;
 //BA.debugLineNum = 30933007;BA.debugLine="params(4) = yh";
_params[(int) (4)] = (byte) (_yh);
RDebugUtils.currentLine=30933008;
 //BA.debugLineNum = 30933008;BA.debugLine="WriteString(GS & \"v0\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"v0");
RDebugUtils.currentLine=30933009;
 //BA.debugLineNum = 30933009;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=30933010;
 //BA.debugLineNum = 30933010;BA.debugLine="WriteBytes(img.data)";
__ref._writebytes /*String*/ (null,_img.Data /*byte[]*/ );
RDebugUtils.currentLine=30933011;
 //BA.debugLineNum = 30933011;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=30933012;
 //BA.debugLineNum = 30933012;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=30933013;
 //BA.debugLineNum = 30933013;BA.debugLine="End Sub";
return 0;
}
public String  _astream_error(SHARK2.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=31784960;
 //BA.debugLineNum = 31784960;BA.debugLine="Private Sub AStream_Error";
RDebugUtils.currentLine=31784961;
 //BA.debugLineNum = 31784961;BA.debugLine="If SubExists(CallBack, EventName & \"_Error\") Then";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error")) { 
RDebugUtils.currentLine=31784962;
 //BA.debugLineNum = 31784962;BA.debugLine="CallSub(CallBack, EventName & \"_Error\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Error");
 };
RDebugUtils.currentLine=31784964;
 //BA.debugLineNum = 31784964;BA.debugLine="End Sub";
return "";
}
public String  _astream_newdata(SHARK2.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=31719424;
 //BA.debugLineNum = 31719424;BA.debugLine="Private Sub AStream_NewData (Buffer() As Byte)";
RDebugUtils.currentLine=31719425;
 //BA.debugLineNum = 31719425;BA.debugLine="If SubExists(CallBack, EventName & \"_NewData\") Th";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData")) { 
RDebugUtils.currentLine=31719426;
 //BA.debugLineNum = 31719426;BA.debugLine="CallSub2(CallBack, EventName & \"_NewData\", Buffe";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_NewData",(Object)(_buffer));
 };
RDebugUtils.currentLine=31719428;
 //BA.debugLineNum = 31719428;BA.debugLine="Log(\"Data \" & Buffer(0))";
__c.LogImpl("531719428","Data "+BA.NumberToString(_buffer[(int) (0)]),0);
RDebugUtils.currentLine=31719429;
 //BA.debugLineNum = 31719429;BA.debugLine="End Sub";
return "";
}
public String  _astream_terminated(SHARK2.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=31850496;
 //BA.debugLineNum = 31850496;BA.debugLine="Private Sub AStream_Terminated";
RDebugUtils.currentLine=31850497;
 //BA.debugLineNum = 31850497;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=31850498;
 //BA.debugLineNum = 31850498;BA.debugLine="If SubExists(CallBack, EventName & \"_Terminated\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated")) { 
RDebugUtils.currentLine=31850499;
 //BA.debugLineNum = 31850499;BA.debugLine="CallSub(CallBack, EventName & \"_Terminated\")";
__c.CallSubNew(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Terminated");
 };
RDebugUtils.currentLine=31850501;
 //BA.debugLineNum = 31850501;BA.debugLine="End Sub";
return "";
}
public String  _class_globals(SHARK2.keymon.com.mx.escposprinter __ref) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
RDebugUtils.currentLine=28246016;
 //BA.debugLineNum = 28246016;BA.debugLine="Sub Class_Globals";
RDebugUtils.currentLine=28246023;
 //BA.debugLineNum = 28246023;BA.debugLine="Private Version As Double = 2.0 ' Printer class v";
_version = 2.0;
RDebugUtils.currentLine=28246025;
 //BA.debugLineNum = 28246025;BA.debugLine="Type AnImage(Width As Int, Height As Int, Data()";
;
RDebugUtils.currentLine=28246027;
 //BA.debugLineNum = 28246027;BA.debugLine="Private EventName As String 'ignore";
_eventname = "";
RDebugUtils.currentLine=28246028;
 //BA.debugLineNum = 28246028;BA.debugLine="Private CallBack As Object 'ignore";
_callback = new Object();
RDebugUtils.currentLine=28246030;
 //BA.debugLineNum = 28246030;BA.debugLine="Private Serial1 As Serial";
_serial1 = new anywheresoftware.b4a.objects.Serial();
RDebugUtils.currentLine=28246031;
 //BA.debugLineNum = 28246031;BA.debugLine="Private Astream As AsyncStreams";
_astream = new anywheresoftware.b4a.randomaccessfile.AsyncStreams();
RDebugUtils.currentLine=28246032;
 //BA.debugLineNum = 28246032;BA.debugLine="Private Connected As Boolean";
_connected = false;
RDebugUtils.currentLine=28246033;
 //BA.debugLineNum = 28246033;BA.debugLine="Private ConnectedError As String";
_connectederror = "";
RDebugUtils.currentLine=28246035;
 //BA.debugLineNum = 28246035;BA.debugLine="Dim ESC As String = Chr(27)";
_esc = BA.ObjectToString(__c.Chr((int) (27)));
RDebugUtils.currentLine=28246036;
 //BA.debugLineNum = 28246036;BA.debugLine="Dim FS As String = Chr(28)";
_fs = BA.ObjectToString(__c.Chr((int) (28)));
RDebugUtils.currentLine=28246037;
 //BA.debugLineNum = 28246037;BA.debugLine="Dim GS As String = Chr(29)";
_gs = BA.ObjectToString(__c.Chr((int) (29)));
RDebugUtils.currentLine=28246040;
 //BA.debugLineNum = 28246040;BA.debugLine="Dim UNREVERSE As String  = GS & \"B\" & Chr(0)";
_unreverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=28246041;
 //BA.debugLineNum = 28246041;BA.debugLine="Dim REVERSE As String = GS & \"B\" & Chr(1)";
_reverse = __ref._gs /*String*/ +"B"+BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=28246044;
 //BA.debugLineNum = 28246044;BA.debugLine="Dim UNINVERT As String = ESC & \"{0\"";
_uninvert = __ref._esc /*String*/ +"{0";
RDebugUtils.currentLine=28246045;
 //BA.debugLineNum = 28246045;BA.debugLine="Dim INVERT As String = ESC & \"{1\"";
_invert = __ref._esc /*String*/ +"{1";
RDebugUtils.currentLine=28246048;
 //BA.debugLineNum = 28246048;BA.debugLine="Dim UNROTATE As String = ESC & \"V0\"";
_unrotate = __ref._esc /*String*/ +"V0";
RDebugUtils.currentLine=28246049;
 //BA.debugLineNum = 28246049;BA.debugLine="Dim ROTATE As String = ESC & \"V1\"";
_rotate = __ref._esc /*String*/ +"V1";
RDebugUtils.currentLine=28246052;
 //BA.debugLineNum = 28246052;BA.debugLine="Dim HT As String = Chr(9)";
_ht = BA.ObjectToString(__c.Chr((int) (9)));
RDebugUtils.currentLine=28246055;
 //BA.debugLineNum = 28246055;BA.debugLine="Dim ULINE0 As String = ESC & \"-0\"";
_uline0 = __ref._esc /*String*/ +"-0";
RDebugUtils.currentLine=28246056;
 //BA.debugLineNum = 28246056;BA.debugLine="Dim ULINE1 As String = ESC & \"-1\"";
_uline1 = __ref._esc /*String*/ +"-1";
RDebugUtils.currentLine=28246057;
 //BA.debugLineNum = 28246057;BA.debugLine="Dim ULINE2 As String = ESC & \"-2\"";
_uline2 = __ref._esc /*String*/ +"-2";
RDebugUtils.currentLine=28246060;
 //BA.debugLineNum = 28246060;BA.debugLine="Dim BOLD As String = ESC & \"E1\"";
_bold = __ref._esc /*String*/ +"E1";
RDebugUtils.currentLine=28246061;
 //BA.debugLineNum = 28246061;BA.debugLine="Dim NOBOLD As String = ESC & \"E0\"";
_nobold = __ref._esc /*String*/ +"E0";
RDebugUtils.currentLine=28246064;
 //BA.debugLineNum = 28246064;BA.debugLine="Dim SINGLE As String = GS & \"!\" & Chr(0x00)";
_single = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x00)));
RDebugUtils.currentLine=28246065;
 //BA.debugLineNum = 28246065;BA.debugLine="Dim HIGH As String = GS & \"!\" & Chr(0x01)";
_high = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x01)));
RDebugUtils.currentLine=28246066;
 //BA.debugLineNum = 28246066;BA.debugLine="Dim WIDE As String = GS & \"!\" & Chr(0x10)";
_wide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x10)));
RDebugUtils.currentLine=28246067;
 //BA.debugLineNum = 28246067;BA.debugLine="Dim HIGHWIDE As String = GS & \"!\" & Chr(0x11)";
_highwide = __ref._gs /*String*/ +"!"+BA.ObjectToString(__c.Chr(((int)0x11)));
RDebugUtils.currentLine=28246070;
 //BA.debugLineNum = 28246070;BA.debugLine="Private LEFTJUSTIFY As String = ESC & \"a0\"";
_leftjustify = __ref._esc /*String*/ +"a0";
RDebugUtils.currentLine=28246071;
 //BA.debugLineNum = 28246071;BA.debugLine="Private LINEDEFAULT As String = ESC & \"2\"";
_linedefault = __ref._esc /*String*/ +"2";
RDebugUtils.currentLine=28246072;
 //BA.debugLineNum = 28246072;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=28246073;
 //BA.debugLineNum = 28246073;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=28246074;
 //BA.debugLineNum = 28246074;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=28246075;
 //BA.debugLineNum = 28246075;BA.debugLine="Private CHARSPACING0 As String = ESC & \" \" & Chr(";
_charspacing0 = __ref._esc /*String*/ +" "+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=28246076;
 //BA.debugLineNum = 28246076;BA.debugLine="Private CHARFONT0 As String = ESC & \"M\" & Chr(0)";
_charfont0 = __ref._esc /*String*/ +"M"+BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=28246077;
 //BA.debugLineNum = 28246077;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=28246080;
 //BA.debugLineNum = 28246080;BA.debugLine="End Sub";
return "";
}
public String  _connectederrormsg(SHARK2.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=28377088;
 //BA.debugLineNum = 28377088;BA.debugLine="Public Sub ConnectedErrorMsg As String";
RDebugUtils.currentLine=28377089;
 //BA.debugLineNum = 28377089;BA.debugLine="Return ConnectedError";
if (true) return __ref._connectederror /*String*/ ;
RDebugUtils.currentLine=28377090;
 //BA.debugLineNum = 28377090;BA.debugLine="End Sub";
return "";
}
public int  _createbox(SHARK2.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=30146560;
 //BA.debugLineNum = 30146560;BA.debugLine="Public Sub CreateBox(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=30146561;
 //BA.debugLineNum = 30146561;BA.debugLine="Dim box As Int = 0x10000000";
_box = ((int)0x10000000);
RDebugUtils.currentLine=30146562;
 //BA.debugLineNum = 30146562;BA.debugLine="If fill Then box = box + 0x80000000";
if (_fill) { 
_box = (int) (_box+((int)0x80000000));};
RDebugUtils.currentLine=30146563;
 //BA.debugLineNum = 30146563;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=30146564;
 //BA.debugLineNum = 30146564;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=30146565;
 //BA.debugLineNum = 30146565;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=30146566;
 //BA.debugLineNum = 30146566;BA.debugLine="box = box + Bit.And(0x1f,y1)";
_box = (int) (_box+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=30146567;
 //BA.debugLineNum = 30146567;BA.debugLine="Return box";
if (true) return _box;
RDebugUtils.currentLine=30146568;
 //BA.debugLineNum = 30146568;BA.debugLine="End Sub";
return 0;
}
public int  _createcircle(SHARK2.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=30015488;
 //BA.debugLineNum = 30015488;BA.debugLine="Public Sub CreateCircle(radius As Int, quadrants A";
RDebugUtils.currentLine=30015489;
 //BA.debugLineNum = 30015489;BA.debugLine="Dim circle As Int = 0x20000000";
_circle = ((int)0x20000000);
RDebugUtils.currentLine=30015490;
 //BA.debugLineNum = 30015490;BA.debugLine="If fill Then circle = circle + 0x80000000";
if (_fill) { 
_circle = (int) (_circle+((int)0x80000000));};
RDebugUtils.currentLine=30015491;
 //BA.debugLineNum = 30015491;BA.debugLine="circle = circle + Bit.ShiftLeft(radius, 24)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_radius,(int) (24)));
RDebugUtils.currentLine=30015492;
 //BA.debugLineNum = 30015492;BA.debugLine="circle = circle + Bit.ShiftLeft(quadrants, 16)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_quadrants,(int) (16)));
RDebugUtils.currentLine=30015493;
 //BA.debugLineNum = 30015493;BA.debugLine="circle = circle + Bit.ShiftLeft(x1, 8)";
_circle = (int) (_circle+__c.Bit.ShiftLeft(_x1,(int) (8)));
RDebugUtils.currentLine=30015494;
 //BA.debugLineNum = 30015494;BA.debugLine="circle = circle + y1";
_circle = (int) (_circle+_y1);
RDebugUtils.currentLine=30015495;
 //BA.debugLineNum = 30015495;BA.debugLine="Return circle";
if (true) return _circle;
RDebugUtils.currentLine=30015496;
 //BA.debugLineNum = 30015496;BA.debugLine="End Sub";
return 0;
}
public byte[]  _createcustomcharacter(SHARK2.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=29884416;
 //BA.debugLineNum = 29884416;BA.debugLine="Public Sub CreateCustomCharacter(shapes() As Int,";
RDebugUtils.currentLine=29884417;
 //BA.debugLineNum = 29884417;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=29884418;
 //BA.debugLineNum = 29884418;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=29884419;
 //BA.debugLineNum = 29884419;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=29884420;
 //BA.debugLineNum = 29884420;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=29884421;
 //BA.debugLineNum = 29884421;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=29884422;
 //BA.debugLineNum = 29884422;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=29884423;
 //BA.debugLineNum = 29884423;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=29884424;
 //BA.debugLineNum = 29884424;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=29884425;
 //BA.debugLineNum = 29884425;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=29884428;
 //BA.debugLineNum = 29884428;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=29884430;
 //BA.debugLineNum = 29884430;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=29884431;
 //BA.debugLineNum = 29884431;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=29884432;
 //BA.debugLineNum = 29884432;BA.debugLine="points(x,y) = 0";
_points[_x][_y] = (byte) (0);
 }
};
 }
};
RDebugUtils.currentLine=29884435;
 //BA.debugLineNum = 29884435;BA.debugLine="Dim size As Int = 12";
_size = (int) (12);
RDebugUtils.currentLine=29884436;
 //BA.debugLineNum = 29884436;BA.debugLine="If characterfont = 1 Then size = 9";
if (_characterfont==1) { 
_size = (int) (9);};
RDebugUtils.currentLine=29884437;
 //BA.debugLineNum = 29884437;BA.debugLine="Dim charbyes(size * 3) As Byte";
_charbyes = new byte[(int) (_size*3)];
;
RDebugUtils.currentLine=29884438;
 //BA.debugLineNum = 29884438;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=29884439;
 //BA.debugLineNum = 29884439;BA.debugLine="charbyes(c) = 0";
_charbyes[_c] = (byte) (0);
 }
};
RDebugUtils.currentLine=29884442;
 //BA.debugLineNum = 29884442;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=29884443;
 //BA.debugLineNum = 29884443;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=29884444;
 //BA.debugLineNum = 29884444;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=29884445;
 //BA.debugLineNum = 29884445;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=29884446;
 //BA.debugLineNum = 29884446;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=29884447;
 //BA.debugLineNum = 29884447;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=29884448;
 //BA.debugLineNum = 29884448;BA.debugLine="Dim y1 As Int = Bit.And(0x0000001f, shapes(i))";
_y1 = __c.Bit.And(((int)0x0000001f),_shapes[_i]);
RDebugUtils.currentLine=29884449;
 //BA.debugLineNum = 29884449;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=29884450;
 //BA.debugLineNum = 29884450;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=29884456;
 //BA.debugLineNum = 29884456;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=29884457;
 //BA.debugLineNum = 29884457;BA.debugLine="If shape = 3 Then";
if (_shape==3) { 
RDebugUtils.currentLine=29884458;
 //BA.debugLineNum = 29884458;BA.debugLine="Log(\"Triangle \" & logmsg)";
__c.LogImpl("529884458","Triangle "+_logmsg,0);
RDebugUtils.currentLine=29884459;
 //BA.debugLineNum = 29884459;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=29884460;
 //BA.debugLineNum = 29884460;BA.debugLine="else If shape = 2 Then";
if (_shape==2) { 
RDebugUtils.currentLine=29884461;
 //BA.debugLineNum = 29884461;BA.debugLine="Log(\"Circle \" & logmsg)";
__c.LogImpl("529884461","Circle "+_logmsg,0);
RDebugUtils.currentLine=29884462;
 //BA.debugLineNum = 29884462;BA.debugLine="PlotCircle(x0, y0, x1, y1, points, fill)";
__ref._plotcircle /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else 
{RDebugUtils.currentLine=29884463;
 //BA.debugLineNum = 29884463;BA.debugLine="Else If shape = 1 Then";
if (_shape==1) { 
RDebugUtils.currentLine=29884464;
 //BA.debugLineNum = 29884464;BA.debugLine="Log(\"Box \" & logmsg)";
__c.LogImpl("529884464","Box "+_logmsg,0);
RDebugUtils.currentLine=29884465;
 //BA.debugLineNum = 29884465;BA.debugLine="PlotBox(x0, y0, x1, y1, points, fill)";
__ref._plotbox /*String*/ (null,_x0,_y0,_x1,_y1,_points,_fill);
 }else {
RDebugUtils.currentLine=29884467;
 //BA.debugLineNum = 29884467;BA.debugLine="Log(\"Line \" & logmsg)";
__c.LogImpl("529884467","Line "+_logmsg,0);
RDebugUtils.currentLine=29884468;
 //BA.debugLineNum = 29884468;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 }}}
;
RDebugUtils.currentLine=29884471;
 //BA.debugLineNum = 29884471;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=29884472;
 //BA.debugLineNum = 29884472;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=29884473;
 //BA.debugLineNum = 29884473;BA.debugLine="Dim bits As Byte = 0";
_bits = (byte) (0);
RDebugUtils.currentLine=29884474;
 //BA.debugLineNum = 29884474;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=29884475;
 //BA.debugLineNum = 29884475;BA.debugLine="If points(x, y*8+b) <> 0 Then";
if (_points[_x][(int) (_y*8+_b)]!=0) { 
RDebugUtils.currentLine=29884476;
 //BA.debugLineNum = 29884476;BA.debugLine="bits = Bit.Or(bits, masks(b))";
_bits = (byte) (__c.Bit.Or((int) (_bits),(int) (_masks[_b])));
 };
 }
};
RDebugUtils.currentLine=29884479;
 //BA.debugLineNum = 29884479;BA.debugLine="charbyes(x*3+y) = bits";
_charbyes[(int) (_x*3+_y)] = _bits;
 }
};
 }
};
 }
};
RDebugUtils.currentLine=29884483;
 //BA.debugLineNum = 29884483;BA.debugLine="Return charbyes";
if (true) return _charbyes;
RDebugUtils.currentLine=29884484;
 //BA.debugLineNum = 29884484;BA.debugLine="End Sub";
return null;
}
public String  _plottriangle(SHARK2.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=30212096;
 //BA.debugLineNum = 30212096;BA.debugLine="Private Sub PlotTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=30212098;
 //BA.debugLineNum = 30212098;BA.debugLine="PlotLine(x0, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=30212099;
 //BA.debugLineNum = 30212099;BA.debugLine="PlotLine(x1, y1, x2, y2, points)";
__ref._plotline /*String*/ (null,_x1,_y1,_x2,_y2,_points);
RDebugUtils.currentLine=30212100;
 //BA.debugLineNum = 30212100;BA.debugLine="PlotLine(x2, y2, x0, y0, points)";
__ref._plotline /*String*/ (null,_x2,_y2,_x0,_y0,_points);
RDebugUtils.currentLine=30212101;
 //BA.debugLineNum = 30212101;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=30212102;
 //BA.debugLineNum = 30212102;BA.debugLine="FillTriangle(x0, y0, x1, y1, x2, y2, points)";
__ref._filltriangle /*String*/ (null,_x0,_y0,_x1,_y1,_x2,_y2,_points);
 };
RDebugUtils.currentLine=30212104;
 //BA.debugLineNum = 30212104;BA.debugLine="End Sub";
return "";
}
public String  _plotcircle(SHARK2.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=30408704;
 //BA.debugLineNum = 30408704;BA.debugLine="Private Sub PlotCircle(radius As Int, quadrants As";
RDebugUtils.currentLine=30408706;
 //BA.debugLineNum = 30408706;BA.debugLine="Dim mask As Int = 1";
_mask = (int) (1);
RDebugUtils.currentLine=30408707;
 //BA.debugLineNum = 30408707;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=30408708;
 //BA.debugLineNum = 30408708;BA.debugLine="If Bit.And(quadrants, mask) <> 0 Then";
if (__c.Bit.And(_quadrants,_mask)!=0) { 
RDebugUtils.currentLine=30408709;
 //BA.debugLineNum = 30408709;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=30408710;
 //BA.debugLineNum = 30408710;BA.debugLine="Dim x,y As Double";
_x = 0;
_y = 0;
RDebugUtils.currentLine=30408711;
 //BA.debugLineNum = 30408711;BA.debugLine="x = x1 - SinD(i)*radius";
_x = _x1-__c.SinD(_i)*_radius;
RDebugUtils.currentLine=30408712;
 //BA.debugLineNum = 30408712;BA.debugLine="y = y1 - CosD(i)*radius";
_y = _y1-__c.CosD(_i)*_radius;
RDebugUtils.currentLine=30408713;
 //BA.debugLineNum = 30408713;BA.debugLine="If fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=30408714;
 //BA.debugLineNum = 30408714;BA.debugLine="PlotLine(x1, y1, x, y, points)";
__ref._plotline /*String*/ (null,_x1,_y1,(int) (_x),(int) (_y),_points);
 }else {
RDebugUtils.currentLine=30408716;
 //BA.debugLineNum = 30408716;BA.debugLine="points(Round(x), Round(y)) = 1";
_points[(int) (__c.Round(_x))][(int) (__c.Round(_y))] = (byte) (1);
 };
 }
};
 };
RDebugUtils.currentLine=30408720;
 //BA.debugLineNum = 30408720;BA.debugLine="mask = Bit.ShiftLeft(mask, 1)";
_mask = __c.Bit.ShiftLeft(_mask,(int) (1));
 }
};
RDebugUtils.currentLine=30408722;
 //BA.debugLineNum = 30408722;BA.debugLine="End Sub";
return "";
}
public String  _plotbox(SHARK2.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=30343168;
 //BA.debugLineNum = 30343168;BA.debugLine="Private Sub PlotBox(x0 As Int, y0 As Int, x1 As In";
RDebugUtils.currentLine=30343170;
 //BA.debugLineNum = 30343170;BA.debugLine="PlotLine(x0, y0, x0, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x0,_y1,_points);
RDebugUtils.currentLine=30343171;
 //BA.debugLineNum = 30343171;BA.debugLine="PlotLine(x0, y0, x1, y0, points)";
__ref._plotline /*String*/ (null,_x0,_y0,_x1,_y0,_points);
RDebugUtils.currentLine=30343172;
 //BA.debugLineNum = 30343172;BA.debugLine="PlotLine(x1, y0, x1, y1, points)";
__ref._plotline /*String*/ (null,_x1,_y0,_x1,_y1,_points);
RDebugUtils.currentLine=30343173;
 //BA.debugLineNum = 30343173;BA.debugLine="PlotLine(x0, y1, x1, y1, points)";
__ref._plotline /*String*/ (null,_x0,_y1,_x1,_y1,_points);
RDebugUtils.currentLine=30343174;
 //BA.debugLineNum = 30343174;BA.debugLine="If Fill > 0 Then";
if (_fill>0) { 
RDebugUtils.currentLine=30343175;
 //BA.debugLineNum = 30343175;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=30343176;
 //BA.debugLineNum = 30343176;BA.debugLine="PlotLine(x, y0, x, y1, points)";
__ref._plotline /*String*/ (null,_x,_y0,_x,_y1,_points);
 }
};
 };
RDebugUtils.currentLine=30343179;
 //BA.debugLineNum = 30343179;BA.debugLine="End Sub";
return "";
}
public String  _plotline(SHARK2.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=30474240;
 //BA.debugLineNum = 30474240;BA.debugLine="Private Sub PlotLine(x0 As Int, y0 As Int, x1 As I";
RDebugUtils.currentLine=30474241;
 //BA.debugLineNum = 30474241;BA.debugLine="If Abs(y1 - y0) < Abs(x1 - x0) Then";
if (__c.Abs(_y1-_y0)<__c.Abs(_x1-_x0)) { 
RDebugUtils.currentLine=30474242;
 //BA.debugLineNum = 30474242;BA.debugLine="If x0 > x1 Then";
if (_x0>_x1) { 
RDebugUtils.currentLine=30474243;
 //BA.debugLineNum = 30474243;BA.debugLine="PlotLineLow(x1, y1, x0, y0, points)";
__ref._plotlinelow /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=30474245;
 //BA.debugLineNum = 30474245;BA.debugLine="PlotLineLow(x0, y0, x1, y1, points)";
__ref._plotlinelow /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 }else {
RDebugUtils.currentLine=30474248;
 //BA.debugLineNum = 30474248;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=30474249;
 //BA.debugLineNum = 30474249;BA.debugLine="PlotLineHigh(x1, y1, x0, y0, points)";
__ref._plotlinehigh /*String*/ (null,_x1,_y1,_x0,_y0,_points);
 }else {
RDebugUtils.currentLine=30474251;
 //BA.debugLineNum = 30474251;BA.debugLine="PlotLineHigh(x0, y0, x1, y1, points)";
__ref._plotlinehigh /*String*/ (null,_x0,_y0,_x1,_y1,_points);
 };
 };
RDebugUtils.currentLine=30474254;
 //BA.debugLineNum = 30474254;BA.debugLine="End Sub";
return "";
}
public int  _createline(SHARK2.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=29949952;
 //BA.debugLineNum = 29949952;BA.debugLine="Public Sub CreateLine(x0 As Int, y0 As Int, x1 As";
RDebugUtils.currentLine=29949953;
 //BA.debugLineNum = 29949953;BA.debugLine="Dim line As Int = 0";
_line = (int) (0);
RDebugUtils.currentLine=29949954;
 //BA.debugLineNum = 29949954;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=29949955;
 //BA.debugLineNum = 29949955;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=29949956;
 //BA.debugLineNum = 29949956;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=29949957;
 //BA.debugLineNum = 29949957;BA.debugLine="line = line + Bit.And(0x1f,y1)";
_line = (int) (_line+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=29949958;
 //BA.debugLineNum = 29949958;BA.debugLine="Return line";
if (true) return _line;
RDebugUtils.currentLine=29949959;
 //BA.debugLineNum = 29949959;BA.debugLine="End Sub";
return 0;
}
public int  _createtriangle(SHARK2.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=30081024;
 //BA.debugLineNum = 30081024;BA.debugLine="Public Sub CreateTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=30081025;
 //BA.debugLineNum = 30081025;BA.debugLine="Dim triangle As Int = 0x30000000";
_triangle = ((int)0x30000000);
RDebugUtils.currentLine=30081026;
 //BA.debugLineNum = 30081026;BA.debugLine="If fill Then triangle = triangle + 0x80000000";
if (_fill) { 
_triangle = (int) (_triangle+((int)0x80000000));};
RDebugUtils.currentLine=30081027;
 //BA.debugLineNum = 30081027;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=30081028;
 //BA.debugLineNum = 30081028;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=30081029;
 //BA.debugLineNum = 30081029;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=30081030;
 //BA.debugLineNum = 30081030;BA.debugLine="triangle = triangle + Bit.And(0x1f,y1)";
_triangle = (int) (_triangle+__c.Bit.And(((int)0x1f),_y1));
RDebugUtils.currentLine=30081031;
 //BA.debugLineNum = 30081031;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=30081032;
 //BA.debugLineNum = 30081032;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=30081033;
 //BA.debugLineNum = 30081033;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=30081034;
 //BA.debugLineNum = 30081034;BA.debugLine="Return triangle";
if (true) return _triangle;
RDebugUtils.currentLine=30081035;
 //BA.debugLineNum = 30081035;BA.debugLine="End Sub";
return 0;
}
public int  _definecustomcharacter(SHARK2.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=29818880;
 //BA.debugLineNum = 29818880;BA.debugLine="Public Sub DefineCustomCharacter(charcode As Int,";
RDebugUtils.currentLine=29818881;
 //BA.debugLineNum = 29818881;BA.debugLine="Dim excess As Int = bitdata.Length Mod 3";
_excess = (int) (_bitdata.length%3);
RDebugUtils.currentLine=29818882;
 //BA.debugLineNum = 29818882;BA.debugLine="If excess <> 0 Then Return -1";
if (_excess!=0) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=29818883;
 //BA.debugLineNum = 29818883;BA.debugLine="Dim size As Int = bitdata.Length / 3";
_size = (int) (_bitdata.length/(double)3);
RDebugUtils.currentLine=29818884;
 //BA.debugLineNum = 29818884;BA.debugLine="WriteString(ESC & \"&\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"&");
RDebugUtils.currentLine=29818885;
 //BA.debugLineNum = 29818885;BA.debugLine="Dim params(4) As Byte";
_params = new byte[(int) (4)];
;
RDebugUtils.currentLine=29818886;
 //BA.debugLineNum = 29818886;BA.debugLine="params(0) = 3";
_params[(int) (0)] = (byte) (3);
RDebugUtils.currentLine=29818887;
 //BA.debugLineNum = 29818887;BA.debugLine="params(1) = charcode";
_params[(int) (1)] = (byte) (_charcode);
RDebugUtils.currentLine=29818888;
 //BA.debugLineNum = 29818888;BA.debugLine="params(2) = charcode";
_params[(int) (2)] = (byte) (_charcode);
RDebugUtils.currentLine=29818889;
 //BA.debugLineNum = 29818889;BA.debugLine="params(3) = size";
_params[(int) (3)] = (byte) (_size);
RDebugUtils.currentLine=29818890;
 //BA.debugLineNum = 29818890;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=29818891;
 //BA.debugLineNum = 29818891;BA.debugLine="WriteBytes(bitdata)";
__ref._writebytes /*String*/ (null,_bitdata);
RDebugUtils.currentLine=29818892;
 //BA.debugLineNum = 29818892;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=29818893;
 //BA.debugLineNum = 29818893;BA.debugLine="End Sub";
return 0;
}
public String  _writebytes(SHARK2.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=29491200;
 //BA.debugLineNum = 29491200;BA.debugLine="Public Sub WriteBytes(data() As Byte)";
RDebugUtils.currentLine=29491201;
 //BA.debugLineNum = 29491201;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=29491202;
 //BA.debugLineNum = 29491202;BA.debugLine="Astream.Write(data)";
__ref._astream /*anywheresoftware.b4a.randomaccessfile.AsyncStreams*/ .Write(_data);
 };
RDebugUtils.currentLine=29491204;
 //BA.debugLineNum = 29491204;BA.debugLine="End Sub";
return "";
}
public String  _deletecustomcharacter(SHARK2.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=29687808;
 //BA.debugLineNum = 29687808;BA.debugLine="Public Sub DeleteCustomCharacter(charcode As Int)";
RDebugUtils.currentLine=29687809;
 //BA.debugLineNum = 29687809;BA.debugLine="WriteString(ESC & \"?\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"?");
RDebugUtils.currentLine=29687810;
 //BA.debugLineNum = 29687810;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=29687811;
 //BA.debugLineNum = 29687811;BA.debugLine="params(0) = charcode";
_params[(int) (0)] = (byte) (_charcode);
RDebugUtils.currentLine=29687812;
 //BA.debugLineNum = 29687812;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=29687813;
 //BA.debugLineNum = 29687813;BA.debugLine="End Sub";
return "";
}
public SHARK2.keymon.com.mx.escposprinter._animage  _ditherimage1d(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "ditherimage1d", false))
	 {return ((SHARK2.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;
SHARK2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=30801920;
 //BA.debugLineNum = 30801920;BA.debugLine="Sub DitherImage1D(img As AnImage, threshold As Int";
RDebugUtils.currentLine=30801921;
 //BA.debugLineNum = 30801921;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=30801922;
 //BA.debugLineNum = 30801922;BA.debugLine="Dim error As Int";
_error = 0;
RDebugUtils.currentLine=30801923;
 //BA.debugLineNum = 30801923;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=30801924;
 //BA.debugLineNum = 30801924;BA.debugLine="error = 0 ' reset on each new line";
_error = (int) (0);
RDebugUtils.currentLine=30801925;
 //BA.debugLineNum = 30801925;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=30801926;
 //BA.debugLineNum = 30801926;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=30801927;
 //BA.debugLineNum = 30801927;BA.debugLine="lum = lum + error";
_lum = (int) (_lum+_error);
RDebugUtils.currentLine=30801928;
 //BA.debugLineNum = 30801928;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=30801929;
 //BA.debugLineNum = 30801929;BA.debugLine="error = lum";
_error = _lum;
RDebugUtils.currentLine=30801930;
 //BA.debugLineNum = 30801930;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=30801932;
 //BA.debugLineNum = 30801932;BA.debugLine="error = lum - 255";
_error = (int) (_lum-255);
RDebugUtils.currentLine=30801933;
 //BA.debugLineNum = 30801933;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=30801935;
 //BA.debugLineNum = 30801935;BA.debugLine="pixels(y*img.Width + x) = lum";
_pixels[(int) (_y*_img.Width /*int*/ +_x)] = (byte) (_lum);
 }
};
 }
};
RDebugUtils.currentLine=30801938;
 //BA.debugLineNum = 30801938;BA.debugLine="Dim ret As AnImage";
_ret = new SHARK2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=30801939;
 //BA.debugLineNum = 30801939;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=30801940;
 //BA.debugLineNum = 30801940;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=30801941;
 //BA.debugLineNum = 30801941;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=30801942;
 //BA.debugLineNum = 30801942;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=30801943;
 //BA.debugLineNum = 30801943;BA.debugLine="End Sub";
return null;
}
public String  _filltriangle(SHARK2.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=30277632;
 //BA.debugLineNum = 30277632;BA.debugLine="Private Sub FillTriangle(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=30277634;
 //BA.debugLineNum = 30277634;BA.debugLine="Dim tx, ty As Int";
_tx = 0;
_ty = 0;
RDebugUtils.currentLine=30277635;
 //BA.debugLineNum = 30277635;BA.debugLine="If y0 > y1 Then";
if (_y0>_y1) { 
RDebugUtils.currentLine=30277636;
 //BA.debugLineNum = 30277636;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=30277636;
 //BA.debugLineNum = 30277636;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=30277637;
 //BA.debugLineNum = 30277637;BA.debugLine="x0 = x1 : y0 = y1";
_x0 = _x1;
RDebugUtils.currentLine=30277637;
 //BA.debugLineNum = 30277637;BA.debugLine="x0 = x1 : y0 = y1";
_y0 = _y1;
RDebugUtils.currentLine=30277638;
 //BA.debugLineNum = 30277638;BA.debugLine="x1 = tx : y1 = ty";
_x1 = _tx;
RDebugUtils.currentLine=30277638;
 //BA.debugLineNum = 30277638;BA.debugLine="x1 = tx : y1 = ty";
_y1 = _ty;
 };
RDebugUtils.currentLine=30277640;
 //BA.debugLineNum = 30277640;BA.debugLine="If y0 > y2 Then";
if (_y0>_y2) { 
RDebugUtils.currentLine=30277641;
 //BA.debugLineNum = 30277641;BA.debugLine="tx = x0 : ty = y0";
_tx = _x0;
RDebugUtils.currentLine=30277641;
 //BA.debugLineNum = 30277641;BA.debugLine="tx = x0 : ty = y0";
_ty = _y0;
RDebugUtils.currentLine=30277642;
 //BA.debugLineNum = 30277642;BA.debugLine="x0 = x2 : y0 = y2";
_x0 = _x2;
RDebugUtils.currentLine=30277642;
 //BA.debugLineNum = 30277642;BA.debugLine="x0 = x2 : y0 = y2";
_y0 = _y2;
RDebugUtils.currentLine=30277643;
 //BA.debugLineNum = 30277643;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=30277643;
 //BA.debugLineNum = 30277643;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=30277645;
 //BA.debugLineNum = 30277645;BA.debugLine="If y1 > y2 Then";
if (_y1>_y2) { 
RDebugUtils.currentLine=30277646;
 //BA.debugLineNum = 30277646;BA.debugLine="tx = x1 : ty = y1";
_tx = _x1;
RDebugUtils.currentLine=30277646;
 //BA.debugLineNum = 30277646;BA.debugLine="tx = x1 : ty = y1";
_ty = _y1;
RDebugUtils.currentLine=30277647;
 //BA.debugLineNum = 30277647;BA.debugLine="x1 = x2 : y1 = y2";
_x1 = _x2;
RDebugUtils.currentLine=30277647;
 //BA.debugLineNum = 30277647;BA.debugLine="x1 = x2 : y1 = y2";
_y1 = _y2;
RDebugUtils.currentLine=30277648;
 //BA.debugLineNum = 30277648;BA.debugLine="x2 = tx : y2 = ty";
_x2 = _tx;
RDebugUtils.currentLine=30277648;
 //BA.debugLineNum = 30277648;BA.debugLine="x2 = tx : y2 = ty";
_y2 = _ty;
 };
RDebugUtils.currentLine=30277651;
 //BA.debugLineNum = 30277651;BA.debugLine="Dim dx0, dx1, dx2 As Double";
_dx0 = 0;
_dx1 = 0;
_dx2 = 0;
RDebugUtils.currentLine=30277652;
 //BA.debugLineNum = 30277652;BA.debugLine="Dim x3, x4, y3, y4 As Double";
_x3 = 0;
_x4 = 0;
_y3 = 0;
_y4 = 0;
RDebugUtils.currentLine=30277653;
 //BA.debugLineNum = 30277653;BA.debugLine="Dim inc As Int";
_inc = 0;
RDebugUtils.currentLine=30277655;
 //BA.debugLineNum = 30277655;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=30277656;
 //BA.debugLineNum = 30277656;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=30277657;
 //BA.debugLineNum = 30277657;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=30277658;
 //BA.debugLineNum = 30277658;BA.debugLine="x3 = x0 : x4 = x0";
_x3 = _x0;
RDebugUtils.currentLine=30277658;
 //BA.debugLineNum = 30277658;BA.debugLine="x3 = x0 : x4 = x0";
_x4 = _x0;
RDebugUtils.currentLine=30277659;
 //BA.debugLineNum = 30277659;BA.debugLine="y3 = y0 : y4 = y0";
_y3 = _y0;
RDebugUtils.currentLine=30277659;
 //BA.debugLineNum = 30277659;BA.debugLine="y3 = y0 : y4 = y0";
_y4 = _y0;
RDebugUtils.currentLine=30277660;
 //BA.debugLineNum = 30277660;BA.debugLine="If dx0 > dx1 Then";
if (_dx0>_dx1) { 
RDebugUtils.currentLine=30277661;
 //BA.debugLineNum = 30277661;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=30277662;
 //BA.debugLineNum = 30277662;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=30277663;
 //BA.debugLineNum = 30277663;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=30277664;
 //BA.debugLineNum = 30277664;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=30277665;
 //BA.debugLineNum = 30277665;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=30277667;
 //BA.debugLineNum = 30277667;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=30277667;
 //BA.debugLineNum = 30277667;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=30277667;
 //BA.debugLineNum = 30277667;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=30277667;
 //BA.debugLineNum = 30277667;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx0;
 }
;
RDebugUtils.currentLine=30277669;
 //BA.debugLineNum = 30277669;BA.debugLine="x4=x1";
_x4 = _x1;
RDebugUtils.currentLine=30277670;
 //BA.debugLineNum = 30277670;BA.debugLine="y4=y1";
_y4 = _y1;
RDebugUtils.currentLine=30277671;
 //BA.debugLineNum = 30277671;BA.debugLine="Do While y3 <= y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=30277672;
 //BA.debugLineNum = 30277672;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=30277673;
 //BA.debugLineNum = 30277673;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=30277674;
 //BA.debugLineNum = 30277674;BA.debugLine="points(x ,y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=30277676;
 //BA.debugLineNum = 30277676;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=30277676;
 //BA.debugLineNum = 30277676;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=30277676;
 //BA.debugLineNum = 30277676;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x3 = _x3+_dx1;
RDebugUtils.currentLine=30277676;
 //BA.debugLineNum = 30277676;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx1 : x4";
_x4 = _x4+_dx2;
 }
;
 }else {
RDebugUtils.currentLine=30277679;
 //BA.debugLineNum = 30277679;BA.debugLine="While";
__c.While();
RDebugUtils.currentLine=30277680;
 //BA.debugLineNum = 30277680;BA.debugLine="Do While y3 <= y1";
while (_y3<=_y1) {
RDebugUtils.currentLine=30277681;
 //BA.debugLineNum = 30277681;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=30277682;
 //BA.debugLineNum = 30277682;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=30277683;
 //BA.debugLineNum = 30277683;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=30277685;
 //BA.debugLineNum = 30277685;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=30277685;
 //BA.debugLineNum = 30277685;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=30277685;
 //BA.debugLineNum = 30277685;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x3 = _x3+_dx0;
RDebugUtils.currentLine=30277685;
 //BA.debugLineNum = 30277685;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx0 : x4";
_x4 = _x4+_dx1;
 }
;
RDebugUtils.currentLine=30277687;
 //BA.debugLineNum = 30277687;BA.debugLine="x3=x1";
_x3 = _x1;
RDebugUtils.currentLine=30277688;
 //BA.debugLineNum = 30277688;BA.debugLine="y3=y1";
_y3 = _y1;
RDebugUtils.currentLine=30277689;
 //BA.debugLineNum = 30277689;BA.debugLine="Do While y3<=y2";
while (_y3<=_y2) {
RDebugUtils.currentLine=30277690;
 //BA.debugLineNum = 30277690;BA.debugLine="If x3 > x4 Then inc = -1 Else inc = 1";
if (_x3>_x4) { 
_inc = (int) (-1);}
else {
_inc = (int) (1);};
RDebugUtils.currentLine=30277691;
 //BA.debugLineNum = 30277691;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=30277692;
 //BA.debugLineNum = 30277692;BA.debugLine="points(x, y3) = 1";
_points[_x][(int) (_y3)] = (byte) (1);
 }
};
RDebugUtils.currentLine=30277694;
 //BA.debugLineNum = 30277694;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y3 = _y3+1;
RDebugUtils.currentLine=30277694;
 //BA.debugLineNum = 30277694;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_y4 = _y4+1;
RDebugUtils.currentLine=30277694;
 //BA.debugLineNum = 30277694;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x3 = _x3+_dx2;
RDebugUtils.currentLine=30277694;
 //BA.debugLineNum = 30277694;BA.debugLine="y3 = y3 + 1 : y4 = y4 + 1 : x3 = x3 + dx2 : x4";
_x4 = _x4+_dx1;
 }
;
 };
RDebugUtils.currentLine=30277697;
 //BA.debugLineNum = 30277697;BA.debugLine="End Sub";
return "";
}
public boolean  _isbluetoothon(SHARK2.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=28508160;
 //BA.debugLineNum = 28508160;BA.debugLine="Public Sub IsBluetoothOn As Boolean";
RDebugUtils.currentLine=28508161;
 //BA.debugLineNum = 28508161;BA.debugLine="Return Serial1.IsEnabled";
if (true) return __ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .IsEnabled();
RDebugUtils.currentLine=28508162;
 //BA.debugLineNum = 28508162;BA.debugLine="End Sub";
return false;
}
public byte[]  _packimageslice(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.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=31129600;
 //BA.debugLineNum = 31129600;BA.debugLine="Public Sub PackImageSlice(img As AnImage, slice As";
RDebugUtils.currentLine=31129601;
 //BA.debugLineNum = 31129601;BA.debugLine="Dim bytes As Int = img.width";
_bytes = _img.Width /*int*/ ;
RDebugUtils.currentLine=31129602;
 //BA.debugLineNum = 31129602;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=31129603;
 //BA.debugLineNum = 31129603;BA.debugLine="Dim pixels(bytes * 3) As Byte";
_pixels = new byte[(int) (_bytes*3)];
;
RDebugUtils.currentLine=31129604;
 //BA.debugLineNum = 31129604;BA.debugLine="Dim slicestart As Int = slice * bytes * 8 * 3";
_slicestart = (int) (_slice*_bytes*8*3);
 }else {
RDebugUtils.currentLine=31129606;
 //BA.debugLineNum = 31129606;BA.debugLine="Dim pixels(bytes) As Byte";
_pixels = new byte[_bytes];
;
RDebugUtils.currentLine=31129607;
 //BA.debugLineNum = 31129607;BA.debugLine="Dim slicestart As Int = slice * bytes * 8";
_slicestart = (int) (_slice*_bytes*8);
 };
RDebugUtils.currentLine=31129610;
 //BA.debugLineNum = 31129610;BA.debugLine="Dim masks(8) As Byte";
_masks = new byte[(int) (8)];
;
RDebugUtils.currentLine=31129611;
 //BA.debugLineNum = 31129611;BA.debugLine="masks(0) = 0x80";
_masks[(int) (0)] = (byte) (((int)0x80));
RDebugUtils.currentLine=31129612;
 //BA.debugLineNum = 31129612;BA.debugLine="masks(1) = 0x40";
_masks[(int) (1)] = (byte) (((int)0x40));
RDebugUtils.currentLine=31129613;
 //BA.debugLineNum = 31129613;BA.debugLine="masks(2) = 0x20";
_masks[(int) (2)] = (byte) (((int)0x20));
RDebugUtils.currentLine=31129614;
 //BA.debugLineNum = 31129614;BA.debugLine="masks(3) = 0x10";
_masks[(int) (3)] = (byte) (((int)0x10));
RDebugUtils.currentLine=31129615;
 //BA.debugLineNum = 31129615;BA.debugLine="masks(4) = 0x08";
_masks[(int) (4)] = (byte) (((int)0x08));
RDebugUtils.currentLine=31129616;
 //BA.debugLineNum = 31129616;BA.debugLine="masks(5) = 0x04";
_masks[(int) (5)] = (byte) (((int)0x04));
RDebugUtils.currentLine=31129617;
 //BA.debugLineNum = 31129617;BA.debugLine="masks(6) = 0x02";
_masks[(int) (6)] = (byte) (((int)0x02));
RDebugUtils.currentLine=31129618;
 //BA.debugLineNum = 31129618;BA.debugLine="masks(7) = 0x01";
_masks[(int) (7)] = (byte) (((int)0x01));
RDebugUtils.currentLine=31129620;
 //BA.debugLineNum = 31129620;BA.debugLine="If dots24 Then";
if (_dots24) { 
RDebugUtils.currentLine=31129621;
 //BA.debugLineNum = 31129621;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=31129622;
 //BA.debugLineNum = 31129622;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=31129623;
 //BA.debugLineNum = 31129623;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=31129624;
 //BA.debugLineNum = 31129624;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=31129626;
 //BA.debugLineNum = 31129626;BA.debugLine="Dim pix As Byte = img.Data(slicestart + ((b +";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+((_b+_s*8)*_bytes)+_x)];
RDebugUtils.currentLine=31129627;
 //BA.debugLineNum = 31129627;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=31129628;
 //BA.debugLineNum = 31129628;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=31129631;
 //BA.debugLineNum = 31129631;BA.debugLine="pixels(x*3+s) = xbyte";
_pixels[(int) (_x*3+_s)] = _xbyte;
 }
};
 }
};
 }else {
RDebugUtils.currentLine=31129635;
 //BA.debugLineNum = 31129635;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=31129636;
 //BA.debugLineNum = 31129636;BA.debugLine="Dim xbyte As Byte = 0";
_xbyte = (byte) (0);
RDebugUtils.currentLine=31129637;
 //BA.debugLineNum = 31129637;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=31129639;
 //BA.debugLineNum = 31129639;BA.debugLine="Dim pix As Byte = img.Data(slicestart + (b * b";
_pix = _img.Data /*byte[]*/ [(int) (_slicestart+(_b*_bytes)+_x)];
RDebugUtils.currentLine=31129640;
 //BA.debugLineNum = 31129640;BA.debugLine="If pix <> 0 Then";
if (_pix!=0) { 
RDebugUtils.currentLine=31129641;
 //BA.debugLineNum = 31129641;BA.debugLine="xbyte = xbyte + masks(b)";
_xbyte = (byte) (_xbyte+_masks[_b]);
 };
 }
};
RDebugUtils.currentLine=31129644;
 //BA.debugLineNum = 31129644;BA.debugLine="pixels(x) = xbyte";
_pixels[_x] = _xbyte;
 }
};
 };
RDebugUtils.currentLine=31129647;
 //BA.debugLineNum = 31129647;BA.debugLine="Return pixels";
if (true) return _pixels;
RDebugUtils.currentLine=31129648;
 //BA.debugLineNum = 31129648;BA.debugLine="End Sub";
return null;
}
public String  _plotlinelow(SHARK2.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=30605312;
 //BA.debugLineNum = 30605312;BA.debugLine="Private Sub	PlotLineLow(x0 As Int, y0 As Int, x1 A";
RDebugUtils.currentLine=30605313;
 //BA.debugLineNum = 30605313;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=30605314;
 //BA.debugLineNum = 30605314;BA.debugLine="Dim dy As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=30605315;
 //BA.debugLineNum = 30605315;BA.debugLine="Dim yi As Int = 1";
_yi = (int) (1);
RDebugUtils.currentLine=30605316;
 //BA.debugLineNum = 30605316;BA.debugLine="If dy < 0 Then";
if (_dy<0) { 
RDebugUtils.currentLine=30605317;
 //BA.debugLineNum = 30605317;BA.debugLine="yi = -1";
_yi = (int) (-1);
RDebugUtils.currentLine=30605318;
 //BA.debugLineNum = 30605318;BA.debugLine="dy = -dy";
_dy = (int) (-_dy);
 };
RDebugUtils.currentLine=30605320;
 //BA.debugLineNum = 30605320;BA.debugLine="Dim D As Int = 2*dy - dx";
_d = (int) (2*_dy-_dx);
RDebugUtils.currentLine=30605321;
 //BA.debugLineNum = 30605321;BA.debugLine="Dim y As Int = y0";
_y = _y0;
RDebugUtils.currentLine=30605322;
 //BA.debugLineNum = 30605322;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=30605323;
 //BA.debugLineNum = 30605323;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=30605324;
 //BA.debugLineNum = 30605324;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=30605325;
 //BA.debugLineNum = 30605325;BA.debugLine="y = y + yi";
_y = (int) (_y+_yi);
RDebugUtils.currentLine=30605326;
 //BA.debugLineNum = 30605326;BA.debugLine="D = D - 2*dx";
_d = (int) (_d-2*_dx);
 };
RDebugUtils.currentLine=30605328;
 //BA.debugLineNum = 30605328;BA.debugLine="D = D + 2*dy";
_d = (int) (_d+2*_dy);
 }
};
RDebugUtils.currentLine=30605330;
 //BA.debugLineNum = 30605330;BA.debugLine="End Sub";
return "";
}
public String  _plotlinehigh(SHARK2.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=30539776;
 //BA.debugLineNum = 30539776;BA.debugLine="Private Sub PlotLineHigh(x0 As Int, y0 As Int, x1";
RDebugUtils.currentLine=30539777;
 //BA.debugLineNum = 30539777;BA.debugLine="Dim dx As Int = x1 - x0";
_dx = (int) (_x1-_x0);
RDebugUtils.currentLine=30539778;
 //BA.debugLineNum = 30539778;BA.debugLine="Dim dy  As Int = y1 - y0";
_dy = (int) (_y1-_y0);
RDebugUtils.currentLine=30539779;
 //BA.debugLineNum = 30539779;BA.debugLine="Dim xi As Int = 1";
_xi = (int) (1);
RDebugUtils.currentLine=30539780;
 //BA.debugLineNum = 30539780;BA.debugLine="If dx < 0 Then";
if (_dx<0) { 
RDebugUtils.currentLine=30539781;
 //BA.debugLineNum = 30539781;BA.debugLine="xi = -1";
_xi = (int) (-1);
RDebugUtils.currentLine=30539782;
 //BA.debugLineNum = 30539782;BA.debugLine="dx = -dx";
_dx = (int) (-_dx);
 };
RDebugUtils.currentLine=30539784;
 //BA.debugLineNum = 30539784;BA.debugLine="Dim D As Int = 2*dx - dy";
_d = (int) (2*_dx-_dy);
RDebugUtils.currentLine=30539785;
 //BA.debugLineNum = 30539785;BA.debugLine="Dim x As Int = x0";
_x = _x0;
RDebugUtils.currentLine=30539786;
 //BA.debugLineNum = 30539786;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=30539787;
 //BA.debugLineNum = 30539787;BA.debugLine="points(x,y) = 1";
_points[_x][_y] = (byte) (1);
RDebugUtils.currentLine=30539788;
 //BA.debugLineNum = 30539788;BA.debugLine="If D > 0 Then";
if (_d>0) { 
RDebugUtils.currentLine=30539789;
 //BA.debugLineNum = 30539789;BA.debugLine="x = x + xi";
_x = (int) (_x+_xi);
RDebugUtils.currentLine=30539790;
 //BA.debugLineNum = 30539790;BA.debugLine="D = D - 2*dy";
_d = (int) (_d-2*_dy);
 };
RDebugUtils.currentLine=30539792;
 //BA.debugLineNum = 30539792;BA.debugLine="D = D + 2*dx";
_d = (int) (_d+2*_dx);
 }
};
RDebugUtils.currentLine=30539794;
 //BA.debugLineNum = 30539794;BA.debugLine="End Sub";
return "";
}
public String  _printandfeedpaper(SHARK2.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=28770304;
 //BA.debugLineNum = 28770304;BA.debugLine="Public Sub PrintAndFeedPaper(units As Int)";
RDebugUtils.currentLine=28770305;
 //BA.debugLineNum = 28770305;BA.debugLine="WriteString(ESC & \"J\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"J");
RDebugUtils.currentLine=28770306;
 //BA.debugLineNum = 28770306;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=28770307;
 //BA.debugLineNum = 28770307;BA.debugLine="params(0) = units";
_params[(int) (0)] = (byte) (_units);
RDebugUtils.currentLine=28770308;
 //BA.debugLineNum = 28770308;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=28770309;
 //BA.debugLineNum = 28770309;BA.debugLine="End Sub";
return "";
}
public int  _printimage2(SHARK2.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=31064064;
 //BA.debugLineNum = 31064064;BA.debugLine="Public Sub PrintImage2(width As Int, data() As Byt";
RDebugUtils.currentLine=31064065;
 //BA.debugLineNum = 31064065;BA.debugLine="Dim d As String = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=31064066;
 //BA.debugLineNum = 31064066;BA.debugLine="If Not(highdensity) And Not(dotds24 )	 Then";
if (__c.Not(_highdensity) && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=31064067;
 //BA.debugLineNum = 31064067;BA.debugLine="d = Chr(0)";
_d = BA.ObjectToString(__c.Chr((int) (0)));
RDebugUtils.currentLine=31064068;
 //BA.debugLineNum = 31064068;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=31064069;
 //BA.debugLineNum = 31064069;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=31064070;
 //BA.debugLineNum = 31064070;BA.debugLine="Else If highdensity And Not(dotds24) 	 Then";
if (_highdensity && __c.Not(_dotds24)) { 
RDebugUtils.currentLine=31064071;
 //BA.debugLineNum = 31064071;BA.debugLine="d = Chr(1)";
_d = BA.ObjectToString(__c.Chr((int) (1)));
RDebugUtils.currentLine=31064072;
 //BA.debugLineNum = 31064072;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=31064073;
 //BA.debugLineNum = 31064073;BA.debugLine="If data.Length <> width Then Return -3";
if (_data.length!=_width) { 
if (true) return (int) (-3);};
 }else 
{RDebugUtils.currentLine=31064074;
 //BA.debugLineNum = 31064074;BA.debugLine="Else 	If Not(highdensity) And dotds24 	 Then";
if (__c.Not(_highdensity) && _dotds24) { 
RDebugUtils.currentLine=31064075;
 //BA.debugLineNum = 31064075;BA.debugLine="d = Chr(32)";
_d = BA.ObjectToString(__c.Chr((int) (32)));
RDebugUtils.currentLine=31064076;
 //BA.debugLineNum = 31064076;BA.debugLine="If width > 288 Then Return -1";
if (_width>288) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=31064077;
 //BA.debugLineNum = 31064077;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }else {
RDebugUtils.currentLine=31064079;
 //BA.debugLineNum = 31064079;BA.debugLine="d = Chr(33)";
_d = BA.ObjectToString(__c.Chr((int) (33)));
RDebugUtils.currentLine=31064080;
 //BA.debugLineNum = 31064080;BA.debugLine="If width > 576 Then Return -1";
if (_width>576) { 
if (true) return (int) (-1);};
RDebugUtils.currentLine=31064081;
 //BA.debugLineNum = 31064081;BA.debugLine="If data.Length <> width*3 Then Return -3";
if (_data.length!=_width*3) { 
if (true) return (int) (-3);};
 }}}
;
RDebugUtils.currentLine=31064083;
 //BA.debugLineNum = 31064083;BA.debugLine="Dim xh As Int = width / 256";
_xh = (int) (_width/(double)256);
RDebugUtils.currentLine=31064084;
 //BA.debugLineNum = 31064084;BA.debugLine="Dim xl As Int = width - xh * 256";
_xl = (int) (_width-_xh*256);
RDebugUtils.currentLine=31064085;
 //BA.debugLineNum = 31064085;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=31064086;
 //BA.debugLineNum = 31064086;BA.debugLine="params(0) = xl";
_params[(int) (0)] = (byte) (_xl);
RDebugUtils.currentLine=31064087;
 //BA.debugLineNum = 31064087;BA.debugLine="params(1) = xh";
_params[(int) (1)] = (byte) (_xh);
RDebugUtils.currentLine=31064088;
 //BA.debugLineNum = 31064088;BA.debugLine="WriteString(ESC & \"*\" & d)";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"*"+_d);
RDebugUtils.currentLine=31064089;
 //BA.debugLineNum = 31064089;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31064090;
 //BA.debugLineNum = 31064090;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=31064091;
 //BA.debugLineNum = 31064091;BA.debugLine="WriteString(CRLF)";
__ref._writestring /*String*/ (null,__c.CRLF);
RDebugUtils.currentLine=31064092;
 //BA.debugLineNum = 31064092;BA.debugLine="Return 0";
if (true) return (int) (0);
RDebugUtils.currentLine=31064093;
 //BA.debugLineNum = 31064093;BA.debugLine="End Sub";
return 0;
}
public String  _reset(SHARK2.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=28704768;
 //BA.debugLineNum = 28704768;BA.debugLine="Public Sub Reset";
RDebugUtils.currentLine=28704769;
 //BA.debugLineNum = 28704769;BA.debugLine="WriteString(ESC & \"@\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"@");
RDebugUtils.currentLine=28704770;
 //BA.debugLineNum = 28704770;BA.debugLine="End Sub";
return "";
}
public String  _serial1_connected(SHARK2.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=31653888;
 //BA.debugLineNum = 31653888;BA.debugLine="Private Sub Serial1_Connected (Success As Boolean)";
RDebugUtils.currentLine=31653889;
 //BA.debugLineNum = 31653889;BA.debugLine="If Success Then";
if (_success) { 
RDebugUtils.currentLine=31653890;
 //BA.debugLineNum = 31653890;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=31653891;
 //BA.debugLineNum = 31653891;BA.debugLine="Connected = True";
__ref._connected /*boolean*/  = __c.True;
RDebugUtils.currentLine=31653892;
 //BA.debugLineNum = 31653892;BA.debugLine="ConnectedError = \"\"";
__ref._connectederror /*String*/  = "";
RDebugUtils.currentLine=31653893;
 //BA.debugLineNum = 31653893;BA.debugLine="Serial1.Listen";
__ref._serial1 /*anywheresoftware.b4a.objects.Serial*/ .Listen(ba);
 }else {
RDebugUtils.currentLine=31653895;
 //BA.debugLineNum = 31653895;BA.debugLine="Connected = False";
__ref._connected /*boolean*/  = __c.False;
RDebugUtils.currentLine=31653896;
 //BA.debugLineNum = 31653896;BA.debugLine="ConnectedError = LastException.Message";
__ref._connectederror /*String*/  = __c.LastException(getActivityBA()).getMessage();
 };
RDebugUtils.currentLine=31653898;
 //BA.debugLineNum = 31653898;BA.debugLine="If SubExists(CallBack, EventName & \"_Connected\")";
if (__c.SubExists(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected")) { 
RDebugUtils.currentLine=31653899;
 //BA.debugLineNum = 31653899;BA.debugLine="CallSub2(CallBack, EventName & \"_Connected\", Suc";
__c.CallSubNew2(ba,__ref._callback /*Object*/ ,__ref._eventname /*String*/ +"_Connected",(Object)(_success));
 };
RDebugUtils.currentLine=31653901;
 //BA.debugLineNum = 31653901;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeheight(SHARK2.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=31195136;
 //BA.debugLineNum = 31195136;BA.debugLine="Public Sub setBarCodeHeight(height As Int)";
RDebugUtils.currentLine=31195137;
 //BA.debugLineNum = 31195137;BA.debugLine="WriteString(GS & \"h\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"h");
RDebugUtils.currentLine=31195138;
 //BA.debugLineNum = 31195138;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=31195139;
 //BA.debugLineNum = 31195139;BA.debugLine="params(0) = height";
_params[(int) (0)] = (byte) (_height);
RDebugUtils.currentLine=31195140;
 //BA.debugLineNum = 31195140;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31195141;
 //BA.debugLineNum = 31195141;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodeleft(SHARK2.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=31260672;
 //BA.debugLineNum = 31260672;BA.debugLine="Public Sub setBarCodeLeft(left As Int)";
RDebugUtils.currentLine=31260673;
 //BA.debugLineNum = 31260673;BA.debugLine="WriteString(GS & \"x\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"x");
RDebugUtils.currentLine=31260674;
 //BA.debugLineNum = 31260674;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=31260675;
 //BA.debugLineNum = 31260675;BA.debugLine="params(0) = left";
_params[(int) (0)] = (byte) (_left);
RDebugUtils.currentLine=31260676;
 //BA.debugLineNum = 31260676;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31260677;
 //BA.debugLineNum = 31260677;BA.debugLine="End Sub";
return "";
}
public String  _setbarcodewidth(SHARK2.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=31326208;
 //BA.debugLineNum = 31326208;BA.debugLine="Public Sub setBarCodeWidth(width As Int)";
RDebugUtils.currentLine=31326209;
 //BA.debugLineNum = 31326209;BA.debugLine="WriteString(GS & \"w\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"w");
RDebugUtils.currentLine=31326210;
 //BA.debugLineNum = 31326210;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=31326211;
 //BA.debugLineNum = 31326211;BA.debugLine="params(0) = width";
_params[(int) (0)] = (byte) (_width);
RDebugUtils.currentLine=31326212;
 //BA.debugLineNum = 31326212;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31326213;
 //BA.debugLineNum = 31326213;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterfont(SHARK2.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=29294592;
 //BA.debugLineNum = 29294592;BA.debugLine="Public Sub setCharacterFont(font As Int)";
RDebugUtils.currentLine=29294593;
 //BA.debugLineNum = 29294593;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=29294594;
 //BA.debugLineNum = 29294594;BA.debugLine="End Sub";
return "";
}
public String  _setcharacterspacing(SHARK2.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=28835840;
 //BA.debugLineNum = 28835840;BA.debugLine="Public Sub setCharacterSpacing(spacing As Int)";
RDebugUtils.currentLine=28835841;
 //BA.debugLineNum = 28835841;BA.debugLine="WriteString(ESC & \" \")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +" ");
RDebugUtils.currentLine=28835842;
 //BA.debugLineNum = 28835842;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=28835843;
 //BA.debugLineNum = 28835843;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=28835844;
 //BA.debugLineNum = 28835844;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=28835845;
 //BA.debugLineNum = 28835845;BA.debugLine="End Sub";
return "";
}
public String  _setcodepage(SHARK2.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=29229056;
 //BA.debugLineNum = 29229056;BA.debugLine="Public Sub setCodePage(codepage As Int)";
RDebugUtils.currentLine=29229057;
 //BA.debugLineNum = 29229057;BA.debugLine="WriteString(ESC & \"t\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"t");
RDebugUtils.currentLine=29229058;
 //BA.debugLineNum = 29229058;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=29229059;
 //BA.debugLineNum = 29229059;BA.debugLine="params(0) = codepage";
_params[(int) (0)] = (byte) (_codepage);
RDebugUtils.currentLine=29229060;
 //BA.debugLineNum = 29229060;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=29229061;
 //BA.debugLineNum = 29229061;BA.debugLine="End Sub";
return "";
}
public String  _sethrifont(SHARK2.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=31457280;
 //BA.debugLineNum = 31457280;BA.debugLine="Public Sub setHriFont(font As Int)";
RDebugUtils.currentLine=31457281;
 //BA.debugLineNum = 31457281;BA.debugLine="WriteString(GS & \"f\" & Chr(font))";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"f"+BA.ObjectToString(__c.Chr(_font)));
RDebugUtils.currentLine=31457282;
 //BA.debugLineNum = 31457282;BA.debugLine="End Sub";
return "";
}
public String  _sethriposn(SHARK2.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=31391744;
 //BA.debugLineNum = 31391744;BA.debugLine="Public Sub setHriPosn(posn As Int)";
RDebugUtils.currentLine=31391745;
 //BA.debugLineNum = 31391745;BA.debugLine="WriteString(GS & \"H\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"H");
RDebugUtils.currentLine=31391746;
 //BA.debugLineNum = 31391746;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=31391747;
 //BA.debugLineNum = 31391747;BA.debugLine="params(0) = posn";
_params[(int) (0)] = (byte) (_posn);
RDebugUtils.currentLine=31391748;
 //BA.debugLineNum = 31391748;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31391749;
 //BA.debugLineNum = 31391749;BA.debugLine="End Sub";
return "";
}
public String  _setleftinset(SHARK2.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=28901376;
 //BA.debugLineNum = 28901376;BA.debugLine="Public Sub setLeftInset(inset As Int)";
RDebugUtils.currentLine=28901377;
 //BA.debugLineNum = 28901377;BA.debugLine="Dim dh As Int = inset / 256";
_dh = (int) (_inset/(double)256);
RDebugUtils.currentLine=28901378;
 //BA.debugLineNum = 28901378;BA.debugLine="Dim dl As Int = inset - dh";
_dl = (int) (_inset-_dh);
RDebugUtils.currentLine=28901379;
 //BA.debugLineNum = 28901379;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=28901380;
 //BA.debugLineNum = 28901380;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=28901381;
 //BA.debugLineNum = 28901381;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=28901382;
 //BA.debugLineNum = 28901382;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=28901383;
 //BA.debugLineNum = 28901383;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=28901384;
 //BA.debugLineNum = 28901384;BA.debugLine="End Sub";
return "";
}
public String  _setleftmargin(SHARK2.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=28966912;
 //BA.debugLineNum = 28966912;BA.debugLine="Public Sub setLeftMargin(margin As Int)";
RDebugUtils.currentLine=28966913;
 //BA.debugLineNum = 28966913;BA.debugLine="Dim dh As Int = margin / 256";
_dh = (int) (_margin/(double)256);
RDebugUtils.currentLine=28966914;
 //BA.debugLineNum = 28966914;BA.debugLine="Dim dl As Int = margin - dh";
_dl = (int) (_margin-_dh);
RDebugUtils.currentLine=28966915;
 //BA.debugLineNum = 28966915;BA.debugLine="WriteString(GS & \"L\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"L");
RDebugUtils.currentLine=28966916;
 //BA.debugLineNum = 28966916;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=28966917;
 //BA.debugLineNum = 28966917;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=28966918;
 //BA.debugLineNum = 28966918;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=28966919;
 //BA.debugLineNum = 28966919;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=28966920;
 //BA.debugLineNum = 28966920;BA.debugLine="End Sub";
return "";
}
public String  _setlinespacing(SHARK2.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=29097984;
 //BA.debugLineNum = 29097984;BA.debugLine="Public Sub setLineSpacing(spacing As Int)";
RDebugUtils.currentLine=29097985;
 //BA.debugLineNum = 29097985;BA.debugLine="If spacing < 0 Then";
if (_spacing<0) { 
RDebugUtils.currentLine=29097986;
 //BA.debugLineNum = 29097986;BA.debugLine="WriteString(ESC & \"2\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"2");
 }else {
RDebugUtils.currentLine=29097988;
 //BA.debugLineNum = 29097988;BA.debugLine="WriteString(ESC & \"3\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"3");
RDebugUtils.currentLine=29097989;
 //BA.debugLineNum = 29097989;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=29097990;
 //BA.debugLineNum = 29097990;BA.debugLine="params(0) = spacing";
_params[(int) (0)] = (byte) (_spacing);
RDebugUtils.currentLine=29097991;
 //BA.debugLineNum = 29097991;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
 };
RDebugUtils.currentLine=29097993;
 //BA.debugLineNum = 29097993;BA.debugLine="End Sub";
return "";
}
public String  _setprintwidth(SHARK2.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=29032448;
 //BA.debugLineNum = 29032448;BA.debugLine="Public Sub setPrintWidth(width As Int)";
RDebugUtils.currentLine=29032449;
 //BA.debugLineNum = 29032449;BA.debugLine="Dim dh As Int = width / 256";
_dh = (int) (_width/(double)256);
RDebugUtils.currentLine=29032450;
 //BA.debugLineNum = 29032450;BA.debugLine="Dim dl As Int = width - dh";
_dl = (int) (_width-_dh);
RDebugUtils.currentLine=29032451;
 //BA.debugLineNum = 29032451;BA.debugLine="WriteString(GS & \"W\")";
__ref._writestring /*String*/ (null,__ref._gs /*String*/ +"W");
RDebugUtils.currentLine=29032452;
 //BA.debugLineNum = 29032452;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=29032453;
 //BA.debugLineNum = 29032453;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=29032454;
 //BA.debugLineNum = 29032454;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=29032455;
 //BA.debugLineNum = 29032455;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=29032456;
 //BA.debugLineNum = 29032456;BA.debugLine="End Sub";
return "";
}
public String  _setrelativeprintposn(SHARK2.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=29425664;
 //BA.debugLineNum = 29425664;BA.debugLine="Public Sub setRelativePrintPosn(relposn As Int)";
RDebugUtils.currentLine=29425665;
 //BA.debugLineNum = 29425665;BA.debugLine="Dim dh As Int = relposn / 256";
_dh = (int) (_relposn/(double)256);
RDebugUtils.currentLine=29425666;
 //BA.debugLineNum = 29425666;BA.debugLine="Dim dl As Int = relposn - dh";
_dl = (int) (_relposn-_dh);
RDebugUtils.currentLine=29425667;
 //BA.debugLineNum = 29425667;BA.debugLine="WriteString(ESC & \"\\\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"\\");
RDebugUtils.currentLine=29425668;
 //BA.debugLineNum = 29425668;BA.debugLine="Dim params(2) As Byte";
_params = new byte[(int) (2)];
;
RDebugUtils.currentLine=29425669;
 //BA.debugLineNum = 29425669;BA.debugLine="params(0) = dl";
_params[(int) (0)] = (byte) (_dl);
RDebugUtils.currentLine=29425670;
 //BA.debugLineNum = 29425670;BA.debugLine="params(1) = dh";
_params[(int) (1)] = (byte) (_dh);
RDebugUtils.currentLine=29425671;
 //BA.debugLineNum = 29425671;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=29425672;
 //BA.debugLineNum = 29425672;BA.debugLine="End Sub";
return "";
}
public String  _settabpositions(SHARK2.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=29360128;
 //BA.debugLineNum = 29360128;BA.debugLine="Public Sub setTabPositions(tabs() As Int)";
RDebugUtils.currentLine=29360129;
 //BA.debugLineNum = 29360129;BA.debugLine="WriteString(ESC & \"D\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"D");
RDebugUtils.currentLine=29360130;
 //BA.debugLineNum = 29360130;BA.debugLine="Dim data(tabs.Length+1) As Byte";
_data = new byte[(int) (_tabs.length+1)];
;
RDebugUtils.currentLine=29360131;
 //BA.debugLineNum = 29360131;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=29360132;
 //BA.debugLineNum = 29360132;BA.debugLine="data(i) = tabs(i)";
_data[_i] = (byte) (_tabs[_i]);
 }
};
RDebugUtils.currentLine=29360134;
 //BA.debugLineNum = 29360134;BA.debugLine="data(tabs.Length) = 0";
_data[_tabs.length] = (byte) (0);
RDebugUtils.currentLine=29360135;
 //BA.debugLineNum = 29360135;BA.debugLine="WriteBytes(data)";
__ref._writebytes /*String*/ (null,_data);
RDebugUtils.currentLine=29360136;
 //BA.debugLineNum = 29360136;BA.debugLine="End Sub";
return "";
}
public String  _setusecustomcharacters(SHARK2.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=29753344;
 //BA.debugLineNum = 29753344;BA.debugLine="Public Sub setUseCustomCharacters(custom As Boolea";
RDebugUtils.currentLine=29753345;
 //BA.debugLineNum = 29753345;BA.debugLine="If custom Then";
if (_custom) { 
RDebugUtils.currentLine=29753346;
 //BA.debugLineNum = 29753346;BA.debugLine="WriteString(ESC & \"%1\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%1");
 }else {
RDebugUtils.currentLine=29753348;
 //BA.debugLineNum = 29753348;BA.debugLine="WriteString(ESC & \"%0\")";
__ref._writestring /*String*/ (null,__ref._esc /*String*/ +"%0");
 };
RDebugUtils.currentLine=29753350;
 //BA.debugLineNum = 29753350;BA.debugLine="End Sub";
return "";
}
public SHARK2.keymon.com.mx.escposprinter._animage  _thresholdimage(SHARK2.keymon.com.mx.escposprinter __ref,SHARK2.keymon.com.mx.escposprinter._animage _img,int _threshold) throws Exception{
__ref = this;
RDebugUtils.currentModule="escposprinter";
if (Debug.shouldDelegate(ba, "thresholdimage", false))
	 {return ((SHARK2.keymon.com.mx.escposprinter._animage) Debug.delegate(ba, "thresholdimage", new Object[] {_img,_threshold}));}
byte[] _pixels = null;
int _i = 0;
int _lum = 0;
SHARK2.keymon.com.mx.escposprinter._animage _ret = null;
RDebugUtils.currentLine=30736384;
 //BA.debugLineNum = 30736384;BA.debugLine="Sub ThresholdImage(img As AnImage, threshold As In";
RDebugUtils.currentLine=30736385;
 //BA.debugLineNum = 30736385;BA.debugLine="Dim pixels(img.Data.Length) As Byte";
_pixels = new byte[_img.Data /*byte[]*/ .length];
;
RDebugUtils.currentLine=30736386;
 //BA.debugLineNum = 30736386;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=30736387;
 //BA.debugLineNum = 30736387;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=30736388;
 //BA.debugLineNum = 30736388;BA.debugLine="If lum < threshold Then";
if (_lum<_threshold) { 
RDebugUtils.currentLine=30736389;
 //BA.debugLineNum = 30736389;BA.debugLine="lum = 1";
_lum = (int) (1);
 }else {
RDebugUtils.currentLine=30736391;
 //BA.debugLineNum = 30736391;BA.debugLine="lum = 0";
_lum = (int) (0);
 };
RDebugUtils.currentLine=30736393;
 //BA.debugLineNum = 30736393;BA.debugLine="pixels(i) = lum";
_pixels[_i] = (byte) (_lum);
 }
};
RDebugUtils.currentLine=30736395;
 //BA.debugLineNum = 30736395;BA.debugLine="Dim ret As AnImage";
_ret = new SHARK2.keymon.com.mx.escposprinter._animage();
RDebugUtils.currentLine=30736396;
 //BA.debugLineNum = 30736396;BA.debugLine="ret.Width = img.Width";
_ret.Width /*int*/  = _img.Width /*int*/ ;
RDebugUtils.currentLine=30736397;
 //BA.debugLineNum = 30736397;BA.debugLine="ret.Height = img.Height";
_ret.Height /*int*/  = _img.Height /*int*/ ;
RDebugUtils.currentLine=30736398;
 //BA.debugLineNum = 30736398;BA.debugLine="ret.Data = pixels";
_ret.Data /*byte[]*/  = _pixels;
RDebugUtils.currentLine=30736399;
 //BA.debugLineNum = 30736399;BA.debugLine="Return ret";
if (true) return _ret;
RDebugUtils.currentLine=30736400;
 //BA.debugLineNum = 30736400;BA.debugLine="End Sub";
return null;
}
public String  _writebarcode(SHARK2.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=31522816;
 //BA.debugLineNum = 31522816;BA.debugLine="Public Sub WriteBarCode(bartype As String, data As";
RDebugUtils.currentLine=31522817;
 //BA.debugLineNum = 31522817;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ASCII\")";
_databytes = _data.getBytes("ASCII");
RDebugUtils.currentLine=31522818;
 //BA.debugLineNum = 31522818;BA.debugLine="Dim dlow As Int = databytes.Length";
_dlow = _databytes.length;
RDebugUtils.currentLine=31522819;
 //BA.debugLineNum = 31522819;BA.debugLine="Log(\"Barcode \" & bartype & \", Size \" & dlow & \",";
__c.LogImpl("531522819","Barcode "+_bartype+", Size "+BA.NumberToString(_dlow)+", "+_data,0);
RDebugUtils.currentLine=31522820;
 //BA.debugLineNum = 31522820;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=31522821;
 //BA.debugLineNum = 31522821;BA.debugLine="Dim params(1) As Byte";
_params = new byte[(int) (1)];
;
RDebugUtils.currentLine=31522822;
 //BA.debugLineNum = 31522822;BA.debugLine="params(0) = dlow";
_params[(int) (0)] = (byte) (_dlow);
RDebugUtils.currentLine=31522823;
 //BA.debugLineNum = 31522823;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31522824;
 //BA.debugLineNum = 31522824;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=31522825;
 //BA.debugLineNum = 31522825;BA.debugLine="End Sub";
return "";
}
public String  _writeqrcode(SHARK2.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=31588352;
 //BA.debugLineNum = 31588352;BA.debugLine="Public Sub WriteQRCode(size As Int, EC As String,";
RDebugUtils.currentLine=31588353;
 //BA.debugLineNum = 31588353;BA.debugLine="Dim databytes() As Byte = data.GetBytes(\"ISO-8859";
_databytes = _data.getBytes("ISO-8859-1");
RDebugUtils.currentLine=31588354;
 //BA.debugLineNum = 31588354;BA.debugLine="Dim dhigh As Int = databytes.Length / 256";
_dhigh = (int) (_databytes.length/(double)256);
RDebugUtils.currentLine=31588355;
 //BA.debugLineNum = 31588355;BA.debugLine="Dim dlow As Int = databytes.Length - dhigh*256";
_dlow = (int) (_databytes.length-_dhigh*256);
RDebugUtils.currentLine=31588356;
 //BA.debugLineNum = 31588356;BA.debugLine="Log(\"QR Code : Size \" & size & \", EC \" & EC & \",";
__c.LogImpl("531588356","QR Code : Size "+BA.NumberToString(_size)+", EC "+_ec+", Scale "+BA.NumberToString(_scale)+", Size "+BA.NumberToString(_dlow)+" "+BA.NumberToString(_dhigh)+" : Data = "+_data,0);
RDebugUtils.currentLine=31588357;
 //BA.debugLineNum = 31588357;BA.debugLine="Dim params(3) As Byte";
_params = new byte[(int) (3)];
;
RDebugUtils.currentLine=31588358;
 //BA.debugLineNum = 31588358;BA.debugLine="params(0) = scale";
_params[(int) (0)] = (byte) (_scale);
RDebugUtils.currentLine=31588359;
 //BA.debugLineNum = 31588359;BA.debugLine="params(1) = dlow";
_params[(int) (1)] = (byte) (_dlow);
RDebugUtils.currentLine=31588360;
 //BA.debugLineNum = 31588360;BA.debugLine="params(2) = dhigh";
_params[(int) (2)] = (byte) (_dhigh);
RDebugUtils.currentLine=31588361;
 //BA.debugLineNum = 31588361;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=31588362;
 //BA.debugLineNum = 31588362;BA.debugLine="WriteBytes(params)";
__ref._writebytes /*String*/ (null,_params);
RDebugUtils.currentLine=31588363;
 //BA.debugLineNum = 31588363;BA.debugLine="WriteBytes(databytes)";
__ref._writebytes /*String*/ (null,_databytes);
RDebugUtils.currentLine=31588364;
 //BA.debugLineNum = 31588364;BA.debugLine="End Sub";
return "";
}
public String  _writestring2(SHARK2.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=29622272;
 //BA.debugLineNum = 29622272;BA.debugLine="Public Sub WriteString2(data As String, encoding A";
RDebugUtils.currentLine=29622273;
 //BA.debugLineNum = 29622273;BA.debugLine="Try";
try {RDebugUtils.currentLine=29622274;
 //BA.debugLineNum = 29622274;BA.debugLine="If Connected Then";
if (__ref._connected /*boolean*/ ) { 
RDebugUtils.currentLine=29622275;
 //BA.debugLineNum = 29622275;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=29622278;
 //BA.debugLineNum = 29622278;BA.debugLine="Log(\"Printer error : \" & LastException.Message)";
__c.LogImpl("529622278","Printer error : "+__c.LastException(getActivityBA()).getMessage(),0);
RDebugUtils.currentLine=29622279;
 //BA.debugLineNum = 29622279;BA.debugLine="AStream_Error";
__ref._astream_error /*String*/ (null);
 };
RDebugUtils.currentLine=29622281;
 //BA.debugLineNum = 29622281;BA.debugLine="End Sub";
return "";
}
}