From e3e7fd9c3a850732b3c74bb752c7bc24e194e53d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Wed, 7 Jan 2015 20:10:41 +0100 Subject: [PATCH] Finish walkthrough implementation for solubility suite, V FROM G KS. - Use global Finalize for Chem_Problem --- bin/templates/face_solubility_submit.html | 6 ++ bin/templates/face_solubility_v_f_g_ks.html | 1 + .../walkthrough_solubility_vksgmw.html | 27 +++++++++ bin/tex2ima | 2 +- .../solubility_suite/v_answer.ttex | 1 + .../solubility_suite/v_diss_c.ttex | 1 + .../solubility_suite/v_plug_c.ttex | 1 + .../solubility_suite/v_plug_volume.ttex | 1 + .../solubility_suite/v_pre_radex.ttex | 1 + src/face_generators/face_generator.adb | 56 ++++++++++++++++++- src/face_generators/face_generator.ads | 4 ++ src/face_generators/face_generator_static.adb | 2 +- .../problem_generator-acidobazic_suite.adb | 6 -- .../problem_generator-solubility_suite.adb | 43 +++++++------- ...roblem_generator-titration_curve_suite.adb | 5 -- src/problem_generators/problem_generator.adb | 5 ++ src/problem_generators/problem_generator.ads | 22 ++++---- .../problem_generator_syswides.ads | 6 +- 18 files changed, 143 insertions(+), 47 deletions(-) create mode 100644 bin/templates/walkthrough_solubility_vksgmw.html create mode 100644 bin/walkthrough_templates/solubility_suite/v_answer.ttex create mode 100644 bin/walkthrough_templates/solubility_suite/v_diss_c.ttex create mode 100644 bin/walkthrough_templates/solubility_suite/v_plug_c.ttex create mode 100644 bin/walkthrough_templates/solubility_suite/v_plug_volume.ttex create mode 100644 bin/walkthrough_templates/solubility_suite/v_pre_radex.ttex diff --git a/bin/templates/face_solubility_submit.html b/bin/templates/face_solubility_submit.html index 7994b92..155c9d7 100644 --- a/bin/templates/face_solubility_submit.html +++ b/bin/templates/face_solubility_submit.html @@ -8,3 +8,9 @@ +
+ +
+ +
+
diff --git a/bin/templates/face_solubility_v_f_g_ks.html b/bin/templates/face_solubility_v_f_g_ks.html index 0efead9..7ebf58b 100644 --- a/bin/templates/face_solubility_v_f_g_ks.html +++ b/bin/templates/face_solubility_v_f_g_ks.html @@ -5,6 +5,7 @@ @_SUBMIT_FORM_@ + @_WALKTHROUGH_SECTION_@ @_ANSWER_SECTION_@
diff --git a/bin/templates/walkthrough_solubility_vksgmw.html b/bin/templates/walkthrough_solubility_vksgmw.html new file mode 100644 index 0000000..f183eb2 --- /dev/null +++ b/bin/templates/walkthrough_solubility_vksgmw.html @@ -0,0 +1,27 @@ +
+
Řešení:
+
+
+ Koncentrace rozpuštěné soli: +
+ Koncentrace rozpuštěné soli + Koncentrace rozpuštěné soli + Koncentrace rozpuštěné soli + Koncentrace rozpuštěné soli +
+ +
+
+ Objem, ve kterém se dané množství soli práve zcela rozpustí: +
+ Objem + Objem +
+ +
+
+ Konečný výsledek: +
+ Konečný výsledek +
+
diff --git a/bin/tex2ima b/bin/tex2ima index 7e056a5..ea67ee4 100755 --- a/bin/tex2ima +++ b/bin/tex2ima @@ -45,7 +45,7 @@ fi; homedir="`pwd`" || exit 1 if test -n "`type -p mktemp`" ; then - tmpdir=`mktemp ${homedir}/tmp/tex2imXXXXXX` + tmpdir=`mktemp ${homedir}/tmp/tex2imXXXXXX` || exit 1 rm $tmpdir mkdir $tmpdir else diff --git a/bin/walkthrough_templates/solubility_suite/v_answer.ttex b/bin/walkthrough_templates/solubility_suite/v_answer.ttex new file mode 100644 index 0000000..24df8aa --- /dev/null +++ b/bin/walkthrough_templates/solubility_suite/v_answer.ttex @@ -0,0 +1 @@ +V = @_WT_RES_INT_@,@_WT_RES_DEC_@ \cdot 10^{@_WT_RES_EXP_@}~\si{\cubic\deci\metre} diff --git a/bin/walkthrough_templates/solubility_suite/v_diss_c.ttex b/bin/walkthrough_templates/solubility_suite/v_diss_c.ttex new file mode 100644 index 0000000..8b968c1 --- /dev/null +++ b/bin/walkthrough_templates/solubility_suite/v_diss_c.ttex @@ -0,0 +1 @@ +c = @_WT_DC_INT_@,@_WT_DC_DEC_@ \cdot 10^{@_WT_DC_EXP_@}~\si{\mol\per\cubic\deci\metre} diff --git a/bin/walkthrough_templates/solubility_suite/v_plug_c.ttex b/bin/walkthrough_templates/solubility_suite/v_plug_c.ttex new file mode 100644 index 0000000..fcec460 --- /dev/null +++ b/bin/walkthrough_templates/solubility_suite/v_plug_c.ttex @@ -0,0 +1 @@ +c = \sqrt[@_WT_M_@ + @_WT_N_@]{\frac{@_WT_KS_INT_@,@_WT_KS_DEC_@ \cdot 10^{@_WT_KS_EXP_@}}{@_WT_M_@^@_WT_M_@ @_WT_N_@^@_WT_N_@}}~\si{\mol\per\cubic\deci\metre} diff --git a/bin/walkthrough_templates/solubility_suite/v_plug_volume.ttex b/bin/walkthrough_templates/solubility_suite/v_plug_volume.ttex new file mode 100644 index 0000000..d4b9484 --- /dev/null +++ b/bin/walkthrough_templates/solubility_suite/v_plug_volume.ttex @@ -0,0 +1 @@ +V = \frac{@_WT_G_INT_@,@_WT_G_DEC_@}{@_WT_MW_INT_@,@_WT_MW_DEC_@ \cdot @_WT_DC_INT_@,@_WT_DC_DEC_@ \cdot 10^{@_WT_DC_EXP_@}}~\si{\cubic\deci\metre} diff --git a/bin/walkthrough_templates/solubility_suite/v_pre_radex.ttex b/bin/walkthrough_templates/solubility_suite/v_pre_radex.ttex new file mode 100644 index 0000000..4d899a2 --- /dev/null +++ b/bin/walkthrough_templates/solubility_suite/v_pre_radex.ttex @@ -0,0 +1 @@ +c = \sqrt[@_WT_MPN_@]{@_WT_KDMN_INT_@,@_WT_KDMN_DEC_@ \cdot 10^{@_WT_KDMN_EXP_@}}~\si{\mol\per\cubic\deci\metre} diff --git a/src/face_generators/face_generator.adb b/src/face_generators/face_generator.adb index 96b1e0e..08f02e7 100644 --- a/src/face_generators/face_generator.adb +++ b/src/face_generators/face_generator.adb @@ -212,6 +212,46 @@ package body Face_Generator is return OK; end Add_Walkthrough_Acidobazic; + function Add_Walkthrough_Solubility_V_FROM_G_KS(Translations: in out AWS.Templates.Translate_Set; + Walkthrough: in Problem_Generator_Syswides.Walkthrough_Info.Map) return RetCode is + use AWS.Templates; + use Problem_Generator_Syswides; + use Problem_Generator_Syswides.Solubility_Suite; + use Problem_Generator_Syswides.Walkthrough_Info; + + WTrans: Translate_Set; + HTML: HTML_Code; + begin + if Walkthrough.Find(WT_V_PLUG_C_RESULT_KEY) = Walkthrough_Info.No_Element then + return E_INVAL; + end if; + Insert(WTrans, Assoc(WT_V_PLUG_C_RESULT_KEY, Walkthrough.Element(WT_V_PLUG_C_RESULT_KEY))); + + if Walkthrough.Find(WT_V_PRE_RADEX_RESULT_KEY) = Walkthrough_Info.No_Element then + return E_INVAL; + end if; + Insert(WTrans, Assoc(WT_V_PRE_RADEX_RESULT_KEY, Walkthrough.Element(WT_V_PRE_RADEX_RESULT_KEY))); + + if Walkthrough.Find(WT_V_DISS_C_RESULT_KEY) = Walkthrough_Info.No_Element then + return E_INVAL; + end if; + Insert(WTrans, Assoc(WT_V_DISS_C_RESULT_KEY, Walkthrough.Element(WT_V_DISS_C_RESULT_KEY))); + + if Walkthrough.Find(WT_V_PLUG_VOLUME_RESULT_KEY) = Walkthrough_Info.No_Element then + return E_INVAL; + end if; + Insert(WTrans, Assoc(WT_V_PLUG_VOLUME_RESULT_KEY, Walkthrough.Element(WT_V_PLUG_VOLUME_RESULT_KEY))); + + if Walkthrough.Find(WT_FINAL_RESULT_KEY) = Walkthrough_Info.No_Element then + return E_INVAL; + end if; + Insert(WTrans, Assoc(WT_FINAL_RESULT_KEY, Walkthrough.Element(WT_FINAL_RESULT_KEY))); + + HTML := Parse(Filename => "templates/walkthrough_solubility_vksgmw.html", Translations => WTrans); + Insert(Translations, Assoc(WALKTHROUGH_SECTION_KEY, HTML_To_Fixed_String(HTML))); + return OK; + end Add_Walkthrough_Solubility_V_FROM_G_KS; + function Generate_Face_Acidobazic(Mode: in Display_Mode; Assignment: in Problem_Generator_Syswides.Assignment_Info.Map; Answer_Message: in UB_Text; @@ -355,6 +395,7 @@ package body Face_Generator is P_Subtype: UB_Text; begin + P_Subtype := To_UB_Text(Parameters.Element(Solubility_Suite.PARAMETER_PROBLEM_SUBTYPE_KEY)); Insert(Translations_Hdr, Assoc(HEADER_CAPTION_KEY, "< " & Solubility_Suite.PROBLEM_NAME_READABLE)); HTML := Parse(Filename => "templates/header.html", Translations => Translations_Hdr); -- Add JavaScripts @@ -364,6 +405,20 @@ package body Face_Generator is case Mode is when Answer_Mode => Add_Answer_Section(Translations, Answer_Message, Answer_Code); + when Walkthrough_Mode => + declare + Ret: RetCode; + begin + if P_Subtype = Solubility_Suite.PROBLEM_SUBTYPE_V_FROM_G_KS then + Ret := Add_Walkthrough_Solubility_V_FROM_G_KS(Translations, Walkthrough); + else + return E_NOTIMPL; + end if; + + if Ret /= OK then + return Ret; + end if; + end; when others => null; end case; @@ -396,7 +451,6 @@ package body Face_Generator is -- This parameter must be always present return E_INVAL; end if; - P_Subtype := To_UB_Text(Parameters.Element(Solubility_Suite.PARAMETER_PROBLEM_SUBTYPE_KEY)); Insert(Translations_Params, Assoc(Solubility_Suite.PARAMETER_PROBLEM_SUBTYPE_KEY, Solubility_Suite.PARAMETER_PROBLEM_SUBTYPE_KEY)); Insert(Translations_Params, Assoc(Solubility_Suite.PROBLEM_SUBTYPE_V_FROM_G_KS, Solubility_Suite.PROBLEM_SUBTYPE_V_FROM_G_KS)); Insert(Translations_Params, Assoc(Solubility_Suite.PROBLEM_SUBTYPE_KS_FROM_G_V, Solubility_Suite.PROBLEM_SUBTYPE_KS_FROM_G_V)); diff --git a/src/face_generators/face_generator.ads b/src/face_generators/face_generator.ads index 89002e7..dc96e70 100644 --- a/src/face_generators/face_generator.ads +++ b/src/face_generators/face_generator.ads @@ -42,6 +42,10 @@ private function Add_Walkthrough_Acidobazic(Translations: in out AWS.Templates.Translate_Set; Walkthrough: in Problem_Generator_Syswides.Walkthrough_Info.Map) return RetCode; + + function Add_Walkthrough_Solubility_V_FROM_G_KS(Translations: in out AWS.Templates.Translate_Set; + Walkthrough: in Problem_Generator_Syswides.Walkthrough_Info.Map) return RetCode; + function Generate_Face_Acidobazic(Mode: in Display_Mode; Assignment: in Problem_Generator_Syswides.Assignment_Info.Map; Answer_Message: in UB_Text; diff --git a/src/face_generators/face_generator_static.adb b/src/face_generators/face_generator_static.adb index d92d726..a681007 100644 --- a/src/face_generators/face_generator_static.adb +++ b/src/face_generators/face_generator_static.adb @@ -36,7 +36,7 @@ package body Face_Generator_Static is function Error_Display_Walkthrough return HTML_Code is use AWS.Templates; begin - return Parse(Filename => "templates/static/error_display_answer.html"); + return Parse(Filename => "templates/static/error_display_walkthrough.html"); end Error_Display_Walkthrough; function Error_UID_Registration return HTML_Code is diff --git a/src/problem_generators/problem_generator-acidobazic_suite.adb b/src/problem_generators/problem_generator-acidobazic_suite.adb index f3e26c5..fc0532f 100644 --- a/src/problem_generators/problem_generator-acidobazic_suite.adb +++ b/src/problem_generators/problem_generator-acidobazic_suite.adb @@ -711,10 +711,4 @@ package body Acidobazic_Suite is return ((Problem.Kx * Problem.cX) ** (0.5)) / Problem.cX; end Walkthrough_Check_Dissociation; - -- Destructor - overriding procedure Finalize(Problem: in out Acidobazic_Problem) is - begin - Problem.Free_Tracked_Resources; - end Finalize; - end Acidobazic_Suite; diff --git a/src/problem_generators/problem_generator-solubility_suite.adb b/src/problem_generators/problem_generator-solubility_suite.adb index 85e884f..3b065c6 100644 --- a/src/problem_generators/problem_generator-solubility_suite.adb +++ b/src/problem_generators/problem_generator-solubility_suite.adb @@ -16,6 +16,7 @@ package body Solubility_Suite is begin Problem := new Solubility_Problem; Problem.Parameters := Solubility_Parameters'(Ionic_Strength => False, P_Subtype => V_FROM_G_KS); + Problem.Walkthrough_Generated := False; return Problem; end; @@ -332,7 +333,7 @@ package body Solubility_Suite is -- This parameter must be always present return E_INVAL; end if; - + return OK; end Set_Parameters; @@ -526,19 +527,22 @@ package body Solubility_Suite is DC_Dec_Str: UB_Text; DC_Exp_Str: UB_Text; - M_Int: Integer := Integer(Problem.Prob_Data.M); - N_Int: Integer := Integer(Problem.Prob_Data.N); - Final_Trans: Translate_Set; + M_Int: constant Integer := Integer(Problem.Prob_Data.M); + N_Int: constant Integer := Integer(Problem.Prob_Data.N); TeXCode: UB_Text; Ret: RetCode; begin + if Problem.Walkthrough_Generated then + Walkthrough := Problem.Walkthrough_Stored; + return OK; + end if; -- Init multicontext data FH.Split_Integer_Decimal_Exponent_Strs(Diss_C, DECIMALS, DC_Int_Str, DC_Dec_Str, DC_Exp_Str); -- Plug the numbers into the raw equation for dissolved concentration declare - M_Str: String := Integer'Image(M_Int); - N_Str: String := Integer'Image(N_Int); + M_Str: constant String := Integer'Image(M_Int); + N_Str: constant String := Integer'Image(N_Int); Ks_Int_Str: UB_Text; Ks_Dec_Str: UB_Text; Ks_Exp_Str: UB_Text; @@ -552,13 +556,13 @@ package body Solubility_Suite is Insert(Trans, Assoc(WT_M_KEY, M_Str)); Insert(Trans, Assoc(WT_N_KEY, N_Str)); - TeXCode := Parse(Filename => WT_T_PREFIX & "v_plug_numbers.ttex", Translations => Trans); - Ret := TeX_To_PNG(TeXCode, WT_F_V_PLUGNUMS, Problem.Resource_Prefix); + TeXCode := Parse(Filename => WT_T_PREFIX & "v_plug_c.ttex", Translations => Trans); + Ret := TeX_To_PNG(TeXCode, WT_F_V_PLUG_C, Problem.Resource_Prefix); if Ret /= OK then return Ret; end if; - Problem.Add_Tracked_Resource(WT_F_V_PLUGNUMS & WT_F_EXTENSION); - Insert(Final_Trans, Assoc(WT_V_PLUG_C_RESULT_KEY, PRP_Fixed & WT_F_V_PLUGNUMS & WT_F_EXTENSION)); + Problem.Add_Tracked_Resource(WT_F_V_PLUG_C & WT_F_EXTENSION); + Walkthrough.Insert(WT_V_PLUG_C_RESULT_KEY, PRP_Fixed & WT_F_V_PLUG_C & WT_F_EXTENSION); end; -- Show the result just before root extraction @@ -582,7 +586,7 @@ package body Solubility_Suite is return Ret; end if; Problem.Add_Tracked_Resource(WT_F_V_PRE_RADEX & WT_F_EXTENSION); - Insert(Final_Trans, Assoc(WT_V_PRE_RADEX_RESULT_KEY, PRP_Fixed & WT_F_V_PRE_RADEX & WT_F_EXTENSION)); + Walkthrough.Insert(WT_V_PRE_RADEX_RESULT_KEY, PRP_Fixed & WT_F_V_PRE_RADEX & WT_F_EXTENSION); end; -- Dissolved concentration @@ -595,12 +599,12 @@ package body Solubility_Suite is Insert(Trans, Assoc(WT_DC_EXP_KEY, DC_Exp_Str)); TeXCode := Parse(Filename => WT_T_PREFIX & "v_diss_c.ttex", Translations => Trans); - Ret := TeX_To_PNG(TeXCode, WT_F_V_PRE_RADEX, Problem.Resource_Prefix); + Ret := TeX_To_PNG(TeXCode, WT_F_V_DISS_C, Problem.Resource_Prefix); if Ret /= OK then return Ret; end if; Problem.Add_Tracked_Resource(WT_F_V_DISS_C & WT_F_EXTENSION); - Insert(Final_Trans, Assoc(WT_V_DISS_C_RESULT_KEY, PRP_Fixed & WT_F_V_PRE_RADEX & WT_F_EXTENSION)); + Walkthrough.Insert(WT_V_DISS_C_RESULT_KEY, PRP_Fixed & WT_F_V_DISS_C & WT_F_EXTENSION); end; -- Plug the numbers into the volume calculation @@ -613,7 +617,7 @@ package body Solubility_Suite is Trans: Translate_Set; begin FH.Split_Integer_Decimal_Unscaled_Strs(Problem.Prob_Data.V_G, DECIMALS, G_Int_Str, G_Dec_Str); - FH.Split_Integer_Decimal_Unscaled_Strs(Problem.Prob_Data.V_MW, DECIMALS, MW_Int_Str, MW_Dec_Str); + FH.Split_Integer_Decimal_Unscaled_Strs(Problem.Prob_Data.V_MW, DECIMALS_MW, MW_Int_Str, MW_Dec_Str); Insert(Trans, Assoc(WT_G_INT_KEY, G_Int_Str)); Insert(Trans, Assoc(WT_G_DEC_KEY, G_Dec_Str)); @@ -623,13 +627,13 @@ package body Solubility_Suite is Insert(Trans, Assoc(WT_DC_DEC_KEY, DC_Dec_Str)); Insert(Trans, Assoc(WT_DC_EXP_KEY, DC_Exp_Str)); - TeXCode := Parse(Filename => WT_T_PREFIX & "v_volume_plug.ttex", Translations => Trans); - Ret := TeX_To_PNG(TeXCode, WT_F_V_PLUG, Problem.Resource_Prefix); + TeXCode := Parse(Filename => WT_T_PREFIX & "v_plug_volume.ttex", Translations => Trans); + Ret := TeX_To_PNG(TeXCode, WT_F_V_PLUG_VOLUME, Problem.Resource_Prefix); if Ret /= OK then return Ret; end if; - Problem.Add_Tracked_Resource(WT_F_V_PLUG & WT_F_EXTENSION); - Insert(Final_Trans, Assoc(WT_V_PLUG_VOLUME_RESULT_KEY, PRP_Fixed & WT_F_V_PLUG & WT_F_EXTENSION)); + Problem.Add_Tracked_Resource(WT_F_V_PLUG_VOLUME & WT_F_EXTENSION); + Walkthrough.Insert(WT_V_PLUG_VOLUME_RESULT_KEY, PRP_Fixed & WT_F_V_PLUG_VOLUME & WT_F_EXTENSION); end; -- Display the final result @@ -652,9 +656,10 @@ package body Solubility_Suite is return Ret; end if; Problem.Add_Tracked_Resource(WT_F_ANSWER & WT_F_EXTENSION); - Insert(Final_Trans, Assoc(WT_ANSWER_RESULT_KEY, PRP_Fixed & WT_F_ANSWER & WT_F_EXTENSION)); + Walkthrough.Insert(WT_FINAL_RESULT_KEY, PRP_Fixed & WT_F_ANSWER & WT_F_EXTENSION); end; + Problem.Walkthrough_Generated := True; return OK; end Gen_Walkthrough_V_FROM_G_KS; diff --git a/src/problem_generators/problem_generator-titration_curve_suite.adb b/src/problem_generators/problem_generator-titration_curve_suite.adb index 4034a35..7c3e2b3 100644 --- a/src/problem_generators/problem_generator-titration_curve_suite.adb +++ b/src/problem_generators/problem_generator-titration_curve_suite.adb @@ -300,11 +300,6 @@ package body Titration_Curve_Suite is begin return OK; end Set_Parameters; - - overriding procedure Finalize(Problem: in out Titration_Curve_Problem) is - begin - Free_Tracked_Resources(Problem); - end Finalize; -- END: Inherited functions -- BEGIN: Private functions diff --git a/src/problem_generators/problem_generator.adb b/src/problem_generators/problem_generator.adb index ff5cebf..41126b8 100644 --- a/src/problem_generators/problem_generator.adb +++ b/src/problem_generators/problem_generator.adb @@ -59,6 +59,11 @@ package body Problem_Generator is Problem.Resource_Prefix := Ada.Strings.Unbounded.To_Unbounded_String(Prefix); end Set_Resource_Prefix; + procedure Finalize(Problem: in out Chem_Problem) is + begin + Free_Tracked_Resources(Problem); + end Finalize; + package body Acidobazic_Suite is separate; package body Solubility_Suite is separate; package body Titration_Curve_Suite is separate; diff --git a/src/problem_generators/problem_generator.ads b/src/problem_generators/problem_generator.ads index 8169b59..15c1487 100644 --- a/src/problem_generators/problem_generator.ads +++ b/src/problem_generators/problem_generator.ads @@ -19,6 +19,7 @@ package Problem_Generator is procedure New_Problem(Problem: in out Chem_Problem) is abstract; function Set_Parameters(Problem: in out Chem_Problem; Parameters: in Parameters_Info.Map) return RetCode is abstract; procedure Set_Resource_Prefix(Problem: in out Chem_Problem; Prefix: in String); + -- function Get_Problem(P_Type: in Problem_Type) return access Chem_Problem'Class; private @@ -29,9 +30,12 @@ private record Resource_Prefix: Ada.Strings.Unbounded.Unbounded_String; TRL: Resource_List.List; + Walkthrough_Generated: Boolean; + Walkthrough_Stored: Problem_Generator_Syswides.Walkthrough_Info.Map; end record; procedure Add_Tracked_Resource(Problem: in out Chem_Problem; Name: in String); procedure Free_Tracked_Resources(Problem: in out Chem_Problem); + procedure Finalize(Problem: in out Chem_Problem); WT_F_EXTENSION: constant String := ".png"; WALKTHROUGH_TEMPLATES_PATH: constant String := "walkthrough_templates/"; @@ -49,7 +53,6 @@ private function Get_Parameters(Problem: in out Acidobazic_Problem; Parameters: out Parameters_Info.Map) return RetCode; function Get_Walkthrough(Problem: in out Acidobazic_Problem; Walkthrough: out Walkthrough_Info.Map) return RetCode; function Set_Parameters(Problem: in out Acidobazic_Problem; Parameters: in Parameters_Info.Map) return RetCode; - overriding procedure Finalize(Problem: in out Acidobazic_Problem); private type pH_Float is digits 15; @@ -88,8 +91,6 @@ private Parameters: Acidobazic_Parameters; Simpl: Simplification; Subst_Type: Substance_Type; - Walkthrough_Generated: Boolean; - Walkthrough_Stored: Problem_Generator_Syswides.Walkthrough_Info.Map; end record; Acidic_Min_pH: constant pH_Float := 1.75; @@ -221,9 +222,9 @@ private WT_T_PREFIX: constant String := WALKTHROUGH_TEMPLATES_PATH & "solubility_suite/"; WT_F_ANSWER: constant String := "answer"; WT_F_V_DISS_C: constant String := "v_diss_c"; - WT_F_V_PLUGNUMS: constant String := "v_plug_nums"; + WT_F_V_PLUG_C: constant String := "v_plug_c"; WT_F_V_PRE_RADEX: constant String := "v_pre_radex"; - WT_F_V_PLUG: constant String := "v_plug"; + WT_F_V_PLUG_VOLUME: constant String := "v_plug_volume"; -- WT_DC_INT_KEY: constant String := "WT_DC_INT"; WT_DC_DEC_KEY: constant String := "WT_DC_DEC"; @@ -239,11 +240,11 @@ private WT_M_KEY: constant String := "WT_M"; WT_N_KEY: constant String := "WT_N"; WT_MPN_KEY: constant String := "WT_MPN"; - WT_MW_INT_KEY: constant String := "WT_MW_INT_KEY"; - WT_MW_DEC_KEY: constant String := "WT_MW_DEC_KEY"; - WT_RES_INT_KEY: constant String := "WT_RES_INT_KEY"; - WT_RES_DEC_KEY: constant String := "WT_RES_DEC_KEY"; - WT_RES_EXP_KEY: constant String := "WT_RES_EXP_KEY"; + WT_MW_INT_KEY: constant String := "WT_MW_INT"; + WT_MW_DEC_KEY: constant String := "WT_MW_DEC"; + WT_RES_INT_KEY: constant String := "WT_RES_INT"; + WT_RES_DEC_KEY: constant String := "WT_RES_DEC"; + WT_RES_EXP_KEY: constant String := "WT_RES_EXP"; end Solubility_Suite; @@ -261,7 +262,6 @@ private function Get_Walkthrough(Problem: in out Titration_Curve_Problem; Walkthrough: out Walkthrough_Info.Map) return RetCode; procedure New_Problem(Problem: in out Titration_Curve_Problem); function Set_Parameters(Problem: in out Titration_Curve_Problem; Parameters: in Parameters_Info.Map) return RetCode; - overriding procedure Finalize(Problem: in out Titration_Curve_Problem); private Math_Limitation: exception; diff --git a/src/problem_generators/problem_generator_syswides.ads b/src/problem_generators/problem_generator_syswides.ads index fc7df85..d7788b7 100644 --- a/src/problem_generators/problem_generator_syswides.ads +++ b/src/problem_generators/problem_generator_syswides.ads @@ -30,6 +30,8 @@ package Problem_Generator_Syswides is RESERVED_PROBLEM_ID_VAL_KEY: constant String := "RESERVED__PROBLEM_ID_VAL"; RESERVED_PROBLEM_CATEGORY_KEY: constant String := "RESERVED__PROBLEM_CATEGORY"; RESERVED_PROBLEM_CATEGORY_VAL_KEY: constant String := "RESERVED__PROBLEM_CATEGORY_VAL"; + -- + WT_FINAL_RESULT_KEY: constant String := "WT_FINAL_RESULT"; package Acidobazic_Suite is -- What effect to ignore in calculations? @@ -59,7 +61,6 @@ package Problem_Generator_Syswides is WT_DISSOC_CALCULATION_KEY: constant String := "WT_DISSOC_CALCULATION"; WT_DISSOC_CORR_FORMULA_KEY: constant String := "WT_DISSOC_CORR_FORMULA"; WT_DISSOC_CORR_RESULT_KEY: constant String := "WT_DISSOC_CORR_RESULT"; - WT_FINAL_RESULT_KEY: constant String := "WT_FINAL_RESULT"; WT_IGN_ATPR_FORMULA_KEY: constant String := "WT_IGN_ATPR_FORMULA"; WT_IGN_ATPR_RESULT_KEY: constant String := "WT_IGN_ATPR_RESULT"; WT_IGN_CONCLUSION_KEY: constant String := "IGN_CONCLUSION"; @@ -99,8 +100,7 @@ package Problem_Generator_Syswides is -- FILLIN_ANSWER_KEY: constant String := "FILLIN_ANSWER"; -- - WT_ANSWER_RESULT_KEY: constant String := "WT_ANSWER_RESULT_KEY"; - WT_V_DISS_C_RESULT_KEY: constant String := "WT_V_DISS_C_RESULT_KEY"; + WT_V_DISS_C_RESULT_KEY: constant String := "WT_V_DISS_C_RESULT"; WT_V_PLUG_C_RESULT_KEY: constant String := "WT_V_PLUG_C_RESULT"; WT_V_PLUG_VOLUME_RESULT_KEY: constant String := "WT_V_PLUG_VOLUME_RESULT"; WT_V_PRE_RADEX_RESULT_KEY: constant String := "WT_V_PRE_RADEX_RESULT"; -- 2.43.5