Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
catharanthus committed Jun 26, 2022
2 parents f7441da + 37b327b commit 299bdf3
Show file tree
Hide file tree
Showing 219 changed files with 643 additions and 375 deletions.
19 changes: 19 additions & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
========================
SDM 1.0.5
------------------------
Released on 2022-06-26
========================

sdmconsole changes:

* user settings directory name changed (Microproject -> Simple Device Model)
* data from register map memories can now be exported/imported in hexadecimal format in addition to CSV
* always use full 32-bit width to display hexadecimal values in the register map
* default tab stop width changed from 8 to 4

Scripting API changes:

* don't create multiple instances of the same plugin
* sdm.info() now generates an error when a non-existent field is requested
* a new method, sdm.findobject(), to find an SDM object by name (and, optionally, type)

========================
SDM 1.0.4
------------------------
Expand Down
2 changes: 2 additions & 0 deletions doc/contributors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Microproject, LLC http://micro-project.ru
Alex I. Kuznetsov https://github.com/catharanthus
4 changes: 2 additions & 2 deletions doc/licenses/license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SIMPLE DEVICE MODEL FRAMEWORK LICENSE NOTICE

Copyright © 2015-2021 by Microproject LLC
Copyright © 2015-2022 Simple Device Model contributors

SDM framework is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -26,7 +26,7 @@ SDM plugin development SDK includes the following components:
* libraries for plugin development,
* example plugins.

Copyright © 2015-2021 by Microproject LLC
Copyright © 2015-2022 Simple Device Model contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
Expand Down
Binary file modified doc/manual.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions src/cmake/GlobalBuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,13 @@ if(GCC_CMDLINE_SYNTAX)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
endif()

# Enable timed mutex workaround for libstdc++

if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0)
message("Activating timed mutex workaround for older libstdc++")
include_directories(${CMAKE_CURRENT_LIST_DIR}/workarounds)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include timed_mutex_workaround.h")
endif()
endif()
2 changes: 1 addition & 1 deletion src/cmake/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.3.0)

set(PRODUCT_VERSION_MAJOR 1)
set(PRODUCT_VERSION_MINOR 0)
set(PRODUCT_VERSION_PATCH 4)
set(PRODUCT_VERSION_PATCH 5)

try_compile(CPU_DETECTED "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU" "${CMAKE_CURRENT_LIST_DIR}/DetectCPU.c" COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/try_compile/DetectCPU.bin")

Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dlldeptool/dlldeptool.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
4 changes: 2 additions & 2 deletions src/cmake/dlldeptool/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down Expand Up @@ -222,7 +222,7 @@ void displayusage(const std::string &strProgramName) {

int main(int argc,char *argv[]) {
utf8cout()<<"DllDepTool: collects DLLs required for the software to run"<<endl;
utf8cout()<<"Copyright (c) 2015 by Microproject LLC"<<endl;
utf8cout()<<"Copyright (c) 2015 Simple Device Model contributors"<<endl;
utf8cout()<<"Note: please make sure that you are legally allowed to redistribute the DLLs!"<<endl<<endl;

auto args=cmdArgs(argc,argv);
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dlldeptool/peimports.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dlldeptool/peimports.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dlldeptool/winpath.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dlldeptool/winpath.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/installer/make_installer.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Main definitions

!define VENDOR_NAME "Microproject"
!define VENDOR_NAME "Simple Device Model contributors"
!define PROGRAM_NAME "Simple Device Model"
!define PROGRAM_SHORT_NAME "SDM"
!define MAIN_EXECUTABLE "sdmconsole"
Expand Down
6 changes: 3 additions & 3 deletions src/cmake/installer/uninstall.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

# Remove user configuration

@EMPTY@rm -f "$ENV{HOME}/.config/Microproject/sdmconsole.ini"
@EMPTY@rm -rf "$ENV{HOME}/.config/Microproject/sdmconsole"
@EMPTY@rm -df "$ENV{HOME}/.config/Microproject"
@EMPTY@rm -f "$ENV{HOME}/.config/Simple Device Model/sdmconsole.ini"
@EMPTY@rm -rf "$ENV{HOME}/.config/Simple Device Model/sdmconsole"
@EMPTY@rm -df "$ENV{HOME}/.config/Simple Device Model"

# Remove these directories only if empty

Expand Down
36 changes: 36 additions & 0 deletions src/cmake/workarounds/timed_mutex_workaround.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
* SDM framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SDM framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with SDM framework. If not, see <https://www.gnu.org/licenses/>.
*
* This header file provides a workaround for a libstdc++ timed
* mutex bug.
*/

// Note: Timed mutexes used to be buggy in GCC versions prior to 4.9.0.

#ifndef TIMED_MUTEX_WORKAROUND_H_INCLUDED
#define TIMED_MUTEX_WORKAROUND_H_INCLUDED

// The following line will include bits/c++config.h if we are using libstdc++
#include <cstddef>

#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
// Workaround: don't use monotonic clock
#undef _GLIBCXX_USE_CLOCK_MONOTONIC
#endif

#endif
2 changes: 1 addition & 1 deletion src/config/sdmconfig.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/config/sdmconfig.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
Binary file modified src/doc/manual/images/formdialog.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 38 additions & 16 deletions src/doc/manual/manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

\hypersetup{
pdftitle={Simple Device Model User Manual},
pdfauthor={Microproject LLC}
pdfauthor={Simple Device Model contributors}
}

\begin{document}
Expand All @@ -23,7 +23,6 @@
\LARGE \textbf{User Manual}\par
\vspace{1.2\onelineskip}
\large Version \productversion\par
Microproject LLC
\end{center}
\vspace*{\fill}
\end{adjustwidth*}
Expand Down Expand Up @@ -116,7 +115,7 @@ \subsection{Build system dependencies}
\item A toolchain for \cplusplus{} development:
\begin{itemize}
\item for Microsoft Windows: Microsoft Visual Studio® 2013 or later, or MinGW-w64 GCC 4.8 or later (see notes below). Pre-built Windows packages are created with Microsoft Visual Studio 2013.
\item for Linux: GCC 4.9 or later, or Clang 3.4 or later.
\item for Linux: GCC 4.8 or later, or Clang 3.4 or later.
\end{itemize}
\item CMake 3.3 or later;
\item Qt® 5.x, x $\ge$ 6 (optional, for \shellcmd{sdmconsole});
Expand Down Expand Up @@ -288,7 +287,7 @@ \subsection{Examples}
\subsection{Generating installer for Windows}
\label{subsec:wininstaller}

Under Microsoft Windows, SDM provides a script, \shellcmd{make\_installer.nsi}, which can be used to generate an installer with NSIS (Nullsoft Scriptable Install System)\footnote{\url{http://nsis.sourceforge.io}}.
Under Microsoft Windows, SDM provides a script, \shellcmd{make\_installer.nsi}, which can be used to generate an installer with NSIS (Nullsoft Scriptable Install System)\footnote{\url{https://nsis.sourceforge.io}}.

To generate the installer package, SDM must be first built and installed using CMake (possibly to a temporary directory). The NSIS script is configured by the build system and installed alongside program executables. Then, \shellcmd{makensis} program is used to create an installer.

Expand Down Expand Up @@ -358,7 +357,7 @@ \section{Directory hierarchy}
\end{tabularx}
\end{table}

User settings are stored in \shellcmd{\%APPDATA\%\textbackslash{}Microproject} on Microsoft Windows and in \shellcmd{\$HOME/.config/Microproject} on Linux.
User settings are stored in \shellcmd{\%APPDATA\%\textbackslash{}Simple Device Model} on Microsoft Windows and in \shellcmd{\$HOME/.config/Simple Device Model} on Linux.

On Linux, how desktop entries (shortcuts and icons) are installed depends on the \shellcmd{CMAKE\_INSTALL\_PREFIX} value:

Expand Down Expand Up @@ -710,7 +709,7 @@ \section{Other features}
\chapter{Scripting engine}
\label{ch:scripting}

SDM integrates a scripting engine based on Lua programming language\footnote{\url{http://www.lua.org/}}. The scripting engine uses Lua extension mechanism to provide bindings for the SDM plugin interface as well as (with \shellcmd{sdmconsole}) means to create dialog windows to interact with the user.
SDM integrates a scripting engine based on Lua programming language\footnote{\url{https://www.lua.org/}}. The scripting engine uses Lua extension mechanism to provide bindings for the SDM plugin interface as well as (with \shellcmd{sdmconsole}) means to create dialog windows to interact with the user.

The Lua project provides a comprehensive set of documentation which is also shipped with the SDM distribution. The language itself will not be covered in this manual.

Expand Down Expand Up @@ -840,6 +839,31 @@ \subsection{\expr{sdm} global object}
When called without parameters, returns the number of opened plugins. When called with an \luaexpr{index} parameter, returns a \objtype{Plugin} type object corresponding to an opened plugin with this index.
\end{funcret}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sdm.findobject()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{luafuncprototype}
sdm.findobject(name [, type])
\end{luafuncprototype}

\begin{funcdescr}
Finds an opened SDM object with the specified name (and type, if present).
\end{funcdescr}

\begin{funcparams}
\funcparam{name} (\luatype{string}): object name
\funcparam{type} (\luatype{string}, optional): object type (\luaexpr{"Plugin"}, \luaexpr{"Device"}, \luaexpr{"Channel"} or \luaexpr{"Source"})
\end{funcparams}

\begin{funcret}
Returns the requested object, or \luaexpr{nil} if it cannot be found.
\end{funcret}

\begin{funcremarks}
If there are multiple objects with the same name (and type, if present), it is not specified which of them is returned.
\end{funcremarks}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% sdm.info()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -2196,10 +2220,10 @@ \subsection{\objtype{FormDialog} type object}
A form dialog is used to request more complex user input than is possible by using \luaexpr{gui.inputdialog()}. It can be created by the \luaexpr{gui.createdialog()} function. An example is shown on Figure \ref{fig:formdialog}.

\begin{shellcmds}\begin{luacode}
form=gui.createdialog("form","Enter user data:")
form.addtextoption("Name","John Smith")
form.addlistoption("Gender",{"M","F","Other"})
form.addfileoption("Photo","open","","JPEG Images (*.jpg *.jpeg);;All files (*)")
form=gui.createdialog("form","Connection settings:")
form.addtextoption("Host","192.168.1.100")
form.addlistoption("Protocol",{"TCP","UDP"})
form.addfileoption("Picture to send","open","","JPEG Images (*.jpg *.jpeg);;All files (*)")
r=form.exec()
if not r then return end
print("Name is "..form.getoption(1))
Expand All @@ -2209,7 +2233,7 @@ \subsection{\objtype{FormDialog} type object}

\begin{figure}[htbp]
\centering
\includegraphics{images/formdialog.png}
\includegraphics[width=0.8\textwidth]{images/formdialog.png}
\caption{Form dialog window}
\label{fig:formdialog}
\end{figure}
Expand Down Expand Up @@ -2740,7 +2764,7 @@ \subsection{\objtype{Plotter} type object}
y = \mathit{scale} \cdot (x + \mathit{inputOffset}) + \mathit{outputOffset}
\end{displaymath}

Color names can be represented as in HTML or CSS (\luaexpr{"\#RRGGBB"}), SVG named colors are also supported\footnote{\url{http://www.w3.org/TR/SVG/types.html\#ColorKeywords}}.
Color names can be represented as in HTML or CSS (\luaexpr{"\#RRGGBB"}), SVG named colors are also supported\footnote{\url{https://www.w3.org/TR/SVG/types.html\#ColorKeywords}}.
\end{funcremarks}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -4723,6 +4747,8 @@ \section{Overview}

SDM plugins are not required to provide reentrancy or thread safety guarantees. Multi-threaded client applications must ensure that plugin functions are not accessed simultaneously from multiple threads.

SDM SDK includes a few example plugins to help you get started. Refer to the \shellcmd{examples/readme.txt} for details.

\section{Application binary interface}
\label{sec:abi}

Expand Down Expand Up @@ -4873,8 +4899,6 @@ \section{Developing SDM plugins in C}

Functions that should be implemented by the plugin are listed in Section \ref{sec:sdmexport}. Their prototypes and semantics are provided in Chapter \ref{ch:sdmapireference}.

SDM SDK includes a simple example, \shellcmd{simpleplugin.c}, which can be used as a reference.

\section[Developing SDM plugins in C++]{Developing SDM plugins in \cplusplus}

Plugins can be developed in \cplusplus{} as they would in C, with a few caveats:
Expand Down Expand Up @@ -4923,8 +4947,6 @@ \section{Developing SDM plugins in C}
\item Add the \shellcmd{pluginprovider} sources to the build process.
\end{enumerate}

SDM SDK includes an example, \shellcmd{uartdemo}, based on \shellcmd{pluginprovider}. It communicates with an Arduino Uno board over the serial port and provides the means to control pin states and capture data from the integrated ADC.

\section{Using SDM with CMake package system}
\label{sec:cmakeconfig}

Expand Down
2 changes: 1 addition & 1 deletion src/doc/manual/version.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% This file is automatically generated by the build system.
% Do not edit it manually.

\newcommand{\productversion}{1.0.4}
\newcommand{\productversion}{1.0.5}
2 changes: 1 addition & 1 deletion src/gui/commonwidgets/autoresizingtable.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
2 changes: 1 addition & 1 deletion src/gui/commonwidgets/autoresizingtable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
4 changes: 2 additions & 2 deletions src/gui/commonwidgets/codeeditor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down Expand Up @@ -38,7 +38,7 @@

CodeEditor::CodeEditor(QWidget *parent):
QPlainTextEdit(parent),
_tabWidth(8)
_tabWidth(4)
{
Q_INIT_RESOURCE(commonwidgets);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/commonwidgets/codeeditor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down
4 changes: 2 additions & 2 deletions src/gui/commonwidgets/consolewidget.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2021 by Microproject LLC
* Copyright (c) 2015-2022 Simple Device Model contributors
*
* This file is part of the Simple Device Model (SDM) framework.
*
Expand Down Expand Up @@ -284,7 +284,7 @@ void ConsoleWidget::runCommand(const QString &cmd,bool suppressEcho) {

void ConsoleWidget::applyFont(const QFont &f) {
QFont newFont=f;
setTabStopWidth(FontUtils::tweakForTabStops(newFont,8));
setTabStopWidth(FontUtils::tweakForTabStops(newFont,4));
setFont(newFont);
}

Expand Down
Loading

0 comments on commit 299bdf3

Please sign in to comment.