brewco/brewco.h

Sat, 28 Nov 2015 20:15:38 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 28 Nov 2015 20:15:38 +0100
changeset 441
bde74a8f2ad7
parent 438
7d1ec160d751
child 443
6b80a37fdf8d
permissions
-rw-r--r--

Added automate state file.

409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 #ifndef _BREWCO_H
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 #define _BREWCO_H
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 #define TRUE 1
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 #define FALSE 0
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 #include "../config.h"
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
8 #include "pid.h"
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 #include <stdlib.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 #include <stdio.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 #include <stdint.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 #include <stdarg.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 #include <string.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 #include <ctype.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 #include <sys/types.h>
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
17 #include <sys/socket.h>
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 #include <sys/stat.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 #include <sys/time.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 #include <time.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 #include <fcntl.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 #include <syslog.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 #include <unistd.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 #include <errno.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 #include <signal.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 #include <getopt.h>
410
e3f8a51b566a Fixed compiling on systems without SDL libraries, and they don't need tha brewpanel program.
Michiel Broek <mbroek@mbse.eu>
parents: 409
diff changeset
27 #include <limits.h>
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
28 #include <sys/socket.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
29 #include <arpa/inet.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
30 #include <netdb.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
31 #include <poll.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
32 #include <dirent.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
33 #include <uuid/uuid.h>
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
34 #include <math.h>
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 #ifndef HAVE_WIRINGPI_H
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 #include <pthread.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 #endif
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 #include <libxml/xmlmemory.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 #include <libxml/parser.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 #include <libxml/encoding.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 #include <libxml/xmlwriter.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 #ifdef HAVE_WIRINGPI_H
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 /* wiringPi */
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 #include <wiringPi.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 #include <pcf8574.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 #include <lcd.h>
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 /*
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 * Thread locks
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 */
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 #define LOCK_DEVICES 0
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 #define LOCK_LCD 1
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 #define LOCK_MENU 2
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 #define LOCK_SPARE2 3
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 #endif
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 /*
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 * 1-Wire devices
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 */
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 #define W1_FAMILY_DEFAULT 0
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 #define W1_FAMILY_SMEM_01 0x01
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 #define W1_FAMILY_SMEM_81 0x81
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 #define W1_THERM_DS18S20 0x10
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 #define W1_FAMILY_DS28E04 0x1C
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 #define W1_COUNTER_DS2423 0x1D
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 #define W1_THERM_DS1822 0x22
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 #define W1_EEPROM_DS2433 0x23
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 #define W1_THERM_DS18B20 0x28
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 #define W1_FAMILY_DS2408 0x29
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 #define W1_EEPROM_DS2431 0x2D
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 #define W1_FAMILY_DS2760 0x30
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 #define W1_FAMILY_DS2780 0x32
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 #define W1_FAMILY_DS2413 0x3A
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 #define W1_THERM_DS1825 0x3B
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 #define W1_FAMILY_DS2781 0x3D
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 #define W1_THERM_DS28EA00 0x42
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 #define MBSE_SS(x) (x)?(x):"(null)"
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85
435
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
86 /*
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
87 * Sensor strcuture
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
88 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
89 typedef struct _sensor_var {
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
90 char uuid[37]; /* sensor uuid */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
91 int state; /* sensor state */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
92 int value; /* sensor value */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
93 } sensor_var;
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
94
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
95
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
96
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
97 /*
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
98 * Switch structure
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
99 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
100 typedef struct _switch_var {
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
101 char uuid[37]; /* switch uuid */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
102 int value; /* switch value (0..100) */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
103 int delay; /* switch delay */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
104 } switch_var;
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
105
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
106
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
107
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
108 /*
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
109 * Brewing units. The sensors of the units are connected via the 1-wire bus.
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
110 * The heaters, pumps (or mixer) are connected on the Pi GPIO. The hardware
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
111 * is configured in the devices lists.
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
112 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
113 typedef struct _units_list {
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
114 struct _units_list *next;
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
115 int version; /* Record version */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
116 char *uuid; /* uuid code */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
117 char *name; /* Unit name */
441
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
118 int number; /* Unit number */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
119 int active; /* 0/1 active unit */
435
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
120 sensor_var *hlt_sensor; /* HLT sensor */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
121 switch_var *hlt_heater; /* HLT heater */
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
122 int hlt_heater_mltfirst; /* HLT heater MLT high priority */
435
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
123 sensor_var *mlt_sensor; /* MLT sensor */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
124 switch_var *mlt_heater; /* MLT heater */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
125 switch_var *mlt_pump; /* MLT pump */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
126 int pump_cycle; /* 5..15 minutes */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
127 int pump_rest; /* 1..5 minutes */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
128 int pump_premash; /* 0/1 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
129 int pump_onmash; /* 0/1 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
130 int pump_mashout; /* 0/1 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
131 int pump_onboil; /* 0/1 pump during boiling */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
132 int pump_stop; /* 80..105 C */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
133 int skip_add; /* 0/1 skip Add phase */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
134 int skip_remove; /* 0/1 skip Remove phase */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
135 int skip_iodine; /* 0/1 skip Iodine test */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
136 int iodine_time; /* 0..90 minutes */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
137 int whirlpool; /* off/cold/hot */
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
138 pid_var *PID_hlt; /* HLT PID */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
139 pid_var *PID_mlt; /* MLT PID */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
140 } units_list;
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
141
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
142
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
143
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
144 /*
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
145 * External devices like sensors, relays, SSR.
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
146 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
147 typedef struct _dev_list {
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
148 struct _dev_list *next;
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
149 int version; /* Version 1 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
150 char *uuid; /* UUID of this device */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
151 int type; /* Device type */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
152 int direction; /* Device direction */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
153 int value; /* Device value */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
154 int offset; /* Device offset value */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
155 int present; /* Device present */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
156 char *address; /* Device address */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
157 int subdevice; /* Device sub address */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
158 int gpiopin; /* Device GPIO pin or -1 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
159 char *description; /* Device description */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
160 int inuse; /* In use counter */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
161 char *comment; /* What we think it is */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
162 time_t timestamp; /* Last updated */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
163 } devices_list;
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
164
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
165
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
166 #define DEVTYPE_NA 0 /* Unknown device type */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
167 #define DEVTYPE_W1 1 /* 1-Wire bus */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
168 #define DEVTYPE_GPIO 2 /* GPIO I/O device */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
169 #define DEVTYPE_I2C 3 /* I2C bus device */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
170 #define DEVTYPE_SPI 4 /* SPI bus device */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
171 #ifdef USE_SIMULATOR
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
172 #define DEVTYPE_SIM 5 /* Simulated device */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
173 #endif
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
174
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
175 #define DEVPRESENT_UNDEF 0 /* Precence not testable */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
176 #define DEVPRESENT_NO 1 /* Device is missing */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
177 #define DEVPRESENT_YES 2 /* Device is detected */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
178 #define DEVPRESENT_ERROR 3 /* Device is in error */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
179
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
180 #define DEVDIR_UNDEF 0 /* Undefined */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
181 #define DEVDIR_IN_BIN 1 /* Binary input */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
182 #define DEVDIR_OUT_BIN 2 /* Binary output */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
183 #define DEVDIR_IN_ANALOG 3 /* Temperature input etc. */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
184 #define DEVDIR_OUT_ANALOG 4 /* Analog steering */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
185 #define DEVDIR_OUT_PWM 5 /* PWM outout */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
186 #define DEVDIR_INTERN 6 /* Internal function */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
187
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
188
435
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
189
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
190 /*
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
191 * Recipes.
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
192 */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
193 typedef struct _mash_step {
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
194 char name[21]; /* Step name */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
195 int min; /* Minimum temperature */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
196 int max; /* Maximum temperature */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
197 int canskip; /* 0/1 can we skip this step */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
198 int setpoint; /* Temperature setpoint */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
199 int skip; /* Skip this step */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
200 int duration; /* Step duration */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
201 } mash_step;
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
202
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
203 // mash-in 20 80 noskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
204 // fitasi 25 55 canskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
205 // glucanasi 35 50 canskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
206 // proteasi 45 60 canskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
207 // B-amilasi 50 70 canskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
208 // A-amilasi 1 60 76 canskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
209 // A-amilasi 2 60 76 noskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
210 // mash-out 75 80 noskip
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
211
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
212 typedef struct _hop_addition {
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
213 char name[21]; /* Hop name */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
214 int boil_duration; /* -1=fwh, 0..boiltime */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
215 } hop_addition;
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
216
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
217 typedef struct _a_recipe {
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
218 char uuid[37]; /* Recipe uuid */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
219 char code[21]; /* Recipe code */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
220 char name[21]; /* Recipe name */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
221 mash_step mash[8]; /* 8 mash steps */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
222 hop_addition hops[10]; /* 10 hop additions */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
223 int boiltime; /* 1..240 minutes */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
224 time_t started; /* Start time */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
225 time_t endtime; /* Ending time */
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
226 } a_recipe;
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
227
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
228
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
229
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
230
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
231 #ifdef USE_SIMULATOR
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
232
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
233 /*
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
234 * Simulate a HLT and MLT.
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
235 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
236 typedef struct _simulator {
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
237 double room_temperature; /* Simulated envionment temp */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
238 double hlt_temperature; /* Simulated HLT temperature */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
239 double hlt_heater_temp; /* Maximum heater temp */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
240 int hlt_heater_time; /* Time to reach temperature */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
241 float hlt_heater_size; /* Size of the heater */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
242 int hlt_heater_state; /* Heater status */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
243 double mlt_temperature; /* Simulated MLT temperature */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
244 double mlt_heater_temp; /* Maximum heater temp */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
245 int mlt_heater_time; /* Time to reach temperature */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
246 float mlt_heater_size; /* Size of the heater */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
247 int mlt_heater_state; /* Heater status */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
248 /*
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
249 * Status values, maintained by the simulator but stored
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
250 * here so they don't get lost over program restarts.
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
251 */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
252 double s_hlt_temp; /* Temp HLT */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
253 double s_mlt_temp; /* Temp MLT */
438
7d1ec160d751 Added simulator configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 435
diff changeset
254 } simulator_var;
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
255
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
256 #endif
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
257
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
258
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
259
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 typedef struct _sys_config {
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 char *name; /* Configuration name */
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
262 int my_port; /* my client/server port */
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 unsigned char tempFormat; /* Temperature format, C or F */
435
4b1ed6897d80 More configuration items added.
Michiel Broek <mbroek@mbse.eu>
parents: 434
diff changeset
264 sensor_var *roomtemp; /* Environment temperature */
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 int lcd_cols; /* LCD display columns */
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 int lcd_rows; /* LCD display rows */
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 int lcd_address; /* LCD display i2c address */
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
268 units_list *units; /* Brewing units */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
269 devices_list *devices; /* Sensors and switches */
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
270 #ifdef USE_SIMULATOR
438
7d1ec160d751 Added simulator configuration.
Michiel Broek <mbroek@mbse.eu>
parents: 435
diff changeset
271 simulator_var *simulator; /* Simulator */
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 #endif
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 } sys_config;
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275
434
eb724767860d Brewco first phase development configuration structure.
Michiel Broek <mbroek@mbse.eu>
parents: 410
diff changeset
276
441
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
277 /*
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
278 * Brewing state file ~/.brewco/var/brewing.xml
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
279 * If present a brew session is running
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
280 */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
281
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
282 #define MAISH_NA 0 /* Not in any state yet */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
283 #define MASIH_PROMPT 1 /* Prompt the user */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
284 #define MAISH_HEATING 2 /* Heating phase */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
285 #define MAISH_REST 3 /* Rest phase */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
286 #define MAISH_DONE 4 /* This step is done */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
287
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
288
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
289 typedef struct _brew_session {
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
290 char *uuid_recipe; /* Brewing this recipe */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
291 char *uuid_unit; /* Brewing unit */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
292 int premash; /* In premash state */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
293 int mashstep; /* In or into maishstep or -1 */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
294 int mashstate; /* State this step is in */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
295 int resttime; /* Rest time downcouner */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
296 int iodine; /* Mash iodine test */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
297 int mashremove; /* Mash remove step */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
298 int boilheating; /* Heat for boiling */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
299 int boiling; /* Boiling started */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
300 int boiltimer; /* Boiling downcount */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
301 int cooling; /* Cooling phase */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
302 int whirlpool; /* Whirlpool phase */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
303 int cleanup; /* Cleanup phase */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
304 time_t starttime; /* Start of brew */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
305 time_t endtime; /* End of brew */
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
306 } brew_session;
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
307
bde74a8f2ad7 Added automate state file.
Michiel Broek <mbroek@mbse.eu>
parents: 438
diff changeset
308
409
cdf68044adaf Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 #endif

mercurial