Skip to content

Commit

Permalink
oops - forgot to add the files as usual
Browse files Browse the repository at this point in the history
  • Loading branch information
nebogeo committed Feb 23, 2018
1 parent b0cd6b1 commit b771def
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
41 changes: 41 additions & 0 deletions android/app/src/main/assets/litter.scm
@@ -0,0 +1,41 @@
;; Mongoose 2000 Copyright (C) 2018 FoAM Kernow
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU Affero General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Affero General Public License for more details.
;;
;; You should have received a copy of the GNU Affero General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

(define (init-litter)
;; retreve (and increment) the pack's id info
(set-current! 'entity-type "pack")
(let ((letter (entity-get-value "litter-code-letter"))
(number (entity-get-value "litter-code-number"))
(parent (entity-get-value "unique_id")))
(let ((name (cond
((or (not letter) (not number)) "No ID")
(else
(entity-set-value! "litter-code-number" "int" (+ number 1))
(entity-update-values!) ;; hmm, cancel won't work
(set-current! 'pack (es-ktv-list)) ;; need to remove this pack stuff...
(string-append letter (number->string number))))))
(list
(ktv "name" "varchar" name)
(ktv "parent" "varchar" parent)
(ktv "date" "varchar" (date->string (date-time)))))))

(define (db-current-litter)
(db-filter
db "sync" "litter"
(list
(list "pack-id" "varchar" "=" (ktv-get (get-current 'pack '()) "unique_id"))
(list "dob" "varchar" "d<" 30))))


30 changes: 30 additions & 0 deletions android/app/src/main/java/foam/starwisp/UpdateLitterActivity.java
@@ -0,0 +1,30 @@
// Starwisp Copyright (C) 2013 Dave Griffiths
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

package foam.starwisp;

import android.app.Activity;
import android.os.Bundle;
import android.content.Context;

public class UpdateLitterActivity extends foam.starwisp.StarwispActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
m_Name = "update-litter";
super.onCreate(savedInstanceState);
}
}

0 comments on commit b771def

Please sign in to comment.