In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Qt how to realize map monitoring". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian to study and learn "Qt how to realize map monitoring" together.
I. Foreword
Map monitoring mainly provides a map (It can be flat or three-dimensional color. It is generally recommended to have a bird's eye view with a 3D sense). Then, on the corresponding map, the equipment can switch maps to view the equipment in the corresponding area. Generally speaking, there will be a map file in an area. The equipment will display the currently collected values on the map in real time, and there will also be corresponding units. If an alarm occurs, the corresponding map will automatically switch to the front display. The equipment will blink and sound an alarm. Double-click the corresponding device point can also control the device back, such as parameter settings.
Similar functional requirements will be used in many systems, such as security, environmental monitoring, temperature and humidity monitoring, etc. Here is a small experience. In the past, this function was implemented by first putting the device point custom control into a container widget, and then adding a label control to display the map. Later, it was found that the controls in Qt, as long as they inherited from the widget, were containers. You only need to set the parent class to label when instantiating the device point custom control. Unlike. NET, where containers are containers, labels cannot be containers. This feature allows complex combos to be implemented very cleverly, such as text boxes added to buttons, or search icons to the right of search boxes that can be placed directly into a button.
The universal button map control is open source, and the renderings are as follows:
II. Functional characteristics
Collection data port, serial port + network port, serial port support free setting serial port number + baud rate, network support free setting IP address + communication port, each port support collection cycle, default 1 second address, support setting communication timeout times, default 3 times, support maximum reconnect time, used to re-read offline equipment.
Controller information, can add controller name, select controller address + controller model, set the number of detectors under the controller.
Detector information, can add digit number, can freely select detector model, gas type, gas symbol, high report value, low report value, buffer value, zero value, whether to enable, alarm sound, background map, storage cycle, decimal places of numerical conversion, alarm delay time, alarm type (HH,LL,HL), etc.
Controller model + detector model + gas type + gas symbol, can be freely configured.
Map support import and delete, all detectors corresponding to the map position can be freely dragged to save.
Port information + controller information + detector information, import/export + export to excel+ print supported.
Run record + alarm record + user record, support multi-condition combination query, such as time period + controller + detector, etc., all records support export to excel+ print.
Records exported to excel support all excel+wps and other form file versions, independent of excel and other software.
Delete data within a specified time range, support automatic cleaning of early data, and set the maximum number of saved records.
Support alarm SMS forwarding, support multiple receiving mobile phone numbers, can set the sending interval, such as instant sending or sending all alarm messages once every 6 hours, SMS content is too long, automatically split multiple SMS.
Support alarm mail forwarding, support multiple receiving mailboxes, can set the sending interval, such as instant sending or sending all alarm messages once every 6 hours, support attachment sending.
High report color + low report color + normal color +0 value color + curve background + curve color, etc., can be freely selected.
The Chinese title + English title +logo path + copyright of the software can be freely set.
Provide switch settings boot operation + alarm sound + automatic login + remember password, etc.
Alarm sound can be set to play times, interface provides 17 kinds of skin file selection.
Support cloud data synchronization, you can set cloud database information, such as database name, username + password, etc.
Support network forwarding and network reception. After network reception is enabled, the software receives data from udp for parsing. Network forwarding supports multiple target IPs, which enables local collection software to freely transfer data to clients and view detector data at any time.
Automatically remember the interface where the user last stayed + other information, and automatically apply it after restarting.
Alarm automatically switches to corresponding map, detector button flashes.
Double-click the detector icon to perform a rollback.
Support user rights management, administrator + operator two categories, user login + user exit, you can remember the password and automatic login, more than three times error prompt and close the program.
Support four monitoring modes, equipment panel monitoring + map monitoring + table data monitoring + curve data monitoring, free switching, four synchronous applications.
Support alarm relay linkage, one bit number can link multiple modules and relay numbers across serial ports, support many-to-many.
Local data storage supports sqlite+mysql, remote data synchronization to cloud database. Automatic reconnection.
The data collected by local devices is uploaded to the cloud in real time for extraction by other means such as mobile APP or web.
Support two data sources, one is serial port and network through the protocol to collect device data, one is database collection. Database acquisition mode can be used as a general purpose system.
Comes with device simulation tool, supports 16 device data simulation, and also comes with database data simulation to test data when there is no device.
The default communication protocol adopts modbus protocol, and later adds support for Internet of Things protocols such as mqtt to make it a universal system.
Support all windows operating systems +linux operating systems and other operating systems.
III. Effect Drawing
void DeviceHelper::initDeviceMap(QListWidget *listWidget){ listWidget->clear(); listWidget->setViewMode(QListView::IconMode); listWidget->setResizeMode(QListView::Adjust); listWidget->setMovement(QListView::Static); listWidget->setIconSize(QSize(App::RightWidth - 20, App::RightWidth - 20)); int count = DBData::MapNames.count(); for (int i = 0; i
< count; i++) { QString imageName = DBData::MapNames.at(i); QPixmap pix = DeviceMap::Instance()->getMapPix(imageName); //Take the first character + the last character of the file name QString itemName = imageName; if (imageName.length() > 18) { itemName = QString("%1...% 2").arg(imageName.left(8)).arg(imageName.right(10)); } QListWidgetItem *listItem = new QListWidgetItem(listWidget, i); listItem->setIcon(QIcon(pix)); listItem->setText(itemName); listItem->setData(Qt::UserRole, imageName); listItem->setTextAlignment(Qt::AlignCenter); }}void DeviceHelper::initDeviceMapCurrent(const QString &imgName){ if (labMap == NULL) { return; } initDeviceMapCurrent(labMap, imgName);}void DeviceHelper::initDeviceMapCurrent(QLabel *label, const QString &imgName){ App::CurrentImage = imgName; label->setProperty("image", imgName); //Take images with defense lines first QString mapName = "normal_" + imgName; if (DeviceMap::Instance()->existMapPix(mapName)) { label->setPixmap(DeviceMap::Instance()->getMapPix(mapName)); } else { label->setPixmap(DeviceMap::Instance()->getMapPix(imgName)); } QList btns = label->findChildren(); foreach (ButtonDefence *btn, btns) { btn->setVisible(btn->property("nodeImage").toString() == imgName); }} Thank you for reading, the above is the content of "Qt how to achieve map monitoring", after the study of this article, I believe that everyone has a deeper understanding of how to achieve map monitoring Qt, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.