Skip to content

Commit 7f78efd

Browse files
committed
Fixed deletion script windows related to the device when device is deleted
1 parent 56122cc commit 7f78efd

File tree

9 files changed

+231
-12
lines changed

9 files changed

+231
-12
lines changed

doc/DoxyfileServer

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ INLINE_INHERITED_MEMB = NO
178178
# shortest path that makes the file name unique will be used
179179
# The default value is: YES.
180180

181-
FULL_PATH_NAMES = YES
181+
FULL_PATH_NAMES = NO
182182

183183
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
184184
# Stripping is only done if one of the specified strings matches the left-hand
@@ -1260,7 +1260,7 @@ USE_HTAGS = NO
12601260
# See also: Section \class.
12611261
# The default value is: YES.
12621262

1263-
VERBATIM_HEADERS = YES
1263+
VERBATIM_HEADERS = NO
12641264

12651265
# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
12661266
# clang parser (see:
@@ -1404,7 +1404,7 @@ HTML_STYLESHEET =
14041404
# documentation.
14051405
# This tag requires that the tag GENERATE_HTML is set to YES.
14061406

1407-
HTML_EXTRA_STYLESHEET =
1407+
HTML_EXTRA_STYLESHEET = qdoc.css
14081408

14091409
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
14101410
# other source files which should be copied to the HTML output directory. Note
@@ -2541,7 +2541,7 @@ HIDE_UNDOC_RELATIONS = YES
25412541
# set to NO
25422542
# The default value is: NO.
25432543

2544-
HAVE_DOT = NO
2544+
HAVE_DOT = YES
25452545

25462546
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
25472547
# to run in parallel. When set to 0 doxygen will base this on the number of
@@ -2635,7 +2635,7 @@ GROUP_GRAPHS = YES
26352635
# The default value is: NO.
26362636
# This tag requires that the tag HAVE_DOT is set to YES.
26372637

2638-
UML_LOOK = NO
2638+
UML_LOOK = YES
26392639

26402640
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
26412641
# class node. If there are many fields or methods and many nodes the graph may

doc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Must be created project collection file `ModbusClient.qhcp`:
4242
Then `qhelpgenerator` must be executed, compiled help `*.qch` and compiled collection `*.qhc` files must be created:
4343

4444
```console
45-
c:\Qt\5.15.2\msvc2019_64\bin\qhelpgenerator.exe "ModbusClient.qhcp"
46-
c:\Qt\5.15.2\msvc2019_64\bin\qhelpgenerator.exe "ModbusServer.qhcp"
45+
c:\Qt\5.15.2\msvc2019_64\bin\qhelpgenerator.exe "output/ModbusClient.qhcp"
46+
c:\Qt\5.15.2\msvc2019_64\bin\qhelpgenerator.exe "output/ModbusServer.qhcp"
4747
```
4848

4949
To check correctness of help generation Qt assistant can be used:

doc/output/ModbusServer.chm

143 KB
Binary file not shown.

doc/output/ModbusServer.qch

192 KB
Binary file not shown.

doc/output/ModbusServer.qhc

36 KB
Binary file not shown.

doc/qdoc.css

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
td.paramtype {
2+
width: 500px; /* Adjust width as needed */
3+
white-space: nowrap;
4+
}
5+
6+
td.returntype {
7+
width: 450px; /* Adjust return type column width */
8+
white-space: nowrap;
9+
}
10+
11+
pre, .LegaleseLeft {
12+
font-family: Courier, monospace;
13+
font-weight: 600;
14+
vertical-align: top;
15+
margin: 15px 85px 15px 35px;
16+
padding: 25px;
17+
width: 90%;
18+
overflow-x:auto;
19+
}
20+
21+
pre a[href] {
22+
color: #5caa15;
23+
}
24+
25+
p {
26+
width: 70%;
27+
margin: 15px 0px 10px 15px;
28+
}
29+
30+
table p {
31+
margin: 0px;
32+
padding: 0px;
33+
}
34+
35+
a[href] {
36+
color: #007330;
37+
text-decoration: none;
38+
}
39+
40+
/* Different color for ext. links */
41+
a[href|="http://"], a[href|="https://"] {
42+
color: #6bb8db;
43+
}
44+
45+
h1.title {
46+
margin-top: 30px;
47+
margin-left: 6px;
48+
padding: 6px;
49+
}
50+
51+
h2, p.h2 {
52+
padding: 4px;
53+
margin: 30px 0px 20px 10px;
54+
}
55+
56+
h3 {
57+
margin: 30px 0px 30px 6px;
58+
}
59+
60+
ul, ol {
61+
margin-top: 4px;
62+
margin-bottom: 0px;
63+
}
64+
65+
ul li, ol li {
66+
margin-bottom: 8px;
67+
}
68+
69+
.mainContent li.level2 {
70+
margin-left: 16px;
71+
}
72+
73+
.rightAlign {
74+
text-align: right;
75+
}
76+
77+
h3.fn, span.fn {
78+
word-spacing: 3px;
79+
padding: 5px;
80+
text-decoration: none;
81+
font-weight: 400;
82+
margin: 45px 0px 0px 6px;
83+
}
84+
.fngroup h3.fngroupitem {
85+
margin-bottom: 5px;
86+
}
87+
table {
88+
max-width: 80%;
89+
padding: 15px 45px 15px 15px;
90+
}
91+
92+
table th {
93+
text-align: left;
94+
padding: 8px;
95+
}
96+
97+
table td {
98+
padding: 6px 10px 6px 10px;
99+
}
100+
101+
table.qmlname td {
102+
padding: 0px;
103+
margin-left: 6px;
104+
}
105+
106+
table.qmlname p .name,
107+
h3.fn .name, h3.fn .type {
108+
font-weight: bold;
109+
}
110+
111+
.context h3.fn {
112+
font-weight: 400;
113+
}
114+
115+
.qmlreadonly, .qmldefault {
116+
font-family: Courier, monospace;
117+
margin-right: 6px;
118+
}
119+
120+
code {
121+
font-family: Courier, monospace;
122+
font-weight: 400;
123+
}
124+
125+
p.naviNextPrevious {
126+
text-align: right;
127+
margin-right: 20px;
128+
}
129+
130+
span.naviSeparator {
131+
white-space: pre;
132+
}
133+
134+
.toc h3 {
135+
margin: 0px 0px 10px 6px;
136+
}
137+
138+
.toc ul {
139+
list-style-type: none;
140+
}
141+
142+
.navigationbar table {
143+
padding: 0;
144+
margin: 0;
145+
}
146+
147+
.footer, .footer p {
148+
padding: 5px 0px 5px 0px;
149+
margin: 45px 15px 5px 15px;
150+
font-size: 8.5pt;
151+
}
152+
153+
.footer p {
154+
margin: 0px;
155+
}
156+
157+
.video {
158+
margin: 15px 0 0 15px;
159+
}

src/server/gui/script/server_scriptmanager.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ void mbServerScriptManager::setProject(mbCoreProject *p)
120120
m_project = project;
121121
if (project)
122122
{
123-
//connect(project, &mbServerProject::scriptAdded , this, &mbServerScriptManager::scriptAdd);
123+
connect(project, &mbServerProject::deviceRemoving, this, &mbServerScriptManager::removeAllDeviceScripts);
124124
//connect(project, &mbServerProject::scriptRemoving, this, &mbServerScriptManager::scriptRemove);
125-
//Q_FOREACH (mbServerScript* d, project->scripts())
125+
//Q_FOREACH (mbServerDevice* d, project->device())
126126
// scriptAdd(d);
127127
}
128128
}
@@ -171,6 +171,13 @@ void mbServerScriptManager::setActiveScriptEditor(mbServerDeviceScriptEditor *ui
171171
}
172172
}
173173

174+
void mbServerScriptManager::removeAllDeviceScripts(mbCoreDevice *device)
175+
{
176+
removeDeviceScript(static_cast<mbServerDevice*>(device), mbServerDevice::Script_Init );
177+
removeDeviceScript(static_cast<mbServerDevice*>(device), mbServerDevice::Script_Loop );
178+
removeDeviceScript(static_cast<mbServerDevice*>(device), mbServerDevice::Script_Final);
179+
}
180+
174181
void mbServerScriptManager::scriptContextMenu(const QPoint & /*pos*/)
175182
{
176183
//mbServerScriptUi *ui = qobject_cast<mbServerScriptUi*>(sender());

src/server/gui/script/server_scriptmanager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class mbServerScriptManager : public QObject
7676

7777
public Q_SLOTS:
7878
void setActiveScriptEditor(mbServerDeviceScriptEditor *ui);
79+
void removeAllDeviceScripts(mbCoreDevice *device);
7980

8081
private Q_SLOTS:
8182
void setProject(mbCoreProject *project);

0 commit comments

Comments
 (0)