Example #1
0
 public static String _ioioconnect() throws Exception {
   // BA.debugLineNum = 49;BA.debugLine="Sub IOIOConnect";
   // BA.debugLineNum = 50;BA.debugLine="Try";
   try { // BA.debugLineNum = 51;BA.debugLine="YOYO.Initialize";
     _yoyo.Initialize();
     // BA.debugLineNum = 52;BA.debugLine="YOYO.WaitForConnect";
     _yoyo.WaitForConnect();
     // BA.debugLineNum = 53;BA.debugLine="pin33_SensorFuerza= YOYO.OpenAnalogInput(33)";
     _pin33_sensorfuerza.setObject((ioio.lib.api.AnalogInput) (_yoyo.OpenAnalogInput((int) (33))));
     // BA.debugLineNum = 54;BA.debugLine="pin11_Zumbador= YOYO.OpenPwmOutput(11,pin11_Zumb";
     _pin11_zumbador.setObject(
         (ioio.lib.api.PwmOutput)
             (_yoyo.OpenPwmOutput((int) (11), _pin11_zumbador.OP_NORMAL, (int) (2000))));
   } catch (Exception e26) {
     processBA.setLastException(
         e26); // BA.debugLineNum = 56;BA.debugLine="Log(\"YOYO Exception: \"&
               // LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "YOYO Exception: "
             + anywheresoftware.b4a.keywords.Common.LastException(mostCurrent.activityBA)
                 .getMessage());
   }
   ;
   // BA.debugLineNum = 58;BA.debugLine="End Sub";
   return "";
 }
Example #2
0
 public static String _editareview(anywheresoftware.b4a.BA _ba, String _titulo, String _id_review)
     throws Exception {
   // BA.debugLineNum = 43;BA.debugLine="Sub EditaReview(titulo As String, id_review As String)";
   // BA.debugLineNum = 44;BA.debugLine="Try";
   try { // BA.debugLineNum = 45;BA.debugLine="Mi_BD.ExecNonQuery(\"UPDATE REVIEW SET titulo='\"&
     // titulo &\"' WHERE id_review='\"& id_review &\"'\")";
     _mi_bd.ExecNonQuery(
         "UPDATE REVIEW SET titulo='" + _titulo + "' WHERE id_review='" + _id_review + "'");
     // BA.debugLineNum = 46;BA.debugLine="Log(\"OK UPDATE de UpLibretaConductor en libreta
     // Realizado.\")";
     anywheresoftware.b4a.keywords.Common.Log(
         "OK UPDATE de UpLibretaConductor en libreta Realizado.");
   } catch (Exception e36) {
     (_ba.processBA == null ? _ba : _ba.processBA)
         .setLastException(
             e36); // BA.debugLineNum = 49;BA.debugLine="Log(\"catch UPDATE de UpLibretaConductor
     // en libreta  DBApp   \" & LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "catch UPDATE de UpLibretaConductor en libreta  DBApp   "
             + anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
   }
   ;
   // BA.debugLineNum = 52;BA.debugLine="End Sub";
   return "";
 }
Example #3
0
 public static String _insertareview(
     anywheresoftware.b4a.BA _ba, String _titulo, String _nota, String _tipo) throws Exception {
   String _fecha = "";
   // BA.debugLineNum = 28;BA.debugLine="Sub InsertaReview(titulo As String, nota As String, tipo
   // As String)";
   // BA.debugLineNum = 29;BA.debugLine="Dim fecha As String";
   _fecha = "";
   // BA.debugLineNum = 30;BA.debugLine="Try";
   try { // BA.debugLineNum = 31;BA.debugLine="fecha=Mi_BD.ExecQuerySingleResult(\"SELECT
     // datetime(CURRENT_TIMESTAMP,'localtime')\")";
     _fecha = _mi_bd.ExecQuerySingleResult("SELECT datetime(CURRENT_TIMESTAMP,'localtime')");
   } catch (Exception e23) {
     (_ba.processBA == null ? _ba : _ba.processBA)
         .setLastException(
             e23); // BA.debugLineNum = 33;BA.debugLine="Log(\"catch ERROR INSERT INTO REVIEW:
     // \"&LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "catch ERROR INSERT INTO REVIEW: "
             + anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
   }
   ;
   // BA.debugLineNum = 36;BA.debugLine="Try";
   try { // BA.debugLineNum = 37;BA.debugLine="Mi_BD.ExecNonQuery2(\"INSERT INTO REVIEW
     // (titulo,nota,tipo,fecha_registro) VALUES (?,?,?,'\"&fecha&\"')\", Array As
     // Object(titulo,nota,tipo))";
     _mi_bd.ExecNonQuery2(
         "INSERT INTO REVIEW (titulo,nota,tipo,fecha_registro) VALUES (?,?,?,'" + _fecha + "')",
         anywheresoftware.b4a.keywords.Common.ArrayToList(
             new Object[] {(Object) (_titulo), (Object) (_nota), (Object) (_tipo)}));
   } catch (Exception e28) {
     (_ba.processBA == null ? _ba : _ba.processBA)
         .setLastException(
             e28); // BA.debugLineNum = 39;BA.debugLine="Log(\"catch ERROR INSERT INTO REVIEW:
     // \"&LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "catch ERROR INSERT INTO REVIEW: "
             + anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
   }
   ;
   // BA.debugLineNum = 41;BA.debugLine="End Sub";
   return "";
 }
Example #4
0
 public static String _creabd(anywheresoftware.b4a.BA _ba) throws Exception {
   String _ssql = "";
   // BA.debugLineNum = 9;BA.debugLine="Sub CreaBD";
   // BA.debugLineNum = 10;BA.debugLine="Mi_BD.Initialize(File.DirInternal,\"DBApp.db\",True)' Se
   // crea el archivo en el directorio interno del Smartphone";
   _mi_bd.Initialize(
       anywheresoftware.b4a.keywords.Common.File.getDirInternal(),
       "DBApp.db",
       anywheresoftware.b4a.keywords.Common.True);
   // BA.debugLineNum = 12;BA.debugLine="Dim sSql As String";
   _ssql = "";
   // BA.debugLineNum = 14;BA.debugLine="Try";
   try { // BA.debugLineNum = 15;BA.debugLine="sSql = \"CREATE TABLE IF NOT EXISTS REVIEW \"";
     _ssql = "CREATE TABLE IF NOT EXISTS REVIEW ";
     // BA.debugLineNum = 16;BA.debugLine="sSql = sSql & \"(id_review INTEGER PRIMARY KEY
     // AUTOINCREMENT, \"";
     _ssql = _ssql + "(id_review INTEGER PRIMARY KEY AUTOINCREMENT, ";
     // BA.debugLineNum = 17;BA.debugLine="sSql = sSql & \"titulo TEXT, \"";
     _ssql = _ssql + "titulo TEXT, ";
     // BA.debugLineNum = 18;BA.debugLine="sSql = sSql & \"nota TEXT, \"";
     _ssql = _ssql + "nota TEXT, ";
     // BA.debugLineNum = 19;BA.debugLine="sSql = sSql & \"tipo TEXT, \"";
     _ssql = _ssql + "tipo TEXT, ";
     // BA.debugLineNum = 20;BA.debugLine="sSql = sSql & \"fecha_registro TIMESTAMP DEFAULT
     // CURRENT_TIMESTAMP)\"";
     _ssql = _ssql + "fecha_registro TIMESTAMP DEFAULT CURRENT_TIMESTAMP)";
     // BA.debugLineNum = 21;BA.debugLine="Mi_BD.ExecNonQuery(sSql)";
     _mi_bd.ExecNonQuery(_ssql);
   } catch (Exception e15) {
     (_ba.processBA == null ? _ba : _ba.processBA)
         .setLastException(
             e15); // BA.debugLineNum = 23;BA.debugLine="Log(\"catch ERROR CREATE TABLE IF NOT
     // EXISTS REVIEW: \"&LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "catch ERROR CREATE TABLE IF NOT EXISTS REVIEW: "
             + anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
   }
   ;
   // BA.debugLineNum = 25;BA.debugLine="End Sub";
   return "";
 }
Example #5
0
 public static String _ioioclose() throws Exception {
   // BA.debugLineNum = 60;BA.debugLine="Sub IOIOClose";
   // BA.debugLineNum = 61;BA.debugLine="Try";
   try { // BA.debugLineNum = 62;BA.debugLine="pin33_SensorFuerza.Close";
     _pin33_sensorfuerza.Close();
     // BA.debugLineNum = 63;BA.debugLine="YOYO.Disconnect";
     _yoyo.Disconnect();
     // BA.debugLineNum = 64;BA.debugLine="YOYO.WaitForDisconnect";
     _yoyo.WaitForDisconnect();
   } catch (Exception e35) {
     processBA.setLastException(
         e35); // BA.debugLineNum = 66;BA.debugLine="Log(\"YOYO Close Exception: \"&
               // LastException.Mess";
     anywheresoftware.b4a.keywords.Common.Log(
         "YOYO Close Exception: "
             + anywheresoftware.b4a.keywords.Common.LastException(mostCurrent.activityBA)
                 .getMessage());
   }
   ;
   // BA.debugLineNum = 68;BA.debugLine="End Sub";
   return "";
 }
Example #6
0
 public static String _eliminareview(anywheresoftware.b4a.BA _ba, String _id_review)
     throws Exception {
   // BA.debugLineNum = 54;BA.debugLine="Sub EliminaReview(id_review As String)";
   // BA.debugLineNum = 56;BA.debugLine="Try";
   try { // BA.debugLineNum = 57;BA.debugLine="Mi_BD.ExecNonQuery(\"DELETE from REVIEW where
     // id_review= '\"& id_review &\"' \")";
     _mi_bd.ExecNonQuery("DELETE from REVIEW where id_review= '" + _id_review + "' ");
     // BA.debugLineNum = 58;BA.debugLine="Log(\"OK UPDATE de UpLibretaConductor en libreta
     // Realizado.\")";
     anywheresoftware.b4a.keywords.Common.Log(
         "OK UPDATE de UpLibretaConductor en libreta Realizado.");
   } catch (Exception e44) {
     (_ba.processBA == null ? _ba : _ba.processBA)
         .setLastException(
             e44); // BA.debugLineNum = 61;BA.debugLine="Log(\"catch UPDATE de UpLibretaConductor
     // en libreta  DBApp   \" & LastException.Message)";
     anywheresoftware.b4a.keywords.Common.Log(
         "catch UPDATE de UpLibretaConductor en libreta  DBApp   "
             + anywheresoftware.b4a.keywords.Common.LastException(_ba).getMessage());
   }
   ;
   // BA.debugLineNum = 64;BA.debugLine="End Sub";
   return "";
 }