diff --git a/Data/limits.db b/Data/limits.db
new file mode 100644
index 0000000..8f30234
Binary files /dev/null and b/Data/limits.db differ
diff --git a/Pages/Results.cshtml b/Pages/Results.cshtml
index 3d158d8..ff2a90b 100644
--- a/Pages/Results.cshtml
+++ b/Pages/Results.cshtml
@@ -23,9 +23,7 @@
th,
td,
form,
- h2,
- h3,
- img {
+ h2 {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
@@ -38,7 +36,6 @@
-
Расчет размеров поковки
@@ -191,10 +188,10 @@
- Результат без пробы
+ Результат без пробы

- Результат с пробой
+ Результат с пробой

diff --git a/Pages/Results.cshtml.cs b/Pages/Results.cshtml.cs
index 4cbe0b0..a0108a4 100644
--- a/Pages/Results.cshtml.cs
+++ b/Pages/Results.cshtml.cs
@@ -1,10 +1,9 @@
-using Microsoft.AspNetCore.Mvc;
+using Microsoft.Data.Sqlite;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Drawing;
-using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Drawing.Text;
-using System.IO;
+
public class ResultsModel : PageModel
{
@@ -205,6 +204,33 @@ public class ResultsModel : PageModel
ResultImage("Result_WithBlank", mDisk_nom_2_O, mDisk_max_2_O, _dd, d_BilletWithBlank, limit6, _H, H_BilletWithBlank, _D, D_BilletWithBlank, limit4);
}
+
+ public (int Delta, int Tolerance) SearchLimit(double D, double H)
+ {
+ using var connection = new SqliteConnection("Data Source=tolerances.db");
+ connection.Open();
+
+ var command = connection.CreateCommand();
+ command.CommandText = @"
+ SELECT Delta, Tolerance
+ FROM Tolerances
+ WHERE @height > HeightFrom
+ AND @height <= HeightTo
+ AND @diameter > DiameterFrom
+ AND @diameter <= DiameterTo
+ LIMIT 1";
+
+ command.Parameters.AddWithValue("@height", H);
+ command.Parameters.AddWithValue("@diameter", D);
+
+ using var reader = command.ExecuteReader();
+ if (reader.Read())
+ {
+ return (reader.GetInt32(0), reader.GetInt32(1));
+ }
+ return (-1, -1);
+ }
+/*
private (int, int) SearchLimit(double D, double H)
{
// Диапазоны высоты H
@@ -291,7 +317,7 @@ public class ResultsModel : PageModel
return limits[hIndex, dIndex];
}
-
+*/
private string ResultImage(string imageName, double weightNom, double weightMax, double d, double d_Billet,
double limit5, double H, double H_Billet, double D, double D_Billet, double limit3)
{
diff --git a/Program.cs b/Program.cs
index b8ba155..f04de3f 100644
--- a/Program.cs
+++ b/Program.cs
@@ -7,11 +7,6 @@ builder.Services.AddRazorPages(options =>
options.Conventions.ConfigureFilter(new IgnoreAntiforgeryTokenAttribute());
});
-builder.WebHost.ConfigureKestrel(serverOptions =>
-{
- serverOptions.ListenAnyIP(5146);
-});
-
var app = builder.Build();
app.MapRazorPages();
app.UseStaticFiles();
diff --git a/TestApp.csproj b/TestApp.csproj
index bd45387..ca7037f 100644
--- a/TestApp.csproj
+++ b/TestApp.csproj
@@ -7,6 +7,7 @@
+