AWS.Config.Set.Server_Host(Server_Config, "localhost");
AWS.Config.Set.Server_Port(Server_Config, 18400);
- AWS.Config.Set.Session_Lifetime(90.0);
- AWS.Config.Set.Session_Cleanup_Interval(180.0);
+ AWS.Config.Set.Session_Lifetime(1800.0);
+ AWS.Config.Set.Session_Cleanup_Interval(3600.0);
Ada.Text_IO.Put_Line("Starting server...");
AWS.Server.Start(Web_Server => Web_Server,
declare
Simplification_Str: constant String := Answer.Element(ANSWER_SIMPLIFICATION_KEY);
begin
- Ada.Text_IO.Put_Line("SS : " & Simplification_Str & " SI : " & Simplification'Image(Problem.Simpl));
if Simplification_Str /= Simplification'Image(Problem.Simpl) then
Message := To_UB_Text("Nesprávné zanedbání");
return Wrong_Answer;
Min := Correct_Up(Min);
end if;
Max := Correct_Down(Max);
- --Ada.Text_IO.Put_Line("Min: " & pH_Float'Image(Min) & " Max: " & pH_Float'Image(Max) & " Simpl: " & Simplification'Image(S));
end Calculate_Concentration_Limits;
function Calculate_Solution(Problem: in Acidobazic_Problem) return pH_Float is
use pH_Float_IO;
use Ada.Text_IO;
begin
- -- DEBUG Dump
- --Put("* Kx = "); Put(Problem.Kx);
- --Put(" | cX = "); Put(Problem.cX);
- --case Problem.Subst_Type is
- -- when Acid =>
- -- Put_Line(" | ACID");
- -- when Base =>
- -- Put_Line(" | BASE");
- -- end case;
- -- END DEBUG Dump
-
case Problem.Simpl is
-- We are ignoring everything
when Both =>
declare
pH: constant pH_Float := X_To_pX(Sqrt(Problem.Kx * Problem.cX));
begin
- --Ada.Text_IO.Put_Line("Both simplifications");
case Problem.Subst_Type is
when Acid =>
return pH;
X_2: pH_Float;
pH: pH_Float;
begin
- --Ada.Text_IO.Put_Line("Taking only dissociation into account");
-- Solve the quadratic equation
D := (Problem.Kx ** 2.0) + (4.0 * Problem.Kx * Problem.cX);
if D < 0.0 then
declare
pH: constant pH_Float := X_To_pX(Sqrt(Problem.Kx * Problem.cX + K_W));
begin
- --Ada.Text_IO.Put_Line("Taking only autoprotolysis into account");
case Problem.Subst_Type is
when Acid =>
return pH;
GM := Calculate_Activity_Coefficient(Prob_Data.N, I);
GN := Calculate_Activity_Coefficient(Prob_Data.M, I);
- Ada.Text_IO.Put_Line("IS, AC");
SS_IO.Put(I); Ada.Text_IO.New_Line;
SS_IO.Put(GM); Ada.Text_IO.New_Line;
SS_IO.Put(GN); Ada.Text_IO.New_Line;
-- Initialize problem
if Parameters.Is_Empty = False then
Success := Problem.Set_Parameters(Parameters);
- Ada.Text_IO.Put_Line("Setting problem parameters");
if Success = False then
Free_Chem_Problem(Problem);
return False;