增加统一界面

This commit is contained in:
石沈昊 2022-06-12 17:07:52 +08:00
parent d036149216
commit 2aaf650f64
6 changed files with 310 additions and 0 deletions

View File

@ -0,0 +1 @@
from In_one.main import *

122
plugins/In_one/main.py Normal file
View File

@ -0,0 +1,122 @@
from asyncio.windows_events import NULL
import os
import pdb
from threading import Thread
import numpy as np
from rscder.gui.actions import ActionManager
from rscder.plugins.basic import BasicPlugin
from PyQt5.QtWidgets import QAction, QDialog, QHBoxLayout, QVBoxLayout, QPushButton,QWidget,QLabel,QLineEdit,QPushButton,QPixmap
from PyQt5.QtGui import QIcon,QPixmap
from PyQt5.QtCore import Qt
from rscder.gui.layercombox import RasterLayerCombox
from rscder.utils.icons import IconInstance
from rscder.utils.project import Project, RasterLayer, SingleBandRasterLayer
from threshold.otsu import OTSU
from osgeo import gdal
from plugins.In_one import pic
class LockerButton(QPushButton):
def __init__(self,parent=NULL):
super(LockerButton,self).__init__(parent)
m_imageLabel = QLabel
m_imageLabel.setFixedWidth(20)
m_imageLabel.setScaledContents(True)
m_imageLabel.setStyleSheet("QLabel{background-color:transparent;}")
m_textLabel = QLabel
m_textLabel.setStyleSheet("QLabel{background-color:transparent;}")
self.m_imageLabel=m_imageLabel
self.m_textLabel=m_textLabel
self.hide_=1
mainLayout = QHBoxLayout()
mainLayout.addWidget(self.m_imageLabel)
mainLayout.addWidget(self.m_textLabel)
mainLayout.setMargin(0)
mainLayout.setSpacing(0)
self.setLayout(mainLayout)
def SetImageLabel(self, pixmap:QPixmap):
self.m_imageLabel.setPixmap(pixmap)
def SetTextLabel(self, text):
self.m_textLabel.setText(text)
class AllInOne(QDialog):
def __init__(self, parent=None):
super(AllInOne, self).__init__(parent)
self.setWindowTitle('变化检测')
self.setWindowIcon(IconInstance().LOGO)
self.initUI()
def initUI(self):
#预处理
filterWeight=QWidget(self)
self.filerButton =LockerButton();
self.filerButton.setObjectName("LockerButton")
self.filerButton.SetTextLabel("大小")
self.filerButton.SetImageLabel(QPixmap('../pic/右箭头.png'))
self.filerButton.setStyleSheet("#LockerButton{background-color:transparent}"
"#LockerButton:hover{background-color:rgba(195,195,195,0.4)}")
self.layer_combox = RasterLayerCombox(self)
layer_label = QLabel('图层:')
hbox = QHBoxLayout()
hbox.addWidget(layer_label)
hbox.addWidget(self.layer_combox)
x_size_input = QLineEdit(self)
x_size_input.setText('3')
y_size_input = QLineEdit(self)
y_size_input.setText('3')
size_label = QLabel(self)
size_label.setText('窗口大小:')
time_label = QLabel(self)
time_label.setText('X')
self.x_size_input = x_size_input
self.y_size_input = y_size_input
hlayout1 = QHBoxLayout(self)
hlayout1.addWidget(size_label)
hlayout1.addWidget(x_size_input)
hlayout1.addWidget(time_label)
hlayout1.addWidget(y_size_input)
vlayout = QVBoxLayout(self)
vlayout.addWidget(self.filerButton)
vlayout.addLayout(hbox)
vlayout.addLayout(hlayout1)
filterWeight.setLayout(vlayout)
#变化检测
changeWeight=QWidget(self)
totalvlayout=QVBoxLayout()
totalvlayout.addWidget(filterWeight)
self.setLayout(totalvlayout)
self.filerButton.clicked.connect(lambda: self.hide(self.filerButton,filterWeight))
def hide(self,button:LockerButton,weight:QWidget):
if ((button.hide_)%2)==1:
weight.setVisible(False)
button.SetImageLabel(QPixmap('../pic/右箭头.png'))
else:
weight.setVisible(True)
button.SetImageLabel(QPixmap('../pic/下箭头.png'))
class InOnePlugin(BasicPlugin):
@staticmethod
def info():
return {
'name': 'AllinOne',
'description': 'AllinOne',
'author': 'RSCDER',
'version': '1.0.0',
}
def set_action(self):
basic_diff_method_in_one = QAction('inone差分法')
ActionManager().change_detection_menu.addAction(basic_diff_method_in_one)
self.basic_diff_method_in_one = basic_diff_method_in_one
basic_diff_method_in_one.triggered.connect(self.run)
def run(self):
pass

181
plugins/In_one/pic.py Normal file
View File

@ -0,0 +1,181 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.9)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x03\x9e\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x03\
\x58\x49\x44\x41\x54\x78\x5e\xed\xdd\x3b\x52\x1c\x41\x10\x84\xe1\
\xe1\xc0\x12\xb6\x4e\x20\x1b\xe9\xc2\x8a\x09\x62\x0d\x11\xc0\xce\
\xa3\x3b\x3b\xab\xf2\xc7\x91\xb3\x8a\xaa\xca\xfc\x68\xc9\x21\x78\
\xd9\xf8\x8a\x4e\xe0\x25\xfa\x7a\x8e\xdf\x00\x10\x8e\x00\x00\x00\
\x08\x4f\x20\xfc\x7c\x5e\x00\x00\x84\x27\x10\x7e\x3e\x2f\x00\x00\
\xc2\x13\x08\x3f\x9f\x17\x00\x00\xe1\x09\x84\x9f\xcf\x0b\x00\x80\
\xf0\x04\xc2\xcf\xe7\x05\x00\x40\x78\x02\xe1\xe7\xf3\x02\x00\x20\
\x3c\x81\xf0\xf3\x79\x01\x00\x10\x9e\x40\xf8\xf9\xbc\x00\x00\x08\
\x4f\x20\xfc\x7c\x5e\x00\x00\x84\x27\x10\x7e\x3e\x2f\x00\x00\xc2\
\x13\x08\x3f\x9f\x17\x00\x00\xe1\x09\x84\x9f\xcf\x0b\x00\x80\xf0\
\x04\xc2\xcf\xe7\x05\x00\x40\x78\x02\xe1\xe7\xf3\x02\x00\x20\x3c\
\x81\xf0\xf3\x79\x01\x00\x10\x9e\x40\xf8\xf9\xbc\x00\x00\x78\x9a\
\xc0\x8f\x6d\xdb\x7e\x3d\xfd\x14\x1f\x70\x4c\xe0\xf7\xb6\x6d\x7f\
\xbf\x5b\xec\xe8\x0b\xb0\x23\xf8\xe3\x78\x21\x3b\x7d\x99\xc0\xcf\
\x67\xe5\xef\x7f\xf3\x28\x80\xfd\xb3\x20\xa8\xa3\xed\x50\xf9\x67\
\x01\x80\xa0\x06\x80\xc3\xe5\x5f\x01\x00\x02\x6f\x04\xa7\xca\xbf\
\x0a\x00\x04\x9e\x08\x4e\x97\x7f\x07\x00\x08\xbc\x10\x5c\x2a\xff\
\x2e\x00\x10\x78\x20\xb8\x5c\xfe\x08\x00\x20\x58\x8b\xe0\x56\xf9\
\xa3\x00\x80\x60\x0d\x82\xdb\xe5\x8f\x04\x00\x02\x2d\x82\x21\xe5\
\x8f\x06\x00\x02\x0d\x82\x61\xe5\xcf\x00\x00\x82\xb9\x08\x86\x96\
\x3f\x0b\x00\x08\xe6\x20\x18\x5e\xfe\x4c\x00\x20\x18\x8b\x60\x4a\
\xf9\xb3\x01\x80\x60\x0c\x82\x69\xe5\x2b\x00\x80\xe0\x1e\x82\xa9\
\xe5\xab\x00\x80\xe0\x1a\x82\xe9\xe5\x2b\x01\x80\xe0\x1c\x02\x49\
\xf9\x6a\x00\x20\x38\x86\x40\x56\xfe\x0a\x00\x20\xf8\x1e\x81\xb4\
\xfc\x55\x00\x40\xf0\x39\x02\x79\xf9\x2b\x01\x80\xe0\x7f\x04\x4b\
\xca\x5f\x0d\x00\x04\xef\x08\x96\x95\xef\x00\x20\x1d\xc1\xd2\xf2\
\x5d\x00\x3c\xbe\x0b\xde\x8e\xfd\x27\xb9\xcd\xa7\x5e\x1d\x7e\xd6\
\xe2\xcc\xcf\x05\xcc\x4e\x7e\xff\x6e\x48\x41\x60\x51\xbe\xd3\x0b\
\xf0\xc0\x95\x80\xc0\xa6\x7c\x47\x00\xdd\xff\x39\xb0\x2a\xdf\x15\
\x40\x57\x04\x76\xe5\x3b\x03\xe8\x86\xc0\xb2\x7c\x77\x00\x5d\x10\
\xd8\x96\x5f\x01\x40\x75\x04\xd6\xe5\x57\x01\x50\x15\x81\x7d\xf9\
\x95\x00\x54\x43\x50\xa2\xfc\x6a\x00\xaa\x20\x28\x53\x7e\x45\x00\
\xee\x08\x4a\x95\x5f\x15\x80\x2b\x82\x72\xe5\x57\x06\xe0\x86\xa0\
\x64\xf9\xd5\x01\xb8\x20\x28\x5b\x7e\x07\x00\xab\x11\x94\x2e\xbf\
\x0b\x80\x55\x08\xca\x97\xdf\x09\x80\x1a\x41\x8b\xf2\xbb\x01\x50\
\x21\x68\x53\x7e\x47\x00\xb3\x11\xb4\x2a\xbf\x2b\x80\x59\x08\xda\
\x95\xdf\x19\xc0\x68\x04\x2d\xcb\xef\x0e\x60\x14\x82\xb6\xe5\x27\
\x00\xb8\x8b\xa0\x75\xf9\x29\x00\xae\x22\x68\x5f\x7e\x12\x80\xb3\
\x08\x22\xca\x4f\x03\x70\x14\x41\x4c\xf9\x89\x00\x9e\x21\x88\x2a\
\x3f\x15\xc0\x57\x08\xe2\xca\x4f\x06\xf0\x11\x41\x64\xf9\xe9\x00\
\x1e\x08\xf6\x3f\x63\x7f\x23\x9a\xd3\x4f\x07\xef\x45\xf0\x25\x4e\
\x00\x00\xe2\xc0\xdd\xc6\x01\xc0\xad\x11\xf1\x3e\x00\x10\x07\xee\
\x36\x0e\x00\x6e\x8d\x88\xf7\x01\x80\x38\x70\xb7\x71\x00\x70\x6b\
\x44\xbc\x0f\x00\xc4\x81\xbb\x8d\x03\x80\x5b\x23\xe2\x7d\x00\x20\
\x0e\xdc\x6d\x1c\x00\xdc\x1a\x11\xef\x03\x00\x71\xe0\x6e\xe3\x00\
\xe0\xd6\x88\x78\x1f\x00\x88\x03\x77\x1b\x07\x00\xb7\x46\xc4\xfb\
\x00\x40\x1c\xb8\xdb\x38\x00\xb8\x35\x22\xde\x07\x00\xe2\xc0\xdd\
\xc6\x01\xc0\xad\x11\xf1\x3e\x00\x10\x07\xee\x36\x0e\x00\x6e\x8d\
\x88\xf7\x01\x80\x38\x70\xb7\x71\x00\x70\x6b\x44\xbc\x0f\x00\xc4\
\x81\xbb\x8d\x03\x80\x5b\x23\xe2\x7d\x00\x20\x0e\xdc\x6d\x1c\x00\
\xdc\x1a\x11\xef\x03\x00\x71\xe0\x6e\xe3\x00\xe0\xd6\x88\x78\x1f\
\x00\x88\x03\x77\x1b\x07\x00\xb7\x46\xc4\xfb\x00\x40\x1c\xb8\xdb\
\x38\x00\xb8\x35\x22\xde\x07\x00\xe2\xc0\xdd\xc6\x01\xc0\xad\x11\
\xf1\x3e\x00\x10\x07\xee\x36\xee\x1f\xc5\x9b\x6f\x81\x82\xfb\xf4\
\x92\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x03\x98\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3\x3e\x61\xcb\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x03\
\x52\x49\x44\x41\x54\x78\x5e\xed\xdd\x51\x4e\xc3\x30\x10\x45\xd1\
\x61\x19\x2c\x12\x58\x06\xff\xb0\x47\xd6\x81\x02\x54\x15\xd0\xc6\
\x4e\x3c\xb6\x66\xe6\xdd\x7e\x87\x36\xf6\x3d\x38\x69\xd4\xb4\x0f\
\xc6\x43\x7a\x06\x1e\xa4\x47\xcf\xe0\x0d\x00\xe2\x08\x00\x00\x00\
\xf1\x19\x10\x1f\x3e\x2b\x00\x00\xc4\x67\x40\x7c\xf8\xac\x00\x00\
\x08\x37\x03\x4f\x66\xf6\x1e\x6e\xaf\x8a\xee\x50\xc4\x15\xe0\xc3\
\xcc\x5e\x41\xb0\x46\x5c\x54\x00\x8f\x66\xf6\x0c\x82\xf9\x08\x22\
\x03\xd8\x46\x0f\x82\xc9\x06\xa2\x03\x00\x01\x00\xbe\x66\x80\x95\
\x60\x12\x84\x0c\x2b\xc0\x65\xe8\x20\x98\x80\x20\x13\x00\x56\x02\
\x00\x70\x38\xf0\x36\x90\x6d\x05\xe0\x70\xe0\x2c\x20\x2b\x00\x0e\
\x07\x4e\x10\x32\x03\x00\x81\x03\x82\xec\x00\x40\x30\x88\xa0\x02\
\x00\x10\x0c\x20\xa8\x02\x00\x04\x27\x11\x54\x02\x00\x82\x13\x08\
\xaa\x01\x00\xc1\x41\x04\x15\x01\x80\xe0\x00\x82\xaa\x00\x40\xd0\
\x89\xa0\x32\x00\x10\x74\x20\xa8\x0e\x00\x04\x0d\x04\x0a\x00\x40\
\xb0\x83\x40\x05\x00\x08\xee\x20\x50\x02\x00\x82\x1b\x08\xd4\x00\
\x80\xe0\x0f\x02\x45\x00\xdb\x14\xbc\x98\xd9\x5b\xc7\x49\x72\xf9\
\x4d\x54\x01\x80\xe0\x87\xb6\x32\x00\x10\x98\x85\xfc\x86\x90\xed\
\xd6\xb0\xed\xce\xa0\x55\x0f\xe9\xc3\x81\xfa\x0a\x70\x41\x26\x8b\
\x00\x00\xd7\x75\x46\x12\x01\x00\x7e\x1f\x68\xe4\x10\x00\xe0\xff\
\x99\x86\x14\x02\x00\xdc\x3e\xd5\x94\x41\x00\x80\xfb\xef\x35\x24\
\x10\x00\x60\xff\xcd\x66\x79\x04\x00\x68\x5f\x6d\x28\x8d\x00\x00\
\x6d\x00\xa5\xaf\x18\x02\xa0\x0f\x40\x59\x04\x00\xe8\x07\x50\x12\
\x01\x00\x8e\x01\x28\x87\x00\x00\xc7\x01\x94\x42\x00\x80\x73\x00\
\xca\x20\x00\xc0\x79\x00\x25\x10\x00\x60\x0c\x40\x7a\x04\x00\x18\
\x07\x90\x1a\x01\x00\x7c\x00\xa4\x45\x00\x00\x3f\x00\x29\x11\x00\
\xc0\x17\x40\x3a\x04\x00\xf0\x07\x90\x0a\x01\x00\xe6\x00\x48\x83\
\x00\x00\xf3\x00\xa4\x40\x00\x80\xb9\x00\xc2\x23\x00\xc0\x7c\x00\
\xa1\x11\x00\x60\x0d\x80\xb0\x08\x00\xb0\x0e\x40\x48\x04\x00\x00\
\xc0\xda\x19\xe8\x78\xb5\xd5\x37\x87\x76\xec\x92\xcb\x26\x21\x3f\
\x5c\xca\x0a\xe0\xd2\xb6\xf9\x24\x21\xe3\x6f\x7b\x0d\x80\x66\xbb\
\xe1\x0d\xc2\xc6\x07\xc0\x70\xdb\xe6\x13\x84\x8e\x0f\x80\x66\xbf\
\xa1\x0d\xc2\xc7\x07\xc0\x50\xdf\xdd\x3f\x4e\x11\x1f\x00\x73\x00\
\xa4\x89\x0f\x00\x7f\x00\xa9\xe2\x03\xc0\x17\x40\xba\xf8\x00\xf0\
\x03\x90\x32\x3e\x00\x7c\x00\xa4\x8d\x0f\x80\x71\x00\xa9\xe3\x03\
\x60\x0c\x40\xfa\xf8\x00\x38\x0f\xa0\x44\x7c\x00\x9c\x03\x50\x26\
\x3e\x00\x8e\x03\x28\x15\x1f\x00\xc7\x00\x94\x8b\x0f\x80\x7e\x00\
\x25\xe3\x03\xa0\x0f\x40\xd9\xf8\x00\x68\x03\x28\x1d\x1f\x00\xfb\
\x00\xca\xc7\x07\xc0\x7d\x00\x12\xf1\x01\x70\x1b\x80\x4c\x7c\x00\
\xfc\x07\x20\x15\x1f\x00\xbf\x01\xc8\xc5\x07\xc0\x15\x80\x64\x7c\
\x00\x7c\x03\x90\x8d\x0f\x00\xf1\xf8\xea\x00\xa4\xff\xf3\x2f\x47\
\x3f\xd5\x5b\xc3\x88\xff\x23\x40\x11\xc0\xb3\x99\xbd\xb7\xaf\x02\
\x6b\x6c\xa1\x06\x80\xf8\x7f\x5c\x2b\x01\x20\xfe\x8d\x45\x4d\x05\
\x00\xf1\xef\x1c\xd1\x14\x00\x10\x7f\xe7\x74\xa6\x3a\x00\xe2\x37\
\xce\x65\x2b\x03\x20\x7e\xc7\x1b\x99\xaa\x00\x88\xdf\x11\xbf\xea\
\x95\x40\xe2\x77\xc6\xaf\x08\x80\xf8\x07\xe2\x57\x03\x40\xfc\x83\
\xf1\x2b\x01\x20\xfe\x89\xf8\x55\x00\x10\xff\x64\xfc\x0a\x00\x88\
\x3f\x10\x3f\x3b\x00\xe2\x0f\xc6\xcf\x0c\x80\xf8\x0e\xf1\xb3\x02\
\x20\xbe\x53\xfc\x8c\x00\x88\xef\x18\x3f\x1b\x00\xe2\x3b\xc7\xcf\
\x04\x80\xf8\x13\xe2\x67\x01\x40\xfc\x49\xf1\x33\x00\x20\xfe\xc4\
\xf8\xd1\x01\x10\x7f\x72\xfc\xc8\x00\x5e\xf9\xe8\xf6\x82\xfa\x41\
\x7f\x33\xe8\x89\xf8\x6b\xe2\x47\x5d\x01\xd6\x8d\x9e\x57\x0a\xf9\
\xab\x61\x64\x59\x38\x03\x11\x3f\x13\xb8\x70\xf8\xbc\x14\x00\xc4\
\x0d\x00\x00\x00\xe2\x33\x20\x3e\x7c\x56\x00\x00\x88\xcf\x80\xf8\
\xf0\x3f\x01\x47\x74\xde\x81\x49\xac\x8e\xa9\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x03\
\x00\x00\x76\xf3\
\x00\x70\
\x00\x69\x00\x63\
\x00\x07\
\x0f\x07\xfb\x67\
\x4e\x0b\
\x7b\xad\x59\x34\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x07\
\x07\x07\xef\x47\
\x53\xf3\
\x7b\xad\x59\x34\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\
\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\
\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\
\x00\x00\x01\x81\x56\x1e\xac\xc9\
\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x81\x56\x1e\xbb\xa5\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

6
plugins/In_one/pic.qrc Normal file
View File

@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/">
<file>pic/下箭头.png</file>
<file>pic/右箭头.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 920 B