package com.shaderyan.neo.wifi.fix;


import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class main extends Activity implements B4AActivity{
	public static main mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	public static final boolean fullScreen = false;
	public static final boolean includeTitle = false;
    public static WeakReference<Activity> previousOne;
    public static boolean dontPause;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        mostCurrent = this;
		if (processBA == null) {
			processBA = new BA(this.getApplicationContext(), null, null, "com.shaderyan.neo.wifi.fix", "com.shaderyan.neo.wifi.fix.main");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
            
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                BA.LogInfo("Killing previous instance (main).");
				p.finish();
			}
		}
        processBA.setActivityPaused(true);
        processBA.runHook("oncreate", this, null);
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		
        processBA.sharedProcessBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
        WaitForLayout wl = new WaitForLayout();
        if (anywheresoftware.b4a.objects.ServiceHelper.StarterHelper.startFromActivity(this, processBA, wl, false))
		    BA.handler.postDelayed(wl, 5);

	}
	static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent == null)
				return;
            
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
        if (this != mostCurrent)
			return;
		activityBA = new BA(this, layout, processBA, "com.shaderyan.neo.wifi.fix", "com.shaderyan.neo.wifi.fix.main");
        
        processBA.sharedProcessBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (BA.isShellModeRuntimeCheck(processBA)) {
			if (isFirst)
				processBA.raiseEvent2(null, true, "SHELL", false);
			processBA.raiseEvent2(null, true, "CREATE", true, "com.shaderyan.neo.wifi.fix.main", processBA, activityBA, _activity, anywheresoftware.b4a.keywords.Common.Density, mostCurrent);
			_activity.reinitializeForShell(activityBA, "activity");
		}
        initializeProcessGlobals();		
        initializeGlobals();
        
        BA.LogInfo("** Activity (main) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (this != mostCurrent)
			return;
        processBA.setActivityPaused(false);
        BA.LogInfo("** Activity (main) Resume **");
        processBA.raiseEvent(null, "activity_resume");
        if (android.os.Build.VERSION.SDK_INT >= 11) {
			try {
				android.app.Activity.class.getMethod("invalidateOptionsMenu").invoke(this,(Object[]) null);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
        try {
            if (processBA.subExists("activity_actionbarhomeclick")) {
                Class.forName("android.app.ActionBar").getMethod("setHomeButtonEnabled", boolean.class).invoke(
                    getClass().getMethod("getActionBar").invoke(this), true);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (processBA.runHook("oncreateoptionsmenu", this, new Object[] {menu}))
            return true;
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
            if (android.os.Build.VERSION.SDK_INT >= 11) {
				try {
                    if (bmi.addToBar) {
				        android.view.MenuItem.class.getMethod("setShowAsAction", int.class).invoke(mi, 1);
                    }
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
        
		return true;
	}   
 @Override
 public boolean onOptionsItemSelected(android.view.MenuItem item) {
    if (item.getItemId() == 16908332) {
        processBA.raiseEvent(null, "activity_actionbarhomeclick");
        return true;
    }
    else
        return super.onOptionsItemSelected(item); 
}
@Override
 public boolean onPrepareOptionsMenu(android.view.Menu menu) {
    super.onPrepareOptionsMenu(menu);
    processBA.runHook("onprepareoptionsmenu", this, new Object[] {menu});
    return true;
    
 }
 protected void onStart() {
    super.onStart();
    processBA.runHook("onstart", this, null);
}
 protected void onStop() {
    super.onStop();
    processBA.runHook("onstop", this, null);
}
    public void onWindowFocusChanged(boolean hasFocus) {
       super.onWindowFocusChanged(hasFocus);
       if (processBA.subExists("activity_windowfocuschanged"))
           processBA.raiseEvent2(null, true, "activity_windowfocuschanged", false, hasFocus);
    }
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEventFromUI(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return main.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeydown", this, new Object[] {keyCode, event}))
            return true;
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK &&
					android.os.Build.VERSION.SDK_INT >= 18) {
				HandleKeyDelayed hk = new HandleKeyDelayed();
				hk.kc = keyCode;
				BA.handler.post(hk);
				return true;
			}
			else {
				boolean res = new HandleKeyDelayed().runDirectly(keyCode);
				if (res)
					return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
	private class HandleKeyDelayed implements Runnable {
		int kc;
		public void run() {
			runDirectly(kc);
		}
		public boolean runDirectly(int keyCode) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true) {
                return true;
            }
            else if (keyCode == anywheresoftware.b4a.keywords.constants.KeyCodes.KEYCODE_BACK) {
				finish();
				return true;
			}
            return false;
		}
		
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
        if (processBA.runHook("onkeyup", this, new Object[] {keyCode, event}))
            return true;
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
        super.onNewIntent(intent);
		this.setIntent(intent);
        processBA.runHook("onnewintent", this, new Object[] {intent});
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null)
            return;
        if (this != mostCurrent)
			return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        if (!dontPause)
            BA.LogInfo("** Activity (main) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        else
            BA.LogInfo("** Activity (main) Pause event (activity is not paused). **");
        if (mostCurrent != null)
            processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        if (!dontPause) {
            processBA.setActivityPaused(true);
            mostCurrent = null;
        }

        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        processBA.runHook("onpause", this, null);
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
        processBA.runHook("ondestroy", this, null);
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
        processBA.runHook("onresume", this, null);
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
            main mc = mostCurrent;
			if (mc == null || mc != activity.get())
				return;
			processBA.setActivityPaused(false);
            BA.LogInfo("** Activity (main) Resume **");
            if (mc != mostCurrent)
                return;
		    processBA.raiseEvent(mc._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
        processBA.runHook("onactivityresult", this, new Object[] {requestCode, resultCode});
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}
    public void onRequestPermissionsResult(int requestCode,
        String permissions[], int[] grantResults) {
        for (int i = 0;i < permissions.length;i++) {
            Object[] o = new Object[] {permissions[i], grantResults[i] == 0};
            processBA.raiseEventFromDifferentThread(null,null, 0, "activity_permissionresult", true, o);
        }
            
    }

public anywheresoftware.b4a.keywords.Common __c = null;
public static int _number_effect = 0;
public static int _number_led = 0;
public static int _auto_effect_1 = 0;
public static int _auto_effect_2 = 0;
public static int _auto_effect_3 = 0;
public anywheresoftware.b4a.phone.Phone.PhoneVibrate _viber = null;
public static String _s1 = "";
public static String _s2 = "";
public static String _s3 = "";
public static int _state1 = 0;
public static int _state2 = 0;
public static int _state3 = 0;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper _cvscolors = null;
public anywheresoftware.b4a.objects.drawable.CanvasWrapper _cvsoverlay = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnlcolors = null;
public anywheresoftware.b4a.objects.PanelWrapper _pnloverlay = null;
public anywheresoftware.b4a.objects.EditTextWrapper _etred = null;
public anywheresoftware.b4a.objects.EditTextWrapper _etgreen = null;
public anywheresoftware.b4a.objects.EditTextWrapper _etblue = null;
public anywheresoftware.b4a.objects.ButtonWrapper _btndo = null;
public anywheresoftware.b4a.objects.SocketWrapper.UDPSocket _udps = null;
public anywheresoftware.b4a.objects.SocketWrapper.UDPSocket.UDPPacket _udpp = null;
public static String _shrip = "";
public static String _shrport = "";
public static String _strcmd = "";
public static String _strreceive = "";
public anywheresoftware.b4a.objects.ImageViewWrapper _imgeffect1 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imgeffect2 = null;
public anywheresoftware.b4a.objects.ImageViewWrapper _imgeffect3 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _eteffect1 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _eteffect2 = null;
public anywheresoftware.b4a.objects.EditTextWrapper _eteffect3 = null;
public anywheresoftware.b4a.objects.ButtonWrapper _btnauto = null;
public anywheresoftware.b4a.objects.SeekBarWrapper _seekbarspeed = null;
public anywheresoftware.b4a.objects.LabelWrapper _lblspeed = null;
public anywheresoftware.b4a.objects.EditTextWrapper _etspeed = null;
public anywheresoftware.b4a.objects.ButtonWrapper _btnspeed = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _sp_e1 = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _sp_e2 = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _sp_e3 = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _sp_count = null;
public anywheresoftware.b4a.objects.SpinnerWrapper _sp_effect = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl_e1 = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl_e2 = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl_e3 = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl_count = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl_effect = null;
public com.shaderyan.neo.wifi.fix.starter _starter = null;

public static boolean isAnyActivityVisible() {
    boolean vis = false;
vis = vis | (main.mostCurrent != null);
return vis;}
public static String  _activity_create(boolean _firsttime) throws Exception{
int _i = 0;
 //BA.debugLineNum = 85;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 86;BA.debugLine="Activity.LoadLayout(\"1\")";
mostCurrent._activity.LoadLayout("1",mostCurrent.activityBA);
 //BA.debugLineNum = 87;BA.debugLine="cvsColors.Initialize(pnlColors)";
mostCurrent._cvscolors.Initialize((android.view.View)(mostCurrent._pnlcolors.getObject()));
 //BA.debugLineNum = 88;BA.debugLine="cvsOverlay.Initialize(pnlOverlay)";
mostCurrent._cvsoverlay.Initialize((android.view.View)(mostCurrent._pnloverlay.getObject()));
 //BA.debugLineNum = 92;BA.debugLine="sp_e1.AddAll(Array As String(\"Mode 1\", \"Mode 2\",";
mostCurrent._sp_e1.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Mode 1","Mode 2","Mode 3","Mode 4","Mode 5","Mode 6","Mode 7","Mode 8","Mode 9","Mode 10","Mode 11","Mode 12","Mode 13","Mode 14","Mode 15","Mode 16","Mode 17","Mode 18","Mode 19","Mode 20"}));
 //BA.debugLineNum = 93;BA.debugLine="sp_e1.TextSize=14";
mostCurrent._sp_e1.setTextSize((float) (14));
 //BA.debugLineNum = 95;BA.debugLine="sp_e1.DropdownBackgroundColor=Colors.RGB(136,78,1";
mostCurrent._sp_e1.setDropdownBackgroundColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (136),(int) (78),(int) (160)));
 //BA.debugLineNum = 96;BA.debugLine="sp_e1.DropdownTextColor=Colors.White";
mostCurrent._sp_e1.setDropdownTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 98;BA.debugLine="sp_e2.AddAll(Array As String(\"Mode 1\", \"Mode 2\",";
mostCurrent._sp_e2.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Mode 1","Mode 2","Mode 3","Mode 4","Mode 5","Mode 6","Mode 7","Mode 8","Mode 9","Mode 10","Mode 11","Mode 12","Mode 13","Mode 14","Mode 15","Mode 16","Mode 17","Mode 18","Mode 19","Mode 20"}));
 //BA.debugLineNum = 99;BA.debugLine="sp_e2.TextSize=14";
mostCurrent._sp_e2.setTextSize((float) (14));
 //BA.debugLineNum = 101;BA.debugLine="sp_e2.DropdownBackgroundColor=Colors.RGB(136,78,1";
mostCurrent._sp_e2.setDropdownBackgroundColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (136),(int) (78),(int) (160)));
 //BA.debugLineNum = 102;BA.debugLine="sp_e2.DropdownTextColor=Colors.White";
mostCurrent._sp_e2.setDropdownTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 104;BA.debugLine="sp_e3.AddAll(Array As String(\"Mode 1\", \"Mode 2\",";
mostCurrent._sp_e3.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Mode 1","Mode 2","Mode 3","Mode 4","Mode 5","Mode 6","Mode 7","Mode 8","Mode 9","Mode 10","Mode 11","Mode 12","Mode 13","Mode 14","Mode 15","Mode 16","Mode 17","Mode 18","Mode 19","Mode 20"}));
 //BA.debugLineNum = 105;BA.debugLine="sp_e3.TextSize=14";
mostCurrent._sp_e3.setTextSize((float) (14));
 //BA.debugLineNum = 107;BA.debugLine="sp_e3.DropdownBackgroundColor=Colors.RGB(136,78,1";
mostCurrent._sp_e3.setDropdownBackgroundColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (136),(int) (78),(int) (160)));
 //BA.debugLineNum = 108;BA.debugLine="sp_e3.DropdownTextColor=Colors.White";
mostCurrent._sp_e3.setDropdownTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 110;BA.debugLine="sp_effect.AddAll(Array As String(\"Mode 1\", \"Mode";
mostCurrent._sp_effect.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Mode 1","Mode 2","Mode 3","Mode 4","Mode 5","Mode 6","Mode 7","Mode 8","Mode 9","Mode 10","Mode 11","Mode 12","Mode 13","Mode 14","Mode 15","Mode 16","Mode 17","Mode 18","Mode 19","Mode 20"}));
 //BA.debugLineNum = 111;BA.debugLine="sp_effect.TextSize=14";
mostCurrent._sp_effect.setTextSize((float) (14));
 //BA.debugLineNum = 113;BA.debugLine="sp_effect.DropdownBackgroundColor=Colors.RGB(136,";
mostCurrent._sp_effect.setDropdownBackgroundColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (136),(int) (78),(int) (160)));
 //BA.debugLineNum = 114;BA.debugLine="sp_effect.DropdownTextColor=Colors.White";
mostCurrent._sp_effect.setDropdownTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 127;BA.debugLine="For i = 1 To 101";
{
final int step20 = 1;
final int limit20 = (int) (101);
_i = (int) (1) ;
for (;_i <= limit20 ;_i = _i + step20 ) {
 //BA.debugLineNum = 128;BA.debugLine="sp_count.Add(i)";
mostCurrent._sp_count.Add(BA.NumberToString(_i));
 }
};
 //BA.debugLineNum = 131;BA.debugLine="sp_count.TextSize=14";
mostCurrent._sp_count.setTextSize((float) (14));
 //BA.debugLineNum = 133;BA.debugLine="sp_count.DropdownBackgroundColor=Colors.RGB(136,7";
mostCurrent._sp_count.setDropdownBackgroundColor(anywheresoftware.b4a.keywords.Common.Colors.RGB((int) (136),(int) (78),(int) (160)));
 //BA.debugLineNum = 134;BA.debugLine="sp_count.DropdownTextColor=Colors.White";
mostCurrent._sp_count.setDropdownTextColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 137;BA.debugLine="sp_e1.SelectedIndex = 0";
mostCurrent._sp_e1.setSelectedIndex((int) (0));
 //BA.debugLineNum = 138;BA.debugLine="sp_e2.SelectedIndex = 0";
mostCurrent._sp_e2.setSelectedIndex((int) (0));
 //BA.debugLineNum = 139;BA.debugLine="sp_e3.SelectedIndex = 0";
mostCurrent._sp_e3.setSelectedIndex((int) (0));
 //BA.debugLineNum = 140;BA.debugLine="sp_effect.SelectedIndex = 0";
mostCurrent._sp_effect.setSelectedIndex((int) (0));
 //BA.debugLineNum = 141;BA.debugLine="sp_count.SelectedIndex = 24";
mostCurrent._sp_count.setSelectedIndex((int) (24));
 //BA.debugLineNum = 143;BA.debugLine="End Sub";
return "";
}
public static boolean  _activity_keypress(int _keycode) throws Exception{
 //BA.debugLineNum = 181;BA.debugLine="Sub Activity_KeyPress (KeyCode As Int) As Boolean";
 //BA.debugLineNum = 182;BA.debugLine="If KeyCode = KeyCodes.KEYCODE_BACK Then";
if (_keycode==anywheresoftware.b4a.keywords.Common.KeyCodes.KEYCODE_BACK) { 
 //BA.debugLineNum = 183;BA.debugLine="If Msgbox2(\"Do you want to close?\", \"\", \"Yes\", \"";
if (anywheresoftware.b4a.keywords.Common.Msgbox2(BA.ObjectToCharSequence("Do you want to close?"),BA.ObjectToCharSequence(""),"Yes","Cancel","No",(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null),mostCurrent.activityBA)==anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE) { 
 //BA.debugLineNum = 184;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 }else {
 //BA.debugLineNum = 186;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 };
 };
 //BA.debugLineNum = 189;BA.debugLine="End Sub";
return false;
}
public static String  _btnauto_click() throws Exception{
 //BA.debugLineNum = 221;BA.debugLine="Sub btnAuto_Click";
 //BA.debugLineNum = 232;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 233;BA.debugLine="Try";
try { //BA.debugLineNum = 234;BA.debugLine="S1 = etEffect1.Text";
mostCurrent._s1 = mostCurrent._eteffect1.getText();
 //BA.debugLineNum = 235;BA.debugLine="S2 = etEffect2.Text";
mostCurrent._s2 = mostCurrent._eteffect2.getText();
 //BA.debugLineNum = 236;BA.debugLine="S3 = etEffect3.Text";
mostCurrent._s3 = mostCurrent._eteffect3.getText();
 //BA.debugLineNum = 238;BA.debugLine="strCmd = \"auto,\"&auto_effect_1&\"x\"&S1&\"@\"&auto_e";
mostCurrent._strcmd = "auto,"+BA.NumberToString(_auto_effect_1)+"x"+mostCurrent._s1+"@"+BA.NumberToString(_auto_effect_2)+"y"+mostCurrent._s2+"&"+BA.NumberToString(_auto_effect_3)+"z"+mostCurrent._s3+"#";
 //BA.debugLineNum = 239;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 240;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 } 
       catch (Exception e10) {
			processBA.setLastException(e10); };
 //BA.debugLineNum = 244;BA.debugLine="End Sub";
return "";
}
public static String  _btnconnect_click() throws Exception{
 //BA.debugLineNum = 202;BA.debugLine="Sub btnConnect_Click";
 //BA.debugLineNum = 203;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 205;BA.debugLine="UdpS.Initialize(\"UdpSEvent\",2000,1024)";
mostCurrent._udps.Initialize(processBA,"UdpSEvent",(int) (2000),(int) (1024));
 //BA.debugLineNum = 206;BA.debugLine="ToastMessageShow(\"با موفقیت متصل شد\",True)";
anywheresoftware.b4a.keywords.Common.ToastMessageShow(BA.ObjectToCharSequence("با موفقیت متصل شد"),anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 207;BA.debugLine="End Sub";
return "";
}
public static String  _btndo_click() throws Exception{
 //BA.debugLineNum = 209;BA.debugLine="Sub btnDo_Click";
 //BA.debugLineNum = 210;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 212;BA.debugLine="Try";
try { //BA.debugLineNum = 213;BA.debugLine="strCmd = etRed.Text & \",\"&etGreen.Text&\",\"&etBlu";
mostCurrent._strcmd = mostCurrent._etred.getText()+","+mostCurrent._etgreen.getText()+","+mostCurrent._etblue.getText();
 //BA.debugLineNum = 214;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 215;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 } 
       catch (Exception e7) {
			processBA.setLastException(e7); };
 //BA.debugLineNum = 219;BA.debugLine="End Sub";
return "";
}
public static String  _btnspeed_click() throws Exception{
int _val = 0;
 //BA.debugLineNum = 389;BA.debugLine="Sub btnSpeed_Click";
 //BA.debugLineNum = 390;BA.debugLine="Try";
try { //BA.debugLineNum = 391;BA.debugLine="Dim val As Int";
_val = 0;
 //BA.debugLineNum = 392;BA.debugLine="val = CInt(etSpeed.Text)";
_val = _cint((Object)(mostCurrent._etspeed.getText()));
 //BA.debugLineNum = 393;BA.debugLine="If val<10 Then";
if (_val<10) { 
 //BA.debugLineNum = 394;BA.debugLine="strCmd = \"000\"&CStr(val)";
mostCurrent._strcmd = "000"+_cstr((Object)(_val));
 }else if(_val<100) { 
 //BA.debugLineNum = 396;BA.debugLine="strCmd = \"00\"&CStr(val)";
mostCurrent._strcmd = "00"+_cstr((Object)(_val));
 }else if(_val<1000) { 
 //BA.debugLineNum = 398;BA.debugLine="strCmd = \"0\"&CStr(val)";
mostCurrent._strcmd = "0"+_cstr((Object)(_val));
 }else {
 //BA.debugLineNum = 400;BA.debugLine="strCmd = CStr(val)";
mostCurrent._strcmd = _cstr((Object)(_val));
 };
 //BA.debugLineNum = 403;BA.debugLine="SeekBarSpeed.Value = val";
mostCurrent._seekbarspeed.setValue(_val);
 //BA.debugLineNum = 404;BA.debugLine="lblSpeed.Text = val";
mostCurrent._lblspeed.setText(BA.ObjectToCharSequence(_val));
 //BA.debugLineNum = 406;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 407;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 } 
       catch (Exception e18) {
			processBA.setLastException(e18); };
 //BA.debugLineNum = 410;BA.debugLine="End Sub";
return "";
}
public static int  _cint(Object _o) throws Exception{
 //BA.debugLineNum = 346;BA.debugLine="Sub CInt(o As Object) As Int";
 //BA.debugLineNum = 347;BA.debugLine="Return Floor(o)";
if (true) return (int) (anywheresoftware.b4a.keywords.Common.Floor((double)(BA.ObjectToNumber(_o))));
 //BA.debugLineNum = 348;BA.debugLine="End Sub";
return 0;
}
public static long  _clng(Object _o) throws Exception{
 //BA.debugLineNum = 350;BA.debugLine="Sub CLng(o As Object) As Long";
 //BA.debugLineNum = 351;BA.debugLine="Return Floor(o)";
if (true) return (long) (anywheresoftware.b4a.keywords.Common.Floor((double)(BA.ObjectToNumber(_o))));
 //BA.debugLineNum = 352;BA.debugLine="End Sub";
return 0L;
}
public static String  _cstr(Object _o) throws Exception{
 //BA.debugLineNum = 342;BA.debugLine="Sub CStr(o As Object) As String";
 //BA.debugLineNum = 343;BA.debugLine="Return \"\" & o";
if (true) return ""+BA.ObjectToString(_o);
 //BA.debugLineNum = 344;BA.debugLine="End Sub";
return "";
}
public static int[]  _getargb(int _color) throws Exception{
int[] _res = null;
 //BA.debugLineNum = 192;BA.debugLine="Sub GetARGB(Color As Int) As Int()";
 //BA.debugLineNum = 193;BA.debugLine="Dim res(4) As Int";
_res = new int[(int) (4)];
;
 //BA.debugLineNum = 194;BA.debugLine="res(0) = Bit.UnsignedShiftRight(Bit.And(Color, 0x";
_res[(int) (0)] = anywheresoftware.b4a.keywords.Common.Bit.UnsignedShiftRight(anywheresoftware.b4a.keywords.Common.Bit.And(_color,(int) (0xff000000)),(int) (24));
 //BA.debugLineNum = 195;BA.debugLine="res(1) = Bit.UnsignedShiftRight(Bit.And(Color, 0x";
_res[(int) (1)] = anywheresoftware.b4a.keywords.Common.Bit.UnsignedShiftRight(anywheresoftware.b4a.keywords.Common.Bit.And(_color,(int) (0xff0000)),(int) (16));
 //BA.debugLineNum = 196;BA.debugLine="res(2) = Bit.UnsignedShiftRight(Bit.And(Color, 0x";
_res[(int) (2)] = anywheresoftware.b4a.keywords.Common.Bit.UnsignedShiftRight(anywheresoftware.b4a.keywords.Common.Bit.And(_color,(int) (0xff00)),(int) (8));
 //BA.debugLineNum = 197;BA.debugLine="res(3) = Bit.And(Color, 0xff)";
_res[(int) (3)] = anywheresoftware.b4a.keywords.Common.Bit.And(_color,(int) (0xff));
 //BA.debugLineNum = 198;BA.debugLine="Return res";
if (true) return _res;
 //BA.debugLineNum = 199;BA.debugLine="End Sub";
return null;
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 25;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 27;BA.debugLine="Dim viber As PhoneVibrate";
mostCurrent._viber = new anywheresoftware.b4a.phone.Phone.PhoneVibrate();
 //BA.debugLineNum = 29;BA.debugLine="Dim S1 As String";
mostCurrent._s1 = "";
 //BA.debugLineNum = 30;BA.debugLine="Dim S2 As String";
mostCurrent._s2 = "";
 //BA.debugLineNum = 31;BA.debugLine="Dim S3 As String";
mostCurrent._s3 = "";
 //BA.debugLineNum = 33;BA.debugLine="Dim state1 As Int";
_state1 = 0;
 //BA.debugLineNum = 34;BA.debugLine="Dim state2 As Int";
_state2 = 0;
 //BA.debugLineNum = 35;BA.debugLine="Dim state3 As Int";
_state3 = 0;
 //BA.debugLineNum = 38;BA.debugLine="Private cvsColors As Canvas";
mostCurrent._cvscolors = new anywheresoftware.b4a.objects.drawable.CanvasWrapper();
 //BA.debugLineNum = 39;BA.debugLine="Private cvsOverlay As Canvas";
mostCurrent._cvsoverlay = new anywheresoftware.b4a.objects.drawable.CanvasWrapper();
 //BA.debugLineNum = 40;BA.debugLine="Private pnlColors As Panel";
mostCurrent._pnlcolors = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 41;BA.debugLine="Private pnlOverlay As Panel";
mostCurrent._pnloverlay = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 42;BA.debugLine="Private etRed As EditText";
mostCurrent._etred = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 43;BA.debugLine="Private etGreen As EditText";
mostCurrent._etgreen = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 44;BA.debugLine="Private etBlue As EditText";
mostCurrent._etblue = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 45;BA.debugLine="Private btnDo As Button";
mostCurrent._btndo = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 47;BA.debugLine="Public UdpS As UDPSocket";
mostCurrent._udps = new anywheresoftware.b4a.objects.SocketWrapper.UDPSocket();
 //BA.debugLineNum = 48;BA.debugLine="Public UdpP As UDPPacket";
mostCurrent._udpp = new anywheresoftware.b4a.objects.SocketWrapper.UDPSocket.UDPPacket();
 //BA.debugLineNum = 50;BA.debugLine="Public ShrIP, ShrPort As String";
mostCurrent._shrip = "";
mostCurrent._shrport = "";
 //BA.debugLineNum = 52;BA.debugLine="ShrIP = \"192.168.4.1\"";
mostCurrent._shrip = "192.168.4.1";
 //BA.debugLineNum = 53;BA.debugLine="ShrPort = \"2000\"";
mostCurrent._shrport = "2000";
 //BA.debugLineNum = 55;BA.debugLine="Dim strCmd As String";
mostCurrent._strcmd = "";
 //BA.debugLineNum = 56;BA.debugLine="Dim strReceive As String";
mostCurrent._strreceive = "";
 //BA.debugLineNum = 58;BA.debugLine="Private imgeffect1 As ImageView";
mostCurrent._imgeffect1 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 59;BA.debugLine="Private imgEffect2 As ImageView";
mostCurrent._imgeffect2 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 60;BA.debugLine="Private imgEffect3 As ImageView";
mostCurrent._imgeffect3 = new anywheresoftware.b4a.objects.ImageViewWrapper();
 //BA.debugLineNum = 62;BA.debugLine="Private etEffect1 As EditText";
mostCurrent._eteffect1 = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 63;BA.debugLine="Private etEffect2 As EditText";
mostCurrent._eteffect2 = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 64;BA.debugLine="Private etEffect3 As EditText";
mostCurrent._eteffect3 = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 65;BA.debugLine="Private btnAuto As Button";
mostCurrent._btnauto = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 66;BA.debugLine="Private SeekBarSpeed As SeekBar";
mostCurrent._seekbarspeed = new anywheresoftware.b4a.objects.SeekBarWrapper();
 //BA.debugLineNum = 68;BA.debugLine="Private lblSpeed As Label";
mostCurrent._lblspeed = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 69;BA.debugLine="Private etSpeed As EditText";
mostCurrent._etspeed = new anywheresoftware.b4a.objects.EditTextWrapper();
 //BA.debugLineNum = 70;BA.debugLine="Private btnSpeed As Button";
mostCurrent._btnspeed = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 71;BA.debugLine="Private sp_e1 As Spinner";
mostCurrent._sp_e1 = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 72;BA.debugLine="Private sp_e2 As Spinner";
mostCurrent._sp_e2 = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 73;BA.debugLine="Private sp_e3 As Spinner";
mostCurrent._sp_e3 = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 74;BA.debugLine="Private sp_count As Spinner";
mostCurrent._sp_count = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 75;BA.debugLine="Private sp_effect As Spinner";
mostCurrent._sp_effect = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 77;BA.debugLine="Private lbl_e1 As Label";
mostCurrent._lbl_e1 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 78;BA.debugLine="Private lbl_e2 As Label";
mostCurrent._lbl_e2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 79;BA.debugLine="Private lbl_e3 As Label";
mostCurrent._lbl_e3 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 81;BA.debugLine="Private lbl_count As Label";
mostCurrent._lbl_count = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 82;BA.debugLine="Private lbl_effect As Label";
mostCurrent._lbl_effect = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 83;BA.debugLine="End Sub";
return "";
}
public static String  _imgback_click() throws Exception{
int _num = 0;
 //BA.debugLineNum = 354;BA.debugLine="Sub imgBack_Click";
 //BA.debugLineNum = 355;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 357;BA.debugLine="Dim num As Int";
_num = 0;
 //BA.debugLineNum = 358;BA.debugLine="num = number_effect";
_num = _number_effect;
 //BA.debugLineNum = 359;BA.debugLine="num = num - 1";
_num = (int) (_num-1);
 //BA.debugLineNum = 360;BA.debugLine="If (num = 0) Then";
if ((_num==0)) { 
 //BA.debugLineNum = 361;BA.debugLine="num = 1";
_num = (int) (1);
 };
 //BA.debugLineNum = 363;BA.debugLine="number_effect = num";
_number_effect = _num;
 //BA.debugLineNum = 365;BA.debugLine="strCmd = CStr(number_effect)";
mostCurrent._strcmd = _cstr((Object)(_number_effect));
 //BA.debugLineNum = 367;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 368;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 369;BA.debugLine="End Sub";
return "";
}
public static String  _imgeffect1_click() throws Exception{
 //BA.debugLineNum = 294;BA.debugLine="Sub imgeffect1_Click";
 //BA.debugLineNum = 295;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 297;BA.debugLine="number_effect=1";
_number_effect = (int) (1);
 //BA.debugLineNum = 298;BA.debugLine="strCmd = \"1\"";
mostCurrent._strcmd = "1";
 //BA.debugLineNum = 299;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 300;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 301;BA.debugLine="End Sub";
return "";
}
public static String  _imgeffect2_click() throws Exception{
 //BA.debugLineNum = 303;BA.debugLine="Sub imgEffect2_Click";
 //BA.debugLineNum = 304;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 306;BA.debugLine="number_effect=2";
_number_effect = (int) (2);
 //BA.debugLineNum = 307;BA.debugLine="strCmd = \"2\"";
mostCurrent._strcmd = "2";
 //BA.debugLineNum = 308;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 309;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 310;BA.debugLine="End Sub";
return "";
}
public static String  _imgeffect3_click() throws Exception{
 //BA.debugLineNum = 312;BA.debugLine="Sub imgEffect3_Click";
 //BA.debugLineNum = 313;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 315;BA.debugLine="number_effect=3";
_number_effect = (int) (3);
 //BA.debugLineNum = 316;BA.debugLine="strCmd = \"3\"";
mostCurrent._strcmd = "3";
 //BA.debugLineNum = 317;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 318;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 319;BA.debugLine="End Sub";
return "";
}
public static String  _imgforward_click() throws Exception{
int _num = 0;
 //BA.debugLineNum = 371;BA.debugLine="Sub imgForward_Click";
 //BA.debugLineNum = 372;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 374;BA.debugLine="Dim num As Int";
_num = 0;
 //BA.debugLineNum = 375;BA.debugLine="num = number_effect";
_num = _number_effect;
 //BA.debugLineNum = 376;BA.debugLine="num = num + 1";
_num = (int) (_num+1);
 //BA.debugLineNum = 377;BA.debugLine="If (num = 10) Then";
if ((_num==10)) { 
 //BA.debugLineNum = 378;BA.debugLine="num = 9";
_num = (int) (9);
 };
 //BA.debugLineNum = 380;BA.debugLine="number_effect = num";
_number_effect = _num;
 //BA.debugLineNum = 382;BA.debugLine="strCmd = CStr(number_effect)";
mostCurrent._strcmd = _cstr((Object)(_number_effect));
 //BA.debugLineNum = 384;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 385;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 386;BA.debugLine="End Sub";
return "";
}
public static String  _pnlcolors_touch(int _action,float _x,float _y) throws Exception{
float _cx = 0f;
float _cy = 0f;
int _clr = 0;
int[] _argb = null;
 //BA.debugLineNum = 145;BA.debugLine="Sub pnlColors_Touch (Action As Int, X As Float, Y";
 //BA.debugLineNum = 146;BA.debugLine="Try";
try { //BA.debugLineNum = 147;BA.debugLine="Dim cx = pnlColors.Width / 2, cy = pnlColors.Hei";
_cx = (float) (mostCurrent._pnlcolors.getWidth()/(double)2);
_cy = (float) (mostCurrent._pnlcolors.getHeight()/(double)2);
 //BA.debugLineNum = 148;BA.debugLine="If Sqrt(Power(x - cx, 2) + Power(y - cy, 2)) > p";
if (anywheresoftware.b4a.keywords.Common.Sqrt(anywheresoftware.b4a.keywords.Common.Power(_x-_cx,2)+anywheresoftware.b4a.keywords.Common.Power(_y-_cy,2))>mostCurrent._pnlcolors.getWidth()/(double)2) { 
if (true) return "";};
 //BA.debugLineNum = 149;BA.debugLine="Dim clr As Int = cvsColors.Bitmap.GetPixel(X, Y)";
_clr = mostCurrent._cvscolors.getBitmap().GetPixel((int) (_x),(int) (_y));
 //BA.debugLineNum = 155;BA.debugLine="Dim argb() As Int";
_argb = new int[(int) (0)];
;
 //BA.debugLineNum = 156;BA.debugLine="argb = GetARGB(clr)";
_argb = _getargb(_clr);
 //BA.debugLineNum = 163;BA.debugLine="etRed.Text = argb(1)";
mostCurrent._etred.setText(BA.ObjectToCharSequence(_argb[(int) (1)]));
 //BA.debugLineNum = 164;BA.debugLine="etGreen.Text = argb(2)";
mostCurrent._etgreen.setText(BA.ObjectToCharSequence(_argb[(int) (2)]));
 //BA.debugLineNum = 165;BA.debugLine="etBlue.Text = argb(3)";
mostCurrent._etblue.setText(BA.ObjectToCharSequence(_argb[(int) (3)]));
 //BA.debugLineNum = 167;BA.debugLine="strCmd = argb(1) & \",\"&argb(2)&\",\"&argb(3)";
mostCurrent._strcmd = BA.NumberToString(_argb[(int) (1)])+","+BA.NumberToString(_argb[(int) (2)])+","+BA.NumberToString(_argb[(int) (3)]);
 //BA.debugLineNum = 169;BA.debugLine="cvsOverlay.DrawColor(Colors.Transparent)";
mostCurrent._cvsoverlay.DrawColor(anywheresoftware.b4a.keywords.Common.Colors.Transparent);
 //BA.debugLineNum = 170;BA.debugLine="cvsOverlay.DrawCircle(X, Y, 20dip, Colors.Black,";
mostCurrent._cvsoverlay.DrawCircle(_x,_y,(float) (anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (20))),anywheresoftware.b4a.keywords.Common.Colors.Black,anywheresoftware.b4a.keywords.Common.False,(float) (anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (3))));
 //BA.debugLineNum = 171;BA.debugLine="pnlOverlay.Invalidate";
mostCurrent._pnloverlay.Invalidate();
 //BA.debugLineNum = 173;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 174;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 } 
       catch (Exception e17) {
			processBA.setLastException(e17); //BA.debugLineNum = 176;BA.debugLine="Log(\"error\")";
anywheresoftware.b4a.keywords.Common.LogImpl("4196639","error",0);
 };
 //BA.debugLineNum = 179;BA.debugLine="End Sub";
return "";
}

public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main._process_globals();
starter._process_globals();
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 15;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 16;BA.debugLine="Dim number_effect As Int:number_effect=1";
_number_effect = 0;
 //BA.debugLineNum = 16;BA.debugLine="Dim number_effect As Int:number_effect=1";
_number_effect = (int) (1);
 //BA.debugLineNum = 17;BA.debugLine="Dim number_led As Int:number_led=16";
_number_led = 0;
 //BA.debugLineNum = 17;BA.debugLine="Dim number_led As Int:number_led=16";
_number_led = (int) (16);
 //BA.debugLineNum = 19;BA.debugLine="Dim auto_effect_1 As Int:auto_effect_1 = 1";
_auto_effect_1 = 0;
 //BA.debugLineNum = 19;BA.debugLine="Dim auto_effect_1 As Int:auto_effect_1 = 1";
_auto_effect_1 = (int) (1);
 //BA.debugLineNum = 20;BA.debugLine="Dim auto_effect_2 As Int:auto_effect_2 = 1";
_auto_effect_2 = 0;
 //BA.debugLineNum = 20;BA.debugLine="Dim auto_effect_2 As Int:auto_effect_2 = 1";
_auto_effect_2 = (int) (1);
 //BA.debugLineNum = 21;BA.debugLine="Dim auto_effect_3 As Int:auto_effect_3 = 1";
_auto_effect_3 = 0;
 //BA.debugLineNum = 21;BA.debugLine="Dim auto_effect_3 As Int:auto_effect_3 = 1";
_auto_effect_3 = (int) (1);
 //BA.debugLineNum = 23;BA.debugLine="End Sub";
return "";
}
public static String  _seekbarspeed_valuechanged(int _value,boolean _userchanged) throws Exception{
 //BA.debugLineNum = 321;BA.debugLine="Sub SeekBarSpeed_ValueChanged (Value As Int, UserC";
 //BA.debugLineNum = 322;BA.debugLine="Try";
try { //BA.debugLineNum = 323;BA.debugLine="If Value<10 Then";
if (_value<10) { 
 //BA.debugLineNum = 324;BA.debugLine="strCmd = \"000\"&CStr(Value)";
mostCurrent._strcmd = "000"+_cstr((Object)(_value));
 }else if(_value<100) { 
 //BA.debugLineNum = 326;BA.debugLine="strCmd = \"00\"&CStr(Value)";
mostCurrent._strcmd = "00"+_cstr((Object)(_value));
 }else if(_value<1000) { 
 //BA.debugLineNum = 328;BA.debugLine="strCmd = \"0\"&CStr(Value)";
mostCurrent._strcmd = "0"+_cstr((Object)(_value));
 }else {
 //BA.debugLineNum = 330;BA.debugLine="strCmd = CStr(Value)";
mostCurrent._strcmd = _cstr((Object)(_value));
 };
 //BA.debugLineNum = 333;BA.debugLine="lblSpeed.Text = CStr(Value)";
mostCurrent._lblspeed.setText(BA.ObjectToCharSequence(_cstr((Object)(_value))));
 //BA.debugLineNum = 334;BA.debugLine="etSpeed.Text = CStr(Value)";
mostCurrent._etspeed.setText(BA.ObjectToCharSequence(_cstr((Object)(_value))));
 //BA.debugLineNum = 335;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 336;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 } 
       catch (Exception e16) {
			processBA.setLastException(e16); };
 //BA.debugLineNum = 340;BA.debugLine="End Sub";
return "";
}
public static String  _sp_count_itemclick(int _position,Object _value) throws Exception{
String _count = "";
 //BA.debugLineNum = 459;BA.debugLine="Sub sp_count_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 460;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 462;BA.debugLine="Dim count As String";
_count = "";
 //BA.debugLineNum = 463;BA.debugLine="count = sp_count.GetItem (Position)";
_count = mostCurrent._sp_count.GetItem(_position);
 //BA.debugLineNum = 464;BA.debugLine="lbl_count.Text = count";
mostCurrent._lbl_count.setText(BA.ObjectToCharSequence(_count));
 //BA.debugLineNum = 466;BA.debugLine="number_led = CInt(count)";
_number_led = _cint((Object)(_count));
 //BA.debugLineNum = 468;BA.debugLine="strCmd = \"count,\"&CStr(number_led)";
mostCurrent._strcmd = "count,"+_cstr((Object)(_number_led));
 //BA.debugLineNum = 469;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 470;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 471;BA.debugLine="End Sub";
return "";
}
public static String  _sp_e1_itemclick(int _position,Object _value) throws Exception{
String _effect1 = "";
String _effect_number_1 = "";
 //BA.debugLineNum = 414;BA.debugLine="Sub sp_e1_ItemClick (Position As Int, Value As Obj";
 //BA.debugLineNum = 415;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 417;BA.debugLine="Dim effect1 As String";
_effect1 = "";
 //BA.debugLineNum = 418;BA.debugLine="effect1 = sp_e1.GetItem(Position)";
_effect1 = mostCurrent._sp_e1.GetItem(_position);
 //BA.debugLineNum = 419;BA.debugLine="lbl_e1.Text = effect1";
mostCurrent._lbl_e1.setText(BA.ObjectToCharSequence(_effect1));
 //BA.debugLineNum = 421;BA.debugLine="Dim effect_number_1 As String";
_effect_number_1 = "";
 //BA.debugLineNum = 422;BA.debugLine="effect_number_1 = effect1.SubString(4)";
_effect_number_1 = _effect1.substring((int) (4));
 //BA.debugLineNum = 425;BA.debugLine="auto_effect_1 = CInt(effect_number_1)";
_auto_effect_1 = _cint((Object)(_effect_number_1));
 //BA.debugLineNum = 427;BA.debugLine="End Sub";
return "";
}
public static String  _sp_e2_itemclick(int _position,Object _value) throws Exception{
String _effect2 = "";
String _effect_number_2 = "";
 //BA.debugLineNum = 429;BA.debugLine="Sub sp_e2_ItemClick (Position As Int, Value As Obj";
 //BA.debugLineNum = 430;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 432;BA.debugLine="Dim effect2 As String";
_effect2 = "";
 //BA.debugLineNum = 433;BA.debugLine="effect2 = sp_e2.GetItem(Position)";
_effect2 = mostCurrent._sp_e2.GetItem(_position);
 //BA.debugLineNum = 434;BA.debugLine="lbl_e2.Text = effect2";
mostCurrent._lbl_e2.setText(BA.ObjectToCharSequence(_effect2));
 //BA.debugLineNum = 436;BA.debugLine="Dim effect_number_2 As String";
_effect_number_2 = "";
 //BA.debugLineNum = 437;BA.debugLine="effect_number_2 = effect2.SubString(4)";
_effect_number_2 = _effect2.substring((int) (4));
 //BA.debugLineNum = 440;BA.debugLine="auto_effect_2 = CInt(effect_number_2)";
_auto_effect_2 = _cint((Object)(_effect_number_2));
 //BA.debugLineNum = 442;BA.debugLine="End Sub";
return "";
}
public static String  _sp_e3_itemclick(int _position,Object _value) throws Exception{
String _effect3 = "";
String _effect_number_3 = "";
 //BA.debugLineNum = 444;BA.debugLine="Sub sp_e3_ItemClick (Position As Int, Value As Obj";
 //BA.debugLineNum = 445;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 447;BA.debugLine="Dim effect3 As String";
_effect3 = "";
 //BA.debugLineNum = 448;BA.debugLine="effect3 = sp_e3.GetItem(Position)";
_effect3 = mostCurrent._sp_e3.GetItem(_position);
 //BA.debugLineNum = 449;BA.debugLine="lbl_e3.Text = effect3";
mostCurrent._lbl_e3.setText(BA.ObjectToCharSequence(_effect3));
 //BA.debugLineNum = 451;BA.debugLine="Dim effect_number_3 As String";
_effect_number_3 = "";
 //BA.debugLineNum = 452;BA.debugLine="effect_number_3 = effect3.SubString(4)";
_effect_number_3 = _effect3.substring((int) (4));
 //BA.debugLineNum = 455;BA.debugLine="auto_effect_3 = CInt(effect_number_3)";
_auto_effect_3 = _cint((Object)(_effect_number_3));
 //BA.debugLineNum = 457;BA.debugLine="End Sub";
return "";
}
public static String  _sp_effect_itemclick(int _position,Object _value) throws Exception{
String _effect = "";
String _effect_number = "";
 //BA.debugLineNum = 473;BA.debugLine="Sub sp_effect_ItemClick (Position As Int, Value As";
 //BA.debugLineNum = 474;BA.debugLine="viber.Vibrate(50)";
mostCurrent._viber.Vibrate(processBA,(long) (50));
 //BA.debugLineNum = 476;BA.debugLine="Dim effect As String";
_effect = "";
 //BA.debugLineNum = 477;BA.debugLine="effect = sp_effect.GetItem(Position)";
_effect = mostCurrent._sp_effect.GetItem(_position);
 //BA.debugLineNum = 478;BA.debugLine="lbl_effect.Text = effect";
mostCurrent._lbl_effect.setText(BA.ObjectToCharSequence(_effect));
 //BA.debugLineNum = 480;BA.debugLine="Dim effect_number As String";
_effect_number = "";
 //BA.debugLineNum = 481;BA.debugLine="effect_number = effect.SubString(4)";
_effect_number = _effect.substring((int) (4));
 //BA.debugLineNum = 484;BA.debugLine="number_effect = CInt(effect_number)";
_number_effect = _cint((Object)(_effect_number));
 //BA.debugLineNum = 486;BA.debugLine="strCmd = number_effect";
mostCurrent._strcmd = BA.NumberToString(_number_effect);
 //BA.debugLineNum = 487;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP,S";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 488;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 //BA.debugLineNum = 489;BA.debugLine="End Sub";
return "";
}
public static String  _udpsevent_packetarrived(anywheresoftware.b4a.objects.SocketWrapper.UDPSocket.UDPPacket _packet) throws Exception{
String _str = "";
 //BA.debugLineNum = 246;BA.debugLine="Sub UdpSEvent_PacketArrived (Packet As UDPPacket)";
 //BA.debugLineNum = 247;BA.debugLine="strReceive = BytesToString(Packet.Data, Packet.Of";
mostCurrent._strreceive = anywheresoftware.b4a.keywords.Common.BytesToString(_packet.getData(),_packet.getOffset(),_packet.getLength(),"ASCII");
 //BA.debugLineNum = 249;BA.debugLine="Dim str As String";
_str = "";
 //BA.debugLineNum = 250;BA.debugLine="str = BytesToString(Packet.Data, Packet.Offset,Pa";
_str = anywheresoftware.b4a.keywords.Common.BytesToString(_packet.getData(),_packet.getOffset(),_packet.getLength(),"ASCII");
 //BA.debugLineNum = 252;BA.debugLine="If (str.CharAt(0) = \"1\" And str.CharAt(1) = \"0\" A";
if ((_str.charAt((int) (0))==BA.ObjectToChar("1") && _str.charAt((int) (1))==BA.ObjectToChar("0") && _str.charAt((int) (2))==BA.ObjectToChar("0"))) { 
 //BA.debugLineNum = 253;BA.debugLine="state1 = CInt(str) - 100000";
_state1 = (int) (_cint((Object)(_str))-100000);
 //BA.debugLineNum = 254;BA.debugLine="If (state1 = CInt(S1)) Then";
if ((_state1==_cint((Object)(mostCurrent._s1)))) { 
 //BA.debugLineNum = 255;BA.debugLine="strCmd = \"st2\"";
mostCurrent._strcmd = "st2";
 //BA.debugLineNum = 256;BA.debugLine="Log(state1)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589834",BA.NumberToString(_state1),0);
 //BA.debugLineNum = 257;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 258;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 }else {
 //BA.debugLineNum = 260;BA.debugLine="strCmd = \"st1\"";
mostCurrent._strcmd = "st1";
 //BA.debugLineNum = 261;BA.debugLine="Log(state1)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589839",BA.NumberToString(_state1),0);
 //BA.debugLineNum = 262;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 263;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 };
 }else if((_str.charAt((int) (0))==BA.ObjectToChar("2") && _str.charAt((int) (1))==BA.ObjectToChar("0") && _str.charAt((int) (2))==BA.ObjectToChar("0"))) { 
 //BA.debugLineNum = 266;BA.debugLine="state2 = CInt(str) - 200000";
_state2 = (int) (_cint((Object)(_str))-200000);
 //BA.debugLineNum = 267;BA.debugLine="If (state2 = CInt(S2)) Then";
if ((_state2==_cint((Object)(mostCurrent._s2)))) { 
 //BA.debugLineNum = 268;BA.debugLine="strCmd = \"st3\"";
mostCurrent._strcmd = "st3";
 //BA.debugLineNum = 269;BA.debugLine="Log(state2)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589847",BA.NumberToString(_state2),0);
 //BA.debugLineNum = 270;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 271;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 }else {
 //BA.debugLineNum = 273;BA.debugLine="strCmd = \"st2\"";
mostCurrent._strcmd = "st2";
 //BA.debugLineNum = 274;BA.debugLine="Log(state2)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589852",BA.NumberToString(_state2),0);
 //BA.debugLineNum = 275;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 276;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 };
 }else if((_str.charAt((int) (0))==BA.ObjectToChar("3") && _str.charAt((int) (1))==BA.ObjectToChar("0") && _str.charAt((int) (2))==BA.ObjectToChar("0"))) { 
 //BA.debugLineNum = 279;BA.debugLine="state3 = CInt(str) - 300000";
_state3 = (int) (_cint((Object)(_str))-300000);
 //BA.debugLineNum = 280;BA.debugLine="If (state3 = CInt(S3)) Then";
if ((_state3==_cint((Object)(mostCurrent._s3)))) { 
 //BA.debugLineNum = 281;BA.debugLine="strCmd = \"st4\"";
mostCurrent._strcmd = "st4";
 //BA.debugLineNum = 282;BA.debugLine="Log(state3)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589860",BA.NumberToString(_state3),0);
 //BA.debugLineNum = 283;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 284;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 }else {
 //BA.debugLineNum = 286;BA.debugLine="strCmd = \"st3\"";
mostCurrent._strcmd = "st3";
 //BA.debugLineNum = 287;BA.debugLine="Log(state3)";
anywheresoftware.b4a.keywords.Common.LogImpl("4589865",BA.NumberToString(_state3),0);
 //BA.debugLineNum = 288;BA.debugLine="UdpP.Initialize(strCmd.GetBytes(\"ASCII\"), ShrIP";
mostCurrent._udpp.Initialize(mostCurrent._strcmd.getBytes("ASCII"),mostCurrent._shrip,(int)(Double.parseDouble(mostCurrent._shrport)));
 //BA.debugLineNum = 289;BA.debugLine="UdpS.Send(UdpP)";
mostCurrent._udps.Send(mostCurrent._udpp);
 };
 };
 //BA.debugLineNum = 292;BA.debugLine="End Sub";
return "";
}
}
