Skip to content

Commit

Permalink
готово
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-grixa committed Dec 8, 2022
1 parent 4958b9e commit 12af083
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 30 deletions.
7 changes: 7 additions & 0 deletions L1/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 37 additions & 30 deletions L1/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,31 +269,8 @@ public void UpD()

public void Trigger()
{
int rast = (Math.Abs(Convert.ToInt32(Rdata.le) - Rstart) + Math.Abs(Convert.ToInt32(Rdata.le) - Lstart)) / 2;
label5.Text = rast.ToString();
if (rast > 4534)
{
if (Rmess.B != 30)
{
Rmess.B=30;
}
else
{
Rmess.B=-30;
}
Rstart = Convert.ToInt32(Rdata.le);
Lstart = Convert.ToInt32(Rdata.le);
Rmess.N++;
SendUDPMessage();
}

}
// //int le = 3734;
// //int re = 5335;
// //100 30

int Rstart=0;
int Lstart = 0;

void map()
{
Expand All @@ -309,15 +286,44 @@ void map()
pictureBox_map.Image=bitmap;
//pictureBox_map.Image.RotateFlip(RotateFlipType.Rotate180FlipX);
}
int shag = 0;
private void checkBox_AI_CheckedChanged(object sender, EventArgs e)
{
Rstart = Convert.ToInt32(Rdata.le);
Lstart = Convert.ToInt32(Rdata.le);
Rmess.B = -30;
Rmess.F = 100;
Rmess.N++;
SendUDPMessage();
}
if (checkBox_AI.Checked)
{
Rmess.B = 30;
Rmess.F = 100;
Rmess.N++;
SendUDPMessage();
timer1.Start();
shag = 0;
}
else
{
timer1.Stop();
}
}

private void timer1_Tick(object sender, EventArgs e)
{
switch (shag)
{
case 0:
shag = 1;
Rmess.B = -30;
Rmess.F = 100;
Rmess.N++;
SendUDPMessage();
break;
case 1:
Rmess.B = 0;
Rmess.F = 0;
Rmess.N++;
SendUDPMessage();
break;
}
}

private void up_N_ValueChanged(object sender, EventArgs e)
{
Rmess.N = (int)up_N.Value;
Expand All @@ -342,5 +348,6 @@ private void up_T_ValueChanged(object sender, EventArgs e)
{
Rmess.T = (int)up_T.Value;
}

}
}
3 changes: 3 additions & 0 deletions L1/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@
<metadata name="UDPRegularSenderTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>203, 17</value>
</metadata>
</root>

0 comments on commit 12af083

Please sign in to comment.