Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -163,5 +163,11 @@ deploytarg/dboard : $(OFILES) $(GOFILES) dashboard.scm deploytarg/apropos.so csc -deploy $(OFILES) $(GOFILES) dashboard.scm -o deploytarg mv deploytarg/deploytarg deploytarg/dboard +DATASHAREO=configf.o common.o process.o +datashare-testing/datashare : datashare.scm $(DATASHAREO) + csc datashare.scm $(DATASHAREO) -o datashare-testing/datashare + +datashare : datashare-testing/datashare + ./datashare-testing/datashare Index: datashare-testing/.datashare.config ================================================================== --- datashare-testing/.datashare.config +++ datashare-testing/.datashare.config @@ -1,4 +1,19 @@ -[datastores] +# Read in the users vars first (so the offical data cannot be overridden +[include datastore.config] + +[storagegroups] 1 eng /tmp/datastore/eng +[areas] +synthesis asic/synthesis +verilog asic/verilog +oalibs custom/oalibs + +[target] +basepath #{getenv BASEPATH} +[quality] +0 untested +1 lightly tested +2 tested +3 full QA Index: datashare.scm ================================================================== --- datashare.scm +++ datashare.scm @@ -28,10 +28,12 @@ (use canvas-draw) (import canvas-draw-iup) (use sqlite3 srfi-1 posix regex regex-case srfi-69) (import (prefix sqlite3 sqlite3:)) + +(declare (uses configf)) (include "megatest-fossil-hash.scm") ;; ;; GLOBALS @@ -67,10 +69,12 @@ key TEXT, iteration INTEGER, submitter TEXT, datetime TEXT, storegrp TEXT, + datavol INTEGER, + quality TEXT, disk_id INTEGER, comment TEXT);" "CREATE TABLE refs (id INTEGER PRIMARY KEY, pkg_id INTEGER, @@ -124,42 +128,57 @@ ;; ;; #:x 'mouse ;; ;; #:y 'mouse ;; ) )))) -(define (datashare:publish-view) +(define (datashare:publish-view configdat) + (let* ((label-size "50x") + (areas-sel (iup:listbox #:expand "YES" #:dropdown "YES")) + (version-val (iup:textbox #:expand "YES" #:size "50x")) + (iteration (iup:textbox #:expand "YES" #:size "20x")) + (comment (iup:textbox #:expand "YES")) + (source-path (iup:textbox #:expand "YES")) + (browse-btn (iup:button "Browse" + #:size "40x" + #:action (lambda (obj) + (let* ((fd (iup:file-dialog #:dialogtype "DIR")) + (top (iup:show fd #:modal? "YES"))) + (iup:attribute-set! source-path "VALUE" + (iup:attribute fd "VALUE")) + (iup:destroy! fd)))))) + (iup:vbox + (iup:hbox (iup:label "Area:" #:size label-size) areas-sel) + (iup:hbox (iup:label "Version:" #:size label-size) version-val + (iup:label "Iteration:") iteration) + (iup:hbox (iup:label "Comment:" #:size label-size) comment) + (iup:hbox (iup:label "Source path:" #:size label-size) source-path browse-btn)))) + +(define (datashare:get-view configdat) (iup:vbox (iup:hbox - (iup:button "Pushme" + (iup:button "Pushme" #:expand "YES" )))) -(define (datashare:get-view) +(define (datashare:manage-view configdat) (iup:vbox (iup:hbox (iup:button "Pushme" #:expand "YES" )))) -(define (datashare:manage-view) - (iup:vbox - (iup:hbox - (iup:button "Pushme" - #:expand "YES" - )))) - -(define (datashare:gui) +(define (datashare:gui configdat) (iup:show (iup:dialog #:title (conc "DataShare dashboard " (current-user-name) ":" (current-directory)) #:menu (datashare:main-menu) (let* ((tabs (iup:tabs #:tabchangepos-cb (lambda (obj curr prev) (set! *datashare:current-tab-number* curr)) - (datashare:publish-view) - (datashare:get-view) - (datashare:manage-view) + (datashare:publish-view configdat) + (datashare:get-view configdat) + (datashare:manage-view configdat) ))) ;; (set! (iup:callback tabs tabchange-cb:) (lambda (a b c)(print "SWITCHED TO TAB: " a " " b " " c))) (iup:attribute-set! tabs "TABTITLE0" "Publish") (iup:attribute-set! tabs "TABTITLE1" "Get") (iup:attribute-set! tabs "TABTITLE2" "Manage") @@ -174,26 +193,27 @@ (define (datashare:load-config path) (let ((fname (conc path "/.datashare.config"))) (ini:property-separator-patt " * *") (ini:property-separator #\space) (if (file-exists? fname) - (ini:read fname) - '()))) + ;; (ini:read-ini fname) + (read-config fname #f #t) + (make-hash-table)))) (define (main) - (let* ((args (argv)) - (prog (car args)) - (rema (cdr args)) - (conf (datashare:load-config (pathname-directory prog)))) + (let* ((args (argv)) + (prog (car args)) + (rema (cdr args)) + (configdat (datashare:load-config (pathname-directory prog)))) (cond ((eq? (length rema) 1) (case (string->symbol (car rema)) ((help -h -help --h --help) (print datashare:help)) (else (print "ERROR: Unrecognised command. Try \"datashare help\"")))) - ((null? rema)(datashare:gui)) + ((null? rema)(datashare:gui configdat)) ((>= (length rema) 2) (apply process-action (car rema)(cdr rema))) (else (print "ERROR: Unrecognised command. Try \"datashare help\""))))) (main)