QtPdWidgets  2.3.1
Classes | Public Member Functions | Protected Member Functions | Properties | Private Attributes | List of all members
Pd::ParameterSetWidget Class Reference

Quick-selector widget for parameter sets. More...

#include <ParameterSetWidget.h>

Inheritance diagram for Pd::ParameterSetWidget:
Inheritance graph
[legend]
Collaboration diagram for Pd::ParameterSetWidget:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

 ParameterSetWidget (QWidget *parent=nullptr)
 Constructor. More...
 
virtual ~ParameterSetWidget ()
 Destructor. More...
 
void setProcesses (QSet< QtPdCom::Process *> processes)
 
void setPath (const QString &)
 
QString getPath () const
 

Protected Member Functions

bool event (QEvent *) override
 
QSize sizeHint () const override
 

Properties

QString path
 

Private Attributes

struct PD_PRIVATE Impl
 
std::unique_ptr< Implimpl
 

Detailed Description

Quick-selector widget for parameter sets.

The ParameterSetWidget class provides functionality for loading and applying parameter files. It displays a list of parameter files in a combo box, and allows the user to select a file to load or apply the parameters to the real-time process. To use it, a set of process pointers (Pd::Process *) has to be passed to the widget.

The parameter file format is JSON-based and is also understood by the Testmanager directory:

{
   "parameters":[
      {
         "url":"msr://host:2345/control/timeout",
         "value":13,
         "comment":"Scalar Parameter, Timeout in [s]"
      },
      {
         "url":"msr://host:2345/pump/speed",
         "value":1500,
         "scale":9.549296585513721,
         "comment":"Scaled Parameter in [rpm], for easier user editing. Process value * scale = file value."
      },
      {
         "url":"msr://anotherhost:2345/ForceController/TargetForce",
         "value":50e3,
         "selector":1,
         "comment":"Vector parameter in [N], selecting 2nd component"
      },
      {
         "url":"msr://anotherhost:2345/Matrix2x2",
         "value":[
            1.0,
            1.0
         ],
         "selector":[
            0,
            3
         ],
         "comment":"Matrix parameter, selecting diagonal"
      }
   ],
   "creator":"Testmanager 0.1.34-g37baaf4d",
   "creation date":"2023-03-13 14:37:58+0100",
   "created by":"fp",
   "description":"My settings"
}

Constructor & Destructor Documentation

◆ ParameterSetWidget()

ParameterSetWidget::ParameterSetWidget ( QWidget *  parent = nullptr)

Constructor.

Parameters
parentparent widget

◆ ~ParameterSetWidget()

ParameterSetWidget::~ParameterSetWidget ( )
virtual

Destructor.

Member Function Documentation

◆ event()

bool ParameterSetWidget::event ( QEvent *  event)
overrideprotected

References impl.

◆ getPath()

QString ParameterSetWidget::getPath ( ) const

References impl.

◆ setPath()

void ParameterSetWidget::setPath ( const QString &  path)

References impl, and path.

◆ setProcesses()

void ParameterSetWidget::setProcesses ( QSet< QtPdCom::Process *>  processes)

References impl.

◆ sizeHint()

QSize ParameterSetWidget::sizeHint ( ) const
overrideprotected

References impl.

Member Data Documentation

◆ Impl

◆ impl

std::unique_ptr<Impl> Pd::ParameterSetWidget::impl
private

Property Documentation

◆ path

QString Pd::ParameterSetWidget::path
readwrite

Referenced by setPath().


The documentation for this class was generated from the following files: