卫星系统算法课程设计 - 第二部分 qt的安装与创建项目

2023-05-16

上一篇文章只讲了基本的东西,这一篇要完成qt的安装,构建项目,并且将上一篇的代码导入进去。

某比利比例搜qt安装,看到qt5.14.2的下载安装,跟着做

1、创建项目

  创建新项目,选择Qt widgets Application,然后选路径,然后就选mainwindow的就可以了。

2、导入代码

  将上一篇的那些什么city.h,city.cpp等创建了,复制进去。

然后,下面将放出mainwindow.h和cpp的全部代码,请copy

h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtCharts>         // 导入QtCharts所有的头文件
QT_CHARTS_USE_NAMESPACE
#include <QMainWindow>
#include<QWidget>
#include"satellite.h"
#include"city.h"
#include"timeslot.h"
#include"square.h"
#include"QVector"
#include<vector>
#include<stack>
using namespace std;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

   void paintEvent(QPaintEvent *event);
private slots:
    void on_pushButton_clicked();

    void on_theOne_clicked();

    void on_theTwo_clicked();

    void on_theThree_clicked();

    void on_theFour_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

private:
    Ui::MainWindow *ui;

public:
    //经度75 - 135,设置24个格子,每格长度为2.5
    //对于纬度0-55,设置22个个子,每个长度2.5
    Square map1[22][24];
    //stack<Square> waitDraw;
    Square* waitDraw;
    int waitSize;
    int setDraw = 0;
    double *Coverage;
    CityList theCityList;//城市列表
    Satellite satellite[9];//卫星列表
    double radius = 7.0068;//每个卫星的半径都是这个。
    void sInit();//卫星的信息初始化函数
    void ReadFile(int number);//和sInit配套使用
    Square* us;
    Square* waitDraw2;
    int waitSize2;
    void readUs();
};

#endif // MAINWINDOW_H

cpp

#include <QtCharts>         // 导入QtCharts所有的头文件
QT_CHARTS_USE_NAMESPACE
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<fstream>
#include<QMessageBox>
#include<QPainter>
#include<QRect>
#include<QColor>
#include<QString>
#include"square.h"
#include<QBrush>
using namespace std;
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    us = new Square[1540];
    readUs();
    for(int i = 0; i < 22; i++)
    {
        for(int j = 0; j < 24; j++)
        {
            //y对应纬度,x对应经度
            map1[i][j].y = 180 + 24 * i;
            map1[i][j].x = 24 + 24 * j;
            map1[i][j].latitude = 2.5*i;
            map1[i][j].longitude = 75 + 2.5*j;
            map1[i][j].state = 0;
            map1[i][j].length = 24;
            map1[i][j].realSize = 2.5;//每个方格的边都为2.5个经纬
        }
    }
    waitDraw = new Square[200];
    waitDraw2 = new Square[1000];
    waitSize2 = 0;
    waitSize = 0;
    ui->stackedWidget->setCurrentWidget(ui->page);//切换到页面1
    //point = new Point[3369];
    sInit();//调用初始化函数
}

MainWindow::~MainWindow()
{
    delete ui;
}
//读取卫星信息
void MainWindow::ReadFile(int number)
{
    ifstream ifs;
    switch (number)
    {
    case 0:
    {
        ifs.open("D:/vc/z/myEarth/Position_0.txt");
        break;
    }
    case 1:
    {
        ifs.open("D:/vc/z/myEarth/Position_1.txt");
        break;
    }
    case 2:
    {
        ifs.open("D:/vc/z/myEarth/Position_2.txt");
        break;
    }
    case 3:
    {
        ifs.open("D:/vc/z/myEarth/Position_3.txt");
        break;
    }
    case 4:
    {
        ifs.open("D:/vc/z/myEarth/Position_4.txt");
        break;
    }
    case 5:
    {
        ifs.open("D:/vc/z/myEarth/Position_5.txt");
        break;
    }
    case 6:
    {
        ifs.open("D:/vc/z/myEarth/Position_6.txt");
        break;

    }
    case 7:
    {
        ifs.open("D:/vc/z/myEarth/Position_7.txt");
        break;
    }
    case 8:
    {
        ifs.open("D:/vc/z/myEarth/Position_8.txt");
        break;
    }
    default:
    {
        return;
    }
    }
    //将每一秒的信息读入
    for(int i = 0; i < 86400; i++)
    {
        ifs>>satellite[number].x[i]>>satellite[number].y[i];//读入第number个卫星的第i时刻的位置信息
    }
    ifs.close();
}
//求平方
double culSquare(double a)
{
    return a*a;
}

void MainWindow::sInit()
{
    //其实半径甚至就是一样
    /*
    satellite[0].radius = 7.00681;
    satellite[1].radius = 7.00679;
    satellite[2].radius = 7.00681;
    satellite[3].radius = 7.0068;
    satellite[4].radius = 7.0068;
    satellite[5].radius = 7.00682;
    satellite[6].radius = 7.00679;
    satellite[7].radius = 7.0068;
    satellite[8].radius = 7.00682;
    */
    //一个循环  每个卫星每秒钟对应的x ,y读进来
    for(int i = 0; i < 9; i++)
    {
       ReadFile(i);
    }
    int start = 0;
    //将各城市的时间窗口计算出来,外循环遍历城市
    for(int i = 0; i < 19; i++)
    {
        bool flag = false;//记录城市是否被卫星星座覆盖
        //中间循环遍历时间
       for(int j = 0; j < 86400; j++)
       {
           //内层循环遍历卫星,时间复杂度较高。
           int number =0;//当前时间段未提供服务的卫星个数
           for(int k = 0; k < 9; k++)
           {
               //判断城市是否在该卫星的搜索范围内,看方程(x-x0)*(x-x0) + (y-y0)*(y-y0)是否小于等于radius
               //第i个城市的x-该卫星的x,即经度longitude,y即纬度latitude
               //第k个卫星在第j秒的数值
               if((culSquare(theCityList.city[i].longitude - satellite[k].x[j]) + culSquare(theCityList.city[i].latitude - satellite[k].y[j])) <= culSquare(radius))
               {
                   //如果该时间段处在星座范围内,且flag标记false,说明此时刻开始进入星座的范围
                   if(!flag)
                   {
                       start = j;//j就是当前时间
                       flag = true;//标记被覆盖
                   }
                   break;//退出当前卫星循环,因为只要有一个卫星提供就算星座在提供
               }
               //执行到这一步,说明此卫星没有提供服务,Number++
               number++;
               //若9个
              if(flag && number == 9)
              {
                  //此时不再星座内,但是flag却为true,说明有了一个时间窗口出现
                  //传入start,和结束时间j - 1
                  TimeSlot t(start, j - 1);
                  //把tpush给该城市的时间窗口VEctor
                  theCityList.city[i].slot.push_back(t);
                  //然后把flag置为false
                  flag = false;
              }

           }
       }
    }

    /*
    ifstream ifs1;
    ifs1.open("D:/vc/z/myEarth/us.txt");
    for(int i = 0; i < 3369; i++)
    {
        ifs1>>point[i].longitude>>point[i].latitude;
    }
    ifs1.close();
    */
}

void MainWindow::readUs()
{
    ifstream ifs1;
    ifs1.open("D:/vc/z/myEarth/fangGe.txt");
    for(int i = 0; i < 288; i++)
    {
        ifs1 >> us[i].longitude >> us[i].latitude >> us[i].realSize;
    }
    ifs1.close();
     ifs1.open("D:/vc/z/myEarth/fangGe2.txt");
     for(int i = 288; i < 1540; i++)
     {
         ifs1 >> us[i].longitude >> us[i].latitude >> us[i].realSize;
     }
     ifs1.close();

     for(int i = 0; i < 1540; i++)
     {
         us[i].x = (double)20*us[i].longitude - 4500;
         us[i].y = (double)(-20)*us[i].latitude + 1200 ;
         us[i].length = (double)20*us[i].realSize;
     }
}

void MainWindow::on_theOne_clicked()
{
    setDraw = 0;
    ui->stackedWidget->setCurrentWidget(ui->page);//切换到页面1
}

void MainWindow::on_theTwo_clicked()
{
    setDraw = 0;
    ui->stackedWidget->setCurrentWidget(ui->page_2);//切换到页面2
}

void MainWindow::on_theThree_clicked()
{
    //切换页面
    setDraw = 1;
    ui->stackedWidget->setCurrentWidget(ui->page_3);
}

void MainWindow::on_theFour_clicked()
{
    setDraw = 2;
    ui->stackedWidget->setCurrentWidget(ui->page_4);
}

//输入城市名字,查看该城市的时间窗口信息
void MainWindow::on_pushButton_clicked()
{
     QString QStr=ui->lineEdit->text();//获取字符串

     int locate = theCityList.location(QStr);//获取城市坐标

    //ui->textBrowser->append(a);
    //将各城市的信息输出就行了
    //外循环遍历城市
     /*
    for(int i = 0; i < 19; i++)
    {
        //内循环遍历城市的时间窗口
        unsigned size = theCityList.city[i].slot.size();
        ui->textBrowser->append("城市" + theCityList.city[i].name + "的时间窗口如下:");
        for(unsigned j = 0; j < size; j++)
        {
            int h = theCityList.city[i].slot[j].startTime / 3600;//时
            int m = (theCityList.city[i].slot[j].startTime % 3600) / 60;//分
            int s = (theCityList.city[i].slot[j].startTime % 3600) % 60;//秒
            QString a("时间窗口" + QString::number(j) + "    [" + QString::number(h) + ":" + QString::number(m) + ":" +QString::number(s) + "]");
            ui->textBrowser->append(a);
        }

    }
    */
     if(locate != -1)
     {
         ui->textBrowser->clear();
         unsigned size = theCityList.city[locate].slot.size();
         if(size == 0)
         {
             QString qs = "该城市没有被卫星星座服务过";
             ui->textBrowser->append(qs);
             return;
         }
         //要算最大值和最小值,其实有个思路是自己写一个 机制类似优先队列的动态数组MyVector,每次push_back都会进行维护,自动排序,维护时间参考二叉堆。
         int maxTimeLength = 0;//记录最大长度
         int maxLocate = 0;
         int minTimeLength = 86400;//记录最小长度
         int minLocate = 0;
         int accumulate =0;//累计
         ui->textBrowser->append("城市" + theCityList.city[locate].name + "的时间窗口如下:");
         for(unsigned j = 0; j < size; j++)
         {
             accumulate += theCityList.city[locate].slot[j].length;//累计值啊
             //最新最大
             if(theCityList.city[locate].slot[j].length > maxTimeLength)
             {
                 maxTimeLength = theCityList.city[locate].slot[j].length;
                 maxLocate = j;//更新位置
             }
             if(theCityList.city[locate].slot[j].length < minTimeLength)
             {
                 minTimeLength = theCityList.city[locate].slot[j].length;
                 minLocate = j;//更新位置
             }
             int h0 = theCityList.city[locate].slot[j].startTime / 3600;//时
             int m0 = (theCityList.city[locate].slot[j].startTime % 3600) / 60;//分
             int s0 = (theCityList.city[locate].slot[j].startTime % 3600) % 60;//秒
             int h1 = theCityList.city[locate].slot[j].overTime / 3600;//时
             int m1 = (theCityList.city[locate].slot[j].overTime % 3600) / 60;//分
             int s1 = (theCityList.city[locate].slot[j].overTime % 3600) % 60;//秒
             QString a("时间窗口" + QString::number(j) + "    [" + QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
             ui->textBrowser->append(a);
         }
         //到这里了,把最大最小和累计进行输出。
         int h0 = theCityList.city[locate].slot[maxLocate].startTime / 3600;//时
         int m0 = (theCityList.city[locate].slot[maxLocate].startTime % 3600) / 60;//分
         int s0 = (theCityList.city[locate].slot[maxLocate].startTime % 3600) % 60;//秒
         int h1 = theCityList.city[locate].slot[maxLocate].overTime / 3600;//时
         int m1 = (theCityList.city[locate].slot[maxLocate].overTime % 3600) / 60;//分
         int s1 = (theCityList.city[locate].slot[maxLocate].overTime % 3600) % 60;//秒
         QString qstr("时间窗口最大值为:"+ QString::number(maxTimeLength) + "   对应时间窗口:  [" + QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
         h0 = theCityList.city[locate].slot[minLocate].startTime / 3600;//时
         m0 = (theCityList.city[locate].slot[minLocate].startTime % 3600) / 60;//分
         s0 = (theCityList.city[locate].slot[minLocate].startTime % 3600) % 60;//秒
         h1 = theCityList.city[locate].slot[minLocate].overTime / 3600;//时
         m1 = (theCityList.city[locate].slot[minLocate].overTime % 3600) / 60;//分
         s1 = (theCityList.city[locate].slot[minLocate].overTime % 3600) % 60;//秒
         QString qstr2("时间窗口最小值为:"+ QString::number(minTimeLength) + "   对应时间窗口:  [" + QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
         ui->textBrowser->append(qstr);
         ui->textBrowser->append(qstr2);
         //输出累计值
         ui->textBrowser->append("时间窗口累计值:"+QString::number(accumulate));


         //接下来求解时间间隙,我个人理解是相邻两个时间窗口之间产生一个时间间隙,不知道对不对,自己看吧
         int maxGap = 0;
         int maxGapLocate[2] = {0, 0};//二维数组
         accumulate = 0;//用于计算累积的
         //终究就是一个遍历数组的问题,把数组遍历一遍即可
         int temp = theCityList.city[locate].slot[0].overTime + 1;
         for(unsigned i = 1; i < size; i++)
         {
             int tmp = theCityList.city[locate].slot[i].startTime - temp;//间隙长度
             int timeGapOver = theCityList.city[locate].slot[i].startTime - 1;
             h0 = temp / 3600;//时
             m0 = (temp % 3600) / 60;//分
             s0 = (temp % 3600) % 60;//秒
             h1 = timeGapOver / 3600;//时
             m1 = (timeGapOver % 3600) / 60;//分
             s1 = (timeGapOver % 3600) % 60;//秒
             QString strTmp("时间间隙: ["+ QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
             ui->textBrowser->append(strTmp);
             accumulate += tmp;
             if(maxGap < tmp)
             {
                 maxGap = tmp;
                 maxGapLocate[0] = theCityList.city[locate].slot[i].startTime - 1;
                 maxGapLocate[1] = temp;
             }
             //然后temp跳转到下一个点
             temp = theCityList.city[locate].slot[i].overTime + 1;//记得+1
         }
         qstr = "最长时间间隙为:" + QString::number(maxGap);
         h0 = maxGapLocate[1] / 3600;//时
         m0 = (maxGapLocate[1] % 3600) / 60;//分
         s0 = (maxGapLocate[1] % 3600) % 60;//秒
         h1 = maxGapLocate[0] / 3600;//时
         m1 = (maxGapLocate[0] % 3600) / 60;//分
         s1 = (maxGapLocate[0] % 3600) % 60;//秒
         QString qq("最长时间间隙对应时间段为:  ["+ QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
         qstr2 = "累计时间间隙为:" + QString::number(accumulate);
         ui->textBrowser->append(qstr);
         ui->textBrowser->append(qq);
         ui->textBrowser->append(qstr2);
     }

    /*
    QString a,b;
    for(int i = 0; i < 86400; i++)
    {
        a = QString::number(satellite[3].x[i]);
        b = QString::number(satellite[3].y[i]);

        ui->textBrowser->append(a + "     " + b);
    }
*/

}

void MainWindow::on_pushButton_2_clicked()
{
    if(ui->lineEdit_2->text().isEmpty() || ui->lineEdit_3->text().isEmpty())
    {
        QMessageBox::information(nullptr, "提示", "不可输入空串", QMessageBox::Yes);
        return;
    }
    QString log = ui->lineEdit_2->text();
    QString lat = ui->lineEdit_3->text();
    double longitude = log.toDouble();
    double latitude = lat.toDouble();

    if(longitude < 75||longitude > 135 ||latitude < 0 || latitude > 55)
    {
        QMessageBox::information(nullptr, "提示", "非法输入,注意输入的经纬度是否有错误", QMessageBox::Yes);
        return;
    }
    ui->textBrowser_2->clear();

    City c;
    c.longitude = longitude;
    c.latitude = latitude;

    int start = 0;
    //将各城市的时间窗口计算出来,外循环遍历城市
    bool flag = false;//记录城市是否被卫星星座覆盖
     //遍历时间
    for(int j = 0; j < 86400; j++)
    {
        //遍历卫星
        int number =0;//当前时间段未提供服务的卫星个数
        for(int k = 0; k < 9; k++)
        {
            //判断城市是否在该卫星的搜索范围内,看方程(x-x0)*(x-x0) + (y-y0)*(y-y0)是否小于等于radius
            //第i个城市的x-该卫星的x,即经度longitude,y即纬度latitude
            //第k个卫星在第j秒的数值
            if((culSquare(c.longitude - satellite[k].x[j]) + culSquare(c.latitude - satellite[k].y[j])) <= culSquare(radius))
            {
                //如果该时间段处在星座范围内,且flag标记false,说明此时刻开始进入星座的范围
                if(!flag)
                {
                    start = j;//j就是当前时间
                    flag = true;//标记被覆盖
                }
                break;//退出当前卫星循环,因为只要有一个卫星提供就算星座在提供
            }
            //执行到这一步,说明此卫星没有提供服务,Number++
            number++;
            //若9个
           if(flag && number == 9)
           {
               //此时不再星座内,但是flag却为true,说明有了一个时间窗口出现
               //传入start,和结束时间j - 1
               TimeSlot t(start, j - 1);
               //把tpush给该城市的时间窗口VEctor
               c.slot.push_back(t);
               //然后把flag置为false
               flag = false;
           }
        }
    }

    unsigned size = c.slot.size();
    if(size == 0)
    {
        QString qs = "该城市没有被卫星星座服务过";
        ui->textBrowser_2->append(qs);
        return;
    }


    //第一题第二问求的是时间间隙,由于我懒的再写一个TimeGap了,直接沿用TimeSlot,然后进行计算
    //题目要求在75 - 135 ,0 - 55 内,但是这个点最小离散到0.1精度就有600 * 550个点
    //要求出这么多个点的信息,我不知道有什么合适的方法,目前采用的是查询某一点的方式
    int h0;
    int m0;//分
    int s0;//秒
    int h1;//时
    int m1;//分
    int s1;//秒
    double *isTime = new double[86400];
    int maxGap = 0;
    int maxGapLocate[2] = {0, 0};//二维数组
    int gapSquare = 0;//平方和
    int accumulate = 0;//用于计算累积的
    //终究就是一个遍历数组的问题,把数组遍历一遍即可
    int temp = c.slot[0].overTime + 1;
    for(unsigned i = 1; i < size; i++)
    {
        int tmp = c.slot[i].startTime - temp;//间隙长度
        int timeGapOver = c.slot[i].startTime - 1;
        h0 = temp / 3600;//时
        m0 = (temp % 3600) / 60;//分
        s0 = (temp % 3600) % 60;//秒
        h1 = timeGapOver / 3600;//时
        m1 = (timeGapOver % 3600) / 60;//分
        s1 = (timeGapOver % 3600) % 60;//秒
        QString strTmp("时间间隙: ["+ QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
        ui->textBrowser_2->append(strTmp);
        for(int k = temp; k < c.slot[i].startTime; k++)
        {
            isTime[k] = 1;
        }
        accumulate += tmp;
        gapSquare += tmp * tmp;
        if(maxGap < tmp)
        {
            maxGap = tmp;
            maxGapLocate[0] = c.slot[i].startTime - 1;
            maxGapLocate[1] = temp;
        }
        //然后temp跳转到下一个点
        temp = c.slot[i].overTime + 1;//记得+1
    }
    QString qstr = "最长时间间隙为:" + QString::number(maxGap);
    h0 = maxGapLocate[1] / 3600;//时
    m0 = (maxGapLocate[1] % 3600) / 60;//分
    s0 = (maxGapLocate[1] % 3600) % 60;//秒
    h1 = maxGapLocate[0] / 3600;//时
    m1 = (maxGapLocate[0] % 3600) / 60;//分
    s1 = (maxGapLocate[0] % 3600) % 60;//秒
    QString qq("对应时间段为:  ["+ QString::number(h0) + ":" + QString::number(m0) + ":" +QString::number(s0) + ", " + QString::number(h1) + ":" + QString::number(m1) + ":" +QString::number(s1) + "]");
    QString qstr2 = "累计时间间隙为:" + QString::number(accumulate);
    ui->textBrowser_2->append(qstr);
    ui->textBrowser_2->append(qq);
    ui->textBrowser_2->append(qstr2);
    qstr2 = "时间间隙平方和为:" + QString::number(gapSquare);
    ui->textBrowser_2->append(qstr2);
    double *isTime1 = new double[86400];
    QSplineSeries* series = new QSplineSeries();   // 创建一个样条曲线对象
    series->setName("时间窗口");
    for(unsigned k = 0; k < size; k++)
    {
        for(int i = c.slot[k].startTime; i <= c.slot[k].overTime; i++)
        {
            isTime1[i] = 1;
        }
    }
    for(int i = 0; i < 86400; i++)
    {
        series->append(i, isTime1[i]);
    }
    QChart* chart = ui->graphicsView_2->chart();    // 获取一个chart用于管理不同类型的series和其他图表相关对象
    chart->legend()->hide();                   // 隐藏图例
    chart->addSeries(series);                  // 添加创建好的曲线图对象
    chart->setTitle("时间窗口可视化");           // 设置标题
    chart->createDefaultAxes();                // 基于已添加到图表中的series为图表创建轴。以前添加到图表中的任何轴都将被删除。
    chart->axes(Qt::Vertical).first()->setRange(0, 1.2);  // 设置Y轴的范围
    //ui->graphicsView_2->setRenderHint(QPainter::Antialiasing);  // 设置抗锯齿
    QSplineSeries* series2 = new QSplineSeries();   // 创建一个样条曲线对象
    series2->setName("时间间隙");
    for(int i = 0; i < 86400; i++)
    {
        series2->append(i, isTime[i]);
    }
    QChart* chart2 = ui->graphicsView_3->chart();    // 获取一个chart用于管理不同类型的series和其他图表相关对象
    chart2->legend()->hide();                   // 隐藏图例
    chart2->addSeries(series2);                  // 添加创建好的曲线图对象
    chart2->setTitle("时间间隙可视化");           // 设置标题
    chart2->createDefaultAxes();                // 基于已添加到图表中的series为图表创建轴。以前添加到图表中的任何轴都将被删除。
    chart2->axes(Qt::Vertical).first()->setRange(0, 1.2);  // 设置Y轴的范围
}
double PI = 3.141592654;
//积分公式,x0 - x1为经度,,y0 - y1是纬度
double integral(double x0, double y0, double x1, double y1)
{
    double S = (cos(y0*PI/180) - cos(y1 * PI / 180)) * ((x1 * PI / 180) - (x0 * PI / 180));
    return S;
}

//75° - 135°区域的覆盖率问题
void MainWindow::on_pushButton_3_clicked()
{
    //格式00:00:00,有bug,目前不采用了
    //QString a = ui->lineEdit_4->text();
    //QString b = ui->lineEdit_5->text();
    //int start = a.mid(0, 2).toInt()*3600 + a.mid(3, 2).toInt()*60 + a.mid(6, 2).toInt();
    //int over = b.mid(0, 2).toInt()*3600 + b.mid(3, 2).toInt()*60 + b.mid(6, 2).toInt();
    int start = ui->lineEdit_4->text().toInt();
    int over = ui->lineEdit_5->text().toInt();
    int timeLength = over  - start + 1;
    if(start>over||start<0||start>86400||over<0||over>86400)
    {
        QMessageBox::information(nullptr, "提示", "输入的时间有误!", QMessageBox::Yes);
        return;
    }
       Coverage = new double[timeLength];//动态空间
    //计算方格内个点是否在里面
    stack<Square> st;
    //遍历,查找有哪些点直接被覆盖和不被覆盖,对于未确定的点,传入stack中
    //外层循环,遍历时间
/*
    for(int i = start;i <= over; i++)
    {
        simulation(i);
        repaint();
    }
    */
    //st用于保存那些待分割的点
    double cul;
    double leftTop1,leftTop2;
    double leftBotton1, leftBotton2;
    double rightTop1, rightTop2;
    double rightBotton1, rightBotton2;
    double temp1;
    double temp2;
    double temp3;
    double temp4;
    double tmp = culSquare(radius);
    double length_2;
    double real_2;
    double acuCover = 0;
    for(int i = start; i <= over; i++)
    {
        cul = 0;

        for(int j = 0; j < 22; j++)
        {
            for(int k = 0; k < 24; k++)
            {
                //遍历卫星
                int number = 0;
                for(int t = 0; t < 9; t++)
                {
                    //保存每个格子的4个点,
                    leftTop1 = map1[j][k].longitude;                leftTop2 = map1[j][k].latitude;
                    leftBotton1 = leftTop1;                         leftBotton2 = leftTop2 + 2.5;
                    rightTop1 = leftTop1 + 2.5;       rightTop2 = leftTop2;
                    rightBotton1 = rightTop1;                       rightBotton2 = leftBotton2;
                    temp1 = culSquare(leftTop1 - satellite[t].x[i]) + culSquare(leftTop2 - satellite[t].y[i]);
                    temp2 = culSquare(leftBotton1 - satellite[t].x[i]) + culSquare(leftBotton2 - satellite[t].y[i]);
                    temp3 = culSquare(rightTop1 - satellite[t].x[i]) + culSquare(rightTop2 - satellite[t].y[i]);
                    temp4 = culSquare(rightBotton1 - satellite[t].x[i]) + culSquare(rightBotton2 - satellite[t].y[i]);
                    //如果全部小于等于,说明应该填充
                    if(temp1 <= tmp&&temp2 <= tmp&&temp3 <= tmp&&temp4 <= tmp)
                    {
                        map1[j][k].state = 1;//beifugai
                        //计算该面的面积
                        cul += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);
                        if(map1[j][k].isCover == false)
                        {
                            map1[j][k].isCover = true;
                            acuCover += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);
                            //ui->textBrowser_3->append(QString::number(j) + "  " + QString::number(k)); 测试使用
                       }
                        break;
                    }
                    //全都在外边,不处理
                    if(temp1 > tmp&&temp2 > tmp&&temp3 > tmp&&temp4 > tmp)
                    {
                        number++;//不在卫星里的数量+1
                    }
                    //如果已经遍历到最后一个卫星,还没有退出,而且number没有加到 9 ,说明是待判断。
                    if(number < 9&&t == 8)
                    {
                        length_2 = map1[j][k].length/(double)2;
                        real_2 = map1[j][k].realSize/(double)2;
                        //待定的点,进行分割,一割为4
                        //构造函数:Square(double _x, double _y, double log, double lat, double realSize, double _length, int _state);
                        Square s1(map1[j][k].x, map1[j][k].y, map1[j][k].longitude, map1[j][k].latitude, real_2, length_2, 0);
                        Square s2(map1[j][k].x + length_2, map1[j][k].y, map1[j][k].longitude + real_2, map1[j][k].latitude, real_2, length_2, 0);
                        Square s3(map1[j][k].x, map1[j][k].y + length_2, map1[j][k].longitude, map1[j][k].latitude + real_2, real_2, length_2, 0);
                        Square s4(map1[j][k].x + length_2, map1[j][k].y + length_2, map1[j][k].longitude + real_2, map1[j][k].latitude + real_2, real_2, length_2, 0);
                        st.push(s1);st.push(s2);st.push(s3);st.push(s4);
                    }
                }
            }
        }
        while(!st.empty())
        {
            Square squa = st.top();//取栈顶
            st.pop();//弹出栈顶
            length_2 = squa.length/(double)2;
            real_2 = squa.realSize/(double)2;
            //分割
            leftTop1 = squa.longitude;                leftTop2 = squa.latitude;
            leftBotton1 = leftTop1;                         leftBotton2 = leftTop2 + squa.realSize;
            rightTop1 = leftTop1 + squa.realSize;       rightTop2 = leftTop2;
            rightBotton1 = rightTop1;                       rightBotton2 = leftBotton2;
            int num = 0;
            for(int t = 0; t < 9; t++)
            {
                temp1 = culSquare(leftTop1 - satellite[t].x[i]) + culSquare(leftTop2 - satellite[t].y[i]);
                temp2 = culSquare(leftBotton1 - satellite[t].x[i]) + culSquare(leftBotton2 - satellite[t].y[i]);
                temp3 = culSquare(rightTop1 - satellite[t].x[i]) + culSquare(rightTop2 - satellite[t].y[i]);
                temp4 = culSquare(rightBotton1 - satellite[t].x[i]) + culSquare(rightBotton2 - satellite[t].y[i]);
                if(temp1 <= tmp&&temp2 <= tmp&&temp3 <= tmp&&temp4 <= tmp)
                {
                    squa.state = 1;
                    cul += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);
                    waitDraw[waitSize++] = squa;
                    break;
                }
                //全都在外边,不处理
                if(temp1 > tmp&&temp2 > tmp&&temp3 > tmp&&temp4 > tmp)
                {
                    num++;//不被覆盖数量+1
                }
                //如果已经到最后一个卫星,而且num还不到9,说明要待判断
                if(num < 9&&t == 8)
                {
                    //限制分割,这种情况还能分
                    if(squa.realSize > 0.625)
                    {
                        Square s1(squa.x, squa.y, squa.longitude, squa.latitude, real_2, length_2, 0);
                        Square s2(squa.x + length_2, squa.y, squa.longitude + real_2, squa.latitude, real_2, length_2, 0);
                        Square s3(squa.x, squa.y + length_2, squa.longitude, squa.latitude + real_2, real_2, length_2, 0);
                        Square s4(squa.x + length_2, squa.y + length_2, squa.longitude + real_2, squa.latitude + real_2, real_2, length_2, 0);
                        st.push(s1);st.push(s2);st.push(s3);st.push(s4);
                    }
                    else//这种情况就是不可再分了,这个点就是待判断,标蓝即可,没什么好说的
                    {
                        squa.state = 2;
                        //waitDraw.push_back(squa);//加入
                        waitDraw[waitSize++] = squa;
                    }
                }
            }
        }
        ui->textBrowser_3->append(QString::number(cul/0.44655));
        ui->textBrowser_4->clear();
        ui->textBrowser_4->append(QString::number(acuCover/0.44655));
        Coverage[i - start] = cul/0.44655;//记录
        repaint();//每秒重新绘制,
        delete []waitDraw;
        waitDraw = new Square[200];
        waitSize = 0;
        //初始化,全部点都不在里面
        for(int i = 0; i < 22; i++)
        {
            for(int j = 0; j < 24; j++)
            {
                map1[i][j].state = 0;
            }
        }
    }
     acuCover = acuCover / 0.44655;
     QSplineSeries* series = new QSplineSeries();   // 创建一个样条曲线对象
     series->setName("曲线");
     for(int i = start;i <= over; i++)
     {
        series->append(i, Coverage[i - start]);
     }
        QChart* chart = ui->graphicsView->chart();    // 获取一个chart用于管理不同类型的series和其他图表相关对象
        chart->legend()->hide();                   // 隐藏图例
        chart->addSeries(series);                  // 添加创建好的曲线图对象
        chart->setTitle("覆盖率曲线");           // 设置标题
        chart->createDefaultAxes();                // 基于已添加到图表中的series为图表创建轴。以前添加到图表中的任何轴都将被删除。
        chart->axes(Qt::Vertical).first()->setRange(0, 0.15);  // 设置Y轴的范围
        ui->graphicsView->setRenderHint(QPainter::Antialiasing);  // 设置抗锯齿
     //ui->textBrowser_4->append("累计覆盖率为:" + QString::number(acuCover));
     QMessageBox::information(nullptr, "提示", "已经模拟完", QMessageBox::Yes);
     delete []Coverage;
     Coverage = nullptr;
}

//QFont font;    //颜色
//QColor color(255, 255, 255);  //字体
//QPen pen;      //画笔
//绘图事件
void MainWindow::paintEvent(QPaintEvent *event)
{
    QPainter painter;
    QBrush qb;
    qb.setColor(QColor(255, 0, 0));
    painter.begin(this);//设置窗口画布
    //第3题画图,75 - 135,,0 - 55
    if(setDraw == 1)
    {
        for(int i = 0; i < 22; i++)
        {
            for(int j = 0; j < 24; j++)
            {
                if(map1[i][j].state == 1)
                {
                    //painter.drawRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length);
                    painter.fillRect(QRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length), QBrush(Qt::red));
                }
               // else if(map1[i][j].state == 2)
                //{
                   // painter.fillRect(QRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length), QBrush(Qt::blue));
               // }
            }
        }
        for(int i = 0; i < waitSize; i++)
        {
            if(waitDraw[i].state == 1)
            {
                painter.fillRect(QRect(waitDraw[i].x, waitDraw[i].y, waitDraw[i].length, waitDraw[i].length), QBrush(Qt::red));
            }
            else if(waitDraw[i].state == 2)
            {
                painter.fillRect(QRect(waitDraw[i].x, waitDraw[i].y, waitDraw[i].length, waitDraw[i].length), QBrush(Qt::blue));
            }
        }
        for(int i = 0; i < 22; i++)
        {
            for(int j = 0; j < 24; j++)
            {
                painter.drawRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length);
            }
            if(i % 4 == 0)
            {
                double temp = 75 +2.5*i;//经
                QString qs = QString::number(temp);
                painter.drawText(i*24 + 24, 170, qs + "°");
                temp = 2.5 * i;// 纬度
                qs =QString::number(temp);
                painter.drawText(610, 180 + i * 24, qs + "°");
            }
            else if(i == 21)
            {
                QString qs = QString::number(135);
                painter.drawText(588, 170, qs + "°");
                qs = QString::number(55);
                painter.drawText(610, 710, qs + "°");
            }
        }

    }
    else if(setDraw == 2)
    {
        //painter.drawRect(100,100,500,500);
        for(int i = 0; i < 1540; i++)
        {
            if(us[i].state == 1)
            {
                painter.fillRect(QRect(us[i].x, us[i].y, us[i].length, -(us[i].length)), QBrush(Qt::red));
            }
            else if(us[i].state == 2)
            {
                painter.fillRect(QRect(us[i].x, us[i].y, us[i].length, -(us[i].length)), QBrush(Qt::blue));
            }
        }
        for(int i = 0; i < waitSize2; i++)
        {
            if(waitDraw2[i].state == 1)
            {
                painter.fillRect(QRect(waitDraw2[i].x, waitDraw2[i].y, waitDraw2[i].length, -(waitDraw2[i].length)), QBrush(Qt::red));
            }
        }
        for(int i = 0; i < waitSize2; i++)
        {
            if(waitDraw2[i].state == 2)
            {
                painter.fillRect(QRect(waitDraw2[i].x, waitDraw2[i].y, waitDraw2[i].length, -(waitDraw2[i].length)), QBrush(Qt::blue));
            }
        }
        for(int i = 0; i < 1540; i++)
        {
            painter.drawRect(us[i].x, us[i].y, us[i].length, -(us[i].length));
        }

    }




    /*
    for(int i = 0; i < 22; i++)
    {
        for(int j = 0; j < 24; j++)
        {
            if(map1[i][j].state == 1)
            {
                //painter.drawRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length);
                painter.fillRect(QRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length), QBrush(Qt::red));
            }
           // else if(map1[i][j].state == 2)
            //{
               // painter.fillRect(QRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length), QBrush(Qt::blue));
           // }
        }
    }
    for(int i = 0; i < waitSize; i++)
    {
        if(waitDraw[i].state == 1)
        {
            painter.fillRect(QRect(waitDraw[i].x, waitDraw[i].y, waitDraw[i].length, waitDraw[i].length), QBrush(Qt::red));
        }
        else if(waitDraw[i].state == 2)
        {
            painter.fillRect(QRect(waitDraw[i].x, waitDraw[i].y, waitDraw[i].length, waitDraw[i].length), QBrush(Qt::blue));
        }
    }
    for(int i = 0; i < 22; i++)
    {
        for(int j = 0; j < 24; j++)
        {
            painter.drawRect(map1[i][j].x, map1[i][j].y, map1[i][j].length, map1[i][j].length);
        }
        if(i % 4 == 0)
        {
            double temp = 75 +2.5*i;//经
            QString qs = QString::number(temp);
            painter.drawText(i*24 + 24, 170, qs + "°");
            temp = 2.5 * i;// 纬度
            qs =QString::number(temp);
            painter.drawText(610, 180 + i * 24, qs + "°");
        }
        else if(i == 21)
        {
            QString qs = QString::number(135);
            painter.drawText(588, 170, qs + "°");
            qs = QString::number(55);
            painter.drawText(610, 710, qs + "°");
        }
    }
    */

    painter.end();

}





//美国多边形区域覆盖率问题
void MainWindow::on_pushButton_4_clicked()
{
    //for(int i = 0; i < 3369; i++)
   // {
      //  ui->textBrowser_5->append(QString::number(point[i].longitude) + "    " + QString::number(point[i].latitude));
    //}

    //格式00:00:00,有bug,目前不采用了
    //QString a = ui->lineEdit_4->text();
    //QString b = ui->lineEdit_5->text();
    //int start = a.mid(0, 2).toInt()*3600 + a.mid(3, 2).toInt()*60 + a.mid(6, 2).toInt();
    //int over = b.mid(0, 2).toInt()*3600 + b.mid(3, 2).toInt()*60 + b.mid(6, 2).toInt();
    int start = ui->lineEdit_6->text().toInt();
    int over = ui->lineEdit_7->text().toInt();
    int timeLength = over  - start + 1;
    if(start>over||start<0||start>86400||over<0||over>86400)
    {
        QMessageBox::information(nullptr, "提示", "输入的时间有误!", QMessageBox::Yes);
        return;
    }
       Coverage = new double[timeLength];//动态空间
    //计算方格内个点是否在里面
    stack<Square> st1;
    //遍历,查找有哪些点直接被覆盖和不被覆盖,对于未确定的点,传入stack中
    //外层循环,遍历时间
/*
    for(int i = start;i <= over; i++)
    {
        simulation(i);
        repaint();
    }
    */
    //st用于保存那些待分割的点
    double cul;//用于计算每秒的覆盖率
    double leftTop1,leftTop2;//左上点
    double leftBotton1, leftBotton2;//左下点
    double rightTop1, rightTop2;//右上点
    double rightBotton1, rightBotton2;//右下点
    double temp1;//(左上点的x - 卫星x)² + (左上点的y - 卫星y)²
    double temp2;
    double temp3;
    double temp4;
    double tmp = culSquare(radius);//对应temp,先保存着radius的平方,避免重复计算了,降低性能
    double length_2;//若出现方格分割,length_2 = 被分割方格.length/2
    double real_2;//若出现方格分割,length_2 = 被分割方格.length/2
    double acuCover = 0;//accumulateCover,直接翻译,累计覆盖率,
    for(int i = start; i <= over; i++)
    {
        cul = 0;
        for(int j = 0; j < 1540; j++)
        {
                   //遍历卫星
            int number = 0;
            for(int t = 0; t < 9; t++)
            {
                //保存每个格子的4个点,
                leftTop1 = us[j].longitude;                leftTop2 = us[j].latitude;
                leftBotton1 = leftTop1;                         leftBotton2 = leftTop2 + us[j].realSize;
                rightTop1 = leftTop1 + us[j].realSize;       rightTop2 = leftTop2;
                rightBotton1 = rightTop1;                       rightBotton2 = leftBotton2;
                temp1 = culSquare(leftTop1 - satellite[t].x[i]) + culSquare(leftTop2 - satellite[t].y[i]);
                temp2 = culSquare(leftBotton1 - satellite[t].x[i]) + culSquare(leftBotton2 - satellite[t].y[i]);
                temp3 = culSquare(rightTop1 - satellite[t].x[i]) + culSquare(rightTop2 - satellite[t].y[i]);
                temp4 = culSquare(rightBotton1 - satellite[t].x[i]) + culSquare(rightBotton2 - satellite[t].y[i]);
                //如果全部小于等于,说明应该填充
                if(temp1 <= tmp&&temp2 <= tmp&&temp3 <= tmp&&temp4 <= tmp)
                {
                    us[j].state = 1;//beifugai
                    //计算该面的面积
                    cul += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);
                    //若是第一次被覆盖,加入累计覆盖中,并且标记被覆盖过了。
                    if(us[j].isCover == false)
                    {
                        us[j].isCover = true;//标记被覆盖过
                        acuCover += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);//累计覆盖的累加
                        //ui->textBrowser_3->append(QString::number(j) + "  " + QString::number(k)); 测试使用
                   }
                    break;
                }
                //全都在外边,不处理
                if(temp1 > tmp&&temp2 > tmp&&temp3 > tmp&&temp4 > tmp)
                {
                    number++;//不在卫星里的数量+1
                }
                //如果已经遍历到最后一个卫星,还没有退出,而且number没有加到 9 ,说明是待判断。
                if(number < 9&&t == 8)
                {
                    if(us[j].realSize >0.3125)
                    {
                        //ui->textBrowser_5->append("加入栈");

                        length_2 = us[j].length/(double)2;
                        real_2 = us[j].realSize/(double)2;
                        //待定的点,进行分割,一割为4
                        //构造函数:Square(double _x, double _y, double log, double lat, double realSize, double _length, int _state);
                        Square s1(us[j].x, us[j].y, us[j].longitude, us[j].latitude, real_2, length_2, 0);
                        Square s2(us[j].x + length_2, us[j].y, us[j].longitude + real_2, us[j].latitude, real_2, length_2, 0);
                        Square s3(us[j].x, us[j].y - length_2, us[j].longitude, us[j].latitude + real_2, real_2, length_2, 0);
                        Square s4(us[j].x + length_2, us[j].y - length_2, us[j].longitude + real_2, us[j].latitude + real_2, real_2, length_2, 0);
                        st1.push(s1);st1.push(s2);st1.push(s3);st1.push(s4);
                    }
                    else
                    {
                        //如果已经太小了,那就别tm分了,直接标记为2,加入等待绘画队列,化成蓝色
                        us[j].state = 2;
                        ///ui->textBrowser_5->append("被标记为蓝");
                        waitDraw2[waitSize2++] = us[j];
                    }
                }
            }
        }
        //这里和上面一毛一样,我担心你看不懂,注释打到我手麻麻
        while(!st1.empty())
        {
            Square squa = st1.top();//取栈顶
            st1.pop();//弹出栈顶
            length_2 = squa.length/(double)2;
            real_2 = squa.realSize/(double)2;
            //分割
            leftTop1 = squa.longitude;                leftTop2 = squa.latitude;
            leftBotton1 = leftTop1;                         leftBotton2 = leftTop2 + squa.realSize;
            rightTop1 = leftTop1 + squa.realSize;       rightTop2 = leftTop2;
            rightBotton1 = rightTop1;                       rightBotton2 = leftBotton2;
            int num = 0;
            for(int t = 0; t < 9; t++)
            {
                temp1 = culSquare(leftTop1 - satellite[t].x[i]) + culSquare(leftTop2 - satellite[t].y[i]);
                temp2 = culSquare(leftBotton1 - satellite[t].x[i]) + culSquare(leftBotton2 - satellite[t].y[i]);
                temp3 = culSquare(rightTop1 - satellite[t].x[i]) + culSquare(rightTop2 - satellite[t].y[i]);
                temp4 = culSquare(rightBotton1 - satellite[t].x[i]) + culSquare(rightBotton2 - satellite[t].y[i]);
                if(temp1 <= tmp&&temp2 <= tmp&&temp3 <= tmp&&temp4 <= tmp)
                {
                    squa.state = 1;
                    cul += integral(leftTop1, leftTop2, rightBotton1, rightBotton2);
                    waitDraw2[waitSize2++] = squa;
                    break;
                }
                //全都在外边,不处理
                if(temp1 > tmp&&temp2 > tmp&&temp3 > tmp&&temp4 > tmp)
                {
                    num++;//不被覆盖数量+1
                }
                //如果已经到最后一个卫星,而且num还不到9,说明要待判断
                if(num < 9&&t == 8)
                {
                    //限制分割,这种情况还能分
                    if(squa.realSize > 0.3125)
                    {
                        Square s1(squa.x, squa.y, squa.longitude, squa.latitude, real_2, length_2, 0);
                        Square s2(squa.x + length_2, squa.y, squa.longitude + real_2, squa.latitude, real_2, length_2, 0);
                        Square s3(squa.x, squa.y - length_2, squa.longitude, squa.latitude + real_2, real_2, length_2, 0);
                        Square s4(squa.x + length_2, squa.y - length_2, squa.longitude + real_2, squa.latitude + real_2, real_2, length_2, 0);
                        st1.push(s1);st1.push(s2);st1.push(s3);st1.push(s4);
                    }
                    else//这种情况就是不可再分了,这个点就是待判断,标蓝加入等待绘画队列即可,没什么好说的
                    {
                        squa.state = 2;
                        //waitDraw.push_back(squa);//加入
                        waitDraw2[waitSize2++] = squa;
                    }
                }
            }
        }
        //每秒的计算基本结束,接下来就是在进入下一秒之前先更新的一下绘图和输出
        ui->textBrowser_5->append(QString::number(cul/0.15656340035));
        ui->textBrowser_6->clear();
        ui->textBrowser_6->append(QString::number(acuCover/0.15656340035));
        Coverage[i - start] = cul/0.15656340035;//记录
        repaint();//每秒重新绘制,
        delete []waitDraw2;
        waitDraw2 = new Square[1000];
        waitSize2 = 0;
        //初始化,全部点都不在里面
        for(int i = 0; i < 1540; i++)
        {
            us[i].state = 0;
        }
    }
     //结束,需要把累计覆盖率输出,
     acuCover = acuCover / 0.15656340035;
     ui->textBrowser_6->append("累计覆盖率为:" + QString::number(acuCover));

     QSplineSeries* seriesUs = new QSplineSeries();   // 创建一个样条曲线对象
     seriesUs->setName("美国覆盖率曲线");
     for(int i = start;i <= over; i++)
     {
        seriesUs->append(i, Coverage[i - start]);
     }
     QChart* chart = ui->graphicsView_4->chart();    // 获取一个chart用于管理不同类型的series和其他图表相关对象
     chart->legend()->hide();                   // 隐藏图例
     chart->addSeries(seriesUs);                  // 添加创建好的曲线图对象
     chart->setTitle("美国覆盖率曲线");           // 设置标题
     chart->createDefaultAxes();                // 基于已添加到图表中的series为图表创建轴。以前添加到图表中的任何轴都将被删除。
     chart->axes(Qt::Vertical).first()->setRange(0, 0.4);  // 设置Y轴的范围
     ui->graphicsView_4->setRenderHint(QPainter::Antialiasing);  // 设置抗锯齿
     QMessageBox::information(nullptr, "提示", "模拟结束", QMessageBox::Yes);
     delete []Coverage;
     Coverage = nullptr;
}

复制进去后,

下面放出mainwindow.ui的代码,复制进去,里面具体用到哪些我会讲,但可能讲不清楚

ui

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>MainWindow</class>
 <widget class="QMainWindow" name="MainWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1895</width>
    <height>1060</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <widget class="QStackedWidget" name="stackedWidget">
    <property name="geometry">
     <rect>
      <x>10</x>
      <y>50</y>
      <width>1861</width>
      <height>971</height>
     </rect>
    </property>
    <property name="currentIndex">
     <number>0</number>
    </property>
    <widget class="QWidget" name="page">
     <widget class="QPushButton" name="pushButton">
      <property name="geometry">
       <rect>
        <x>50</x>
        <y>30</y>
        <width>401</width>
        <height>31</height>
       </rect>
      </property>
      <property name="text">
       <string>请在右边输入城市名字,查看城市与卫星服务的相关信息</string>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit">
      <property name="geometry">
       <rect>
        <x>470</x>
        <y>30</y>
        <width>511</width>
        <height>31</height>
       </rect>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser">
      <property name="geometry">
       <rect>
        <x>30</x>
        <y>90</y>
        <width>1001</width>
        <height>361</height>
       </rect>
      </property>
     </widget>
    </widget>
    <widget class="QWidget" name="page_2">
     <widget class="QPushButton" name="pushButton_2">
      <property name="geometry">
       <rect>
        <x>250</x>
        <y>10</y>
        <width>511</width>
        <height>28</height>
       </rect>
      </property>
      <property name="text">
       <string>输入经度纬度查询,查询该点信息</string>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_2">
      <property name="geometry">
       <rect>
        <x>250</x>
        <y>70</y>
        <width>201</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_3">
      <property name="geometry">
       <rect>
        <x>510</x>
        <y>70</y>
        <width>251</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QLabel" name="label">
      <property name="geometry">
       <rect>
        <x>250</x>
        <y>50</y>
        <width>72</width>
        <height>15</height>
       </rect>
      </property>
      <property name="text">
       <string>longitude</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_2">
      <property name="geometry">
       <rect>
        <x>510</x>
        <y>50</y>
        <width>72</width>
        <height>15</height>
       </rect>
      </property>
      <property name="text">
       <string>latitude</string>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser_2">
      <property name="geometry">
       <rect>
        <x>30</x>
        <y>100</y>
        <width>961</width>
        <height>121</height>
       </rect>
      </property>
     </widget>
     <widget class="QChartView" name="graphicsView_2">
      <property name="geometry">
       <rect>
        <x>30</x>
        <y>250</y>
        <width>1291</width>
        <height>192</height>
       </rect>
      </property>
     </widget>
     <widget class="QChartView" name="graphicsView_3">
      <property name="geometry">
       <rect>
        <x>30</x>
        <y>490</y>
        <width>1291</width>
        <height>192</height>
       </rect>
      </property>
     </widget>
    </widget>
    <widget class="QWidget" name="page_3">
     <widget class="QPushButton" name="pushButton_3">
      <property name="geometry">
       <rect>
        <x>810</x>
        <y>10</y>
        <width>261</width>
        <height>28</height>
       </rect>
      </property>
      <property name="text">
       <string>输入仿真时间,然后开始计算</string>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_4">
      <property name="geometry">
       <rect>
        <x>820</x>
        <y>80</y>
        <width>113</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_5">
      <property name="geometry">
       <rect>
        <x>950</x>
        <y>80</y>
        <width>113</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QLabel" name="label_3">
      <property name="geometry">
       <rect>
        <x>820</x>
        <y>50</y>
        <width>72</width>
        <height>15</height>
       </rect>
      </property>
      <property name="text">
       <string>startTime</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_4">
      <property name="geometry">
       <rect>
        <x>950</x>
        <y>50</y>
        <width>72</width>
        <height>15</height>
       </rect>
      </property>
      <property name="text">
       <string>overTime</string>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser_3">
      <property name="geometry">
       <rect>
        <x>820</x>
        <y>140</y>
        <width>321</width>
        <height>331</height>
       </rect>
      </property>
     </widget>
     <widget class="QChartView" name="graphicsView">
      <property name="geometry">
       <rect>
        <x>20</x>
        <y>640</y>
        <width>1341</width>
        <height>291</height>
       </rect>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser_4">
      <property name="geometry">
       <rect>
        <x>820</x>
        <y>530</y>
        <width>321</width>
        <height>71</height>
       </rect>
      </property>
     </widget>
     <widget class="QLabel" name="label_5">
      <property name="geometry">
       <rect>
        <x>720</x>
        <y>560</y>
        <width>101</width>
        <height>16</height>
       </rect>
      </property>
      <property name="text">
       <string>累计覆盖率:</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_6">
      <property name="geometry">
       <rect>
        <x>720</x>
        <y>150</y>
        <width>91</width>
        <height>16</height>
       </rect>
      </property>
      <property name="text">
       <string>瞬时覆盖率:</string>
      </property>
     </widget>
    </widget>
    <widget class="QWidget" name="page_4">
     <widget class="QPushButton" name="pushButton_4">
      <property name="geometry">
       <rect>
        <x>1510</x>
        <y>70</y>
        <width>251</width>
        <height>28</height>
       </rect>
      </property>
      <property name="text">
       <string>输入时间,开始运行</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_7">
      <property name="geometry">
       <rect>
        <x>1520</x>
        <y>130</y>
        <width>81</width>
        <height>16</height>
       </rect>
      </property>
      <property name="text">
       <string>startTime</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_8">
      <property name="geometry">
       <rect>
        <x>1680</x>
        <y>130</y>
        <width>72</width>
        <height>15</height>
       </rect>
      </property>
      <property name="text">
       <string>overTime</string>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_6">
      <property name="geometry">
       <rect>
        <x>1520</x>
        <y>180</y>
        <width>113</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QLineEdit" name="lineEdit_7">
      <property name="geometry">
       <rect>
        <x>1680</x>
        <y>180</y>
        <width>113</width>
        <height>21</height>
       </rect>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser_5">
      <property name="geometry">
       <rect>
        <x>1510</x>
        <y>230</y>
        <width>331</width>
        <height>241</height>
       </rect>
      </property>
     </widget>
     <widget class="QLabel" name="label_9">
      <property name="geometry">
       <rect>
        <x>1410</x>
        <y>240</y>
        <width>81</width>
        <height>16</height>
       </rect>
      </property>
      <property name="text">
       <string>瞬时覆盖率</string>
      </property>
     </widget>
     <widget class="QLabel" name="label_10">
      <property name="geometry">
       <rect>
        <x>1400</x>
        <y>530</y>
        <width>81</width>
        <height>16</height>
       </rect>
      </property>
      <property name="text">
       <string>累计覆盖率</string>
      </property>
     </widget>
     <widget class="QTextBrowser" name="textBrowser_6">
      <property name="geometry">
       <rect>
        <x>1510</x>
        <y>520</y>
        <width>331</width>
        <height>41</height>
       </rect>
      </property>
     </widget>
     <widget class="QChartView" name="graphicsView_4">
      <property name="geometry">
       <rect>
        <x>10</x>
        <y>631</y>
        <width>1811</width>
        <height>291</height>
       </rect>
      </property>
     </widget>
    </widget>
   </widget>
   <widget class="QPushButton" name="theOne">
    <property name="geometry">
     <rect>
      <x>50</x>
      <y>10</y>
      <width>231</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>题1-1,城市窗口问题</string>
    </property>
   </widget>
   <widget class="QPushButton" name="theTwo">
    <property name="geometry">
     <rect>
      <x>300</x>
      <y>10</y>
      <width>231</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>题1-2,求区域各点信息</string>
    </property>
   </widget>
   <widget class="QPushButton" name="theThree">
    <property name="geometry">
     <rect>
      <x>550</x>
      <y>10</y>
      <width>221</width>
      <height>28</height>
     </rect>
    </property>
    <property name="text">
     <string>题2-1.覆盖率</string>
    </property>
   </widget>
   <widget class="QPushButton" name="theFour">
    <property name="geometry">
     <rect>
      <x>790</x>
      <y>10</y>
      <width>201</width>
      <height>31</height>
     </rect>
    </property>
    <property name="text">
     <string>题2-2.美国覆盖率</string>
    </property>
   </widget>
  </widget>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>1895</width>
     <height>26</height>
    </rect>
   </property>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <customwidgets>
  <customwidget>
   <class>QChartView</class>
   <extends>QGraphicsView</extends>
   <header>qchartview.h</header>
  </customwidget>
 </customwidgets>
 <resources/>
 <connections/>
</ui>

以上

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

卫星系统算法课程设计 - 第二部分 qt的安装与创建项目 的相关文章

  • Spring学习笔记1

    前言 Spring框架的学习路线 xff1a Spring第一天 xff1a Spring的IOC容器之XML的方式 xff0c Spring框架与Web项目整合Spring第二天 xff1a Spring的IOC容器之注解的方式 xff0
  • GitHub学生包的介绍与申请

    1 Github学生包介绍 1 Github学生包是什么 xff1f GitHub 学生包是一个由 GitHub 免费提供给学生的福利 xff0c 里面包括了计算机专业可能用到的很多付费资源 xff0c 其中包含一系列网站服务的打折 代金券
  • (二)GitHub的使用随记

    一 Git及GitHub的使用 1 突破GitHub单个大文件上传限制 GitHub 上新建的仓库容量大小限制在 1G xff0c 单个文件不能超过 100M xff0c 有 50M 的文件 xff0c 就会警告了 可通过以下命令查找超过
  • 总结一个月以来调试STM32底盘踩过的坑

    深坑1 xff1a 基本配置方法 xff1b 配置PWM输出 xff0c TIM4有四路PWM输出 xff0c 依葫芦画瓢开始配置 xff0c 配置完后 xff0c 开始测试 xff0c 啥都没有啊 xff0c 很是伤心 xff0c 开始查
  • Android开发60条技术经验总结

    1 全部Activity可继承自BaseActivity xff0c 便于统一风格与处理公共事件 xff0c 构建对话框统一构建器的建立 xff0c 万一需要整体变动 xff0c 一处修改到处有效 2 数据库表段字段常量和SQL逻辑分离 x
  • 无人机利用视觉slam实现位置估计

    无人机利用视觉slam实现室内位置估计 自己近期所做的以及思考的东西 我们实验室买了阿木的p200 带t265 无人机用于无人机的控制研究 xff0c 通过阿木实验室的ros功能包px4 command可以 无脑的实现飞机的悬停功能 xff
  • 学习api的使用方式

    网上有很多API教程 xff0c 但是都是针对单个API的使用来讲解 xff0c 但是如果遇到网上没有教程的API呢 xff1f 这篇教程的目的就是这样 xff1a 当遇到一个不会的API的时候 xff0c 懂得如何利用资料学会使用这个AP
  • 解决favicon.ico无法显示的问题

    今天在做站的时候发现网站favicon ico图标不显示 xff0c favicon是什么 xff1f 其实我们在浏览器看网页的时候 xff0c 在地址栏的左边 xff0c 你就可以看到一个小的图标 xff08 每个网站都不一样 xff09
  • RTK和GPS定位

    GPS定位的基本原理是 xff0c 测量出已知位置的卫星到地面GPS接收器之间的距离 xff0c 然后接收器通过与至少4颗卫星通讯 xff0c 计算与这些卫星间的距离 xff0c 就能确定其在地球上的具体位置 普通GPS的定位精度 1米 x
  • ESP8266EX 串口WIFI无线模块

    介绍 内部跑LWIP协议 xff0c 支持三种模式 xff1a AP STA AP 43 STA共存模式 简洁高效的AT指令 特点 支持无线802 11 b g n标准 支持STA AP STA 43 AP 三种工作模式 内置CTP IP协
  • Cesium球心坐标与本地坐标系经纬转换的数学原理—矩阵变换

    之前整理过 xff1a 透析矩阵 xff0c 由浅入深娓娓道来 高数 线性代数 矩阵 三维旋转笔记 欧拉角 四元数 旋转矩阵 轴角 记忆点整理 xff0c 这次转载 FuckGIS的 Cesium之球心坐标与本地坐标 xff0c 算是线性代
  • 怎么在keil官网上下载芯片固件包(*.pack)

    第一步 xff1a 登录keil官网 www keil com 第二步 xff1a 点击 Product 第三步 xff1a 点击 ARM development tools 第四步 xff1a Public software Packs
  • UCOS开发手册中关于OSQPend()函数讲

    转自 xff1a http www openedv com thread 44168 1 1 html UCOS开发手册中 第十章 UCOSIII消息传递 章节中关于等待消息队列的函数OSQPend 讲解有误 xff0c OSQPend 函
  • ucos-ii学习笔记——信号量集(事件标志组)的原理及使用

    xfeff xfeff ucos ii学习笔记 信号量集 事件标志组 的原理及使用 Created on 2012 10 8 Author zhang bin 学习笔记 for ucos ii PC redesigned by zhang
  • 低速容错CAN:ISO 11898-3 与ISO 11519-2标准两者关系

    xfeff xfeff 有关 低速容错CAN xff1a ISO 11898 3 与ISO 11519 2标准两者关系 最近有几个客户问到这个问题 xff0c 对应的产品是否兼容 于是上ISO官网查看发现并无两者的关系 xff0c 不过在网
  • CAN总线仲裁机制--对于多个节点同时发送相同ID的报文

    最近在学习CAN总线 xff0c 原先一直不太明白 xff0c 若有A xff0c B 2个节点同一时刻一起向总线上发送数据 xff0c CAN总线是怎么仲裁的 xff0c 来让A xff0c B其中一个节点退出 xff0c 保证高优先级的
  • roslaunch mavros px4.launch fcu_url=xxxx到底做了什么

    roslaunch mavros px4 launch fcu url 61 xxxx到底做了什么 一言以蔽之 xff0c roslaunch mavros px4 launch fcu url span class token opera
  • PX4,ROS,gazebo仿真

    https gitee com bingobinlw some tree master Overview Simulation Px4 command Slam map image process planning P200 AmovCar
  • 飞行控制PID算法——无人机飞控

    PID控制应该算是应用非常广泛的控制算法了 小到控制一个元件的温度 xff0c 大到控制无人机的飞行姿态和飞行速度等等 xff0c 都可以使用PID控制 这里我们从原理上来理解PID控制 PID proportion integration
  • Ubuntu20.04桌面版图文安装(超详细)

    Ubuntu20 04桌面版图文安装 xff08 超详细 xff09 一 准备工具 VMWare Workstation15 Pro xff1b ubuntu 20 04 desktop amd64 iso xff1b 二 虚拟机初始配置

随机推荐

  • 嵌入式芯片概念梳理 - CPU、MCU、MP、DSP、FPGA、ASIC

    CPU中央处理单元包含基本的运算单元AUL xff0c 存储单元cache等基本资源 xff0c 实现硬件设备的基本控制功能 中央处理器作为一个普世概念 xff0c 实际根据具体数据处理功能方向不同 xff0c 细分位DSP MCU和MP
  • UART、I2C、USB、SPI、CAN、Jtag、PCI/PCIE协议汇总

    协议通信方式UART串行全双工I2C SPI是串行外设接口 xff08 Serial Peripheral Interface xff09 的缩写 SPI是一种高速的 全双工 同步的通信总线 xff0c 并且在芯片的管脚上只占用四根线 xf
  • busybox概述

    busybox是什么 xff1f xff08 1 xff09 busybox是Linux上的一个应用程序 application xff0c 即只有一个ELF文件头 xff08 2 xff09 它整合了许多Linux上常用的工具和命令 xf
  • SR-IOV

    SSR IOV是Single Root I O Virtualization的缩写 在虚拟机中 xff0c 一切皆虚拟 比如网卡 xff0c 虚拟机看来好像有一个真实网卡 xff0c 但是这个网卡是宿主机虚拟出来的硬件 xff0c 也就是一
  • 希尔排序算法

    本章介绍排序算法中的希尔排序 内容包括 xff1a 1 希尔排序介绍 2 希尔排序图文说明 3 希尔排序的时间复杂度和稳定性 4 希尔排序实现 4 1 希尔排序C实现 4 2 希尔排序C 43 43 实现 4 3 希尔排序Java实现 转载
  • 归并排序算法

    概要 本章介绍排序算法中的归并排序 内容包括 xff1a 1 归并排序介绍 2 归并排序图文说明 3 归并排序的时间复杂度和稳定性 4 归并排序实现 4 1 归并排序C实现 4 2 归并排序C 43 43 实现 4 3 归并排序Java实现
  • 拓扑排序算法

    拓扑排序介绍 拓扑排序 Topological Order 是指 xff0c 将一个有向无环图 Directed Acyclic Graph简称DAG 进行排序进而得到一个有序的线性序列 这样说 xff0c 可能理解起来比较抽象 下面通过简
  • 线性时不变系统输出调节问题

    线性时不变系统输出调节问题 最近在学习 Nonlinear output regulation 中的linear output regulation时 xff0c 对于linear robust output regulation的问题时
  • MinGW-w64安装教程——著名C/C++编译器GCC的Windows版本

    MinGW w64安装教程 著名C C 43 43 编译器GCC的Windows版本 MinGW w64安装教程 著名C C 43 43 编译器GCC的Windows版本 本文主要讲述如何安装 C语言 编译器 MinGW w64 xff0c
  • RT-Thread实时操作系统简介

    目录 一 概述 二 架构 三 版本选择 四 内核启动流程 五 自动初始化机制 六 内核对象模型 七 I O设备模型 1 框架 2 设备驱动使用序列图 3 设备类型 八 FinSH控制台 九 ENV工具 1 menuconfig 2 Scon
  • PCIe RAS

    对于Linux系统针对RAS的AER错误处理机制完成 PCIe RAS简单来讲就是PCIe的错误检测 纠正以及汇报的机制 它可以方便我们准确的定位 xff0c 纠正和分析错误增强系统的健壮性和可靠性 PCIe错误的分类 PCIe错误分为可校
  • Linux下的regulator调试

    先看regulator使用的小demo 如 i2c8 touchscreen 64 28 vddcama supply 61 lt amp xxxxx gt int ret struct regulator power static int
  • 关于添加系统调用遇到 Unable to handle kernel paging request at virtual address 的解决

    Unable to handle kernel paging request at virtual address 是内存访问异常的错误 xff0c 原因通常有三种 xff1a virtual address 为 0x00000000 时
  • vscode安装配置clang-format插件及使用

    vscode安装配置clang format插件及使用 首先安装插件 在vscode扩展里搜索clang format xff0c 安装排名第一的xaver clang format 确认clang format可执行程序路径 window
  • 简历中项目描述怎么写啊

    http wenda tianya cn question 7ade6dc9324bed88
  • 树莓派(Raspberry Pi 3) - 系统烧录及系统使用

    树莓派 xff08 Raspberry pi xff09 是一块集成度极高的ARM开发板 xff0c 不仅包含了HDMI xff0c RCA xff0c CSI xff0c HDMI xff0c GPIO等端口 xff0c 还支持蓝牙以及无
  • flashcache原理

    介绍flashcache的文章很多 xff0c 我就不废话了 使用上 xff0c 有余峰老哥的 文章 xff1b 原理上 xff0c 有ningoo同学的 flashcache系列 但是ningoo同学漏掉了device mapper和fl
  • 无人机算法之PID

    xff08 未完成 xff09 一 PID介绍 xff08 百度百科 xff09 PID 控制器 xff08 比例 积分 微分控制器 xff09 是一个在工业控制应用中常见的反馈回路部件 xff0c 由比例单元 P 积分单元 I 和微分单元
  • java:接口、lambda表达式与内部类

    接口 xff08 interface 接口用来描述类应该做什么 xff0c 而不指定他们具体应该如何做 接口不是类 xff0c 而是对符合这个接口的类的一组需求 接口定义的关键词是interface span class token key
  • 卫星系统算法课程设计 - 第二部分 qt的安装与创建项目

    上一篇文章只讲了基本的东西 xff0c 这一篇要完成qt的安装 xff0c 构建项目 xff0c 并且将上一篇的代码导入进去 某比利比例搜qt安装 xff0c 看到qt5 14 2的下载安装 xff0c 跟着做 1 创建项目 创建新项目 x