Skip to content

Commit df67d78

Browse files
Added datepicker
1 parent 56db064 commit df67d78

12 files changed

+1523
-270
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ qt5_wrap_ui(UI src/mainwindow.ui
235235
src/cfrmnodeconfig.ui
236236
src/cfrmnodescan.ui
237237
src/cdlgactionparam.ui
238+
srd/cdlgdatepicker.ui
238239
src/cfrmmdf.ui
240+
src/cdlgmdfmodule.ui
239241
src/cdlgmdfbitlist.ui
240242
src/cdlgmdfdm.ui
241243
src/cdlgmdffilepicture.ui
@@ -467,10 +469,21 @@ add_executable(${PROJECT_NAME}
467469
src/xyseries.h
468470
src/xyseries.cpp
469471

472+
build/ui_cdlgdatepicker.h
473+
src/cdlgdatepicker.ui
474+
src/cdlgdatepicker.cpp
475+
src/cdlgdatepicker.h
476+
477+
build/ui_cfrmmdf.h
470478
src/cfrmmdf.ui
471479
src/cfrmmdf.h
472480
src/cfrmmdf.cpp
473481

482+
build/ui_cdlgmdfmodule.h
483+
src/cdlgmdfmodule.ui
484+
src/cdlgmdfmodule.cpp
485+
src/cdlgmdfmodule.h
486+
474487
${VSCP_PATH}/src/vscp/common/version.h
475488
${VSCP_PATH}/src/vscp/common/vscp.h
476489
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.h

docs/codes.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
MDF tree codes
2+
--------------
3+
4+
MSB | MSB+1 | MSB+2 | MSB+3
5+
6+
MSB
7+
---
8+
0 Redirect
9+
1 Module
10+
11+
MSB+1
12+
-----
13+
0 Description
14+
1 Info URL
15+
2 Name
16+
3 Change Date
17+
4 VSCP Level
18+
5 Model
19+
6 Version
20+
7 Buffer size
21+
9 MANUFACTURER
22+
10 BOOT
23+
11 FILES
24+
12 REGISTER
25+
13 REMOTE VARIABLES
26+
14 ALARM
27+
15 DECISION MATRIX
28+
16 EVENTS
29+
30+
Manufacturer
31+
-----
32+
0 Description (Reserved)
33+
1 Info URL (Reserved)
34+
2 Name
35+
3 Street
36+
4 City
37+
5 Town
38+
6 Post Code
39+
7 Region
40+
8 State
41+
9 Country
42+
10 Email
43+
11 Phone
44+
12 Fax
45+
13 Web
46+
14 Social
47+
48+
Boot
49+
----
50+
0 Description (Reserved)
51+
1 Info URL (Reserved)
52+
2 Algorithm
53+
3 Block size
54+
4 Block count
55+
56+
Files
57+
-----
58+
0 Description (Reserved)
59+
1 Info URL (Reserved)
60+
2 Manuals
61+
3 Pictures
62+
4 Videos
63+
5 Firmware
64+
6 Drivers
65+
7 Setup scripts

mdf/beijing_2.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<vscp>
44
<module>
55
<name>Beijing IO controller</name>
6+
<copyright>(C) 2000-2023 Grodans Paradis AB</copyright>
67
<level>1</level>
78
<model>B</model>
89
<version>9</version>

src/cdlgdatepicker.cpp

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
// cdlgdatepicker.cpp
2+
//
3+
// This file is part of the VSCP (https://www.vscp.org)
4+
//
5+
// The MIT License (MIT)
6+
//
7+
// Copyright © 2000-2023 Ake Hedman, Grodans Paradis AB
8+
9+
//
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy
11+
// of this software and associated documentation files (the "Software"), to deal
12+
// in the Software without restriction, including without limitation the rights
13+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
// copies of the Software, and to permit persons to whom the Software is
15+
// furnished to do so, subject to the following conditions:
16+
//
17+
// The above copyright notice and this permission notice shall be included in
18+
// all copies or substantial portions of the Software.
19+
//
20+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
// SOFTWARE.
27+
//
28+
29+
#ifdef WIN32
30+
#include <pch.h>
31+
#endif
32+
33+
#include <vscp.h>
34+
#include <vscphelper.h>
35+
36+
#include <vscpworks.h>
37+
38+
#include "cdlgdatepicker.h"
39+
#include "ui_cdlgdatepicker.h"
40+
41+
#include <QMessageBox>
42+
#include <QDebug>
43+
44+
#include <spdlog/async.h>
45+
#include <spdlog/sinks/rotating_file_sink.h>
46+
#include <spdlog/sinks/stdout_color_sinks.h>
47+
#include <spdlog/spdlog.h>
48+
49+
///////////////////////////////////////////////////////////////////////////////
50+
// CTor
51+
//
52+
53+
CDlgDatePicker::CDlgDatePicker(QWidget *parent) :
54+
QDialog(parent),
55+
ui(new Ui::CDlgDatePicker)
56+
{
57+
ui->setupUi(this);
58+
59+
vscpworks *pworks = (vscpworks *)QCoreApplication::instance();
60+
61+
//connect(ui->btnSetDummyGuid, &QPushButton::clicked, this, &cdlgdatepicker::setDummyGuid);
62+
63+
setInitialFocus();
64+
}
65+
66+
///////////////////////////////////////////////////////////////////////////////
67+
// DTor
68+
//
69+
70+
CDlgDatePicker::~CDlgDatePicker()
71+
{
72+
delete ui;
73+
}
74+
75+
///////////////////////////////////////////////////////////////////////////////
76+
// setInitialFocus
77+
//
78+
79+
void CDlgDatePicker::setInitialFocus(void)
80+
{
81+
// ui->editGuid->setFocus();
82+
}
83+
84+
///////////////////////////////////////////////////////////////////////////////
85+
// setEditMode
86+
//
87+
88+
void CDlgDatePicker::setEditMode(void)
89+
{
90+
// ui->editGuid->setReadOnly(true);
91+
// ui->btnSetDummyGuid->setVisible(false);
92+
// ui->editName->setFocus();
93+
}
94+
95+
///////////////////////////////////////////////////////////////////////////////
96+
// setDummyGuid
97+
//
98+
99+
// void cdlgdatepicker::setDummyGuid(void)
100+
// {
101+
// //ui->editGuid->setText("00:00:00:00:00:00:00:00:00:00:00:00:xx:xx:xx:xx");
102+
// }
103+
104+
105+
// ----------------------------------------------------------------------------
106+
// Getters & Setters
107+
// ----------------------------------------------------------------------------
108+
109+
///////////////////////////////////////////////////////////////////////////////
110+
// getGuid
111+
//
112+
113+
// QString cdlgdatepicker::getGuid(void)
114+
// {
115+
// //return (ui->editGuid->text());
116+
// }
117+
118+
///////////////////////////////////////////////////////////////////////////////
119+
// setGuid
120+
//
121+
122+
// void cdlgdatepicker::setGuid(const QString& str)
123+
// {
124+
// //ui->editGuid->setText(str);
125+
// }
126+
127+
///////////////////////////////////////////////////////////////////////////////
128+
// getName
129+
//
130+
131+
// QString cdlgdatepicker::getName(void)
132+
// {
133+
// return (ui->editName->text());
134+
// }
135+
136+
///////////////////////////////////////////////////////////////////////////////
137+
// setName
138+
//
139+
140+
// void cdlgdatepicker::setName(const QString& str)
141+
// {
142+
// ui->editName->setText(str);
143+
// }
144+
145+
///////////////////////////////////////////////////////////////////////////////
146+
// getDescription
147+
//
148+
149+
// QString cdlgdatepicker::getDescription(void)
150+
// {
151+
// #if QT_VERSION >= 0x050E00
152+
// //return (ui->editDescription->toMarkdown());
153+
// return (ui->editDescription->toPlainText());
154+
// #else
155+
// return (ui->editDescription->toPlainText());
156+
// #endif
157+
// }
158+
159+
///////////////////////////////////////////////////////////////////////////////
160+
// setDescription
161+
//
162+
163+
// void cdlgdatepicker::setDescription(const QString& str)
164+
// {
165+
// #if QT_VERSION >= 0x050E00
166+
// ui->editDescription->setMarkdown(str);
167+
// #else
168+
// ui->editDescription->setText(str);
169+
// #endif
170+
// }
171+
172+

src/cdlgdatepicker.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// cdlgdatepicker.h
2+
//
3+
// This file is part of the VSCP (https://www.vscp.org)
4+
//
5+
// The MIT License (MIT)
6+
//
7+
// Copyright © 2000-2023 Ake Hedman, Grodans Paradis AB
8+
9+
//
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy
11+
// of this software and associated documentation files (the "Software"), to deal
12+
// in the Software without restriction, including without limitation the rights
13+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
// copies of the Software, and to permit persons to whom the Software is
15+
// furnished to do so, subject to the following conditions:
16+
//
17+
// The above copyright notice and this permission notice shall be included in
18+
// all copies or substantial portions of the Software.
19+
//
20+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
// SOFTWARE.
27+
//
28+
29+
#ifndef CDLGDATEPICKER_H
30+
#define CDLGDATEPICKER_H
31+
32+
#include <vscpworks.h>
33+
34+
#include <QDialog>
35+
36+
37+
namespace Ui {
38+
class CDlgDatePicker;
39+
}
40+
41+
42+
class CDlgDatePicker : public QDialog
43+
{
44+
Q_OBJECT
45+
46+
public:
47+
48+
49+
public:
50+
explicit CDlgDatePicker(QWidget *parent = nullptr);
51+
~CDlgDatePicker();
52+
53+
/*!
54+
Set inital focus to description
55+
*/
56+
void setInitialFocus(void);
57+
58+
/*!
59+
Set edit mode.
60+
GUID will be READ ONLY
61+
*/
62+
void setEditMode(void);
63+
64+
65+
66+
67+
// ----------------------------------------------------------------------------
68+
// Getters & Setters
69+
// ----------------------------------------------------------------------------
70+
71+
72+
73+
public slots:
74+
75+
76+
private:
77+
78+
Ui::CDlgDatePicker *ui;
79+
80+
};
81+
82+
83+
#endif // CDLGDATEPICKER_H

0 commit comments

Comments
 (0)