15 Commits

Author SHA1 Message Date
KatKatKateryna 2f15a17566 pop-up warning 2024-03-01 11:31:55 +00:00
KatKatKateryna 18435bf4af add reports placeholders for regression testing 2024-02-20 00:09:12 +00:00
KatKatKateryna 61af1d7676 typo 2024-02-12 20:46:53 +00:00
KatKatKateryna bb081a9b52 Merge pull request #10 from specklesystems/2.18-fixes-for-arcgis
2.18 fixes for arcgis
2024-02-13 03:26:34 +08:00
KatKatKateryna 563b54aa60 add workspace property 2024-02-12 13:28:26 +00:00
KatKatKateryna 0b099810e5 don't pin window on launch 2024-02-12 00:03:43 +00:00
KatKatKateryna 30c3514bde get layers with structure 2024-02-11 18:15:45 +00:00
KatKatKateryna 97adaca60a fix arcgis report on receive 2024-02-10 23:17:35 +00:00
KatKatKateryna 66f45e8147 arcgis support: crs format; pin window 2024-02-10 19:00:28 +00:00
KatKatKateryna 8d505db4fd btn active 2024-02-07 18:07:42 +00:00
KatKatKateryna 5a85a97785 support other CRS data structures; saved layers in MainWindow 2024-02-07 17:37:23 +00:00
KatKatKateryna 04e4f43972 resize 2024-02-07 00:56:26 +00:00
KatKatKateryna ef07bedc26 fixes_main window 2024-02-07 00:26:07 +00:00
KatKatKateryna 97f2afedfb update main_window 2024-02-06 23:53:38 +00:00
KatKatKateryna ae83a21179 Merge pull request #9 from specklesystems/2.18
2.18
2024-02-06 03:20:48 +08:00
12 changed files with 859 additions and 461 deletions
+5 -1
View File
@@ -5,7 +5,7 @@ import webbrowser
try:
from specklepy_qt_ui.qt_ui.utils.logger import logToUser
except ModuleNotFoundError:
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.utils.logger import logToUser
from specklepy.core.api.credentials import get_local_accounts
@@ -22,6 +22,7 @@ class DataStorage:
currentCRS = None
currentUnits = "m"
currentOriginalUnits = ""
workspace = ""
custom_lat: Optional[float] = None
custom_lon: Optional[float] = None
@@ -53,6 +54,9 @@ class DataStorage:
latestActionLayers: Optional[list] = None
latestActionUnits: str = ""
flat_report_receive: dict = {}
flat_report_latest: dict = {}
def __init__(self):
# print("hello")
# self.streamsToFollow.append(("https://speckle.xyz/streams/17b0b76d13/branches/random_tests", "", "09a0f3e41a"))
+16 -10
View File
@@ -21,9 +21,11 @@ try:
BACKGR_ERROR_COLOR,
BACKGR_ERROR_COLOR_LIGHT,
)
from specklepy_qt_ui.qt_ui.widget_dependencies_upgrade import DependenciesUpgradeDialog
from specklepy_qt_ui.qt_ui.widget_dependencies_upgrade import (
DependenciesUpgradeDialog,
)
from specklepy_qt_ui.qt_ui.widget_report import ReportDialog
except ModuleNotFoundError:
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.utils.global_resources import (
BACKGR_COLOR,
BACKGR_COLOR_LIGHT,
@@ -35,7 +37,9 @@ except ModuleNotFoundError:
BACKGR_ERROR_COLOR,
BACKGR_ERROR_COLOR_LIGHT,
)
from speckle.specklepy_qt_ui.qt_ui.widget_dependencies_upgrade import DependenciesUpgradeDialog
from speckle.specklepy_qt_ui.qt_ui.widget_dependencies_upgrade import (
DependenciesUpgradeDialog,
)
from speckle.specklepy_qt_ui.qt_ui.widget_report import ReportDialog
@@ -283,20 +287,22 @@ class LogWidget(QWidget):
def getNextBtn(self):
index = len(self.used_btns) # get the next "free" button
# print(index)
# print(self.btns)
if index >= len(self.btns):
# remove first button
print(self.layout.itemAt(0).widget())
self.layout.itemAt(0).widget().setParent(None)
# self.used_btns.clear()
self.createBtns()
index = 0
btn = self.btns[index]
# print(btn)
return btn, index
def getLastBtn(self):
index = len(self.used_btns) - 1 # get the next "free" button
btn = None
if index > 0:
btn = self.btns[index]
return btn, index
def getBtnByKeyword(self, keyword: str):
+722 -387
View File
File diff suppressed because it is too large Load Diff
+58 -47
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SpeckleQArcGISDialog</class>
<widget class="QMainWindow" name="SpeckleQArcGISDialog">
<class>SpeckleGISDialog</class>
<widget class="QMainWindow" name="SpeckleGISDialog">
<property name="geometry">
<rect>
<x>0</x>
@@ -98,9 +98,21 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="commitDropdown"/>
</item>
<layout class="QHBoxLayout" name="commitListButtons" stretch="20,1">
<item>
<widget class="QComboBox" name="commitDropdown"/>
</item>
<item>
<widget class="QPushButton" name="commit_web_view">
<property name="text">
<string> </string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
</layout>
@@ -126,6 +138,15 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="reportBtn">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
@@ -178,21 +199,49 @@
<bool>true</bool>
</property>
<property name="text">
<string>Set visible layers as selection</string>
<string>Save visible layers as selection</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="0">
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="crsSettings">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Set project center on Send/Receive</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="0">
<widget class="QLabel" name="messageLabel">
<property name="text">
<string>Message</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="11" column="1">
<widget class="QLineEdit" name="messageInput">
<property name="placeholderText">
<string>Sent XXX objects from ArcGIS</string>
@@ -202,7 +251,7 @@
<item row="10" column="1">
<item row="12" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
@@ -236,46 +285,8 @@
</layout>
</item>
<item row="11" column="0">
<widget class="QLabel" name="surveyPointLabel">
<property name="text">
<string>Lat, Lon</string>
</property>
</widget>
</item>
<item row="11" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="surveyPointLat">
<property name="placeholderText">
<string>0.0</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="surveyPointLon">
<property name="placeholderText">
<string>0.0</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveSurveyPoint">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Set as a project center</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="12" column="1">
<item row="13" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

+7
View File
@@ -81,3 +81,10 @@ ICON_POINT = os.path.join(
ICON_GENERIC = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", "legend_generic.png"
)
ICON_PIN_ACTIVE = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", "pin.png"
)
ICON_PIN_DISABLED = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "assets", "pin-outline.png"
)
+2
View File
@@ -2,6 +2,8 @@ from textwrap import wrap
from typing import Union
import requests
SYMBOL = "_x_x_"
def splitTextIntoLines(text: str = "", number: int = 40) -> str:
msg = ""
+7
View File
@@ -2,14 +2,17 @@ import inspect
import os
from typing import List, Union
import urllib.parse
try:
from specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from specklepy_qt_ui.qt_ui.utils.logger import logToUser
from specklepy_qt_ui.qt_ui.utils.utils import constructCommitURLfromServerCommit
from specklepy_qt_ui.qt_ui.utils.logger import displayUserMsg
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from speckle.specklepy_qt_ui.qt_ui.utils.logger import logToUser
from speckle.specklepy_qt_ui.qt_ui.utils.utils import constructCommitURLfromServerCommit
from speckle.specklepy_qt_ui.qt_ui.utils.logger import displayUserMsg
from PyQt5 import QtWidgets, uic, QtCore
from PyQt5.QtCore import pyqtSignal
@@ -188,6 +191,10 @@ class AddStreamModalDialog(QtWidgets.QWidget, FORM_CLASS):
except Exception as e:
logToUser(e, level=2, func=inspect.stack()[0][3])
if isinstance(e, SpeckleException):
displayUserMsg(e.message, level=2)
else:
displayUserMsg(str(e), level=2)
return
def populateResultsList(self, sw=None):
+12 -3
View File
@@ -6,7 +6,7 @@ try:
from specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from specklepy_qt_ui.qt_ui.utils.logger import logToUser
from specklepy_qt_ui.qt_ui.utils.global_resources import COLOR
except ModuleNotFoundError:
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from speckle.specklepy_qt_ui.qt_ui.utils.logger import logToUser
from speckle.specklepy_qt_ui.qt_ui.utils.global_resources import COLOR
@@ -26,7 +26,7 @@ FORM_CLASS, _ = uic.loadUiType(
class CustomCRSDialog(QtWidgets.QWidget, FORM_CLASS):
name_field: QtWidgets.QLineEdit = None
description_field: QtWidgets.QLineEdit = None
description: QtWidgets.QLineEdit = None
dialog_button_box: QtWidgets.QDialogButtonBox = None
saveSurveyPoint: QtWidgets.QPushButton = None
speckle_client: Union[SpeckleClient, None] = None
@@ -84,6 +84,7 @@ class CustomCRSDialog(QtWidgets.QWidget, FORM_CLASS):
self.offsetYDegreeSign.show()
units = self.dataStorage.currentOriginalUnits
print(units)
if units == "degrees":
self.offsetXDegreeSign.setText("°")
self.offsetYDegreeSign.setText("°")
@@ -94,9 +95,17 @@ class CustomCRSDialog(QtWidgets.QWidget, FORM_CLASS):
self.offsetXDegreeSign.hide()
self.offsetYDegreeSign.hide()
try:
authid = self.dataStorage.currentCRS.authid()
except:
try:
authid = self.dataStorage.currentCRS.name
except:
authid = str(self.dataStorage.currentCRS)
text = f"Use this option when your project requires a use of a specific CRS. \
\n\nThis will only affect Speckle data properties, not your Project CRS.\
\n\nHint: your current project CRS is '{self.dataStorage.currentCRS.authid()}' and using units '{self.dataStorage.currentOriginalUnits}'."
\n\nHint: your current project CRS is '{authid}' and using units '{self.dataStorage.currentOriginalUnits}'."
if units == "degrees":
text += "\nThis CRS is not recommended if data was sent or needs to be \
+6 -2
View File
@@ -6,7 +6,7 @@ from specklepy.logging import metrics
try:
from specklepy_qt_ui.qt_ui.DataStorage import DataStorage
except ModuleNotFoundError:
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from PyQt5 import QtWidgets, uic, QtCore
@@ -91,7 +91,11 @@ To do it manually, you can run 2 following commands from QGIS Plugins panel->Pyt
def runSubprocess(self):
import subprocess
from speckle.utils.utils import get_qgis_python_path as path
try:
from speckle.utils.utils import get_qgis_python_path as path
except ModuleNotFoundError:
from speckle.speckle.utils.utils import get_qgis_python_path as path
result1 = subprocess.run(
[path(), "-m", "pip", "install", "requests==2.31.0"],
+24 -11
View File
@@ -5,9 +5,11 @@ from typing import List, Tuple, Union
try:
from specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from specklepy_qt_ui.qt_ui.utils.global_resources import COLOR
except ModuleNotFoundError:
from specklepy_qt_ui.qt_ui.utils.utils import SYMBOL
except ModuleNotFoundError:
from speckle.specklepy_qt_ui.qt_ui.DataStorage import DataStorage
from speckle.specklepy_qt_ui.qt_ui.utils.global_resources import COLOR
from speckle.specklepy_qt_ui.qt_ui.utils.utils import SYMBOL
# from specklepy_qt_ui.qt_ui.utils.logger import logToUser
@@ -50,7 +52,7 @@ class ReportDialog(QtWidgets.QWidget, FORM_CLASS):
try:
if self.dataStorage is None:
return
reportList = self.dataStorage.latestActionReport
reportList: List[dict] = self.dataStorage.latestActionReport
if reportList is None:
return
@@ -66,11 +68,13 @@ class ReportDialog(QtWidgets.QWidget, FORM_CLASS):
for item in reportList:
line = ""
try: # if sending
line += f'{item["feature_id"]}: {item["obj_type"]}'
some_id = item["feature_id"].replace(SYMBOL, "\\")
line += f'{some_id}: {item["obj_type"]}'
operation = f"Sent at {self.dataStorage.latestActionTime}"
except: # if receiving
sending = False
line += f'{item["speckle_id"]}: {item["obj_type"]}'
some_id = item[list(item.keys())[0]].replace(SYMBOL, "\\")
line += f'{some_id}: {item["obj_type"]}' # f'{item["speckle_id"]}: {item["obj_type"]}'
operation = f"Received at {self.dataStorage.latestActionTime}"
# edit based on the type
@@ -121,22 +125,31 @@ class ReportDialog(QtWidgets.QWidget, FORM_CLASS):
text += "\n"
# add info about the offsets
text += "Project CRS: " + self.dataStorage.project.crs().authid() + "\n"
try:
crs = self.dataStorage.project.crs()
text += "Project CRS: " + crs.authid() + "\n"
crs_keyword = "CRS"
except AttributeError:
crs = self.dataStorage.project.activeMap.spatialReference
crs_keyword = "Spatial Reference"
text += f"Project {crs_keyword}: " + crs.name + "\n"
units = self.dataStorage.latestActionUnits
text += (
"Project CRS units: "
f"Project {crs_keyword} units: "
+ units
+ f"{' (not supported, treated as Meters)' if 'degrees' in units else ''}"
+ "\n"
)
try:
text += f"Project {crs_keyword} WKT: \n" + crs.toWkt() + "\n\n"
except:
text += f"Project {crs_keyword} WKT: \n" + crs.exportToString() + "\n\n"
text += (
"Project CRS WKT: \n" + self.dataStorage.project.crs().toWkt() + "\n\n"
)
text += (
f"CRS offsets: x={self.dataStorage.crs_offset_x}, y={self.dataStorage.crs_offset_y}"
f"{crs_keyword} offsets: x={self.dataStorage.crs_offset_x}, y={self.dataStorage.crs_offset_y}"
+ "\n"
)
text += f"CRS rotation: {self.dataStorage.crs_rotation}°" + "\n\n"
text += f"{crs_keyword} rotation: {self.dataStorage.crs_rotation}°" + "\n\n"
text += last_report