src/EditProductTab9.cpp

changeset 207
3b164a0aea90
parent 205
ae6109192fb2
child 209
19c50b1f58d3
equal deleted inserted replaced
206:83ae8ac83f51 207:3b164a0aea90
62 void EditProduct::brew_start_date_changed(QDate val) 62 void EditProduct::brew_start_date_changed(QDate val)
63 { 63 {
64 product->brew_date_start.setDate(ui->brew_startDate->nullDate()); 64 product->brew_date_start.setDate(ui->brew_startDate->nullDate());
65 qDebug() << "brew_start_date_changed" << product->brew_date_start.date(); 65 qDebug() << "brew_start_date_changed" << product->brew_date_start.date();
66 updateBrewday(); 66 updateBrewday();
67 is_changed();
67 } 68 }
68 69
69 70
70 void EditProduct::brew_end_today() 71 void EditProduct::brew_end_today()
71 { 72 {
76 { 77 {
77 qDebug() << "brew_end_date_changed" << val; 78 qDebug() << "brew_end_date_changed" << val;
78 } 79 }
79 80
80 81
82 void EditProduct::brew_mashph_changed(double val)
83 {
84 if (product->brew_mash_ph == 0) {
85 product->brew_mash_ph = 4.8;
86 const QSignalBlocker blocker1(ui->brew_mashphEdit);
87 ui->brew_mashphEdit->setValue(4.8);
88 } else {
89 product->brew_mash_ph = val;
90 }
91 is_changed();
92 }
93
94
95 void EditProduct::brew_mashsg_changed(double val)
96 {
97 product->brew_mash_sg = val;
98 double c = Utils::sg_to_plato(product->est_mash_sg);
99 double m = Utils::sg_to_plato(val);
100
101 if (c > 0.5)
102 product->brew_mash_efficiency = 100 * m / c;
103 else
104 product->brew_mash_efficiency = 0;
105 ui->brew_masheffShow->setValue(product->brew_mash_efficiency);
106 is_changed();
107 }
108
109
110 void EditProduct::brew_spargeph_changed(double val)
111 {
112 if (product->brew_sparge_ph == 0) {
113 product->brew_sparge_ph = 4.8;
114 const QSignalBlocker blocker1(ui->brew_spargephEdit);
115 ui->brew_spargephEdit->setValue(4.8);
116 } else {
117 product->brew_sparge_ph = val;
118 }
119 is_changed();
120 }
121
122
123 void EditProduct::brew_preboilph_changed(double val)
124 {
125 if (product->brew_preboil_ph == 0) {
126 product->brew_preboil_ph = 4.8;
127 const QSignalBlocker blocker1(ui->brew_preboilphEdit);
128 ui->brew_preboilphEdit->setValue(4.8);
129 } else {
130 product->brew_preboil_ph = val;
131 }
132 is_changed();
133 }
134
135
136 void EditProduct::brew_aboilph_changed(double val)
137 {
138 if (product->brew_aboil_ph == 0) {
139 product->brew_aboil_ph = 4.8;
140 const QSignalBlocker blocker1(ui->brew_aboilphEdit);
141 ui->brew_aboilphEdit->setValue(4.8);
142 } else {
143 product->brew_aboil_ph = val;
144 }
145 is_changed();
146 }
147
148

mercurial