Skip to content

Commit

Permalink
Merge pull request #23 from PESchoenberg/develop
Browse files Browse the repository at this point in the history
Parked and running car data added.
  • Loading branch information
PESchoenberg authored Jan 19, 2020
2 parents fa1223d + 1595b53 commit 244430b
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 74 deletions.
Binary file modified data/jcp_inm.db
Binary file not shown.
123 changes: 111 additions & 12 deletions src/scheme/jcp_inm.scm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,36 @@
res))


; menu-process-data - Process data menu.
;
; Output:
; - Returns an integer corresponding to the menu option selected.
;
(define (menu-process-data)
(let ((res 0))
(grsp-ld "0 - Main menu.")
(grsp-ld "1 - Process ppers.")
(grsp-ld "2 - Process pvehp.")
(grsp-ld "3 - Process pvehr.")
(set! res (grsp-ask opt))
res))


; menu-report-data - Report data menu.
;
; Output:
; - Returns an integer corresponding to the menu option selected.
;
(define (menu-report-data)
(let ((res 0))
(grsp-ld "0 - Main menu.")
(grsp-ld "1 - Report existing ppers.")
(grsp-ld "2 - Report existing pvehp.")
(grsp-ld "3 - Report existing pvehr.")
(set! res (grsp-ask opt))
res))


; write-prep-sql - Overwrites the contents of prep.sql with the values
; contained in the arguments.
;
Expand Down Expand Up @@ -311,14 +341,18 @@
database
(strings-append
(list
"\"INSERT INTO trf_pers (Abr, Alt, Value) VALUES("
"\"INSERT INTO trf_pers (Abr, Alt, Value, Vehp, Vehr) VALUES("
"'"
(ask-street-abr)
"', '"
(grsp-n2s (ask-street-number))
"', "
"', '"
(grsp-n2s (grsp-ask "Number of people? "))
");\"")
"', '"
(grsp-n2s (grsp-ask "Vehicles parked? "))
"', '"
(grsp-n2s (grsp-ask "Vehicles running? "))
"');\"")
0)
oqc))

Expand Down Expand Up @@ -349,23 +383,88 @@
(else (wrch))))))


; process-data - Data processing sqlp call.
; process-data-opt - Enter block data. allows for data input to trf_pers, and
; batch update with prep.sql once finished entering records.
;
(define (process-data-opt)
(let ((mc -1))
(while (equal? #f (equal? mc 0))
(menu-present "Jcp_inm - process data options" pdf "n")
(set! mc (menu-process-data))
(cond ((equal? mc 0)(grsp-cd "Back to main menu!\n"))
((equal? mc 1)(process-data1))
((equal? mc 2)(process-data2))
((equal? mc 3)(process-data3))
(else (wrch))))))


; report-data-opt - Report data options.
;
(define (process-data)
(grsp-cd "Processing data...\n")
(define (report-data-opt)
(let ((mc -1))
(while (equal? #f (equal? mc 0))
(menu-present "Jcp_inm - report data options" pdf "n")
(set! mc (menu-report-data))
(cond ((equal? mc 0)(grsp-cd "Back to main menu!\n"))
((equal? mc 1)(report-data1))
((equal? mc 2)(report-data2))
((equal? mc 3)(report-data3))
(else (wrch))))))


; process-data1 - Data processing sqlp call, pers.
;
(define (process-data1)
(grsp-cd "Processing data (pers)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "calc.sql") 0) oqc))


; report-data - Data reporting sqlp call.
; process-data2 - Data processing sqlp call, vehp.
;
(define (report-data)
(grsp-cd "Generating report...\n")
(define (process-data2)
(grsp-cd "Processing data (vehp)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "calc2.sql") 0) oqc))


; process-data2 - Data processing sqlp call, vehp.
;
(define (process-data3)
(grsp-cd "Processing data (vehr)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "calc3.sql") 0) oqc))


; report-data1 - Data reporting sqlp call (pers).
;
(define (report-data1)
(grsp-cd "Generating report (pers)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "rep.sql") 0) oqcs)
(grsp-sqlp sqlp-path "sqlp_results.txt" "COLS=6" oqcp)
(clear)
(display (read-file-as-string "sqlp_pretty_tmp.txt"))
(grsp-ask "Press <ENT> to continue."))



; report-data1 - Data reporting sqlp call (vehp).
;
(define (report-data2)
(grsp-cd "Generating report (vehp)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "rep2.sql") 0) oqcs)
(grsp-sqlp sqlp-path "sqlp_results.txt" "COLS=6" oqcp)
(clear)
(display (read-file-as-string "sqlp_pretty_tmp.txt"))
(grsp-ask "Press <ENT> to continue."))


; report-data1 - Data reporting sqlp call (vehr).
;
(define (report-data3)
(grsp-cd "Generating report (vehr)...\n")
(grsp-sqlp sqlp-path database (strings-append (list sql-path "rep3.sql") 0) oqcs)
(grsp-sqlp sqlp-path "sqlp_results.txt" "COLS=6" oqcp)
(clear)
(display (read-file-as-string "sqlp_pretty_tmp.txt"))
(grsp-ask "Press <ENT> to continue."))


; menu-main - Main menu of the program.
;
Expand All @@ -389,7 +488,7 @@
(set! mc (menu-main))
(cond ((equal? mc 0)(grsp-cd "Bye!\n"))
((equal? mc 1)(enter-data))
((equal? mc 2)(process-data))
((equal? mc 3)(report-data))
((equal? mc 2)(process-data-opt))
((equal? mc 3)(report-data-opt))
(else (wrch))))

116 changes: 58 additions & 58 deletions src/scheme/sqlp_pretty_tmp.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
|R197|1500|109.0|93.0 |MEDIUM|8158.17
|R197|1400|91.0 |92.0 |MEDIUM|6810.95
|ZU |5000|85.0 |127.0|HIGH |6361.88
|RSP |5000|77.0 |160.0|HIGH |5763.11
|JCP |1700|68.0 |150.0|HIGH |5089.5
|R197|1600|68.0 |96.0 |MEDIUM|5089.5
|ALT |1900|67.0 |147.0|HIGH |5014.66
|RSP |5100|57.0 |194.0|HIGH |4266.2
|ZU |4900|56.0 |91.0 |MEDIUM|4191.36
|ALT |1800|55.0 |127.0|HIGH |4116.51
|GC |5000|51.0 |134.0|HIGH |3817.13
|MJ |5000|51.0 |101.0|MEDIUM|3817.13
|ALT |1700|48.0 |112.0|HIGH |3592.59
|ALT |2000|44.0 |97.0 |MEDIUM|3293.21
|ALM |5100|43.0 |75.0 |MEDIUM|3218.36
|R197|1800|43.0 |37.0 |LOW |3218.36
|RSP |5200|40.0 |102.0|MEDIUM|2993.83
|R197|1300|39.0 |81.0 |MEDIUM|2918.98
|R197|1700|37.0 |40.0 |LOW |2769.29
|JCP |1800|36.0 |95.0 |MEDIUM|2694.44
|MJ |4900|36.0 |116.0|HIGH |2694.44
|GCA |6400|32.0 |77.0 |MEDIUM|2395.06
|MJ |5100|32.0 |92.0 |MEDIUM|2395.06
|R197|1900|29.0 |37.0 |LOW |2170.52
|GC |4900|28.0 |120.0|HIGH |2095.68
|LG |5000|27.0 |40.0 |LOW |2020.83
|LAV |2000|26.0 |74.0 |MEDIUM|1945.99
|RSP |4900|26.0 |85.0 |MEDIUM|1945.99
|ALM |5000|25.0 |54.0 |LOW |1871.14
|R197|1200|22.0 |53.0 |LOW |1646.6
|ALM |4900|21.0 |49.0 |LOW |1571.76
|ALT |2100|21.0 |65.0 |LOW |1571.76
|GO |4900|21.0 |102.0|MEDIUM|1571.76
|JCP |1900|20.0 |121.0|HIGH |1496.91
|JCP |2000|20.0 |115.0|HIGH |1496.91
|ZA |4900|18.0 |99.0 |MEDIUM|1347.22
|ALM |4800|17.0 |44.0 |LOW |1272.38
|GO |5000|17.0 |129.0|HIGH |1272.38
|LAV |1900|17.0 |82.0 |MEDIUM|1272.38
|GCA |6600|13.0 |65.0 |LOW |972.99
|ZU |4800|11.0 |80.0 |MEDIUM|823.3
|GCA |6500|8.0 |67.0 |LOW |598.77
|GO |5100|8.0 |102.0|MEDIUM|598.77
|LG |4900|8.0 |40.0 |LOW |598.77
|ZA |5000|8.0 |103.0|MEDIUM|598.77
|GCA |6300|7.0 |75.0 |MEDIUM|523.92
|JCP |2100|7.0 |59.0 |LOW |523.92
|COL |1900|6.0 |107.0|MEDIUM|449.07
|LAV |1800|6.0 |82.0 |MEDIUM|449.07
|LAV |2100|6.0 |74.0 |MEDIUM|449.07
|LG |4800|6.0 |34.0 |NONE |449.07
|COL |2000|4.0 |111.0|HIGH |299.38
|COL |2100|4.0 |98.0 |MEDIUM|299.38
|GO |5200|4.0 |81.0 |MEDIUM|299.38
|LAV |1700|3.0 |79.0 |MEDIUM|224.54
|MJ |4800|2.0 |80.0 |MEDIUM|149.69
|ZA |5100|2.0 |97.0 |MEDIUM|149.69
|ZA |5200|2.0 |97.0 |MEDIUM|149.69
|R197|1400|19.0|5.0 |NONE|13897.47
|R197|1500|17.0|5.0 |NONE|12434.58
|R197|1800|15.0|2.0 |NONE|10971.69
|R197|1700|14.0|3.0 |NONE|10240.24
|RSP |5100|14.0|7.0 |NONE|10240.24
|R197|1600|12.0|6.0 |NONE|8777.35
|RSP |5200|11.0|6.0 |NONE|8045.9
|R197|1300|10.0|4.0 |NONE|7314.46
|RSP |5000|10.0|8.0 |NONE|7314.46
|R197|1900|9.0 |3.0 |NONE|6583.01
|ALT |1900|7.0 |9.0 |NONE|5120.12
|LG |4900|7.0 |3.0 |NONE|5120.12
|ALT |1700|6.0 |8.0 |NONE|4388.68
|ALT |1800|6.0 |9.0 |NONE|4388.68
|LG |4800|6.0 |3.0 |NONE|4388.68
|GCA |6600|5.0 |3.0 |NONE|3657.23
|ALT |2000|4.0 |7.0 |NONE|2925.78
|LG |5000|4.0 |3.0 |NONE|2925.78
|RSP |4900|4.0 |2.0 |NONE|2925.78
|R197|1200|3.0 |2.0 |NONE|2194.34
|ALM |5100|2.0 |6.0 |NONE|1462.89
|GC |5000|2.0 |11.0|NONE|1462.89
|GCA |6300|2.0 |3.0 |NONE|1462.89
|GCA |6400|2.0 |3.0 |NONE|1462.89
|JCP |1800|2.0 |8.0 |NONE|1462.89
|JCP |1900|2.0 |8.0 |NONE|1462.89
|MJ |4900|2.0 |7.0 |NONE|1462.89
|ALM |5000|1.0 |4.0 |NONE|731.45
|GC |4900|1.0 |9.0 |NONE|731.45
|GO |4900|1.0 |4.0 |NONE|731.45
|GO |5000|1.0 |10.0|NONE|731.45
|GO |5100|1.0 |6.0 |NONE|731.45
|GO |5200|1.0 |3.0 |NONE|731.45
|LAV |1700|1.0 |11.0|NONE|731.45
|LAV |1800|1.0 |11.0|NONE|731.45
|LAV |1900|1.0 |9.0 |NONE|731.45
|LAV |2000|1.0 |10.0|NONE|731.45
|LAV |2100|1.0 |10.0|NONE|731.45
|MJ |4800|1.0 |8.0 |NONE|731.45
|MJ |5000|1.0 |4.0 |NONE|731.45
|MJ |5100|1.0 |3.0 |NONE|731.45
|ZA |5100|1.0 |8.0 |NONE|731.45
|ZU |4800|1.0 |7.0 |NONE|731.45
|ZU |4900|1.0 |8.0 |NONE|731.45
|ALM |4800|0.0 |5.0 |NONE|0.0
|ALM |4900|0.0 |4.0 |NONE|0.0
|ALT |2100|0.0 |1.0 |NONE|0.0
|COL |1900|0.0 |7.0 |NONE|0.0
|COL |2000|0.0 |7.0 |NONE|0.0
|COL |2100|0.0 |6.0 |NONE|0.0
|GCA |6500|0.0 |3.0 |NONE|0.0
|JCP |1700|0.0 |12.0|NONE|0.0
|JCP |2000|0.0 |9.0 |NONE|0.0
|JCP |2100|0.0 |4.0 |NONE|0.0
|ZA |4900|0.0 |8.0 |NONE|0.0
|ZA |5000|0.0 |8.0 |NONE|0.0
|ZA |5200|0.0 |8.0 |NONE|0.0
|ZU |5000|0.0 |9.0 |NONE|0.0
|EOQ |
2 changes: 1 addition & 1 deletion src/scheme/sqlp_results.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
R197|1500|109.0|93.0|MEDIUM|8158.17|R197|1400|91.0|92.0|MEDIUM|6810.95|ZU|5000|85.0|127.0|HIGH|6361.88|RSP|5000|77.0|160.0|HIGH|5763.11|JCP|1700|68.0|150.0|HIGH|5089.5|R197|1600|68.0|96.0|MEDIUM|5089.5|ALT|1900|67.0|147.0|HIGH|5014.66|RSP|5100|57.0|194.0|HIGH|4266.2|ZU|4900|56.0|91.0|MEDIUM|4191.36|ALT|1800|55.0|127.0|HIGH|4116.51|GC|5000|51.0|134.0|HIGH|3817.13|MJ|5000|51.0|101.0|MEDIUM|3817.13|ALT|1700|48.0|112.0|HIGH|3592.59|ALT|2000|44.0|97.0|MEDIUM|3293.21|ALM|5100|43.0|75.0|MEDIUM|3218.36|R197|1800|43.0|37.0|LOW|3218.36|RSP|5200|40.0|102.0|MEDIUM|2993.83|R197|1300|39.0|81.0|MEDIUM|2918.98|R197|1700|37.0|40.0|LOW|2769.29|JCP|1800|36.0|95.0|MEDIUM|2694.44|MJ|4900|36.0|116.0|HIGH|2694.44|GCA|6400|32.0|77.0|MEDIUM|2395.06|MJ|5100|32.0|92.0|MEDIUM|2395.06|R197|1900|29.0|37.0|LOW|2170.52|GC|4900|28.0|120.0|HIGH|2095.68|LG|5000|27.0|40.0|LOW|2020.83|LAV|2000|26.0|74.0|MEDIUM|1945.99|RSP|4900|26.0|85.0|MEDIUM|1945.99|ALM|5000|25.0|54.0|LOW|1871.14|R197|1200|22.0|53.0|LOW|1646.6|ALM|4900|21.0|49.0|LOW|1571.76|ALT|2100|21.0|65.0|LOW|1571.76|GO|4900|21.0|102.0|MEDIUM|1571.76|JCP|1900|20.0|121.0|HIGH|1496.91|JCP|2000|20.0|115.0|HIGH|1496.91|ZA|4900|18.0|99.0|MEDIUM|1347.22|ALM|4800|17.0|44.0|LOW|1272.38|GO|5000|17.0|129.0|HIGH|1272.38|LAV|1900|17.0|82.0|MEDIUM|1272.38|GCA|6600|13.0|65.0|LOW|972.99|ZU|4800|11.0|80.0|MEDIUM|823.3|GCA|6500|8.0|67.0|LOW|598.77|GO|5100|8.0|102.0|MEDIUM|598.77|LG|4900|8.0|40.0|LOW|598.77|ZA|5000|8.0|103.0|MEDIUM|598.77|GCA|6300|7.0|75.0|MEDIUM|523.92|JCP|2100|7.0|59.0|LOW|523.92|COL|1900|6.0|107.0|MEDIUM|449.07|LAV|1800|6.0|82.0|MEDIUM|449.07|LAV|2100|6.0|74.0|MEDIUM|449.07|LG|4800|6.0|34.0|NONE|449.07|COL|2000|4.0|111.0|HIGH|299.38|COL|2100|4.0|98.0|MEDIUM|299.38|GO|5200|4.0|81.0|MEDIUM|299.38|LAV|1700|3.0|79.0|MEDIUM|224.54|MJ|4800|2.0|80.0|MEDIUM|149.69|ZA|5100|2.0|97.0|MEDIUM|149.69|ZA|5200|2.0|97.0|MEDIUM|149.69|EOQ|
R197|1400|19.0|5.0|NONE|13897.47|R197|1500|17.0|5.0|NONE|12434.58|R197|1800|15.0|2.0|NONE|10971.69|R197|1700|14.0|3.0|NONE|10240.24|RSP|5100|14.0|7.0|NONE|10240.24|R197|1600|12.0|6.0|NONE|8777.35|RSP|5200|11.0|6.0|NONE|8045.9|R197|1300|10.0|4.0|NONE|7314.46|RSP|5000|10.0|8.0|NONE|7314.46|R197|1900|9.0|3.0|NONE|6583.01|ALT|1900|7.0|9.0|NONE|5120.12|LG|4900|7.0|3.0|NONE|5120.12|ALT|1700|6.0|8.0|NONE|4388.68|ALT|1800|6.0|9.0|NONE|4388.68|LG|4800|6.0|3.0|NONE|4388.68|GCA|6600|5.0|3.0|NONE|3657.23|ALT|2000|4.0|7.0|NONE|2925.78|LG|5000|4.0|3.0|NONE|2925.78|RSP|4900|4.0|2.0|NONE|2925.78|R197|1200|3.0|2.0|NONE|2194.34|ALM|5100|2.0|6.0|NONE|1462.89|GC|5000|2.0|11.0|NONE|1462.89|GCA|6300|2.0|3.0|NONE|1462.89|GCA|6400|2.0|3.0|NONE|1462.89|JCP|1800|2.0|8.0|NONE|1462.89|JCP|1900|2.0|8.0|NONE|1462.89|MJ|4900|2.0|7.0|NONE|1462.89|ALM|5000|1.0|4.0|NONE|731.45|GC|4900|1.0|9.0|NONE|731.45|GO|4900|1.0|4.0|NONE|731.45|GO|5000|1.0|10.0|NONE|731.45|GO|5100|1.0|6.0|NONE|731.45|GO|5200|1.0|3.0|NONE|731.45|LAV|1700|1.0|11.0|NONE|731.45|LAV|1800|1.0|11.0|NONE|731.45|LAV|1900|1.0|9.0|NONE|731.45|LAV|2000|1.0|10.0|NONE|731.45|LAV|2100|1.0|10.0|NONE|731.45|MJ|4800|1.0|8.0|NONE|731.45|MJ|5000|1.0|4.0|NONE|731.45|MJ|5100|1.0|3.0|NONE|731.45|ZA|5100|1.0|8.0|NONE|731.45|ZU|4800|1.0|7.0|NONE|731.45|ZU|4900|1.0|8.0|NONE|731.45|ALM|4800|0.0|5.0|NONE|0.0|ALM|4900|0.0|4.0|NONE|0.0|ALT|2100|0.0|1.0|NONE|0.0|COL|1900|0.0|7.0|NONE|0.0|COL|2000|0.0|7.0|NONE|0.0|COL|2100|0.0|6.0|NONE|0.0|GCA|6500|0.0|3.0|NONE|0.0|JCP|1700|0.0|12.0|NONE|0.0|JCP|2000|0.0|9.0|NONE|0.0|JCP|2100|0.0|4.0|NONE|0.0|ZA|4900|0.0|8.0|NONE|0.0|ZA|5000|0.0|8.0|NONE|0.0|ZA|5200|0.0|8.0|NONE|0.0|ZU|5000|0.0|9.0|NONE|0.0|EOQ|
Loading

0 comments on commit 244430b

Please sign in to comment.