100 break; |
100 break; |
101 if ((xml->tokenType() == QXmlStreamReader::EndElement) && (xml->name() == "EQUIPMENT")) { |
101 if ((xml->tokenType() == QXmlStreamReader::EndElement) && (xml->name() == "EQUIPMENT")) { |
102 query.prepare("INSERT INTO inventory_equipments SET name=:name, boil_size=:boil_size, " |
102 query.prepare("INSERT INTO inventory_equipments SET name=:name, boil_size=:boil_size, " |
103 "batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, " |
103 "batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, " |
104 "tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, " |
104 "tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, " |
105 "top_up_water=:top_up_water, trub_chiller_loss=:chiller_loss, evap_rate=:evap_rate, " |
105 "top_up_water=:top_up_water, trub_loss=:chiller_loss, evap_rate=:evap_rate, " |
106 "boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, " |
106 "boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, " |
107 "hop_utilization=:hopfactor, notes=:notes, lauter_volume=:lauter_volume, " |
107 "hop_utilization=:hopfactor, notes=:notes, lauter_volume=:lauter_volume, " |
108 "lauter_height=:lauter_height, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, " |
108 "lauter_height=:lauter_height, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, " |
109 "kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, " |
109 "kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, " |
110 "efficiency=:efficiency, uuid=:uuid"); |
110 "efficiency=:efficiency, uuid=:uuid"); |
115 query.bindValue(":tun_weight", QString("%1").arg(eq->tun_weight, 2, 'f', 1, '0')); |
115 query.bindValue(":tun_weight", QString("%1").arg(eq->tun_weight, 2, 'f', 1, '0')); |
116 query.bindValue(":tun_specific_heat", QString("%1").arg(eq->tun_specific_heat, 4, 'f', 3, '0')); |
116 query.bindValue(":tun_specific_heat", QString("%1").arg(eq->tun_specific_heat, 4, 'f', 3, '0')); |
117 query.bindValue(":tun_material", eq->tun_material); |
117 query.bindValue(":tun_material", eq->tun_material); |
118 query.bindValue(":tun_height", QString("%1").arg(eq->tun_height, 4, 'f', 3, '0')); |
118 query.bindValue(":tun_height", QString("%1").arg(eq->tun_height, 4, 'f', 3, '0')); |
119 query.bindValue(":top_up_water", QString("%1").arg(eq->top_up_water, 2, 'f', 1, '0')); |
119 query.bindValue(":top_up_water", QString("%1").arg(eq->top_up_water, 2, 'f', 1, '0')); |
120 query.bindValue(":chiller_loss", QString("%1").arg(eq->trub_chiller_loss, 2, 'f', 1, '0')); |
120 query.bindValue(":chiller_loss", QString("%1").arg(eq->trub_loss, 2, 'f', 1, '0')); |
121 /* The evaporation in beerxml is percentage, but we use the real volume per hour */ |
121 /* The evaporation in beerxml is percentage, but we use the real volume per hour */ |
122 query.bindValue(":evap_rate", QString("%1").arg((eq->evap_rate / 100) * eq->boil_size, 3, 'f', 2, '0')); |
122 query.bindValue(":evap_rate", QString("%1").arg((eq->evap_rate / 100) * eq->boil_size, 3, 'f', 2, '0')); |
123 query.bindValue(":boil_time", QString("%1").arg(eq->boil_time, 1, 'f', 0, '0')); |
123 query.bindValue(":boil_time", QString("%1").arg(eq->boil_time, 1, 'f', 0, '0')); |
124 query.bindValue(":calcboil", eq->calc_boil_volume ? 1:0); |
124 query.bindValue(":calcboil", eq->calc_boil_volume ? 1:0); |
125 query.bindValue(":top_up_kettle", QString("%1").arg(eq->top_up_kettle, 2, 'f', 1, '0')); |
125 query.bindValue(":top_up_kettle", QString("%1").arg(eq->top_up_kettle, 2, 'f', 1, '0')); |
176 else |
176 else |
177 eq->tun_material = 0; |
177 eq->tun_material = 0; |
178 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "TUN_HEIGHT")) { |
178 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "TUN_HEIGHT")) { |
179 eq->tun_height = xml->readElementText().toDouble(); |
179 eq->tun_height = xml->readElementText().toDouble(); |
180 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "TRUB_CHILLER_LOSS")) { |
180 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "TRUB_CHILLER_LOSS")) { |
181 eq->trub_chiller_loss = xml->readElementText().toDouble(); |
181 eq->trub_loss = xml->readElementText().toDouble(); |
182 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "EVAP_RATE")) { |
182 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "EVAP_RATE")) { |
183 eq->evap_rate = xml->readElementText().toDouble(); |
183 eq->evap_rate = xml->readElementText().toDouble(); |
184 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "BOIL_TIME")) { |
184 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "BOIL_TIME")) { |
185 eq->boil_time = xml->readElementText().toDouble(); |
185 eq->boil_time = xml->readElementText().toDouble(); |
186 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "CALC_BOIL_VOLUME")) { |
186 } else if ((xml->tokenType() == QXmlStreamReader::StartElement) && (xml->name() == "CALC_BOIL_VOLUME")) { |