Skip to content

Commit

Permalink
Added datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Sep 14, 2023
1 parent 56db064 commit df67d78
Show file tree
Hide file tree
Showing 12 changed files with 1,523 additions and 270 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ qt5_wrap_ui(UI src/mainwindow.ui
src/cfrmnodeconfig.ui
src/cfrmnodescan.ui
src/cdlgactionparam.ui
srd/cdlgdatepicker.ui
src/cfrmmdf.ui
src/cdlgmdfmodule.ui
src/cdlgmdfbitlist.ui
src/cdlgmdfdm.ui
src/cdlgmdffilepicture.ui
Expand Down Expand Up @@ -467,10 +469,21 @@ add_executable(${PROJECT_NAME}
src/xyseries.h
src/xyseries.cpp

build/ui_cdlgdatepicker.h
src/cdlgdatepicker.ui
src/cdlgdatepicker.cpp
src/cdlgdatepicker.h

build/ui_cfrmmdf.h
src/cfrmmdf.ui
src/cfrmmdf.h
src/cfrmmdf.cpp

build/ui_cdlgmdfmodule.h
src/cdlgmdfmodule.ui
src/cdlgmdfmodule.cpp
src/cdlgmdfmodule.h

${VSCP_PATH}/src/vscp/common/version.h
${VSCP_PATH}/src/vscp/common/vscp.h
${VSCP_PATH}/src/vscp/common/vscpremotetcpif.h
Expand Down
65 changes: 65 additions & 0 deletions docs/codes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
MDF tree codes
--------------

MSB | MSB+1 | MSB+2 | MSB+3

MSB
---
0 Redirect
1 Module

MSB+1
-----
0 Description
1 Info URL
2 Name
3 Change Date
4 VSCP Level
5 Model
6 Version
7 Buffer size
9 MANUFACTURER
10 BOOT
11 FILES
12 REGISTER
13 REMOTE VARIABLES
14 ALARM
15 DECISION MATRIX
16 EVENTS

Manufacturer
-----
0 Description (Reserved)
1 Info URL (Reserved)
2 Name
3 Street
4 City
5 Town
6 Post Code
7 Region
8 State
9 Country
10 Email
11 Phone
12 Fax
13 Web
14 Social

Boot
----
0 Description (Reserved)
1 Info URL (Reserved)
2 Algorithm
3 Block size
4 Block count

Files
-----
0 Description (Reserved)
1 Info URL (Reserved)
2 Manuals
3 Pictures
4 Videos
5 Firmware
6 Drivers
7 Setup scripts
1 change: 1 addition & 0 deletions mdf/beijing_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<vscp>
<module>
<name>Beijing IO controller</name>
<copyright>(C) 2000-2023 Grodans Paradis AB</copyright>
<level>1</level>
<model>B</model>
<version>9</version>
Expand Down
172 changes: 172 additions & 0 deletions src/cdlgdatepicker.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
// cdlgdatepicker.cpp
//
// This file is part of the VSCP (https://www.vscp.org)
//
// The MIT License (MIT)
//
// Copyright © 2000-2023 Ake Hedman, Grodans Paradis AB
// <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

#ifdef WIN32
#include <pch.h>
#endif

#include <vscp.h>
#include <vscphelper.h>

#include <vscpworks.h>

#include "cdlgdatepicker.h"
#include "ui_cdlgdatepicker.h"

#include <QMessageBox>
#include <QDebug>

#include <spdlog/async.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>

///////////////////////////////////////////////////////////////////////////////
// CTor
//

CDlgDatePicker::CDlgDatePicker(QWidget *parent) :
QDialog(parent),
ui(new Ui::CDlgDatePicker)
{
ui->setupUi(this);

vscpworks *pworks = (vscpworks *)QCoreApplication::instance();

//connect(ui->btnSetDummyGuid, &QPushButton::clicked, this, &cdlgdatepicker::setDummyGuid);

setInitialFocus();
}

///////////////////////////////////////////////////////////////////////////////
// DTor
//

CDlgDatePicker::~CDlgDatePicker()
{
delete ui;
}

///////////////////////////////////////////////////////////////////////////////
// setInitialFocus
//

void CDlgDatePicker::setInitialFocus(void)
{
// ui->editGuid->setFocus();
}

///////////////////////////////////////////////////////////////////////////////
// setEditMode
//

void CDlgDatePicker::setEditMode(void)
{
// ui->editGuid->setReadOnly(true);
// ui->btnSetDummyGuid->setVisible(false);
// ui->editName->setFocus();
}

///////////////////////////////////////////////////////////////////////////////
// setDummyGuid
//

// void cdlgdatepicker::setDummyGuid(void)
// {
// //ui->editGuid->setText("00:00:00:00:00:00:00:00:00:00:00:00:xx:xx:xx:xx");
// }


// ----------------------------------------------------------------------------
// Getters & Setters
// ----------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////
// getGuid
//

// QString cdlgdatepicker::getGuid(void)
// {
// //return (ui->editGuid->text());
// }

///////////////////////////////////////////////////////////////////////////////
// setGuid
//

// void cdlgdatepicker::setGuid(const QString& str)
// {
// //ui->editGuid->setText(str);
// }

///////////////////////////////////////////////////////////////////////////////
// getName
//

// QString cdlgdatepicker::getName(void)
// {
// return (ui->editName->text());
// }

///////////////////////////////////////////////////////////////////////////////
// setName
//

// void cdlgdatepicker::setName(const QString& str)
// {
// ui->editName->setText(str);
// }

///////////////////////////////////////////////////////////////////////////////
// getDescription
//

// QString cdlgdatepicker::getDescription(void)
// {
// #if QT_VERSION >= 0x050E00
// //return (ui->editDescription->toMarkdown());
// return (ui->editDescription->toPlainText());
// #else
// return (ui->editDescription->toPlainText());
// #endif
// }

///////////////////////////////////////////////////////////////////////////////
// setDescription
//

// void cdlgdatepicker::setDescription(const QString& str)
// {
// #if QT_VERSION >= 0x050E00
// ui->editDescription->setMarkdown(str);
// #else
// ui->editDescription->setText(str);
// #endif
// }


83 changes: 83 additions & 0 deletions src/cdlgdatepicker.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// cdlgdatepicker.h
//
// This file is part of the VSCP (https://www.vscp.org)
//
// The MIT License (MIT)
//
// Copyright © 2000-2023 Ake Hedman, Grodans Paradis AB
// <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

#ifndef CDLGDATEPICKER_H
#define CDLGDATEPICKER_H

#include <vscpworks.h>

#include <QDialog>


namespace Ui {
class CDlgDatePicker;
}


class CDlgDatePicker : public QDialog
{
Q_OBJECT

public:


public:
explicit CDlgDatePicker(QWidget *parent = nullptr);
~CDlgDatePicker();

/*!
Set inital focus to description
*/
void setInitialFocus(void);

/*!
Set edit mode.
GUID will be READ ONLY
*/
void setEditMode(void);




// ----------------------------------------------------------------------------
// Getters & Setters
// ----------------------------------------------------------------------------



public slots:


private:

Ui::CDlgDatePicker *ui;

};


#endif // CDLGDATEPICKER_H
Loading

0 comments on commit df67d78

Please sign in to comment.