QT-模拟电梯上下楼

QT-模拟电梯上下楼

  • 一、演示效果
  • 二、核心程序
  • 三、下载链接


一、演示效果

在这里插入图片描述

二、核心程序

#include "ElevatorController.h"
#include <QGridLayout>
#include <QLabel>
#include <QGroupBox>
#include <QGridLayout>
#include <QPushButton>
#include <QDebug>
#include <QChar>
#include <QGuiApplication>
#include <QScreen>
#include <queue>ElevatorController::ElevatorController(Ui::MainWindow* u, int numElevators, int numFloors)
{// create/populate ui ComboBox elementsui = u;QStringList evs;for (int elevator = 1; elevator <= numElevators; ++elevator){evs << QString("Elevator: %1").arg(elevator);}ui->comboElevatorBox->addItems(evs);connect(ui->comboElevatorBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &ElevatorController::elevatorSelected);evs.clear();for (int floorc = 1; floorc <= numFloors; ++floorc){evs << QString("Floor: %1").arg(floorc);}ui->comboFloorBox->addItems(evs);// buttons connectedconnect(ui->pushElevatorButton, &QPushButton::clicked, this, &ElevatorController::buttonElevatorSubmit);connect(ui->pushHelpButton, &QPushButton::clicked, this, &ElevatorController::buttonElevatorHelp);connect(ui->pushPlaceButton, &QPushButton::clicked, this, &ElevatorController::buttonPlaceOnFloor);connect(ui->pushMoveButton, &QPushButton::clicked, this, &ElevatorController::buttonMoveToElevator);connect(ui->pushAdd10FloorButton, &QPushButton::clicked, this, &ElevatorController::add10ToEachFloor);connect(ui->pushBuildingEmergencyButton, &QPushButton::clicked, this, &ElevatorController::triggerBuildingEmergency);connect(ui->pushEmergencyResetAllButton, &QPushButton::clicked, this, &ElevatorController::resetAllElevatorsEmergency);connect(ui->pushLeaveButton, &QPushButton::clicked, this, &ElevatorController::buttonLeaveElevator);// spin box buttons:connect(ui->spinBoxMove, qOverload<int>(&QSpinBox::valueChanged), this, &ElevatorController::moveComboBoxChange);connect(ui->spinBoxLeaveElevator, qOverload<int>(&QSpinBox::valueChanged), this, &ElevatorController::moveLeaveElevatorBoxChange);// combo box change:connect(ui->comboFloorBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &ElevatorController::floorSelected);// keep in mind: "setWidget" and "setLayout" etc add to the ui tree, memory managed by Qt not Me :-)// widget to hold the grid layoutQWidget* elevatorWidget = new QWidget();ui->elevatorScrollArea->setWidget(elevatorWidget); // Set the content widget of the ElevatorController// QGridLayout* elevatorGridLayoutelevatorGridLayout = new QGridLayout(elevatorWidget);elevatorWidget->setLayout(elevatorGridLayout);// Add buttons or labels to the grid layout based on dimensionsfor (int floor = numFloors - 1; floor >= 0; floor--){for (int elevator = 1; elevator <= numElevators; ++elevator){// Create a QLabel for each positionQLabel* cube = new QLabel;cube->setText(" ");cube->setFixedSize(CUBE_SIZE, CUBE_SIZE);QString color = "gray";if(numFloors - floor - 1 == 0) // all ev's start at 0color = "red";cube->setStyleSheet(QString("background-color: %1").arg(color));// Add the widget to the grid layout at the specified positionelevatorGridLayout->addWidget(cube, floor, elevator);}Floor* flr = new Floor(floor + 1); // floor class is a part of the UI// Connect the signals from the Floor to the slots in the ElevatorControllerconnect(flr, &Floor::upButtonPressed, this, &ElevatorController::buttonPressedUp);connect(flr, &Floor::downButtonPressed, this, &ElevatorController::buttonPressedDown);// adds the floor at the start (far left)elevatorGridLayout->addWidget(flr, numFloors - floor - 1, 0);floors.push_back(flr);}// create elevatorsfor (int elevator = 1; elevator <= numElevators; ++elevator){Elevator* ev = new Elevator(elevator);elevators.push_back(ev);updateDisplays();// should be connecting slot in elevator to signals in elevator controllerconnect(this, &ElevatorController::resetEmergency, ev, &Elevator::resetEmergencyInElevator);connect(this, &ElevatorController::sendRequestToElevator, ev, &Elevator::pressButton);connect(this, &ElevatorController::helpButton, ev, &Elevator::helpButtonPressed);connect(this, &ElevatorController::moveElevatorToFloor, ev, &Elevator::moveTofloor);connect(this, &ElevatorController::removeElevatorPassengers, ev, &Elevator::removePassengers);connect(this, &ElevatorController::addElevatorPassengers, ev, &Elevator::addPassengers);connect(this, &ElevatorController::buildingEmergency, ev, &Elevator::emergency);connect(this, &ElevatorController::pressButton, ev, &Elevator::pressButton);connect(this, &ElevatorController::unpressButton, ev, &Elevator::unpressButton);connect(ev, &Elevator::floorChanged, this, &ElevatorController::elevatorFloorChanged);connect(ev, &Elevator::doorOpened, this, &ElevatorController::doorOpened);connect(ev, &Elevator::doorClosed, this, &ElevatorController::doorClosed);connect(ev, &Elevator::doorBlocked, this, &ElevatorController::doorBlocked);connect(ev, &Elevator::overloaded, this, &ElevatorController::overloaded);connect(ev, &Elevator::emergencyOnBoard, this, &ElevatorController::emergency);connect(ev, &Elevator::updateDisplays, this, &ElevatorController::updateDisplays);QThread* evThread = new QThread;ev->moveToThread(evThread);evThread->start();threads.push_back(evThread);}requestScanTimer = new QTimer(this);connect(requestScanTimer, &QTimer::timeout, this, &ElevatorController::scanRequestTree);requestScanTimer->start(SCAN_REQUEST_TREE_SECS);  // Scan backup request tree every 15 seconds, in case overflowqDebug() << "Elevator Controller Initialized";
}ElevatorController::~ElevatorController() // clean up floors
{for(int i = 0; i < floors.size(); i++)delete floors[i];requestScanTimer->stop();delete requestScanTimer;for(int i = 0; i < threads.size(); i++){threads[i]->quit();threads[i]->wait();delete threads[i];}
}// --- UI INPUT & CALLBACK FUNCS ---void ElevatorController::handleScreenResized(int w, int h)
{int bufferGap = 10;ui->elevatorScrollArea->resize(w - ui->InputTerminal->width() - 3*bufferGap, h - bufferGap*6);qDebug() << "Reinit scale -- uiWidth: " << w << " uiHeight: " << h;ui->InputTerminal->move(ui->elevatorScrollArea->x() + w - ui->InputTerminal->width() - 2*bufferGap, ui->InputTerminal->y());ui->InputTerminal->resize(ui->InputTerminal->width(), h - bufferGap*5);
}void ElevatorController::updateDisplays()
{int ev = ui->comboElevatorBox->currentText().remove(0, 10).toInt(); // stored from 0QString buttonList = "";const std::set<int>& blist = elevators[ev - 1]->getButtonsPressed();for(const int& a : blist){buttonList += QString::number(a) + " ";}ui->textBrowserButtonsPressed->setPlainText(buttonList);const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt();ui->passengerOnFloorNumber->display(floors[flr - 1]->peopleOnFloor());ui->passengerNumber->display(elevators[ev - 1]->numPassengers());
}void ElevatorController::buttonElevatorSubmit()
{// get the int values from the combo boxesint ev = ui->comboElevatorBox->currentText().remove(0, 10).toInt();int fb = ui->comboFloorBox->currentText().remove(0, 7).toInt();qDebug() << "BUTTON - elevator submit pressed elev: " << ev << " floor button: " << fb;if(elevators[ev - 1]->getButtonsPressed().count(fb) > 0)emit unpressButton(ev, fb);elseemit pressButton(ev, fb);
}void ElevatorController::buttonPlaceOnFloor()
{qDebug() << "BUTTON buttonPlaceOnFloor.... spawning ppl on floor";const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt() - 1;floors[flr]->addPeople(ui->spinBoxPlace->value());ui->passengerOnFloorNumber->display(floors[flr]->peopleOnFloor());ui->spinBoxPlace->setValue(0);
}void ElevatorController::buttonMoveToElevator()
{qDebug() << "BUTTON: buttonMoveToElevator.... moving ppl ";const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt();int evweak = ui->comboElevatorBox->currentText().remove(0, 10).toInt() - 1; // if this is on the same floor its usedElevator* availableEv = nullptr;Elevator* weakEv = nullptr;bool potentialEvPassed = false;if(elevators[evweak]->currentFloor() == flr) // soft lock the current elevatorweakEv = elevators[evweak];for(Elevator* ev : elevators) // unless theres one that makes more sense{if(ev->currentFloor() == flr && ev->currentState() == Elevator::DoorsOpen){availableEv = ev;if(weakEv == ev && weakEv != nullptr){availableEv = weakEv;break;}}}if(!availableEv)return;const int val = ui->spinBoxMove->value(); //usr inputui->spinBoxMove->setValue(0);floors[flr - 1]->removePeople(val);//    emit addElevatorPassengers(availableEv->getId(), flr, val);elevators[availableEv->getId() - 1]->addPassengers(availableEv->getId(), flr, val);// just set the combo box option to the one that people were put into automatically... for visibilityui->comboElevatorBox->setCurrentIndex(availableEv->getId() - 1);// update the floor on people displayupdateDisplays();
}void ElevatorController::buttonLeaveElevator()
{int ev = ui->comboElevatorBox->currentText().remove(0, 10).toInt();qDebug() << "BUTTON: buttonLeaveElevator.... moving ppl EV: " << ev << " FLR: " << elevators[ev - 1]->currentFloor();const int val = ui->spinBoxLeaveElevator->value(); //usr inputui->spinBoxLeaveElevator->setValue(0);emit removeElevatorPassengers(elevators[ev - 1]->getId(), elevators[ev - 1]->currentFloor(), val);floors[elevators[ev - 1]->currentFloor() - 1]->addPeople(val);// just set the combo box option to the one that people were put into automatically... for visibilityui->comboFloorBox->setCurrentIndex(elevators[ev - 1]->currentFloor() - 1);ui->passengerNumber->display(elevators[ev-1]->numPassengers());updateDisplays();const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt();if(elevators[ev - 1]->currentFloor() != flr)return;// update the floor on people displayui->passengerOnFloorNumber->display(floors[elevators[ev - 1]->currentFloor()]->peopleOnFloor());updateDisplays();controlMoveButtonActivated();
}void ElevatorController::add10ToEachFloor()
{qDebug() << "BUTTON add 10 To Each Floor.... spawning 10 ppl on each floor!";for(Floor* f : floors){f->addPeople(10);}const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt() - 1;ui->passengerOnFloorNumber->display(floors[flr]->peopleOnFloor());ui->spinBoxPlace->setValue(0);
}void ElevatorController::triggerBuildingEmergency()
{emit buildingEmergency(-1);
}void ElevatorController::buttonElevatorHelp()
{int ev = ui->comboElevatorBox->currentText().remove(0, 10).toInt();emit helpButton(ev);updateDisplays();
}void ElevatorController::resetAllElevatorsEmergency()
{emit resetEmergency(-1);updateDisplays();
}void ElevatorController::controlMoveButtonActivated(Elevator* availableEv)
{// we want to check if there is an elevator on the floor in door open state// & set the control button to active or not based on it//qDebug() << "BUTTON ACTIVATE: Activating/Deactivating the Move Button to allow moving ppl ";const int flr = ui->comboFloorBox->currentText().remove(0, 7).toInt();const int evNum = ui->comboElevatorBox->currentText().remove(0, 10).toInt();for(Elevator* ev : elevators){if(availableEv != nullptr)break;if(ev->currentFloor() == flr && ev->currentState() == Elevator::DoorsOpen || elevators[evNum - 1]->currentState() == Elevator::Overload)availableEv = ev;}if(elevators[evNum - 1]->currentState() == Elevator::DoorsOpen || elevators[evNum - 1]->currentState() == Elevator::Overload || elevators[evNum - 1]->currentState() == Elevator::Emergency)ui->pushLeaveButton->setEnabled(true);else if(ui->pushLeaveButton->isEnabled())ui->pushLeaveButton->setEnabled(false);if(availableEv != nullptr && flr == availableEv->currentFloor())ui->pushMoveButton->setEnabled(true);else if(ui->pushMoveButton->isEnabled())ui->pushMoveButton->setEnabled(false);
}void ElevatorController::elevatorSelected(int index)
{ui->passengerNumber->display(elevators[index]->numPassengers());updateDisplays();controlMoveButtonActivated(elevators[index]);qDebug()  << "COMBO BOX: Elevator selected. Elevator: " << index;
}void ElevatorController::floorSelected(int index)
{// update the segment display for passangersui->passengerOnFloorNumber->display(floors[index]->peopleOnFloor());qDebug()  << "COMBO BOX: Floor selected. Floor: " << index;ui->spinBoxMove->setValue(0); // wipe this since its different # pplcontrolMoveButtonActivated(); // potentially changes move buttons state
}void ElevatorController::moveComboBoxChange(int index)
{if(index > ui->passengerOnFloorNumber->value()){ui->spinBoxMove->setValue(ui->passengerOnFloorNumber->value());}
}void ElevatorController::moveLeaveElevatorBoxChange(int index)
{if(index > ui->passengerNumber->value()){ui->spinBoxLeaveElevator->setValue(ui->passengerNumber->value());}
}// --- UI UPDATE / EV SOCKET FUNCS ---void ElevatorController::elevatorFloorChanged(int floor, int ev, bool up)
{// each elevator emits this when the moved to new floorev -= 1;qDebug() << "EV signal: Elevator floor changed, floor: " << floor << " elevator: " << ev << " up dir: " << up;qDebug() << "(X, Y) : " << floor << ", " << (ev + 1);const int x = floors.size() - floor; // as the floors decrease, x increases (flr increase, x decrease)const int y = ev + 1;QLayoutItem* layoutItem = elevatorGridLayout->itemAtPosition(x, y); // check if we are looking at a valid evif (!layoutItem){qDebug() << "No layout item at this position.";return;}QWidget* widget = layoutItem->widget();if (!widget){qDebug() << "No widget at this position.";return;}const QMetaObject* metaObject = widget->metaObject();QString widgetType = QString::fromUtf8(metaObject->className());if (widgetType == "QLabel"){QLabel* square = qobject_cast<QLabel*>(widget);QLabel* squarePrev;squarePrev = qobject_cast<QLabel*>(elevatorGridLayout->itemAtPosition((x - 1 + floors.size()) % floors.size(), y)->widget());squarePrev->setStyleSheet(QString("background-color: gray;"));squarePrev = qobject_cast<QLabel*>(elevatorGridLayout->itemAtPosition((x + 1)%floors.size(), y)->widget());squarePrev->setStyleSheet(QString("background-color: gray;"));if(elevators[ev]->currentState() == Elevator::Emergency)square->setStyleSheet("background-color: yellow;");elsesquare->setStyleSheet("background-color: red;");}qDebug() << "Widget type: " << widgetType;
}void ElevatorController::doorOpened(int flr, int ev)
{// a door has openedqDebug()  << "EV signal: Door opened! Elevator: " << ev;const int x = floors.size() - flr; // as the floors decrease, x increases (flr increase, x decrease)const int y = ev;if (!elevatorGridLayout->itemAtPosition(x, y)){qDebug()  << "doorOpened(): No Item at position:  (" << x << ", " << y <<  ")";return;}QWidget* wdg = elevatorGridLayout->itemAtPosition(x, y)->widget();if(QString::fromUtf8(wdg->metaObject()->className()) != "QLabel"){qDebug()  << "doorOpened(): Item at position:  (" << x << ", " << y <<  ") " << "is a: " << QString::fromUtf8(wdg->metaObject()->className());return;}QLabel* squarePrev = qobject_cast<QLabel*>(wdg);squarePrev->setStyleSheet(QString("background-color: green;"));controlMoveButtonActivated(elevators[ev - 1]);updateDisplays();
}void ElevatorController::doorClosed(int flr, int ev)
{// a door has closedqDebug()  << "EV signal: Door closed!! Elevator: " << ev;const int x = floors.size() - flr; // as the floors decrease, x increases (flr increase, x decrease)const int y = ev;if (!elevatorGridLayout->itemAtPosition(x, y)){qDebug()  << "doorClosed(): No Item at position:  (" << x << ", " << y <<  ")";return;}QWidget* wdg = elevatorGridLayout->itemAtPosition(x, y)->widget();if(QString::fromUtf8(wdg->metaObject()->className()) != "QLabel"){qDebug()  << "doorClosed(): Item at position:  (" << x << ", " << y <<  ") " << "is a: " << QString::fromUtf8(wdg->metaObject()->className());return;}QLabel* squarePrev = qobject_cast<QLabel*>(wdg);squarePrev->setStyleSheet(QString("background-color: purple;"));
}void ElevatorController::doorBlocked(int flr, int ev)
{// a door has closedqDebug()  << "EV signal: Alert! Door blocked... reopening door... Elevator: " << ev;const int x = floors.size() - flr; // as the floors decrease, x increases (flr increase, x decrease)const int y = ev;if (!elevatorGridLayout->itemAtPosition(x, y)){qDebug()  << "doorBlocked(): No Item at position:  (" << x << ", " << y <<  ")";return;}QWidget* wdg = elevatorGridLayout->itemAtPosition(x, y)->widget();if(QString::fromUtf8(wdg->metaObject()->className()) != "QLabel"){qDebug()  << "doorBlocked(): Item at position:  (" << x << ", " << y <<  ") " << "is a: " << QString::fromUtf8(wdg->metaObject()->className());return;}QLabel* squarePrev = qobject_cast<QLabel*>(wdg);squarePrev->setStyleSheet(QString("background-color: blue;"));
}void ElevatorController::overloaded(int flr, int ev)
{// a door has closedqDebug()  << "EV signal: Elevator overloaded!! Elevator: " << ev;const int x = floors.size() - flr; // as the floors decrease, x increases (flr increase, x decrease)const int y = ev;if (!elevatorGridLayout->itemAtPosition(x, y)){qDebug()  << "doorClosed(): No Item at position:  (" << x << ", " << y <<  ")";return;}QWidget* wdg = elevatorGridLayout->itemAtPosition(x, y)->widget();if(QString::fromUtf8(wdg->metaObject()->className()) != "QLabel"){qDebug()  << "overloaded(): Item at position:  (" << x << ", " << y <<  ") " << "is a: " << QString::fromUtf8(wdg->metaObject()->className());return;}QLabel* squarePrev = qobject_cast<QLabel*>(wdg);squarePrev->setStyleSheet(QString("background-color: orange;"));
}void ElevatorController::emergency(int flr, int ev)
{// a door has closedqDebug()  << "EV signal: Elevator emergency!! Elevator: " << ev;if(flr != SAFE_FLOOR)return;QLayoutItem* layoutItem = elevatorGridLayout->itemAtPosition(floors.size() - SAFE_FLOOR, ev); // check if we are looking at a valid evif (!layoutItem){qDebug() << "No layout item at this position.";return;}QWidget* widget = layoutItem->widget();if (!widget){qDebug() << "No widget at this position.";return;}const QMetaObject* metaObject = widget->metaObject();QString widgetType = QString::fromUtf8(metaObject->className());if (widgetType == "QLabel"){QLabel* square = qobject_cast<QLabel*>(widget);if(elevators[ev - 1]->currentState() == Elevator::Idle)square->setStyleSheet(QString("background-color: red;"));elsesquare->setStyleSheet(QString("background-color: yellow;"));} qDebug() << "Widget type: " << widgetType;
}// --- EV REQUEST FUNCS ---void ElevatorController::buttonPressedUp(int floor)
{// an up button on a floor has been pressedqDebug()  << "Floor signal: Floor up button pressed: " << floor;handleFlrPressed(FloorDirection(floor, true));
}void ElevatorController::buttonPressedDown(int floor)
{// a down button on a floor has been pressedqDebug() << "Floor signal: Floor down button pressed: " << floor;handleFlrPressed(FloorDirection(floor, false));
}void ElevatorController::handleFlrPressed(FloorDirection fd)
{// maybe this had some use in some implementtation? ev->getNumFloorsReserved();Elevator* bestElevator = nullptr;Elevator* idleEv = nullptr; // lower priofor(Elevator* pEv : elevators){if(fd.up && pEv->lastDirMovingUp() && fd.num >= pEv->currentFloor()){bestElevator = pEv;break;}if(!fd.up && !pEv->lastDirMovingUp() && fd.num <= pEv->currentFloor()){bestElevator = pEv;break;}if(pEv->currentState() == Elevator::Idle)idleEv = pEv;}if(bestElevator)emit moveElevatorToFloor(bestElevator->getId(), fd.num);else if(idleEv)emit moveElevatorToFloor(idleEv->getId(), fd.num);elseearliestRequestTree.push(fd);
}void ElevatorController::scanRequestTree()
{// happen on a timer, scan request tree realloc elevators if freeif(AGGRESSIVE_LOGGING && !earliestRequestTree.empty())qDebug() << "scanRequestTree-> Request floor:  " << earliestRequestTree.top().num << " up: " << earliestRequestTree.top().up; // << i++;if (earliestRequestTree.empty()){return;}FloorDirection fd = earliestRequestTree.top();earliestRequestTree.pop();handleFlrPressed(FloorDirection(fd.num, fd.up));
}
xt

三、下载链接

https://download.csdn.net/download/u013083044/88861542

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/695001.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

尾矿库排洪系统结构仿真APP助力尾矿库本质安全

1、背景介绍 尾矿库作为重大危险源之一&#xff0c;在国际灾害事故排名中位列第18位&#xff0c;根据中国钼业2019年8月刊《中国尾矿库溃坝与泄漏事故统计及成因分析》的统计&#xff0c;在46起尾矿库泄漏事故中&#xff0c;由于排洪设施导致的尾矿泄漏事故占比高达1/3&#x…

linux下开发,stm32和arduino,我该何去何从?

linux下开发&#xff0c;stm32和arduino&#xff0c;我该何去何从&#xff1f; 在开始前我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「stm3的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共…

QT中的多线程有什么作用?

概述 在学习QT线程的时候我们首先要知道的是QT的主线程&#xff0c;也叫GUI线程&#xff0c;意如其名&#xff0c;也就是我们程序的最主要的一个线程&#xff0c;主要负责初始化界面并监听事件循环&#xff0c;并根据事件处理做出界面上的反馈。但是当我们只限于在一个主线程上…

密码学基本概念

密码学基本概念 密码学的安全目标至少包含三个方面&#xff1a; &#xff08;1&#xff09;保密性&#xff08;Confidentiality&#xff09;:信息仅被合法用户访问&#xff08;浏览、阅读、打印等&#xff09;&#xff0c;不被泄露给非授权的用户、实体或过程。 提高保密性的手…

电商+支付双系统项目------实现电商系统中分类模块的开发!

本篇文章主要介绍一下这个项目中电商系统的分类模块开发。电商系统有很多模块&#xff0c;除了分类模块&#xff0c;还有用户模块&#xff0c;购物车模块&#xff0c;订单模块等等。上一篇文章已经讲了用户模块&#xff0c;这篇文章我们讲讲项目中的分类模块。 有的人可能会很…

图文并茂手把手教你MAC运行.net项目(Visual Studio Code-vs code 配置c# .net环境 运行solution)

前提条件 下载安装vscode有一个完整项目 vscode下载插件 C# Dev Kit.NET Core Extension Packvscode-solution-explorer 下载安装.NET SDK 点此进入下载 以Download .NET 6.0为案例 查看mac是arm64还是x64 屏幕左上角苹果图标&#xff0c;点击关于本机处理器&#x…

1-SpringBoot启动流程

SpringBoot启动流程 new SpringApplication() 确认web应用类型加载ApplicationContextInitializer加载ApplicationListener记录主启动类 run() 准备环境对象Environment&#xff0c;用于加载系统属性等等打印Banner实例化容器Context准备容器&#xff0c;为容器设置Environmen…

恶意软件分析工具集成环境

前言 之前很多朋友对我的恶意软件分析虚拟机环境比较好奇&#xff0c;有些朋友还问我能不能共享一下我的恶意软件分析环境虚拟机&#xff0c;因为实在是太大了&#xff0c;而且做了很多快照&#xff0c;也不方便共享&#xff0c;在做恶意软件分析的时候&#xff0c;因为不同的…

物联网在智慧景区中的应用:提升游客体验与运营效率

目录 一、物联网技术概述 二、物联网在智慧景区中的应用 1、智能门票系统 2、智能导览系统 3、智能安全监控系统 4、智能环保系统 三、物联网在智慧景区中提升游客体验 1、提高游览便捷性 2、个性化服务体验 3、提升游客安全感 四、物联网在智慧景区中提升运营效率 …

Chromium的下载地址

Chromium的下载地址&#xff1a; Download Chromiumhttps://www.chromium.org/getting-involved/download-chromium/ https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefixWin_x64/https://commondatastorage.googleapis.com/chromium-br…

【数学建模入门】

数学建模入门 数学建模需要的学科知识怎么学习数学模型如何读好一篇优秀论文数学建模赛题常见类别数学建模常见问题数学建模组队和分工数学建模准备工作 数学建模需要的学科知识 怎么学习数学模型 &#x1f4a6;推荐阅读书籍&#xff1a; 《数学建模算法与应用》&#xff0c;…

制冷系统12大阀件的详细图文介绍

四通阀&#xff0c;液压阀术语&#xff0c;是具有四个油口的控制阀。 四通阀工作原理&#xff1a; 当电磁阀线圈处于断电状态&#xff0c;先导滑阀在右侧压缩弹簧驱动下左移&#xff0c;高压气体进入毛细管后进入右端活塞腔&#xff0c;另一方面&#xff0c;左端活塞腔的气体排…

Py之pydantic:pydantic的简介、安装、使用方法之详细攻略

Py之pydantic&#xff1a;pydantic的简介、安装、使用方法之详细攻略 目录 pydantic的简介 1、Pydantic V1.10 vs. V2 pydantic的安装 pydantic的使用方法 1、简单的示例 pydantic的简介 pydantic是使用Python类型提示进行数据验证。快速且可扩展&#xff0c;Pydantic与您…

从源码解析Kruise(K8S)原地升级原理

从源码解析Kruise原地升级原理 本文从源码的角度分析 Kruise 原地升级相关功能的实现。 本篇Kruise版本为v1.5.2。 Kruise项目地址: https://github.com/openkruise/kruise 更多云原生、K8S相关文章请点击【专栏】查看&#xff01; 原地升级的概念 当我们使用deployment等Wor…

【Node.js】介绍、下载及安装

目录 一、什么是 Node.js 二、Node.js下载 下载方式1&#xff1a;直接在首页下载&#xff08;下载的是.msi后缀的安装包&#xff09; 下载方式2&#xff1a;点击官网顶上的DOWNLOAD 三、Node.js安装 .zip后缀的安装步骤 .msi后缀的安装步骤 一、什么是 Node.js Node.js …

合金电阻器生产中的制造工艺和质量控制?

合金电阻器是电子电路功能不可或缺的一部分&#xff0c;经过细致的制造工艺和严格的质量控制措施&#xff0c;以确保其精度和可靠性。本文深入探讨了合金电阻器生产中采用的关键制造技术和实施的质量控制协议。 1.合金成分及选择&#xff1a; 制造过程从精心选择合金材料开始。…

Apache服务

目录 引言 一、常见的http服务程序 &#xff08;一&#xff09;lls &#xff08;二&#xff09;nginx &#xff08;三&#xff09;Apache &#xff08;四&#xff09;Tomcat 二、Apache特点 三、Apache服务的安装 &#xff08;一&#xff09;yum安装及配置文件 1.配置…

每日OJ题_二叉树dfs④_力扣98. 验证二叉搜索树

目录 力扣98. 验证二叉搜索树 解析代码 力扣98. 验证二叉搜索树 98. 验证二叉搜索树 难度 中等 给你一个二叉树的根节点 root &#xff0c;判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下&#xff1a; 节点的左子树只包含 小于 当前节点的数。节点的右子树…

利用eds editor生成CANOPEN 设备eds文件

使用CANopen EDS Editor生成CANOPEN设备的EDS文件是一个系统化的过程&#xff0c;它涉及将设备的具体技术参数和功能映射到CANopen规范定义的对象字典中。以下是一般步骤概览&#xff1a; 启动编辑器&#xff1a; 打开CANopen EDS Editor软件&#xff0c;通常可以通过桌面快捷方…

mac 安装H3C iNode + accessClient mac版

一、下载安装 官网下载地址 https://www.h3c.com/cn/Service/Document_Software/Software_Download/IP_Management/ 可以使用文末参考博文中的账号 yx800 密码 01230123登录下载 选择版本 下载 下载 H3C_iNode_PC_7.3_E0626.zip 文件后&#xff0c;解压下载到的PC端压缩包…