+++
This commit is contained in:
@ -44,7 +44,7 @@ namespace DroneSimulator
|
||||
|
||||
if (data.Connect)
|
||||
{
|
||||
Drone drone = new Drone(data.ID);
|
||||
Drone drone = new Drone(data.ID, data.Client);
|
||||
drone.Create();
|
||||
|
||||
screen2D.CreateDrone(Color.Red, data.ID);
|
||||
@ -115,6 +115,9 @@ namespace DroneSimulator
|
||||
{
|
||||
button_Client_Start.Text = "Stop";
|
||||
button_Client_Start.BackColor = Color.LimeGreen;
|
||||
numericUpDown_Clients_Limit.Enabled = false;
|
||||
numericUpDown_Clients_Port.Enabled = false;
|
||||
checkBox_Lockstep_Limit.Enabled = false;
|
||||
break;
|
||||
}
|
||||
case NetServerClients.ServerState.Stop:
|
||||
@ -122,6 +125,9 @@ namespace DroneSimulator
|
||||
label_Clients_Num.Text = "0";
|
||||
button_Client_Start.Text = "Start";
|
||||
button_Client_Start.BackColor = Color.Transparent;
|
||||
numericUpDown_Clients_Limit.Enabled = true;
|
||||
numericUpDown_Clients_Port.Enabled = true;
|
||||
checkBox_Lockstep_Limit.Enabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -151,10 +157,9 @@ namespace DroneSimulator
|
||||
|
||||
private void timer_Test_Tick(object sender, EventArgs e)
|
||||
{
|
||||
DateTime test = DateTime.Now;
|
||||
|
||||
int tim = test.Second + test.Minute * 100 + test.Hour * 10000;
|
||||
DateTime time = DateTime.Now;
|
||||
|
||||
label_Lockstep_Time.Text = time.Hour.ToString("D2") + ":" + time.Minute.ToString("D2") + ":" + time.Second.ToString("D2") + "." + time.Millisecond.ToString("D3");
|
||||
|
||||
if (screen2D == null) return;
|
||||
|
||||
@ -176,9 +181,6 @@ namespace DroneSimulator
|
||||
}
|
||||
catch { }
|
||||
|
||||
label_Timing.Text = Drone.Timing.ToString() + " Hz";
|
||||
label_Timing_Lag.Text = Drone.Lag.ToString();
|
||||
|
||||
screen2D.DrawScene();
|
||||
}
|
||||
|
||||
@ -367,10 +369,9 @@ namespace DroneSimulator
|
||||
Drone.StopThread();
|
||||
}
|
||||
|
||||
private void numericUpDown_Timing_Freq_ValueChanged(object sender, EventArgs e)
|
||||
private void checkBox_Lockstep_Limit_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Drone.Freq = (long)numericUpDown_Timing_Freq.Value;
|
||||
Drone.Boost = checkBox_Freq_Boost.Checked;
|
||||
Drone.TimeLimit = checkBox_Lockstep_Limit.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user