diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 24cb4c1d0..c8d939ba1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -28,10 +28,11 @@
-
+
-
-
+
+
+
@@ -113,7 +114,7 @@
"Git.Branch.Popup.ShowAllRemotes": "true",
"MATLAB_INTERPRETER": "/usr/local/MATLAB/R2018a/bin/matlab",
"Python tests.pytest in tests.executor": "Run",
- "Python.ExecuteGridCal.executor": "Debug",
+ "Python.ExecuteGridCal.executor": "Run",
"Python.update_gui_file.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
@@ -571,7 +572,7 @@
-
+
@@ -609,16 +610,16 @@
+
-
-
+
@@ -1609,7 +1610,7 @@
1706010683113
-
+
@@ -1655,7 +1656,6 @@
-
@@ -1680,7 +1680,8 @@
-
+
+
@@ -2528,13 +2529,13 @@
-
+
-
+
diff --git a/src/GridCal/Gui/Diagrams/MapWidget/Branches/map_line_container.py b/src/GridCal/Gui/Diagrams/MapWidget/Branches/map_line_container.py
index 587ccd463..3627b9275 100644
--- a/src/GridCal/Gui/Diagrams/MapWidget/Branches/map_line_container.py
+++ b/src/GridCal/Gui/Diagrams/MapWidget/Branches/map_line_container.py
@@ -63,6 +63,16 @@ def __init__(self,
self.enabled = True
self.original = True
+ def setWidthScale(self, val: float):
+ """
+ Set the width scale of the line
+ :param val:
+ """
+ for segment in self.segments_list:
+ pen = segment.pen() # get the current pen
+ pen.setWidthF(val) # Set the fractional thickness of the line
+ segment.setPen(pen) # Assign the pen to the line item
+
def clean_segments(self) -> None:
"""
Remove all segments from the scene
diff --git a/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py b/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py
index 38bc73025..c3ed16b50 100644
--- a/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py
+++ b/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py
@@ -22,7 +22,8 @@
from collections.abc import Callable
from PySide6.QtSvg import QSvgGenerator
from PySide6.QtCore import (Qt, QSize, QRect, QMimeData, QIODevice, QByteArray, QDataStream, QModelIndex)
-from PySide6.QtGui import (QIcon, QPixmap, QImage, QPainter, QStandardItemModel, QStandardItem, QColor, QDropEvent)
+from PySide6.QtGui import (QIcon, QPixmap, QImage, QPainter, QStandardItemModel, QStandardItem, QColor, QDropEvent,
+ QWheelEvent)
from GridCalEngine.Devices.Diagrams.map_location import MapLocation
from GridCalEngine.Devices.Substation import Bus
@@ -819,6 +820,26 @@ def dropEvent(self, event: QDropEvent):
self.circuit.add_substation(obj=api_object)
self.add_api_substation(api_object=api_object, lat=lat, lon=lon, r=0.01)
+ def wheelEvent(self, event: QWheelEvent):
+ """
+
+ :param event:
+ :return:
+ """
+ max_zoom = self.map.max_level
+ min_zoom = self.map.min_level
+ zoom = self.map.zoom_factor
+ scale = 0.1 + zoom / (max_zoom - min_zoom)
+
+ # rescale lines
+ for dev_tpe in [DeviceType.LineDevice,
+ DeviceType.DCLineDevice,
+ DeviceType.HVDCLineDevice,
+ DeviceType.FluidPathDevice]:
+ graphics_dict = self.graphics_manager.get_device_type_dict(device_type=dev_tpe)
+ for key, lne in graphics_dict.items():
+ lne.setWidthScale(scale)
+
def change_size_and_pen_width_all(self, new_radius, pen_width):
"""
Change the size and pen width of all elements in Schema.
diff --git a/src/GridCal/Gui/Diagrams/MapWidget2/map_widget.py b/src/GridCal/Gui/Diagrams/MapWidget2/map_widget.py
index ae92eb840..1f47701fd 100644
--- a/src/GridCal/Gui/Diagrams/MapWidget2/map_widget.py
+++ b/src/GridCal/Gui/Diagrams/MapWidget2/map_widget.py
@@ -755,6 +755,7 @@ def wheelEvent(self, event: QWheelEvent):
"""
Handle a mouse wheel rotation.
"""
+ self.editor.wheelEvent(event)
def resizeEvent(self, event: QResizeEvent = None, updateDiagram: bool = True):
"""