Лабораторная работа №7 3

This commit is contained in:
Shtyrkin_Egor 2024-05-13 10:41:38 +04:00
parent 3281b42193
commit 899cd1e27a
3 changed files with 77 additions and 50 deletions

View File

@ -40,7 +40,7 @@ public abstract class AbstractCompany
/// <summary>
/// Вычисление максимального количества элементов, которых можно разместить в окне
/// </summary>
private int GetMaxCount => _pictureWidth * _pictureHeight / (_placeSizeWidth * _placeSizeHeight);
private int GetMaxCount => _pictureWidth * _pictureHeight / (_placeSizeWidth * _placeSizeHeight) - 6;
/// <summary>
/// Конструктор

View File

@ -73,8 +73,10 @@
groupBoxConfig.Controls.Add(labelSimpleObject);
groupBoxConfig.Dock = DockStyle.Left;
groupBoxConfig.Location = new Point(0, 0);
groupBoxConfig.Margin = new Padding(3, 2, 3, 2);
groupBoxConfig.Name = "groupBoxConfig";
groupBoxConfig.Size = new Size(686, 215);
groupBoxConfig.Padding = new Padding(3, 2, 3, 2);
groupBoxConfig.Size = new Size(600, 161);
groupBoxConfig.TabIndex = 0;
groupBoxConfig.TabStop = false;
groupBoxConfig.Text = "Параметры";
@ -89,9 +91,11 @@
groupBoxColors.Controls.Add(panelWhite);
groupBoxColors.Controls.Add(panelGreen);
groupBoxColors.Controls.Add(panelRed);
groupBoxColors.Location = new Point(386, 20);
groupBoxColors.Location = new Point(338, 15);
groupBoxColors.Margin = new Padding(3, 2, 3, 2);
groupBoxColors.Name = "groupBoxColors";
groupBoxColors.Size = new Size(271, 134);
groupBoxColors.Padding = new Padding(3, 2, 3, 2);
groupBoxColors.Size = new Size(237, 100);
groupBoxColors.TabIndex = 8;
groupBoxColors.TabStop = false;
groupBoxColors.Text = "Цвета";
@ -99,73 +103,82 @@
// panelPurple
//
panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(212, 77);
panelPurple.Location = new Point(186, 58);
panelPurple.Margin = new Padding(3, 2, 3, 2);
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(40, 40);
panelPurple.Size = new Size(35, 30);
panelPurple.TabIndex = 3;
//
// panelYellow
//
panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(212, 26);
panelYellow.Location = new Point(186, 20);
panelYellow.Margin = new Padding(3, 2, 3, 2);
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(40, 40);
panelYellow.Size = new Size(35, 30);
panelYellow.TabIndex = 1;
//
// panelBlack
//
panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(148, 77);
panelBlack.Location = new Point(130, 58);
panelBlack.Margin = new Padding(3, 2, 3, 2);
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(40, 40);
panelBlack.Size = new Size(35, 30);
panelBlack.TabIndex = 4;
//
// panelBlue
//
panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(148, 26);
panelBlue.Location = new Point(130, 20);
panelBlue.Margin = new Padding(3, 2, 3, 2);
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(40, 40);
panelBlue.Size = new Size(35, 30);
panelBlue.TabIndex = 1;
//
// panelGray
//
panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(84, 77);
panelGray.Location = new Point(74, 58);
panelGray.Margin = new Padding(3, 2, 3, 2);
panelGray.Name = "panelGray";
panelGray.Size = new Size(40, 40);
panelGray.Size = new Size(35, 30);
panelGray.TabIndex = 5;
//
// panelWhite
//
panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(20, 77);
panelWhite.Location = new Point(18, 58);
panelWhite.Margin = new Padding(3, 2, 3, 2);
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(40, 40);
panelWhite.Size = new Size(35, 30);
panelWhite.TabIndex = 2;
//
// panelGreen
//
panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(84, 26);
panelGreen.Location = new Point(74, 20);
panelGreen.Margin = new Padding(3, 2, 3, 2);
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(40, 40);
panelGreen.Size = new Size(35, 30);
panelGreen.TabIndex = 1;
//
// panelRed
//
panelRed.BackColor = Color.Red;
panelRed.Location = new Point(20, 26);
panelRed.Location = new Point(18, 20);
panelRed.Margin = new Padding(3, 2, 3, 2);
panelRed.Name = "panelRed";
panelRed.Size = new Size(40, 40);
panelRed.Size = new Size(35, 30);
panelRed.TabIndex = 0;
//
// checkBoxControlRoom
//
checkBoxControlRoom.AutoSize = true;
checkBoxControlRoom.Location = new Point(6, 130);
checkBoxControlRoom.Location = new Point(5, 98);
checkBoxControlRoom.Margin = new Padding(3, 2, 3, 2);
checkBoxControlRoom.Name = "checkBoxControlRoom";
checkBoxControlRoom.Size = new Size(286, 24);
checkBoxControlRoom.Size = new Size(227, 19);
checkBoxControlRoom.TabIndex = 7;
checkBoxControlRoom.Text = "Признак наличия рубки управления";
checkBoxControlRoom.UseVisualStyleBackColor = true;
@ -173,57 +186,60 @@
// checkBoxAircraftDeck
//
checkBoxAircraftDeck.AutoSize = true;
checkBoxAircraftDeck.Location = new Point(6, 172);
checkBoxAircraftDeck.Location = new Point(5, 129);
checkBoxAircraftDeck.Margin = new Padding(3, 2, 3, 2);
checkBoxAircraftDeck.Name = "checkBoxAircraftDeck";
checkBoxAircraftDeck.Size = new Size(361, 24);
checkBoxAircraftDeck.Size = new Size(287, 19);
checkBoxAircraftDeck.TabIndex = 6;
checkBoxAircraftDeck.Text = "Признак наличия взлётно-посадочной полосы";
checkBoxAircraftDeck.UseVisualStyleBackColor = true;
//
// numericUpDownWeight
//
numericUpDownWeight.Location = new Point(94, 76);
numericUpDownWeight.Location = new Point(82, 57);
numericUpDownWeight.Margin = new Padding(3, 2, 3, 2);
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWeight.Name = "numericUpDownWeight";
numericUpDownWeight.Size = new Size(122, 27);
numericUpDownWeight.Size = new Size(107, 23);
numericUpDownWeight.TabIndex = 5;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelWeight
//
labelWeight.AutoSize = true;
labelWeight.Location = new Point(12, 78);
labelWeight.Location = new Point(10, 58);
labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(36, 20);
labelWeight.Size = new Size(29, 15);
labelWeight.TabIndex = 4;
labelWeight.Text = "Вес:";
//
// numericUpDownSpeed
//
numericUpDownSpeed.Location = new Point(94, 39);
numericUpDownSpeed.Location = new Point(82, 29);
numericUpDownSpeed.Margin = new Padding(3, 2, 3, 2);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(122, 27);
numericUpDownSpeed.Size = new Size(107, 23);
numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(12, 41);
labelSpeed.Location = new Point(10, 31);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(76, 20);
labelSpeed.Size = new Size(62, 15);
labelSpeed.TabIndex = 2;
labelSpeed.Text = "Скорость:";
//
// labelModifiedObject
//
labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
labelModifiedObject.Location = new Point(538, 162);
labelModifiedObject.Location = new Point(471, 122);
labelModifiedObject.Name = "labelModifiedObject";
labelModifiedObject.Size = new Size(119, 43);
labelModifiedObject.Size = new Size(104, 33);
labelModifiedObject.TabIndex = 1;
labelModifiedObject.Text = "Продвинутый";
labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
@ -232,9 +248,9 @@
// labelSimpleObject
//
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(386, 162);
labelSimpleObject.Location = new Point(338, 122);
labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(119, 43);
labelSimpleObject.Size = new Size(104, 33);
labelSimpleObject.TabIndex = 0;
labelSimpleObject.Text = "Простой";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
@ -242,17 +258,19 @@
//
// pictureBoxObject
//
pictureBoxObject.Location = new Point(48, 65);
pictureBoxObject.Location = new Point(8, 42);
pictureBoxObject.Margin = new Padding(3, 2, 3, 2);
pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(154, 102);
pictureBoxObject.Size = new Size(189, 83);
pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false;
//
// buttonAdd
//
buttonAdd.Location = new Point(703, 176);
buttonAdd.Location = new Point(615, 132);
buttonAdd.Margin = new Padding(3, 2, 3, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(94, 29);
buttonAdd.Size = new Size(82, 22);
buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true;
@ -260,9 +278,10 @@
//
// buttonCancel
//
buttonCancel.Location = new Point(814, 176);
buttonCancel.Location = new Point(712, 132);
buttonCancel.Margin = new Padding(3, 2, 3, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.Size = new Size(82, 22);
buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
@ -273,9 +292,10 @@
panelObject.Controls.Add(labelAdditionalColor);
panelObject.Controls.Add(labelBodyColor);
panelObject.Controls.Add(pictureBoxObject);
panelObject.Location = new Point(683, 0);
panelObject.Location = new Point(598, 0);
panelObject.Margin = new Padding(3, 2, 3, 2);
panelObject.Name = "panelObject";
panelObject.Size = new Size(239, 170);
panelObject.Size = new Size(209, 128);
panelObject.TabIndex = 4;
panelObject.DragDrop += PanelObject_DragDrop;
panelObject.DragEnter += PanelObject_DragEnter;
@ -284,9 +304,9 @@
//
labelAdditionalColor.AllowDrop = true;
labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle;
labelAdditionalColor.Location = new Point(131, 9);
labelAdditionalColor.Location = new Point(115, 7);
labelAdditionalColor.Name = "labelAdditionalColor";
labelAdditionalColor.Size = new Size(94, 43);
labelAdditionalColor.Size = new Size(82, 33);
labelAdditionalColor.TabIndex = 3;
labelAdditionalColor.Text = "Доп. цвет";
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
@ -297,9 +317,9 @@
//
labelBodyColor.AllowDrop = true;
labelBodyColor.BorderStyle = BorderStyle.FixedSingle;
labelBodyColor.Location = new Point(20, 9);
labelBodyColor.Location = new Point(18, 7);
labelBodyColor.Name = "labelBodyColor";
labelBodyColor.Size = new Size(94, 43);
labelBodyColor.Size = new Size(82, 33);
labelBodyColor.TabIndex = 2;
labelBodyColor.Text = "Цвет";
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
@ -308,13 +328,14 @@
//
// FormWarshipConfig
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(923, 215);
ClientSize = new Size(808, 161);
Controls.Add(panelObject);
Controls.Add(buttonCancel);
Controls.Add(buttonAdd);
Controls.Add(groupBoxConfig);
Margin = new Padding(3, 2, 3, 2);
Name = "FormWarshipConfig";
Text = "Создание объекта";
groupBoxConfig.ResumeLayout(false);

View File

@ -10,8 +10,14 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
<ItemGroup>