thermferm/thermferm.h

changeset 570
1e0192b295b9
parent 569
9c69d43bfb06
child 575
86496d2bc4bb
--- a/thermferm/thermferm.h	Thu Jan 10 16:33:42 2019 +0100
+++ b/thermferm/thermferm.h	Mon Jan 14 22:46:27 2019 +0100
@@ -81,7 +81,6 @@
 #define MENU_MODE_FRIDGE	214
 #define MENU_FRIDGE_TEMP	2141
 #define MENU_MODE_PROFILE	215
-#define	MENU_PROFILE_SELECT	2151
 #define	MENU_PROFILE_START	2152
 #define	MENU_PROFILE_PAUSE	2153
 #define	MENU_PROFILE_ABORT	2154
@@ -120,6 +119,21 @@
 
 
 /*
+ * Fermenting steps
+ */
+typedef struct _prof_step {
+    struct _prof_step   *next;
+    char                *name;                  /* Description of this step     */
+    int                 steptime;               /* Step time to target in hours */
+    int                 resttime;               /* Rest time on target in hours */
+    float               target_lo;              /* Low Target temperature       */
+    float               target_hi;              /* High target temperature      */
+    int                 fridge_mode;            /* Fridge or beer mode          */
+} prof_step;
+
+
+
+/*
  * Fermenter units. These units are connected via the 1-wire bus.
  * Each unit can have:
  *  a DS18B20 sensor to measure the air temperature inside the unit.
@@ -128,7 +142,6 @@
  */
 typedef struct _units_list {
     struct _units_list	*next;
-    int			version;		/* Record version		*/
     char		*uuid;			/* uid code			*/
     char		*product_uuid;		/* Beer product uuid		*/
     char		*product_code;		/* Beer product code		*/
@@ -182,7 +195,14 @@
     float		fridge_set;		/* Fridge temperature setting	*/
     float		temp_set_min;		/* Minimum temperature		*/
     float		temp_set_max;		/* Maximum temperature		*/
-    char		*profile;		/* Active profile uuid		*/
+    char		*profile_uuid;		/* Profile uuid or NULL		*/
+    char		*profile_name;		/* Profile name			*/
+    float		profile_inittemp_lo;	/* Profile initial temp low	*/
+    float		profile_inittemp_hi;	/* Profile initial temp high	*/
+    int			profile_fridge_mode;	/* Profile initial fridge mode	*/
+    int			profile_duration;	/* Profile duration in hours	*/
+    int			profile_totalsteps;	/* Profile number of steps	*/
+    prof_step		*profile_steps;		/* Profile steps                */
     time_t		prof_started;		/* Profile start time		*/
     int			prof_state;		/* Profile OFF|PAUSE|RUN|DONE	*/
     float		prof_target_lo;		/* Profile current target low	*/
@@ -228,35 +248,6 @@
 #define	ALARM_FLAG_CHILLER	0x0100		/* Chiller too warm		*/
 
 
-
-/*
- * Fermenting steps
- */
-typedef struct _prof_step {
-    struct _prof_step	*next;
-    int			version;		/* Version 1			*/
-    int			steptime;		/* Step time to target in hours	*/
-    int			resttime;		/* Rest time on target in hours	*/
-    float		target_lo;		/* Low Target temperature	*/
-    float		target_hi;		/* High target temperature	*/
-    int			fridge_mode;		/* Fridge or beer mode		*/
-} prof_step;
-
-/*
- * Fermenting profiles
- */
-typedef struct _prof_list {
-    struct _prof_list	*next;
-    int			version;		/* Version 1			*/
-    char		*uuid;			/* Profile uuid			*/
-    char		*name;			/* Profile name			*/
-    int			busy;			/* Profile busy == 1, free == 0	*/
-    float		inittemp_lo;		/* Low target before start	*/
-    float		inittemp_hi;		/* High target before start	*/
-    int			fridge_mode;		/* Fridge or beer mode		*/
-    prof_step		*steps;			/* Profile steps		*/
-} profiles_list;
-
 #define PROFILE_OFF		0		/* Profile not active		*/
 #define	PROFILE_PAUSE		1		/* Profile pause		*/
 #define	PROFILE_RUN		2		/* Profile is running		*/
@@ -269,7 +260,6 @@
  */
 typedef struct _dev_list {
     struct _dev_list	*next;
-    int			version;		/* Version 1			*/
     char		*uuid;			/* UUID of this device		*/
     int			type;			/* Device type			*/
     int			direction;		/* Device direction		*/
@@ -319,7 +309,6 @@
  */
 typedef struct _simulator {
     struct _simulator	*next;
-    int			version;		/* Version of this record	*/
     char		*uuid;			/* Simulator uuid		*/
     char		*name;			/* Simulator name		*/
     int			volume_air;		/* Volume air of the frigo	*/
@@ -368,7 +357,7 @@
     int			lcd_address;		/* LCD display i2c address	*/
     int			next_unit;		/* Next unit alias name		*/
     units_list		*units;			/* Fermenter units		*/
-    profiles_list	*profiles;		/* Ferment profiles		*/
+//    profiles_list	*profiles;		/* Ferment profiles		*/
     devices_list	*devices;		/* Sensors and switches		*/
 #ifdef USE_SIMULATOR
     simulator_list	*simulators;		/* Simulators			*/

mercurial