package dbcheck.keymon.lat;


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

public class subs {
private static subs mostCurrent = new subs();
public static Object getObject() {
    throw new RuntimeException("Code module does not support this method.");
}
 public anywheresoftware.b4a.keywords.Common __c = null;
public static anywheresoftware.b4a.objects.StringUtils _su = null;
public dbcheck.keymon.lat.main _main = null;
public dbcheck.keymon.lat.starter _starter = null;
public dbcheck.keymon.lat.b4xpages _b4xpages = null;
public dbcheck.keymon.lat.b4xcollections _b4xcollections = null;
public dbcheck.keymon.lat.httputils2service _httputils2service = null;
public static String  _centraedittext(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.EditTextWrapper _elemento,int _anchoelementosuperior) throws Exception{
 //BA.debugLineNum = 103;BA.debugLine="Sub centraEditText(elemento As EditText, anchoElem";
 //BA.debugLineNum = 104;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
 //BA.debugLineNum = 105;BA.debugLine="End Sub";
return "";
}
public static String  _centraetiqueta(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.LabelWrapper _elemento,int _anchoelementosuperior) throws Exception{
 //BA.debugLineNum = 94;BA.debugLine="Sub centraEtiqueta(elemento As Label, anchoElement";
 //BA.debugLineNum = 95;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
 //BA.debugLineNum = 96;BA.debugLine="End Sub";
return "";
}
public static String  _centrapanel(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _elemento,int _anchoelementosuperior) throws Exception{
 //BA.debugLineNum = 99;BA.debugLine="Sub centraPanel(elemento As Panel, anchoElementoSu";
 //BA.debugLineNum = 100;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
 //BA.debugLineNum = 101;BA.debugLine="End Sub";
return "";
}
public static String  _centraprogressbar(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.ProgressBarWrapper _elemento,int _anchoelementosuperior) throws Exception{
 //BA.debugLineNum = 108;BA.debugLine="Sub centraProgressBar(elemento As ProgressBar, anc";
 //BA.debugLineNum = 109;BA.debugLine="elemento.Left = Round(anchoElementoSuperior/2)-(e";
_elemento.setLeft((int) (anywheresoftware.b4a.keywords.Common.Round(_anchoelementosuperior/(double)2)-(_elemento.getWidth()/(double)2)));
 //BA.debugLineNum = 110;BA.debugLine="End Sub";
return "";
}
public static String  _damediasemana(anywheresoftware.b4a.BA _ba) throws Exception{
String _ds = "";
 //BA.debugLineNum = 122;BA.debugLine="Sub dameDiaSemana As String 'ignore";
 //BA.debugLineNum = 123;BA.debugLine="Private ds As String = DateTime.GetDayOfWeek(Date";
_ds = BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetDayOfWeek(anywheresoftware.b4a.keywords.Common.DateTime.getNow()));
 //BA.debugLineNum = 124;BA.debugLine="If ds = \"1\" Then";
if ((_ds).equals("1")) { 
 //BA.debugLineNum = 125;BA.debugLine="ds = \"DOMINGO\"";
_ds = "DOMINGO";
 }else if((_ds).equals("2")) { 
 //BA.debugLineNum = 127;BA.debugLine="ds = \"LUNES\"";
_ds = "LUNES";
 }else if((_ds).equals("3")) { 
 //BA.debugLineNum = 129;BA.debugLine="ds = \"MARTES\"";
_ds = "MARTES";
 }else if((_ds).equals("4")) { 
 //BA.debugLineNum = 131;BA.debugLine="ds = \"MIERCOLES\"";
_ds = "MIERCOLES";
 }else if((_ds).equals("5")) { 
 //BA.debugLineNum = 133;BA.debugLine="ds = \"JUEVES\"";
_ds = "JUEVES";
 }else if((_ds).equals("6")) { 
 //BA.debugLineNum = 135;BA.debugLine="ds = \"VIERNES\"";
_ds = "VIERNES";
 }else {
 //BA.debugLineNum = 137;BA.debugLine="ds = \"SABADO\"";
_ds = "SABADO";
 };
 //BA.debugLineNum = 139;BA.debugLine="Return ds";
if (true) return _ds;
 //BA.debugLineNum = 140;BA.debugLine="End Sub";
return "";
}
public static String  _fechainiciohoy(anywheresoftware.b4a.BA _ba) throws Exception{
String _origformat = "";
String _h = "";
 //BA.debugLineNum = 21;BA.debugLine="Sub fechaInicioHoy As String 'ignore";
 //BA.debugLineNum = 22;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
 //BA.debugLineNum = 23;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
 //BA.debugLineNum = 24;BA.debugLine="Private h As String = DateTime.Date(DateTime.Now";
_h = anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow())+"000000";
 //BA.debugLineNum = 25;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
 //BA.debugLineNum = 27;BA.debugLine="Return h";
if (true) return _h;
 //BA.debugLineNum = 28;BA.debugLine="End Sub";
return "";
}
public static String  _fechakmt(anywheresoftware.b4a.BA _ba,String _fecha) throws Exception{
String _origformat = "";
String _nuevafecha = "";
 //BA.debugLineNum = 10;BA.debugLine="Sub fechaKMT(fecha As String) As String 'ignore";
 //BA.debugLineNum = 12;BA.debugLine="Dim OrigFormat As String = DateTime.DateFormat  '";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
 //BA.debugLineNum = 13;BA.debugLine="DateTime.DateFormat=\"yyMMddHHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMddHHmmss");
 //BA.debugLineNum = 14;BA.debugLine="Dim nuevaFecha As String=DateTime.Date(fecha)";
_nuevafecha = anywheresoftware.b4a.keywords.Common.DateTime.Date((long)(Double.parseDouble(_fecha)));
 //BA.debugLineNum = 15;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig d";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
 //BA.debugLineNum = 17;BA.debugLine="Return nuevaFecha";
if (true) return _nuevafecha;
 //BA.debugLineNum = 18;BA.debugLine="End Sub";
return "";
}
public static long  _fechakmt2ticks(anywheresoftware.b4a.BA _ba,String _fkmt) throws Exception{
String _partefecha = "";
String _partehora = "";
String _origformat = "";
long _ticks = 0L;
 //BA.debugLineNum = 56;BA.debugLine="Sub fechaKMT2Ticks(fKMT As String) As Long 'ignore";
 //BA.debugLineNum = 57;BA.debugLine="Try";
try { //BA.debugLineNum = 58;BA.debugLine="If fKMT.Length = 12 Then";
if (_fkmt.length()==12) { 
 //BA.debugLineNum = 59;BA.debugLine="Private parteFecha As String = fKMT.SubString2(";
_partefecha = _fkmt.substring((int) (0),(int) (6));
 //BA.debugLineNum = 60;BA.debugLine="Private parteHora As String = fKMT.SubString(6)";
_partehora = _fkmt.substring((int) (6));
 //BA.debugLineNum = 61;BA.debugLine="Private OrigFormat As String = DateTime.DateFor";
_origformat = anywheresoftware.b4a.keywords.Common.DateTime.getDateFormat();
 //BA.debugLineNum = 62;BA.debugLine="DateTime.DateFormat=\"yyMMdd\"";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat("yyMMdd");
 //BA.debugLineNum = 63;BA.debugLine="DateTime.TimeFormat=\"HHmmss\"";
anywheresoftware.b4a.keywords.Common.DateTime.setTimeFormat("HHmmss");
 //BA.debugLineNum = 64;BA.debugLine="Private ticks As Long = DateTime.DateTimeParse(";
_ticks = anywheresoftware.b4a.keywords.Common.DateTime.DateTimeParse(_partefecha,_partehora);
 //BA.debugLineNum = 66;BA.debugLine="DateTime.DateFormat=OrigFormat  'return to orig";
anywheresoftware.b4a.keywords.Common.DateTime.setDateFormat(_origformat);
 //BA.debugLineNum = 67;BA.debugLine="Return ticks";
if (true) return _ticks;
 }else {
 //BA.debugLineNum = 69;BA.debugLine="Log(\"Formato de fecha incorrecto, debe de ser '";
anywheresoftware.b4a.keywords.Common.LogImpl("116842765","Formato de fecha incorrecto, debe de ser 'yyMMddHHmmss', no '"+_fkmt+"' largo="+BA.NumberToString(_fkmt.length()),0);
 //BA.debugLineNum = 70;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 } 
       catch (Exception e16) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e16); //BA.debugLineNum = 73;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("116842769",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 //BA.debugLineNum = 75;BA.debugLine="Return 0";
if (true) return (long) (0);
 };
 //BA.debugLineNum = 77;BA.debugLine="End Sub";
return 0L;
}
public static boolean  _masdexxmins(anywheresoftware.b4a.BA _ba,int _hora,int _mins) throws Exception{
 //BA.debugLineNum = 31;BA.debugLine="Sub masDeXXMins(hora As Int, mins As Int) As Boole";
 //BA.debugLineNum = 32;BA.debugLine="If (hora + mins * DateTime.TicksPerMinute) < Date";
if ((_hora+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute)<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
 //BA.debugLineNum = 33;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
 //BA.debugLineNum = 35;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
 //BA.debugLineNum = 37;BA.debugLine="End Sub";
return false;
}
public static boolean  _masdexxminskmt(anywheresoftware.b4a.BA _ba,String _hora,int _mins) throws Exception{
 //BA.debugLineNum = 40;BA.debugLine="Sub masDeXXMinsKMT(hora As String, mins As Int) As";
 //BA.debugLineNum = 41;BA.debugLine="Try";
try { //BA.debugLineNum = 43;BA.debugLine="If fechaKMT2Ticks(hora) + mins * DateTime.TicksP";
if (_fechakmt2ticks(_ba,_hora)+_mins*anywheresoftware.b4a.keywords.Common.DateTime.TicksPerMinute<anywheresoftware.b4a.keywords.Common.DateTime.getNow()) { 
 //BA.debugLineNum = 45;BA.debugLine="Return True";
if (true) return anywheresoftware.b4a.keywords.Common.True;
 }else {
 //BA.debugLineNum = 48;BA.debugLine="Return False";
if (true) return anywheresoftware.b4a.keywords.Common.False;
 };
 } 
       catch (Exception e8) {
			(_ba.processBA == null ? _ba : _ba.processBA).setLastException(e8); //BA.debugLineNum = 51;BA.debugLine="Log(LastException)";
anywheresoftware.b4a.keywords.Common.LogImpl("116187403",BA.ObjectToString(anywheresoftware.b4a.keywords.Common.LastException(_ba)),0);
 };
 //BA.debugLineNum = 53;BA.debugLine="End Sub";
return false;
}
public static String  _panelanchoalto(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _p,int _w,int _h) throws Exception{
 //BA.debugLineNum = 113;BA.debugLine="Sub panelAnchoAlto(p As Panel, w As Int, h As Int)";
 //BA.debugLineNum = 115;BA.debugLine="p.Top = 0";
_p.setTop((int) (0));
 //BA.debugLineNum = 116;BA.debugLine="p.Left = 0";
_p.setLeft((int) (0));
 //BA.debugLineNum = 117;BA.debugLine="p.Width = w";
_p.setWidth(_w);
 //BA.debugLineNum = 118;BA.debugLine="p.Height = h";
_p.setHeight(_h);
 //BA.debugLineNum = 119;BA.debugLine="End Sub";
return "";
}
public static String  _paneloculto(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _panel) throws Exception{
 //BA.debugLineNum = 88;BA.debugLine="Sub panelOculto(panel As Panel) 'ignore";
 //BA.debugLineNum = 89;BA.debugLine="panel.SendToBack";
_panel.SendToBack();
 //BA.debugLineNum = 90;BA.debugLine="panel.Visible = False";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 91;BA.debugLine="End Sub";
return "";
}
public static String  _panelvisible(anywheresoftware.b4a.BA _ba,anywheresoftware.b4a.objects.PanelWrapper _panel,int _top,int _left) throws Exception{
 //BA.debugLineNum = 80;BA.debugLine="Sub panelVisible(panel As Panel, top As Int, left";
 //BA.debugLineNum = 81;BA.debugLine="panel.BringToFront";
_panel.BringToFront();
 //BA.debugLineNum = 82;BA.debugLine="panel.Visible = True";
_panel.setVisible(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 83;BA.debugLine="panel.Top = top";
_panel.setTop(_top);
 //BA.debugLineNum = 84;BA.debugLine="panel.Left = left";
_panel.setLeft(_left);
 //BA.debugLineNum = 85;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 3;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 6;BA.debugLine="Private su As StringUtils 		'Usa la libreria Stri";
_su = new anywheresoftware.b4a.objects.StringUtils();
 //BA.debugLineNum = 7;BA.debugLine="End Sub";
return "";
}
}
