Сергей Вячеславович Хвощев (глобус) - Спутниковые программы
Название: | Спутниковые программы | |
Автор: | Сергей Вячеславович Хвощев (глобус) | |
Жанр: | Программы | |
Изадано в серии: | неизвестно | |
Издательство: | неизвестно | |
Год издания: | 2022 | |
ISBN: | неизвестно | |
Отзывы: | Комментировать | |
Рейтинг: | ||
Поделись книгой с друзьями! Помощь сайту: донат на оплату сервера |
Краткое содержание книги "Спутниковые программы"
Аннотация к этой книге отсутствует.
Читаем онлайн "Спутниковые программы". [Страница - 8]
Edit1.Text;
IdTCPClient1.Port:=StrToInt(Edit2.Text);
IdTCPClient1.Connect;
Button2.Enabled := true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
LocationSensor1.Active := true;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
i: Integer;
sredneeX, sredneeY, skoX, skoY, sko: real;
ss, xx, yy: string;
count: Integer;
begin
sredneeX := 0;
sredneeY := 0;
skoX := 0;
skoY := 0;
count := Memo1.Lines.count;
Button4.Text := intToStr(count);
for i := 0 to Memo1.Lines.count - 1 do
begin
ss := Memo1.Lines[i];
xx := Copy(ss, 1, pos(' ', ss) - 1);
Trim(xx);
delete(ss, 1, pos(' ', ss));
yy := Copy(ss, 1, length(ss));
Trim(yy);
sredneeX := sredneeX + StrToFloat(xx);
sredneeY := sredneeY + StrToFloat(yy);
end;
sredneeX := sredneeX / count;
sredneeY := sredneeY / count;
for i := 0 to Memo1.Lines.count - 1 do
begin
ss := Memo1.Lines[i];
xx := Copy(ss, 1, pos(' ', ss) - 1);
Trim(xx);
delete(ss, 1, pos(' ', ss));
yy := Copy(ss, 1, length(ss));
Trim(yy);
skoX := skoX + sqr(StrToFloat(xx) - sredneeX);
skoY := skoY + sqr(StrToFloat(yy) - sredneeY);
end;
skoX := sqrt(skoX / count);
skoY := sqrt(skoY / count);
sko := sqrt(sqr(skoX) + sqr(skoY));
Label3.Text := FloatToStrF(sko, ffFixed, 10, 3);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
Memo1.Lines.Clear;
end;
procedure TForm1.LocationSensor1LocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
begin
F1 := NewLocation.Latitude;
L1 := NewLocation.Longitude;
WGS_SK(F1, L1, 0);
SK_Pr(B, L);
x1 := x;
y1 := y;
Label1.Text := FloatToStr(x1);
Label2.Text := FloatToStr(y1);
IdTCPClient1.Socket.WriteLn(Label1.Text + ' ' + Label2.Text);
Memo1.Lines.Add(IdTCPClient1.Socket.ReadLn);
end;
На базе твердые координаты.
procedure TForm1.Button1Click(Sender: TObject);
begin
LocationSensor1.Active := true;
IdTCPServer1.DefaultPort:=StrToInt(Edit4.Text);
IdTCPServer1.Active := true;
end;
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
s, _x, _y: string;
Xispr, Yispr: real;
begin
Edit1.Text := AContext.Connection.Socket.ReadLn;
s := Edit1.Text;
_x := Copy(s, 1, pos(' ', s) - 1);
delete(s, 1, pos(' ', s));
_y := Copy(s, 1, Length(s));
Xispr := StrToFloat(_x) + dX;
Yispr := StrToFloat(_y) + dY;
AContext.Connection.Socket.WriteLn(FloatToStrF(Xispr, ffFixed, 11, 3) + ' ' +
FloatToStrF(Yispr, ffFixed, 11, 3));
end;
procedure TForm1.LocationSensor1LocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
begin
F1 := NewLocation.Latitude;
L1 := NewLocation.Longitude;
WGS_SK(F1, L1, 0);
SK_Pr(B, L);
x1 := x;
y1 := y;
Label1.Text := FloatToStr(x1);
Label2.Text := FloatToStr(y1);
dX := StrToFloat(Edit2.Text) - x1;
dY := StrToFloat(Edit3.Text) - y1;
Memo1.Lines.Add(FloatToStrF(dX, ffFixed, 11, 3) + ' ' + FloatToStrF(dY,
ffFixed, 11, 3));
end;
Исправляет координаты и отправляет клиенту на ровер.
--">
IdTCPClient1.Port:=StrToInt(Edit2.Text);
IdTCPClient1.Connect;
Button2.Enabled := true;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
LocationSensor1.Active := true;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
i: Integer;
sredneeX, sredneeY, skoX, skoY, sko: real;
ss, xx, yy: string;
count: Integer;
begin
sredneeX := 0;
sredneeY := 0;
skoX := 0;
skoY := 0;
count := Memo1.Lines.count;
Button4.Text := intToStr(count);
for i := 0 to Memo1.Lines.count - 1 do
begin
ss := Memo1.Lines[i];
xx := Copy(ss, 1, pos(' ', ss) - 1);
Trim(xx);
delete(ss, 1, pos(' ', ss));
yy := Copy(ss, 1, length(ss));
Trim(yy);
sredneeX := sredneeX + StrToFloat(xx);
sredneeY := sredneeY + StrToFloat(yy);
end;
sredneeX := sredneeX / count;
sredneeY := sredneeY / count;
for i := 0 to Memo1.Lines.count - 1 do
begin
ss := Memo1.Lines[i];
xx := Copy(ss, 1, pos(' ', ss) - 1);
Trim(xx);
delete(ss, 1, pos(' ', ss));
yy := Copy(ss, 1, length(ss));
Trim(yy);
skoX := skoX + sqr(StrToFloat(xx) - sredneeX);
skoY := skoY + sqr(StrToFloat(yy) - sredneeY);
end;
skoX := sqrt(skoX / count);
skoY := sqrt(skoY / count);
sko := sqrt(sqr(skoX) + sqr(skoY));
Label3.Text := FloatToStrF(sko, ffFixed, 10, 3);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
Memo1.Lines.Clear;
end;
procedure TForm1.LocationSensor1LocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
begin
F1 := NewLocation.Latitude;
L1 := NewLocation.Longitude;
WGS_SK(F1, L1, 0);
SK_Pr(B, L);
x1 := x;
y1 := y;
Label1.Text := FloatToStr(x1);
Label2.Text := FloatToStr(y1);
IdTCPClient1.Socket.WriteLn(Label1.Text + ' ' + Label2.Text);
Memo1.Lines.Add(IdTCPClient1.Socket.ReadLn);
end;
На базе твердые координаты.
procedure TForm1.Button1Click(Sender: TObject);
begin
LocationSensor1.Active := true;
IdTCPServer1.DefaultPort:=StrToInt(Edit4.Text);
IdTCPServer1.Active := true;
end;
procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
var
s, _x, _y: string;
Xispr, Yispr: real;
begin
Edit1.Text := AContext.Connection.Socket.ReadLn;
s := Edit1.Text;
_x := Copy(s, 1, pos(' ', s) - 1);
delete(s, 1, pos(' ', s));
_y := Copy(s, 1, Length(s));
Xispr := StrToFloat(_x) + dX;
Yispr := StrToFloat(_y) + dY;
AContext.Connection.Socket.WriteLn(FloatToStrF(Xispr, ffFixed, 11, 3) + ' ' +
FloatToStrF(Yispr, ffFixed, 11, 3));
end;
procedure TForm1.LocationSensor1LocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
begin
F1 := NewLocation.Latitude;
L1 := NewLocation.Longitude;
WGS_SK(F1, L1, 0);
SK_Pr(B, L);
x1 := x;
y1 := y;
Label1.Text := FloatToStr(x1);
Label2.Text := FloatToStr(y1);
dX := StrToFloat(Edit2.Text) - x1;
dY := StrToFloat(Edit3.Text) - y1;
Memo1.Lines.Add(FloatToStrF(dX, ffFixed, 11, 3) + ' ' + FloatToStrF(dY,
ffFixed, 11, 3));
end;
Исправляет координаты и отправляет клиенту на ровер.
--">
Книги схожие с «Спутниковые программы» по жанру, серии, автору или названию:
Владимир Пташинский - 33 лучшие программы для ноутбука. Популярный самоучитель Жанр: Программы Год издания: 2008 Серия: Популярный самоучитель |
Василий Халявин - Халявные антивирусы и другие бесплатные программы из Интернета! Жанр: Интернет Год издания: 2011 |
Маттиас Фелляйзен, Мэтью Флэтт, Роберт Брюс Финдлер и др. - Как проектировать программы Жанр: Околокомпьютерная литература Год издания: 2022 |
Сергей Вячеславович Хвощев (глобус) - Игры на Делфи Жанр: Программы Год издания: 2022 |