src/EditRecipe.h

changeset 158
24bc2de721d9
parent 157
771b0b00092a
child 162
19156b8b339f
--- a/src/EditRecipe.h	Sat Apr 23 20:00:35 2022 +0200
+++ b/src/EditRecipe.h	Sun Apr 24 14:15:20 2022 +0200
@@ -13,232 +13,7 @@
 #include <QList>
 #include <QLabel>
 
-
-/*
- * Fermentables, Hops, Miscs, Yeasts and Mashs are stored in the 
- * database in json arrays. These are the QList structures.
- */
-struct Fermentables
-{
-    QString	f_name;
-    QString	f_origin;
-    QString	f_supplier;
-    double	f_amount;
-    double	f_cost;
-    int		f_type;
-    double	f_yield;
-    double	f_color;
-    double	f_coarse_fine_diff;
-    double	f_moisture;
-    double	f_diastatic_power;
-    double	f_protein;
-    double	f_dissolved_protein;
-    double	f_max_in_batch;
-    int		f_graintype;
-    int		f_added;
-    bool	f_recommend_mash;
-    bool	f_add_after_boil;
-    bool	f_adjust_to_total_100;
-    double	f_percentage;
-    double	f_di_ph;
-    double	f_acid_to_ph_57;
-};
-
-
-struct Hops
-{
-    QString	h_name;
-    QString	h_origin;
-    double	h_amount;
-    double	h_cost;
-    int		h_type;
-    int		h_form;
-    int		h_useat;
-    double	h_time;
-    double	h_alpha;
-    double	h_beta;
-    double	h_hsi;
-    double	h_humulene;
-    double	h_caryophyllene;
-    double	h_cohumulone;
-    double	h_myrcene;
-    double	h_total_oil;
-};
-
-
-struct Miscs
-{
-    QString	m_name;
-    double	m_amount;
-    int		m_type;
-    int		m_use_use;
-    double	m_time;
-    bool	m_amount_is_weight;
-    double	m_cost;
-};
-
-
-struct Yeasts
-{
-    QString	y_name;
-    QString	y_laboratory;
-    QString	y_product_id;
-    double	y_amount;
-    int		y_type;
-    int		y_form;
-    double	y_min_temperature;
-    double	y_max_temperature;
-    int		y_flocculation;
-    double	y_attenuation;
-    double	y_cells;
-    double	y_tolerance;
-    double	y_inventory;
-    int		y_use;
-    bool	y_sta1;
-    bool	y_bacteria;
-    bool	y_harvest_top;
-    int		y_harvest_time;
-    double	y_pitch_temperature;
-    bool	y_pofpos;
-    int		y_zymocide;
-    int		y_gr_hl_lo;
-    double	y_sg_lo;
-    int		y_gr_hl_hi;
-    double	y_sg_hi;
-    double	y_cost;
-};
-
-
-struct Mashs
-{
-    QString	step_name;
-    int		step_type;
-    double	step_volume;		///< The water volume upto this step.
-    double	step_infuse_amount;	///< Infuse/decoction volume this step.
-    double	step_infuse_temp;	///< Infuse/decoction temperature.
-    double	step_temp;		///< Start tmperature this step.
-    double	step_time;		///< Step rest time.
-    double	ramp_time;		///< Estimated ramp time to this step.
-    double	end_temp;		///< End temperature this step.
-    double	step_wg_ratio;		///< Current water/grain ratio.
-};
-
-
-/*
- * The main recipe record stored in the database.
- */
-struct Recipe
-{
-    int		record;
-    QString	uuid;
-    bool	locked;
-    QString	st_name;
-    QString	st_letter;
-    QString	st_guide;
-    QString	st_category;
-    int		st_category_number;
-    int		st_type;
-    double	st_og_min;
-    double	st_og_max;
-    double	st_fg_min;
-    double	st_fg_max;
-    double	st_ibu_min;
-    double	st_ibu_max;
-    double	st_color_min;
-    double	st_color_max;
-    double	st_carb_min;
-    double	st_carb_max;
-    double	st_abv_min;
-    double	st_abv_max;
-
-    QString	name;
-    QString	notes;
-    int		type;
-    double	batch_size;
-    double	boil_size;
-    double	boil_time;
-    double	efficiency;
-    double	est_og;
-    double	est_fg;
-    double	est_abv;
-    double	est_color;
-    int		color_method;
-    double	est_ibu;
-    int		ibu_method;
-    double	est_carb;
-
-    double	sparge_temp;
-    double	sparge_ph;
-    double	sparge_volume;
-    int		sparge_source;
-    int		sparge_acid_type;
-    double	sparge_acid_perc;
-    double	sparge_acid_amount;
-    double	mash_ph;
-    QString	mash_name;
-    bool	calc_acid;
-
-    QString	w1_name;			///< Water source 1
-    double	w1_amount;
-    double	w1_calcium;
-    double	w1_sulfate;
-    double	w1_chloride;
-    double	w1_sodium;
-    double	w1_magnesium;
-    double	w1_total_alkalinity;
-    double	w1_ph;
-    double	w1_cost;
-    QString     w2_name;			///< Water source 2
-    double      w2_amount;
-    double      w2_calcium;
-    double      w2_sulfate;
-    double      w2_chloride;
-    double      w2_sodium;
-    double      w2_magnesium;
-    double      w2_total_alkalinity;
-    double      w2_ph;
-    double      w2_cost;
-    double      wg_amount;			///< Mixed water
-    double      wg_calcium;
-    double      wg_sulfate;
-    double      wg_chloride;
-    double      wg_sodium;
-    double      wg_magnesium;
-    double      wg_total_alkalinity;
-    double      wg_ph;
-    double      wb_calcium;			///< Treated water
-    double      wb_sulfate;
-    double      wb_chloride;
-    double      wb_sodium;
-    double      wb_magnesium;
-    double      wb_total_alkalinity;
-    double      wb_ph;
-    int		wa_acid_name;
-    double	wa_acid_perc;
-    int		wa_base_name;
-
-    QList<Fermentables>	fermentables;
-    QList<Hops>		hops;
-    QList<Miscs>	miscs;
-    QList<Yeasts>	yeasts;
-    QList<Mashs>	mashs;
-
-    /*
-     * These are not in the MySL database, but are global variables
-     * that belong with the loaded recipe data and are present to
-     * make things easier.
-     */
-    int		fermentables_row;	///< Current row, -1 is invalid.
-    bool	fermentables_use100;	///< Use percentages instead of amount
-    int		hops_row;
-    int		miscs_row;
-    int		yeasts_row;
-    int		mashs_row;
-    double	mashs_kg;		///< Kg fermentables in the mash.
-    int		mashs_time;		///< Total mash time.
-    double	preboil_sg;
-};
-
+#include "global.h"
 
 namespace Ui {
 class EditRecipe;
@@ -361,7 +136,7 @@
     QString bar_100 = "QProgressBar::chunk {background: #80FF80;}";
     int recno;
     bool textIsChanged = false;
-    Recipe *recipe;
+//    Recipe *recipe;
     /*
      * Variables for popup ingredients editing.
      */

mercurial