Danh mục

CODE MÔ PHỎNG HIỂN THỊ MỤC TIÊU RADAR TRÊN MÀN HÌNH PC

Số trang: 51      Loại file: doc      Dung lượng: 479.00 KB      Lượt xem: 8      Lượt tải: 0    
10.10.2023

Hỗ trợ phí lưu trữ khi tải xuống: 24,000 VND Tải xuống file đầy đủ (51 trang) 0

Báo xấu

Xem trước 0 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

TÀI LIỆU THAM KHẢO CODE MÔ PHỎNG HIỂN THỊ MỤC TIÊU RADAR TRÊN MÀN HÌNH PC using System;using System.Collections;using System.Collections.Generic;using System.Drawing;using System.Drawing.Design;using System.Drawing.Drawing2D;using System.Drawing.Imaging;using System.Drawing.Text;using System.Windows.Forms;using System.Threading;using System.ComponentModel;using System.Windows;
Nội dung trích xuất từ tài liệu:
CODE MÔ PHỎNG HIỂN THỊ MỤC TIÊU RADAR TRÊN MÀN HÌNH PC CODE MÔ PHỎNG HIỂN THỊ MỤC TIÊU RADAR TRÊN MÀN HÌNH PCForm1using System;using System.Collections;using System.Collections.Generic;using System.Drawing;using System.Drawing.Design;using System.Drawing.Drawing2D;using System.Drawing.Imaging;using System.Drawing.Text;using System.Windows.Forms;using System.Threading;using System.ComponentModel;using System.Windows;namespace Radar{ public partial class MainForm : Form { Radar _radar; Coordinate td1 = new Coordinate(1,400, 400, 4000, 1000, abc); Coordinate td2 = new Coordinate(2, 200, 200, 4000, 1000, abc); List qd1 = new List(); System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); int speed = 400; public static List listTarget = new List(); public static List listTenlua = new List(); public MainForm() { InitializeComponent();// internal item update timer t.Interval = 500; t.Tick += new EventHandler(t_Tick); t.Enabled = true; backgroundWorker1.DoWork+=new System.ComponentModel.DoWorkEventHandler(backgroundWorker1_DoWork);}void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e){ System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(); myPlayer.SoundLocation = @c:sound1.wav; myPlayer.Play();}//update vi tri cac May bay trong khoang thoi gian = t.Intervalvoid t_Tick(object sender, EventArgs e){ double max_angle = _radar.maxAngle * 0.0174532925d; if (listTarget.Count == 0) { lvTarget.Items.Clear(); cbTarget.Items.Clear(); cbTarget.Text = ; } else { //lvTarget.Items.Clear(); cbTarget.Items.Clear(); // select which of the three items to update foreach (FlyingItem item in listTarget) { //khoang cach di duoc cua muc tieu trong 1 s double s = item._current.velocity * 1000 / (3600000 * 3);//toa do tuong doi giua diem di va diem den double x = item._to.X - item._current.X; double y = item._to.Y - item._current.Y; double chenhlech_kc = Math.Sqrt(x * x + y * y); double gocngang = Math.Acos(x / chenhlech_kc); //doi sang do. gocngang = gocngang / 0.0174532925d; if (y < 0) { gocngang = 360d - gocngang; } //doi sang radian de tinh sin va cos gocngang *= 0.0174532925d; double z = item._to.Z - item._current.Z; double gocdung = Math.Asin(z / Math.Sqrt(z * z + chenhlech_kc * chenhlech_kc)); //toa do muc tieu sau 1s double z1 = item._current.Z + (s * Math.Sin(gocdung)); double chenhlech_kc1 = (float)(s * Math.Abs(Math.Cos(gocdung))); double x1 = item._current.X + chenhlech_kc1 * Math.Cos(gocngang); double y1 = item._current.Y + chenhlech_kc1 * Math.Sin(gocngang); Coordinate current = new Coordinate(item._current.stt, x1, y1, z1, item._current.velocity,abc); //gan diem nay thanh diem bat dau item._current = current; if (z >= 0) { item._current = current; if (z1 >= item._to.Z) { for (int k = 0; k < item.airline.Count; k++) { Coordinate td = item.airline[k]; if (td1.stt == item._to.stt) item._to = item.airline[k + 1]; else {} } } else { } } else { item._current = current; if (z1 Radar.getAzimuth(current) && _radar._az - 20 < Radar.getAzimuth(current)&& Radar.getRange(current) item._current.Z) {bool Flag = true;for (int j = 0; j < lvTarget.Items.Count; j++){ if (lvTarget.Items[j].Text.Trim() == item.ID.ToString().Trim()) { ListViewItem lvItem = lvTarget.Items[j]; lvItem.Text = item.ID.ToString(); lvItem.SubItems[1].Text = (item._category); lvItem.SubItems[2].Text = (Radar.getAzimuth(item._current).ToString()); int rg = (int)Radar.getRange(item._current); lvItem.SubItems[3].Text = (rg.ToString()); lvItem.SubI ...

Tài liệu được xem nhiều: