当前位置: 首页 > news >正文

申请免费的网站优化公司哪家好

申请免费的网站,优化公司哪家好,类似火脉的推广平台,中建八局第二建设有限公司平台文章目录 一.前言二.预览三.软件开发心得1.使用方法2.UI设计3.代码架构4.项目结构 四.代码片段分享1.图片平滑缩放组件2.滚动日志组件 五.心得体会 大小:35.0 M,软件安装包放在了这里! 本软件未…

文章目录

  • 一.前言
  • 二.预览
  • 三.软件开发心得
    • 1.使用方法
    • 2.UI设计
    • 3.代码架构
    • 4.项目结构
  • 四.代码片段分享
    • 1.图片平滑缩放组件
    • 2.滚动日志组件
  • 五.心得体会


大小:35.0 M,软件安装包放在了这里!
本软件未使用web相关技术,无嵌套浏览器!

一.前言

今天又来和大家分享我开发的PyQt5大屏可视化方案了,本次和大家分享一款XX产业大数据指挥舱可视化方案。

二.预览

下面我将截图展示一下本次系统的主要功能
本次软件只有一屏,下面截图为软件主界面
在这里插入图片描述

三.软件开发心得

1.使用方法

双击安装包,点下一步进行安装,双击打开软件即可进入软件主界面,软件默认是全屏的,大家可以按下ESC退出。

在这里插入图片描述

2.UI设计

本次UI采用图片+文字的方式,软件整体布局为垂直布局,内部为水平布局,通过将主体内容占比增大的方式凸出主体内容,通过绘制组件实现了组件的重写,主屏增加了盘旋的无人机,增加了软件的灵巧性,软件内部有多个模块:病虫害预警、统计数据、硬件设备、灌溉数据、日志模块…每一部分都是单独设计的,简而言之就是每个模块都可以单独调试,避免了整体测试的时间浪费。软件整体颜色采用深色背景、亮色文字的方案,更直观地凸出主体。本次软件实现为代码实现,无设计师,请读者不要和笔者询问.ui文件。

3.代码架构

源代码文件夹包含多个.py文件,每个文件的互相调用逻辑见下图

在这里插入图片描述

4.项目结构

以下为本项目的代码结构,主要源代码在src目录下,目录下分资源、配置、组件包。
在这里插入图片描述

四.代码片段分享

1.图片平滑缩放组件

软开主屏中的“太阳”就是这个组件实现的

class ImageResizerLabel(QLabel):def __init__(self, parent=None):super().__init__(parent)# Initialize scaling factors and original imageself.original_pixmap = None# Set the fixed minimum size of the label (75x75)self.min_size = 75self.max_size = 90# Set up a timer for smooth scaling effectself.timer = QTimer(self)self.timer.timeout.connect(self.resize_image)self.timer.start(30)  # 30ms interval for smooth transition# Initial fixed size for the label (75x75)self.setFixedSize(self.min_size, self.min_size)# Initialize scale factor and flagself.current_size = self.min_sizeself.scaling_up = Truedef load_image(self, image_path):"""Load an image into the label"""self.original_pixmap = QPixmap(image_path)if self.original_pixmap:self.update_image_size()  # Ensure image is resized to fit label sizedef update_image(self, image_path):"""Update the image data (called externally to update the image)"""if self.original_pixmap:self.original_pixmap = QPixmap(image_path)self.current_size = self.min_size  # Reset to the minimum sizeself.scaling_up = True  # Start scaling up againself.update_image_size()  # Update the image size after the updatedef resize_image(self):"""Resize the image smoothly"""if self.original_pixmap:if self.scaling_up:self.current_size += 0.5  # Increase size gradually (0.5 units per step)if self.current_size >= self.max_size:  # Reached the max size (100)self.scaling_up = False  # Start scaling downelse:self.current_size -= 0.5  # Decrease size gradually (0.5 units per step)if self.current_size <= self.min_size:  # Back to the original size (75)self.scaling_up = True  # Start scaling up# Adjust the label size to match the current sizeself.setFixedSize(self.current_size, self.current_size)# Scale the image to fit the label sizescaled_pixmap = self.original_pixmap.scaled(self.current_size, self.current_size, Qt.KeepAspectRatio, Qt.SmoothTransformation)# Update the pixmapself.setPixmap(scaled_pixmap)def update_image_size(self):"""Update the size of the label based on the image size"""if self.original_pixmap:# Adjust the size of the image while maintaining aspect ratioscaled_pixmap = self.original_pixmap.scaled(self.current_size, self.current_size, Qt.KeepAspectRatio, Qt.SmoothTransformation)self.setPixmap(scaled_pixmap)def resizeEvent(self, event):"""Handle window resize events to resize the image proportionally"""self.update_image_size()  # Update the image size whenever the widget is resizedsuper().resizeEvent(event)  # Call the base class method to handle the default behavior

2.滚动日志组件

这个组件用于滚动显示日志

class ScrollingMessageWidget(QWidget):def __init__(self, parent=None, messages=[]):super().__init__(parent)self.messages = messages  # 初始化中奖信息列表self.message_labels = []  # 保存所有 QLabelself.current_offset = 0  # 当前滚动偏移量self.init_ui()self.start_scrolling()def init_ui(self):"""初始化UI组件"""# 窗口设置self.setStyleSheet("background-color: transparent;")# 垂直布局self.layout = QVBoxLayout(self)self.layout.setSpacing(0)self.layout.setContentsMargins(0, 0, 0, 0)# 设置字体样式font = QFont("Arial", 7, QFont.Bold)font.setBold(True)# 创建 QLabel 并添加到布局中self.create_labels(font)def create_labels(self, font):"""根据当前消息列表创建 QLabel"""# 清空原有标签for label in self.message_labels:self.layout.removeWidget(label)label.deleteLater()self.message_labels.clear()# 创建新的标签for message in self.messages:label = QLabel(message, self)label.setAlignment(Qt.AlignCenter)label.setFont(font)label.setStyleSheet("color: rgb(201,206,211);")self.layout.addWidget(label)self.message_labels.append(label)# 首尾相接:复制消息以实现循环效果for message in self.messages:label = QLabel(message, self)label.setAlignment(Qt.AlignCenter)label.setFont(font)label.setStyleSheet("color: rgb(201,206,211);")self.layout.addWidget(label)self.message_labels.append(label)def start_scrolling(self):"""启动滚动定时器"""self.timer = QTimer(self)self.timer.timeout.connect(self.scroll)self.timer.start(10)  # 每 5 毫秒更新一次def scroll(self):"""滚动消息"""# 滚动偏移量递增self.current_offset += 1# 检查是否需要重置偏移量if self.current_offset >= self.message_labels[0].height():self.current_offset = 0# 将第一个 QLabel 移动到最后label = self.message_labels.pop(0)self.layout.removeWidget(label)self.layout.addWidget(label)self.message_labels.append(label)# 更新每个 QLabel 的位置for i, label in enumerate(self.message_labels):label.move(0, (i - 1) * label.height() - self.current_offset)def update_messages(self, new_messages):"""更新中奖信息并刷新显示:param new_messages: 新的中奖信息列表"""self.messages = new_messagesself.current_offset = 0  # 重置滚动偏移量self.create_labels(QFont("微软雅黑", 7, QFont.Bold))  # 重新创建标签

五.心得体会

本次和大家分享了我的大屏可视化方案,软件完全是使用PyQt5实现的,与大家分享了我的软件开发心得与软件代码项目结构还有我的代码片段,希望大家亲自下载体验一下软件,更希望得到大家的反馈!

在这里插入图片描述

http://www.mnyf.cn/news/37982.html

相关文章:

  • php做网站百度推广怎么操作
  • 网站运营这么做网络营销的应用
  • 2016手机网站制作规范网络运营培训班
  • wordpress 添加幻灯片seo的中文含义
  • 企业微信网站怎么做手机百度下载
  • 网站建设简介是什么意思百度推广后台登录页面
  • 建设网站域名备案查询网络营销策略内容
  • 响应式网站设计的优点网站收录优化
  • 自己做电视视频网站百度指数怎么分析
  • 网站开发图片压缩沈阳百度快照优化公司
  • 网站目录做二级域名跨境电商靠谱吗
  • 小程序可以做企业网站seo赚钱
  • 台州网页设计招聘搜索引擎营销优化诊断训练
  • 网站建设中的图片网络营销渠道可分为
  • 哪里做网站排名优化网站找哪家
  • 东莞seo排名优化公司seoul什么意思
  • 程序员做笔记的网站怎么做推广和宣传平台
  • 钟祥网站制作手机优化专家下载
  • 外贸做的亚马逊网站是哪个如何利用seo赚钱
  • 广州市品牌网站建设公司网站制作出名的公司
  • 网站换域名要怎么做长沙排名优化公司
  • 营销型网站的建设步骤长春免费网上推广
  • 做网站那家比较好青岛官网seo方法
  • 海南爱心扶贫网站是哪个公司做的包括哪些内容
  • 昆明公司网站建设长沙seo
  • 做漫画网站空间多大老鬼seo
  • 做网站用什么配置笔记本上海职业技能培训机构一览表
  • 张店政府网站建设托管简述获得友情链接的途径
  • 网站ip域名查询2022年可以打开的网址
  • 自己做民宿在什么网站上投放武汉网站推广很 棒