This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheat_cia.bas
executable file
·1005 lines (855 loc) · 36.8 KB
/
heat_cia.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1 REM HEATING CONTROL PROGRAM FOR CHRISTIANS IN ACTION CHURCH
2 REM WRITTEN BY LARRY BERKNER (ADAPTATIONS FOR 486 COMPUTER MADE 1/6/99)
3 REM BY John Schroeder
4 REM LATEST REVISION DATE IS JANUARY 12,2008 (LINE 1240 & 1370)
5 CLS
6 ONCOUNT = 0: allow.kill = 0: ENTRY# = 0: STORE.EVERY.FIVEMIN = 0: HEADER = 0
8 REM VOLT.U = 1.81909: VOLT.L = 1.80786: Volt.B = 1.25: VOLT.O = 1.69323: VOLT.H = 1.76821
10 PAUSE.LOOP.COUNT = 5000000
11 DIM ENTRY#(2020), MON(2020), DAY(2020), HR(2020), MIN(2020), TU(2020), TL(2020), TOUT(2020), BOILER.ON(2020)
12 DIM DBT(10)
20 DIM SETU.PERM(336), SETL.PERM(336), SETSTAIRS.PERM(336)
30 DIM SETU.TEMP(336), SETL.TEMP(336), SETSTAIRS.TEMP(336)
40 DIM DAYS.PER.MON(12)
50 CLS : LOCATE 10, 24
55 COLOR 4, 7: PRINT "Loading in schedule from disc file."
56 LOCATE 12, 34: PRINT "Please Wait!!"
57 COLOR 1, 7
60 OPEN "COM2:1200,E,7,1,CS,DS " FOR RANDOM AS #1
62 REM OPEN RS232 I/O port to SENSATROL
65 REM GOSUB 4750
86 GOSUB 5531
90 OPEN "C:SCHEDULE.DAT" FOR INPUT AS #2
100 FOR x = 1 TO 336
110 INPUT #2, SETU.PERM(x)
120 INPUT #2, SETL.PERM(x)
130 INPUT #2, SETSTAIRS.PERM(x)
140 INPUT #2, SETU.TEMP(x)
150 INPUT #2, SETL.TEMP(x)
160 INPUT #2, SETSTAIRS.TEMP(x)
210 NEXT x
220 CLOSE #2
240 T1 = 70
250 T2 = 65
260 T3 = 50
270 T4 = 35
280 T1U.ADJ = T1 + 2
290 T1L.ADJ = T1 + 1: REM by user when T1 is scheduled.
300 TRU = .6
310 TRL = .4
320 TCU = 2000
330 TCL = 4500
340 cwa% = 48
350 cwb% = 48: REM cwa = 4: cwb = 2: cwb = 4: cwb = 8: cwa = 11
355 cwb% = 48: REM cwa = 4: cwb = 2: cwb = 4: cwb = 8: cwa = 3
360 ALPHA.U = .002: REM Temperature coefficient of temperature sensor.
370 ALPHA.L = .0019
380 ALPHA.H = .004
390 ALPHA.O = .0021
410 RS72.U = 100.5
420 RS72.L = 102.1
430 RS72.H = 103.6
440 RS72.O = 96.4
460 DAYS.PER.MON(1) = 31: DAYS.PER.MON(2) = 28: DAYS.PER.MON(3) = 31
470 DAYS.PER.MON(4) = 30: DAYS.PER.MON(5) = 31: DAYS.PER.MON(6) = 30
480 DAYS.PER.MON(7) = 31: DAYS.PER.MON(8) = 31: DAYS.PER.MON(9) = 30
490 DAYS.PER.MON(10) = 31: DAYS.PER.MON(11) = 30: DAYS.PER.MON(12) = 31
500 GOSUB 1430
510 TUSET = SETU.TEMP(CI)
520 TLSET = SETL.TEMP(CI)
530 SHORT.CYCLE.START# = NOW# - .5
540 SAVE.CYCLE.START# = NOW# + 20
590 GOSUB 1680
593 IF (HR = 0) AND (MIN = 0) THEN GOTO 594 ELSE 600
594 ONCOUNT = -1
595 GOSUB 5150
600 IF BOILER.ON THEN GOSUB 5150
602 RMD = (VAL(MID$(TIME$, 4, 2))) - 10 * (VAL(MID$(TIME$, 4, 1)))
605 IF ((RMD = 0) OR (RMD = 5)) AND (VAL(MID$(TIME$, 7, 1)) < 3) THEN GOTO 607 ELSE 610
607 GOSUB 5180
610 GOSUB 1430
620 KEY.HIT$ = INKEY$
640 IF (KEY.HIT$ = "&") AND (NOT DISP.BURN) GOTO 642 ELSE 644
642 DISP.VAR = -1
643 GOTO 590
644 IF (KEY.HIT$ = "@") AND (NOT DISP.VAR) GOTO 645 ELSE 647
645 DISP.BURN = -1
646 GOTO 590
647 IF KEY.HIT$ = "*" GOTO 648 ELSE 650
648 DISP.BURN = 0: DISP.VAR = 0: C.SELECT = 0
649 GOTO 590
650 IF (KEY.HIT$ <> "&") AND (KEY.HIT$ <> "") GOTO 652 ELSE 660
652 DISP.VAR = 0
660 IF (KEY.HIT$ = "a") OR (KEY.HIT$ = "A") THEN GOSUB 2140 ELSE 670
665 GOTO 590
670 IF (KEY.HIT$ = "b") OR (KEY.HIT$ = "B") THEN GOSUB 3110 ELSE 680
675 GOTO 590
680 IF (VAL(KEY.HIT$) < 1) OR (VAL(KEY.HIT$) > 4) THEN DISP.MENU = 0
690 IF (KEY.HIT$ = "c") OR (KEY.HIT$ = "C") GOTO 695 ELSE 700
695 DISP.MENU = -1
696 C.SELECT = -1
697 GOTO 590
700 IF KEY.HIT$ = "1" AND C.SELECT = -1 THEN T1U.ADJ = T1U.ADJ + 1 ELSE GOTO 710
701 IF T1U.ADJ >= 75 THEN T1U.ADJ = 75
702 DISP.MENU = -1
704 PRINT CHR$(7);
706 GOTO 590
710 IF KEY.HIT$ = "2" AND C.SELECT = -1 THEN T1U.ADJ = T1U.ADJ - 1 ELSE GOTO 720
711 IF T1U.ADJ < 70 THEN T1U.ADJ = 70
712 DISP.MENU = -1
714 PRINT CHR$(7);
716 GOTO 590
720 IF KEY.HIT$ = "3" AND C.SELECT = -1 THEN T1L.ADJ = T1L.ADJ + 1 ELSE GOTO 730
721 IF T1L.ADJ >= 74 THEN T1L.ADJ = 74
722 DISP.MENU = -1
724 PRINT CHR$(7);
726 GOTO 590
730 IF KEY.HIT$ = "4" AND C.SELECT = -1 THEN T1L.ADJ = T1L.ADJ - 1 ELSE GOTO 740
731 IF T1L.ADJ < 68 THEN T1L.ADJ = 68
732 DISP.MENU = -1
734 PRINT CHR$(7);
736 GOTO 590
740 IF NOW# < SHORT.CYCLE.START# + .5 GOTO 610
750 SHORT.CYCLE.START# = NOW#
770 IF NOW# < (SAVE.CYCLE.START# + 10) GOTO 820
780 H = VAL(MID$(TIME$, 1, 2))
800 SAVE.CYCLE.START# = NOW#
820 GOSUB 1500
830 C.SELECT = 0
840 GOSUB 3620
850 IF TUSET = 70 THEN TUSET = T1U.ADJ
860 IF TLSET = 70 THEN TLSET = T1L.ADJ
950 IF TUSET = T1U.ADJ THEN DTU = .5 ELSE IF TUSET = T2 THEN DTU = 1 ELSE DTU = 2
960 IF TLSET = T1L.ADJ THEN DTL = .5 ELSE IF TLSET = T2 THEN DTL = 1 ELSE DTL = 2
970 IF (NOT FANU.ON) AND (BOILER.ON OR (NOT B.PRESS.LOW)) AND (TU < (TUSET - DTU)) GOTO 972 ELSE 980
972 cwa% = cwa% + 4
975 GOSUB 5210
977 FANU.ON = -1
980 IF ((NOT FANL.ON) AND (BOILER.ON OR (NOT B.PRESS.LOW))) AND ((TL < (TLSET - DTL)) OR (NOT FANU.ON)) GOTO 982 ELSE 990
982 cwb% = cwb% + 2
985 GOSUB 5210
987 FANL.ON = -1
990 IF (FANU.ON) AND (TU > (TUSET + DTU)) GOTO 992 ELSE 1000
992 cwa% = cwa% - 4
995 GOSUB 5210
997 FANU.ON = 0
1000 IF (FANL.ON) AND ((NOW# > (B.PRESS.LOW.TIME# + 20)) AND (B.PRESS.LOW) AND (NOT BOILER.ON)) GOTO 1002 ELSE 1020
1002 cwb% = cwb% - 2
1005 GOSUB 5210
1007 FANL.ON = 0
1020 IF (NOT STAIRS.ON) AND (((SETSTAIRS.TEMP(CI) = 1) AND (TOUT < 37)) OR HUMU OR HUML) GOTO 1022 ELSE 1030
1022 cwa% = cwa% + 11
1025 GOSUB 5210
1027 STAIRS.ON = -1
1030 IF STAIRS.ON AND ((SETSTAIRS.TEMP(CI) = 0) OR (TOUT > 43)) AND (NOT HUMU) AND (NOT HUML) GOTO 1032 ELSE 1050
1032 cwa% = cwa% - 11
1035 GOSUB 5210
1037 STAIRS.ON = 0
1050 IF (BOILER.ON AND (NOT B.PRESS.LOW) AND ((NOW# - B.PRESS.LOW.TIME#) >= 5)) GOTO 1052 ELSE 1070
1052 cwb% = cwb% - 8
1055 GOSUB 5210
1057 BOILER.ON = 0
1070 IF (NOT BOILER.ON) AND (B.PRESS.LOW) AND TOUT < 60 THEN GOSUB 4030
1090 IF CI = 1 THEN PREVIOUS.CI = 336 ELSE PREVIOUS.CI = CI - 1
1100 IF SETU.TEMP(PREVIOUS.CI) <> SETU.PERM(PREVIOUS.CI) GOTO 1102 ELSE 1110
1102 SETU.TEMP(PREVIOUS.CI) = SETU.PERM(PREVIOUS.CI)
1105 SAVE.SCHED = -1
1110 IF SETL.TEMP(PREVIOUS.CI) <> SETL.PERM(PREVIOUS.CI) GOTO 1112 ELSE 1120
1112 SETL.TEMP(PREVIOUS.CI) = SETL.PERM(PREVIOUS.CI)
1115 SAVE.SCHED = -1
1120 IF SETSTAIRS.TEMP(PREVIOUS.CI) <> SETSTAIRS.PERM(PREVIOUS.CI) GOTO 1122 ELSE 1130
1122 SETSTAIRS.TEMP(PREVIOUS.CI) = SETSTAIRS.PERM(PREVIOUS.CI)
1125 SAVE.SCHED = -1
1130 IF (SAVE.SCHED AND (MID$(DATE$, 7, 4) <> "1980")) GOTO 1132 ELSE 1140
1132 GOSUB 4170
1135 SAVE.SCHED = 0
1140 GOTO 590
1180 '
1210 IF TIME$ = "24:00:00" GOTO 1210: REM This time messes up calculation of CI.
1220 DD$ = DATE$: REM Use this in case date changes in next few lines.
1230 TT$ = TIME$: REM Use this in case time changes hour in next few lines.
1240 YR = VAL(MID$(DD$, 9, 2)) - 1: REM BEFORE y2k, CODE WAS (-89)
1250 MON = VAL(MID$(DD$, 1, 2))
1260 DAY = VAL(MID$(DD$, 4, 2))
1270 HR = VAL(MID$(TT$, 1, 2))
1280 MIN = VAL(MID$(TT$, 4, 2))
1290 SEC# = VAL(MID$(TT$, 7, 2)): REM Need one double precision for later date.
1300 FOUR.YR.PERIODS = INT(YR / 4)
1310 YR.MIN = FOUR.YR.PERIODS * 2103840! + (YR - 4 * FOUR.YR.PERIODS) * 525600!
1320 MON.DAYS = 0
1330 IF (4 * (FOUR.YR.PERIODS + 1) - (YR + 1)) = 0 THEN DAYS.PER.MON(2) = 29 ELSE DAYS.PER.MON(2) = 28
1340 FOR x = 1 TO (MON - 1)
1350 MON.DAYS = MON.DAYS + DAYS.PER.MON(x)
1360 NEXT x
1370 NOW# = YR.MIN + (MON.DAYS + DAY) * 1440 + HR * 60 + MIN + SEC# / 60
1375 REM BEFORE Y2K, CODE WAS DAY-1
1380 RETURN
1430 GOSUB 1210
1440 DAYS.TO.DATE = INT(NOW# / 1440)
1450 WEEKS.TO.DATE = INT(DAYS.TO.DATE / 7)
1460 DAY.OF.WEEK = (DAYS.TO.DATE - 7 * WEEKS.TO.DATE)
1470 CI = DAY.OF.WEEK * 48 + (HR * 2 + 1) + INT(MIN / 30)
1480 RETURN
1500
1510 PRINT #1, CHR$(cwa%); CHR$(cwb%); "0": INPUT #1, VOLT.U: VOLT.U = VOLT.U / 10000
1530 PRINT #1, CHR$(cwa%); CHR$(cwb%); "1": INPUT #1, VOLT.L: VOLT.L = VOLT.L / 10000
1540 PRINT #1, CHR$(cwa%); CHR$(cwb%); "3": INPUT #1, VOLT.B: VOLT.B = VOLT.B / 10000
1550 PRINT #1, CHR$(cwa%); CHR$(cwb%); "4": INPUT #1, VOLT.O: VOLT.O = VOLT.O / 10000
1560 PRINT #1, CHR$(cwa%); CHR$(cwb%); "2": INPUT #1, VOLT.H: VOLT.H = VOLT.H / 10000
1570 TU = 72 + ((500 / VOLT.U - 180) / RS72.U - 1) / ALPHA.U: REM Calculate temperatures
1580 TL = 72 + ((500 / VOLT.L - 180) / RS72.L - 1) / ALPHA.L: REM Calculate temperatures
1600 TOUT = 72 + ((500 / VOLT.O - 200) / RS72.O - 1) / ALPHA.O: REM Calculate temperatures
1610 TH = 72 + ((500 / VOLT.H - 180) / RS72.H - 1) / ALPHA.H: REM Calculate temperatures
1620 IF (B.PRESS.LOW AND VOLT.B < 1) OR ((NOT B.PRESS.LOW) AND VOLT.B > 1) THEN B.PRESS.LOW.TIME# = NOW#
1630 IF VOLT.B > 1 THEN B.PRESS.LOW = -1 ELSE B.PRESS.LOW = 0
1640 RETURN
1680 IF SETU.TEMP(CI) = SETU.PERM(CI) THEN TTU$ = " " ELSE TTU$ = "t "
1690 IF SETL.TEMP(CI) = SETL.PERM(CI) THEN TTL$ = " " ELSE TTL$ = "t "
1700 IF SETSTAIRS.TEMP(CI) = SETSTAIRS.PERM(CI) THEN TTS$ = " " ELSE TTS$ = "t "
1710 CLS
1715 COLOR 4, 7
1720 PRINT " Date: " + DATE$ + " Time: " + TIME$
1730 PRINT
1735 COLOR 1, 7: PRINT " Current schedule:"
1740 PRINT " Upper level scheduled temperature: " + STR$(SETU.TEMP(CI)) + TTU$;
1750 IF SETU.TEMP(CI) = T1 OR (VAL(KEY.HIT$) > 0 AND VAL(KEY.HIT$) < 5) OR KEY.HIT$ = "c" OR KEY.HIT$ = "C" THEN PRINT "(" + MID$(STR$(T1U.ADJ), 2, 2) + ")"; ELSE PRINT " ";
1760 PRINT " Stairway Heaters: ";
1770 IF SETSTAIRS.TEMP(CI) = 1 THEN PRINT "ON" + TTS$ ELSE PRINT "OFF" + TTS$
1780 PRINT " Lower level scheduled temperature: " + STR$(SETL.TEMP(CI)) + TTL$;
1790 IF SETL.TEMP(CI) = T1 OR (VAL(KEY.HIT$) > 0 AND VAL(KEY.HIT$) < 5) OR KEY.HIT$ = "c" OR KEY.HIT$ = "C" THEN PRINT "(" + MID$(STR$(T1L.ADJ), 2, 2) + ")"; ELSE PRINT " ";
1800 PRINT " ": PRINT " ": PRINT " Current status:"
1810 PRINT " Upper level actual temperature: " + STR$(INT(TU + .5)) + " Upper level fan: ";
1820 IF FANU.ON THEN PRINT "ON" ELSE PRINT "OFF"
1830 PRINT " Lower level actual temperature: " + STR$(INT(TL + .5)) + " Lower level fan: ";
1840 IF FANL.ON THEN PRINT "ON" ELSE PRINT "OFF"
1850 PRINT " Outside temperature: " + STR$(INT(TOUT)) + " Boiler: ";
1860 IF BOILER.ON THEN PRINT "HEATING UP"
1870 IF (NOT BOILER.ON) AND (NOT B.PRESS.LOW) THEN PRINT "HOT"
1880 IF (NOT BOILER.ON) AND (B.PRESS.LOW) THEN PRINT "COOL"
1890 PRINT " Stairway Heaters: ";
1900 IF STAIRS.ON THEN PRINT "ON" ELSE PRINT "OFF"
1910 COLOR 15: PRINT " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
1915 PRINT " "
1917 PRINT " Press the A, B, or C Key, if you wish to select one of the options below:"
1918 COLOR 1, 7: PRINT
1920 PRINT " A . . . Change schedule (for authorized individuals only)"
1930 PRINT " B . . . Temporary heatup of building"
1940 PRINT " C . . . Menu for adjusting temperature settings"
1950 IF MID$(DATE$, 7, 4) <> "1980" GOTO 2025
1957 PRINT " "
1960 PRINT CHR$(7) + "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
1962 PRINT
1970 COLOR 23
1980 PRINT "NOTICE: ";
1990 COLOR 15
2000 PRINT "The computer's date is " + DATE$ + ", so default temperature settings"
2010 PRINT " are being used. See operating instructions for what to do."
2012 PRINT CHR$(7)
2015 COLOR 7
2025 IF (NOT DISP.MENU) GOTO 2080
2034 LOCATE 20, 1
2035 SKIP.HUMSG = 1
2038 COLOR 15
2040 PRINT " Press 1 to raise upper level setting one degree"
2050 PRINT " Press 2 to decrease upper level setting one degree"
2060 PRINT " Press 3 to raise lower level setting one degree"
2070 PRINT " Press 4 to decrease lower level setting one degree"
2075 COLOR 7
2080 IF HU.MESSAGE.TIME# > NOW# AND HU.MESSAGE.TIME# <> 0 THEN GOTO 2082 ELSE 2090
2082 IF SKIP.HUMSG = 1 GOTO 2090
2083 LOCATE 21, 3: COLOR 4, 7: PRINT HU.MESSAGE$;
2090 IF DISP.BURN THEN GOSUB 5050
2092 IF DISP.VAR THEN GOSUB 4900
2095 COLOR 1, 7
2098 SKIP.HUMSG = 0
2100 RETURN
2140 GOSUB 5120
2150 CLS
2152 PRINT " "
2155 PRINT CHR$(7);
2158 COLOR 4, 7
2160 PRINT " Only authorized individuals with a password are allowed to"
2170 PRINT " change the schedule. Press 'R'to return to the main menu"
2180 PRINT " display."
2182 PRINT " "
2185 COLOR 15
2190 PRINT " Enter the password: ";
2200 PASSWORD$ = ""
2205 LOOP.COUNTER = 0
2210 P$ = INKEY$
2220 IF P$ <> "" THEN PASSWORD$ = PASSWORD$ + P$: LOCATE CSRLIN, 28: PRINT PASSWORD$;
2230 IF (P$ = "R") OR (P$ = "r") OR (LOOP.COUNTER > PAUSE.LOOP.COUNT / 10) THEN RETURN
2240 IF LEN(PASSWORD$) >= 3 GOTO 2270
2250 LOOP.COUNTER = LOOP.COUNTER + 1
2260 GOTO 2210
2270 IF (PASSWORD$ <> "joe") AND (PASSWORD$ <> "JOE") GOTO 2275 ELSE 2290
2275 COLOR 4, 7: PRINT " < - INCORRECT PASSWORD - >"
2278 COLOR 15
2280 GOTO 2190
2290 COLOR 7: IF BOILER.ON THEN GOTO 2292 ELSE 2300
2292 cwb% = cwb% - 8
2295 GOSUB 5210
2297 BOILER.ON = 0
2300 CLS
2305 LOCATE 8, 1
2307 COLOR 1, 7
2310 PRINT " ENTER: T . . . . . . . Display TEMPORARY schedule"
2320 PRINT " ENTER: P . . . . . . . Display PERMANENT schedule"
2325 COLOR 15: PRINT " "
2330 PRINT " Enter a T or P to display the current schedule. Or just press"
2340 PRINT " return to go change the schedule.": PRINT
2345 COLOR 1, 7
2350 PRINT " (If the schedule is displayed, you must press C when"
2360 PRINT " done viewing, to change the schedule, or to go back"
2370 INPUT " to the main menu display) "; CHOICE$
2380 IF (CHOICE$ = "t") OR (CHOICE$ = "T") THEN GOSUB 4300: GOTO 2400
2390 IF (CHOICE$ = "p") OR (CHOICE$ = "P") THEN GOSUB 4500: GOTO 2400
2395 IF (CHOICE$ = "") THEN GOTO 2400 ELSE 590
2400 CHANGES.MADE = 0
2420 CLS
2425 COLOR 4, 7
2430 PRINT " DAY AREA TEMPERATURE TYPE OF CHANGE"
2435 COLOR 1, 7
2440 PRINT " 1 - Sunday 1 - Upper Level 1 -" + STR$(T1) + " 1 - Permanent"
2450 PRINT " 2 - Monday 2 - Lower Level 2 -" + STR$(T2) + " 2 - One week only"
2460 PRINT " 3 - Tuesday 3 - Stairs * 3 -" + STR$(T3) + ""
2470 PRINT " 4 - Wednesday 4 - Both levels 4 -" + STR$(T4) + ""
2480 PRINT " 5 - Thursday 5 - All 3 areas"
2490 PRINT " 6 - Friday "
2500 PRINT " 7 - Saturday * for stairs (" + STR$(T1) + " = on . all others = off)"
2510 PRINT " 8 - Monday through Friday"
2515 PRINT " 9 - Return to main menu"
2516 COLOR 15
2517 PRINT " "
2518 PRINT " ENTER: 9 . . . to exit without making any changes"
2519 PRINT " ": PRINT " "
2520 INPUT " Enter a number from 1 to 8 to select DAY(s): ", DAY$
2525 DAY = VAL(DAY$)
2527 IF DAY = 9 GOTO 590
2530 IF DAY < 1 OR DAY > 9 GOTO 2535 ELSE 2540
2535 PRINT CHR$(7) + " "
2537 GOTO 2520
2540 INPUT " Enter a number from 1 to 5 to select AREA(s): ", AREA$
2545 AREA = VAL(AREA$)
2550 IF AREA < 1 OR AREA > 5 GOTO 2555 ELSE 2560
2555 PRINT CHR$(7) + " "
2557 GOTO 2540
2560 INPUT " Enter a number from 1 to 4 to select TEMPERATURE: ", TEMP$
2565 TEMP = VAL(TEMP$)
2570 IF (TEMP < 1) OR (TEMP > 4) GOTO 2575 ELSE 2580
2575 PRINT CHR$(7) + " "
2577 GOTO 2560
2580 INPUT " Enter a number from 1 to 2 to select TYPE OF CHANGE: ", TYPE$
2585 TYYPE = VAL(TYPE$)
2590 IF (TYYPE < 1) OR (TYYPE > 2) GOTO 2595 ELSE 2600
2595 PRINT CHR$(7) + " ";
2597 GOTO 2580
2600 COLOR 4, 7: PRINT " Enter time range to change. Use military time (ie. 430 P.M. = 1630) "
2610 PRINT " time must have 4 digits, but no other characters. (example: 0900, 1730)"
2615 PRINT
2620 COLOR 15: INPUT " Starting time: "; S$
2625 COLOR 7
2630 S1$ = MID$(S$, 1, 1): S2$ = MID$(S$, 2, 1)
2640 S3$ = MID$(S$, 3, 1): S4$ = MID$(S$, 4, 1)
2650 IF (LEN(S$) <> 4) OR (S1$ <> "0" AND S1$ <> "1" AND S1$ <> "2") OR ((VAL(S2$) < 1 OR VAL(S2$) > 9) AND S2$ <> "0") OR (S1$ = "2" AND VAL(S2$) > 4) OR (S3$ <> "3" AND S3$ <> "0") OR (S4$ <> "0") GOTO 2655 ELSE 2660
2655 PRINT CHR$(7) + " "
2657 GOTO 2620
2660 COLOR 15: INPUT " Ending time: ", E$
2665 COLOR 7
2670 E1$ = MID$(E$, 1, 1): E2$ = MID$(E$, 2, 1)
2680 E3$ = MID$(E$, 3, 1): E4$ = MID$(E$, 4, 1)
2690 IF (LEN(E$) <> 4) OR (VAL(E$) <= VAL(S$)) OR (E1$ <> "0" AND E1$ <> "1" AND E1$ <> "2") OR ((VAL(E2$) < 1 OR VAL(E2$) > 9) AND E2$ <> "0") OR (E1$ = "2" AND VAL(E2$) > 4) OR (E3$ <> "3" AND E3$ <> "0") OR (E4$ <> "0") GOTO 2692 ELSE 2700
2692 PRINT CHR$(7) + " ";
2695 GOTO 2660
2700 CLS
2702 COLOR 1, 7: PRINT " "
2705 PRINT " 1 - Save current changes and leave (earlier changes will be saved)"
2710 PRINT " 2 - Save current changes and make more changes"
2720 PRINT " 3 - Leave, don't save current changes (earlier changes will be saved)"
2725 PRINT " ": PRINT " ": COLOR 15
2730 INPUT " Enter a 1, 2, or 3: ", CHOICE$
2735 COLOR 7
2740 IF CHOICE$ <> "1" AND CHOICE$ <> "2" AND CHOICE$ <> "3" GOTO 2742 ELSE 2750
2742 PRINT CHR$(7) + ""
2745 GOTO 2725
2750 IF CHOICE$ = "2" THEN CHANGES.MADE = -1
2760 IF (CHOICE$ = "3") AND (CHANGES.MADE) THEN GOSUB 4170
2770 IF CHOICE$ = "3" THEN RETURN
2790 LOCATE CSRLIN - 1, 48
2792 COLOR 4, 7
2795 PRINT " CHANGES BEING SAVED";
2797 FOR Z = 1 TO PAUSE.LOOP.COUNT / 10
2798 NEXT Z
2800 IF TEMP = 1 THEN TEMP = T1
2810 IF TEMP = 2 THEN TEMP = T2
2820 IF TEMP = 3 THEN TEMP = T3
2830 IF TEMP = 4 THEN TEMP = T4
2840 IF DAY <= 7 THEN START.INDEX = (DAY - 1) * 48 + VAL(MID$(S$, 1, 2)) * 2 + (VAL(MID$(S$, 3, 2)) + 30) / 30
2850 IF DAY = 8 THEN START.INDEX = (2 - 1) * 48 + VAL(MID$(S$, 1, 2)) * 2 + (VAL(MID$(S$, 3, 2)) + 30) / 30
2860 IF DAY <= 7 THEN END.INDEX = (DAY - 1) * 48 + VAL(MID$(E$, 1, 2)) * 2 + (VAL(MID$(E$, 3, 2)) + 30) / 30 - 1
2870 IF DAY = 8 THEN END.INDEX = (2 - 1) * 48 + VAL(MID$(E$, 1, 2)) * 2 + (VAL(MID$(E$, 3, 2)) + 30) / 30 - 1
2880 FOR x = 1 TO 5
2890 FOR Y = START.INDEX TO END.INDEX
2900 IF AREA = 1 OR AREA = 4 OR AREA = 5 THEN SETU.TEMP(Y) = TEMP
2910 IF (AREA = 1 OR AREA = 4 OR AREA = 5) AND TYYPE = 1 THEN SETU.PERM(Y) = TEMP
2920 IF AREA = 2 OR AREA = 4 OR AREA = 5 THEN SETL.TEMP(Y) = TEMP
2930 IF (AREA = 2 OR AREA = 4 OR AREA = 5) AND TYYPE = 1 THEN SETL.PERM(Y) = TEMP
2940 IF (AREA = 3 OR AREA = 5) AND (TEMP <> T1) THEN SETSTAIRS.TEMP(Y) = 0
2950 IF (AREA = 3 OR AREA = 5) AND (TEMP <> T1) AND (TYYPE = 1) THEN SETSTAIRS.PERM(Y) = 0
2960 IF AREA = 3 AND TEMP = T1 AND ((SETU.TEMP(Y) < T1 AND SETL.TEMP(Y) < T1) OR (TYYPE = 1 AND SETU.PERM(Y) < T1)) AND SETL.PERM(Y) THEN GOTO 2962 ELSE 2970
2962 COLOR 4, 7: PRINT " Stairs forbidden, no level 1 at " + STR$(T1) + ". " + S$ + " +"; STR$((Y - START.INDEX) / 2) + CHR$(7)
2963 COLOR 1, 7
2965 FOR Z = 1 TO PAUSE.LOOP.COUNT / 10
2967 NEXT Z
2970 IF (AREA = 3 OR AREA = 5) AND (TEMP = T1) THEN SETSTAIRS.TEMP(Y) = 1
2980 IF (AREA = 3 OR AREA = 5) AND (TEMP = T1) AND (TYYPE = 1) THEN SETSTAIRS.PERM(Y) = 1
2990 IF Y = CI AND (AREA = 1 OR AREA = 4 OR AREA = 5) THEN TUSET = TEMP
3000 IF Y = CI AND (AREA = 2 OR AREA = 4 OR AREA = 5) THEN TLSET = TEMP
3010 NEXT Y
3020 IF DAY <> 8 THEN x = 6
3030 START.INDEX = START.INDEX + 48
3035 END.INDEX = END.INDEX + 48
3040 NEXT x
3050 IF CHOICE$ = "2" GOTO 2420
3060 GOSUB 4170
3070 RETURN
3110 GOSUB 5120
3120 CLS
3126 PRINT CHR$(7)
3128 COLOR 4, 7
3130 PRINT " TEMPORARY HEATUP"
3132 PRINT " "
3133 COLOR 1, 7
3140 PRINT "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
3145 PRINT " "
3150 PRINT " ENTER: 1 . . . . Heat up UPPER level only"
3160 PRINT " ENTER: 2 . . . . Heat up LOWER level only"
3170 PRINT " ENTER: 3 . . . . Heat up BOTH levels"
3175 COLOR 15: PRINT " "
3180 PRINT " Enter a number from 1 to 3 to select which levels(s) to heat up "
3190 PRINT " (Press R to return with no selection)";
3200 COLOR 7: LOOP.COUNTER = 0
3210 LEVEL$ = INKEY$
3220 LOOP.COUNTER = LOOP.COUNTER + 1
3230 IF (LEVEL$ = "R") OR (LEVEL$ = "r") OR (LOOP.COUNTER > PAUSE.LOOP.COUNT) THEN RETURN
3240 IF LEVEL$ <> "1" AND LEVEL$ <> "2" AND LEVEL$ <> "3" GOTO 3210
3250 COLOR 4, 7
3252 PRINT " "; LEVEL$
3254 PRINT " "
3255 COLOR 7
3257 PRINT " ENTER: 0 . . . . Terminate Heat up"
3260 PRINT " ENTER: 1 . . . . Heat up the level for 1 hour"
3270 PRINT " ENTER: 2 . . . . Heat up the level for 2 hours"
3280 PRINT " ENTER: 3 . . . . Heat up the level for 3 hours"
3290 PRINT " ENTER: 4 . . . . Heat up the level for 4 hours"
3300 PRINT " ENTER: 5 . . . . Heat up the level for 5 hours"
3305 COLOR 15: PRINT " "
3310 PRINT " Enter a number from 1 to 5 to select how many hours the level should heat."
3315 PRINT " (Press R to return with no selection.)";
3320 COLOR 7: LOOP.COUNTER = 0
3330 length$ = INKEY$
3340 LOOP.COUNTER = LOOP.COUNTER + 1
3350 IF (length$ = "R") OR (length$ = "r") OR (LOOP.COUNTER > PAUSE.LOOP.COUNT) THEN RETURN
3360 IF (length$ <> "1") AND (length$ <> "2") AND (length$ <> "3") AND (length$ <> "4") AND (length$ <> "5") AND (length$ <> "0") THEN GOTO 3330
3370 COLOR 4, 7
3372 PRINT " "; length$
3374 PRINT " "
3375 FOR Z = 1 TO PAUSE.LOOP.COUNT / 50: NEXT Z
3377 CLS
3379 LOCATE 10, 1
3380 COLOR 4, 7
3382 PRINT " . . . HEAT UP HAS BEGUN . . ."
3385 COLOR 1, 7
3390 FOR Z = 1 TO PAUSE.LOOP.COUNT / 10
3395 NEXT Z
3400 GOSUB 1430
3410 END.INDEX = CI + (2 * VAL(length$))
3420 FOR x = CI TO END.INDEX
3430 IF (LEVEL$ = "1") OR (LEVEL$ = "3") THEN SETU.TEMP(x) = T1
3440 IF (LEVEL$ = "2") OR (LEVEL$ = "3") THEN SETL.TEMP(x) = T1
3450 IF x = 336 GOTO 3470
3460 NEXT x
3470 FOR x = 1 TO END.INDEX - 336
3480 IF (LEVEL$ = "1") OR (LEVEL$ = "3") THEN SETU.TEMP(x) = T1
3490 IF (LEVEL$ = "2") OR (LEVEL$ = "3") THEN SETL.TEMP(x) = T1
3500 NEXT x
3510 IF LEVEL$ = "1" OR LEVEL$ = "3" THEN TUSET = T1
3520 IF LEVEL$ = "2" OR LEVEL$ = "3" THEN TLSET = T1
3530 IF (LEVEL$ = "1" OR LEVEL$ = "3") AND (TU < T1 - 4) THEN HUMU = -1
3540 IF (LEVEL$ = "2" OR LEVEL$ = "3") AND (TL < T1 - 4) THEN HUML = -1
3550 HU.MESSAGE$ = "{ A temporary heatup of " + length$ + " hour(s) was begun at " + TIME$ + " }"
3555 PRINT " "
3560 HU.MESSAGE.TIME# = NOW# + 60 * (VAL(length$))
3570 FOR Z = 1 TO PAUSE.LOOP.COUNT / 10
3580 NEXT Z
3620 NEW.TEMP.U = 0
3630 FOR x = CI TO 336
3640 IF SETU.TEMP(CI) <> SETU.TEMP(x) THEN GOTO 3641 ELSE 3650
3641 NEW.INDEX.U = x
3645 NEW.TEMP.U = SETU.TEMP(x)
3647 x = 337
3650 NEXT x
3660 IF NEW.TEMP.U <> 0 GOTO 3700
3670 FOR x = 1 TO CI
3680 IF SETU.TEMP(CI) <> SETU.TEMP(x) THEN GOTO 3681 ELSE 3690
3681 NEW.INDEX.U = x
3685 NEW.TEMP.U = SETU.TEMP(x)
3687 x = CI + 1
3690 NEXT x
3700 IF NEW.INDEX.U < CI THEN NUMBER.U = 336 - CI + NEW.INDEX.U - 1 ELSE NUMBER.U = NEW.INDEX.U - CI - 1
3710 CHANGE.TIME.U = NUMBER.U * 30 + (30 - 30 * (NOW# / 30 - INT(NOW# / 30)))
3720 WUT.U = TCU * (NEW.TEMP.U - TU) / (ABS(300 - ((NEW.TEMP.U + TU) / 2 - TOUT) / TRU))
3740 IF HUMU AND (TU < TUSET) AND (WUT.U > (CHANGE.TIME.U - 100)) GOTO 3810
3750 IF HUMU AND ((TU >= TUSET) OR ((WUT.U + 100) <= (CHANGE.TIME.U - 100))) GOTO 3752 ELSE 3760
3752 HUMU = 0
3755 GOTO 3810
3760 IF NEW.TEMP.U < SETU.TEMP(CI) AND CHANGE.TIME.U < 15 GOTO 3762 ELSE 3770
3762 TUSET = NEW.TEMP.U
3765 GOTO 3810
3770 IF TUSET > SETU.TEMP(CI) GOTO 3772 ELSE 3780
3772 TUSET = SETU.TEMP(CI)
3775 GOTO 3810
3780 IF (NEW.TEMP.U > SETU.TEMP(CI)) AND (WUT.U > CHANGE.TIME.U) AND (TU < (NEW.TEMP.U - 2)) AND (TOUT < 60) GOTO 3782 ELSE 3795
3782 TUSET = NEW.TEMP.U
3784 HUMU = -1
3785 GOTO 3810
3795 IF TUSET < SETU.TEMP(CI) THEN TUSET = SETU.TEMP(CI)
3810 NEW.TEMP.L = 0
3820 FOR x = CI TO 336
3830 IF SETL.TEMP(CI) <> SETL.TEMP(x) GOTO 3831 ELSE 3840
3831 NEW.INDEX.L = x
3835 NEW.TEMP.L = SETL.TEMP(x)
3837 x = 337
3840 NEXT x
3850 IF NEW.TEMP.L <> 0 GOTO 3890
3860 FOR x = 1 TO CI
3870 IF SETL.TEMP(CI) <> SETL.TEMP(x) GOTO 3871 ELSE 3880
3871 NEW.INDEX.L = x
3875 NEW.TEMP.L = SETL.TEMP(x)
3877 x = CI + 1
3880 NEXT x
3890 IF NEW.INDEX.L < CI THEN NUMBER.L = 336 - CI + NEW.INDEX.L - 1 ELSE NUMBER.L = NEW.INDEX.L - CI - 1
3900 CHANGE.TIME.L = NUMBER.L * 30 + (30 - 30 * (NOW# / 30 - INT(NOW# / 30)))
3910 WUT.L = TCL * (NEW.TEMP.L - TL) / (ABS(300 - ((NEW.TEMP.L + TL) / 2 - TOUT) / TRL))
3930 IF HUML AND (TL < TLSET) AND (WUT.L > (CHANGE.TIME.L - 50)) GOTO 3990
3940 IF HUML AND ((TL >= TLSET) OR (WUT.L <= (CHANGE.TIME.L - 50))) GOTO 3942 ELSE 3950
3942 HUML = 0
3945 GOTO 3990
3950 IF NEW.TEMP.L < SETL.TEMP(CI) AND CHANGE.TIME.L < 15 GOTO 3952 ELSE 3960
3952 TLSET = NEW.TEMP.L
3955 GOTO 3990
3960 IF (TLSET > SETL.TEMP(CI)) GOTO 3962 ELSE 3970
3962 TLSET = SETL.TEMP(CI)
3965 GOTO 3990
3970 IF (NEW.TEMP.L > SETL.TEMP(CI)) AND (WUT.L > CHANGE.TIME.L) AND (TL < (NEW.TEMP.L - 2)) AND (TOUT < 60) GOTO 3972 ELSE 3980
3972 TLSET = NEW.TEMP.L
3975 HUML = -1
3977 GOTO 3990
3980 IF TLSET < SETL.TEMP(CI) THEN TLSET = SETL.TEMP(CI)
3990 RETURN
4030 IF TUSET = T1U.ADJ THEN DTU = .75 ELSE IF TUSET = T2 THEN DTU = 1.5 ELSE DTU = 2
4040 IF TLSET = T1L.ADJ THEN DTL = .75 ELSE IF TLSET = T2 THEN DTL = 1.5 ELSE DTL = 2
4050 IF TU < (TUSET - DTU) GOTO 4100
4060 IF TL < (TLSET - DTL) GOTO 4100
4070 IF (HUMU OR HUML) GOTO 4100
4080 RETURN
4100 cwb% = cwb% + 8
4110 GOSUB 5210
4115 BOILER.ON = -1
4118 GOSUB 1180
4120 SHORT.CYCLE.START# = NOW#
4130 RETURN
4170 OPEN "C:schedule.dat" FOR OUTPUT AS #2
4180 REM GOTO 4270
4185 FOR x = 1 TO 336
4190 PRINT #2, SETU.PERM(x)
4200 PRINT #2, SETL.PERM(x)
4210 PRINT #2, SETSTAIRS.PERM(x)
4220 PRINT #2, SETU.TEMP(x)
4230 PRINT #2, SETL.TEMP(x)
4240 PRINT #2, SETSTAIRS.TEMP(x)
4250 NEXT x
4260 CLOSE #2
4270 RETURN
4300 CLS
4301 COLOR 4, 7
4302 PRINT " ****** SCHEDULE (TEMPORARY) FOR 12:01 AM (PM) TO 5:30 AM (PM) ******"
4303 COLOR 1, 7
4304 GOSUB 5400
4318 FOR x = 1 TO 12
4320 FOR Y = 1 TO 7
4322 IF Y = 1 THEN GOSUB 5300
4324 PRINT USING "#"; INT(SETU.TEMP(x + (Y - 1) * 48) / 10);
4326 PRINT " ";
4328 PRINT USING "#"; INT(SETL.TEMP(x + (Y - 1) * 48) / 10);
4330 IF SETSTAIRS.TEMP(x + (Y - 1) * 48) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4332 PRINT USING "#"; INT(SETU.TEMP(x + (Y - 1) * 48 + 24) / 10);
4334 PRINT " ";
4336 PRINT USING "#"; INT(SETL.TEMP(x + (Y - 1) * 48 + 24) / 10);
4338 IF SETSTAIRS.TEMP(x + (Y - 1) * 48 + 24) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4340 IF Y < 7 THEN PRINT " ";
4342 IF Y = 7 AND x < 24 THEN PRINT CHR$(13);
4344 NEXT Y
4346 NEXT x
4348 COLOR 5, 7: PRINT "NOTE: 12:01AM=MIDNITE 12:01PM=NOON U/L = UPPER/LOWER LEVEL 5=50;6=65;7=70 DEG."
4349 COLOR 15
4350 PRINT " ENTER: N . . . . To get schedule for next six hour period."
4352 PRINT " ENTER: C . . . . To make a change to the schedule."
4353 COLOR 7
4354 GOSUB 5120
4362 PAUSE$ = INKEY$
4366 IF (PAUSE$ = "n") OR (PAUSE$ = "N") GOTO 4400
4370 IF (PAUSE$ = "c") OR (PAUSE$ = "C") THEN RETURN
4374 GOTO 4362
4400 CLS
4401 COLOR 4, 7
4402 PRINT " ****** SCHEDULE (TEMPORARY) FOR 06:00 AM (PM) TO 11:30 AM (PM) ******"
4403 COLOR 1, 7
4404 GOSUB 5400
4418 FOR x = 13 TO 24
4420 FOR Y = 1 TO 7
4422 IF Y = 1 THEN GOSUB 5330
4424 PRINT USING "#"; INT(SETU.TEMP(x + (Y - 1) * 48) / 10);
4426 PRINT " ";
4428 PRINT USING "#"; INT(SETL.TEMP(x + (Y - 1) * 48) / 10);
4430 IF SETSTAIRS.TEMP(x + (Y - 1) * 48) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4432 PRINT USING "#"; INT(SETU.TEMP(x + (Y - 1) * 48 + 24) / 10);
4434 PRINT " ";
4436 PRINT USING "#"; INT(SETL.TEMP(x + (Y - 1) * 48 + 24) / 10);
4438 IF SETSTAIRS.TEMP(x + (Y - 1) * 48 + 24) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4440 IF Y < 7 THEN PRINT " ";
4442 IF Y = 7 AND x < 24 THEN PRINT CHR$(13);
4444 NEXT Y
4446 NEXT x
4448 COLOR 5, 7: PRINT " NOTE: U/L = UPPER/LOWER LEVEL 5 = 50; 6 = 65; 7 = 70 DEGREES"
4449 COLOR 15
4450 PRINT " ENTER: P . . . . To get schedule for previous six hour period."
4452 PRINT " ENTER: C . . . . To make a change to the schedule."
4453 COLOR 7
4454 GOSUB 5120
4462 PAUSE$ = INKEY$
4466 IF (PAUSE$ = "p") OR (PAUSE$ = "P") GOTO 4300
4470 IF (PAUSE$ = "c") OR (PAUSE$ = "C") THEN RETURN
4474 GOTO 4462
4500 CLS
4501 COLOR 4, 7
4502 PRINT " ****** SCHEDULE (PERMANENT) FOR 12:01 AM (PM) TO 5:30 AM (PM) ******"
4503 COLOR 1, 7
4504 GOSUB 5400
4518 FOR x = 1 TO 12
4520 FOR Y = 1 TO 7
4522 IF Y = 1 THEN GOSUB 5300
4524 PRINT USING "#"; INT(SETU.PERM(x + (Y - 1) * 48) / 10);
4526 PRINT " ";
4528 PRINT USING "#"; INT(SETL.PERM(x + (Y - 1) * 48) / 10);
4530 IF SETSTAIRS.PERM(x + (Y - 1) * 48) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4532 PRINT USING "#"; INT(SETU.PERM(x + (Y - 1) * 48 + 24) / 10);
4534 PRINT " ";
4536 PRINT USING "#"; INT(SETL.PERM(x + (Y - 1) * 48 + 24) / 10);
4538 IF SETSTAIRS.PERM(x + (Y - 1) * 48 + 24) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4540 IF Y < 7 THEN PRINT " ";
4542 IF Y = 7 AND x < 24 THEN PRINT CHR$(13);
4544 NEXT Y
4546 NEXT x
4548 COLOR 5, 7: PRINT "NOTE: 12:01AM=MIDNITE 12:01PM=NOON U/L = UPPER/LOWER LEVEL 5=50;6=65;7=70 DEG."
4549 COLOR 15
4550 PRINT " ENTER: N . . . . To get schedule for next six hour period."
4552 PRINT " ENTER: C . . . . To make a change to the schedule."
4553 COLOR 7
4554 GOSUB 5120
4558 PAUSE$ = INKEY$
4562 IF (PAUSE$ = "n") OR (PAUSE$ = "N") GOTO 4600
4566 IF (PAUSE$ = "c") OR (PAUSE$ = "C") THEN RETURN
4570 GOTO 4558
4600 CLS
4601 COLOR 4, 7
4602 PRINT " ****** SCHEDULE (PERMANENT) FOR 06:00 AM (PM) TO 11:30 AM (PM) ******"
4603 COLOR 1, 7
4604 GOSUB 5400
4618 FOR x = 13 TO 24
4620 FOR Y = 1 TO 7
4622 IF Y = 1 THEN GOSUB 5330
4624 PRINT USING "#"; INT(SETU.PERM(x + (Y - 1) * 48) / 10);
4626 PRINT " ";
4628 PRINT USING "#"; INT(SETL.PERM(x + (Y - 1) * 48) / 10);
4630 IF SETSTAIRS.PERM(x + (Y - 1) * 48) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4632 PRINT USING "#"; INT(SETU.PERM(x + (Y - 1) * 48 + 24) / 10);
4634 PRINT " ";
4636 PRINT USING "#"; INT(SETL.PERM(x + (Y - 1) * 48 + 24) / 10);
4638 IF SETSTAIRS.PERM(x + (Y - 1) * 48 + 24) = 1 THEN PRINT CHR$(177) + ""; ELSE PRINT " ";
4640 IF Y < 7 THEN PRINT " ";
4642 IF Y = 7 AND x < 24 THEN PRINT CHR$(13);
4644 NEXT Y
4646 NEXT x
4648 COLOR 5, 7: PRINT " NOTE: U/L = UPPER/LOWER LEVEL 5 = 50; 6 = 65; 7 = 70 DEGREES"
4651 COLOR 15
4650 PRINT " ENTER: P . . . . To get schedule for previous six hour period."
4652 PRINT " ENTER: C . . . . To make a change to the schedule."
4653 COLOR 7
4654 GOSUB 5120
4662 PAUSE$ = INKEY$
4666 IF (PAUSE$ = "p") OR (PAUSE$ = "P") GOTO 4500
4670 IF (PAUSE$ = "c") OR (PAUSE$ = "C") THEN RETURN
4674 GOTO 4662
4750 FOR x = 1 TO 336
4760 SETU.PERM(x) = 50
4770 SETL.PERM(x) = 50
4780 SETSTAIRS.PERM(x) = 0
4790 SETU.TEMP(x) = 50
4800 SETL.TEMP(x) = 50
4810 SETSTAIRS.TEMP(x) = 0
4820 NEXT x
4870 RETURN
4900 CLS : PRINT ""
4905 PRINT " TU = "; : PRINT USING "###"; TU;
4910 PRINT " TL = "; : PRINT USING "###"; TL;
4915 PRINT " TH = "; : PRINT USING "###"; TH
4920 PRINT " TUSET = " + STR$(TUSET);
4925 PRINT " TLSET = " + STR$(TLSET)
4930 PRINT " NEW.TEMP.L ="; : PRINT NEW.TEMP.L; : PRINT " CHANGE.TIME.L ="; : PRINT USING "###.##"; CHANGE.TIME.L / 60
4932 PRINT " NEW.TEMP.U ="; : PRINT NEW.TEMP.U; : PRINT " CHANGE.TIME.U ="; : PRINT USING "###.##"; CHANGE.TIME.U / 60
4933 PRINT " NUMBER.L ="; : PRINT NUMBER.L; : PRINT " NEW INDEX NUMBER L = "; : PRINT NEW.INDEX.L
4934 PRINT " NUMBER.U ="; : PRINT NUMBER.U; : PRINT " NEW INDEX NUMBER U = "; : PRINT NEW.INDEX.U
4935 PRINT " BLR PRESS LOW =";
4940 PRINT USING "##"; B.PRESS.LOW;
4945 PRINT " BOILER PRESS LOW TIME = ";
4950 PRINT USING "#####.##"; (NOW# - B.PRESS.LOW.TIME#) / 60;
4955 PRINT " (Hrs)"
4960 PRINT " HUMU = "; STR$(HUMU);
4965 PRINT " HUML = "; STR$(HUML)
4970 PRINT " CI = " + STR$(CI);
4975 PRINT " CTU = ";
4980 PRINT USING "###.#"; CHANGE.TIME.U / 60;
4985 PRINT " CTL = ";
4990 PRINT USING "###.#"; CHANGE.TIME.L / 60
4995 PRINT " WUTU = ";
5000 PRINT USING "###.#"; WUT.U / 60;
5005 PRINT " WUTL = ";
5010 PRINT USING "###.#"; WUT.L / 60
5015 PRINT " BOILER ON = "; BOILER.ON;
5017 PRINT " Volt.B = "; VOLT.B;
5030 PRINT " NOW# = "; : PRINT USING "#####.##"; NOW#
5032 PRINT " B.PRESS.LOW.TIME#/60 = "; : PRINT USING "#####.##"; B.PRESS.LOW.TIME# / 60
5033 PRINT " FOUR.YR.PERIODS = "; FOUR.YR.PERIODS; : PRINT " YR.MIN = "; YR.MIN
5034 PRINT " DAYS.TO.DATE = "; DAYS.TO.DATE; : PRINT "WEEKS.TO.DATE = "; WEEKS.TO.DATE
5035 PRINT " DAY.OF.WEEK ="; DAY.OF.WEEK; : PRINT " DAYS.PER.MON(MON) ="; DAYS.PER.MON(MON)
5036 PRINT " (SUNDAY = 0)"
5037 PRINT " MON.DAYS = "; MON.DAYS
5038 PRINT " YR ="; YR + 1, "MON = "; MON, " DAY = "; DAY, "; HOUR = "; HR, "; MIN = "; MIN; ""
5039 GOSUB 5250
5040 RETURN
5050 CLS : PRINT " ": PRINT " ": COLOR 4, 7
5056 PRINT " Furnace Burn Time In Minutes "
5057 PRINT " ---------------------------- "
5058 PRINT " Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
5059 PRINT " ------ ------ ------- --------- -------- ------ --------"
5060 PRINT USING " #### "; DBT(1);
5061 PRINT USING "#### "; DBT(2);
5062 PRINT USING "#### "; DBT(3);
5063 PRINT USING "#### "; DBT(4);
5064 PRINT USING "#### "; DBT(5);
5065 PRINT USING "#### "; DBT(6);
5067 PRINT USING "####"; DBT(7)
5080 PRINT " "
5082 PRINT " Furnace Weekly Burn Time in Minutes "
5085 PRINT " ----------------------------------- "
5087 PRINT " WBT = "; : PRINT USING "#####"; WBT
5088 PRINT " One day = 1440 minutes One week = 10080 minutes"
5089 PRINT " "; : PRINT DD$; : PRINT " "; : PRINT TT$
5090 GOSUB 5250
5095 RETURN
5120 FOR x = 1 TO 20
5125 JUNK$ = INKEY$
5130 NEXT x
5135 RETURN
5150 ONCOUNT = ONCOUNT + 1: REM Increment oncount each pass thru 30 second main loop
5155 ONTIME = ONCOUNT * .5: REM Each count = .5 minute
5160 D = DAY.OF.WEEK + 1
5165 DBT(D) = ONTIME: REM save time in array BDT for current day
5168 WBT = DBT(1) + DBT(2) + DBT(3) + DBT(4) + DBT(5) + DBT(6) + DBT(7): REM Save weekly total
5169 STORE.EVERY.FIVEMIN = STORE.EVERY.FIVEMIN + 1
5170 IF STORE.EVERY.FIVEMIN = 10 THEN GOTO 5171 ELSE 5178
5171 STORE.EVERY.FIVEMIN = 0
5172 GOSUB 5582
5178 RETURN
5180 REM OPEN "C:HISTORY.DAT" FOR APPEND AS #3
5182 GOTO 5209: REM IF HEADER = 0 GOTO 5185 ELSE 5187
5183 PRINT #3, "Mon Day Hr Min TU TL Tout BLR.ON B.PRESS.LOW Volt.B HUML HUMU CI"
5184 PRINT #3, MON; DAY; HR; MIN; INT(TU); INT(TL);
5185 PRINT #3, USING " ##"; INT(TOUT);
5186 PRINT #3, USING " ##"; B.PRESS.LOW;
5187 PRINT #3, USING " ##"; BOILER.ON;
5188 PRINT #3, USING "###.##"; VOLT.B;
5190 PRINT #3, USING " ##"; HUML; HUMU;
5191 PRINT #3, USING "####"; CI
5192 CLOSE #3
5196 ENTRY# = ENTRY# + 1
5200 OPEN "C:BURNAPND.DAT" FOR APPEND AS #3
5201 IF HEADER = 0 THEN GOTO 5202 ELSE 5203
5202 PRINT #3, " Sun Mon Tue Wed Thu Fri Sat WBT OnCount"
5203 FOR E = 1 TO 7
5204 PRINT #3, DBT(E);
5205 NEXT E
5206 PRINT #3, WBT; ONCOUNT
5207 CLOSE #3
5208 HEADER = HEADER + 1: IF HEADER = 17 THEN HEADER = 0
5209 RETURN
5210 GOTO 5220
5212 PRINT #1, CHR$(cwa%); CHR$(cwb%); "0"
5215 INPUT #1, JUNK
5220 RETURN
5250 PRINT " ": COLOR 15: PRINT " TO RETURN TO MAIN PROGRAM DISPLAY: PRESS SHIFT and * TOGETHER"
5255 RETURN
5300 IF x = 1 THEN PRINT " 12:01 ";
5301 IF x = 2 THEN PRINT " 12:30 ";
5302 IF x = 3 THEN PRINT " 01:00 ";
5303 IF x = 4 THEN PRINT " 01:30 ";
5304 IF x = 5 THEN PRINT " 02:00 ";
5305 IF x = 6 THEN PRINT " 02:30 ";
5306 IF x = 7 THEN PRINT " 03:00 ";
5307 IF x = 8 THEN PRINT " 03:30 ";
5308 IF x = 9 THEN PRINT " 04:00 ";
5309 IF x = 10 THEN PRINT " 04:30 ";
5310 IF x = 11 THEN PRINT " 05:00 ";
5311 IF x = 12 THEN PRINT " 05:30 ";
5320 RETURN
5330 IF x = 13 THEN PRINT " 06:00 ";
5331 IF x = 14 THEN PRINT " 06:30 ";
5332 IF x = 15 THEN PRINT " 07:00 ";
5333 IF x = 16 THEN PRINT " 07:30 ";
5334 IF x = 17 THEN PRINT " 08:00 ";
5335 IF x = 18 THEN PRINT " 08:30 ";
5336 IF x = 19 THEN PRINT " 09:00 ";
5337 IF x = 20 THEN PRINT " 09:30 ";
5338 IF x = 21 THEN PRINT " 10:00 ";
5339 IF x = 22 THEN PRINT " 10:30 ";
5340 IF x = 23 THEN PRINT " 11:00 ";
5341 IF x = 24 THEN PRINT " 11:30 ";
5350 RETURN
5400 COLOR 4, 7: PRINT " "
5405 PRINT " TIME SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY"
5410 PRINT " ------ ------- ------- ------- --------- -------- ------- --------"
5415 COLOR 5, 7: PRINT " (BOTH AM. PM. AM. PM. AM. PM. AM. PM. AM. PM. AM. PM. AM. PM."
5420 PRINT " A.M. & --- --- --- --- --- --- --- --- --- --- --- --- --- ---"
5422 COLOR 6, 7
5425 PRINT " P.M.) U L U L U L U L U L U L U L U L U L U L U L U L U L U L"
5430 PRINT " ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
5432 COLOR 1, 7
5435 RETURN
5531 REM OPEN "C:BURNHIST.DAT" FOR INPUT AS #7
5533 REM FOR D = 1 TO 7
5534 REM INPUT #7, DBT(D)
5535 REM NEXT D
5537 REM INPUT #7, WBT
5539 REM INPUT #7, ONCOUNT
5540 REM CLOSE #7
5541 REM RETURN
5582 OPEN "C:BURNHIST.DAT" FOR OUTPUT AS #7
5583 FOR D = 1 TO 7
5584 PRINT #7, USING " ####"; DBT(D)
5585 NEXT D
5586 PRINT #7, USING "#####"; WBT
5587 PRINT #7, USING "#####"; ONCOUNT
5589 CLOSE #7
5600 RETURN
6000 END