1
/***************************************************************************
2
* Copyright (C) 2009 by Kashyap R Puranik, kashthealien@gmail.com *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18
***************************************************************************/
20
#include "concCalculator.h"
23
#include <ktoolinvocation.h>
26
concCalculator::concCalculator(QWidget * parent)
31
/**************************************************************************/
32
// concentration Calculator set up
33
/**************************************************************************/
35
// initialise the initially selected values
38
// Connect signals with slots ( when a change of selection in the UI takes place,
39
// corresponding quantity should be updated in the class. )
41
// Amount of solute changed
42
connect(ui.amtSolute, SIGNAL(valueChanged(double)),
43
this, SLOT(amtSoluteChanged()));
44
connect(ui.amtSltType, SIGNAL(activated(int)),
45
this, SLOT(amtSoluteTypeChanged()));
46
connect(ui.amtSlt_unit, SIGNAL(activated(int)),
47
this, SLOT(amtSoluteChanged()));
48
// Molar mass and equivalent mass change for solvent
49
connect(ui.molarMass, SIGNAL(valueChanged(double)),
50
this, SLOT(molarMassChanged(double)));
51
connect(ui.eqtMass, SIGNAL(valueChanged(double)),
52
this, SLOT(eqtMassChanged(double)));
53
// Density change for solute
54
connect(ui.densitySolute, SIGNAL(valueChanged(double)),
55
this, SLOT(densitySoluteChanged()));
56
connect(ui.densSlt_unit, SIGNAL(activated(int)),
57
this, SLOT(densitySoluteChanged()));
58
// Amount of solvent changed
59
connect(ui.amtSolvent, SIGNAL(valueChanged(double)),
60
this, SLOT(amtSolventChanged()));
61
connect(ui.amtSlvtType, SIGNAL(activated(int)),
62
this, SLOT(amtSolventTypeChanged()));
63
connect(ui.amtSlvt_unit, SIGNAL(activated(int)),
64
this, SLOT(amtSolventChanged()));
65
// Molar mass change for solvent
66
connect(ui.molarMassSolvent, SIGNAL(valueChanged(double)),
67
this, SLOT(molarMassSolventChanged(double)));
69
connect(ui.densitySolvent, SIGNAL(valueChanged(double)),
70
this, SLOT(densitySolventChanged()));
71
connect(ui.densSlvt_unit, SIGNAL(activated(int)),
72
this, SLOT(densitySolventChanged()));
73
// concentration change
74
connect(ui.concentration, SIGNAL(valueChanged(double)),
75
this, SLOT(concentrationChanged()));
76
connect(ui.conc_unit, SIGNAL(activated(int)),
77
this, SLOT(concentrationChanged()));
79
connect(ui.mode, SIGNAL(activated(int)),
80
this, SLOT(setMode(int)));
82
connect(ui.reset, SIGNAL(clicked()),
85
/**************************************************************************/
86
// concentration Calculator setup complete
87
/**************************************************************************/
88
if(Prefs::soluteMass())
89
ui.amtSltType->hide();
90
if(Prefs::solventVolume())
91
ui.amtSlvtType->hide();
94
concCalculator:: ~concCalculator()
99
// Initialises values and GUI.
100
void concCalculator::init()
102
error(RESET_CONC_MESSAGE);
104
ui.amtSolute -> setValue(117.0);
105
ui.molarMass -> setValue(58.5);
106
ui.eqtMass -> setValue(58.5);
107
ui.densitySolute -> setValue(2.7);
108
ui.amtSolvent -> setValue(1.0);
109
ui.molarMassSolvent -> setValue(18.0);
110
ui.densitySolvent -> setValue(1000.0);
111
ui.concentration -> setValue(2.0);
113
ui.amtSltType ->setCurrentIndex(0);
114
ui.amtSlt_unit ->setCurrentIndex(0);
115
ui.densSlt_unit ->setCurrentIndex(0);
116
ui.amtSlvtType ->setCurrentIndex(0);
117
ui.amtSlvt_unit ->setCurrentIndex(0);
118
ui.densSlvt_unit->setCurrentIndex(0);
119
ui.conc_unit ->setCurrentIndex(0);
122
m_amtSolute = Value(117.0, "grams");
123
m_amtSolvent = Value(1.0, "liter");
127
m_molesSolvent = 55.5;
128
m_molarMassSolvent = 18.0;
129
m_densitySolute = Value(2.7, "grams per milliliter");
130
m_concentration = 2.0;
131
m_densitySolvent = Value(1000.0, "grams per liter");
132
// Initialisation of values done
137
// Calculates the amount of solute
138
void concCalculator::calculateAmtSolute()
140
int type1 = ui.conc_unit -> currentIndex();
141
int type2 = ui.amtSltType -> currentIndex();
143
double molesSolute , eqtsSolute, massSolute, volSolute; // variables
146
* mode = 1 ( molesSolute) mode = 2 eqtsSolute, mode = 3 mass, 4 volume
148
// Calculate the number of moles of the solute
150
// calculate the number of moles of solute
151
case 0: // molarity specified
152
molesSolute = m_concentration * volumeSolvent();
155
// Calculate the number of equivalents of solute
156
case 1: // Normality specified
157
eqtsSolute = m_concentration * volumeSolvent();
160
// Calculate the number of moles of solute
161
case 2: // molality specified
162
molesSolute = m_concentration * massSolvent() / 1000.0;
165
// Calculate the mass of solute
166
case 3: // mass percentage specified
167
if (m_concentration >= 100.0) {
170
massSolute = m_concentration / (100.0 - m_concentration) * massSolvent();
173
// Calculate the volume of solute
174
case 4: // volume percentage specified
175
if (m_concentration >= 100.0) {
178
volSolute = m_concentration / (100.0 - m_concentration) * volumeSolvent();
181
// Calculate the moles of solute
182
case 5: //mole percentage specified
183
if (m_concentration >= 100.0) {
186
molesSolute = m_concentration / (100.0 - m_concentration) * molesSolvent();
193
// We have the amount of solvent in some form ( moles, equivalents, mass, volume etc )
194
// Now we have to present it in the UI
196
case 0: // amount should be specified interms of mass
198
case 1: // we should get mass from moles
199
massSolute = molesSolute * m_molarMass;
201
case 2: // we should obtain mass from number of equivalents
202
massSolute = eqtsSolute * m_eqtMass;
204
case 3: // we already know the mass of the solute
206
case 4: // we should get the mass from volume
207
massSolute = volSolute * densitySolute();
210
// update mass of solute
211
m_amtSolute = Value(massSolute, "grams");
212
m_amtSolute = m_amtSolute.convertTo(ui.amtSlt_unit->currentText());
213
ui.amtSolute -> setValue(m_amtSolute.number());
216
case 1: // amount should be specified in terms of volume
218
if (densitySolute() == 0) {
223
case 1: // we should get the volume from moles
224
volSolute = molesSolute * m_molarMass / densitySolute();
226
case 2: // we should get the volume from equivalents
227
volSolute = eqtsSolute * m_eqtMass / densitySolute();
229
case 3: // we should get the volume from mass
230
volSolute = massSolute / densitySolute();
232
case 4: // we already know the volume
235
// update volume of solute
236
m_amtSolute = Value(volSolute, "liters");
237
m_amtSolute = m_amtSolute.convertTo(ui.amtSlt_unit->currentText());
238
ui.amtSolute -> setValue(m_amtSolute.number());
241
case 2: // amount should be specified in terms of moles
243
case 1: // we already know the moles of solute
245
case 2: // we should obtain moles from equivalents ( not possible )
248
case 3: // we should obtain moles from mass
249
molesSolute = massSolute / m_molarMass;
251
case 4: // we should obtain moles from volume
252
molesSolute = volSolute * densitySolute() / m_molarMass;
255
// Update the number of moles
256
m_molesSolute = molesSolute;
257
ui.amtSolute -> setValue(molesSolute);
263
// Calculates the molar mass
264
void concCalculator::calculateMolarMass()
266
// molarity / molality / mole fraction required
267
int type = ui.conc_unit -> currentIndex();
268
int type2 = ui.amtSlvtType -> currentIndex();
271
case 0: //molarity specified
272
// number of moles = volume * concentration
273
numMoles = volumeSolvent() * m_concentration;
275
case 1: // cannot be calculated ( insufficient data )
276
error(INSUFFICIENT_DATA_MOLE);
279
case 2: // molality specified
280
numMoles = massSolvent() / 1000.0 * m_concentration;
282
case 3: // cannot be calculated ( insufficient data )
284
error(INSUFFICIENT_DATA_MOLE);
287
case 5: // mole fraction specified
288
numMoles = m_concentration / (100.0 - m_concentration) * molesSolvent();
292
if (type2 == 2) { // amount of solute is specified in moles, cannot calculate
293
error(INSUFFICIENT_DATA_MOLES);
296
if (numMoles == 0.0) {
300
m_molarMass = massSolute() / numMoles;
301
ui.molarMass->setValue(m_molarMass);
305
// Calculates the equivalent mass
306
void concCalculator::calculateEqtMass()
308
// Normality required
309
int type = ui.conc_unit -> currentIndex();
310
int type2 = ui.amtSltType -> currentIndex();
314
// Normality required
315
case 0: // molarity not sufficient
316
error(INSUFFICIENT_DATA_EQT);
319
case 1: // normality specified
320
numEqts = volumeSolvent() * m_concentration;
326
error(INSUFFICIENT_DATA_EQT);
331
if (type2 == 2) { // Amount of solute specified in moles, cannot calculate
332
error(INSUFFICIENT_DATA_MOLES);
334
if (numEqts == 0.0) {
338
m_eqtMass = massSolute() / numEqts;
339
ui.eqtMass->setValue(m_eqtMass);
344
// Calculates the calculate molar mass of the solvent
345
void concCalculator::calculateMolarMassSolvent()
347
// molarity / molality / mole fraction required
348
int type = ui.conc_unit -> currentIndex();
349
int type2 = ui.amtSlvtType -> currentIndex();
352
case 0: // molarity specified
353
case 1: // normality specified
354
case 2: // molality specified
355
case 3: // mass fraction specified
356
case 4: // volume fraction specified
357
error(INSUFFICIENT_DATA_SOLVENT);
359
break; // cannot be calculated ( insufficient data )
360
case 5: // mole fraction specified
361
numMoles = (100.0 - m_concentration) / m_concentration * molesSolute();
365
if (type2 == 2) { // amount specified in moles
366
error(INSUFFICIENT_DATA_MOLES);
368
m_molarMassSolvent = massSolvent() / numMoles;
369
ui.molarMassSolvent->setValue(m_molarMassSolvent);
375
// Calculates the amount of solvent
376
void concCalculator::calculateAmtSolvent()
378
int type1 = ui.conc_unit -> currentIndex();
379
int type2 = ui.amtSlvtType -> currentIndex();
381
double moleSolvent , massSolvent, volSolvent;
383
int mode = 0; // Indicates the mode in which we have calculated the amount of solvent
385
* mode = 1 ( molessolvent) mode = 2 eqtssolvent, mode = 3 mass, 4 volume
387
// Calculate the number of moles of the solvent
388
if (m_concentration == 0.0) {
394
// calculate the number of moles of solvent
395
case 0: // molarity specified
396
volSolvent = molesSolute() / m_concentration;
399
// Calculate the number of equivalents of solvent
400
case 1: // Normality specified
401
volSolvent = eqtsSolute() / m_concentration;
404
// Calculate the number of moles of solvent
405
case 2: // molality specified
406
massSolvent = molesSolute() * 1000.0 / m_concentration;
409
// Calculate the mass of solvent
410
case 3: // mass percentage specified
411
massSolvent = (100.0 - m_concentration) / m_concentration;
412
massSolvent *= massSolute();
415
// Calculate the volume of solvent
416
case 4: // volume percentage specified
417
volSolvent = (100.0 - m_concentration) / m_concentration;
418
volSolvent *= volumeSolute();
421
// Calculate the moles of solvent
422
case 5: //mole percentage specified
423
moleSolvent = (100.0 - m_concentration) / m_concentration;
424
moleSolvent *= molesSolute();
431
// We have the amount of solvent in some form ( moles, equivalents, mass, volume etc )
432
// Now we have to present it in the UI
433
if (densitySolvent() == 0.0) {
437
if (m_molarMassSolvent == 0.0) {
438
error(MOLAR_SOLVENT_ZERO);
442
case 0: // amount should be specified interms of volume
444
case 1: // obtain volume from moles
445
volSolvent = moleSolvent * m_molarMassSolvent / densitySolvent();
447
case 2: // obtain volume from mass
448
volSolvent = massSolvent / densitySolvent();
450
case 3: // volume already known
453
m_amtSolvent = Value(volSolvent, "liters");
454
m_amtSolvent = m_amtSolvent.convertTo(ui.amtSlvt_unit->currentText());
455
ui.amtSolvent->setValue(m_amtSolvent.number());
458
case 1: // amount should be specified in terms of mass
460
case 1: // obtain mass from moles
461
massSolvent = moleSolvent / m_molarMassSolvent;
463
case 2: // mass already known
465
case 3: // obtain mass from volume
466
massSolvent = volSolvent / densitySolvent();
469
m_amtSolvent = Value(massSolvent, "grams");
470
m_amtSolvent = m_amtSolvent.convertTo(ui.amtSlvt_unit->currentText());
471
ui.amtSolvent->setValue(m_amtSolvent.number());
474
case 2: // amount should be specified in terms of moles
476
case 1: // moles already known
478
case 2: // obtain moles from mass
479
moleSolvent = massSolvent / m_molarMassSolvent;
481
case 3: // obtain moles from volume
482
moleSolvent = volSolvent * densitySolvent() / m_molarMassSolvent;
485
m_molesSolvent = moleSolvent;
486
ui.amtSolvent->setValue(moleSolvent);
492
// calculates the concentration
493
void concCalculator::calculateConcentration()
495
int type = ui.conc_unit -> currentIndex();
497
if (volumeSolvent() == 0.0) {
498
error(SOLVENT_VOLUME_ZERO);
501
if (massSolvent() == 0.0) {
502
error(SOLVENT_MASS_ZERO);
505
if (molesSolvent() == 0.0) {
506
error(SOLVENT_MOLES_ZERO);
511
m_concentration = molesSolute() / volumeSolvent();
514
m_concentration = eqtsSolute() / volumeSolvent();
517
m_concentration = molesSolute() * 1000.0 / massSolvent();
519
case 3: // mass fraction
520
m_concentration = massSolute() / (massSolute() + massSolvent()) * 100.0;
522
case 4: // volume fraction
523
m_concentration = volumeSolute() / (volumeSolute() + volumeSolvent()) * 100.0;
525
case 5: // mole fraction
526
m_concentration = molesSolute() / (molesSolute() + molesSolvent()) * 100.0;
531
ui.concentration->setValue(m_concentration);
535
double concCalculator::volumeSolvent()
537
int type = ui.amtSlvtType -> currentIndex();
540
case 0: // If volume is specified, return it in liters
541
volume = m_amtSolvent.convertTo("liter").number();
543
case 1: // If mass is specified, calculate volume and return it.
544
volume = massSolvent() / densitySolvent();
546
case 2: // If moles are specified, calculated volume and return it.
547
volume = massSolvent() / densitySolvent();
554
double concCalculator::molesSolvent()
556
int type = ui.amtSlvtType -> currentIndex();
561
moles = massSolvent() / m_molarMassSolvent;
564
moles = massSolvent() / m_molarMassSolvent;
567
moles = m_molesSolvent;
575
double concCalculator::massSolvent()
577
int type = ui.amtSlvtType -> currentIndex();
581
mass = volumeSolvent() * densitySolvent();
584
mass = m_amtSolvent.convertTo("gram").number();
587
mass = m_molesSolvent * m_molarMassSolvent;
595
double concCalculator::densitySolvent()
597
return (m_densitySolvent.convertTo("grams per liter").number());
600
double concCalculator::volumeSolute()
602
int type = ui.amtSltType -> currentIndex();
606
volume = massSolute() / densitySolute();
609
volume = m_amtSolute.convertTo("liter").number();
612
volume = massSolute() / densitySolute();
619
double concCalculator::molesSolute()
621
int type = ui.amtSltType -> currentIndex();
624
if (m_molarMass == 0.0) {
625
error(MOLAR_MASS_ZERO);
630
moles = massSolute() / m_molarMass;
633
moles = massSolute() / m_molarMass;
636
moles = m_molesSolute;
644
double concCalculator::eqtsSolute()
646
int type = ui.amtSltType -> currentIndex();
648
if (m_eqtMass == 0.0) {
649
error(EQT_MASS_ZERO);
654
eqts = massSolute() / m_eqtMass;
657
eqts = massSolute() / m_eqtMass;
660
// Cannot be calculated
661
error(INSUFFICIENT_DATA_MOLES);
671
double concCalculator::massSolute()
673
int type = ui.amtSltType -> currentIndex();
677
mass = m_amtSolute.convertTo("gram").number();
680
mass = volumeSolute() * densitySolute();
683
mass = m_molesSolute * m_molarMass;
691
double concCalculator::densitySolute()
693
return (m_densitySolute.convertTo("grams per liter").number());
697
// occurs when the type in which amount of solute is specified is changed
698
void concCalculator::amtSoluteTypeChanged()
700
int type = ui.amtSltType -> currentIndex();
701
if (type == 0) { // amount of solute specified in terms of mass
702
ui.amtSlt_unit -> show();
703
ui.amtSlt_unit->clear();
704
ui.amtSlt_unit->insertItems(0, QStringList()
710
<< i18n("troy ounces")
712
ui.amtSlt_unit->setCurrentIndex(0);
713
m_amtSolute = Value(ui.amtSolute -> value(), ui.amtSlt_unit -> currentText());
714
} else if (type == 1) { // amount of solute is specified in terms of volume
715
ui.amtSlt_unit -> show();
716
ui.amtSlt_unit->clear();
717
ui.amtSlt_unit->insertItems(0, QStringList()
719
<< i18n("cubic meters")
720
<< i18n("cubic feet")
721
<< i18n("cubic inch")
722
<< i18n("cubic mile")
723
<< i18n("fluid ounce")
728
ui.amtSlt_unit->setCurrentIndex(0);
729
m_amtSolute = Value(ui.amtSolute -> value(), ui.amtSlt_unit -> currentText());
730
} else { // amount of solute is specified in terms of moles
731
m_molesSolute = ui.amtSolute -> value();
732
ui.amtSlt_unit -> hide();
737
void concCalculator::amtSoluteChanged()
739
int type = ui.amtSltType -> currentIndex();
743
m_amtSolute = Value(ui.amtSolute -> value(), ui.amtSlt_unit -> currentText());
746
m_molesSolute = ui.amtSolute -> value();
751
// occurs when the type in which amount of solvent is specified is changed
752
void concCalculator::amtSolventTypeChanged()
754
int type = ui.amtSlvtType -> currentIndex();
755
if (type == 0) { // amount of solvent specified in terms of volume
756
ui.amtSlvt_unit-> show();
757
ui.amtSlvt_unit->clear();
758
ui.amtSlvt_unit->insertItems(0, QStringList()
760
<< i18n("cubic meters")
761
<< i18n("cubic feet")
762
<< i18n("cubic inch")
763
<< i18n("cubic mile")
764
<< i18n("fluid ounce")
769
m_amtSolvent = Value(ui.amtSolvent -> value(), ui.amtSlvt_unit -> currentText());
770
} else if (type == 1) { // amount of solvent is specified in terms of mass
771
ui.amtSlvt_unit -> show();
772
ui.amtSlvt_unit->clear();
773
ui.amtSlvt_unit->insertItems(0, QStringList()
779
<< i18n("troy ounces")
781
m_amtSolvent = Value(ui.amtSolvent -> value(), ui.amtSlvt_unit -> currentText());
783
ui.amtSlvt_unit -> hide();
784
m_molesSolvent = ui.amtSolvent -> value();
789
// Occurs when the amount of solute is changed
790
void concCalculator::amtSolventChanged()
792
int type = ui.amtSlvtType -> currentIndex();
793
switch (type) { // amount of solvent specified in terms of volume
796
m_amtSolvent = Value(ui.amtSolvent -> value(), ui.amtSlvt_unit -> currentText());
799
m_molesSolvent = ui.amtSolvent -> value();
804
// occurs when the molar mass of solute is changed
805
void concCalculator::molarMassChanged(double value)
811
// occurs when the equivalent mass of solute is changed
812
void concCalculator::eqtMassChanged(double value)
818
// occurs when the molar mass of solvent is changed
819
void concCalculator::molarMassSolventChanged(double value)
821
m_molarMassSolvent = value;
825
// occurs when the number of moles is changed
826
void concCalculator::densitySoluteChanged()
828
m_densitySolute = Value(ui.densitySolute -> value(), ui.densSlt_unit -> currentText());
832
// occurs when the density of solvent is changed
833
void concCalculator::densitySolventChanged()
835
m_densitySolvent = Value(ui.densitySolvent -> value(), ui.densSlvt_unit -> currentText());
839
// occurs when the concentration is changed
840
void concCalculator::concentrationChanged()
842
m_concentration = ui.concentration->value();
846
// occurs when mode is changed. eg Concentration to molarMass
847
void concCalculator::setMode (int mode)
849
// If there is no change, return.
853
// set all to writeable
854
ui.amtSolute->setReadOnly(false);
855
ui.molarMass->setReadOnly(false);
856
ui.eqtMass->setReadOnly(false);
857
ui.amtSolvent->setReadOnly(false);
858
ui.molarMassSolvent->setReadOnly(false);
859
ui.concentration->setReadOnly(false);
861
// set the value that should be calculated to readOnly
864
case AMT_SOLUTE: // Calculate the amount of solute
865
ui.amtSolute->setReadOnly(true);
867
case MOLAR_MASS: // Calculate the molar mass of solute
868
ui.molarMass->setReadOnly(true);
870
case EQT_MASS: // Calculate the equivalent mass of solute
871
ui.eqtMass->setReadOnly(true);
873
case AMT_SOLVENT: // Calculate the amount of solvent
874
ui.amtSolvent->setReadOnly(true);
876
case MOLAR_MASS_SOLVENT: // Calculate the molar mass of solvent
877
ui.molarMassSolvent->setReadOnly(true);
879
case CONCENTRATION: // Calculate the concentration of the solution
880
ui.concentration->setReadOnly(true);
887
// occurs when any quantity is changed
888
void concCalculator::calculate()
890
error(RESET_CONC_MESSAGE);
891
// Calculate the amount of solute
894
case AMT_SOLUTE: // Calculate the amount of solute
895
if (ui.conc_unit -> currentIndex() > 2 && ui.concentration -> value() > 100)
897
error ( PERCENTAGE );
900
calculateAmtSolute();
902
case MOLAR_MASS: // Calculate the molar mass of solute
903
calculateMolarMass();
905
case EQT_MASS: // Calculate the equivalent mass of solute
908
case AMT_SOLVENT: // Calculate the amount of solvent
909
calculateAmtSolvent();
911
case MOLAR_MASS_SOLVENT: // Calculate the molar mass of solvent
912
calculateMolarMassSolvent();
914
case CONCENTRATION: // Calculate the concentration of the solution
915
calculateConcentration();
921
// This function puts the error messages on the screen depending on the mode.
922
void concCalculator::error(int mode)
924
switch (mode) { // Depending on the mode, set the error messages.
925
case RESET_CONC_MESSAGE:
926
ui.error->setText("");
929
ui.error->setText(i18n("Percentage should be less than 100.0, please enter a valid value."));
932
ui.error->setText(i18n("Density cannot be zero, please enter a valid value."));
935
ui.error->setText(i18n("Mass cannot be zero, please enter a valid value."));
938
ui.error->setText(i18n("Volume cannot be zero, please enter a valid value."));
941
ui.error->setText(i18n("Number of moles cannot be zero, please enter a valid value."));
943
case MOLAR_SOLVENT_ZERO:
944
ui.error->setText(i18n("Molar mass of solvent is zero, please enter a valid value."));
947
ui.error->setText(i18n("Number of equivalents is zero. Cannot calculate equivalent mass."));
950
ui.error->setText(i18n("Concentration is zero, please enter a valid value."));
952
case SOLVENT_VOLUME_ZERO:
953
ui.error->setText(i18n("The volume of the solvent cannot be zero."));
955
case SOLVENT_MOLES_ZERO:
956
ui.error->setText(i18n("The number of moles of the solvent cannot be zero."));
958
case SOLVENT_MASS_ZERO:
959
ui.error->setText(i18n("The mass of the solvent cannot be zero."));
961
case INSUFFICIENT_DATA_EQT:
962
ui.error->setText(i18n("Insufficient data to calculate the required value, please specify normality."));
964
case INSUFFICIENT_DATA_MOLE:
965
ui.error->setText(i18n("Insufficient data, specify molarity / mole fraction / molality to calculate."));
967
case INSUFFICIENT_DATA_MOLES:
968
ui.error->setText(i18n("The amount is specified in moles, cannot calculate molar/equivalent masses. Please specify mass/volume."));
970
case INSUFFICIENT_DATA_SOLVENT:
971
ui.error->setText(i18n("You can calculate the molar mass of solvent only if the mole fraction is specified."));
973
case MOLAR_MASS_ZERO:
974
ui.error->setText(i18n("Molar mass cannot be zero, please enter a valid value."));
977
ui.error->setText(i18n("Equivalent mass cannot be zero, please enter a valid value."));
984
#include "concCalculator.moc"