mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-12 23:23:14 +02:00
Compare commits
132 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34cc26a325 | |||
| ba14c6112e | |||
| cb8256bd48 | |||
| 3dd512b587 | |||
| 31c0267cd5 | |||
| 88b2955b00 | |||
| 46378ca2a7 | |||
| c7481011e8 | |||
| 15d9708c46 | |||
| 3b32daf15d | |||
| 0a658d5d61 | |||
| a140c5ad39 | |||
| 4894284520 | |||
| efc8745bc7 | |||
| 406af16e94 | |||
| e3e48d3966 | |||
| 0e646aed0b | |||
| 52d56c18a2 | |||
| d3f132adc6 | |||
| 7b50f10749 | |||
| 64bb2308d8 | |||
| dd3cee5d8e | |||
| 6dcb6ebcb7 | |||
| a9f5e2945b | |||
| 732d317e81 | |||
| 2b77964881 | |||
| 5702ed3d04 | |||
| a2c1c5515a | |||
| 8b66709ea3 | |||
| e6d995c190 | |||
| c1706cb055 | |||
| fe3ffd890b | |||
| 8b5a4cea0d | |||
| ca48684b39 | |||
| c4fd1efb4f | |||
| fc0dcb6ab0 | |||
| e02ad585a9 | |||
| 75cd943dbd | |||
| e6d3121a32 | |||
| 429726f463 | |||
| b9c9d0e31f | |||
| 7918cbb7ab | |||
| 1454a8d4e7 | |||
| 35018ba314 | |||
| 3bf4c852c9 | |||
| a118c33f80 | |||
| 326387895a | |||
| 566e7f7004 | |||
| 625e673385 | |||
| 1863329ca0 | |||
| e83424459c | |||
| 59253019ff | |||
| c66b873631 | |||
| b2a999cec5 | |||
| f1cb63cf0c | |||
| 4138b8998c | |||
| 24929861ba | |||
| fcd2f68f68 | |||
| f0b0af9a76 | |||
| 6a7f24a2af | |||
| 59e06a4087 | |||
| 3738c79ec6 | |||
| 4871aae59d | |||
| 8649d21298 | |||
| de41f29e6b | |||
| f1a8c00028 | |||
| e4f5e8c68a | |||
| 1649e8d28b | |||
| 5e3ca46133 | |||
| a162f158ad | |||
| 6aebbfeaa7 | |||
| 5d725f6d55 | |||
| 85d10fc0e6 | |||
| 1baf9db799 | |||
| 32c0e04c56 | |||
| 57b5819f07 | |||
| 7c5e0135a6 | |||
| 7d8734e192 | |||
| 30184bdd06 | |||
| 1062d217f0 | |||
| 6cad599664 | |||
| cbd309ec5a | |||
| 23c4ba2a3e | |||
| dd03f0eece | |||
| 491b8ce64c | |||
| 2d8dd2b480 | |||
| fda314d585 | |||
| f9073ca5fb | |||
| 36da291be6 | |||
| 4da78939d0 | |||
| a942f42927 | |||
| e9e2ea5b0e | |||
| 701265e393 | |||
| 073763d9bf | |||
| ca7dc28ecf | |||
| a70cc75504 | |||
| 6cc297def1 | |||
| 1baf9125dc | |||
| 78bae2dc60 | |||
| d0a10ef9af | |||
| c6bc23addc | |||
| 9a7da28fc5 | |||
| dd7f295f5c | |||
| 774b604b50 | |||
| e36df6f7d2 | |||
| 9076d9da80 | |||
| c7d6312997 | |||
| 5492cd3f71 | |||
| 9b4bbfbf0d | |||
| b20456d0d6 | |||
| 69338962bc | |||
| 78005f812a | |||
| 3479b98242 | |||
| f4f28b83bd | |||
| 4c8e7f4856 | |||
| ba1123cf73 | |||
| b3ac3c82af | |||
| e9448be986 | |||
| f72a2545bd | |||
| 206a48a15f | |||
| f33ea64b99 | |||
| 0d44933432 | |||
| fa68d545d0 | |||
| 171f2eab4e | |||
| ce86e18664 | |||
| 17030aaa80 | |||
| 09b1c0905e | |||
| b453832d46 | |||
| 109efa03d2 | |||
| 99a8b5f46d | |||
| d8b7fc3642 | |||
| 5f7f72f292 |
+1
-1
@@ -146,7 +146,7 @@ install(DIRECTORY elements DESTINATION share/qelectrotech)
|
|||||||
install(DIRECTORY examples DESTINATION share/qelectrotech)
|
install(DIRECTORY examples DESTINATION share/qelectrotech)
|
||||||
install(DIRECTORY titleblocks DESTINATION share/qelectrotech)
|
install(DIRECTORY titleblocks DESTINATION share/qelectrotech)
|
||||||
install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
|
install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share/doc/qelectrotech)
|
||||||
install(FILES misc/qelectrotech.desktop DESTINATION share/applications)
|
install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications)
|
||||||
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
|
install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages)
|
||||||
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
|
install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH})
|
||||||
install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH})
|
install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Permission is not granted to use this software or any of the associated files
|
|
||||||
as sample data for the purposes of building machine learning models.
|
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ The main goal of the developers is to provide a libre, easy to use and effective
|
|||||||
The current stable version is 0.90 and was released on 2023.01.06.
|
The current stable version is 0.90 and was released on 2023.01.06.
|
||||||
Once it has been officially released, the stable version is always frozen and is no longer developed.
|
Once it has been officially released, the stable version is always frozen and is no longer developed.
|
||||||
|
|
||||||
New functionalities, bug and issue fixings are further made in the development version (currently 0.100), which can also be [downloaded](https://qelectrotech.org/download.html).
|
New functionalities, bug and issue fixings are further made in the development version (currently 0.100), which can also be [downloaded](https://qelectrotech.org/download.php).
|
||||||
|
|
||||||
Users who want to test and take benefits from the last software implementations should use the development version. But... use it at your own risk, since things are sometimes broken or only partially implemented until they are done!
|
Users who want to test and take benefits from the last software implementations should use the development version. But... use it at your own risk, since things are sometimes broken or only partially implemented until they are done!
|
||||||
|
|
||||||
@@ -26,10 +26,7 @@ Users who want to test and take benefits from the last software implementations
|
|||||||
|
|
||||||
The software is licensed under [GNU/GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
|
The software is licensed under [GNU/GPL](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).
|
||||||
You are free to use, copy, modify and redistribute it under the terms of the license.
|
You are free to use, copy, modify and redistribute it under the terms of the license.
|
||||||
```txt
|
|
||||||
Permission is not granted to use this software or any of the associated files
|
|
||||||
as sample data for the purposes of building machine learning models.
|
|
||||||
```
|
|
||||||
Like many other open source software, QElectroTech is provided as is, without any warranty.
|
Like many other open source software, QElectroTech is provided as is, without any warranty.
|
||||||
|
|
||||||
### Development / technical choices
|
### Development / technical choices
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"id": "org.qelectrotech.QElectroTech",
|
"id": "org.qelectrotech.QElectroTech",
|
||||||
"base-version": "5.15-22.08",
|
"base-version": "5.15-23.08",
|
||||||
"runtime": "org.kde.Platform",
|
"runtime": "org.kde.Platform",
|
||||||
"runtime-version": "5.15-22.08",
|
"runtime-version": "5.15-23.08",
|
||||||
"sdk": "org.kde.Sdk",
|
"sdk": "org.kde.Sdk",
|
||||||
"command": "qelectrotech",
|
"command": "qelectrotech",
|
||||||
"rename-desktop-file": "qelectrotech.desktop",
|
"rename-desktop-file": "org.qelectrotech.qelectrotech.desktop",
|
||||||
"rename-appdata-file": "qelectrotech.appdata.xml",
|
"rename-appdata-file": "qelectrotech.appdata.xml",
|
||||||
"rename-icon": "qelectrotech",
|
"rename-icon": "qelectrotech",
|
||||||
"copy-icon": true,
|
"copy-icon": true,
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ if [ ! -d "$to" ] && [ -d "$from" ]; then
|
|||||||
cp -av "$from/." "$to"
|
cp -av "$from/." "$to"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# link DXFtoQET so that QET finds it
|
|
||||||
mkdir -p "$HOME/.qet"
|
|
||||||
ln -snf "$SNAP/bin/DXFtoQET" "$HOME/.qet/DXFtoQET"
|
|
||||||
|
|
||||||
exec "${@}"
|
exec "${@}"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ apps:
|
|||||||
common-id: qelectrotech.desktop
|
common-id: qelectrotech.desktop
|
||||||
extensions:
|
extensions:
|
||||||
- kde-neon
|
- kde-neon
|
||||||
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control]
|
plugs: &plugs [opengl, unity7, home, removable-media, gsettings, network, cups-control, wayland, x11]
|
||||||
environment: &env
|
environment: &env
|
||||||
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
|
TCL_LIBRARY: $SNAP/usr/share/tcltk/tcl8.6
|
||||||
HOME: $SNAP_USER_COMMON
|
HOME: $SNAP_USER_COMMON
|
||||||
@@ -42,13 +42,7 @@ apps:
|
|||||||
plugs: *plugs
|
plugs: *plugs
|
||||||
environment: *env
|
environment: *env
|
||||||
|
|
||||||
dxf-to-qet:
|
|
||||||
command: bin/DXFtoQET
|
|
||||||
extensions:
|
|
||||||
- kde-neon
|
|
||||||
plugs: *plugs
|
|
||||||
environment: *env
|
|
||||||
|
|
||||||
parts:
|
parts:
|
||||||
launchers:
|
launchers:
|
||||||
plugin: dump
|
plugin: dump
|
||||||
@@ -77,16 +71,7 @@ parts:
|
|||||||
override-build: |
|
override-build: |
|
||||||
rsync -a --ignore-existing /snap/kf5-5-110-qt-5-15-11-core22-sdk/current/ /
|
rsync -a --ignore-existing /snap/kf5-5-110-qt-5-15-11-core22-sdk/current/ /
|
||||||
|
|
||||||
dxf-to-qet:
|
|
||||||
after: [kde-sdk-setup]
|
|
||||||
plugin: nil
|
|
||||||
source: https://github.com/qelectrotech/DXFtoQET-2020.git
|
|
||||||
override-build: |
|
|
||||||
qmake "$CRAFT_PART_SRC/DXFtoQET.pro"
|
|
||||||
make -j$(nproc)
|
|
||||||
mkdir -p "$CRAFT_PART_INSTALL/bin"
|
|
||||||
cp DXFtoQET "$CRAFT_PART_INSTALL/bin/"
|
|
||||||
|
|
||||||
qelectrotech:
|
qelectrotech:
|
||||||
after: [kde-sdk-setup]
|
after: [kde-sdk-setup]
|
||||||
plugin: nil
|
plugin: nil
|
||||||
@@ -96,7 +81,7 @@ parts:
|
|||||||
- git
|
- git
|
||||||
- libsqlite3-dev
|
- libsqlite3-dev
|
||||||
override-build: |
|
override-build: |
|
||||||
displayed_version=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g')
|
displayed_version=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)"
|
snap_version="${displayed_version}-g$(git rev-parse --short=8 HEAD)"
|
||||||
modified_displayed_version="${snap_version}.snap"
|
modified_displayed_version="${snap_version}.snap"
|
||||||
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h
|
sed -i -E "s|const QString displayedVersion =.*|const QString displayedVersion =\"$modified_displayed_version\";|" sources/qet.h
|
||||||
@@ -108,10 +93,10 @@ parts:
|
|||||||
craftctl default
|
craftctl default
|
||||||
# patch desktop file with correct icon path
|
# patch desktop file with correct icon path
|
||||||
SED_CMD="sed -i -E s|^Icon=(.*)|Icon=\${SNAP}/usr/local/share/icons/hicolor/128x128/apps/\1.png|g"
|
SED_CMD="sed -i -E s|^Icon=(.*)|Icon=\${SNAP}/usr/local/share/icons/hicolor/128x128/apps/\1.png|g"
|
||||||
$SED_CMD usr/local/share/applications/qelectrotech.desktop
|
$SED_CMD usr/local/share/applications/org.qelectrotech.qelectrotech.desktop
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
after: [qelectrotech, dxf-to-qet, qet-tb-generator]
|
after: [qelectrotech, qet-tb-generator]
|
||||||
plugin: nil
|
plugin: nil
|
||||||
build-snaps: [kf5-5-110-qt-5-15-11-core22]
|
build-snaps: [kf5-5-110-qt-5-15-11-core22]
|
||||||
override-prime: |
|
override-prime: |
|
||||||
|
|||||||
@@ -266,13 +266,13 @@ Section ""
|
|||||||
; write file associations registry keys
|
; write file associations registry keys
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "Applications\qelectrotech.exe\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\""
|
WriteRegStr HKEY_CLASSES_ROOT "Applications\qelectrotech.exe\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\""
|
||||||
WriteRegStr HKEY_CLASSES_ROOT ".qet" "" "qet_diagram_file"
|
WriteRegStr HKEY_CLASSES_ROOT ".qet" "" "qet_diagram_file"
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file" "" "Schéma QET"
|
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file" "" "Diagram QET"
|
||||||
WriteRegDWORD HKEY_CLASSES_ROOT "qet_diagram_file" "EditFlags" 0x00000000
|
WriteRegDWORD HKEY_CLASSES_ROOT "qet_diagram_file" "EditFlags" 0x00000000
|
||||||
WriteRegDWORD HKEY_CLASSES_ROOT "qet_diagram_file" "BrowserFlags" 0x00000008
|
WriteRegDWORD HKEY_CLASSES_ROOT "qet_diagram_file" "BrowserFlags" 0x00000008
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file\DefaultIcon" "" "$final_project_ico"
|
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file\DefaultIcon" "" "$final_project_ico"
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\""
|
WriteRegStr HKEY_CLASSES_ROOT "qet_diagram_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\""
|
||||||
WriteRegStr HKEY_CLASSES_ROOT ".elmt" "" "qet_element_file"
|
WriteRegStr HKEY_CLASSES_ROOT ".elmt" "" "qet_element_file"
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "qet_element_file" "" "Élément QET"
|
WriteRegStr HKEY_CLASSES_ROOT "qet_element_file" "" "Element QET"
|
||||||
WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "EditFlags" 0x00000000
|
WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "EditFlags" 0x00000000
|
||||||
WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "BrowserFlags" 0x00000008
|
WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "BrowserFlags" 0x00000008
|
||||||
WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\DefaultIcon" "" "$final_element_ico"
|
WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\DefaultIcon" "" "$final_element_ico"
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ set(QET_SRC_FILES
|
|||||||
${QET_DIR}/sources/dxf/dxftoelmt.cpp
|
${QET_DIR}/sources/dxf/dxftoelmt.cpp
|
||||||
${QET_DIR}/sources/dxf/dxftoelmt.h
|
${QET_DIR}/sources/dxf/dxftoelmt.h
|
||||||
|
|
||||||
|
${QET_DIR}/sources/qet_elementscaler/qet_elementscaler.cpp
|
||||||
|
${QET_DIR}/sources/qet_elementscaler/qet_elementscaler.h
|
||||||
|
|
||||||
${QET_DIR}/sources/editor/arceditor.cpp
|
${QET_DIR}/sources/editor/arceditor.cpp
|
||||||
${QET_DIR}/sources/editor/arceditor.h
|
${QET_DIR}/sources/editor/arceditor.h
|
||||||
${QET_DIR}/sources/editor/editorcommands.cpp
|
${QET_DIR}/sources/editor/editorcommands.cpp
|
||||||
|
|||||||
+1
-1
Submodule elements updated: 5052b6330e...62e471ff0e
+513
-264
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
+513
-264
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+542
-275
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+534
-265
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+852
-602
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+516
-265
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+512
-263
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+511
-289
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+594
-311
File diff suppressed because it is too large
Load Diff
+508
-259
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+511
-262
File diff suppressed because it is too large
Load Diff
+513
-264
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+509
-260
File diff suppressed because it is too large
Load Diff
+509
-260
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
+510
-261
File diff suppressed because it is too large
Load Diff
@@ -89,7 +89,8 @@ A=$(git rev-list HEAD --count)
|
|||||||
HEAD=$(($A+473))
|
HEAD=$(($A+473))
|
||||||
|
|
||||||
|
|
||||||
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
|
#VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c25-35| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
|
|
||||||
# Dmg de la dernière revision déjà créé
|
# Dmg de la dernière revision déjà créé
|
||||||
if [ -e "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg" ] ; then
|
if [ -e "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg" ] ; then
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ A=$(git rev-list HEAD --count)
|
|||||||
HEAD=$(($A+473))
|
HEAD=$(($A+473))
|
||||||
|
|
||||||
|
|
||||||
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
|
#VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
|
|
||||||
# Tarball de la dernière revision déjà créé
|
# Tarball de la dernière revision déjà créé
|
||||||
if [ -e "build-aux/mac-osx/${APPNAME}-$VERSION-r$HEAD-arm64.zip" ] ; then
|
if [ -e "build-aux/mac-osx/${APPNAME}-$VERSION-r$HEAD-arm64.zip" ] ; then
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ my $no = '[no]';
|
|||||||
my $todo = 'TODO';
|
my $todo = 'TODO';
|
||||||
|
|
||||||
our $default_language = 'fr';
|
our $default_language = 'fr';
|
||||||
our @misc_desktop_files = qw(misc/qelectrotech.desktop);
|
our @misc_desktop_files = qw(misc/org.qelectrotech.qelectrotech.desktop);
|
||||||
our @misc_xml_files = qw(misc/qelectrotech.xml);
|
our @misc_xml_files = qw(misc/qelectrotech.xml);
|
||||||
our @readme_files = qw(CREDIT README INSTALL ELEMENTS.LICENSE build-aux/linux/fedora/README.elements);
|
our @readme_files = qw(CREDIT README INSTALL ELEMENTS.LICENSE build-aux/linux/fedora/README.elements);
|
||||||
our @ordered_languages = qw(fr en es pt cs pl ca de it ar sl hr el nl be ru ro da pt_BR hu sr tr nb ja mn uk zh);
|
our @ordered_languages = qw(fr en es pt cs pl ca de it ar sl hr el nl be ru ro da pt_BR hu sr tr nb ja mn uk zh);
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ A=$(git rev-list HEAD --count)
|
|||||||
HEAD=$(($A+473))
|
HEAD=$(($A+473))
|
||||||
|
|
||||||
#Find major, minor, and micro version numbers in sources/qetversion.cp
|
#Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
|
||||||
|
tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
|
#tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
|
|
||||||
rm -Rf build/
|
rm -Rf build/
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
@@ -37,9 +39,9 @@ rm -Rf qelectrotech/usr/share/{elements,examples,titleblocks,lang,man,doc}
|
|||||||
cp ../build/qelectrotech qelectrotech/usr/bin/
|
cp ../build/qelectrotech qelectrotech/usr/bin/
|
||||||
cp -r ../{elements,examples,titleblocks,lang,man} qelectrotech/usr/share/
|
cp -r ../{elements,examples,titleblocks,lang,man} qelectrotech/usr/share/
|
||||||
|
|
||||||
./linuxdeployqt-continuous-x86_64.AppImage qelectrotech/usr/share/qelectrotech.desktop -appimage -bundle-non-qt-libs -verbose=1 -extra-plugins=iconengines
|
./linuxdeployqt-continuous-x86_64.AppImage qelectrotech/usr/share/org.qelectrotech.qelectrotech.desktop -appimage -bundle-non-qt-libs -verbose=1 -extra-plugins=iconengines
|
||||||
rm qelectrotech/AppRun
|
rm qelectrotech/AppRun
|
||||||
sed -i 's/'"QElectroTech_*.*/QElectroTech_$tagName-r$HEAD"'/' qelectrotech/qelectrotech.desktop
|
sed -i 's/'"QElectroTech_*.*/QElectroTech_$tagName-r$HEAD"'/' qelectrotech/org.qelectrotech.qelectrotech.desktop
|
||||||
cp AppRun qelectrotech/
|
cp AppRun qelectrotech/
|
||||||
rm QElectroTech_*.AppImage
|
rm QElectroTech_*.AppImage
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ if [ -z "$HEAD" ] ; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
|
#VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
|
|
||||||
|
|
||||||
#clean /var/cache/pbuilder/ .. / result/debs
|
#clean /var/cache/pbuilder/ .. / result/debs
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ git pull --recurse-submodules
|
|||||||
# get the number of the new revision
|
# get the number of the new revision
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
GITCOMMIT=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{"| head -n 1| awk -F "{" '{ print $2 }' | awk -F "}" '{ print $1 }' | sed -e 's/,/./g' -e 's/ //g')
|
||||||
|
#tagName=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
flatpak-builder --force-clean --ccache --repo=qet_git/0.8-dev qet_git/build-dir qet_git/build-aux/flatpak/org.qelectrotech.QElectroTech.json --gpg-sign=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --gpg-homedir=gpg
|
flatpak-builder --force-clean --ccache --repo=qet_git/0.8-dev qet_git/build-dir qet_git/build-aux/flatpak/org.qelectrotech.QElectroTech.json --gpg-sign=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --gpg-homedir=gpg
|
||||||
|
|||||||
+5
-3
@@ -166,7 +166,8 @@ HEADERS += $$files(sources/*.h) \
|
|||||||
$$files(sources/TerminalStrip/GraphicsItem/*.h) \
|
$$files(sources/TerminalStrip/GraphicsItem/*.h) \
|
||||||
$$files(sources/TerminalStrip/GraphicsItem/properties/*.h) \
|
$$files(sources/TerminalStrip/GraphicsItem/properties/*.h) \
|
||||||
$$files(sources/xml/*.h) \
|
$$files(sources/xml/*.h) \
|
||||||
$$files(sources/dxf/*.h)
|
$$files(sources/dxf/*.h) \
|
||||||
|
$$files(sources/qet_elementscaler/*.h)
|
||||||
|
|
||||||
SOURCES += $$files(sources/*.cpp) \
|
SOURCES += $$files(sources/*.cpp) \
|
||||||
$$files(sources/editor/*.cpp) \
|
$$files(sources/editor/*.cpp) \
|
||||||
@@ -208,7 +209,8 @@ SOURCES += $$files(sources/*.cpp) \
|
|||||||
$$files(sources/TerminalStrip/GraphicsItem/*.cpp) \
|
$$files(sources/TerminalStrip/GraphicsItem/*.cpp) \
|
||||||
$$files(sources/TerminalStrip/GraphicsItem/properties/*.cpp) \
|
$$files(sources/TerminalStrip/GraphicsItem/properties/*.cpp) \
|
||||||
$$files(sources/xml/*.cpp) \
|
$$files(sources/xml/*.cpp) \
|
||||||
$$files(sources/dxf/*.cpp)
|
$$files(sources/dxf/*.cpp) \
|
||||||
|
$$files(sources/qet_elementscaler/*.cpp)
|
||||||
|
|
||||||
# Needed for use promote QTreeWidget in terminalstripeditor.ui
|
# Needed for use promote QTreeWidget in terminalstripeditor.ui
|
||||||
INCLUDEPATH += sources/TerminalStrip/ui
|
INCLUDEPATH += sources/TerminalStrip/ui
|
||||||
@@ -279,7 +281,7 @@ mime_package.path = $$join(INSTALL_PREFIX,,,$${QET_MIME_PACKAGE_PATH})
|
|||||||
mime_package.files = misc/qelectrotech.xml
|
mime_package.files = misc/qelectrotech.xml
|
||||||
|
|
||||||
desktop.path = $$join(INSTALL_PREFIX,,,$${QET_DESKTOP_PATH})
|
desktop.path = $$join(INSTALL_PREFIX,,,$${QET_DESKTOP_PATH})
|
||||||
desktop.files = misc/qelectrotech.desktop
|
desktop.files = misc/org.qelectrotech.qelectrotech.desktop
|
||||||
|
|
||||||
appdata.path = $$join(INSTALL_PREFIX,,,$${QET_APPDATA_PATH})
|
appdata.path = $$join(INSTALL_PREFIX,,,$${QET_APPDATA_PATH})
|
||||||
appdata.files = misc/qelectrotech.appdata.xml
|
appdata.files = misc/qelectrotech.appdata.xml
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ ElementsLocation ElementCollectionHandler::createDir(ElementsLocation &parent, c
|
|||||||
@brief ElementCollectionHandler::importFromProject
|
@brief ElementCollectionHandler::importFromProject
|
||||||
Import the element represented by location to the embedded collection
|
Import the element represented by location to the embedded collection
|
||||||
of project at the same path.
|
of project at the same path.
|
||||||
location must represente an element owned by a project embedded collection
|
location must represent an element owned by a project embedded collection
|
||||||
@param project : project where copy the element
|
@param project : project where copy the element
|
||||||
@param location : location to copy
|
@param location : location to copy
|
||||||
@return true if import with success
|
@return true if import with success
|
||||||
|
|||||||
@@ -111,10 +111,10 @@ QStringList ElementsCollectionModel::mimeTypes() const
|
|||||||
@return
|
@return
|
||||||
*/
|
*/
|
||||||
bool ElementsCollectionModel::canDropMimeData(const QMimeData *data,
|
bool ElementsCollectionModel::canDropMimeData(const QMimeData *data,
|
||||||
Qt::DropAction action,
|
Qt::DropAction action,
|
||||||
int row,
|
int row,
|
||||||
int column,
|
int column,
|
||||||
const QModelIndex &parent) const
|
const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
if (!(QStandardItemModel::canDropMimeData(data,
|
if (!(QStandardItemModel::canDropMimeData(data,
|
||||||
action,
|
action,
|
||||||
@@ -258,9 +258,9 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
|
|||||||
@param projects : list of projects to load
|
@param projects : list of projects to load
|
||||||
*/
|
*/
|
||||||
void ElementsCollectionModel::loadCollections(bool common_collection,
|
void ElementsCollectionModel::loadCollections(bool common_collection,
|
||||||
bool company_collection,
|
bool company_collection,
|
||||||
bool custom_collection,
|
bool custom_collection,
|
||||||
QList<QETProject *> projects)
|
QList<QETProject *> projects)
|
||||||
{
|
{
|
||||||
m_items_list_to_setUp.clear();
|
m_items_list_to_setUp.clear();
|
||||||
|
|
||||||
@@ -313,8 +313,8 @@ void ElementsCollectionModel::addCommonCollection(bool set_data)
|
|||||||
{
|
{
|
||||||
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||||
if (feci->setRootPath(QETApp::commonElementsDirN(),
|
if (feci->setRootPath(QETApp::commonElementsDirN(),
|
||||||
set_data,
|
set_data,
|
||||||
m_hide_element)) {
|
m_hide_element)) {
|
||||||
invisibleRootItem()->appendRow(feci);
|
invisibleRootItem()->appendRow(feci);
|
||||||
if (set_data)
|
if (set_data)
|
||||||
feci->setUpData();
|
feci->setUpData();
|
||||||
@@ -324,41 +324,41 @@ void ElementsCollectionModel::addCommonCollection(bool set_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsCollectionModel::addCompanyCollection
|
@brief ElementsCollectionModel::addCompanyCollection
|
||||||
Add the company elements collection to this model
|
Add the company elements collection to this model
|
||||||
@param set_data
|
@param set_data
|
||||||
*/
|
*/
|
||||||
void ElementsCollectionModel::addCompanyCollection(bool set_data)
|
void ElementsCollectionModel::addCompanyCollection(bool set_data)
|
||||||
{
|
{
|
||||||
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||||
if (feci->setRootPath(QETApp::companyElementsDirN(),
|
if (feci->setRootPath(QETApp::companyElementsDirN(),
|
||||||
set_data,
|
set_data,
|
||||||
m_hide_element)) {
|
m_hide_element)) {
|
||||||
invisibleRootItem()->appendRow(feci);
|
invisibleRootItem()->appendRow(feci);
|
||||||
if (set_data)
|
if (set_data)
|
||||||
feci->setUpData();
|
feci->setUpData();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete feci;
|
delete feci;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsCollectionModel::addCustomCollection
|
@brief ElementsCollectionModel::addCustomCollection
|
||||||
Add the custom elements collection to this model
|
Add the custom elements collection to this model
|
||||||
@param set_data
|
@param set_data
|
||||||
*/
|
*/
|
||||||
void ElementsCollectionModel::addCustomCollection(bool set_data)
|
void ElementsCollectionModel::addCustomCollection(bool set_data)
|
||||||
{
|
{
|
||||||
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||||
if (feci->setRootPath(QETApp::customElementsDirN(),
|
if (feci->setRootPath(QETApp::customElementsDirN(),
|
||||||
set_data,
|
set_data,
|
||||||
m_hide_element)) {
|
m_hide_element)) {
|
||||||
invisibleRootItem()->appendRow(feci);
|
invisibleRootItem()->appendRow(feci);
|
||||||
if (set_data)
|
if (set_data)
|
||||||
feci->setUpData();
|
feci->setUpData();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete feci;
|
delete feci;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -579,9 +579,9 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
|
|||||||
{
|
{
|
||||||
QList <ElementCollectionItem *> child_list;
|
QList <ElementCollectionItem *> child_list;
|
||||||
|
|
||||||
for (int i=0 ; i<rowCount() ; i++){
|
for (int i=0 ; i<rowCount() ; i++){
|
||||||
child_list.append(static_cast<ElementCollectionItem *>(item(i)));
|
child_list.append(static_cast<ElementCollectionItem *>(item(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(ElementCollectionItem *eci, child_list) {
|
foreach(ElementCollectionItem *eci, child_list) {
|
||||||
|
|
||||||
@@ -590,8 +590,8 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
|
|||||||
if (eci->type() == FileElementCollectionItem::Type) {
|
if (eci->type() == FileElementCollectionItem::Type) {
|
||||||
if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
|
if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
|
||||||
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
|
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
|
||||||
(location.isCompanyCollection() && feci->isCompanyCollection()) ||
|
(location.isCompanyCollection() && feci->isCompanyCollection()) ||
|
||||||
(location.isCustomCollection() && !feci->isCommonCollection()) ) {
|
(location.isCustomCollection() && !feci->isCommonCollection()) ) {
|
||||||
match_eci = feci->itemAtPath(location.collectionPath(false));
|
match_eci = feci->itemAtPath(location.collectionPath(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ class ElementsCollectionModel : public QStandardItemModel
|
|||||||
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override;
|
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override;
|
||||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
||||||
|
|
||||||
void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList<QETProject *> projects);
|
void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList<QETProject *> projects);
|
||||||
|
|
||||||
void addCommonCollection(bool set_data = true);
|
void addCommonCollection(bool set_data = true);
|
||||||
void addCompanyCollection(bool set_data = true);
|
void addCompanyCollection(bool set_data = true);
|
||||||
void addCustomCollection(bool set_data = true);
|
void addCustomCollection(bool set_data = true);
|
||||||
void addLocation(const ElementsLocation& location);
|
void addLocation(const ElementsLocation& location);
|
||||||
|
|
||||||
void addProject(QETProject *project, bool set_data = true);
|
void addProject(QETProject *project, bool set_data = true);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void ElementsCollectionWidget::addProject(QETProject *project)
|
|||||||
m_progress_bar->show();
|
m_progress_bar->show();
|
||||||
m_tree_view->setDisabled(true);
|
m_tree_view->setDisabled(true);
|
||||||
QList <QETProject *> prj; prj.append(project);
|
QList <QETProject *> prj; prj.append(project);
|
||||||
m_model->loadCollections(false, false, false, prj);
|
m_model->loadCollections(false, false, false, prj);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_waiting_project.append(project);
|
m_waiting_project.append(project);
|
||||||
@@ -148,26 +148,26 @@ void ElementsCollectionWidget::setUpAction()
|
|||||||
m_open_dir = new QAction(QET::Icons::FolderOpen,
|
m_open_dir = new QAction(QET::Icons::FolderOpen,
|
||||||
tr("Ouvrir le dossier correspondant"), this);
|
tr("Ouvrir le dossier correspondant"), this);
|
||||||
m_edit_element = new QAction(QET::Icons::ElementEdit,
|
m_edit_element = new QAction(QET::Icons::ElementEdit,
|
||||||
tr("Éditer l'élément"), this);
|
tr("Éditer l'élément"), this);
|
||||||
m_delete_element = new QAction(QET::Icons::ElementDelete,
|
m_delete_element = new QAction(QET::Icons::ElementDelete,
|
||||||
tr("Supprimer l'élément"), this);
|
tr("Supprimer l'élément"), this);
|
||||||
m_delete_dir = new QAction(QET::Icons::FolderDelete,
|
m_delete_dir = new QAction(QET::Icons::FolderDelete,
|
||||||
tr("Supprimer le dossier"), this);
|
tr("Supprimer le dossier"), this);
|
||||||
m_reload = new QAction(QET::Icons::ViewRefresh,
|
m_reload = new QAction(QET::Icons::ViewRefresh,
|
||||||
tr("Recharger les collections"), this);
|
tr("Recharger les collections"), this);
|
||||||
m_edit_dir = new QAction(QET::Icons::FolderEdit,
|
m_edit_dir = new QAction(QET::Icons::FolderEdit,
|
||||||
tr("Éditer le dossier"), this);
|
tr("Éditer le dossier"), this);
|
||||||
m_new_directory = new QAction(QET::Icons::FolderNew,
|
m_new_directory = new QAction(QET::Icons::FolderNew,
|
||||||
tr("Nouveau dossier"), this);
|
tr("Nouveau dossier"), this);
|
||||||
m_new_element = new QAction(QET::Icons::ElementNew,
|
m_new_element = new QAction(QET::Icons::ElementNew,
|
||||||
tr("Nouvel élément"), this);
|
tr("Nouvel élément"), this);
|
||||||
m_show_this_dir = new QAction(QET::Icons::FolderOnlyThis,
|
m_show_this_dir = new QAction(QET::Icons::FolderOnlyThis,
|
||||||
tr("Afficher uniquement ce dossier"),
|
tr("Afficher uniquement ce dossier"),
|
||||||
this);
|
this);
|
||||||
m_show_all_dir = new QAction(QET::Icons::FolderShowAll,
|
m_show_all_dir = new QAction(QET::Icons::FolderShowAll,
|
||||||
tr("Afficher tous les dossiers"), this);
|
tr("Afficher tous les dossiers"), this);
|
||||||
m_dir_propertie = new QAction(QET::Icons::FolderProperties,
|
m_dir_propertie = new QAction(QET::Icons::FolderProperties,
|
||||||
tr("Propriété du dossier"), this);
|
tr("Propriété du dossier"), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -385,10 +385,10 @@ void ElementsCollectionWidget::deleteElement()
|
|||||||
|
|
||||||
ElementsLocation loc(eci->collectionPath());
|
ElementsLocation loc(eci->collectionPath());
|
||||||
if (! (loc.isElement()
|
if (! (loc.isElement()
|
||||||
&& loc.exist()
|
&& loc.exist()
|
||||||
&& loc.isFileSystem()
|
&& loc.isFileSystem()
|
||||||
&& (loc.collectionPath().startsWith("company://")
|
&& (loc.collectionPath().startsWith("company://")
|
||||||
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
||||||
|
|
||||||
if (QET::QetMessageBox::question(
|
if (QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
@@ -401,8 +401,8 @@ void ElementsCollectionWidget::deleteElement()
|
|||||||
if (file.remove())
|
if (file.remove())
|
||||||
{
|
{
|
||||||
m_model->removeRows(m_index_at_context_menu.row(),
|
m_model->removeRows(m_index_at_context_menu.row(),
|
||||||
1,
|
1,
|
||||||
m_index_at_context_menu.parent());
|
m_index_at_context_menu.parent());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -429,10 +429,10 @@ void ElementsCollectionWidget::deleteDirectory()
|
|||||||
|
|
||||||
ElementsLocation loc (eci->collectionPath());
|
ElementsLocation loc (eci->collectionPath());
|
||||||
if (! (loc.isDirectory()
|
if (! (loc.isDirectory()
|
||||||
&& loc.exist()
|
&& loc.exist()
|
||||||
&& loc.isFileSystem()
|
&& loc.isFileSystem()
|
||||||
&& (loc.collectionPath().startsWith("company://")
|
&& (loc.collectionPath().startsWith("company://")
|
||||||
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
||||||
|
|
||||||
if (QET::QetMessageBox::question(
|
if (QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
@@ -446,8 +446,8 @@ void ElementsCollectionWidget::deleteDirectory()
|
|||||||
if (dir.removeRecursively())
|
if (dir.removeRecursively())
|
||||||
{
|
{
|
||||||
m_model->removeRows(m_index_at_context_menu.row(),
|
m_model->removeRows(m_index_at_context_menu.row(),
|
||||||
1,
|
1,
|
||||||
m_index_at_context_menu.parent());
|
m_index_at_context_menu.parent());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -529,7 +529,7 @@ void ElementsCollectionWidget::newElement()
|
|||||||
elmt_wizard.exec();
|
elmt_wizard.exec();
|
||||||
|
|
||||||
foreach (QETElementEditor *element_editor,
|
foreach (QETElementEditor *element_editor,
|
||||||
QETApp::instance()->elementEditors())
|
QETApp::instance()->elementEditors())
|
||||||
connect(element_editor,
|
connect(element_editor,
|
||||||
&QETElementEditor::saveToLocation,
|
&QETElementEditor::saveToLocation,
|
||||||
this,
|
this,
|
||||||
@@ -666,7 +666,7 @@ void ElementsCollectionWidget::reload()
|
|||||||
this,
|
this,
|
||||||
&ElementsCollectionWidget::loadingFinished);
|
&ElementsCollectionWidget::loadingFinished);
|
||||||
|
|
||||||
m_new_model->loadCollections(true, true, true, project_list);
|
m_new_model->loadCollections(true, true, true, project_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -713,7 +713,7 @@ void ElementsCollectionWidget::locationWasSaved(
|
|||||||
const ElementsLocation& location)
|
const ElementsLocation& location)
|
||||||
{
|
{
|
||||||
//Because this method update an item in the model, location must
|
//Because this method update an item in the model, location must
|
||||||
//represente an existing element (in file system of project)
|
//represent an existing element (in file system of project)
|
||||||
if (!location.exist())
|
if (!location.exist())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -781,13 +781,13 @@ void ElementsCollectionWidget::search()
|
|||||||
QModelIndexList match_index;
|
QModelIndexList match_index;
|
||||||
for (QString txt : text_list) {
|
for (QString txt : text_list) {
|
||||||
match_index << m_model->match(m_showed_index.isValid()
|
match_index << m_model->match(m_showed_index.isValid()
|
||||||
? m_model->index(0,0,m_showed_index)
|
? m_model->index(0,0,m_showed_index)
|
||||||
: m_model->index(0,0),
|
: m_model->index(0,0),
|
||||||
Qt::UserRole+1,
|
Qt::UserRole+1,
|
||||||
QVariant(txt),
|
QVariant(txt),
|
||||||
-1,
|
-1,
|
||||||
Qt::MatchContains
|
Qt::MatchContains
|
||||||
| Qt::MatchRecursive);
|
| Qt::MatchRecursive);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(QModelIndex index : match_index)
|
for(QModelIndex index : match_index)
|
||||||
|
|||||||
@@ -293,17 +293,17 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
else if (path.startsWith("common://") || path.startsWith("company://") || path.startsWith("custom://"))
|
else if (path.startsWith("common://") || path.startsWith("company://") || path.startsWith("custom://"))
|
||||||
{
|
{
|
||||||
QString p;
|
QString p;
|
||||||
if (path.startsWith("common://"))
|
if (path.startsWith("common://"))
|
||||||
{
|
{
|
||||||
tmp_path.remove("common://");
|
tmp_path.remove("common://");
|
||||||
p = QETApp::commonElementsDirN() + "/" + tmp_path;
|
p = QETApp::commonElementsDirN() + "/" + tmp_path;
|
||||||
}
|
}
|
||||||
else if (path.startsWith("company://"))
|
else if (path.startsWith("company://"))
|
||||||
{
|
{
|
||||||
tmp_path.remove("company://");
|
tmp_path.remove("company://");
|
||||||
p = QETApp::companyElementsDirN() + "/" + tmp_path;
|
p = QETApp::companyElementsDirN() + "/" + tmp_path;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tmp_path.remove("custom://");
|
tmp_path.remove("custom://");
|
||||||
p = QETApp::customElementsDirN() + "/" + tmp_path;
|
p = QETApp::customElementsDirN() + "/" + tmp_path;
|
||||||
@@ -319,19 +319,19 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
if(path_.endsWith(".elmt"))
|
if(path_.endsWith(".elmt"))
|
||||||
{
|
{
|
||||||
m_file_system_path = path_;
|
m_file_system_path = path_;
|
||||||
if (path_.startsWith(QETApp::commonElementsDirN()))
|
if (path_.startsWith(QETApp::commonElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::commonElementsDirN()+="/");
|
path_.remove(QETApp::commonElementsDirN()+="/");
|
||||||
path_.prepend("common://");
|
path_.prepend("common://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::companyElementsDirN()+="/");
|
path_.remove(QETApp::companyElementsDirN()+="/");
|
||||||
path_.prepend("company://");
|
path_.prepend("company://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
else if (path_.startsWith(QETApp::customElementsDirN()))
|
else if (path_.startsWith(QETApp::customElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::customElementsDirN()+="/");
|
path_.remove(QETApp::customElementsDirN()+="/");
|
||||||
path_.prepend("custom://");
|
path_.prepend("custom://");
|
||||||
@@ -341,19 +341,19 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_file_system_path = path_;
|
m_file_system_path = path_;
|
||||||
if (path_.startsWith(QETApp::commonElementsDirN()))
|
if (path_.startsWith(QETApp::commonElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::commonElementsDirN()+="/");
|
path_.remove(QETApp::commonElementsDirN()+="/");
|
||||||
path_.prepend("common://");
|
path_.prepend("common://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::companyElementsDirN()+="/");
|
path_.remove(QETApp::companyElementsDirN()+="/");
|
||||||
path_.prepend("company://");
|
path_.prepend("company://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
else if (path_.startsWith(QETApp::customElementsDirN()))
|
else if (path_.startsWith(QETApp::customElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::customElementsDirN()+="/");
|
path_.remove(QETApp::customElementsDirN()+="/");
|
||||||
path_.prepend("custom://");
|
path_.prepend("custom://");
|
||||||
@@ -501,23 +501,23 @@ bool ElementsLocation::isFileSystem() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsLocation::isCommonCollection
|
@brief ElementsLocation::isCommonCollection
|
||||||
@return
|
@return
|
||||||
True if this location represent an item from the common collection
|
True if this location represent an item from the common collection
|
||||||
*/
|
*/
|
||||||
bool ElementsLocation::isCommonCollection() const
|
bool ElementsLocation::isCommonCollection() const
|
||||||
{
|
{
|
||||||
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsLocation::isCompanyCollection
|
@brief ElementsLocation::isCompanyCollection
|
||||||
@return
|
@return
|
||||||
True if this location represent an item from the company collection
|
True if this location represent an item from the company collection
|
||||||
*/
|
*/
|
||||||
bool ElementsLocation::isCompanyCollection() const
|
bool ElementsLocation::isCompanyCollection() const
|
||||||
{
|
{
|
||||||
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -591,7 +591,7 @@ bool ElementsLocation::isWritable() const
|
|||||||
/**
|
/**
|
||||||
@brief ElementsLocation::projectCollection
|
@brief ElementsLocation::projectCollection
|
||||||
@return
|
@return
|
||||||
If this location represente a item in an embedded project collection,
|
If this location represents an item in an embedded project collection,
|
||||||
return this collection else return nullptr.
|
return this collection else return nullptr.
|
||||||
*/
|
*/
|
||||||
XmlElementCollection *ElementsLocation::projectCollection() const
|
XmlElementCollection *ElementsLocation::projectCollection() const
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ class ElementsLocation
|
|||||||
bool isElement() const;
|
bool isElement() const;
|
||||||
bool isDirectory() const;
|
bool isDirectory() const;
|
||||||
bool isFileSystem() const;
|
bool isFileSystem() const;
|
||||||
bool isCommonCollection() const;
|
bool isCommonCollection() const;
|
||||||
bool isCompanyCollection() const;
|
bool isCompanyCollection() const;
|
||||||
bool isCustomCollection() const;
|
bool isCustomCollection() const;
|
||||||
bool isProject() const;
|
bool isProject() const;
|
||||||
bool exist() const;
|
bool exist() const;
|
||||||
bool isWritable() const;
|
bool isWritable() const;
|
||||||
|
|||||||
@@ -35,7 +35,17 @@ static int MAX_DND_PIXMAP_HEIGHT = 375;
|
|||||||
*/
|
*/
|
||||||
ElementsTreeView::ElementsTreeView(QWidget *parent) :
|
ElementsTreeView::ElementsTreeView(QWidget *parent) :
|
||||||
QTreeView(parent)
|
QTreeView(parent)
|
||||||
{}
|
{
|
||||||
|
// force du noir sur une alternance de blanc (comme le schema) et de gris
|
||||||
|
// clair, avec du blanc sur bleu pas trop fonce pour la selection
|
||||||
|
QPalette qp = palette();
|
||||||
|
qp.setColor(QPalette::Text, Qt::black);
|
||||||
|
qp.setColor(QPalette::Base, Qt::white);
|
||||||
|
qp.setColor(QPalette::AlternateBase, QColor("#e8e8e8"));
|
||||||
|
qp.setColor(QPalette::Highlight, QColor("#678db2"));
|
||||||
|
qp.setColor(QPalette::HighlightedText, Qt::black);
|
||||||
|
setPalette(qp);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsTreeView::startDrag
|
@brief ElementsTreeView::startDrag
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ FileElementCollectionItem::FileElementCollectionItem()
|
|||||||
@return true if path exist.
|
@return true if path exist.
|
||||||
*/
|
*/
|
||||||
bool FileElementCollectionItem::setRootPath(const QString& path,
|
bool FileElementCollectionItem::setRootPath(const QString& path,
|
||||||
bool set_data,
|
bool set_data,
|
||||||
bool hide_element)
|
bool hide_element)
|
||||||
{
|
{
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
if (dir.exists())
|
if (dir.exists())
|
||||||
@@ -120,11 +120,11 @@ QString FileElementCollectionItem::localName()
|
|||||||
|
|
||||||
else if (isDir()) {
|
else if (isDir()) {
|
||||||
if (isCollectionRoot()) {
|
if (isCollectionRoot()) {
|
||||||
if (m_path == QETApp::commonElementsDirN())
|
if (m_path == QETApp::commonElementsDirN())
|
||||||
setText(QObject::tr("Collection QET"));
|
setText(QObject::tr("Collection QET"));
|
||||||
else if (m_path == QETApp::companyElementsDirN())
|
else if (m_path == QETApp::companyElementsDirN())
|
||||||
setText(QObject::tr("Collection Company"));
|
setText(QObject::tr("Collection Company"));
|
||||||
else if (m_path == QETApp::customElementsDirN())
|
else if (m_path == QETApp::customElementsDirN())
|
||||||
setText(QObject::tr("Collection utilisateur"));
|
setText(QObject::tr("Collection utilisateur"));
|
||||||
else
|
else
|
||||||
setText(QObject::tr("Collection inconnue"));
|
setText(QObject::tr("Collection inconnue"));
|
||||||
@@ -221,29 +221,29 @@ QString FileElementCollectionItem::collectionPath() const
|
|||||||
bool FileElementCollectionItem::isCollectionRoot() const
|
bool FileElementCollectionItem::isCollectionRoot() const
|
||||||
{
|
{
|
||||||
if (m_path == QETApp::commonElementsDirN()
|
if (m_path == QETApp::commonElementsDirN()
|
||||||
|| m_path == QETApp::companyElementsDirN()
|
|| m_path == QETApp::companyElementsDirN()
|
||||||
|| m_path == QETApp::customElementsDirN())
|
|| m_path == QETApp::customElementsDirN())
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief FileElementCollectionItem::isCommonCollection
|
@brief FileElementCollectionItem::isCommonCollection
|
||||||
@return True if this item represent the common collection
|
@return True if this item represent the common collection
|
||||||
*/
|
*/
|
||||||
bool FileElementCollectionItem::isCommonCollection() const
|
bool FileElementCollectionItem::isCommonCollection() const
|
||||||
{
|
{
|
||||||
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief FileElementCollectionItem::isCompanyCollection
|
@brief FileElementCollectionItem::isCompanyCollection
|
||||||
@return True if this item represent the company collection
|
@return True if this item represent the company collection
|
||||||
*/
|
*/
|
||||||
bool FileElementCollectionItem::isCompanyCollection() const
|
bool FileElementCollectionItem::isCompanyCollection() const
|
||||||
{
|
{
|
||||||
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -347,8 +347,8 @@ void FileElementCollectionItem::setUpIcon()
|
|||||||
@param hide_element
|
@param hide_element
|
||||||
*/
|
*/
|
||||||
void FileElementCollectionItem::setPathName(const QString& path_name,
|
void FileElementCollectionItem::setPathName(const QString& path_name,
|
||||||
bool set_data,
|
bool set_data,
|
||||||
bool hide_element)
|
bool hide_element)
|
||||||
{
|
{
|
||||||
m_path = path_name;
|
m_path = path_name;
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ class FileElementCollectionItem : public ElementCollectionItem
|
|||||||
QString name() const override;
|
QString name() const override;
|
||||||
QString collectionPath() const override;
|
QString collectionPath() const override;
|
||||||
bool isCollectionRoot() const override;
|
bool isCollectionRoot() const override;
|
||||||
bool isCommonCollection() const;
|
bool isCommonCollection() const;
|
||||||
bool isCompanyCollection() const;
|
bool isCompanyCollection() const;
|
||||||
bool isCustomCollection() const;
|
bool isCustomCollection() const;
|
||||||
void addChildAtPath(const QString &collection_name) override;
|
void addChildAtPath(const QString &collection_name) override;
|
||||||
|
|
||||||
void setUpData() override;
|
void setUpData() override;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RenameDialog;
|
class RenameDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenameDialog : public QDialog
|
class RenameDialog : public QDialog
|
||||||
|
|||||||
@@ -195,10 +195,10 @@ QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(
|
|||||||
*/
|
*/
|
||||||
QRectF QetGraphicsHandlerUtility::rectForArc(const QRectF &rect, qreal start_angle, qreal span_angle)
|
QRectF QetGraphicsHandlerUtility::rectForArc(const QRectF &rect, qreal start_angle, qreal span_angle)
|
||||||
{
|
{
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.arcMoveTo(rect, start_angle);
|
path.arcMoveTo(rect, start_angle);
|
||||||
path.arcTo(rect, start_angle, span_angle);
|
path.arcTo(rect, start_angle, span_angle);
|
||||||
return path.boundingRect();
|
return path.boundingRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ void ReplaceConductorDialog::setProperties(const ConductorProperties &properties
|
|||||||
ui->m_pen_cb ->setChecked (m_properties.singleLineProperties.isPen());
|
ui->m_pen_cb ->setChecked (m_properties.singleLineProperties.isPen());
|
||||||
ui->m_phase_cb ->setChecked (m_properties.singleLineProperties.phasesCount());
|
ui->m_phase_cb ->setChecked (m_properties.singleLineProperties.phasesCount());
|
||||||
ui->m_phase_slider->setValue (m_properties.singleLineProperties.phasesCount());
|
ui->m_phase_slider->setValue (m_properties.singleLineProperties.phasesCount());
|
||||||
|
|
||||||
updatePreview(false);
|
updatePreview(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ void ReplaceConductorDialog::setColorButton2(const QColor &color)
|
|||||||
|
|
||||||
void ReplaceConductorDialog::on_m_erase_formula_cb_clicked()
|
void ReplaceConductorDialog::on_m_erase_formula_cb_clicked()
|
||||||
{
|
{
|
||||||
ui->m_formula_le->setText(ui->m_erase_formula_cb->isChecked()
|
ui->m_formula_le->setText(ui->m_erase_formula_cb->isChecked()
|
||||||
? SearchAndReplaceWorker::eraseText()
|
? SearchAndReplaceWorker::eraseText()
|
||||||
: QString());
|
: QString());
|
||||||
ui->m_formula_le->setDisabled(ui->m_erase_formula_cb->isChecked());
|
ui->m_formula_le->setDisabled(ui->m_erase_formula_cb->isChecked());
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "demoterminalstrip.h"
|
#include "demoterminalstrip.h"
|
||||||
|
|
||||||
@@ -21,132 +21,132 @@ namespace TerminalStripDrawer
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*========= DemoBridge =========*/
|
/*========= DemoBridge =========*/
|
||||||
class DemoBridge : public AbstractBridgeInterface
|
class DemoBridge : public AbstractBridgeInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DemoBridge(const QUuid &uuid) :
|
DemoBridge(const QUuid &uuid) :
|
||||||
m_uuid { uuid } {}
|
m_uuid { uuid } {}
|
||||||
|
|
||||||
QUuid uuid() const override {
|
QUuid uuid() const override {
|
||||||
return m_uuid;
|
return m_uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QUuid m_uuid;
|
const QUuid m_uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DemoRealTerminal : public AbstractRealTerminalInterface
|
class DemoRealTerminal : public AbstractRealTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DemoRealTerminal(const QString &label, const QUuid &bridge) :
|
DemoRealTerminal(const QString &label, const QUuid &bridge) :
|
||||||
m_label { label },
|
m_label { label },
|
||||||
m_bridge { bridge }
|
m_bridge { bridge }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString label() const override {
|
QString label() const override {
|
||||||
return m_label;
|
return m_label;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBridged() const override {
|
bool isBridged() const override {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DemoBridge *bridge() const override {
|
DemoBridge *bridge() const override {
|
||||||
return new DemoBridge { m_bridge };
|
return new DemoBridge { m_bridge };
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_label;
|
QString m_label;
|
||||||
QUuid m_bridge;
|
QUuid m_bridge;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DemoPhysicalTerminal : public AbstractPhysicalTerminalInterface
|
class DemoPhysicalTerminal : public AbstractPhysicalTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DemoPhysicalTerminal(QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminals) :
|
DemoPhysicalTerminal(QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminals) :
|
||||||
m_real_terminals { real_terminals}
|
m_real_terminals { real_terminals}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const override {
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const override {
|
||||||
return m_real_terminals;
|
return m_real_terminals;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<QSharedPointer<AbstractRealTerminalInterface>> m_real_terminals;
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> m_real_terminals;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*========= DemoTerminalStrip =========*/
|
/*========= DemoTerminalStrip =========*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DemoTerminalStrip::DemoTerminalStrip
|
* @brief DemoTerminalStrip::DemoTerminalStrip
|
||||||
*/
|
*/
|
||||||
DemoTerminalStrip::DemoTerminalStrip()
|
DemoTerminalStrip::DemoTerminalStrip()
|
||||||
{
|
{
|
||||||
build();
|
build();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface> > DemoTerminalStrip::physicalTerminal() const
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface> > DemoTerminalStrip::physicalTerminal() const
|
||||||
{
|
{
|
||||||
return m_physical_terminal;
|
return m_physical_terminal;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DemoTerminalStrip::build()
|
void DemoTerminalStrip::build()
|
||||||
{
|
{
|
||||||
QUuid lvl_1 = QUuid::createUuid();
|
QUuid lvl_1 = QUuid::createUuid();
|
||||||
QUuid lvl_2 = QUuid::createUuid();
|
QUuid lvl_2 = QUuid::createUuid();
|
||||||
QUuid lvl_3 = QUuid::createUuid();
|
QUuid lvl_3 = QUuid::createUuid();
|
||||||
QUuid lvl_4 = QUuid::createUuid();
|
QUuid lvl_4 = QUuid::createUuid();
|
||||||
|
|
||||||
QVector <QSharedPointer<AbstractRealTerminalInterface>> real_terminals_vector;
|
QVector <QSharedPointer<AbstractRealTerminalInterface>> real_terminals_vector;
|
||||||
|
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("24vdc"),
|
new DemoRealTerminal( QStringLiteral("24vdc"),
|
||||||
lvl_1)};
|
lvl_1)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("0vdc"),
|
new DemoRealTerminal( QStringLiteral("0vdc"),
|
||||||
lvl_2)};
|
lvl_2)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("signal"),
|
new DemoRealTerminal( QStringLiteral("signal"),
|
||||||
lvl_3)};
|
lvl_3)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("teach"),
|
new DemoRealTerminal( QStringLiteral("teach"),
|
||||||
lvl_4)};
|
lvl_4)};
|
||||||
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
||||||
new DemoPhysicalTerminal {real_terminals_vector}};
|
new DemoPhysicalTerminal {real_terminals_vector}};
|
||||||
|
|
||||||
real_terminals_vector.clear();
|
real_terminals_vector.clear();
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("24vdc"),
|
new DemoRealTerminal( QStringLiteral("24vdc"),
|
||||||
lvl_1)};
|
lvl_1)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("0vdc"),
|
new DemoRealTerminal( QStringLiteral("0vdc"),
|
||||||
lvl_2)};
|
lvl_2)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("signal"),
|
new DemoRealTerminal( QStringLiteral("signal"),
|
||||||
lvl_3)};
|
lvl_3)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("teach"),
|
new DemoRealTerminal( QStringLiteral("teach"),
|
||||||
lvl_4)};
|
lvl_4)};
|
||||||
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
||||||
new DemoPhysicalTerminal {real_terminals_vector}};
|
new DemoPhysicalTerminal {real_terminals_vector}};
|
||||||
|
|
||||||
real_terminals_vector.clear();
|
real_terminals_vector.clear();
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("24vdc"),
|
new DemoRealTerminal( QStringLiteral("24vdc"),
|
||||||
lvl_1)};
|
lvl_1)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("0vdc"),
|
new DemoRealTerminal( QStringLiteral("0vdc"),
|
||||||
lvl_2)};
|
lvl_2)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("signal"),
|
new DemoRealTerminal( QStringLiteral("signal"),
|
||||||
lvl_3)};
|
lvl_3)};
|
||||||
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
real_terminals_vector << QSharedPointer<AbstractRealTerminalInterface> {
|
||||||
new DemoRealTerminal( QStringLiteral("teach"),
|
new DemoRealTerminal( QStringLiteral("teach"),
|
||||||
lvl_4)};
|
lvl_4)};
|
||||||
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
m_physical_terminal << QSharedPointer<AbstractPhysicalTerminalInterface> {
|
||||||
new DemoPhysicalTerminal {real_terminals_vector}};
|
new DemoPhysicalTerminal {real_terminals_vector}};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef DEMOTERMINALSTRIP_H
|
#ifndef DEMOTERMINALSTRIP_H
|
||||||
#define DEMOTERMINALSTRIP_H
|
#define DEMOTERMINALSTRIP_H
|
||||||
@@ -24,25 +24,25 @@ namespace TerminalStripDrawer {
|
|||||||
|
|
||||||
class DemoTerminalStrip : public AbstractTerminalStripInterface
|
class DemoTerminalStrip : public AbstractTerminalStripInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DemoTerminalStrip();
|
DemoTerminalStrip();
|
||||||
|
|
||||||
QString installation() const override {
|
QString installation() const override {
|
||||||
return QStringLiteral("=INST");
|
return QStringLiteral("=INST");
|
||||||
}
|
}
|
||||||
QString location() const override {
|
QString location() const override {
|
||||||
return QStringLiteral("+LOC" );
|
return QStringLiteral("+LOC" );
|
||||||
}
|
}
|
||||||
QString name() const override {
|
QString name() const override {
|
||||||
return QStringLiteral("X1");
|
return QStringLiteral("X1");
|
||||||
}
|
}
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const override;
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void build();
|
void build();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> m_physical_terminal;
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> m_physical_terminal;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //End namespace TerminalStripDrawer
|
} //End namespace TerminalStripDrawer
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ class TerminalStripLayoutPattern
|
|||||||
int m_bridge_point_d{5};
|
int m_bridge_point_d{5};
|
||||||
QVector<int> m_bridge_point_y_offset{50,70,90,110};
|
QVector<int> m_bridge_point_y_offset{50,70,90,110};
|
||||||
|
|
||||||
QUuid m_uuid{QUuid::createUuid()};
|
QUuid m_uuid{QUuid::createUuid()};
|
||||||
QString m_name;
|
QString m_name;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateHeaderTextOption();
|
void updateHeaderTextOption();
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "terminalstriplayoutshandler.h"
|
#include "terminalstriplayoutshandler.h"
|
||||||
|
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
TerminalStripLayoutsHandler::TerminalStripLayoutsHandler()
|
TerminalStripLayoutsHandler::TerminalStripLayoutsHandler()
|
||||||
{
|
{
|
||||||
|
|
||||||
m_default_layout = QSharedPointer<TerminalStripLayoutPattern>::create();
|
m_default_layout = QSharedPointer<TerminalStripLayoutPattern>::create();
|
||||||
m_default_layout->m_name = QObject::tr("Disposition par défaut");
|
m_default_layout->m_name = QObject::tr("Disposition par défaut");
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<TerminalStripLayoutPattern> TerminalStripLayoutsHandler::defaultLayout()
|
QSharedPointer<TerminalStripLayoutPattern> TerminalStripLayoutsHandler::defaultLayout()
|
||||||
{
|
{
|
||||||
return m_default_layout;
|
return m_default_layout;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef TERMINALSTRIPLAYOUTSHANDLER_H
|
#ifndef TERMINALSTRIPLAYOUTSHANDLER_H
|
||||||
#define TERMINALSTRIPLAYOUTSHANDLER_H
|
#define TERMINALSTRIPLAYOUTSHANDLER_H
|
||||||
@@ -29,13 +29,13 @@
|
|||||||
*/
|
*/
|
||||||
class TerminalStripLayoutsHandler
|
class TerminalStripLayoutsHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TerminalStripLayoutsHandler();
|
TerminalStripLayoutsHandler();
|
||||||
QSharedPointer<TerminalStripLayoutPattern> defaultLayout();
|
QSharedPointer<TerminalStripLayoutPattern> defaultLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSet<QSharedPointer<TerminalStripLayoutPattern>> m_layout_set;
|
QSet<QSharedPointer<TerminalStripLayoutPattern>> m_layout_set;
|
||||||
QSharedPointer<TerminalStripLayoutPattern> m_default_layout;
|
QSharedPointer<TerminalStripLayoutPattern> m_default_layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TERMINALSTRIPLAYOUTSHANDLER_H
|
#endif // TERMINALSTRIPLAYOUTSHANDLER_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "terminalstripdrawer.h"
|
#include "terminalstripdrawer.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
@@ -26,9 +26,9 @@ namespace TerminalStripDrawer {
|
|||||||
* @param pattern
|
* @param pattern
|
||||||
*/
|
*/
|
||||||
TerminalStripDrawer::TerminalStripDrawer(QSharedPointer<AbstractTerminalStripInterface> strip,
|
TerminalStripDrawer::TerminalStripDrawer(QSharedPointer<AbstractTerminalStripInterface> strip,
|
||||||
QSharedPointer<TerminalStripLayoutPattern> layout) :
|
QSharedPointer<TerminalStripLayoutPattern> layout) :
|
||||||
m_strip { strip },
|
m_strip { strip },
|
||||||
m_pattern { layout }
|
m_pattern { layout }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void TerminalStripDrawer::setStrip(QSharedPointer<AbstractTerminalStripInterface> strip)
|
void TerminalStripDrawer::setStrip(QSharedPointer<AbstractTerminalStripInterface> strip)
|
||||||
@@ -42,248 +42,248 @@ void TerminalStripDrawer::setStrip(QSharedPointer<AbstractTerminalStripInterface
|
|||||||
*/
|
*/
|
||||||
void TerminalStripDrawer::paint(QPainter *painter)
|
void TerminalStripDrawer::paint(QPainter *painter)
|
||||||
{
|
{
|
||||||
if (m_strip && m_pattern)
|
if (m_strip && m_pattern)
|
||||||
{
|
{
|
||||||
//To draw text, QPainter need a Qrect. Instead of create an instance
|
//To draw text, QPainter need a Qrect. Instead of create an instance
|
||||||
//for each text, we re-use the same instance of QRect.
|
//for each text, we re-use the same instance of QRect.
|
||||||
QRect text_rect;
|
QRect text_rect;
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
auto pen_{painter->pen()};
|
auto pen_{painter->pen()};
|
||||||
pen_.setColor(Qt::black);
|
pen_.setColor(Qt::black);
|
||||||
pen_.setWidth(1);
|
pen_.setWidth(1);
|
||||||
|
|
||||||
auto brush_ = painter->brush();
|
auto brush_ = painter->brush();
|
||||||
brush_.setColor(Qt::white);
|
brush_.setColor(Qt::white);
|
||||||
|
|
||||||
painter->setPen(pen_);
|
painter->setPen(pen_);
|
||||||
painter->setBrush(brush_);
|
painter->setBrush(brush_);
|
||||||
|
|
||||||
if (m_preview_draw)
|
if (m_preview_draw)
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setPen(Qt::blue);
|
painter->setPen(Qt::blue);
|
||||||
painter->drawRect(boundingRect());
|
painter->drawRect(boundingRect());
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw header
|
//Draw header
|
||||||
painter->drawRect(m_pattern->m_header_rect);
|
painter->drawRect(m_pattern->m_header_rect);
|
||||||
|
|
||||||
//Draw the header text
|
//Draw the header text
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
if (m_pattern->m_header_text_orientation == Qt::Horizontal)
|
if (m_pattern->m_header_text_orientation == Qt::Horizontal)
|
||||||
{
|
{
|
||||||
text_rect.setRect(0,m_pattern->m_header_rect.y(),m_pattern->m_header_rect.width(),m_pattern->m_header_rect.height());
|
text_rect.setRect(0,m_pattern->m_header_rect.y(),m_pattern->m_header_rect.width(),m_pattern->m_header_rect.height());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
painter->translate(m_pattern->m_header_rect.bottomLeft());
|
painter->translate(m_pattern->m_header_rect.bottomLeft());
|
||||||
painter->rotate(270);
|
painter->rotate(270);
|
||||||
text_rect.setRect(0,0,m_pattern->m_header_rect.height(),m_pattern->m_header_rect.width());
|
text_rect.setRect(0,0,m_pattern->m_header_rect.height(),m_pattern->m_header_rect.width());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto text_{m_strip->installation() + " " + m_strip->location() + " " + m_strip->name()};
|
const auto text_{m_strip->installation() + " " + m_strip->location() + " " + m_strip->name()};
|
||||||
painter->drawText(text_rect, text_, m_pattern->headerTextOption());
|
painter->drawText(text_rect, text_, m_pattern->headerTextOption());
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
//Move painter pos to next drawing
|
//Move painter pos to next drawing
|
||||||
painter->translate(m_pattern->m_header_rect.width(),0);
|
painter->translate(m_pattern->m_header_rect.width(),0);
|
||||||
|
|
||||||
int x_offset{m_pattern->m_header_rect.width()};
|
int x_offset{m_pattern->m_header_rect.width()};
|
||||||
|
|
||||||
//Draw spacer
|
//Draw spacer
|
||||||
painter->drawRect(m_pattern->m_spacer_rect);
|
painter->drawRect(m_pattern->m_spacer_rect);
|
||||||
//Move painter pos to next drawing
|
//Move painter pos to next drawing
|
||||||
painter->translate(m_pattern->m_spacer_rect.width(),0);
|
painter->translate(m_pattern->m_spacer_rect.width(),0);
|
||||||
x_offset += m_pattern->m_spacer_rect.width();
|
x_offset += m_pattern->m_spacer_rect.width();
|
||||||
|
|
||||||
|
|
||||||
//Draw terminals
|
//Draw terminals
|
||||||
const auto terminals_text_rect{m_pattern->m_terminals_text_rect};
|
const auto terminals_text_rect{m_pattern->m_terminals_text_rect};
|
||||||
const auto terminals_text_orientation{m_pattern->m_terminals_text_orientation};
|
const auto terminals_text_orientation{m_pattern->m_terminals_text_orientation};
|
||||||
const auto terminals_text_option{m_pattern->terminalsTextOption()};
|
const auto terminals_text_option{m_pattern->terminalsTextOption()};
|
||||||
QRect terminal_rect;
|
QRect terminal_rect;
|
||||||
|
|
||||||
QHash<QUuid, QVector<QPointF>> bridges_anchor_points;
|
QHash<QUuid, QVector<QPointF>> bridges_anchor_points;
|
||||||
|
|
||||||
//Loop over physical terminals
|
//Loop over physical terminals
|
||||||
for (const auto &physical_t : m_strip->physicalTerminal())
|
for (const auto &physical_t : m_strip->physicalTerminal())
|
||||||
{
|
{
|
||||||
//Get the good offset according to how many level have the current physical terminal
|
//Get the good offset according to how many level have the current physical terminal
|
||||||
const QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminal_vector{physical_t->realTerminals()};
|
const QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminal_vector{physical_t->realTerminals()};
|
||||||
const auto real_t_count{real_terminal_vector.size()};
|
const auto real_t_count{real_terminal_vector.size()};
|
||||||
const auto offset_{4 - real_t_count};
|
const auto offset_{4 - real_t_count};
|
||||||
|
|
||||||
//Loop over real terminals
|
//Loop over real terminals
|
||||||
for (auto i=0 ; i<real_t_count ; ++i)
|
for (auto i=0 ; i<real_t_count ; ++i)
|
||||||
{
|
{
|
||||||
const auto index_ = offset_ + i;
|
const auto index_ = offset_ + i;
|
||||||
if (index_ >= 4) {
|
if (index_ >= 4) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
terminal_rect = m_pattern->m_terminal_rect[index_];
|
terminal_rect = m_pattern->m_terminal_rect[index_];
|
||||||
//Draw terminal rect
|
//Draw terminal rect
|
||||||
painter->drawRect(terminal_rect);
|
painter->drawRect(terminal_rect);
|
||||||
//Draw a stronger line if the current terminal have level
|
//Draw a stronger line if the current terminal have level
|
||||||
//and the current level is the first
|
//and the current level is the first
|
||||||
if (real_t_count > 1 && i == 0)
|
if (real_t_count > 1 && i == 0)
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
pen_ = painter->pen();
|
pen_ = painter->pen();
|
||||||
pen_.setWidth(4);
|
pen_.setWidth(4);
|
||||||
pen_.setCapStyle(Qt::FlatCap);
|
pen_.setCapStyle(Qt::FlatCap);
|
||||||
painter->setPen(pen_);
|
painter->setPen(pen_);
|
||||||
const auto p1 { terminal_rect.topLeft() };
|
const auto p1 { terminal_rect.topLeft() };
|
||||||
//We can't use terminal_rect.bottomLeft for p2 because
|
//We can't use terminal_rect.bottomLeft for p2 because
|
||||||
//the returned value deviate from the true value
|
//the returned value deviate from the true value
|
||||||
//(see Qt documentation about QRect)
|
//(see Qt documentation about QRect)
|
||||||
const QPoint p2 { p1.x(), p1.y() + terminal_rect.height() };
|
const QPoint p2 { p1.x(), p1.y() + terminal_rect.height() };
|
||||||
painter->drawLine(p1, p2);
|
painter->drawLine(p1, p2);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw text
|
//Draw text
|
||||||
painter->save();
|
painter->save();
|
||||||
if (terminals_text_orientation[index_] == Qt::Horizontal)
|
if (terminals_text_orientation[index_] == Qt::Horizontal)
|
||||||
{
|
{
|
||||||
text_rect = terminals_text_rect[index_];
|
text_rect = terminals_text_rect[index_];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto rect_{terminals_text_rect[index_]};
|
const auto rect_{terminals_text_rect[index_]};
|
||||||
painter->translate(rect_.bottomLeft());
|
painter->translate(rect_.bottomLeft());
|
||||||
painter->rotate(270);
|
painter->rotate(270);
|
||||||
text_rect.setRect(0, 0, rect_.height(), terminal_rect.width());
|
text_rect.setRect(0, 0, rect_.height(), terminal_rect.width());
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto shared_real_terminal{real_terminal_vector[i]};
|
const auto shared_real_terminal{real_terminal_vector[i]};
|
||||||
painter->drawText(text_rect,
|
painter->drawText(text_rect,
|
||||||
shared_real_terminal ? shared_real_terminal->label() : QLatin1String(),
|
shared_real_terminal ? shared_real_terminal->label() : QLatin1String(),
|
||||||
terminals_text_option[index_]);
|
terminals_text_option[index_]);
|
||||||
|
|
||||||
if (m_preview_draw)
|
if (m_preview_draw)
|
||||||
{
|
{
|
||||||
painter->setPen(Qt::blue);
|
painter->setPen(Qt::blue);
|
||||||
painter->drawRect(text_rect);
|
painter->drawRect(text_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
//Add bridge anchor
|
//Add bridge anchor
|
||||||
if (shared_real_terminal->isBridged())
|
if (shared_real_terminal->isBridged())
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
if (QScopedPointer<AbstractBridgeInterface> bridge_ {
|
if (QScopedPointer<AbstractBridgeInterface> bridge_ {
|
||||||
shared_real_terminal->bridge() })
|
shared_real_terminal->bridge() })
|
||||||
{
|
{
|
||||||
const auto x_anchor{terminal_rect.width()/2};
|
const auto x_anchor{terminal_rect.width()/2};
|
||||||
const auto y_anchor {m_pattern->m_bridge_point_y_offset[index_]};
|
const auto y_anchor {m_pattern->m_bridge_point_y_offset[index_]};
|
||||||
const auto radius_anchor{m_pattern->m_bridge_point_d/2};
|
const auto radius_anchor{m_pattern->m_bridge_point_d/2};
|
||||||
|
|
||||||
painter->setBrush(Qt::SolidPattern);
|
painter->setBrush(Qt::SolidPattern);
|
||||||
painter->drawEllipse(QPointF(x_anchor, y_anchor),
|
painter->drawEllipse(QPointF(x_anchor, y_anchor),
|
||||||
radius_anchor, radius_anchor);
|
radius_anchor, radius_anchor);
|
||||||
|
|
||||||
auto anchor_points{bridges_anchor_points.value(bridge_->uuid())};
|
auto anchor_points{bridges_anchor_points.value(bridge_->uuid())};
|
||||||
anchor_points.append(QPointF(x_offset + x_anchor, y_anchor));
|
anchor_points.append(QPointF(x_offset + x_anchor, y_anchor));
|
||||||
bridges_anchor_points.insert(bridge_->uuid(), anchor_points);
|
bridges_anchor_points.insert(bridge_->uuid(), anchor_points);
|
||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Move painter pos to next drawing
|
//Move painter pos to next drawing
|
||||||
painter->translate(terminal_rect.width(),0);
|
painter->translate(terminal_rect.width(),0);
|
||||||
x_offset += terminal_rect.width();
|
x_offset += terminal_rect.width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
//Draw the bridges
|
//Draw the bridges
|
||||||
for (const auto &points_ : qAsConst(bridges_anchor_points))
|
for (const auto &points_ : qAsConst(bridges_anchor_points))
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
auto pen_{painter->pen()};
|
auto pen_{painter->pen()};
|
||||||
pen_.setWidth(2);
|
pen_.setWidth(2);
|
||||||
painter->setPen(pen_);
|
painter->setPen(pen_);
|
||||||
painter->drawPolyline(QPolygonF{points_});
|
painter->drawPolyline(QPolygonF{points_});
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF TerminalStripDrawer::boundingRect() const
|
QRectF TerminalStripDrawer::boundingRect() const
|
||||||
{
|
{
|
||||||
return QRect{0, 0, width(), height()};;
|
return QRect{0, 0, width(), height()};;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripDrawer::setLayout(QSharedPointer<TerminalStripLayoutPattern> layout)
|
void TerminalStripDrawer::setLayout(QSharedPointer<TerminalStripLayoutPattern> layout)
|
||||||
{
|
{
|
||||||
m_pattern = layout;
|
m_pattern = layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TerminalStripDrawer::haveLayout() const
|
bool TerminalStripDrawer::haveLayout() const
|
||||||
{
|
{
|
||||||
return !m_pattern.isNull();
|
return !m_pattern.isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripDrawer::setPreviewDraw(bool draw) {
|
void TerminalStripDrawer::setPreviewDraw(bool draw) {
|
||||||
m_preview_draw = draw;
|
m_preview_draw = draw;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerminalStripDrawer::height() const
|
int TerminalStripDrawer::height() const
|
||||||
{
|
{
|
||||||
if (m_pattern)
|
if (m_pattern)
|
||||||
{
|
{
|
||||||
auto height_{m_pattern->m_header_rect.y() + m_pattern->m_header_rect.height()};
|
auto height_{m_pattern->m_header_rect.y() + m_pattern->m_header_rect.height()};
|
||||||
|
|
||||||
height_ = std::max(height_, m_pattern->m_spacer_rect.y() + m_pattern->m_spacer_rect.height());
|
height_ = std::max(height_, m_pattern->m_spacer_rect.y() + m_pattern->m_spacer_rect.height());
|
||||||
|
|
||||||
for (const auto &rect : m_pattern->m_terminal_rect) {
|
for (const auto &rect : m_pattern->m_terminal_rect) {
|
||||||
height_ = std::max(height_, rect.y() + rect.height());
|
height_ = std::max(height_, rect.y() + rect.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
return height_;
|
return height_;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerminalStripDrawer::width() const
|
int TerminalStripDrawer::width() const
|
||||||
{
|
{
|
||||||
if (m_pattern)
|
if (m_pattern)
|
||||||
{
|
{
|
||||||
int width_{m_pattern->m_header_rect.width() + m_pattern->m_spacer_rect.width()};
|
int width_{m_pattern->m_header_rect.width() + m_pattern->m_spacer_rect.width()};
|
||||||
|
|
||||||
if (m_strip)
|
if (m_strip)
|
||||||
{
|
{
|
||||||
//Loop over physical terminals
|
//Loop over physical terminals
|
||||||
for (const auto &physical_t : m_strip->physicalTerminal())
|
for (const auto &physical_t : m_strip->physicalTerminal())
|
||||||
{
|
{
|
||||||
//Get the good offset according to how many level have the current physical terminal
|
//Get the good offset according to how many level have the current physical terminal
|
||||||
const QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminal_vector{physical_t->realTerminals()};
|
const QVector<QSharedPointer<AbstractRealTerminalInterface>> real_terminal_vector{physical_t->realTerminals()};
|
||||||
const auto real_t_count{real_terminal_vector.size()};
|
const auto real_t_count{real_terminal_vector.size()};
|
||||||
const auto offset_{4 - real_t_count};
|
const auto offset_{4 - real_t_count};
|
||||||
|
|
||||||
//Loop over real terminals
|
//Loop over real terminals
|
||||||
for (auto i=0 ; i<real_t_count ; ++i)
|
for (auto i=0 ; i<real_t_count ; ++i)
|
||||||
{
|
{
|
||||||
const auto index_ = offset_ + i;
|
const auto index_ = offset_ + i;
|
||||||
if (index_ >= 4) {
|
if (index_ >= 4) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
width_ += m_pattern->m_terminal_rect[index_].width();
|
width_ += m_pattern->m_terminal_rect[index_].width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return width_;
|
return width_;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} //End namespace TerminalStripDrawer
|
} //End namespace TerminalStripDrawer
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef TERMINALSTRIPDRAWER_H
|
#ifndef TERMINALSTRIPDRAWER_H
|
||||||
#define TERMINALSTRIPDRAWER_H
|
#define TERMINALSTRIPDRAWER_H
|
||||||
@@ -27,67 +27,67 @@ class TerminalStrip;
|
|||||||
|
|
||||||
namespace TerminalStripDrawer
|
namespace TerminalStripDrawer
|
||||||
{
|
{
|
||||||
class AbstractBridgeInterface
|
class AbstractBridgeInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractBridgeInterface() {}
|
AbstractBridgeInterface() {}
|
||||||
virtual ~AbstractBridgeInterface() {}
|
virtual ~AbstractBridgeInterface() {}
|
||||||
virtual QUuid uuid() const = 0;
|
virtual QUuid uuid() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractRealTerminalInterface
|
class AbstractRealTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractRealTerminalInterface() {}
|
AbstractRealTerminalInterface() {}
|
||||||
virtual ~AbstractRealTerminalInterface() {}
|
virtual ~AbstractRealTerminalInterface() {}
|
||||||
virtual QString label() const = 0;
|
virtual QString label() const = 0;
|
||||||
virtual bool isBridged() const = 0;
|
virtual bool isBridged() const = 0;
|
||||||
virtual AbstractBridgeInterface* bridge() const = 0;
|
virtual AbstractBridgeInterface* bridge() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractPhysicalTerminalInterface
|
class AbstractPhysicalTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractPhysicalTerminalInterface() {}
|
AbstractPhysicalTerminalInterface() {}
|
||||||
virtual ~AbstractPhysicalTerminalInterface() {}
|
virtual ~AbstractPhysicalTerminalInterface() {}
|
||||||
virtual QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const = 0;
|
virtual QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AbstractTerminalStripInterface
|
class AbstractTerminalStripInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AbstractTerminalStripInterface() {}
|
AbstractTerminalStripInterface() {}
|
||||||
virtual ~AbstractTerminalStripInterface() {}
|
virtual ~AbstractTerminalStripInterface() {}
|
||||||
virtual QString installation() const = 0;
|
virtual QString installation() const = 0;
|
||||||
virtual QString location() const = 0;
|
virtual QString location() const = 0;
|
||||||
virtual QString name() const = 0;
|
virtual QString name() const = 0;
|
||||||
virtual QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const = 0;
|
virtual QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TerminalStripDrawer
|
class TerminalStripDrawer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TerminalStripDrawer(QSharedPointer<AbstractTerminalStripInterface> strip = QSharedPointer<AbstractTerminalStripInterface> { nullptr },
|
TerminalStripDrawer(QSharedPointer<AbstractTerminalStripInterface> strip = QSharedPointer<AbstractTerminalStripInterface> { nullptr },
|
||||||
QSharedPointer<TerminalStripLayoutPattern> layout = QSharedPointer<TerminalStripLayoutPattern>());
|
QSharedPointer<TerminalStripLayoutPattern> layout = QSharedPointer<TerminalStripLayoutPattern>());
|
||||||
|
|
||||||
void setStrip(QSharedPointer<AbstractTerminalStripInterface> strip);
|
void setStrip(QSharedPointer<AbstractTerminalStripInterface> strip);
|
||||||
void paint(QPainter *painter);
|
void paint(QPainter *painter);
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
|
|
||||||
void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
|
void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
|
||||||
bool haveLayout() const;
|
bool haveLayout() const;
|
||||||
|
|
||||||
void setPreviewDraw(bool draw = true);
|
void setPreviewDraw(bool draw = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int height() const;
|
int height() const;
|
||||||
int width() const;
|
int width() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedPointer <AbstractTerminalStripInterface> m_strip;
|
QSharedPointer <AbstractTerminalStripInterface> m_strip;
|
||||||
QSharedPointer<TerminalStripLayoutPattern> m_pattern;
|
QSharedPointer<TerminalStripLayoutPattern> m_pattern;
|
||||||
bool m_preview_draw { false };
|
bool m_preview_draw { false };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TERMINALSTRIPDRAWER_H
|
#endif // TERMINALSTRIPDRAWER_H
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2022 The QElectroTech Team
|
Copyright 2006-2022 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
@@ -26,35 +26,35 @@
|
|||||||
#include "trueterminalstrip.h"
|
#include "trueterminalstrip.h"
|
||||||
|
|
||||||
TerminalStripItem::TerminalStripItem(QPointer<TerminalStrip> strip,
|
TerminalStripItem::TerminalStripItem(QPointer<TerminalStrip> strip,
|
||||||
QGraphicsItem *parent) :
|
QGraphicsItem *parent) :
|
||||||
QetGraphicsItem { parent },
|
QetGraphicsItem { parent },
|
||||||
m_strip { strip },
|
m_strip { strip },
|
||||||
m_drawer { QSharedPointer<TerminalStripDrawer::TrueTerminalStrip> {
|
m_drawer { QSharedPointer<TerminalStripDrawer::TrueTerminalStrip> {
|
||||||
new TerminalStripDrawer::TrueTerminalStrip { strip }}
|
new TerminalStripDrawer::TrueTerminalStrip { strip }}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setDefaultLayout();
|
setDefaultLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminalStripItem::TerminalStripItem(QGraphicsItem *parent) :
|
TerminalStripItem::TerminalStripItem(QGraphicsItem *parent) :
|
||||||
QetGraphicsItem { parent }
|
QetGraphicsItem { parent }
|
||||||
{
|
{
|
||||||
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::setTerminalStrip(TerminalStrip *strip)
|
void TerminalStripItem::setTerminalStrip(TerminalStrip *strip)
|
||||||
{
|
{
|
||||||
m_strip = strip;
|
m_strip = strip;
|
||||||
m_drawer.setStrip(QSharedPointer<TerminalStripDrawer::TrueTerminalStrip> {
|
m_drawer.setStrip(QSharedPointer<TerminalStripDrawer::TrueTerminalStrip> {
|
||||||
new TerminalStripDrawer::TrueTerminalStrip { strip }});
|
new TerminalStripDrawer::TrueTerminalStrip { strip }});
|
||||||
m_pending_strip_uuid = QUuid();
|
m_pending_strip_uuid = QUuid();
|
||||||
|
|
||||||
if (!m_drawer.haveLayout()) {
|
if (!m_drawer.haveLayout()) {
|
||||||
setDefaultLayout();
|
setDefaultLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,7 +62,7 @@ void TerminalStripItem::setTerminalStrip(TerminalStrip *strip)
|
|||||||
* @return The strip drawed by this item
|
* @return The strip drawed by this item
|
||||||
*/
|
*/
|
||||||
QPointer<TerminalStrip> TerminalStripItem::terminalStrip() const {
|
QPointer<TerminalStrip> TerminalStripItem::terminalStrip() const {
|
||||||
return m_strip;
|
return m_strip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void TerminalStripItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
@@ -91,42 +91,42 @@ QRectF TerminalStripItem::boundingRect() const
|
|||||||
* @return usual name of this item
|
* @return usual name of this item
|
||||||
*/
|
*/
|
||||||
QString TerminalStripItem::name() const {
|
QString TerminalStripItem::name() const {
|
||||||
return tr("plan de bornes");
|
return tr("plan de bornes");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
void TerminalStripItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED (event);
|
Q_UNUSED (event);
|
||||||
|
|
||||||
if (m_strip) {
|
if (m_strip) {
|
||||||
TerminalStripEditorWindow::edit(m_strip);
|
TerminalStripEditorWindow::edit(m_strip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::refreshPending()
|
void TerminalStripItem::refreshPending()
|
||||||
{
|
{
|
||||||
if (!m_pending_strip_uuid.isNull()
|
if (!m_pending_strip_uuid.isNull()
|
||||||
&& diagram()
|
&& diagram()
|
||||||
&& diagram()->project())
|
&& diagram()->project())
|
||||||
{
|
{
|
||||||
for (const auto &strip_ : diagram()->project()->terminalStrip()) {
|
for (const auto &strip_ : diagram()->project()->terminalStrip()) {
|
||||||
if (strip_->uuid() == m_pending_strip_uuid) {
|
if (strip_->uuid() == m_pending_strip_uuid) {
|
||||||
setTerminalStrip(strip_);
|
setTerminalStrip(strip_);
|
||||||
m_pending_strip_uuid = QUuid();
|
m_pending_strip_uuid = QUuid();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::setLayout(QSharedPointer<TerminalStripLayoutPattern> layout)
|
void TerminalStripItem::setLayout(QSharedPointer<TerminalStripLayoutPattern> layout)
|
||||||
{
|
{
|
||||||
m_drawer.setLayout(layout);
|
m_drawer.setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripItem::setDefaultLayout()
|
void TerminalStripItem::setDefaultLayout()
|
||||||
{
|
{
|
||||||
if (m_strip && m_strip->project()) {
|
if (m_strip && m_strip->project()) {
|
||||||
m_drawer.setLayout(m_strip->project()->projectPropertiesHandler().terminalStripLayoutHandler().defaultLayout());
|
m_drawer.setLayout(m_strip->project()->projectPropertiesHandler().terminalStripLayoutHandler().defaultLayout());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,16 +28,16 @@ class TerminalStrip;
|
|||||||
|
|
||||||
class TerminalStripItem : public QetGraphicsItem
|
class TerminalStripItem : public QetGraphicsItem
|
||||||
{
|
{
|
||||||
friend class TerminalStripItemXml;
|
friend class TerminalStripItemXml;
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TerminalStripItem(QPointer<TerminalStrip> strip, QGraphicsItem *parent = nullptr);
|
TerminalStripItem(QPointer<TerminalStrip> strip, QGraphicsItem *parent = nullptr);
|
||||||
TerminalStripItem(QGraphicsItem *parent = nullptr);
|
TerminalStripItem(QGraphicsItem *parent = nullptr);
|
||||||
|
|
||||||
void setTerminalStrip(TerminalStrip *strip);
|
void setTerminalStrip(TerminalStrip *strip);
|
||||||
QPointer<TerminalStrip> terminalStrip() const;
|
QPointer<TerminalStrip> terminalStrip() const;
|
||||||
|
|
||||||
enum {Type = UserType + 1011};
|
enum {Type = UserType + 1011};
|
||||||
int type() const override {return Type;}
|
int type() const override {return Type;}
|
||||||
@@ -46,17 +46,17 @@ class TerminalStripItem : public QetGraphicsItem
|
|||||||
QRectF boundingRect() const override;
|
QRectF boundingRect() const override;
|
||||||
QString name() const override;
|
QString name() const override;
|
||||||
|
|
||||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
|
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
|
||||||
void refreshPending();
|
void refreshPending();
|
||||||
void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
|
void setLayout(QSharedPointer<TerminalStripLayoutPattern> layout);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setDefaultLayout();
|
void setDefaultLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<TerminalStrip> m_strip;
|
QPointer<TerminalStrip> m_strip;
|
||||||
TerminalStripDrawer::TerminalStripDrawer m_drawer;
|
TerminalStripDrawer::TerminalStripDrawer m_drawer;
|
||||||
QUuid m_pending_strip_uuid;
|
QUuid m_pending_strip_uuid;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "trueterminalstrip.h"
|
#include "trueterminalstrip.h"
|
||||||
#include "../physicalterminal.h"
|
#include "../physicalterminal.h"
|
||||||
@@ -25,109 +25,109 @@
|
|||||||
|
|
||||||
namespace TerminalStripDrawer
|
namespace TerminalStripDrawer
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @brief TrueTerminalStrip::TrueTerminalStrip
|
* @brief TrueTerminalStrip::TrueTerminalStrip
|
||||||
* Constructor, this class don't take ownership of @a strip
|
* Constructor, this class don't take ownership of @a strip
|
||||||
* @param strip
|
* @param strip
|
||||||
*/
|
*/
|
||||||
TrueTerminalStrip::TrueTerminalStrip(TerminalStrip *strip) :
|
TrueTerminalStrip::TrueTerminalStrip(TerminalStrip *strip) :
|
||||||
m_strip { strip }
|
m_strip { strip }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
QString TrueTerminalStrip::installation() const
|
QString TrueTerminalStrip::installation() const
|
||||||
{
|
{
|
||||||
if (m_strip) {
|
if (m_strip) {
|
||||||
return m_strip->installation();
|
return m_strip->installation();
|
||||||
} else {
|
} else {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TrueTerminalStrip::location() const
|
QString TrueTerminalStrip::location() const
|
||||||
{
|
{
|
||||||
if (m_strip) {
|
if (m_strip) {
|
||||||
return m_strip->location();
|
return m_strip->location();
|
||||||
} else {
|
} else {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TrueTerminalStrip::name() const
|
QString TrueTerminalStrip::name() const
|
||||||
{
|
{
|
||||||
if (m_strip) {
|
if (m_strip) {
|
||||||
return m_strip->name();
|
return m_strip->name();
|
||||||
} else {
|
} else {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> TrueTerminalStrip::physicalTerminal() const
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> TrueTerminalStrip::physicalTerminal() const
|
||||||
{
|
{
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> vector_;
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> vector_;
|
||||||
if (m_strip) {
|
if (m_strip) {
|
||||||
for (const auto &phy : m_strip->physicalTerminal()) {
|
for (const auto &phy : m_strip->physicalTerminal()) {
|
||||||
vector_.append(QSharedPointer<AbstractPhysicalTerminalInterface>{ new TruePhysicalTerminal(phy) });
|
vector_.append(QSharedPointer<AbstractPhysicalTerminalInterface>{ new TruePhysicalTerminal(phy) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return vector_;
|
return vector_;
|
||||||
}
|
}
|
||||||
|
|
||||||
TruePhysicalTerminal::TruePhysicalTerminal(QSharedPointer<PhysicalTerminal> physical) :
|
TruePhysicalTerminal::TruePhysicalTerminal(QSharedPointer<PhysicalTerminal> physical) :
|
||||||
m_physical { physical }
|
m_physical { physical }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QVector<QSharedPointer<AbstractRealTerminalInterface>> TruePhysicalTerminal::realTerminals() const
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> TruePhysicalTerminal::realTerminals() const
|
||||||
{
|
{
|
||||||
QVector<QSharedPointer<AbstractRealTerminalInterface>> vector_;
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> vector_;
|
||||||
if (m_physical) {
|
if (m_physical) {
|
||||||
for (const auto &real_ : m_physical->realTerminals()) {
|
for (const auto &real_ : m_physical->realTerminals()) {
|
||||||
vector_.append(QSharedPointer<AbstractRealTerminalInterface> { new TrueRealTerminal{ real_ }});
|
vector_.append(QSharedPointer<AbstractRealTerminalInterface> { new TrueRealTerminal{ real_ }});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return vector_;
|
return vector_;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrueRealTerminal::TrueRealTerminal(QSharedPointer<RealTerminal> real) :
|
TrueRealTerminal::TrueRealTerminal(QSharedPointer<RealTerminal> real) :
|
||||||
m_real { real }
|
m_real { real }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QString TrueRealTerminal::label() const
|
QString TrueRealTerminal::label() const
|
||||||
{
|
{
|
||||||
if (m_real) {
|
if (m_real) {
|
||||||
return m_real->label();
|
return m_real->label();
|
||||||
} else {
|
} else {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TrueRealTerminal::isBridged() const
|
bool TrueRealTerminal::isBridged() const
|
||||||
{
|
{
|
||||||
if (m_real) {
|
if (m_real) {
|
||||||
return m_real->isBridged();
|
return m_real->isBridged();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Return a raw pointer, the pointer is not managed by this class
|
//Return a raw pointer, the pointer is not managed by this class
|
||||||
AbstractBridgeInterface* TrueRealTerminal::bridge() const
|
AbstractBridgeInterface* TrueRealTerminal::bridge() const
|
||||||
{
|
{
|
||||||
return new TrueBridge(m_real->bridge());
|
return new TrueBridge(m_real->bridge());
|
||||||
}
|
}
|
||||||
|
|
||||||
TrueBridge::TrueBridge(QSharedPointer<TerminalStripBridge> bridge) :
|
TrueBridge::TrueBridge(QSharedPointer<TerminalStripBridge> bridge) :
|
||||||
m_bridge { bridge }
|
m_bridge { bridge }
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QUuid TrueBridge::uuid() const
|
QUuid TrueBridge::uuid() const
|
||||||
{
|
{
|
||||||
if (m_bridge) {
|
if (m_bridge) {
|
||||||
return m_bridge->uuid();
|
return m_bridge->uuid();
|
||||||
} else {
|
} else {
|
||||||
return QUuid();
|
return QUuid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef TRUETERMINALSTRIP_H
|
#ifndef TRUETERMINALSTRIP_H
|
||||||
#define TRUETERMINALSTRIP_H
|
#define TRUETERMINALSTRIP_H
|
||||||
@@ -27,51 +27,51 @@ class TerminalStripBridge;
|
|||||||
|
|
||||||
namespace TerminalStripDrawer
|
namespace TerminalStripDrawer
|
||||||
{
|
{
|
||||||
class TrueTerminalStrip : public AbstractTerminalStripInterface
|
class TrueTerminalStrip : public AbstractTerminalStripInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TrueTerminalStrip(TerminalStrip *strip);
|
TrueTerminalStrip(TerminalStrip *strip);
|
||||||
|
|
||||||
QString installation() const override;
|
QString installation() const override;
|
||||||
QString location() const override;
|
QString location() const override;
|
||||||
QString name() const override;
|
QString name() const override;
|
||||||
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const override;
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<TerminalStrip> m_strip;
|
QPointer<TerminalStrip> m_strip;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TruePhysicalTerminal : public AbstractPhysicalTerminalInterface
|
class TruePhysicalTerminal : public AbstractPhysicalTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TruePhysicalTerminal(QSharedPointer<PhysicalTerminal> physical);
|
TruePhysicalTerminal(QSharedPointer<PhysicalTerminal> physical);
|
||||||
QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const override;
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedPointer<PhysicalTerminal> m_physical;
|
QSharedPointer<PhysicalTerminal> m_physical;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TrueRealTerminal : public AbstractRealTerminalInterface
|
class TrueRealTerminal : public AbstractRealTerminalInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TrueRealTerminal(QSharedPointer<RealTerminal> real);
|
TrueRealTerminal(QSharedPointer<RealTerminal> real);
|
||||||
QString label() const override;
|
QString label() const override;
|
||||||
bool isBridged() const override;
|
bool isBridged() const override;
|
||||||
AbstractBridgeInterface* bridge() const override;
|
AbstractBridgeInterface* bridge() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedPointer<RealTerminal> m_real;
|
QSharedPointer<RealTerminal> m_real;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TrueBridge : public AbstractBridgeInterface
|
class TrueBridge : public AbstractBridgeInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TrueBridge(QSharedPointer<TerminalStripBridge> bridge);
|
TrueBridge(QSharedPointer<TerminalStripBridge> bridge);
|
||||||
QUuid uuid() const override;
|
QUuid uuid() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedPointer<TerminalStripBridge> m_bridge;
|
QSharedPointer<TerminalStripBridge> m_bridge;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TRUETERMINALSTRIP_H
|
#endif // TRUETERMINALSTRIP_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "addterminalstripcommand.h"
|
#include "addterminalstripcommand.h"
|
||||||
#include "../../qetproject.h"
|
#include "../../qetproject.h"
|
||||||
@@ -35,22 +35,22 @@ AddTerminalStripCommand::AddTerminalStripCommand(TerminalStrip *strip,
|
|||||||
m_strip(strip),
|
m_strip(strip),
|
||||||
m_project(project)
|
m_project(project)
|
||||||
{
|
{
|
||||||
setText(QObject::tr("Ajouter un groupe de bornes"));
|
setText(QObject::tr("Ajouter un groupe de bornes"));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddTerminalStripCommand::~AddTerminalStripCommand()
|
AddTerminalStripCommand::~AddTerminalStripCommand()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void AddTerminalStripCommand::undo() {
|
void AddTerminalStripCommand::undo() {
|
||||||
if (m_project && m_strip) {
|
if (m_project && m_strip) {
|
||||||
m_project->removeTerminalStrip(m_strip);
|
m_project->removeTerminalStrip(m_strip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddTerminalStripCommand::redo() {
|
void AddTerminalStripCommand::redo() {
|
||||||
if (m_project && m_strip) {
|
if (m_project && m_strip) {
|
||||||
m_project->addTerminalStrip(m_strip);
|
m_project->addTerminalStrip(m_strip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveTerminalStripCommand::RemoveTerminalStripCommand(TerminalStrip *strip,
|
RemoveTerminalStripCommand::RemoveTerminalStripCommand(TerminalStrip *strip,
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef ADDTERMINALSTRIPCOMMAND_H
|
#ifndef ADDTERMINALSTRIPCOMMAND_H
|
||||||
#define ADDTERMINALSTRIPCOMMAND_H
|
#define ADDTERMINALSTRIPCOMMAND_H
|
||||||
@@ -28,16 +28,16 @@ class Element;
|
|||||||
|
|
||||||
class AddTerminalStripCommand : public QUndoCommand
|
class AddTerminalStripCommand : public QUndoCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AddTerminalStripCommand(TerminalStrip *strip, QETProject *project, QUndoCommand *parent = nullptr);
|
AddTerminalStripCommand(TerminalStrip *strip, QETProject *project, QUndoCommand *parent = nullptr);
|
||||||
~AddTerminalStripCommand() override;
|
~AddTerminalStripCommand() override;
|
||||||
|
|
||||||
void undo() override;
|
void undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<TerminalStrip> m_strip;
|
QPointer<TerminalStrip> m_strip;
|
||||||
QPointer<QETProject> m_project;
|
QPointer<QETProject> m_project;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RemoveTerminalStripCommand : public QUndoCommand
|
class RemoveTerminalStripCommand : public QUndoCommand
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "addterminaltostripcommand.h"
|
#include "addterminaltostripcommand.h"
|
||||||
#include "../../qetgraphicsitem/terminalelement.h"
|
#include "../../qetgraphicsitem/terminalelement.h"
|
||||||
@@ -72,7 +72,7 @@ void AddTerminalToStripCommand::undo()
|
|||||||
{
|
{
|
||||||
if (m_new_strip) {
|
if (m_new_strip) {
|
||||||
m_new_strip->removeTerminals(m_terminal);
|
m_new_strip->removeTerminals(m_terminal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,7 +83,7 @@ void AddTerminalToStripCommand::redo()
|
|||||||
{
|
{
|
||||||
if (m_new_strip) {
|
if (m_new_strip) {
|
||||||
m_new_strip->addTerminals(m_terminal);
|
m_new_strip->addTerminals(m_terminal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef ADDTERMINALTOSTRIPCOMMAND_H
|
#ifndef ADDTERMINALTOSTRIPCOMMAND_H
|
||||||
#define ADDTERMINALTOSTRIPCOMMAND_H
|
#define ADDTERMINALTOSTRIPCOMMAND_H
|
||||||
@@ -36,17 +36,17 @@ class PhysicalTerminal;
|
|||||||
*/
|
*/
|
||||||
class AddTerminalToStripCommand : public QUndoCommand
|
class AddTerminalToStripCommand : public QUndoCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AddTerminalToStripCommand(QSharedPointer<RealTerminal> terminal, TerminalStrip *strip, QUndoCommand *parent = nullptr);
|
AddTerminalToStripCommand(QSharedPointer<RealTerminal> terminal, TerminalStrip *strip, QUndoCommand *parent = nullptr);
|
||||||
AddTerminalToStripCommand(QVector<QSharedPointer<RealTerminal>> terminals, TerminalStrip *strip, QUndoCommand *parent = nullptr);
|
AddTerminalToStripCommand(QVector<QSharedPointer<RealTerminal>> terminals, TerminalStrip *strip, QUndoCommand *parent = nullptr);
|
||||||
~AddTerminalToStripCommand() override;
|
~AddTerminalToStripCommand() override;
|
||||||
|
|
||||||
void undo() override;
|
void undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<QSharedPointer<RealTerminal>> m_terminal;
|
QVector<QSharedPointer<RealTerminal>> m_terminal;
|
||||||
QPointer<TerminalStrip> m_new_strip;
|
QPointer<TerminalStrip> m_new_strip;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "bridgeterminalscommand.h"
|
#include "bridgeterminalscommand.h"
|
||||||
#include "../terminalstripbridge.h"
|
#include "../terminalstripbridge.h"
|
||||||
@@ -58,18 +58,18 @@ UnBridgeTerminalsCommand::UnBridgeTerminalsCommand(TerminalStrip *strip,
|
|||||||
|
|
||||||
if (strip->canUnBridge(real_terminal))
|
if (strip->canUnBridge(real_terminal))
|
||||||
{
|
{
|
||||||
m_bridge = strip->isBridged(real_terminal.first());
|
m_bridge = strip->isBridged(real_terminal.first());
|
||||||
|
|
||||||
//If bridge have one more terminals than @real_terminal
|
//If bridge have one more terminals than @real_terminal
|
||||||
//that mean every terminals of the bridge must be unbridged by this undo command,
|
//that mean every terminals of the bridge must be unbridged by this undo command,
|
||||||
//else the single terminal who's not umbridged by this undo command
|
//else the single terminal who's not umbridged by this undo command
|
||||||
//continue to have a bridge (to nothing) and this nowhere bridge is visible
|
//continue to have a bridge (to nothing) and this nowhere bridge is visible
|
||||||
//in the terminal strip graphic item and terminal strip editor dialog.
|
//in the terminal strip graphic item and terminal strip editor dialog.
|
||||||
if (m_bridge->realTerminals().size() == real_terminal.size() + 1) {
|
if (m_bridge->realTerminals().size() == real_terminal.size() + 1) {
|
||||||
m_terminals = m_bridge->realTerminals();
|
m_terminals = m_bridge->realTerminals();
|
||||||
} else {
|
} else {
|
||||||
m_terminals = real_terminal;
|
m_terminals = real_terminal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef BRIDGETERMINALSCOMMAND_H
|
#ifndef BRIDGETERMINALSCOMMAND_H
|
||||||
#define BRIDGETERMINALSCOMMAND_H
|
#define BRIDGETERMINALSCOMMAND_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "changeterminallevel.h"
|
#include "changeterminallevel.h"
|
||||||
#include "../realterminal.h"
|
#include "../realterminal.h"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef CHANGETERMINALLEVEL_H
|
#ifndef CHANGETERMINALLEVEL_H
|
||||||
#define CHANGETERMINALLEVEL_H
|
#define CHANGETERMINALLEVEL_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "changeterminalstripcolor.h"
|
#include "changeterminalstripcolor.h"
|
||||||
#include "../terminalstripbridge.h"
|
#include "../terminalstripbridge.h"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef CHANGETERMINALSTRIPCOLOR_H
|
#ifndef CHANGETERMINALSTRIPCOLOR_H
|
||||||
#define CHANGETERMINALSTRIPCOLOR_H
|
#define CHANGETERMINALSTRIPCOLOR_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "changeterminalstripdata.h"
|
#include "changeterminalstripdata.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef CHANGETERMINALSTRIPDATA_H
|
#ifndef CHANGETERMINALSTRIPDATA_H
|
||||||
#define CHANGETERMINALSTRIPDATA_H
|
#define CHANGETERMINALSTRIPDATA_H
|
||||||
@@ -27,15 +27,15 @@
|
|||||||
*/
|
*/
|
||||||
class ChangeTerminalStripData : public QUndoCommand
|
class ChangeTerminalStripData : public QUndoCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChangeTerminalStripData(TerminalStrip *strip, const TerminalStripData &data, QUndoCommand *parent = nullptr);
|
ChangeTerminalStripData(TerminalStrip *strip, const TerminalStripData &data, QUndoCommand *parent = nullptr);
|
||||||
|
|
||||||
void undo() override;
|
void undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<TerminalStrip> m_strip;
|
QPointer<TerminalStrip> m_strip;
|
||||||
TerminalStripData m_old_data, m_new_data;
|
TerminalStripData m_old_data, m_new_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHANGETERMINALSTRIPDATA_H
|
#endif // CHANGETERMINALSTRIPDATA_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "groupterminalscommand.h"
|
#include "groupterminalscommand.h"
|
||||||
#include "../physicalterminal.h"
|
#include "../physicalterminal.h"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef GROUPTERMINALSCOMMAND_H
|
#ifndef GROUPTERMINALSCOMMAND_H
|
||||||
#define GROUPTERMINALSCOMMAND_H
|
#define GROUPTERMINALSCOMMAND_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "sortterminalstripcommand.h"
|
#include "sortterminalstripcommand.h"
|
||||||
#include "../terminalstrip.h"
|
#include "../terminalstrip.h"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef SORTTERMINALSTRIPCOMMAND_H
|
#ifndef SORTTERMINALSTRIPCOMMAND_H
|
||||||
#define SORTTERMINALSTRIPCOMMAND_H
|
#define SORTTERMINALSTRIPCOMMAND_H
|
||||||
|
|||||||
@@ -976,7 +976,7 @@ QDomElement TerminalStrip::toXml(QDomDocument &parent_document)
|
|||||||
root_elmt.appendChild(m_data.toXml(parent_document));
|
root_elmt.appendChild(m_data.toXml(parent_document));
|
||||||
|
|
||||||
//Undrawed terminals
|
//Undrawed terminals
|
||||||
auto xml_layout = parent_document.createElement(QStringLiteral("layout"));
|
auto xml_layout = parent_document.createElement(QStringLiteral("layout"));
|
||||||
|
|
||||||
for (auto &phy_t : m_physical_terminals) {
|
for (auto &phy_t : m_physical_terminals) {
|
||||||
xml_layout.appendChild(phy_t->toXml(parent_document));
|
xml_layout.appendChild(phy_t->toXml(parent_document));
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "terminalstripdata.h"
|
#include "terminalstripdata.h"
|
||||||
#include "../qetxml.h"
|
#include "../qetxml.h"
|
||||||
@@ -34,7 +34,7 @@ QDomElement TerminalStripData::toXml(QDomDocument &xml_document) const
|
|||||||
|
|
||||||
root_elmt.setAttribute(QStringLiteral("uuid"), m_uuid.toString());
|
root_elmt.setAttribute(QStringLiteral("uuid"), m_uuid.toString());
|
||||||
|
|
||||||
auto info_elmt = xml_document.createElement(QStringLiteral("informations"));
|
auto info_elmt = xml_document.createElement(QStringLiteral("informations"));
|
||||||
root_elmt.appendChild(info_elmt);
|
root_elmt.appendChild(info_elmt);
|
||||||
|
|
||||||
if (!m_installation.isEmpty()) {
|
if (!m_installation.isEmpty()) {
|
||||||
@@ -65,23 +65,23 @@ bool TerminalStripData::fromXml(const QDomElement &xml_element)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||||
m_uuid = QUuid::fromString(xml_element.attribute(QStringLiteral("uuid")));
|
m_uuid = QUuid::fromString(xml_element.attribute(QStringLiteral("uuid")));
|
||||||
#else
|
#else
|
||||||
m_uuid = QUuid(xml_element.attribute(QStringLiteral("uuid")));
|
m_uuid = QUuid(xml_element.attribute(QStringLiteral("uuid")));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (auto &xml_info :
|
for (auto &xml_info :
|
||||||
QETXML::findInDomElement(xml_element.firstChildElement(QStringLiteral("informations")),
|
QETXML::findInDomElement(xml_element.firstChildElement(QStringLiteral("informations")),
|
||||||
QStringLiteral("information")))
|
QStringLiteral("information")))
|
||||||
{
|
{
|
||||||
auto name = xml_info.attribute(QStringLiteral("name"));
|
auto name = xml_info.attribute(QStringLiteral("name"));
|
||||||
auto value = xml_info.text();
|
auto value = xml_info.text();
|
||||||
|
|
||||||
if (name == QLatin1String("installation")) { m_installation = value;}
|
if (name == QLatin1String("installation")) { m_installation = value;}
|
||||||
else if (name == QLatin1String("location")) {m_location = value;}
|
else if (name == QLatin1String("location")) {m_location = value;}
|
||||||
else if (name == QLatin1String("name")) {m_name = value;}
|
else if (name == QLatin1String("name")) {m_name = value;}
|
||||||
else if (name == QLatin1String("comment")) {m_comment = value;}
|
else if (name == QLatin1String("comment")) {m_comment = value;}
|
||||||
else if (name == QLatin1String("description")) {m_description = value;}
|
else if (name == QLatin1String("description")) {m_description = value;}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -101,7 +101,7 @@ TerminalStripData &TerminalStripData::operator=(const TerminalStripData &other)
|
|||||||
|
|
||||||
QDomElement TerminalStripData::infoToXml(QDomDocument &xml_doc, const QString &name, const QString &value)
|
QDomElement TerminalStripData::infoToXml(QDomDocument &xml_doc, const QString &name, const QString &value)
|
||||||
{
|
{
|
||||||
auto xml_elmt = xml_doc.createElement(QStringLiteral("information"));
|
auto xml_elmt = xml_doc.createElement(QStringLiteral("information"));
|
||||||
xml_elmt.setAttribute(QStringLiteral("name"), name);
|
xml_elmt.setAttribute(QStringLiteral("name"), name);
|
||||||
xml_elmt.appendChild(xml_doc.createTextNode(value));
|
xml_elmt.appendChild(xml_doc.createTextNode(value));
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef TERMINALSTRIPDATA_H
|
#ifndef TERMINALSTRIPDATA_H
|
||||||
#define TERMINALSTRIPDATA_H
|
#define TERMINALSTRIPDATA_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "terminalstripprojectconfigpage.h"
|
#include "terminalstripprojectconfigpage.h"
|
||||||
#include "../../../qeticons.h"
|
#include "../../../qeticons.h"
|
||||||
@@ -23,26 +23,26 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
TerminalStripProjectConfigPage::TerminalStripProjectConfigPage(QETProject *project,
|
TerminalStripProjectConfigPage::TerminalStripProjectConfigPage(QETProject *project,
|
||||||
QWidget *parent) :
|
QWidget *parent) :
|
||||||
ProjectConfigPage { project, parent }
|
ProjectConfigPage { project, parent }
|
||||||
{
|
{
|
||||||
initWidgets();
|
initWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TerminalStripProjectConfigPage::title() const {
|
QString TerminalStripProjectConfigPage::title() const {
|
||||||
return tr("Plan de bornes");
|
return tr("Plan de bornes");
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon TerminalStripProjectConfigPage::icon() const {
|
QIcon TerminalStripProjectConfigPage::icon() const {
|
||||||
return QET::Icons::TerminalStrip;
|
return QET::Icons::TerminalStrip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalStripProjectConfigPage::initWidgets()
|
void TerminalStripProjectConfigPage::initWidgets()
|
||||||
{
|
{
|
||||||
m_layout_editor = new TerminalStripLayoutEditor{ project()->projectPropertiesHandler().terminalStripLayoutHandler().defaultLayout(),
|
m_layout_editor = new TerminalStripLayoutEditor{ project()->projectPropertiesHandler().terminalStripLayoutHandler().defaultLayout(),
|
||||||
this };
|
this };
|
||||||
|
|
||||||
auto v_layout = new QVBoxLayout { this };
|
auto v_layout = new QVBoxLayout { this };
|
||||||
v_layout->addWidget(m_layout_editor);
|
v_layout->addWidget(m_layout_editor);
|
||||||
setLayout(v_layout);
|
setLayout(v_layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef TERMINALSTRIPPROJECTCONFIGPAGE_H
|
#ifndef TERMINALSTRIPPROJECTCONFIGPAGE_H
|
||||||
#define TERMINALSTRIPPROJECTCONFIGPAGE_H
|
#define TERMINALSTRIPPROJECTCONFIGPAGE_H
|
||||||
@@ -24,23 +24,23 @@ class TerminalStripLayoutEditor;
|
|||||||
|
|
||||||
class TerminalStripProjectConfigPage : public ProjectConfigPage
|
class TerminalStripProjectConfigPage : public ProjectConfigPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TerminalStripProjectConfigPage(QETProject *project, QWidget *parent = nullptr);
|
TerminalStripProjectConfigPage(QETProject *project, QWidget *parent = nullptr);
|
||||||
|
|
||||||
QString title() const override;
|
QString title() const override;
|
||||||
QIcon icon() const override;
|
QIcon icon() const override;
|
||||||
|
|
||||||
void applyProjectConf() override {}
|
void applyProjectConf() override {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initWidgets() override;
|
void initWidgets() override;
|
||||||
void initLayout() override{}
|
void initLayout() override{}
|
||||||
void readValuesFromProject() override {}
|
void readValuesFromProject() override {}
|
||||||
void adjustReadOnly() override {}
|
void adjustReadOnly() override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TerminalStripLayoutEditor *m_layout_editor { nullptr };
|
TerminalStripLayoutEditor *m_layout_editor { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TERMINALSTRIPPROJECTCONFIGPAGE_H
|
#endif // TERMINALSTRIPPROJECTCONFIGPAGE_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "freeterminaleditor.h"
|
#include "freeterminaleditor.h"
|
||||||
#include "ui_freeterminaleditor.h"
|
#include "ui_freeterminaleditor.h"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef FREETERMINALEDITOR_H
|
#ifndef FREETERMINALEDITOR_H
|
||||||
#define FREETERMINALEDITOR_H
|
#define FREETERMINALEDITOR_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ QWidget *FreeTerminalModelDelegate::createEditor(QWidget *parent, const QStyleOp
|
|||||||
{
|
{
|
||||||
if (index.column() == TYPE_CELL) {
|
if (index.column() == TYPE_CELL) {
|
||||||
auto qcb = new QComboBox(parent);
|
auto qcb = new QComboBox(parent);
|
||||||
qcb->setObjectName(QStringLiteral("terminal_type"));
|
qcb->setObjectName(QStringLiteral("terminal_type"));
|
||||||
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTGeneric), ElementData::TTGeneric);
|
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTGeneric), ElementData::TTGeneric);
|
||||||
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTFuse), ElementData::TTFuse);
|
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTFuse), ElementData::TTFuse);
|
||||||
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTSectional), ElementData::TTSectional);
|
qcb->addItem(ElementData::translatedTerminalType(ElementData::TTSectional), ElementData::TTSectional);
|
||||||
@@ -344,7 +344,7 @@ QWidget *FreeTerminalModelDelegate::createEditor(QWidget *parent, const QStyleOp
|
|||||||
}
|
}
|
||||||
if (index.column() == FUNCTION_CELL) {
|
if (index.column() == FUNCTION_CELL) {
|
||||||
auto qcb = new QComboBox(parent);
|
auto qcb = new QComboBox(parent);
|
||||||
qcb->setObjectName(QStringLiteral("terminal_function"));
|
qcb->setObjectName(QStringLiteral("terminal_function"));
|
||||||
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFGeneric), ElementData::TFGeneric);
|
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFGeneric), ElementData::TFGeneric);
|
||||||
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFPhase), ElementData::TFPhase);
|
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFPhase), ElementData::TFPhase);
|
||||||
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFNeutral), ElementData::TFNeutral);
|
qcb->addItem(ElementData::translatedTerminalFunction(ElementData::TFNeutral), ElementData::TFNeutral);
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef FREETERMINALMODEL_H
|
#ifndef FREETERMINALMODEL_H
|
||||||
#define FREETERMINALMODEL_H
|
#define FREETERMINALMODEL_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef MODELTERMINALDATA_H
|
#ifndef MODELTERMINALDATA_H
|
||||||
#define MODELTERMINALDATA_H
|
#define MODELTERMINALDATA_H
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2024 The QElectroTech Team
|
Copyright 2006-2024 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "terminalstripcreatordialog.h"
|
#include "terminalstripcreatordialog.h"
|
||||||
#include "ui_terminalstripcreatordialog.h"
|
#include "ui_terminalstripcreatordialog.h"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user