merge plugin in rscder
This commit is contained in:
parent
fde841c037
commit
bf7f7f0bca
@ -1,68 +1,96 @@
|
||||
import sys
|
||||
import time
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QFont, QPixmap
|
||||
from PyQt5.QtWidgets import QSplashScreen, QProgressBar, QStyleFactory, QMessageBox
|
||||
from qgis.core import QgsApplication
|
||||
# from qgis.core import
|
||||
from rscder.gui.mainwindow import MainWindow
|
||||
import multiprocessing
|
||||
from rscder.gui import license
|
||||
from rscder.utils.setting import Settings
|
||||
import os
|
||||
BASE_DIR = os.environ['ECD_BASEDIR']
|
||||
class MulStart:
|
||||
|
||||
def __init__(self, **kargs) -> None:
|
||||
super(MulStart, self).__init__()
|
||||
self.kargs = kargs
|
||||
def run(self):
|
||||
|
||||
QgsApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
||||
QgsApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
|
||||
QgsApplication.setOrganizationName("西安理工大学-ImgSciGroup")
|
||||
QgsApplication.setApplicationName("Easy Change Detection")
|
||||
QgsApplication.setApplicationVersion("v0.0.1")
|
||||
QgsApplication.setFont(QFont("Segoe UI", 10))
|
||||
QgsApplication.setStyle(QStyleFactory.create("Fusion"))
|
||||
|
||||
|
||||
# pyrcc5 res.qrc -o rc.py
|
||||
# import rscder.rc
|
||||
|
||||
app = QgsApplication([], True)
|
||||
QgsApplication.initQgis()
|
||||
while not Settings.General().license:
|
||||
QMessageBox.warning(None, "Warning", "Please select a license file.")
|
||||
if(license.License().exec_() == license.License.Accepted):
|
||||
continue
|
||||
else:
|
||||
sys.exit(0)
|
||||
# Create and display the splash screen
|
||||
splash_pix = QPixmap(os.path.join(BASE_DIR, "./icons/splash.png"))
|
||||
# splash_pix.scaledToWidth(800)
|
||||
# splash_pix.scaledToHeight(600)
|
||||
|
||||
splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
|
||||
# splash
|
||||
# splash.setFixedSize(800, 600)
|
||||
progressBar = QProgressBar(splash)
|
||||
progressBar.setMaximum(10)
|
||||
progressBar.setTextVisible(False)
|
||||
progressBar.setGeometry(106, splash_pix.height() - 60, splash_pix.width()-212, 10)
|
||||
|
||||
splash.show()
|
||||
for i in range(1, 11):
|
||||
progressBar.setValue(i)
|
||||
t = time.time()
|
||||
while time.time() < t + 0.05:
|
||||
app.processEvents()
|
||||
|
||||
ex = MainWindow(**self.kargs)
|
||||
# ex.canvas.load_image(r'data\100001678.jpg')
|
||||
# ex.canvas.load_result_from_txt(r'data\100001678.txt')
|
||||
# ex.showMaximized()
|
||||
ex.show()
|
||||
splash.finish(ex)
|
||||
sys.exit(app.exec_())
|
||||
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
import logging
|
||||
import pprint
|
||||
|
||||
def format_now():
|
||||
return datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S')
|
||||
os.environ['ECD_BASEDIR'] = os.path.join( os.path.dirname(__file__))
|
||||
if os.path.exists(os.path.join(os.path.dirname(__file__), 'share')):
|
||||
os.environ['PROJ_LIB'] = os.path.join(os.path.dirname(__file__), 'share/proj')
|
||||
os.environ['GDAL_DATA'] = os.path.join(os.path.dirname(__file__), 'share')
|
||||
|
||||
BASE_DIR = os.path.join( os.path.dirname(__file__))
|
||||
os.makedirs(os.path.join(BASE_DIR, 'logs'), exist_ok=True)
|
||||
|
||||
logging.basicConfig(level=logging.INFO, filename=os.path.join(BASE_DIR, 'logs', format_now() + '_log.txt'), filemode='a', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
logging.info('sys path :' + pprint.pformat(sys.path))
|
||||
logging.info('os.environ :' + pprint.pformat(os.environ))
|
||||
|
||||
import time
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtGui import QFont, QPixmap
|
||||
from PyQt5.QtWidgets import QSplashScreen, QProgressBar, QStyleFactory, QMessageBox
|
||||
from qgis.core import QgsApplication
|
||||
# from qgis.core import
|
||||
from rscder.gui.mainwindow import MainWindow
|
||||
from rscder.gui import license
|
||||
from rscder.utils.setting import Settings
|
||||
import os
|
||||
|
||||
class MulStart:
|
||||
|
||||
def __init__(self, **kargs) -> None:
|
||||
super(MulStart, self).__init__()
|
||||
self.kargs = kargs
|
||||
def run(self):
|
||||
app = QgsApplication([], True)
|
||||
QgsApplication.setPrefixPath('qgis', True)
|
||||
QgsApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
|
||||
QgsApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
|
||||
QgsApplication.setOrganizationName("ImgSciGroup")
|
||||
QgsApplication.setApplicationName("Easy Change Detection")
|
||||
QgsApplication.setApplicationVersion("v0.0.1")
|
||||
QgsApplication.setFont(QFont("Segoe UI", 10))
|
||||
QgsApplication.setStyle(QStyleFactory.create("Fusion"))
|
||||
|
||||
|
||||
# pyrcc5 res.qrc -o rc.py
|
||||
# import rscder.rc
|
||||
|
||||
|
||||
QgsApplication.initQgis()
|
||||
while not Settings.General().license:
|
||||
QMessageBox.warning(None, "Warning", "Please select a license file.")
|
||||
if(license.License().exec_() == license.License.Accepted):
|
||||
continue
|
||||
else:
|
||||
sys.exit(0)
|
||||
# Create and display the splash screen
|
||||
splash_pix = QPixmap(os.path.join(BASE_DIR, "./icons/splash.png"))
|
||||
# splash_pix.scaledToWidth(800)
|
||||
# splash_pix.scaledToHeight(600)
|
||||
|
||||
splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
|
||||
# splash
|
||||
# splash.setFixedSize(800, 600)
|
||||
progressBar = QProgressBar(splash)
|
||||
progressBar.setMaximum(10)
|
||||
progressBar.setTextVisible(False)
|
||||
progressBar.setGeometry(106, splash_pix.height() - 60, splash_pix.width()-212, 10)
|
||||
|
||||
splash.show()
|
||||
for i in range(1, 11):
|
||||
progressBar.setValue(i)
|
||||
t = time.time()
|
||||
while time.time() < t + 0.05:
|
||||
app.processEvents()
|
||||
|
||||
ex = MainWindow(**self.kargs)
|
||||
# ex.canvas.load_image(r'data\100001678.jpg')
|
||||
# ex.canvas.load_result_from_txt(r'data\100001678.txt')
|
||||
# ex.showMaximized()
|
||||
ex.show()
|
||||
splash.finish(ex)
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
def main():
|
||||
# print(sys.path)
|
||||
t = MulStart()
|
||||
t.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
main()
|
@ -1,19 +1,19 @@
|
||||
import os
|
||||
|
||||
# os.environ['PROJ_LIB'] = os.path.join(os.path.dirname(__file__), 'share/proj')
|
||||
# os.environ['GDAL_DATA'] = os.path.join(os.path.dirname(__file__), 'share')
|
||||
os.environ['ECD_BASEDIR'] = os.path.join( os.path.dirname(__file__), '..')
|
||||
BASE_DIR = os.path.join( os.path.dirname(__file__), '..')
|
||||
|
||||
from rscder.gui.keygen import LicenseGen
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
import sys
|
||||
|
||||
def main():
|
||||
app =QApplication(sys.argv)
|
||||
license = LicenseGen()
|
||||
license.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
if __name__ == "__main__":
|
||||
import os
|
||||
|
||||
# os.environ['PROJ_LIB'] = os.path.join(os.path.dirname(__file__), 'share/proj')
|
||||
# os.environ['GDAL_DATA'] = os.path.join(os.path.dirname(__file__), 'share')
|
||||
os.environ['ECD_BASEDIR'] = os.path.join( os.path.dirname(__file__))
|
||||
BASE_DIR = os.path.join( os.path.dirname(__file__))
|
||||
|
||||
from rscder.gui.keygen import LicenseGen
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
import sys
|
||||
|
||||
def main():
|
||||
app =QApplication(sys.argv)
|
||||
license = LicenseGen()
|
||||
license.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
1
lic/license.lic
Normal file
1
lic/license.lic
Normal file
@ -0,0 +1 @@
|
||||
U2cvLo/waByK0JLEzMsbuevhDgvFdw9E2wATS9YnC1NrtbmcSH9Rb3F2Bn5G8D8AruY/+S4tf+Lj5PRRyUXubyM2e6erbEYW7HnA9BZljgLMHnmrxpiW1woR6OEWzhJH6Y6GILPn7S0esv4oO3JjRyDRYXecz/lw58wkdZbHktpNVKfjoe827/aKa7gmYNXO
|
@ -1,5 +0,0 @@
|
||||
2023-03-25 11:00:10,230 - root - INFO - lic data:2033-01-01 00:00:00
|
||||
2023-03-25 11:00:10,230 - root - INFO - remain_days: 3569
|
||||
2023-03-25 11:00:11,182 - root - INFO - lic data:2033-01-01 00:00:00
|
||||
2023-03-25 11:00:11,182 - root - INFO - remain_days: 3569
|
||||
2023-03-25 11:00:30,172 - root - INFO - nothing
|
@ -1,4 +0,0 @@
|
||||
2023-03-25 11:02:32,812 - root - INFO - lic data:2033-01-01 00:00:00
|
||||
2023-03-25 11:02:32,812 - root - INFO - remain_days: 3569
|
||||
2023-03-25 11:02:33,761 - root - INFO - lic data:2033-01-01 00:00:00
|
||||
2023-03-25 11:02:33,761 - root - INFO - remain_days: 3569
|
@ -1 +0,0 @@
|
||||
from about.main import *
|
@ -1 +0,0 @@
|
||||
from change_rate.main import *
|
@ -1 +0,0 @@
|
||||
from evaluation.main import *
|
@ -1 +0,0 @@
|
||||
from export_to.main import *
|
@ -1,5 +0,0 @@
|
||||
from misc import Register
|
||||
|
||||
FOLLOW = Register('流程')
|
||||
|
||||
from follow.main import *
|
@ -1,63 +0,0 @@
|
||||
- author: RSCDER
|
||||
description: "\u5173\u4E8E"
|
||||
enabled: true
|
||||
module: about
|
||||
name: "\u5173\u4E8E"
|
||||
path: ./plugin\about
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: ExportTo
|
||||
enabled: true
|
||||
module: export_to
|
||||
name: ExportTo
|
||||
path: ./plugin\export_to
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: FilterCollection
|
||||
enabled: true
|
||||
module: filter_collection
|
||||
name: FilterCollection
|
||||
path: ./plugin\filter_collection
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: Evaluation
|
||||
enabled: true
|
||||
module: evaluation
|
||||
name: Evaluation
|
||||
path: ./plugin\evaluation
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: UnsupervisedPlugin
|
||||
enabled: true
|
||||
module: unsupervised_method
|
||||
name: UnsupervisedPlugin
|
||||
path: ./plugin\unsupervsied_method
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: VegatationPlugin
|
||||
enabled: true
|
||||
module: veg_method
|
||||
name: VegatationPlugin
|
||||
path: ./plugin\veg_method
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: set Change Rate
|
||||
enabled: true
|
||||
module: change_rate
|
||||
name: set_change_rate
|
||||
path: ./plugin\change_rate
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: Follow box
|
||||
enabled: true
|
||||
module: follow
|
||||
name: FollowPlugin
|
||||
path: ./plugin\follow
|
||||
version: 1.0.0
|
||||
- author: RSCDER
|
||||
description: AI CD
|
||||
enabled: true
|
||||
module: ai_method
|
||||
name: AIPlugin
|
||||
path: ./plugin\ai_method
|
||||
version: 1.0.0
|
@ -1,5 +0,0 @@
|
||||
from misc import Register
|
||||
|
||||
THRES = Register('阈值方法')
|
||||
|
||||
from thres.main import *
|
@ -1 +0,0 @@
|
||||
from unsupervised_method.main import *
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
from veg_method.main import *
|
236
result.txt
236
result.txt
@ -1,118 +1,118 @@
|
||||
x,y,diff,status
|
||||
234053.9937022142,3530980.0747939292,80.47999999999999,1
|
||||
234153.9937022142,3530980.0747939292,76.88000000000001,1
|
||||
234253.9937022142,3530980.0747939292,77.83,1
|
||||
234353.9937022142,3530980.0747939292,81.65,1
|
||||
234453.9937022142,3530980.0747939292,84.71,1
|
||||
234553.9937022142,3530980.0747939292,79.03999999999999,1
|
||||
234653.9937022142,3530980.0747939292,74.18,1
|
||||
234753.9937022142,3530980.0747939292,76.0,1
|
||||
234853.9937022142,3530980.0747939292,85.37,1
|
||||
234953.9937022142,3530980.0747939292,73.00999999999999,1
|
||||
235053.9937022142,3530980.0747939292,52.32,1
|
||||
235153.9937022142,3530980.0747939292,86.32,1
|
||||
235253.9937022142,3530980.0747939292,84.875,1
|
||||
234053.9937022142,3530880.0747939292,79.83,1
|
||||
234153.9937022142,3530880.0747939292,84.71,1
|
||||
234253.9937022142,3530880.0747939292,78.86999999999999,1
|
||||
234353.9937022142,3530880.0747939292,79.36999999999999,1
|
||||
234453.9937022142,3530880.0747939292,80.62,1
|
||||
234553.9937022142,3530880.0747939292,81.55,1
|
||||
234653.9937022142,3530880.0747939292,73.83,1
|
||||
234753.9937022142,3530880.0747939292,78.67,1
|
||||
234853.9937022142,3530880.0747939292,71.81,1
|
||||
234953.9937022142,3530880.0747939292,75.89,1
|
||||
235053.9937022142,3530880.0747939292,59.660000000000004,1
|
||||
235153.9937022142,3530880.0747939292,80.33,1
|
||||
235253.9937022142,3530880.0747939292,82.5,1
|
||||
234053.9937022142,3530780.0747939292,80.27,1
|
||||
234153.9937022142,3530780.0747939292,81.04,1
|
||||
234253.9937022142,3530780.0747939292,78.48,1
|
||||
234353.9937022142,3530780.0747939292,84.17999999999999,1
|
||||
234453.9937022142,3530780.0747939292,91.45,1
|
||||
234553.9937022142,3530780.0747939292,81.96,1
|
||||
234653.9937022142,3530780.0747939292,74.38,1
|
||||
234753.9937022142,3530780.0747939292,74.42999999999999,1
|
||||
234853.9937022142,3530780.0747939292,68.12,1
|
||||
234953.9937022142,3530780.0747939292,73.22999999999999,1
|
||||
235053.9937022142,3530780.0747939292,56.28999999999999,1
|
||||
235153.9937022142,3530780.0747939292,75.52,1
|
||||
235253.9937022142,3530780.0747939292,74.55000000000001,1
|
||||
234053.9937022142,3530680.0747939292,78.72,1
|
||||
234153.9937022142,3530680.0747939292,77.56,1
|
||||
234253.9937022142,3530680.0747939292,73.77,1
|
||||
234353.9937022142,3530680.0747939292,77.64999999999999,1
|
||||
234453.9937022142,3530680.0747939292,86.4,1
|
||||
234553.9937022142,3530680.0747939292,80.36,1
|
||||
234653.9937022142,3530680.0747939292,70.63000000000001,1
|
||||
234753.9937022142,3530680.0747939292,77.24,1
|
||||
234853.9937022142,3530680.0747939292,61.29,1
|
||||
234953.9937022142,3530680.0747939292,54.230000000000004,1
|
||||
235053.9937022142,3530680.0747939292,50.22,1
|
||||
235153.9937022142,3530680.0747939292,71.95,1
|
||||
235253.9937022142,3530680.0747939292,76.75,1
|
||||
234053.9937022142,3530580.0747939292,78.06,1
|
||||
234153.9937022142,3530580.0747939292,83.17,1
|
||||
234253.9937022142,3530580.0747939292,83.14,1
|
||||
234353.9937022142,3530580.0747939292,84.32,1
|
||||
234453.9937022142,3530580.0747939292,62.23,1
|
||||
234553.9937022142,3530580.0747939292,84.72,1
|
||||
234653.9937022142,3530580.0747939292,86.11999999999999,1
|
||||
234753.9937022142,3530580.0747939292,81.85,1
|
||||
234853.9937022142,3530580.0747939292,70.58,1
|
||||
234953.9937022142,3530580.0747939292,50.63999999999999,1
|
||||
235053.9937022142,3530580.0747939292,63.17,1
|
||||
235153.9937022142,3530580.0747939292,76.55,1
|
||||
235253.9937022142,3530580.0747939292,74.225,1
|
||||
234053.9937022142,3530480.0747939292,78.14,1
|
||||
234153.9937022142,3530480.0747939292,77.41,1
|
||||
234253.9937022142,3530480.0747939292,78.31,1
|
||||
234353.9937022142,3530480.0747939292,78.0,1
|
||||
234453.9937022142,3530480.0747939292,82.67,1
|
||||
234553.9937022142,3530480.0747939292,89.29,1
|
||||
234653.9937022142,3530480.0747939292,73.53,1
|
||||
234753.9937022142,3530480.0747939292,82.24000000000001,1
|
||||
234853.9937022142,3530480.0747939292,81.16,1
|
||||
234953.9937022142,3530480.0747939292,73.44000000000001,1
|
||||
235053.9937022142,3530480.0747939292,74.52,1
|
||||
235153.9937022142,3530480.0747939292,71.52,1
|
||||
235253.9937022142,3530480.0747939292,89.85,1
|
||||
234053.9937022142,3530380.0747939292,79.36,1
|
||||
234153.9937022142,3530380.0747939292,78.77,1
|
||||
234253.9937022142,3530380.0747939292,72.13000000000001,1
|
||||
234353.9937022142,3530380.0747939292,77.56,1
|
||||
234453.9937022142,3530380.0747939292,74.67,1
|
||||
234553.9937022142,3530380.0747939292,84.54,1
|
||||
234653.9937022142,3530380.0747939292,89.53,1
|
||||
234753.9937022142,3530380.0747939292,85.99,1
|
||||
234853.9937022142,3530380.0747939292,87.22999999999999,1
|
||||
234953.9937022142,3530380.0747939292,85.53,1
|
||||
235053.9937022142,3530380.0747939292,75.82,1
|
||||
235153.9937022142,3530380.0747939292,66.47999999999999,1
|
||||
235253.9937022142,3530380.0747939292,67.55,1
|
||||
234053.9937022142,3530280.0747939292,80.64,1
|
||||
234153.9937022142,3530280.0747939292,81.23,1
|
||||
234253.9937022142,3530280.0747939292,76.6,1
|
||||
234353.9937022142,3530280.0747939292,93.39,1
|
||||
234453.9937022142,3530280.0747939292,85.55,1
|
||||
234553.9937022142,3530280.0747939292,90.69,1
|
||||
234653.9937022142,3530280.0747939292,87.16000000000001,1
|
||||
234753.9937022142,3530280.0747939292,87.01,1
|
||||
234853.9937022142,3530280.0747939292,90.9,1
|
||||
234953.9937022142,3530280.0747939292,86.92999999999999,1
|
||||
235053.9937022142,3530280.0747939292,67.22,1
|
||||
235153.9937022142,3530280.0747939292,63.77,1
|
||||
235253.9937022142,3530280.0747939292,78.475,1
|
||||
234053.9937022142,3530180.0747939292,76.86111111111111,1
|
||||
234153.9937022142,3530180.0747939292,79.76388888888889,1
|
||||
234253.9937022142,3530180.0747939292,80.15277777777777,1
|
||||
234353.9937022142,3530180.0747939292,91.45833333333333,1
|
||||
234453.9937022142,3530180.0747939292,82.05555555555556,1
|
||||
234553.9937022142,3530180.0747939292,94.15277777777777,1
|
||||
234653.9937022142,3530180.0747939292,82.72222222222221,1
|
||||
234753.9937022142,3530180.0747939292,89.11111111111111,1
|
||||
234853.9937022142,3530180.0747939292,91.41666666666667,1
|
||||
234953.9937022142,3530180.0747939292,87.58333333333333,1
|
||||
235053.9937022142,3530180.0747939292,64.54166666666666,1
|
||||
235153.9937022142,3530180.0747939292,56.40277777777778,1
|
||||
235253.9937022142,3530180.0747939292,64.86111111111111,1
|
||||
x,y,diff,status
|
||||
234053.9937022142,3530980.0747939292,80.47999999999999,1
|
||||
234153.9937022142,3530980.0747939292,76.88000000000001,1
|
||||
234253.9937022142,3530980.0747939292,77.83,1
|
||||
234353.9937022142,3530980.0747939292,81.65,1
|
||||
234453.9937022142,3530980.0747939292,84.71,1
|
||||
234553.9937022142,3530980.0747939292,79.03999999999999,1
|
||||
234653.9937022142,3530980.0747939292,74.18,1
|
||||
234753.9937022142,3530980.0747939292,76.0,1
|
||||
234853.9937022142,3530980.0747939292,85.37,1
|
||||
234953.9937022142,3530980.0747939292,73.00999999999999,1
|
||||
235053.9937022142,3530980.0747939292,52.32,1
|
||||
235153.9937022142,3530980.0747939292,86.32,1
|
||||
235253.9937022142,3530980.0747939292,84.875,1
|
||||
234053.9937022142,3530880.0747939292,79.83,1
|
||||
234153.9937022142,3530880.0747939292,84.71,1
|
||||
234253.9937022142,3530880.0747939292,78.86999999999999,1
|
||||
234353.9937022142,3530880.0747939292,79.36999999999999,1
|
||||
234453.9937022142,3530880.0747939292,80.62,1
|
||||
234553.9937022142,3530880.0747939292,81.55,1
|
||||
234653.9937022142,3530880.0747939292,73.83,1
|
||||
234753.9937022142,3530880.0747939292,78.67,1
|
||||
234853.9937022142,3530880.0747939292,71.81,1
|
||||
234953.9937022142,3530880.0747939292,75.89,1
|
||||
235053.9937022142,3530880.0747939292,59.660000000000004,1
|
||||
235153.9937022142,3530880.0747939292,80.33,1
|
||||
235253.9937022142,3530880.0747939292,82.5,1
|
||||
234053.9937022142,3530780.0747939292,80.27,1
|
||||
234153.9937022142,3530780.0747939292,81.04,1
|
||||
234253.9937022142,3530780.0747939292,78.48,1
|
||||
234353.9937022142,3530780.0747939292,84.17999999999999,1
|
||||
234453.9937022142,3530780.0747939292,91.45,1
|
||||
234553.9937022142,3530780.0747939292,81.96,1
|
||||
234653.9937022142,3530780.0747939292,74.38,1
|
||||
234753.9937022142,3530780.0747939292,74.42999999999999,1
|
||||
234853.9937022142,3530780.0747939292,68.12,1
|
||||
234953.9937022142,3530780.0747939292,73.22999999999999,1
|
||||
235053.9937022142,3530780.0747939292,56.28999999999999,1
|
||||
235153.9937022142,3530780.0747939292,75.52,1
|
||||
235253.9937022142,3530780.0747939292,74.55000000000001,1
|
||||
234053.9937022142,3530680.0747939292,78.72,1
|
||||
234153.9937022142,3530680.0747939292,77.56,1
|
||||
234253.9937022142,3530680.0747939292,73.77,1
|
||||
234353.9937022142,3530680.0747939292,77.64999999999999,1
|
||||
234453.9937022142,3530680.0747939292,86.4,1
|
||||
234553.9937022142,3530680.0747939292,80.36,1
|
||||
234653.9937022142,3530680.0747939292,70.63000000000001,1
|
||||
234753.9937022142,3530680.0747939292,77.24,1
|
||||
234853.9937022142,3530680.0747939292,61.29,1
|
||||
234953.9937022142,3530680.0747939292,54.230000000000004,1
|
||||
235053.9937022142,3530680.0747939292,50.22,1
|
||||
235153.9937022142,3530680.0747939292,71.95,1
|
||||
235253.9937022142,3530680.0747939292,76.75,1
|
||||
234053.9937022142,3530580.0747939292,78.06,1
|
||||
234153.9937022142,3530580.0747939292,83.17,1
|
||||
234253.9937022142,3530580.0747939292,83.14,1
|
||||
234353.9937022142,3530580.0747939292,84.32,1
|
||||
234453.9937022142,3530580.0747939292,62.23,1
|
||||
234553.9937022142,3530580.0747939292,84.72,1
|
||||
234653.9937022142,3530580.0747939292,86.11999999999999,1
|
||||
234753.9937022142,3530580.0747939292,81.85,1
|
||||
234853.9937022142,3530580.0747939292,70.58,1
|
||||
234953.9937022142,3530580.0747939292,50.63999999999999,1
|
||||
235053.9937022142,3530580.0747939292,63.17,1
|
||||
235153.9937022142,3530580.0747939292,76.55,1
|
||||
235253.9937022142,3530580.0747939292,74.225,1
|
||||
234053.9937022142,3530480.0747939292,78.14,1
|
||||
234153.9937022142,3530480.0747939292,77.41,1
|
||||
234253.9937022142,3530480.0747939292,78.31,1
|
||||
234353.9937022142,3530480.0747939292,78.0,1
|
||||
234453.9937022142,3530480.0747939292,82.67,1
|
||||
234553.9937022142,3530480.0747939292,89.29,1
|
||||
234653.9937022142,3530480.0747939292,73.53,1
|
||||
234753.9937022142,3530480.0747939292,82.24000000000001,1
|
||||
234853.9937022142,3530480.0747939292,81.16,1
|
||||
234953.9937022142,3530480.0747939292,73.44000000000001,1
|
||||
235053.9937022142,3530480.0747939292,74.52,1
|
||||
235153.9937022142,3530480.0747939292,71.52,1
|
||||
235253.9937022142,3530480.0747939292,89.85,1
|
||||
234053.9937022142,3530380.0747939292,79.36,1
|
||||
234153.9937022142,3530380.0747939292,78.77,1
|
||||
234253.9937022142,3530380.0747939292,72.13000000000001,1
|
||||
234353.9937022142,3530380.0747939292,77.56,1
|
||||
234453.9937022142,3530380.0747939292,74.67,1
|
||||
234553.9937022142,3530380.0747939292,84.54,1
|
||||
234653.9937022142,3530380.0747939292,89.53,1
|
||||
234753.9937022142,3530380.0747939292,85.99,1
|
||||
234853.9937022142,3530380.0747939292,87.22999999999999,1
|
||||
234953.9937022142,3530380.0747939292,85.53,1
|
||||
235053.9937022142,3530380.0747939292,75.82,1
|
||||
235153.9937022142,3530380.0747939292,66.47999999999999,1
|
||||
235253.9937022142,3530380.0747939292,67.55,1
|
||||
234053.9937022142,3530280.0747939292,80.64,1
|
||||
234153.9937022142,3530280.0747939292,81.23,1
|
||||
234253.9937022142,3530280.0747939292,76.6,1
|
||||
234353.9937022142,3530280.0747939292,93.39,1
|
||||
234453.9937022142,3530280.0747939292,85.55,1
|
||||
234553.9937022142,3530280.0747939292,90.69,1
|
||||
234653.9937022142,3530280.0747939292,87.16000000000001,1
|
||||
234753.9937022142,3530280.0747939292,87.01,1
|
||||
234853.9937022142,3530280.0747939292,90.9,1
|
||||
234953.9937022142,3530280.0747939292,86.92999999999999,1
|
||||
235053.9937022142,3530280.0747939292,67.22,1
|
||||
235153.9937022142,3530280.0747939292,63.77,1
|
||||
235253.9937022142,3530280.0747939292,78.475,1
|
||||
234053.9937022142,3530180.0747939292,76.86111111111111,1
|
||||
234153.9937022142,3530180.0747939292,79.76388888888889,1
|
||||
234253.9937022142,3530180.0747939292,80.15277777777777,1
|
||||
234353.9937022142,3530180.0747939292,91.45833333333333,1
|
||||
234453.9937022142,3530180.0747939292,82.05555555555556,1
|
||||
234553.9937022142,3530180.0747939292,94.15277777777777,1
|
||||
234653.9937022142,3530180.0747939292,82.72222222222221,1
|
||||
234753.9937022142,3530180.0747939292,89.11111111111111,1
|
||||
234853.9937022142,3530180.0747939292,91.41666666666667,1
|
||||
234953.9937022142,3530180.0747939292,87.58333333333333,1
|
||||
235053.9937022142,3530180.0747939292,64.54166666666666,1
|
||||
235153.9937022142,3530180.0747939292,56.40277777777778,1
|
||||
235253.9937022142,3530180.0747939292,64.86111111111111,1
|
||||
|
@ -1,29 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
# sys.path.insert(0, os.path.dirname(__file__))
|
||||
# sys.path.insert(0, os.path.join('..', os.path.dirname(__file__), 'libs'))
|
||||
# os.environ['PROJ_LIB'] = os.path.join(os.path.dirname(__file__), 'share/proj')
|
||||
# os.environ['GDAL_DATA'] = os.path.join(os.path.dirname(__file__), 'share')
|
||||
os.environ['ECD_BASEDIR'] = os.path.join( os.path.dirname(__file__), '..')
|
||||
BASE_DIR = os.path.join( os.path.dirname(__file__), '..')
|
||||
# import ctypes
|
||||
|
||||
# ctypes.windll.LoadLibrary()
|
||||
|
||||
from rscder.mul.mulstart import MulStart
|
||||
import logging
|
||||
from plugins.misc import format_now
|
||||
|
||||
os.makedirs(os.path.join(BASE_DIR, 'logs'), exist_ok=True)
|
||||
|
||||
logging.basicConfig(level=logging.INFO, filename=os.path.join(BASE_DIR, 'logs', format_now() + '_log.txt'), filemode='a', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
|
||||
|
||||
def main():
|
||||
# print(sys.path)
|
||||
t = MulStart()
|
||||
t.run()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
main()
|
@ -9,7 +9,6 @@ from rscder.gui.project import Create
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.project import Project
|
||||
from rscder.utils.misc import singleton
|
||||
from rscder.gui.plugins import PluginDialog
|
||||
from rscder.utils.setting import Settings
|
||||
from rscder.gui.load import loader
|
||||
from functools import partial
|
||||
@ -77,7 +76,7 @@ class ActionManager(QtCore.QObject):
|
||||
self.export_menu = self.postop_menu.addMenu(IconInstance().DOCUMENT,'&结果导出')
|
||||
|
||||
self.view_menu = menubar.addMenu('&视图')
|
||||
self.plugin_menu = menubar.addMenu('&插件')
|
||||
# self.plugin_menu = menubar.addMenu('&插件')
|
||||
self.help_menu = menubar.addMenu( '&帮助')
|
||||
|
||||
# vbox = QVBoxLayout()
|
||||
@ -191,16 +190,16 @@ class ActionManager(QtCore.QObject):
|
||||
'''
|
||||
Plugin menu
|
||||
'''
|
||||
plugin_list = self.add_action(QAction(IconInstance().PLUGINS,'&插件列表', self.w_parent), 'Plugin')
|
||||
plugin_list.triggered.connect(self.plugin_list)
|
||||
# plugin_list = self.add_action(QAction(IconInstance().PLUGINS,'&插件列表', self.w_parent), 'Plugin')
|
||||
# plugin_list.triggered.connect(self.plugin_list)
|
||||
|
||||
# toolbar = self.add_toolbar('Plugin')
|
||||
# toolbar.addAction(plugin_list)
|
||||
|
||||
self.plugin_menu.addAction(plugin_list)
|
||||
# self.plugin_menu.addAction(plugin_list)
|
||||
|
||||
self.message_box.info('菜单初始化完成')
|
||||
self.message_box.info(self.actions.keys())
|
||||
|
||||
|
||||
'''
|
||||
Enabled actions
|
||||
@ -228,9 +227,6 @@ class ActionManager(QtCore.QObject):
|
||||
lic_end_date.setText('有效期至:%s' % (Settings.General().end_date))
|
||||
self.status_bar.addPermanentWidget(lic_end_date)
|
||||
|
||||
def plugin_list(self):
|
||||
dialog = PluginDialog(self.w_parent)
|
||||
dialog.show()
|
||||
|
||||
def project_create(self):
|
||||
project = Project()
|
||||
|
@ -1,39 +1,39 @@
|
||||
from PyQt5.QtWidgets import QDialog, QFormLayout, QLineEdit, QCheckBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QTextEdit, QFileDialog, QMessageBox
|
||||
from PyQt5 import QtCore, QtGui
|
||||
from PyQt5.QtGui import QIcon
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.setting import Settings
|
||||
|
||||
class GUICfg(QDialog):
|
||||
|
||||
def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags() ) -> None:
|
||||
super().__init__(parent, flags)
|
||||
|
||||
self.setWindowTitle("界面定制")
|
||||
self.setWindowIcon(IconInstance(parent).LOGO)
|
||||
|
||||
form_layout = QFormLayout(self)
|
||||
default_size_label = QLabel('默认格网')
|
||||
default_size = QLineEdit()
|
||||
default_size.setValidator(QtGui.QIntValidator(1, 1000))
|
||||
|
||||
def set_defaultsize():
|
||||
Settings.General().size = (int(default_size.text()), int(default_size.text()))
|
||||
# form_layout.addRow
|
||||
default_size.textChanged.connect( set_defaultsize )
|
||||
|
||||
|
||||
form_layout.addRow(default_size_label, default_size)
|
||||
|
||||
self.setLayout(form_layout)
|
||||
|
||||
auto_save_label = QLabel('自动保存')
|
||||
auto_save = QCheckBox()
|
||||
auto_save.setChecked(Settings.General().auto_save)
|
||||
|
||||
def set_autosave():
|
||||
Settings.General().auto_save = auto_save.isChecked()
|
||||
|
||||
auto_save.stateChanged.connect(set_autosave)
|
||||
|
||||
form_layout.addRow(auto_save_label, auto_save)
|
||||
from PyQt5.QtWidgets import QDialog, QFormLayout, QLineEdit, QCheckBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QTextEdit, QFileDialog, QMessageBox
|
||||
from PyQt5 import QtCore, QtGui
|
||||
from PyQt5.QtGui import QIcon
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.setting import Settings
|
||||
|
||||
class GUICfg(QDialog):
|
||||
|
||||
def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags() ) -> None:
|
||||
super().__init__(parent, flags)
|
||||
|
||||
self.setWindowTitle("界面定制")
|
||||
self.setWindowIcon(IconInstance(parent).LOGO)
|
||||
|
||||
form_layout = QFormLayout(self)
|
||||
default_size_label = QLabel('默认格网')
|
||||
default_size = QLineEdit()
|
||||
default_size.setValidator(QtGui.QIntValidator(1, 1000))
|
||||
|
||||
def set_defaultsize():
|
||||
Settings.General().size = (int(default_size.text()), int(default_size.text()))
|
||||
# form_layout.addRow
|
||||
default_size.textChanged.connect( set_defaultsize )
|
||||
|
||||
|
||||
form_layout.addRow(default_size_label, default_size)
|
||||
|
||||
self.setLayout(form_layout)
|
||||
|
||||
auto_save_label = QLabel('自动保存')
|
||||
auto_save = QCheckBox()
|
||||
auto_save.setChecked(Settings.General().auto_save)
|
||||
|
||||
def set_autosave():
|
||||
Settings.General().auto_save = auto_save.isChecked()
|
||||
|
||||
auto_save.stateChanged.connect(set_autosave)
|
||||
|
||||
form_layout.addRow(auto_save_label, auto_save)
|
||||
|
@ -1,67 +1,67 @@
|
||||
from PyQt5.QtWidgets import QDialog, QFormLayout, QLineEdit, QCheckBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QTextEdit, QFileDialog, QMessageBox
|
||||
from PyQt5 import QtCore, QtGui
|
||||
from PyQt5.QtGui import QIcon
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.setting import Settings
|
||||
from rscder.utils.project import Project
|
||||
from qgis.core import QgsRectangle
|
||||
|
||||
class Location(QDialog):
|
||||
|
||||
extent = QtCore.pyqtSignal(object)
|
||||
|
||||
def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags() ) -> None:
|
||||
super().__init__(parent, flags)
|
||||
|
||||
self.setWindowTitle("定位")
|
||||
self.setWindowIcon(IconInstance(parent).LOGO)
|
||||
|
||||
X_label = QLabel('X:')
|
||||
Y_label = QLabel('Y:')
|
||||
X = QLineEdit()
|
||||
X.setValidator(QtGui.QDoubleValidator())
|
||||
Y = QLineEdit()
|
||||
Y.setValidator(QtGui.QDoubleValidator())
|
||||
|
||||
hlay = QHBoxLayout()
|
||||
hlay.addWidget(X_label)
|
||||
hlay.addWidget(X)
|
||||
hlay.addWidget(Y_label)
|
||||
hlay.addWidget(Y)
|
||||
|
||||
btns = QPushButton('确定')
|
||||
hlay.addWidget(btns)
|
||||
self.setLayout(hlay)
|
||||
|
||||
def loc():
|
||||
x = float(X.text())
|
||||
y = float(Y.text())
|
||||
extent = QgsRectangle(x - 100, y - 100, x + 100, y + 100 )
|
||||
self.extent.emit(extent)
|
||||
|
||||
btns.clicked.connect(loc)
|
||||
# form_layout = QFormLayout(self)
|
||||
# default_size_label = QLabel('默认格网')
|
||||
# default_size = QLineEdit()
|
||||
# default_size.setValidator(QtGui.QIntValidator(1, 1000))
|
||||
|
||||
# def set_defaultsize():
|
||||
# Settings.General().size = (int(default_size.text()), int(default_size.text()))
|
||||
# # form_layout.addRow
|
||||
# default_size.textChanged.connect( set_defaultsize )
|
||||
|
||||
|
||||
# form_layout.addRow(default_size_label, default_size)
|
||||
|
||||
# self.setLayout(form_layout)
|
||||
|
||||
# auto_save_label = QLabel('自动保存')
|
||||
# auto_save = QCheckBox()
|
||||
# auto_save.setChecked(Settings.General().auto_save)
|
||||
|
||||
# def set_autosave():
|
||||
# Settings.General().auto_save = auto_save.isChecked()
|
||||
|
||||
# auto_save.stateChanged.connect(set_autosave)
|
||||
|
||||
# form_layout.addRow(auto_save_label, auto_save)
|
||||
from PyQt5.QtWidgets import QDialog, QFormLayout, QLineEdit, QCheckBox, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QTextEdit, QFileDialog, QMessageBox
|
||||
from PyQt5 import QtCore, QtGui
|
||||
from PyQt5.QtGui import QIcon
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.setting import Settings
|
||||
from rscder.utils.project import Project
|
||||
from qgis.core import QgsRectangle
|
||||
|
||||
class Location(QDialog):
|
||||
|
||||
extent = QtCore.pyqtSignal(object)
|
||||
|
||||
def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags() ) -> None:
|
||||
super().__init__(parent, flags)
|
||||
|
||||
self.setWindowTitle("定位")
|
||||
self.setWindowIcon(IconInstance(parent).LOGO)
|
||||
|
||||
X_label = QLabel('X:')
|
||||
Y_label = QLabel('Y:')
|
||||
X = QLineEdit()
|
||||
X.setValidator(QtGui.QDoubleValidator())
|
||||
Y = QLineEdit()
|
||||
Y.setValidator(QtGui.QDoubleValidator())
|
||||
|
||||
hlay = QHBoxLayout()
|
||||
hlay.addWidget(X_label)
|
||||
hlay.addWidget(X)
|
||||
hlay.addWidget(Y_label)
|
||||
hlay.addWidget(Y)
|
||||
|
||||
btns = QPushButton('确定')
|
||||
hlay.addWidget(btns)
|
||||
self.setLayout(hlay)
|
||||
|
||||
def loc():
|
||||
x = float(X.text())
|
||||
y = float(Y.text())
|
||||
extent = QgsRectangle(x - 100, y - 100, x + 100, y + 100 )
|
||||
self.extent.emit(extent)
|
||||
|
||||
btns.clicked.connect(loc)
|
||||
# form_layout = QFormLayout(self)
|
||||
# default_size_label = QLabel('默认格网')
|
||||
# default_size = QLineEdit()
|
||||
# default_size.setValidator(QtGui.QIntValidator(1, 1000))
|
||||
|
||||
# def set_defaultsize():
|
||||
# Settings.General().size = (int(default_size.text()), int(default_size.text()))
|
||||
# # form_layout.addRow
|
||||
# default_size.textChanged.connect( set_defaultsize )
|
||||
|
||||
|
||||
# form_layout.addRow(default_size_label, default_size)
|
||||
|
||||
# self.setLayout(form_layout)
|
||||
|
||||
# auto_save_label = QLabel('自动保存')
|
||||
# auto_save = QCheckBox()
|
||||
# auto_save.setChecked(Settings.General().auto_save)
|
||||
|
||||
# def set_autosave():
|
||||
# Settings.General().auto_save = auto_save.isChecked()
|
||||
|
||||
# auto_save.stateChanged.connect(set_autosave)
|
||||
|
||||
# form_layout.addRow(auto_save_label, auto_save)
|
||||
|
@ -15,7 +15,7 @@ from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.project import Project
|
||||
from rscder.gui.layercombox import LayerCombox
|
||||
from rscder.gui.eagle_eye import eagleEye
|
||||
|
||||
import pprint
|
||||
class MainWindow(QMainWindow):
|
||||
|
||||
closed = pyqtSignal()
|
||||
@ -51,7 +51,7 @@ class MainWindow(QMainWindow):
|
||||
self.action_manager.set_status_bar(self.statusBar())
|
||||
self.action_manager.set_actions()
|
||||
|
||||
PluginLoader(dict(
|
||||
plugin_loader = PluginLoader(dict(
|
||||
layer_tree=self.layer_tree,
|
||||
pair_canvas=self.double_map,
|
||||
message_box=self.message_box,
|
||||
@ -59,7 +59,10 @@ class MainWindow(QMainWindow):
|
||||
mainwindow=self,
|
||||
toolbar=self.toolbar,
|
||||
statusbar=self.statusBar(),
|
||||
)).load_plugin()
|
||||
))
|
||||
plugin_loader.load_plugin()
|
||||
|
||||
self.message_box.info(pprint.pformat(plugin_loader.plugins.keys()))
|
||||
|
||||
self.resize(*Settings.General().size)
|
||||
|
||||
|
@ -1,128 +0,0 @@
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtCore import Qt
|
||||
from rscder.plugins.loader import PluginLoader
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.utils.setting import Settings
|
||||
|
||||
class PluginDialog(QDialog):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setWindowTitle('插件')
|
||||
self.setWindowIcon(IconInstance().PLUGINS)
|
||||
self.setMinimumWidth(900)
|
||||
self.setMinimumHeight(600)
|
||||
self.plugins = list(Settings.Plugin().plugins)
|
||||
|
||||
self.plugin_table = QTableWidget(len(self.plugins), 3, self)
|
||||
self.plugin_table.setSelectionMode(QAbstractItemView.ExtendedSelection)
|
||||
self.plugin_table.setColumnWidth(0, 200)
|
||||
self.plugin_table.setColumnWidth(1, 500)
|
||||
self.plugin_table.setHorizontalHeaderLabels(['名称', '模块ID', '启用'])
|
||||
self.plugin_table.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
||||
self.plugin_table.cellDoubleClicked.connect(self.edit_plugin)
|
||||
for idx, plugin in enumerate(self.plugins):
|
||||
name_item = QTableWidgetItem(plugin['name'])
|
||||
module_item = QTableWidgetItem(plugin['module'])
|
||||
enabled_item = QTableWidgetItem('启用')
|
||||
enabled_item.setCheckState(Qt.Checked if plugin['enabled'] else Qt.Unchecked)
|
||||
|
||||
self.plugin_table.setItem(idx, 0, name_item)
|
||||
self.plugin_table.setItem(idx, 1, module_item)
|
||||
self.plugin_table.setItem(idx, 2, enabled_item)
|
||||
|
||||
self.add_button = QPushButton('添加', self)
|
||||
self.add_button.clicked.connect(self.add_plugin)
|
||||
self.remove_button = QPushButton('移除', self)
|
||||
self.remove_button.clicked.connect(self.remove_plugin)
|
||||
self.save_button = QPushButton('保存', self)
|
||||
self.save_button.clicked.connect(self.save_plugin)
|
||||
self.cancel_button = QPushButton('取消', self)
|
||||
self.cancel_button.clicked.connect(self.close)
|
||||
|
||||
layout = QVBoxLayout(self)
|
||||
layout.addWidget(self.plugin_table)
|
||||
hlayout = QHBoxLayout()
|
||||
hlayout.addWidget(self.add_button)
|
||||
hlayout.addWidget(self.remove_button)
|
||||
hlayout.addWidget(self.save_button)
|
||||
hlayout.addWidget(self.cancel_button)
|
||||
layout.addLayout(hlayout)
|
||||
self.setLayout(layout)
|
||||
self.has_change = False
|
||||
|
||||
def add_plugin(self):
|
||||
plugin_directory = QFileDialog.getExistingDirectory(self, 'Select Plugin Directory', '.')
|
||||
if plugin_directory is not None:
|
||||
info = PluginLoader.load_plugin_info(plugin_directory)
|
||||
logging.info(info)
|
||||
|
||||
if info is not None:
|
||||
try:
|
||||
dst = PluginLoader.copy_plugin_to_3rd(plugin_directory)
|
||||
except:
|
||||
QMessageBox.warning(self, 'Warning', 'Failed to copy plugin to 3rd party directory')
|
||||
return
|
||||
|
||||
info['module'] = os.path.basename(plugin_directory)
|
||||
info['enabled'] = True
|
||||
info['path'] = dst
|
||||
self.has_change = True
|
||||
|
||||
self.plugin_table.insertRow(self.plugin_table.rowCount())
|
||||
name_item = QTableWidgetItem(info['name'])
|
||||
name_item.setIcon(IconInstance().TOOLBOX)
|
||||
module_item = QTableWidgetItem(info['module'])
|
||||
enabled_item = QTableWidgetItem('启用')
|
||||
enabled_item.setCheckState(Qt.Checked)
|
||||
self.plugin_table.setItem(self.plugin_table.rowCount() - 1, 0, name_item)
|
||||
self.plugin_table.setItem(self.plugin_table.rowCount() - 1, 1, module_item)
|
||||
self.plugin_table.setItem(self.plugin_table.rowCount() - 1, 2, enabled_item)
|
||||
self.plugins.append(info)
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
def remove_plugin(self):
|
||||
self.has_change = True
|
||||
row_ids = list( row.row() for row in self.plugin_table.selectionModel().selectedRows())
|
||||
row_ids.sort(reverse=True)
|
||||
for row in row_ids:
|
||||
self.plugin_table.removeRow(row)
|
||||
info = self.plugins.pop(row)
|
||||
try:
|
||||
shutil.rmtree(info['path'])
|
||||
except Exception as e:
|
||||
# logging
|
||||
logging.info(e)
|
||||
pass
|
||||
# for idx in self.plugins
|
||||
|
||||
def edit_plugin(self, row, column):
|
||||
self.has_change = True
|
||||
if column == 2:
|
||||
self.plugin_table.item(row, column).setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable)
|
||||
|
||||
def save_plugin(self):
|
||||
|
||||
for idx in range(self.plugin_table.rowCount()):
|
||||
enabled = self.plugin_table.item(idx, 2).checkState() == Qt.Checked
|
||||
self.plugins[idx]['enabled'] = enabled
|
||||
Settings.Plugin().plugins = self.plugins
|
||||
self.has_change = False
|
||||
self.close()
|
||||
|
||||
def closeEvent(self, event):
|
||||
if self.has_change:
|
||||
reply = QMessageBox.question(self, 'Message', "Do you want to save the changes?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
||||
if reply == QMessageBox.Yes:
|
||||
self.save_plugin()
|
||||
event.accept()
|
||||
else:
|
||||
event.accept()
|
||||
else:
|
||||
event.accept()
|
1
rscder/plugins/about/__init__.py
Normal file
1
rscder/plugins/about/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .main import *
|
1
rscder/plugins/change_rate/__init__.py
Normal file
1
rscder/plugins/change_rate/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .main import *
|
1
rscder/plugins/evaluation/__init__.py
Normal file
1
rscder/plugins/evaluation/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .main import *
|
1
rscder/plugins/export_to/__init__.py
Normal file
1
rscder/plugins/export_to/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from .main import *
|
@ -1,9 +1,9 @@
|
||||
from misc import Register
|
||||
from rscder.plugins.misc import Register
|
||||
|
||||
FILTER = Register('滤波处理算法')
|
||||
|
||||
from .mean_filter import MeanFilter
|
||||
from filter_collection.main import *
|
||||
from rscder.plugins.filter_collection.main import *
|
||||
from .morphology_filter import MorphologyFilter
|
||||
from .bilater_filter import BilaterFilter
|
||||
from .lee_filter import LeeFilter
|
@ -1,9 +1,9 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
@ -1,9 +1,9 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
@ -1,18 +1,16 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
||||
from rscder.utils.icons import IconInstance
|
||||
import os
|
||||
from datetime import datetime
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
import cv2
|
||||
from tqdm import tqdm
|
||||
def adaptiveMedianDeNoise(count, image):
|
@ -1,9 +1,9 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
||||
@ -11,9 +11,6 @@ from rscder.utils.icons import IconInstance
|
||||
import os
|
||||
from datetime import datetime
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
import pandas as pd
|
||||
import cv2
|
||||
from tqdm import tqdm
|
||||
def adaptiveMedianDeNoise(count, image):
|
@ -12,8 +12,8 @@ from rscder.gui.layercombox import RasterLayerCombox
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from misc import AlgFrontend, AlgSelectWidget
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from rscder.plugins.misc import AlgFrontend, AlgSelectWidget
|
||||
import functools
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
@ -1,9 +1,9 @@
|
||||
from misc import AlgFrontend
|
||||
from misc.utils import format_now
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
from rscder.plugins.misc.utils import format_now
|
||||
from osgeo import gdal, gdal_array
|
||||
from skimage.filters import rank
|
||||
from skimage.morphology import rectangle
|
||||
from filter_collection import FILTER
|
||||
from rscder.plugins.filter_collection import FILTER
|
||||
from PyQt5.QtWidgets import QDialog, QAction
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from rscder.utils.project import PairLayer, Project, RasterLayer, ResultPointLayer
|
5
rscder/plugins/follow/__init__.py
Normal file
5
rscder/plugins/follow/__init__.py
Normal file
@ -0,0 +1,5 @@
|
||||
from rscder.plugins.misc import Register
|
||||
|
||||
FOLLOW = Register('流程')
|
||||
|
||||
from .main import *
|
@ -4,8 +4,8 @@ from rscder.plugins.basic import BasicPlugin
|
||||
from rscder.utils.icons import IconInstance
|
||||
from rscder.gui.actions import ActionManager
|
||||
from PyQt5 import QtWidgets, QtGui
|
||||
from follow import FOLLOW
|
||||
from misc import AlgFrontend
|
||||
from . import FOLLOW
|
||||
from rscder.plugins.misc import AlgFrontend
|
||||
|
||||
class FollowDialog(QtWidgets.QDialog):
|
||||
|
@ -9,6 +9,19 @@ import os
|
||||
import sys
|
||||
import inspect
|
||||
|
||||
from rscder.plugins.about import AboutPlugin
|
||||
from rscder.plugins.change_rate import RateSetPlugin
|
||||
from rscder.plugins.evaluation import EvaluationPlugin
|
||||
from rscder.plugins.export_to import ExportPlugin
|
||||
from rscder.plugins.filter_collection import MainPlugin as FilterPlugin
|
||||
from rscder.plugins.follow import FollowPlugin
|
||||
from rscder.plugins.unsupervised_method import UnsupervisedPlugin
|
||||
from rscder.plugins.veg_method import VegtationPlugin
|
||||
|
||||
PLUGINS = [
|
||||
AboutPlugin, RateSetPlugin, EvaluationPlugin, ExportPlugin, FilterPlugin, FollowPlugin, UnsupervisedPlugin, VegtationPlugin
|
||||
]
|
||||
|
||||
class PluginLoader(QObject):
|
||||
|
||||
plugin_loaded = pyqtSignal()
|
||||
@ -16,7 +29,7 @@ class PluginLoader(QObject):
|
||||
def __init__(self, ctx):
|
||||
super().__init__()
|
||||
self.ctx = ctx
|
||||
self.plugins = []
|
||||
self.plugins = dict()
|
||||
|
||||
@staticmethod
|
||||
def copy_plugin_to_3rd(dir, random_suffix=True):
|
||||
@ -48,19 +61,11 @@ class PluginLoader(QObject):
|
||||
return info
|
||||
|
||||
def load_plugin(self):
|
||||
plugins = Settings.Plugin().plugins
|
||||
if Settings.Plugin().root not in sys.path:
|
||||
sys.path.insert(0, Settings.Plugin().root)
|
||||
for plugin in plugins:
|
||||
# path = plugin['path']
|
||||
if not plugin['enabled']:
|
||||
continue
|
||||
|
||||
for plugin in PLUGINS:
|
||||
|
||||
try:
|
||||
module = importlib.import_module(plugin['module'])
|
||||
for oname, obj in inspect.getmembers(module):
|
||||
if inspect.isclass(obj) and issubclass(obj, BasicPlugin) and obj != BasicPlugin and obj != PluginLoader:
|
||||
self.plugins.append(obj(self.ctx))
|
||||
break
|
||||
self.plugins[plugin.__name__] = plugin(self.ctx)
|
||||
except Exception as e:
|
||||
# import traceback
|
||||
# traceback.print_exc()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user