From: Michal Malý Date: Wed, 24 Dec 2014 15:20:43 +0000 (+0100) Subject: Use "pKa" and "pKb" in titration curve instead of generic "pKx" X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=413da70c67c00a2aaee407b3baeb463831ba9c0f;p=Nine-Q.git Use "pKa" and "pKb" in titration curve instead of generic "pKx" --- diff --git a/bin/templates/face_titration_curve.html b/bin/templates/face_titration_curve.html index fe6d8ca..a65ab53 100644 --- a/bin/templates/face_titration_curve.html +++ b/bin/templates/face_titration_curve.html @@ -1,7 +1,7 @@
Zadání:
-
@_SAMPLE_VOLUME_INT_@,@_SAMPLE_VOLUME_DEC_@ . 10@_SAMPLE_VOLUME_EXP_@ dm3 dvojsytné @_SAMPLE_TYPE_@ o koncentraci @_SAMPLE_CONC_INT_@,@_SAMPLE_CONC_DEC_@ . 10@_SAMPLE_CONC_EXP_@ mol/L o pKx1 = @_PKX1_INT_@,@_PKX1_DEC_@ a pKx2 = @_PKX2_INT_@,@_PKX2_DEC_@ je titrováno odměrným roztokem jednosytné @_TITRANT_TYPE_@ o koncentraci @_TITRANT_CONC_INT_@,@_TITRANT_CONC_DEC_@ . 10@_TITRANT_CONC_EXP_@ mol/L. Spočítejte pH roztoku a objem přidaného titračního činidla v těchto bodech: +
@_SAMPLE_VOLUME_INT_@,@_SAMPLE_VOLUME_DEC_@ . 10@_SAMPLE_VOLUME_EXP_@ dm3 dvojsytné @_SAMPLE_TYPE_@ o koncentraci @_SAMPLE_CONC_INT_@,@_SAMPLE_CONC_DEC_@ . 10@_SAMPLE_CONC_EXP_@ mol/L o @_PKX_TYPE_@ = @_PKX1_INT_@,@_PKX1_DEC_@ a @_PKX_TYPE_@ = @_PKX2_INT_@,@_PKX2_DEC_@ je titrováno odměrným roztokem jednosytné @_TITRANT_TYPE_@ o koncentraci @_TITRANT_CONC_INT_@,@_TITRANT_CONC_DEC_@ . 10@_TITRANT_CONC_EXP_@ mol/L. Spočítejte pH roztoku a objem přidaného titračního činidla v těchto bodech:
  • Na počátku titrace
  • diff --git a/src/face_generators/face_generator.adb b/src/face_generators/face_generator.adb index 8503835..d084bea 100644 --- a/src/face_generators/face_generator.adb +++ b/src/face_generators/face_generator.adb @@ -506,6 +506,10 @@ package body Face_Generator is return E_INVAL; end if; Insert(Translations, Assoc(Titration_Curve_Suite.PKX2_DEC_KEY, Assignment.Element(Titration_Curve_Suite.PKX2_DEC_KEY))); + if (Assignment.Find(Titration_Curve_Suite.PKX_TYPE_KEY)) = Assignment_Info.No_Element then + return E_INVAL; + end if; + Insert(Translations, Assoc(Titration_Curve_Suite.PKX_TYPE_KEY, Assignment.Element(Titration_Curve_Suite.PKX_TYPE_KEY))); -- Insert(Translations, Assoc(Titration_Curve_Suite.ANSWER_PH_START_KEY, Titration_Curve_Suite.ANSWER_PH_START_KEY)); Insert(Translations, Assoc(Titration_Curve_Suite.ANSWER_VOLUME_START_KEY, Titration_Curve_Suite.ANSWER_VOLUME_FIRST_HALF_KEY)); diff --git a/src/problem_generators/problem_generator-titration_curve_suite.adb b/src/problem_generators/problem_generator-titration_curve_suite.adb index 784239e..4293c54 100644 --- a/src/problem_generators/problem_generator-titration_curve_suite.adb +++ b/src/problem_generators/problem_generator-titration_curve_suite.adb @@ -192,9 +192,11 @@ package body Titration_Curve_Suite is Assignment.Insert(PROBLEM_TYPE_KEY, PROBLEM_TYPE_TITRATION_CURVE); case Problem.SType is when ACID => + Assignment.Insert(PKX_TYPE_KEY, PKX_TYPE_ACID); Assignment.Insert(SAMPLE_TYPE_KEY, SAMPLE_TYPE_ACID); Assignment.Insert(TITRANT_TYPE_KEY, TITRANT_TYPE_BASE); when BASE => + Assignment.Insert(PKX_TYPE_KEY, PKX_TYPE_BASE); Assignment.Insert(SAMPLE_TYPE_KEY, SAMPLE_TYPE_BASE); Assignment.Insert(TITRANT_TYPE_KEY, TITRANT_TYPE_ACID); end case; diff --git a/src/problem_generators/problem_generator_syswides.ads b/src/problem_generators/problem_generator_syswides.ads index 42b8dbd..a679138 100644 --- a/src/problem_generators/problem_generator_syswides.ads +++ b/src/problem_generators/problem_generator_syswides.ads @@ -106,6 +106,9 @@ package Problem_Generator_Syswides is SAMPLE_VOLUME_DEC_KEY: constant String := "SAMPLE_VOLUME_DEC"; SAMPLE_VOLUME_EXP_KEY: constant String := "SAMPLE_VOLUME_EXP"; -- + PKX_TYPE_KEY: constant String := "PKX_TYPE"; + PKX_TYPE_ACID: constant String := "pKa"; + PKX_TYPE_BASE: constant String := "pKb"; PKX1_INT_KEY: constant String := "PKX1_INT"; PKX1_DEC_KEY: constant String := "PKX1_DEC"; PKX2_INT_KEY: constant String := "PKX2_INT";