diff --git a/control/src/drv/commit_hash.h b/control/src/drv/commit_hash.h index dceebaa..0d3bd44 100644 --- a/control/src/drv/commit_hash.h +++ b/control/src/drv/commit_hash.h @@ -1,4 +1,4 @@ #ifndef COMMIT_HASH_H #define COMMIT_HASH_H -const char COMMIT_HASH[] = "28277098cbdeb228c0fcb0c04394643f6fd15a20"; +const char COMMIT_HASH[] = "9640bb00c8b16073af9eadf9e40ede3c2e0e4020"; #endif // COMMIT_HASH_H diff --git a/control/src/drv/driverexception.h b/control/src/drv/driverexception.h index cc6764b..5314602 100644 --- a/control/src/drv/driverexception.h +++ b/control/src/drv/driverexception.h @@ -10,25 +10,40 @@ class DriverException: public std::exception { public: + /** + * Constructor + * @param message as c-string + */ explicit DriverException(const char* message) : msg_(message) { } + /** + * Constructor + * @param message as c++-string + */ explicit DriverException(const std::string& message) : msg_(message) { } + /** + * Standard-destructor + */ virtual ~DriverException() throw () { } + /** + * Get failure description + * @return error message as c-string + */ virtual const char* what() const throw () { return msg_.c_str(); } protected: - std::string msg_; + std::string msg_; //!< failure description }; #endif // DRIVEREXCEPTION_H diff --git a/control/src/drv/plottyfile.h b/control/src/drv/plottyfile.h index e26ce45..3f2c03d 100644 --- a/control/src/drv/plottyfile.h +++ b/control/src/drv/plottyfile.h @@ -65,42 +65,43 @@ public: /** * Sets the stepwith the parameter got increased with each curve. - * \param para_first parameter stepwith + * \param para_stepwidth parameter stepwith */ void setParaStepWidth(uint16_t para_stepwidth); /** * Sets the unit of the x axis. - * \param para_first unit + * \param unit_x unit identifier */ void setUnitX(std::string unit_x); /** * Sets the description of the x axis. - * \param para_first description + * \param desc_x description */ void setDescX(std::string desc_x); /** * Sets the unit of the y axis. - * \param para_first unit + * \param unit_y unit identifier */ void setUnitY(std::string unit_y); /** * Sets the description of the y axis. - * \param para_first description + * \param desc_y description */ void setDescY(std::string desc_y); /** * Sets the unit of the parameter. - * \param para_first unit + * \param unit_para unit identifier */ void setUnitPara(std::string unit_para); + /** * Sets the description of the parameter. - * \param para_first description + * \param desc_para description */ void setDescPara(std::string desc_para); @@ -112,7 +113,7 @@ public: FunctionType getFunctionType(void) const; /** - * \return the quadrant + * \return the quadrant number */ uint8_t getQuadrant(void) const; @@ -183,7 +184,7 @@ private: std::vector dots; - int8_t command = 0x1D; + int8_t command = 0x1D; //!< command for file header const std::string head = "HTWK-HWLab"; const std::string filetype = "MD"; int16_t version = 1; @@ -200,7 +201,7 @@ private: std::string desc_y; //!< description for y-axis std::string unit_para; //!< unit name for parameter std::string desc_para; //!< description for parameter - const uint8_t eof = 0xD; + const uint8_t eof = 0xD; //!< end of file, but only marks end of header constexpr static uint8_t STR_LEN_SHORT = 10; //!< string length for short string in header constexpr static uint8_t STR_LEN_LARGE = 20; //!< string length for large string in header diff --git a/control/src/drv/timeoutexception.h b/control/src/drv/timeoutexception.h index d59fe24..766d46c 100644 --- a/control/src/drv/timeoutexception.h +++ b/control/src/drv/timeoutexception.h @@ -13,7 +13,7 @@ public: * Constructor * @param message as c-string */ - explicit TimeoutException(const char* message) : msg(message) + explicit TimeoutException(const char* message) : msg_(message) { } @@ -21,7 +21,7 @@ public: * Constructor * @param message as c++-string */ - explicit TimeoutException(const std::string& message) : msg(message) + explicit TimeoutException(const std::string& message) : msg_(message) { } @@ -36,11 +36,11 @@ public: */ virtual const char* what() const throw () { - return msg.c_str(); + return msg_.c_str(); } protected: - std::string msg; //!< failure description + std::string msg_; //!< failure description }; #endif // TIMEOUTEXCEPTION_H diff --git a/control/src/ui/view.h b/control/src/ui/view.h index a63043b..ef64df3 100644 --- a/control/src/ui/view.h +++ b/control/src/ui/view.h @@ -19,29 +19,72 @@ typedef std::function call_t; class View { public: + /** + * standard constructor, takes no args + */ View(void); + + /** + * standard destructor + */ virtual ~View(void); + /** + * Sets static view context, used for every view + * Note: this UI systems supports only one window + * \param win window context + */ static void setWinContext(WINDOW* win); + + /** + * \return static window context for all views + */ static WINDOW* getWinContext(void); + + /** + * Splits a string by a delimeter and returns the parts in a vector + * \param str input string + * \param delim the delimeter for splitting + * \return splitted parts of str + */ static std::vector str_split(const std::string& str, const std::string delim); + /** + * Sets the title of this view + * \param title string to set title + */ virtual void setTitle(std::string title); + /** + * Repaints the whole window with the current view. + * The centered position of the window in the terminal gets new calculated. + * The window box gets repainted. + */ virtual void repaint(void); + /** + * Abstract function for drawing ths particular view. + * Gets overridden in the derived classes to paints for example a promt. + */ virtual void draw(void) = 0; + + /** + * Abstract function for the view to reacted on a keypress. + * Gets overridden in the derived classes to close for example a view on ESC. + */ virtual call_t keypress(int& key) = 0; protected: - int width, height; - int start_x = 0, start_y = 0; - std::string title; - std::vector calls; + int width; //!< width of view in terminal characters + int height; //!< height of view in terminal characters + int start_x = 0; //!< x offset (characters) in the terminal, used to center the window on repaint() + int start_y = 0; //!< y offset (characters) in the terminal, used to center the window on repaint() + std::string title; //!< title of the view + std::vector calls; //!< calls (function pointers) for different button actions in the view (if any) - static WINDOW* win; - constexpr static int KEY_ENT = 10; + static WINDOW* win; //!< static window contexts for all views + constexpr static int KEY_ENT = 10; //!< Key value for the Enter key }; #endif // VIEW_H diff --git a/docs/html/annotated.html b/docs/html/annotated.html index e4a439d..3c75bdc 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -85,7 +85,7 @@ $(function() { diff --git a/docs/html/b15f_8cpp_source.html b/docs/html/b15f_8cpp_source.html index 52f2788..c16b11c 100644 --- a/docs/html/b15f_8cpp_source.html +++ b/docs/html/b15f_8cpp_source.html @@ -121,7 +121,7 @@ $(function() { diff --git a/docs/html/b15f_8h_source.html b/docs/html/b15f_8h_source.html index 650fc40..1f7ab2b 100644 --- a/docs/html/b15f_8h_source.html +++ b/docs/html/b15f_8h_source.html @@ -117,7 +117,7 @@ $(function() { diff --git a/docs/html/classB15F-members.html b/docs/html/classB15F-members.html index fbe016a..40b8468 100644 --- a/docs/html/classB15F-members.html +++ b/docs/html/classB15F-members.html @@ -114,7 +114,7 @@ $(function() { diff --git a/docs/html/classB15F.html b/docs/html/classB15F.html index 7961a88..5f95f3a 100644 --- a/docs/html/classB15F.html +++ b/docs/html/classB15F.html @@ -1309,7 +1309,7 @@ constexpr static uint32_t  diff --git a/docs/html/classDot-members.html b/docs/html/classDot-members.html index 77b821a..0f0670f 100644 --- a/docs/html/classDot-members.html +++ b/docs/html/classDot-members.html @@ -76,7 +76,7 @@ $(function() { diff --git a/docs/html/classDot.html b/docs/html/classDot.html index 4a41143..3759bcf 100644 --- a/docs/html/classDot.html +++ b/docs/html/classDot.html @@ -196,7 +196,7 @@ Public Member Functions diff --git a/docs/html/classDriverException-members.html b/docs/html/classDriverException-members.html index f63d184..44455f3 100644 --- a/docs/html/classDriverException-members.html +++ b/docs/html/classDriverException-members.html @@ -69,15 +69,15 @@ $(function() {

This is the complete list of members for DriverException, including all inherited members.

- - - - - + + + + +
DriverException(const char *message) (defined in DriverException)DriverExceptioninlineexplicit
DriverException(const std::string &message) (defined in DriverException)DriverExceptioninlineexplicit
msg_ (defined in DriverException)DriverExceptionprotected
what() const (defined in DriverException)DriverExceptioninlinevirtual
~DriverException() (defined in DriverException)DriverExceptioninlinevirtual
DriverException(const char *message)DriverExceptioninlineexplicit
DriverException(const std::string &message)DriverExceptioninlineexplicit
msg_DriverExceptionprotected
what() constDriverExceptioninlinevirtual
~DriverException()DriverExceptioninlinevirtual
diff --git a/docs/html/classDriverException.html b/docs/html/classDriverException.html index 3a97cb1..688ef0a 100644 --- a/docs/html/classDriverException.html +++ b/docs/html/classDriverException.html @@ -83,33 +83,171 @@ $(function() { - + - + - + + +

Public Member Functions

DriverException (const char *message)
 DriverException (const char *message)
 
DriverException (const std::string &message)
 DriverException (const std::string &message)
 
-virtual const char * what () const throw ()
virtual ~DriverException () throw ()
 
virtual const char * what () const throw ()
 
+std::string  +

Protected Attributes

-std::string msg_
msg_
 failure description
 

Detailed Description

Exception driver problems, for instance incompatible firmware version.

Definition at line 10 of file driverexception.h.

-

The documentation for this class was generated from the following file:
    +

    Constructor & Destructor Documentation

    + +

    ◆ DriverException() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    DriverException::DriverException (const char * message)
    +
    +inlineexplicit
    +
    +

    Constructor

    Parameters
    + + +
    messageas c-string
    +
    +
    + +

    Definition at line 17 of file driverexception.h.

    + +
    +
    + +

    ◆ DriverException() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + +
    DriverException::DriverException (const std::string & message)
    +
    +inlineexplicit
    +
    +

    Constructor

    Parameters
    + + +
    messageas c++-string
    +
    +
    + +

    Definition at line 25 of file driverexception.h.

    + +
    +
    + +

    ◆ ~DriverException()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + +
    virtual DriverException::~DriverException ()
    throw (
    )
    +
    +inlinevirtual
    +
    +

    Standard-destructor

    + +

    Definition at line 32 of file driverexception.h.

    + +
    +
    +

    Member Function Documentation

    + +

    ◆ what()

    + +
    +
    + + + + + +
    + + + + + + + + + + + + + +
    virtual const char* DriverException::what () const
    throw (
    )
    +
    +inlinevirtual
    +
    +

    Get failure description

    Returns
    error message as c-string
    + +

    Definition at line 40 of file driverexception.h.

    + +
    +
    +
    The documentation for this class was generated from the following file: diff --git a/docs/html/classPlottyFile-members.html b/docs/html/classPlottyFile-members.html index 1493624..3a36954 100644 --- a/docs/html/classPlottyFile-members.html +++ b/docs/html/classPlottyFile-members.html @@ -100,7 +100,7 @@ $(function() { diff --git a/docs/html/classPlottyFile.html b/docs/html/classPlottyFile.html index 02be7ac..f9b3f83 100644 --- a/docs/html/classPlottyFile.html +++ b/docs/html/classPlottyFile.html @@ -329,7 +329,7 @@ Public Member Functions
    -
    Returns
    the quadrant
    +
    Returns
    the quadrant number

    Definition at line 80 of file plottyfile.cpp.

    @@ -457,7 +457,7 @@ Public Member Functions

    Sets the description of the parameter.

    Parameters
    - +
    para_firstdescription
    desc_paradescription
    @@ -483,7 +483,7 @@ Public Member Functions

    Sets the description of the x axis.

    Parameters
    - +
    para_firstdescription
    desc_xdescription
    @@ -509,7 +509,7 @@ Public Member Functions

    Sets the description of the y axis.

    Parameters
    - +
    para_firstdescription
    desc_ydescription
    @@ -587,7 +587,7 @@ Public Member Functions

    Sets the stepwith the parameter got increased with each curve.

    Parameters
    - +
    para_firstparameter stepwith
    para_stepwidthparameter stepwith
    @@ -691,7 +691,7 @@ Public Member Functions

    Sets the unit of the parameter.

    Parameters
    - +
    para_firstunit
    unit_paraunit identifier
    @@ -717,7 +717,7 @@ Public Member Functions

    Sets the unit of the x axis.

    Parameters
    - +
    para_firstunit
    unit_xunit identifier
    @@ -743,7 +743,7 @@ Public Member Functions

    Sets the unit of the y axis.

    Parameters
    - +
    para_firstunit
    unit_yunit identifier
    @@ -811,7 +811,7 @@ Public Member Functions
    diff --git a/docs/html/classTimeoutException-members.html b/docs/html/classTimeoutException-members.html index 3c9f2f9..850108d 100644 --- a/docs/html/classTimeoutException-members.html +++ b/docs/html/classTimeoutException-members.html @@ -69,7 +69,7 @@ $(function() {

    This is the complete list of members for TimeoutException, including all inherited members.

    - + @@ -77,7 +77,7 @@ $(function() {
    msgTimeoutExceptionprotected
    msg_TimeoutExceptionprotected
    TimeoutException(const char *message)TimeoutExceptioninlineexplicit
    TimeoutException(const std::string &message)TimeoutExceptioninlineexplicit
    what() constTimeoutExceptioninlinevirtual
    diff --git a/docs/html/classTimeoutException.html b/docs/html/classTimeoutException.html index e6f713c..26950b0 100644 --- a/docs/html/classTimeoutException.html +++ b/docs/html/classTimeoutException.html @@ -94,10 +94,10 @@ Public Member Functions - - - + + +

    Protected Attributes

    -std::string msg
     failure description
     
    +std::string msg_
     failure description
     

    Detailed Description

    Exception for USART related timeouts.

    @@ -239,7 +239,7 @@ std::string  diff --git a/docs/html/classUSART-members.html b/docs/html/classUSART-members.html index 6c9f906..a1bd4a2 100644 --- a/docs/html/classUSART-members.html +++ b/docs/html/classUSART-members.html @@ -86,7 +86,7 @@ $(function() {
    diff --git a/docs/html/classUSART.html b/docs/html/classUSART.html index b0ea1f3..26b6c3e 100644 --- a/docs/html/classUSART.html +++ b/docs/html/classUSART.html @@ -523,7 +523,7 @@ Public Member Functions diff --git a/docs/html/classUSARTException-members.html b/docs/html/classUSARTException-members.html index 4820c91..ab4bbff 100644 --- a/docs/html/classUSARTException-members.html +++ b/docs/html/classUSARTException-members.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/html/classUSARTException.html b/docs/html/classUSARTException.html index ccdff9b..67a3ecf 100644 --- a/docs/html/classUSARTException.html +++ b/docs/html/classUSARTException.html @@ -239,7 +239,7 @@ std::string  diff --git a/docs/html/classView-members.html b/docs/html/classView-members.html index c128b99..1e17025 100644 --- a/docs/html/classView-members.html +++ b/docs/html/classView-members.html @@ -69,27 +69,27 @@ $(function() {

    This is the complete list of members for View, including all inherited members.

    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
    calls (defined in View)Viewprotected
    draw(void)=0 (defined in View)Viewpure virtual
    getWinContext(void) (defined in View)Viewstatic
    height (defined in View)Viewprotected
    KEY_ENT (defined in View)Viewprotectedstatic
    keypress(int &key)=0 (defined in View)Viewpure virtual
    repaint(void) (defined in View)Viewvirtual
    setTitle(std::string title) (defined in View)Viewvirtual
    setWinContext(WINDOW *win) (defined in View)Viewstatic
    start_x (defined in View)Viewprotected
    start_y (defined in View)Viewprotected
    str_split(const std::string &str, const std::string delim) (defined in View)Viewstatic
    title (defined in View)Viewprotected
    View(void) (defined in View)View
    width (defined in View)Viewprotected
    win (defined in View)Viewprotectedstatic
    ~View(void) (defined in View)Viewvirtual
    callsViewprotected
    draw(void)=0Viewpure virtual
    getWinContext(void)Viewstatic
    heightViewprotected
    KEY_ENTViewprotectedstatic
    keypress(int &key)=0Viewpure virtual
    repaint(void)Viewvirtual
    setTitle(std::string title)Viewvirtual
    setWinContext(WINDOW *win)Viewstatic
    start_xViewprotected
    start_yViewprotected
    str_split(const std::string &str, const std::string delim)Viewstatic
    titleViewprotected
    View(void)View
    widthViewprotected
    winViewprotectedstatic
    ~View(void)Viewvirtual
    diff --git a/docs/html/classView.html b/docs/html/classView.html index 8c67c74..9546d4c 100644 --- a/docs/html/classView.html +++ b/docs/html/classView.html @@ -91,73 +91,360 @@ $(function() { - + + + + + - + - + - +

    Public Member Functions

    -virtual void setTitle (std::string title)
     View (void)
     
    virtual ~View (void)
     
    virtual void setTitle (std::string title)
     
    -virtual void repaint (void)
    virtual void repaint (void)
     
    -virtual void draw (void)=0
    virtual void draw (void)=0
     
    -virtual call_t keypress (int &key)=0
    virtual call_t keypress (int &key)=0
     
    - + - + - +

    Static Public Member Functions

    -static void setWinContext (WINDOW *win)
    static void setWinContext (WINDOW *win)
     
    -static WINDOW * getWinContext (void)
    static WINDOW * getWinContext (void)
     
    -static std::vector< std::string > str_split (const std::string &str, const std::string delim)
    static std::vector< std::string > str_split (const std::string &str, const std::string delim)
     
    +int  + +int  + +int  + +int  + +std::string  + +std::vector< call_t >  +

    Protected Attributes

    -int width
    width
     width of view in terminal characters
     
    -int height
    height
     height of view in terminal characters
     
    -int start_x = 0
    start_x = 0
     x offset (characters) in the terminal, used to center the window on repaint()
     
    -int start_y = 0
    start_y = 0
     y offset (characters) in the terminal, used to center the window on repaint()
     
    -std::string title
    title
     title of the view
     
    -std::vector< call_t > calls
    calls
     calls (function pointers) for different button actions in the view (if any)
     
    +static WINDOW *  + +constexpr static int  +

    Static Protected Attributes

    -static WINDOW * win = nullptr
    win = nullptr
     static window contexts for all views
     
    -constexpr static int KEY_ENT = 10
    KEY_ENT = 10
     Key value for the Enter key.
     

    Detailed Description

    Base class for multiple views with the ncurses user interface.

    Definition at line 19 of file view.h.

    -

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

      Constructor & Destructor Documentation

      + +

      ◆ View()

      + +
      +
      + + + + + + + + +
      View::View (void )
      +
      +

      standard constructor, takes no args

      + +

      Definition at line 5 of file view.cpp.

      + +
      +
      + +

      ◆ ~View()

      + +
      +
      + + + + + +
      + + + + + + + + +
      View::~View (void )
      +
      +virtual
      +
      +

      standard destructor

      + +

      Definition at line 15 of file view.cpp.

      + +
      +
      +

      Member Function Documentation

      + +

      ◆ draw()

      + +
      +
      + + + + + +
      + + + + + + + + +
      virtual void View::draw (void )
      +
      +pure virtual
      +
      +

      Abstract function for drawing ths particular view. Gets overridden in the derived classes to paints for example a promt.

      + +

      Implemented in ViewInfo, ViewPromt, and ViewSelection.

      + +
      +
      + +

      ◆ getWinContext()

      + +
      +
      + + + + + +
      + + + + + + + + +
      WINDOW * View::getWinContext (void )
      +
      +static
      +
      +
      Returns
      static window context for all views
      + +

      Definition at line 24 of file view.cpp.

      + +
      +
      + +

      ◆ keypress()

      + +
      +
      + + + + + +
      + + + + + + + + +
      virtual call_t View::keypress (int & key)
      +
      +pure virtual
      +
      +

      Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

      + +

      Implemented in ViewMonitor, ViewPromt, ViewInfo, and ViewSelection.

      + +
      +
      + +

      ◆ repaint()

      + +
      +
      + + + + + +
      + + + + + + + + +
      void View::repaint (void )
      +
      +virtual
      +
      +

      Repaints the whole window with the current view. The centered position of the window in the terminal gets new calculated. The window box gets repainted.

      + +

      Definition at line 52 of file view.cpp.

      + +
      +
      + +

      ◆ setTitle()

      + +
      +
      + + + + + +
      + + + + + + + + +
      void View::setTitle (std::string title)
      +
      +virtual
      +
      +

      Sets the title of this view

      Parameters
      + + +
      titlestring to set title
      +
      +
      + +

      Definition at line 47 of file view.cpp.

      + +
      +
      + +

      ◆ setWinContext()

      + +
      +
      + + + + + +
      + + + + + + + + +
      void View::setWinContext (WINDOW * win)
      +
      +static
      +
      +

      Sets static view context, used for every view Note: this UI systems supports only one window

      Parameters
      + + +
      winwindow context
      +
      +
      + +

      Definition at line 19 of file view.cpp.

      + +
      +
      + +

      ◆ str_split()

      + +
      +
      + + + + + +
      + + + + + + + + + + + + + + + + + + +
      std::vector< std::string > View::str_split (const std::string & str,
      const std::string delim 
      )
      +
      +static
      +
      +

      Splits a string by a delimeter and returns the parts in a vector

      Parameters
      + + + +
      strinput string
      delimthe delimeter for splitting
      +
      +
      +
      Returns
      splitted parts of str
      + +

      Definition at line 30 of file view.cpp.

      + +
      +
      +
      The documentation for this class was generated from the following files: diff --git a/docs/html/classViewInfo-members.html b/docs/html/classViewInfo-members.html index 176829a..38c18f2 100644 --- a/docs/html/classViewInfo-members.html +++ b/docs/html/classViewInfo-members.html @@ -69,37 +69,37 @@ $(function() {

      This is the complete list of members for ViewInfo, including all inherited members.

      - + - - - - - + + + + + - + - - - - - + + + + + - - + + - - - + + +
      calls (defined in View)Viewprotected
      callsViewprotected
      close_offset_x (defined in ViewInfo)ViewInfoprotected
      close_offset_y (defined in ViewInfo)ViewInfoprotected
      draw(void) override (defined in ViewInfo)ViewInfovirtual
      getWinContext(void) (defined in View)Viewstatic
      height (defined in View)Viewprotected
      KEY_ENT (defined in View)Viewprotectedstatic
      keypress(int &key) override (defined in ViewInfo)ViewInfovirtual
      draw(void) overrideViewInfovirtual
      getWinContext(void)Viewstatic
      heightViewprotected
      KEY_ENTViewprotectedstatic
      keypress(int &key) overrideViewInfovirtual
      label_close (defined in ViewInfo)ViewInfoprotected
      repaint(void) (defined in View)Viewvirtual
      repaint(void)Viewvirtual
      setCall(call_t call) (defined in ViewInfo)ViewInfovirtual
      setLabelClose(std::string label) (defined in ViewInfo)ViewInfovirtual
      setText(std::string text) (defined in ViewInfo)ViewInfovirtual
      setTitle(std::string title) (defined in View)Viewvirtual
      setWinContext(WINDOW *win) (defined in View)Viewstatic
      start_x (defined in View)Viewprotected
      start_y (defined in View)Viewprotected
      str_split(const std::string &str, const std::string delim) (defined in View)Viewstatic
      setTitle(std::string title)Viewvirtual
      setWinContext(WINDOW *win)Viewstatic
      start_xViewprotected
      start_yViewprotected
      str_split(const std::string &str, const std::string delim)Viewstatic
      text (defined in ViewInfo)ViewInfoprotected
      text_offset_x (defined in ViewInfo)ViewInfoprotectedstatic
      text_offset_y (defined in ViewInfo)ViewInfoprotectedstatic
      title (defined in View)Viewprotected
      View(void) (defined in View)View
      titleViewprotected
      View(void)View
      ViewInfo(void) (defined in ViewInfo)ViewInfo
      width (defined in View)Viewprotected
      win (defined in View)Viewprotectedstatic
      ~View(void) (defined in View)Viewvirtual
      widthViewprotected
      winViewprotectedstatic
      ~View(void)Viewvirtual
      diff --git a/docs/html/classViewInfo.html b/docs/html/classViewInfo.html index b6e43bb..ae43c44 100644 --- a/docs/html/classViewInfo.html +++ b/docs/html/classViewInfo.html @@ -97,18 +97,18 @@ virtual void setLabelClose virtual void setCall (call_t call)   - -virtual void draw (void) override +virtual void draw (void) override   - -virtual call_t keypress (int &key) override +virtual call_t keypress (int &key) override   - Public Member Functions inherited from View - -virtual void setTitle (std::string title) + View (void) +  +virtual ~View (void) +  +virtual void setTitle (std::string title)   - -virtual void repaint (void) +virtual void repaint (void)   +int  + +int  + +int  + +int  + +std::string  + +std::vector< call_t >  +

      @@ -127,22 +127,28 @@ int 

      close_offset_y = 0
       
      - Protected Attributes inherited from View
      -int width
      width
       width of view in terminal characters
       
      -int height
      height
       height of view in terminal characters
       
      -int start_x = 0
      start_x = 0
       x offset (characters) in the terminal, used to center the window on repaint()
       
      -int start_y = 0
      start_y = 0
       y offset (characters) in the terminal, used to center the window on repaint()
       
      -std::string title
      title
       title of the view
       
      -std::vector< call_t > calls
      calls
       calls (function pointers) for different button actions in the view (if any)
       
      +static WINDOW *  + +constexpr static int  +

      @@ -155,37 +161,101 @@ constexpr static int 

      text_
       
      - Static Protected Attributes inherited from View
      -static WINDOW * win = nullptr
      win = nullptr
       static window contexts for all views
       
      -constexpr static int KEY_ENT = 10
      KEY_ENT = 10
       Key value for the Enter key.
       
      - + - + - +

      Additional Inherited Members

      - Static Public Member Functions inherited from View
      -static void setWinContext (WINDOW *win)
      static void setWinContext (WINDOW *win)
       
      -static WINDOW * getWinContext (void)
      static WINDOW * getWinContext (void)
       
      -static std::vector< std::string > str_split (const std::string &str, const std::string delim)
      static std::vector< std::string > str_split (const std::string &str, const std::string delim)
       

      Detailed Description

      View for simple text message output.

      Definition at line 8 of file view_info.h.

      -

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

        Member Function Documentation

        + +

        ◆ draw()

        + +
        +
        + + + + + +
        + + + + + + + + +
        void ViewInfo::draw (void )
        +
        +overridevirtual
        +
        +

        Abstract function for drawing ths particular view. Gets overridden in the derived classes to paints for example a promt.

        + +

        Implements View.

        + +

        Definition at line 23 of file view_info.cpp.

        + +
        +
        + +

        ◆ keypress()

        + +
        +
        + + + + + +
        + + + + + + + + +
        call_t ViewInfo::keypress (int & key)
        +
        +overridevirtual
        +
        +

        Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

        + +

        Implements View.

        + +

        Reimplemented in ViewMonitor.

        + +

        Definition at line 37 of file view_info.cpp.

        + +
        +
        +
        The documentation for this class was generated from the following files: diff --git a/docs/html/classViewMonitor-members.html b/docs/html/classViewMonitor-members.html index 3b836a1..46c2b38 100644 --- a/docs/html/classViewMonitor-members.html +++ b/docs/html/classViewMonitor-members.html @@ -69,41 +69,41 @@ $(function() {

        This is the complete list of members for ViewMonitor, including all inherited members.

        - + - - - - - + + + + + - + - - - - - + + + + + - - + + - - + + - +
        calls (defined in View)Viewprotected
        callsViewprotected
        close_offset_x (defined in ViewInfo)ViewInfoprotected
        close_offset_y (defined in ViewInfo)ViewInfoprotected
        draw(void) override (defined in ViewInfo)ViewInfovirtual
        getWinContext(void) (defined in View)Viewstatic
        height (defined in View)Viewprotected
        KEY_ENT (defined in View)Viewprotectedstatic
        keypress(int &key) override (defined in ViewMonitor)ViewMonitorvirtual
        draw(void) overrideViewInfovirtual
        getWinContext(void)Viewstatic
        heightViewprotected
        KEY_ENTViewprotectedstatic
        keypress(int &key) overrideViewMonitorvirtual
        label_close (defined in ViewInfo)ViewInfoprotected
        repaint(void) (defined in View)Viewvirtual
        repaint(void)Viewvirtual
        run_worker (defined in ViewMonitor)ViewMonitorprotected
        setCall(call_t call) (defined in ViewInfo)ViewInfovirtual
        setLabelClose(std::string label) (defined in ViewInfo)ViewInfovirtual
        setText(std::string text) (defined in ViewInfo)ViewInfovirtual
        setTitle(std::string title) (defined in View)Viewvirtual
        setWinContext(WINDOW *win) (defined in View)Viewstatic
        start_x (defined in View)Viewprotected
        start_y (defined in View)Viewprotected
        str_split(const std::string &str, const std::string delim) (defined in View)Viewstatic
        setTitle(std::string title)Viewvirtual
        setWinContext(WINDOW *win)Viewstatic
        start_xViewprotected
        start_yViewprotected
        str_split(const std::string &str, const std::string delim)Viewstatic
        t_worker (defined in ViewMonitor)ViewMonitorprotected
        text (defined in ViewInfo)ViewInfoprotected
        text_offset_x (defined in ViewInfo)ViewInfoprotectedstatic
        text_offset_y (defined in ViewInfo)ViewInfoprotectedstatic
        title (defined in View)Viewprotected
        View(void) (defined in View)View
        titleViewprotected
        View(void)View
        ViewInfo(void) (defined in ViewInfo)ViewInfo
        ViewMonitor(void) (defined in ViewMonitor)ViewMonitor
        width (defined in View)Viewprotected
        win (defined in View)Viewprotectedstatic
        widthViewprotected
        winViewprotectedstatic
        worker(void) (defined in ViewMonitor)ViewMonitorprotectedvirtual
        ~View(void) (defined in View)Viewvirtual
        ~View(void)Viewvirtual
        diff --git a/docs/html/classViewMonitor.html b/docs/html/classViewMonitor.html index e3795ae..e78f6d2 100644 --- a/docs/html/classViewMonitor.html +++ b/docs/html/classViewMonitor.html @@ -88,8 +88,7 @@ $(function() { - + - + - + + + + + - +

        Public Member Functions

        -virtual call_t keypress (int &key) override
        virtual call_t keypress (int &key) override
         
        - Public Member Functions inherited from ViewInfo
        @@ -101,15 +100,16 @@ virtual void setLabelClose
        virtual void setCall (call_t call)
         
        -virtual void draw (void) override
        virtual void draw (void) override
         
        - Public Member Functions inherited from View
        -virtual void setTitle (std::string title)
         View (void)
         
        virtual ~View (void)
         
        virtual void setTitle (std::string title)
         
        -virtual void repaint (void)
        virtual void repaint (void)
         
        +int  + +int  + +int  + +int  + +std::string  + +std::vector< call_t >  +

        @@ -141,35 +141,38 @@ int 

        close_offset_y = 0
         
        - Protected Attributes inherited from View
        -int width
        width
         width of view in terminal characters
         
        -int height
        height
         height of view in terminal characters
         
        -int start_x = 0
        start_x = 0
         x offset (characters) in the terminal, used to center the window on repaint()
         
        -int start_y = 0
        start_y = 0
         y offset (characters) in the terminal, used to center the window on repaint()
         
        -std::string title
        title
         title of the view
         
        -std::vector< call_t > calls
        calls
         calls (function pointers) for different button actions in the view (if any)
         
        - + - + - + +static WINDOW *  + +constexpr static int  +

        Additional Inherited Members

        - Static Public Member Functions inherited from View
        -static void setWinContext (WINDOW *win)
        static void setWinContext (WINDOW *win)
         
        -static WINDOW * getWinContext (void)
        static WINDOW * getWinContext (void)
         
        -static std::vector< std::string > str_split (const std::string &str, const std::string delim)
        static std::vector< std::string > str_split (const std::string &str, const std::string delim)
         
        - Static Protected Attributes inherited from ViewInfo
        @@ -180,24 +183,58 @@ constexpr static int text_
         
        - Static Protected Attributes inherited from View
        -static WINDOW * win = nullptr
        win = nullptr
         static window contexts for all views
         
        -constexpr static int KEY_ENT = 10
        KEY_ENT = 10
         Key value for the Enter key.
         

        Detailed Description

        View to display all B15 inputs.

        Definition at line 13 of file view_monitor.h.

        -

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

          Member Function Documentation

          + +

          ◆ keypress()

          + +
          +
          + + + + + +
          + + + + + + + + +
          call_t ViewMonitor::keypress (int & key)
          +
          +overridevirtual
          +
          +

          Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

          + +

          Reimplemented from ViewInfo.

          + +

          Definition at line 7 of file view_monitor.cpp.

          + +
          +
          +
          The documentation for this class was generated from the following files: diff --git a/docs/html/classViewPromt-members.html b/docs/html/classViewPromt-members.html index 5fe509a..97bf039 100644 --- a/docs/html/classViewPromt-members.html +++ b/docs/html/classViewPromt-members.html @@ -72,40 +72,40 @@ $(function() { button_offset_x (defined in ViewPromt)ViewPromtprotected button_offset_y (defined in ViewPromt)ViewPromtprotected call_confirm (defined in ViewPromt)ViewPromtprotected - calls (defined in View)Viewprotected + callsViewprotected cancelable (defined in ViewPromt)ViewPromtprotected - draw(void) override (defined in ViewPromt)ViewPromtvirtual + draw(void) overrideViewPromtvirtual getInput(void) (defined in ViewPromt)ViewPromtvirtual - getWinContext(void) (defined in View)Viewstatic - height (defined in View)Viewprotected + getWinContext(void)Viewstatic + heightViewprotected input (defined in ViewPromt)ViewPromtprotected - KEY_ENT (defined in View)Viewprotectedstatic - keypress(int &key) override (defined in ViewPromt)ViewPromtvirtual + KEY_ENTViewprotectedstatic + keypress(int &key) overrideViewPromtvirtual label_cancel (defined in ViewPromt)ViewPromtprotected label_confirm (defined in ViewPromt)ViewPromtprotected message (defined in ViewPromt)ViewPromtprotected - repaint(void) (defined in View)Viewvirtual + repaint(void)Viewvirtual selection (defined in ViewPromt)ViewPromtprotected sep (defined in ViewPromt)ViewPromtprotected setCancel(std::string name, bool cancelable) (defined in ViewPromt)ViewPromtvirtual setConfirm(std::string name, call_t call) (defined in ViewPromt)ViewPromtvirtual setMessage(std::string message) (defined in ViewPromt)ViewPromtvirtual - setTitle(std::string title) (defined in View)Viewvirtual - setWinContext(WINDOW *win) (defined in View)Viewstatic - start_x (defined in View)Viewprotected - start_y (defined in View)Viewprotected - str_split(const std::string &str, const std::string delim) (defined in View)Viewstatic + setTitle(std::string title)Viewvirtual + setWinContext(WINDOW *win)Viewstatic + start_xViewprotected + start_yViewprotected + str_split(const std::string &str, const std::string delim)Viewstatic text_offset_x (defined in ViewPromt)ViewPromtprotectedstatic text_offset_y (defined in ViewPromt)ViewPromtprotectedstatic - title (defined in View)Viewprotected - View(void) (defined in View)View - width (defined in View)Viewprotected - win (defined in View)Viewprotectedstatic - ~View(void) (defined in View)Viewvirtual + titleViewprotected + View(void)View + widthViewprotected + winViewprotectedstatic + ~View(void)Viewvirtual diff --git a/docs/html/classViewPromt.html b/docs/html/classViewPromt.html index 8ece5b1..20da289 100644 --- a/docs/html/classViewPromt.html +++ b/docs/html/classViewPromt.html @@ -87,8 +87,7 @@ $(function() { - + @@ -102,15 +101,16 @@ virtual void  - + - + + + + + - +

          Public Member Functions

          -virtual void draw (void) override
          virtual void draw (void) override
           
          virtual void setMessage (std::string message)
          setCancel
          virtual std::string getInput (void)
           
          -virtual call_t keypress (int &key) override
          virtual call_t keypress (int &key) override
           
          - Public Member Functions inherited from View
          -virtual void setTitle (std::string title)
           View (void)
           
          virtual ~View (void)
           
          virtual void setTitle (std::string title)
           
          -virtual void repaint (void)
          virtual void repaint (void)
           
          +int  + +int  + +int  + +int  + +std::string  + +std::vector< call_t >  +

          @@ -147,22 +147,28 @@ int 

          button_offset_y =
           
          - Protected Attributes inherited from View
          -int width
          width
           width of view in terminal characters
           
          -int height
          height
           height of view in terminal characters
           
          -int start_x = 0
          start_x = 0
           x offset (characters) in the terminal, used to center the window on repaint()
           
          -int start_y = 0
          start_y = 0
           y offset (characters) in the terminal, used to center the window on repaint()
           
          -std::string title
          title
           title of the view
           
          -std::vector< call_t > calls
          calls
           calls (function pointers) for different button actions in the view (if any)
           
          +static WINDOW *  + +constexpr static int  +

          @@ -175,37 +181,99 @@ constexpr static int 

          text_
           
          - Static Protected Attributes inherited from View
          -static WINDOW * win = nullptr
          win = nullptr
           static window contexts for all views
           
          -constexpr static int KEY_ENT = 10
          KEY_ENT = 10
           Key value for the Enter key.
           
          - + - + - +

          Additional Inherited Members

          - Static Public Member Functions inherited from View
          -static void setWinContext (WINDOW *win)
          static void setWinContext (WINDOW *win)
           
          -static WINDOW * getWinContext (void)
          static WINDOW * getWinContext (void)
           
          -static std::vector< std::string > str_split (const std::string &str, const std::string delim)
          static std::vector< std::string > str_split (const std::string &str, const std::string delim)
           

          Detailed Description

          View for basic user text input.

          Definition at line 10 of file view_promt.h.

          -

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

            Member Function Documentation

            + +

            ◆ draw()

            + +
            +
            + + + + + +
            + + + + + + + + +
            void ViewPromt::draw (void )
            +
            +overridevirtual
            +
            +

            Abstract function for drawing ths particular view. Gets overridden in the derived classes to paints for example a promt.

            + +

            Implements View.

            + +

            Definition at line 3 of file view_promt.cpp.

            + +
            +
            + +

            ◆ keypress()

            + +
            +
            + + + + + +
            + + + + + + + + +
            std::function< void(int)> ViewPromt::keypress (int & key)
            +
            +overridevirtual
            +
            +

            Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

            + +

            Implements View.

            + +

            Definition at line 59 of file view_promt.cpp.

            + +
            +
            +
            The documentation for this class was generated from the following files: diff --git a/docs/html/classViewSelection-members.html b/docs/html/classViewSelection-members.html index 116bec5..07d39e9 100644 --- a/docs/html/classViewSelection-members.html +++ b/docs/html/classViewSelection-members.html @@ -70,31 +70,31 @@ $(function() {

            This is the complete list of members for ViewSelection, including all inherited members.

            - + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + +
            addChoice(std::string name, call_t call) (defined in ViewSelection)ViewSelectionvirtual
            calls (defined in View)Viewprotected
            callsViewprotected
            choice_offset_x (defined in ViewSelection)ViewSelectionprotectedstatic
            choice_offset_y (defined in ViewSelection)ViewSelectionprotectedstatic
            choices (defined in ViewSelection)ViewSelectionprotected
            draw(void) override (defined in ViewSelection)ViewSelectionvirtual
            getWinContext(void) (defined in View)Viewstatic
            height (defined in View)Viewprotected
            KEY_ENT (defined in View)Viewprotectedstatic
            keypress(int &key) override (defined in ViewSelection)ViewSelectionvirtual
            repaint(void) (defined in View)Viewvirtual
            draw(void) overrideViewSelectionvirtual
            getWinContext(void)Viewstatic
            heightViewprotected
            KEY_ENTViewprotectedstatic
            keypress(int &key) overrideViewSelectionvirtual
            repaint(void)Viewvirtual
            selection (defined in ViewSelection)ViewSelectionprotected
            setTitle(std::string title) (defined in View)Viewvirtual
            setWinContext(WINDOW *win) (defined in View)Viewstatic
            start_x (defined in View)Viewprotected
            start_y (defined in View)Viewprotected
            str_split(const std::string &str, const std::string delim) (defined in View)Viewstatic
            title (defined in View)Viewprotected
            View(void) (defined in View)View
            width (defined in View)Viewprotected
            win (defined in View)Viewprotectedstatic
            ~View(void) (defined in View)Viewvirtual
            setTitle(std::string title)Viewvirtual
            setWinContext(WINDOW *win)Viewstatic
            start_xViewprotected
            start_yViewprotected
            str_split(const std::string &str, const std::string delim)Viewstatic
            titleViewprotected
            View(void)View
            widthViewprotected
            winViewprotectedstatic
            ~View(void)Viewvirtual
            diff --git a/docs/html/classViewSelection.html b/docs/html/classViewSelection.html index 7251946..e1982d9 100644 --- a/docs/html/classViewSelection.html +++ b/docs/html/classViewSelection.html @@ -87,21 +87,21 @@ $(function() { - + - + - + + + + + - +

            Public Member Functions

            -virtual void draw (void) override
            virtual void draw (void) override
             
            virtual void addChoice (std::string name, call_t call)
             
            -virtual call_t keypress (int &key) override
            virtual call_t keypress (int &key) override
             
            - Public Member Functions inherited from View
            -virtual void setTitle (std::string title)
             View (void)
             
            virtual ~View (void)
             
            virtual void setTitle (std::string title)
             
            -virtual void repaint (void)
            virtual void repaint (void)
             
            +int  + +int  + +int  + +int  + +std::string  + +std::vector< call_t >  +

            @@ -114,22 +114,28 @@ std::vector< std::string > 

             
            - Protected Attributes inherited from View
            -int width
            width
             width of view in terminal characters
             
            -int height
            height
             height of view in terminal characters
             
            -int start_x = 0
            start_x = 0
             x offset (characters) in the terminal, used to center the window on repaint()
             
            -int start_y = 0
            start_y = 0
             y offset (characters) in the terminal, used to center the window on repaint()
             
            -std::string title
            title
             title of the view
             
            -std::vector< call_t > calls
            calls
             calls (function pointers) for different button actions in the view (if any)
             
            +static WINDOW *  + +constexpr static int  +

            @@ -142,37 +148,99 @@ constexpr static int 

            choic
             
            - Static Protected Attributes inherited from View
            -static WINDOW * win = nullptr
            win = nullptr
             static window contexts for all views
             
            -constexpr static int KEY_ENT = 10
            KEY_ENT = 10
             Key value for the Enter key.
             
            - + - + - +

            Additional Inherited Members

            - Static Public Member Functions inherited from View
            -static void setWinContext (WINDOW *win)
            static void setWinContext (WINDOW *win)
             
            -static WINDOW * getWinContext (void)
            static WINDOW * getWinContext (void)
             
            -static std::vector< std::string > str_split (const std::string &str, const std::string delim)
            static std::vector< std::string > str_split (const std::string &str, const std::string delim)
             

            Detailed Description

            View for user selection input.

            Definition at line 10 of file view_selection.h.

            -

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

              Member Function Documentation

              + +

              ◆ draw()

              + +
              +
              + + + + + +
              + + + + + + + + +
              void ViewSelection::draw (void )
              +
              +overridevirtual
              +
              +

              Abstract function for drawing ths particular view. Gets overridden in the derived classes to paints for example a promt.

              + +

              Implements View.

              + +

              Definition at line 3 of file view_selection.cpp.

              + +
              +
              + +

              ◆ keypress()

              + +
              +
              + + + + + +
              + + + + + + + + +
              call_t ViewSelection::keypress (int & key)
              +
              +overridevirtual
              +
              +

              Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

              + +

              Implements View.

              + +

              Definition at line 22 of file view_selection.cpp.

              + +
              +
              +
              The documentation for this class was generated from the following files: diff --git a/docs/html/classes.html b/docs/html/classes.html index b7d5ff2..89a68e4 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -105,7 +105,7 @@ $(function() { diff --git a/docs/html/cli_8cpp_source.html b/docs/html/cli_8cpp_source.html index 63d294b..b43e790 100644 --- a/docs/html/cli_8cpp_source.html +++ b/docs/html/cli_8cpp_source.html @@ -66,13 +66,16 @@ $(function() {
              cli.cpp
              -
              1 //#define B15F_CLI_DEBUG
              2 
              3 #include <stdio.h>
              4 #include <ncurses.h> // sudo apt-get install libncurses5-dev
              5 #include <vector>
              6 #include <string>
              7 #include <iostream>
              8 #include <signal.h>
              9 #include <sys/ioctl.h>
              10 #include <unistd.h>
              11 #include <signal.h>
              12 #include <future>
              13 #include <thread>
              14 #include <chrono>
              15 #include "drv/b15f.h"
              16 #include "ui/ui.h"
              17 #include "ui/view_selection.h"
              18 #include "ui/view_info.h"
              19 #include "ui/view_monitor.h"
              20 #include "ui/view_promt.h"
              21 
              22 constexpr uint8_t WIN_WIDTH = 80;
              23 constexpr uint8_t WIN_HEIGHT = 24;
              24 
              25 volatile int win_changed_cooldown = 0;
              26 volatile bool t_refresh_active = false;
              27 
              28 void signal_handler(int signal)
              29 {
              30  if(signal == SIGWINCH)
              31  {
              32  win_changed_cooldown = 10; // 100ms
              33 
              34  if (!t_refresh_active)
              35  {
              36  if(t_refresh.joinable())
              37  t_refresh.join();
              38  t_refresh_active = true;
              39  t_refresh = std::thread([]()
              40  {
              41 
              42  while(win_changed_cooldown--)
              43  std::this_thread::sleep_for(std::chrono::milliseconds(10));
              44 
              45  t_refresh_active = false;
              46 
              47  if(win_stack.size())
              48  win_stack.back()->repaint();
              49 
              50  });
              51  }
              52 
              53  }
              54  else if(signal == SIGINT)
              55  {
              56  cleanup();
              57  std::cout << "SIGINT - Abbruch." << std::endl;
              58  exit(EXIT_FAILURE);
              59  }
              60 }
              61 
              62 void abort_handler(std::exception& ex)
              63 {
              64  ViewInfo* view = new ViewInfo();
              65  view->setTitle("Fehler");
              66  std::string msg(ex.what());
              67  msg += "\n\nBeende in 5 Sekunden.";
              68  view->setText(msg.c_str());
              69  view->setLabelClose("");
              70  view->repaint();
              71 
              72  std::this_thread::sleep_for(std::chrono::milliseconds(5000));
              73 
              74  cleanup();
              75  std::cerr << std::endl << "*** EXCEPTION ***" << std::endl << ex.what() << std::endl;
              76  exit(EXIT_FAILURE);
              77 }
              78 
              79 void init()
              80 {
              81  // init b15 driver
              83 #ifndef B15F_CLI_DEBUG
              84  std::cout << std::endl << "Starte in 3s ..." << std::endl;
              85  sleep(3);
              86 #endif
              87 
              88  // init all ncurses stuff
              89  initscr();
              90  start_color();
              91  curs_set(0); // 0: invisible, 1: normal, 2: very visible
              92  clear();
              93  noecho();
              94  cbreak(); // Line buffering disabled. pass on everything
              95  mousemask(ALL_MOUSE_EVENTS, NULL);
              96 
              97  // connect signals to handler
              98  signal(SIGWINCH, signal_handler);
              99  signal(SIGINT, signal_handler);
              100 
              101  // set view context
              102  View::setWinContext(newwin(WIN_HEIGHT, WIN_WIDTH, 0, 0));
              103 
              104  // set graphical error handler
              105  B15F::setAbortHandler(&abort_handler);
              106 }
              107 
              108 
              109 int main()
              110 {
              111  init();
              112 
              113  int exit_code = EXIT_SUCCESS;
              114 
              115  show_main(0);
              116 
              117  cleanup();
              118 
              119  return exit_code;
              120 }
              +
              1 //#define B15F_CLI_DEBUG
              2 
              3 #include <stdio.h>
              4 #include <ncurses.h> // sudo apt-get install libncurses5-dev
              5 #include <vector>
              6 #include <string>
              7 #include <iostream>
              8 #include <signal.h>
              9 #include <sys/ioctl.h>
              10 #include <unistd.h>
              11 #include <signal.h>
              12 #include <future>
              13 #include <thread>
              14 #include <chrono>
              15 #include "drv/b15f.h"
              16 #include "ui/ui.h"
              17 #include "ui/view_selection.h"
              18 #include "ui/view_info.h"
              19 #include "ui/view_monitor.h"
              20 #include "ui/view_promt.h"
              21 
              22 constexpr uint8_t WIN_WIDTH = 80;
              23 constexpr uint8_t WIN_HEIGHT = 24;
              24 
              25 volatile int win_changed_cooldown = 0;
              26 volatile bool t_refresh_active = false;
              27 
              28 void signal_handler(int signal)
              29 {
              30  if(signal == SIGWINCH)
              31  {
              32  win_changed_cooldown = 10; // 100ms
              33 
              34  if (!t_refresh_active)
              35  {
              36  if(t_refresh.joinable())
              37  t_refresh.join();
              38  t_refresh_active = true;
              39  t_refresh = std::thread([]()
              40  {
              41 
              42  while(win_changed_cooldown--)
              43  std::this_thread::sleep_for(std::chrono::milliseconds(10));
              44 
              45  t_refresh_active = false;
              46 
              47  if(win_stack.size())
              48  win_stack.back()->repaint();
              49 
              50  });
              51  }
              52 
              53  }
              54  else if(signal == SIGINT)
              55  {
              56  cleanup();
              57  std::cout << "SIGINT - Abbruch." << std::endl;
              58  exit(EXIT_FAILURE);
              59  }
              60 }
              61 
              62 void abort_handler(std::exception& ex)
              63 {
              64  ViewInfo* view = new ViewInfo();
              65  view->setTitle("Fehler");
              66  std::string msg(ex.what());
              67  msg += "\n\nBeende in 5 Sekunden.";
              68  view->setText(msg.c_str());
              69  view->setLabelClose("");
              70  view->repaint();
              71 
              72  std::this_thread::sleep_for(std::chrono::milliseconds(5000));
              73 
              74  cleanup();
              75  std::cerr << std::endl << "*** EXCEPTION ***" << std::endl << ex.what() << std::endl;
              76  exit(EXIT_FAILURE);
              77 }
              78 
              79 void init()
              80 {
              81  // init b15 driver
              83 #ifndef B15F_CLI_DEBUG
              84  std::cout << std::endl << "Starte in 3s ..." << std::endl;
              85  sleep(3);
              86 #endif
              87 
              88  // init all ncurses stuff
              89  initscr();
              90  start_color();
              91  curs_set(0); // 0: invisible, 1: normal, 2: very visible
              92  clear();
              93  noecho();
              94  cbreak(); // Line buffering disabled. pass on everything
              95  mousemask(ALL_MOUSE_EVENTS, NULL);
              96 
              97  // connect signals to handler
              98  signal(SIGWINCH, signal_handler);
              99  signal(SIGINT, signal_handler);
              100 
              101  // set view context
              102  View::setWinContext(newwin(WIN_HEIGHT, WIN_WIDTH, 0, 0));
              103 
              104  // set graphical error handler
              105  B15F::setAbortHandler(&abort_handler);
              106 }
              107 
              108 
              109 int main()
              110 {
              111  init();
              112 
              113  int exit_code = EXIT_SUCCESS;
              114 
              115  show_main(0);
              116 
              117  cleanup();
              118 
              119  return exit_code;
              120 }
              static B15F & getInstance(void)
              Definition: b15f.cpp:10
              +
              static void setWinContext(WINDOW *win)
              Definition: view.cpp:19
              +
              virtual void repaint(void)
              Definition: view.cpp:52
              static void setAbortHandler(errorhandler_t func)
              Definition: b15f.cpp:192
              +
              virtual void setTitle(std::string title)
              Definition: view.cpp:47
              diff --git a/docs/html/commit__hash_8h_source.html b/docs/html/commit__hash_8h_source.html index 8bfcaa2..6118243 100644 --- a/docs/html/commit__hash_8h_source.html +++ b/docs/html/commit__hash_8h_source.html @@ -70,10 +70,10 @@ $(function() {
              commit_hash.h
              -
              1 #ifndef COMMIT_HASH_H
              2 #define COMMIT_HASH_H
              3 const char COMMIT_HASH[] = "28277098cbdeb228c0fcb0c04394643f6fd15a20";
              4 #endif // COMMIT_HASH_H
              +
              1 #ifndef COMMIT_HASH_H
              2 #define COMMIT_HASH_H
              3 const char COMMIT_HASH[] = "9640bb00c8b16073af9eadf9e40ede3c2e0e4020";
              4 #endif // COMMIT_HASH_H
              diff --git a/docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html b/docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html index a68d6a4..70464fe 100644 --- a/docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html +++ b/docs/html/dir_1788f8309b1a812dcb800a185471cf6c.html @@ -73,7 +73,7 @@ $(function() { diff --git a/docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html b/docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html index 8890416..f449bd3 100644 --- a/docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html +++ b/docs/html/dir_587c94d866dbb2f408f78cf41f9b2f8d.html @@ -73,7 +73,7 @@ $(function() { diff --git a/docs/html/dot_8cpp_source.html b/docs/html/dot_8cpp_source.html index 8282285..4929c71 100644 --- a/docs/html/dot_8cpp_source.html +++ b/docs/html/dot_8cpp_source.html @@ -77,7 +77,7 @@ $(function() {
              Dot(uint16_t x, uint16_t y, uint8_t curve)
              Definition: dot.cpp:3
              diff --git a/docs/html/dot_8h_source.html b/docs/html/dot_8h_source.html index 2603c4c..612fc73 100644 --- a/docs/html/dot_8h_source.html +++ b/docs/html/dot_8h_source.html @@ -78,7 +78,7 @@ $(function() {
              Dot(uint16_t x, uint16_t y, uint8_t curve)
              Definition: dot.cpp:3
              diff --git a/docs/html/driverexception_8h_source.html b/docs/html/driverexception_8h_source.html index e56b7aa..8f04e0d 100644 --- a/docs/html/driverexception_8h_source.html +++ b/docs/html/driverexception_8h_source.html @@ -70,11 +70,16 @@ $(function() {
              driverexception.h
              -
              1 #ifndef DRIVEREXCEPTION_H
              2 #define DRIVEREXCEPTION_H
              3 
              4 #include <exception>
              5 
              6 // SOURCE: https://stackoverflow.com/a/8152888
              7 
              10 class DriverException: public std::exception
              11 {
              12 public:
              13  explicit DriverException(const char* message) : msg_(message)
              14  {
              15  }
              16 
              17  explicit DriverException(const std::string& message) : msg_(message)
              18  {
              19  }
              20 
              21  virtual ~DriverException() throw ()
              22  {
              23  }
              24 
              25  virtual const char* what() const throw ()
              26  {
              27  return msg_.c_str();
              28  }
              29 
              30 protected:
              31  std::string msg_;
              32 };
              33 
              34 #endif // DRIVEREXCEPTION_H
              35 
              +
              1 #ifndef DRIVEREXCEPTION_H
              2 #define DRIVEREXCEPTION_H
              3 
              4 #include <exception>
              5 
              6 // SOURCE: https://stackoverflow.com/a/8152888
              7 
              10 class DriverException: public std::exception
              11 {
              12 public:
              17  explicit DriverException(const char* message) : msg_(message)
              18  {
              19  }
              20 
              25  explicit DriverException(const std::string& message) : msg_(message)
              26  {
              27  }
              28 
              32  virtual ~DriverException() throw ()
              33  {
              34  }
              35 
              40  virtual const char* what() const throw ()
              41  {
              42  return msg_.c_str();
              43  }
              44 
              45 protected:
              46  std::string msg_;
              47 };
              48 
              49 #endif // DRIVEREXCEPTION_H
              50 
              +
              virtual const char * what() const
              +
              DriverException(const char *message)
              +
              std::string msg_
              failure description
              +
              DriverException(const std::string &message)
              +
              virtual ~DriverException()
              diff --git a/docs/html/files.html b/docs/html/files.html index 8ece1a2..2a8451c 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -101,7 +101,7 @@ $(function() { diff --git a/docs/html/functions.html b/docs/html/functions.html index 24de8cf..0ebde8f 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -97,6 +97,9 @@ $(function() {

              - c -

              +

              - h -

                +
              • height +: View +
              • +
              + + +

              - k -

              + +

              - m -

              @@ -361,7 +418,10 @@ $(function() { : B15F
            • TimeoutException() -: TimeoutException +: TimeoutException +
            • +
            • title +: View
            • transmit() : USART @@ -374,7 +434,14 @@ $(function() { : USART
            • USARTException() -: USARTException +: USARTException +
            • +
            + + +

            - v -

            @@ -384,9 +451,16 @@ $(function() { : B15F
          • what() -: TimeoutException +: DriverException +, TimeoutException , USARTException
          • +
          • width +: View +
          • +
          • win +: View +
          • writeToFile() : PlottyFile
          • @@ -394,6 +468,9 @@ $(function() {

            - ~ -

            diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index f4ed71a..e0e5f89 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -127,6 +127,15 @@ $(function() {
          • Dot() : Dot
          • +
          • draw() +: View +, ViewInfo +, ViewPromt +, ViewSelection +
          • +
          • DriverException() +: DriverException +
          • drop() : USART
          • @@ -211,6 +220,9 @@ $(function() {
          • getUnitY() : PlottyFile
          • +
          • getWinContext() +: View +
          • getX() : Dot
          • @@ -220,6 +232,17 @@ $(function() {
          +

          - k -

          + +

          - o -

          • openDevice() : USART @@ -247,6 +270,9 @@ $(function() {
          • reconnect() : B15F
          • +
          • repaint() +: View +
          • reverse() : B15F
          • @@ -308,6 +334,9 @@ $(function() {
          • setTimeout() : USART
          • +
          • setTitle() +: View +
          • setUnitPara() : PlottyFile
          • @@ -317,9 +346,15 @@ $(function() {
          • setUnitY() : PlottyFile
          • +
          • setWinContext() +: View +
          • startPlotty() : PlottyFile
          • +
          • str_split() +: View +
          @@ -349,9 +384,17 @@ $(function() {
        +

        - v -

          +
        • View() +: View +
        • +
        + +

        - w -

        diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html index d6494d6..e6c48e9 100644 --- a/docs/html/hierarchy.html +++ b/docs/html/hierarchy.html @@ -86,7 +86,7 @@ $(function() { diff --git a/docs/html/index.html b/docs/html/index.html index 723813f..e88cb50 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -175,7 +175,7 @@ Dabei gehören Punkte mit dem gleichen Index für curve (uint8_ diff --git a/docs/html/menudata.js b/docs/html/menudata.js index e79079b..e2fe8f5 100644 --- a/docs/html/menudata.js +++ b/docs/html/menudata.js @@ -35,6 +35,8 @@ var menudata={children:[ {text:"e",url:"functions.html#index_e"}, {text:"f",url:"functions.html#index_f"}, {text:"g",url:"functions.html#index_g"}, +{text:"h",url:"functions.html#index_h"}, +{text:"k",url:"functions.html#index_k"}, {text:"m",url:"functions.html#index_m"}, {text:"o",url:"functions.html#index_o"}, {text:"p",url:"functions.html#index_p"}, @@ -42,6 +44,7 @@ var menudata={children:[ {text:"s",url:"functions.html#index_s"}, {text:"t",url:"functions.html#index_t"}, {text:"u",url:"functions.html#index_u"}, +{text:"v",url:"functions.html#index_v"}, {text:"w",url:"functions.html#index_w"}, {text:"~",url:"functions.html#index__7E"}]}, {text:"Functions",url:"functions_func.html",children:[ @@ -51,12 +54,14 @@ var menudata={children:[ {text:"e",url:"functions_func.html#index_e"}, {text:"f",url:"functions_func.html#index_f"}, {text:"g",url:"functions_func.html#index_g"}, +{text:"k",url:"functions_func.html#index_k"}, {text:"o",url:"functions_func.html#index_o"}, {text:"p",url:"functions_func.html#index_p"}, {text:"r",url:"functions_func.html#index_r"}, {text:"s",url:"functions_func.html#index_s"}, {text:"t",url:"functions_func.html#index_t"}, {text:"u",url:"functions_func.html#index_u"}, +{text:"v",url:"functions_func.html#index_v"}, {text:"w",url:"functions_func.html#index_w"}, {text:"~",url:"functions_func.html#index__7E"}]}, {text:"Variables",url:"functions_vars.html"}]}]}, diff --git a/docs/html/plottyfile_8cpp_source.html b/docs/html/plottyfile_8cpp_source.html index f0278ef..28382f0 100644 --- a/docs/html/plottyfile_8cpp_source.html +++ b/docs/html/plottyfile_8cpp_source.html @@ -101,7 +101,7 @@ $(function() {
        std::string getUnitX(void) const
        Definition: plottyfile.cpp:105
        diff --git a/docs/html/plottyfile_8h_source.html b/docs/html/plottyfile_8h_source.html index a55b104..f7ab107 100644 --- a/docs/html/plottyfile_8h_source.html +++ b/docs/html/plottyfile_8h_source.html @@ -70,7 +70,7 @@ $(function() {
        plottyfile.h
        -
        1 #ifndef PLOTTYFILE_H
        2 #define PLOTTYFILE_H
        3 
        4 #include <iostream>
        5 #include <fstream>
        6 #include <exception>
        7 #include <vector>
        8 #include <stdexcept>
        9 #include "dot.h"
        10 
        11 enum FunctionType
        12 {
        13  CurveFamily = 'S',
        14  Curve = 'C',
        15  Level = 'P'
        16 };
        17 
        21 {
        22 public:
        27  void addDot(Dot& dot);
        28 
        33  void addDot(Dot dot);
        34 
        39  void setFunctionType(FunctionType function_type);
        40 
        45  void setQuadrant(uint8_t quadrant);
        46 
        51  void setRefX(uint16_t ref_x);
        52 
        57  void setRefY(uint16_t ref_y);
        58 
        64  void setParaFirstCurve(uint16_t para_first);
        65 
        70  void setParaStepWidth(uint16_t para_stepwidth);
        71 
        76  void setUnitX(std::string unit_x);
        77 
        82  void setDescX(std::string desc_x);
        83 
        88  void setUnitY(std::string unit_y);
        89 
        94  void setDescY(std::string desc_y);
        95 
        100  void setUnitPara(std::string unit_para);
        105  void setDescPara(std::string desc_para);
        106 
        107 
        108 
        112  FunctionType getFunctionType(void) const;
        113 
        117  uint8_t getQuadrant(void) const;
        118 
        122  uint16_t getRefX(void) const;
        123 
        127  uint16_t getRefY(void) const;
        128 
        132  uint16_t getParaFirstCurve(void) const;
        133 
        137  uint16_t getParaStepWidth(void) const;
        138 
        142  std::string getUnitX(void) const;
        143 
        147  std::string getDescX(void) const;
        148 
        152  std::string getUnitY(void) const;
        153 
        157  std::string getDescY(void) const;
        158 
        162  std::string getUnitPara(void) const;
        163 
        167  std::string getDescPara(void) const;
        168 
        169 
        174  void writeToFile(std::string filename);
        175 
        180  void startPlotty(std::string filename);
        181 private:
        182  void prepStr(std::string& str, uint8_t len);
        183 
        184  std::vector<Dot> dots;
        185 
        186  int8_t command = 0x1D;
        187  const std::string head = "HTWK-HWLab";
        188  const std::string filetype = "MD";
        189  int16_t version = 1;
        190  int16_t subversion = 0;
        191  FunctionType function_type = FunctionType::Curve;
        192  uint8_t quadrant = 1;
        193  uint16_t ref_x = 1023;
        194  uint16_t ref_y = 1023;
        195  uint16_t para_first = 1;
        196  uint16_t para_stepwidth = 1;
        197  std::string unit_x;
        198  std::string desc_x;
        199  std::string unit_y;
        200  std::string desc_y;
        201  std::string unit_para;
        202  std::string desc_para;
        203  const uint8_t eof = 0xD;
        204 
        205  constexpr static uint8_t STR_LEN_SHORT = 10;
        206  constexpr static uint8_t STR_LEN_LARGE = 20;
        207 };
        208 
        209 #endif // PLOTTYFILE_H
        +
        1 #ifndef PLOTTYFILE_H
        2 #define PLOTTYFILE_H
        3 
        4 #include <iostream>
        5 #include <fstream>
        6 #include <exception>
        7 #include <vector>
        8 #include <stdexcept>
        9 #include "dot.h"
        10 
        11 enum FunctionType
        12 {
        13  CurveFamily = 'S',
        14  Curve = 'C',
        15  Level = 'P'
        16 };
        17 
        21 {
        22 public:
        27  void addDot(Dot& dot);
        28 
        33  void addDot(Dot dot);
        34 
        39  void setFunctionType(FunctionType function_type);
        40 
        45  void setQuadrant(uint8_t quadrant);
        46 
        51  void setRefX(uint16_t ref_x);
        52 
        57  void setRefY(uint16_t ref_y);
        58 
        64  void setParaFirstCurve(uint16_t para_first);
        65 
        70  void setParaStepWidth(uint16_t para_stepwidth);
        71 
        76  void setUnitX(std::string unit_x);
        77 
        82  void setDescX(std::string desc_x);
        83 
        88  void setUnitY(std::string unit_y);
        89 
        94  void setDescY(std::string desc_y);
        95 
        100  void setUnitPara(std::string unit_para);
        101 
        106  void setDescPara(std::string desc_para);
        107 
        108 
        109 
        113  FunctionType getFunctionType(void) const;
        114 
        118  uint8_t getQuadrant(void) const;
        119 
        123  uint16_t getRefX(void) const;
        124 
        128  uint16_t getRefY(void) const;
        129 
        133  uint16_t getParaFirstCurve(void) const;
        134 
        138  uint16_t getParaStepWidth(void) const;
        139 
        143  std::string getUnitX(void) const;
        144 
        148  std::string getDescX(void) const;
        149 
        153  std::string getUnitY(void) const;
        154 
        158  std::string getDescY(void) const;
        159 
        163  std::string getUnitPara(void) const;
        164 
        168  std::string getDescPara(void) const;
        169 
        170 
        175  void writeToFile(std::string filename);
        176 
        181  void startPlotty(std::string filename);
        182 private:
        183  void prepStr(std::string& str, uint8_t len);
        184 
        185  std::vector<Dot> dots;
        186 
        187  int8_t command = 0x1D;
        188  const std::string head = "HTWK-HWLab";
        189  const std::string filetype = "MD";
        190  int16_t version = 1;
        191  int16_t subversion = 0;
        192  FunctionType function_type = FunctionType::Curve;
        193  uint8_t quadrant = 1;
        194  uint16_t ref_x = 1023;
        195  uint16_t ref_y = 1023;
        196  uint16_t para_first = 1;
        197  uint16_t para_stepwidth = 1;
        198  std::string unit_x;
        199  std::string desc_x;
        200  std::string unit_y;
        201  std::string desc_y;
        202  std::string unit_para;
        203  std::string desc_para;
        204  const uint8_t eof = 0xD;
        205 
        206  constexpr static uint8_t STR_LEN_SHORT = 10;
        207  constexpr static uint8_t STR_LEN_LARGE = 20;
        208 };
        209 
        210 #endif // PLOTTYFILE_H
        void setParaStepWidth(uint16_t para_stepwidth)
        Definition: plottyfile.cpp:40
        uint8_t getQuadrant(void) const
        Definition: plottyfile.cpp:80
        void startPlotty(std::string filename)
        Definition: plottyfile.cpp:196
        @@ -102,7 +102,7 @@ $(function() {
        std::string getUnitX(void) const
        Definition: plottyfile.cpp:105
        diff --git a/docs/html/requests_8h_source.html b/docs/html/requests_8h_source.html index c010e26..fc05140 100644 --- a/docs/html/requests_8h_source.html +++ b/docs/html/requests_8h_source.html @@ -73,7 +73,7 @@ $(function() {
        1 #ifndef REQUESTS_H
        2 #define REQUESTS_H
        3 
        4 constexpr static uint8_t RQ_DISCARD = 0;
        5 constexpr static uint8_t RQ_TEST = 1;
        6 constexpr static uint8_t RQ_INFO = 2;
        7 constexpr static uint8_t RQ_INT_TEST = 3;
        8 constexpr static uint8_t RQ_SELF_TEST = 4;
        9 constexpr static uint8_t RQ_DIGITAL_WRITE_0 = 5;
        10 constexpr static uint8_t RQ_DIGITAL_WRITE_1 = 6;
        11 constexpr static uint8_t RQ_DIGITAL_READ_0 = 7;
        12 constexpr static uint8_t RQ_DIGITAL_READ_1 = 8;
        13 constexpr static uint8_t RQ_READ_DIP_SWITCH = 9;
        14 constexpr static uint8_t RQ_ANALOG_WRITE_0 = 10;
        15 constexpr static uint8_t RQ_ANALOG_WRITE_1 = 11;
        16 constexpr static uint8_t RQ_ANALOG_READ = 12;
        17 constexpr static uint8_t RQ_ADC_DAC_STROKE = 13;
        18 constexpr static uint8_t RQ_PWM_SET_FREQ = 14;
        19 constexpr static uint8_t RQ_PWM_SET_VALUE = 15;
        20 constexpr static uint8_t RQ_SET_MEM_8 = 16;
        21 constexpr static uint8_t RQ_GET_MEM_8 = 17;
        22 constexpr static uint8_t RQ_SET_MEM_16 = 18;
        23 constexpr static uint8_t RQ_GET_MEM_16 = 19;
        24 constexpr static uint8_t RQ_COUNTER_OFFSET = 20;
        25 constexpr static uint8_t RQ_SERVO_ENABLE = 21;
        26 constexpr static uint8_t RQ_SERVO_DISABLE = 22;
        27 constexpr static uint8_t RQ_SERVO_SET_POS = 23;
        28 
        29 uint8_t const rq_len[] =
        30 {
        31  1 /* RQ_DISCARD */,
        32  1 /* RQ_TEST */ + 1 /* test byte */,
        33  1 /* RQ_INFO */,
        34  1 /* RQ_INT_TEST */ + 1 /* test int high low */ + 1 /* test int high high */,
        35  1 /* RQ_SELF_TEST */,
        36  1 /* RQ_DIGITAL_WRITE_0 */ + 1 /* port value */,
        37  1 /* RQ_DIGITAL_WRITE_1 */ + 1 /* port value */,
        38  1 /* RQ_DIGITAL_READ_0 */,
        39  1 /* RQ_DIGITAL_READ_1 */,
        40  1 /* RQ_READ_DIP_SWITCH */,
        41  1 /* RQ_ANALOG_WRITE_0 */ + 1 /* test int high low */ + 1 /* test int high high */,
        42  1 /* RQ_ANALOG_WRITE_1 */ + 1 /* test int high low */ + 1 /* test int high high */,
        43  1 /* RQ_ANALOG_READ */ + 1 /* adc channel */,
        44  1 /* RQ_ADC_DAC_STROKE */ + 1 /* channel a */ + 1 /* channel b */ + 1 /* start low */ + 1 /* start high */ + 1 /* delta low */ + 1 /* delta high */ + 1 /* count low */ + 1 /* count high */,
        45  1 /* RQ_PWM_SET_FREQ */ + 1 /* freq low low */ + 1 /* freq low high */ + 1 /* freq high low */ + 1 /* freq high high */,
        46  1 /* RQ_PWM_SET_VALUE */ + 1 /* pwm value */,
        47  1 /* RQ_SET_MEM_8 */ + 1 /* memory address low */ + 1 /* memory address high */ + 1 /* memory value (8-bit) */,
        48  1 /* RQ_GET_MEM_8 */ + 1 /* memory address low */ + 1 /* memory address high */,
        49  1 /* RQ_SET_MEM_16 */ + 1 /* memory address low */ + 1 /* memory address high */ + 1 /* memory value low */ + 1 /* memory value high */,
        50  1 /* RQ_GET_MEM_16 */ + 1 /* memory address low */ + 1 /* memory address high */,
        51  1 /* RQ_COUNTER_OFFSET */,
        52  1 /* RQ_SERVO_ENABLE */,
        53  1 /* RQ_SERVO_DISABLE */,
        54  1 /* RQ_SERVO_SET_POS */ + 1 /* pulse length low */ + 1 /* pulse length high */,
        55 };
        56 
        57 #endif // REQUESTS_H
        diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js index f5a3874..ca1b57d 100644 --- a/docs/html/search/all_10.js +++ b/docs/html/search/all_10.js @@ -1,6 +1,8 @@ var searchData= [ - ['_7etimeoutexception',['~TimeoutException',['../classTimeoutException.html#a2f686b262d2ccffa0090fda9b44ab540',1,'TimeoutException']]], - ['_7eusart',['~USART',['../classUSART.html#a0c8eb1a939ca00921e22f6cbcc7bb749',1,'USART']]], - ['_7eusartexception',['~USARTException',['../classUSARTException.html#a0e008b3cb4974859e6bc8c8f8eb480be',1,'USARTException']]] + ['view',['View',['../classView.html',1,'View'],['../classView.html#a0a9be6e5fb588412aab31cacf5e43b04',1,'View::View()']]], + ['viewinfo',['ViewInfo',['../classViewInfo.html',1,'']]], + ['viewmonitor',['ViewMonitor',['../classViewMonitor.html',1,'']]], + ['viewpromt',['ViewPromt',['../classViewPromt.html',1,'']]], + ['viewselection',['ViewSelection',['../classViewSelection.html',1,'']]] ]; diff --git a/docs/html/search/all_11.html b/docs/html/search/all_11.html new file mode 100644 index 0000000..2f927fe --- /dev/null +++ b/docs/html/search/all_11.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/all_11.js b/docs/html/search/all_11.js new file mode 100644 index 0000000..4f5cf1d --- /dev/null +++ b/docs/html/search/all_11.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['wdt_5ftimeout',['WDT_TIMEOUT',['../classB15F.html#a158d13bc84aed6430cdede1396384e06',1,'B15F']]], + ['what',['what',['../classDriverException.html#a781362760bcd75b1bd5448629df58446',1,'DriverException::what()'],['../classTimeoutException.html#a97eaf01fc39ddb94b060020b42fefd6e',1,'TimeoutException::what()'],['../classUSARTException.html#a2af5e3c00cd0585c7427c2e0420a8f15',1,'USARTException::what()']]], + ['width',['width',['../classView.html#ae039aa744b085db819ae149705b2c32b',1,'View']]], + ['win',['win',['../classView.html#a5ddee2bf0b26dbcfa7780be17ff33dd7',1,'View']]], + ['writetofile',['writeToFile',['../classPlottyFile.html#a82c348e7fade2edcbc907e7c2bc2e305',1,'PlottyFile']]] +]; diff --git a/docs/html/search/all_12.html b/docs/html/search/all_12.html new file mode 100644 index 0000000..6b0988c --- /dev/null +++ b/docs/html/search/all_12.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js new file mode 100644 index 0000000..b756d4d --- /dev/null +++ b/docs/html/search/all_12.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['_7edriverexception',['~DriverException',['../classDriverException.html#a4e62b528e9a6c1a776b1a08487fac340',1,'DriverException']]], + ['_7etimeoutexception',['~TimeoutException',['../classTimeoutException.html#a2f686b262d2ccffa0090fda9b44ab540',1,'TimeoutException']]], + ['_7eusart',['~USART',['../classUSART.html#a0c8eb1a939ca00921e22f6cbcc7bb749',1,'USART']]], + ['_7eusartexception',['~USARTException',['../classUSARTException.html#a0e008b3cb4974859e6bc8c8f8eb480be',1,'USARTException']]], + ['_7eview',['~View',['../classView.html#a450dfab3f21a52edc03db4310593412f',1,'View']]] +]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index 7200182..5f43282 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -1,5 +1,6 @@ var searchData= [ + ['calls',['calls',['../classView.html#a610367214a727e2f7da72ac5bdb60fa3',1,'View']]], ['clearinputbuffer',['clearInputBuffer',['../classUSART.html#a28a2b4c5ed66b2c3a81196f76884f156',1,'USART']]], ['clearoutputbuffer',['clearOutputBuffer',['../classUSART.html#a756d268a8762c316f91ca3238972b0c1',1,'USART']]], ['closedevice',['closeDevice',['../classUSART.html#af80d6291ac1d2df04cfa1d8d27458cc5',1,'USART']]] diff --git a/docs/html/search/all_3.js b/docs/html/search/all_3.js index 8e2286b..6007f94 100644 --- a/docs/html/search/all_3.js +++ b/docs/html/search/all_3.js @@ -8,6 +8,7 @@ var searchData= ['digitalwrite1',['digitalWrite1',['../classB15F.html#a8f0d3891ec613a569b0a4309dfe213da',1,'B15F']]], ['discard',['discard',['../classB15F.html#ae4740cd473f40a1a4121dfa66b25e1d5',1,'B15F']]], ['dot',['Dot',['../classDot.html',1,'Dot'],['../classDot.html#ad975f119c0627a928790b3cd5ca6da05',1,'Dot::Dot()']]], - ['driverexception',['DriverException',['../classDriverException.html',1,'']]], + ['draw',['draw',['../classView.html#a092a269bf53569af7fca4d710dd5b980',1,'View::draw()'],['../classViewInfo.html#ab7f9ea145f8cf26dbd27e29982cda206',1,'ViewInfo::draw()'],['../classViewPromt.html#a8f3f805bece2a669f10e29d1d22a9de1',1,'ViewPromt::draw()'],['../classViewSelection.html#a10fa34fb676bfed472ca5ee62ef9446d',1,'ViewSelection::draw()']]], + ['driverexception',['DriverException',['../classDriverException.html',1,'DriverException'],['../classDriverException.html#a6dcc078e6bfb7d87b53a5aef758cfe5f',1,'DriverException::DriverException(const char *message)'],['../classDriverException.html#abf7f902d3fbbfcdbde8e54a058948519',1,'DriverException::DriverException(const std::string &message)']]], ['drop',['drop',['../classUSART.html#a038d00c0b3d8c0c13c3e7eae5dad7813',1,'USART']]] ]; diff --git a/docs/html/search/all_6.js b/docs/html/search/all_6.js index ff9844a..3cc9a24 100644 --- a/docs/html/search/all_6.js +++ b/docs/html/search/all_6.js @@ -21,6 +21,7 @@ var searchData= ['getunitpara',['getUnitPara',['../classPlottyFile.html#abcda4139adf8c5ab8a93b13b84ac097c',1,'PlottyFile']]], ['getunitx',['getUnitX',['../classPlottyFile.html#af952ac5e2c40896acaf6a86063874fe3',1,'PlottyFile']]], ['getunity',['getUnitY',['../classPlottyFile.html#a746b96036872dbece204e9739f3413b6',1,'PlottyFile']]], + ['getwincontext',['getWinContext',['../classView.html#a0710c6ba06e3795e7ddf369361308b79',1,'View']]], ['getx',['getX',['../classDot.html#a029f0cc99c474122b77a708a317e7f77',1,'Dot']]], ['gety',['getY',['../classDot.html#a8fcb987e6308d8184d1a2c8692227e58',1,'Dot']]] ]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js index 66df4a3..e27dc21 100644 --- a/docs/html/search/all_7.js +++ b/docs/html/search/all_7.js @@ -1,6 +1,4 @@ var searchData= [ - ['msg',['msg',['../classTimeoutException.html#aa625fc0fae48a67737a98eafb91c9624',1,'TimeoutException::msg()'],['../classUSARTException.html#a14c80df95f216d221aa97cffbcd8dd79',1,'USARTException::msg()']]], - ['msg_5ffail',['MSG_FAIL',['../classB15F.html#a77d1ecf24b406c9204665d3b09c36f1e',1,'B15F']]], - ['msg_5fok',['MSG_OK',['../classB15F.html#ab01299858f74a6cec598688562e0ad02',1,'B15F']]] + ['height',['height',['../classView.html#a6e3e5c18893617490f02166641356746',1,'View']]] ]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js index bd75d34..773842a 100644 --- a/docs/html/search/all_8.js +++ b/docs/html/search/all_8.js @@ -1,4 +1,5 @@ var searchData= [ - ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] + ['key_5fent',['KEY_ENT',['../classView.html#a3554cf8689cad24c643665aa3d182134',1,'View']]], + ['keypress',['keypress',['../classView.html#a60f77156dc4786bb6227d58a3061d2f6',1,'View::keypress()'],['../classViewInfo.html#a7d231a44600aa100ad4a0b9f283e5bd8',1,'ViewInfo::keypress()'],['../classViewMonitor.html#a2224002fe45655df87130fe07a161693',1,'ViewMonitor::keypress()'],['../classViewPromt.html#a24aa1e8887fc5e6631d6cb88adb7f3db',1,'ViewPromt::keypress()'],['../classViewSelection.html#a04341cde5e8355edc5ff3d653d1dbc76',1,'ViewSelection::keypress()']]] ]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js index 26e6d28..9a8efba 100644 --- a/docs/html/search/all_9.js +++ b/docs/html/search/all_9.js @@ -1,7 +1,7 @@ var searchData= [ - ['plottyfile',['PlottyFile',['../classPlottyFile.html',1,'']]], - ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',1,'B15F']]], - ['pwmsetfrequency',['pwmSetFrequency',['../classB15F.html#ac6f6532bb9550a0632c28b98c157d0a1',1,'B15F']]], - ['pwmsetvalue',['pwmSetValue',['../classB15F.html#aae99d74a945039c365ebd2f995b5546e',1,'B15F']]] + ['msg',['msg',['../classUSARTException.html#a14c80df95f216d221aa97cffbcd8dd79',1,'USARTException']]], + ['msg_5f',['msg_',['../classDriverException.html#ab8777afe3f5aed2e66f2b2fcb480a651',1,'DriverException::msg_()'],['../classTimeoutException.html#ae6395f887040521c915b0b8d88dc29e7',1,'TimeoutException::msg_()']]], + ['msg_5ffail',['MSG_FAIL',['../classB15F.html#a77d1ecf24b406c9204665d3b09c36f1e',1,'B15F']]], + ['msg_5fok',['MSG_OK',['../classB15F.html#ab01299858f74a6cec598688562e0ad02',1,'B15F']]] ]; diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js index ffd120f..bd75d34 100644 --- a/docs/html/search/all_a.js +++ b/docs/html/search/all_a.js @@ -1,9 +1,4 @@ var searchData= [ - ['readdipswitch',['readDipSwitch',['../classB15F.html#a6f858f21ea81d491b5031b3644a2239a',1,'B15F']]], - ['receive',['receive',['../classUSART.html#a0fdc238203852f00bd750127602b2a6a',1,'USART']]], - ['reconnect',['reconnect',['../classB15F.html#a52557b375443c180a044e7d4e80a1ae7',1,'B15F']]], - ['reconnect_5ftimeout',['RECONNECT_TIMEOUT',['../classB15F.html#a040951746fbfd632e12bd1ad14578816',1,'B15F']]], - ['reconnect_5ftries',['RECONNECT_TRIES',['../classB15F.html#a6c4895bdbcd71ff6743becf97985c2dc',1,'B15F']]], - ['reverse',['reverse',['../classB15F.html#a2937f22f1cfc9b533f4b5bf4db726a68',1,'B15F']]] + ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] ]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index fc8198d..26e6d28 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -1,25 +1,7 @@ var searchData= [ - ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], - ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], - ['setdescpara',['setDescPara',['../classPlottyFile.html#a431904143c3c1164a2e8b8cfec3c77ab',1,'PlottyFile']]], - ['setdescx',['setDescX',['../classPlottyFile.html#aa0449c290265d55d6223b19cf0a88b0a',1,'PlottyFile']]], - ['setdescy',['setDescY',['../classPlottyFile.html#a38a3a4dfc76bc70523727584bf01d590',1,'PlottyFile']]], - ['setfunctiontype',['setFunctionType',['../classPlottyFile.html#a4e5ab1ebb012a5cc1a3d6458a4cd512f',1,'PlottyFile']]], - ['setmem16',['setMem16',['../classB15F.html#a62ef2ee9bd945d30979939fcffa6759a',1,'B15F']]], - ['setmem8',['setMem8',['../classB15F.html#a65c0eee6b40b6d3ec58b0335fd668503',1,'B15F']]], - ['setparafirstcurve',['setParaFirstCurve',['../classPlottyFile.html#aa676414793becb975506f48d6e949dd0',1,'PlottyFile']]], - ['setparastepwidth',['setParaStepWidth',['../classPlottyFile.html#a6caebd31e04e2e7081cc007047350355',1,'PlottyFile']]], - ['setquadrant',['setQuadrant',['../classPlottyFile.html#a1953ee0d9a87b7353c16139584e9c2ae',1,'PlottyFile']]], - ['setrefx',['setRefX',['../classPlottyFile.html#a80c2c2e97a454566f9c1f2c51e1d7f3e',1,'PlottyFile']]], - ['setrefy',['setRefY',['../classPlottyFile.html#a3a371228ddcc007e97eebe7cc04dffc2',1,'PlottyFile']]], - ['setregister',['setRegister',['../classB15F.html#a47d7b797129d1ee7ebee4d8ae4f0ff93',1,'B15F']]], - ['setservodisabled',['setServoDisabled',['../classB15F.html#aad1b3206761c06c7183ae1b8b95b350b',1,'B15F']]], - ['setservoenabled',['setServoEnabled',['../classB15F.html#ab23d8c5a0b520b9d12d94a04f90fcfa0',1,'B15F']]], - ['setservoposition',['setServoPosition',['../classB15F.html#aa76f289274e5d0be41c5d4a58b52a416',1,'B15F']]], - ['settimeout',['setTimeout',['../classUSART.html#ad7fe866cebe920784d2b17602824c7ff',1,'USART']]], - ['setunitpara',['setUnitPara',['../classPlottyFile.html#abbac84109a1e0958a4ca5c270fac0986',1,'PlottyFile']]], - ['setunitx',['setUnitX',['../classPlottyFile.html#ab8d35a841ca9c325fca671cf34e03527',1,'PlottyFile']]], - ['setunity',['setUnitY',['../classPlottyFile.html#abb18c814f435926f741f7ceb310f3059',1,'PlottyFile']]], - ['startplotty',['startPlotty',['../classPlottyFile.html#a08a115ef10458cadfe76077d623313df',1,'PlottyFile']]] + ['plottyfile',['PlottyFile',['../classPlottyFile.html',1,'']]], + ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',1,'B15F']]], + ['pwmsetfrequency',['pwmSetFrequency',['../classB15F.html#ac6f6532bb9550a0632c28b98c157d0a1',1,'B15F']]], + ['pwmsetvalue',['pwmSetValue',['../classB15F.html#aae99d74a945039c365ebd2f995b5546e',1,'B15F']]] ]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js index ad39cf2..2c0fc33 100644 --- a/docs/html/search/all_c.js +++ b/docs/html/search/all_c.js @@ -1,7 +1,10 @@ var searchData= [ - ['testconnection',['testConnection',['../classB15F.html#a6b8c7da1fb9b619543844e0ce7597d83',1,'B15F']]], - ['testintconv',['testIntConv',['../classB15F.html#ac2c7b6d84da5239ee7cc3d44e689d9db',1,'B15F']]], - ['timeoutexception',['TimeoutException',['../classTimeoutException.html',1,'TimeoutException'],['../classTimeoutException.html#aa45912234da11ffc9dd3594a1bbc0218',1,'TimeoutException::TimeoutException(const char *message)'],['../classTimeoutException.html#ad6e5c200fbfd276f48a6c1163e2d2988',1,'TimeoutException::TimeoutException(const std::string &message)']]], - ['transmit',['transmit',['../classUSART.html#a41b19dd58f307015b73e154048cd74ca',1,'USART']]] + ['readdipswitch',['readDipSwitch',['../classB15F.html#a6f858f21ea81d491b5031b3644a2239a',1,'B15F']]], + ['receive',['receive',['../classUSART.html#a0fdc238203852f00bd750127602b2a6a',1,'USART']]], + ['reconnect',['reconnect',['../classB15F.html#a52557b375443c180a044e7d4e80a1ae7',1,'B15F']]], + ['reconnect_5ftimeout',['RECONNECT_TIMEOUT',['../classB15F.html#a040951746fbfd632e12bd1ad14578816',1,'B15F']]], + ['reconnect_5ftries',['RECONNECT_TRIES',['../classB15F.html#a6c4895bdbcd71ff6743becf97985c2dc',1,'B15F']]], + ['repaint',['repaint',['../classView.html#aa7b1f1179e3c4f06bef1e99355d0d592',1,'View']]], + ['reverse',['reverse',['../classB15F.html#a2937f22f1cfc9b533f4b5bf4db726a68',1,'B15F']]] ]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js index 7e9d9bc..be4f36c 100644 --- a/docs/html/search/all_d.js +++ b/docs/html/search/all_d.js @@ -1,5 +1,30 @@ var searchData= [ - ['usart',['USART',['../classUSART.html',1,'USART'],['../classUSART.html#a5daed20dc595c43d87c4c28bb08a7449',1,'USART::USART()']]], - ['usartexception',['USARTException',['../classUSARTException.html',1,'USARTException'],['../classUSARTException.html#a3c359db129825703b91392d5128cf93d',1,'USARTException::USARTException(const char *message)'],['../classUSARTException.html#a643c0a8b7f0d81e2f1693a75b378e6c2',1,'USARTException::USARTException(const std::string &message)']]] + ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], + ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], + ['setdescpara',['setDescPara',['../classPlottyFile.html#a431904143c3c1164a2e8b8cfec3c77ab',1,'PlottyFile']]], + ['setdescx',['setDescX',['../classPlottyFile.html#aa0449c290265d55d6223b19cf0a88b0a',1,'PlottyFile']]], + ['setdescy',['setDescY',['../classPlottyFile.html#a38a3a4dfc76bc70523727584bf01d590',1,'PlottyFile']]], + ['setfunctiontype',['setFunctionType',['../classPlottyFile.html#a4e5ab1ebb012a5cc1a3d6458a4cd512f',1,'PlottyFile']]], + ['setmem16',['setMem16',['../classB15F.html#a62ef2ee9bd945d30979939fcffa6759a',1,'B15F']]], + ['setmem8',['setMem8',['../classB15F.html#a65c0eee6b40b6d3ec58b0335fd668503',1,'B15F']]], + ['setparafirstcurve',['setParaFirstCurve',['../classPlottyFile.html#aa676414793becb975506f48d6e949dd0',1,'PlottyFile']]], + ['setparastepwidth',['setParaStepWidth',['../classPlottyFile.html#a6caebd31e04e2e7081cc007047350355',1,'PlottyFile']]], + ['setquadrant',['setQuadrant',['../classPlottyFile.html#a1953ee0d9a87b7353c16139584e9c2ae',1,'PlottyFile']]], + ['setrefx',['setRefX',['../classPlottyFile.html#a80c2c2e97a454566f9c1f2c51e1d7f3e',1,'PlottyFile']]], + ['setrefy',['setRefY',['../classPlottyFile.html#a3a371228ddcc007e97eebe7cc04dffc2',1,'PlottyFile']]], + ['setregister',['setRegister',['../classB15F.html#a47d7b797129d1ee7ebee4d8ae4f0ff93',1,'B15F']]], + ['setservodisabled',['setServoDisabled',['../classB15F.html#aad1b3206761c06c7183ae1b8b95b350b',1,'B15F']]], + ['setservoenabled',['setServoEnabled',['../classB15F.html#ab23d8c5a0b520b9d12d94a04f90fcfa0',1,'B15F']]], + ['setservoposition',['setServoPosition',['../classB15F.html#aa76f289274e5d0be41c5d4a58b52a416',1,'B15F']]], + ['settimeout',['setTimeout',['../classUSART.html#ad7fe866cebe920784d2b17602824c7ff',1,'USART']]], + ['settitle',['setTitle',['../classView.html#a6c725e4d83fd7474635a7e64200c7a08',1,'View']]], + ['setunitpara',['setUnitPara',['../classPlottyFile.html#abbac84109a1e0958a4ca5c270fac0986',1,'PlottyFile']]], + ['setunitx',['setUnitX',['../classPlottyFile.html#ab8d35a841ca9c325fca671cf34e03527',1,'PlottyFile']]], + ['setunity',['setUnitY',['../classPlottyFile.html#abb18c814f435926f741f7ceb310f3059',1,'PlottyFile']]], + ['setwincontext',['setWinContext',['../classView.html#a990aa2223befde031dfcce54a740c558',1,'View']]], + ['start_5fx',['start_x',['../classView.html#a9fc9f3b0c876d063e6f57dee320a43fe',1,'View']]], + ['start_5fy',['start_y',['../classView.html#ac424db4c13776c3ce9d33f9074dfcfaa',1,'View']]], + ['startplotty',['startPlotty',['../classPlottyFile.html#a08a115ef10458cadfe76077d623313df',1,'PlottyFile']]], + ['str_5fsplit',['str_split',['../classView.html#a52c2e2a7bc56388e7d9bfa398ad52668',1,'View']]] ]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js index 27f785f..98b4476 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -1,8 +1,8 @@ var searchData= [ - ['view',['View',['../classView.html',1,'']]], - ['viewinfo',['ViewInfo',['../classViewInfo.html',1,'']]], - ['viewmonitor',['ViewMonitor',['../classViewMonitor.html',1,'']]], - ['viewpromt',['ViewPromt',['../classViewPromt.html',1,'']]], - ['viewselection',['ViewSelection',['../classViewSelection.html',1,'']]] + ['testconnection',['testConnection',['../classB15F.html#a6b8c7da1fb9b619543844e0ce7597d83',1,'B15F']]], + ['testintconv',['testIntConv',['../classB15F.html#ac2c7b6d84da5239ee7cc3d44e689d9db',1,'B15F']]], + ['timeoutexception',['TimeoutException',['../classTimeoutException.html',1,'TimeoutException'],['../classTimeoutException.html#aa45912234da11ffc9dd3594a1bbc0218',1,'TimeoutException::TimeoutException(const char *message)'],['../classTimeoutException.html#ad6e5c200fbfd276f48a6c1163e2d2988',1,'TimeoutException::TimeoutException(const std::string &message)']]], + ['title',['title',['../classView.html#a80441aa81b52e04677a2aa2bd9c47753',1,'View']]], + ['transmit',['transmit',['../classUSART.html#a41b19dd58f307015b73e154048cd74ca',1,'USART']]] ]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js index 38b315c..7e9d9bc 100644 --- a/docs/html/search/all_f.js +++ b/docs/html/search/all_f.js @@ -1,6 +1,5 @@ var searchData= [ - ['wdt_5ftimeout',['WDT_TIMEOUT',['../classB15F.html#a158d13bc84aed6430cdede1396384e06',1,'B15F']]], - ['what',['what',['../classTimeoutException.html#a97eaf01fc39ddb94b060020b42fefd6e',1,'TimeoutException::what()'],['../classUSARTException.html#a2af5e3c00cd0585c7427c2e0420a8f15',1,'USARTException::what()']]], - ['writetofile',['writeToFile',['../classPlottyFile.html#a82c348e7fade2edcbc907e7c2bc2e305',1,'PlottyFile']]] + ['usart',['USART',['../classUSART.html',1,'USART'],['../classUSART.html#a5daed20dc595c43d87c4c28bb08a7449',1,'USART::USART()']]], + ['usartexception',['USARTException',['../classUSARTException.html',1,'USARTException'],['../classUSARTException.html#a3c359db129825703b91392d5128cf93d',1,'USARTException::USARTException(const char *message)'],['../classUSARTException.html#a643c0a8b7f0d81e2f1693a75b378e6c2',1,'USARTException::USARTException(const std::string &message)']]] ]; diff --git a/docs/html/search/functions_2.js b/docs/html/search/functions_2.js index 098c341..c4416f8 100644 --- a/docs/html/search/functions_2.js +++ b/docs/html/search/functions_2.js @@ -8,5 +8,7 @@ var searchData= ['digitalwrite1',['digitalWrite1',['../classB15F.html#a8f0d3891ec613a569b0a4309dfe213da',1,'B15F']]], ['discard',['discard',['../classB15F.html#ae4740cd473f40a1a4121dfa66b25e1d5',1,'B15F']]], ['dot',['Dot',['../classDot.html#ad975f119c0627a928790b3cd5ca6da05',1,'Dot']]], + ['draw',['draw',['../classView.html#a092a269bf53569af7fca4d710dd5b980',1,'View::draw()'],['../classViewInfo.html#ab7f9ea145f8cf26dbd27e29982cda206',1,'ViewInfo::draw()'],['../classViewPromt.html#a8f3f805bece2a669f10e29d1d22a9de1',1,'ViewPromt::draw()'],['../classViewSelection.html#a10fa34fb676bfed472ca5ee62ef9446d',1,'ViewSelection::draw()']]], + ['driverexception',['DriverException',['../classDriverException.html#a6dcc078e6bfb7d87b53a5aef758cfe5f',1,'DriverException::DriverException(const char *message)'],['../classDriverException.html#abf7f902d3fbbfcdbde8e54a058948519',1,'DriverException::DriverException(const std::string &message)']]], ['drop',['drop',['../classUSART.html#a038d00c0b3d8c0c13c3e7eae5dad7813',1,'USART']]] ]; diff --git a/docs/html/search/functions_5.js b/docs/html/search/functions_5.js index ff9844a..3cc9a24 100644 --- a/docs/html/search/functions_5.js +++ b/docs/html/search/functions_5.js @@ -21,6 +21,7 @@ var searchData= ['getunitpara',['getUnitPara',['../classPlottyFile.html#abcda4139adf8c5ab8a93b13b84ac097c',1,'PlottyFile']]], ['getunitx',['getUnitX',['../classPlottyFile.html#af952ac5e2c40896acaf6a86063874fe3',1,'PlottyFile']]], ['getunity',['getUnitY',['../classPlottyFile.html#a746b96036872dbece204e9739f3413b6',1,'PlottyFile']]], + ['getwincontext',['getWinContext',['../classView.html#a0710c6ba06e3795e7ddf369361308b79',1,'View']]], ['getx',['getX',['../classDot.html#a029f0cc99c474122b77a708a317e7f77',1,'Dot']]], ['gety',['getY',['../classDot.html#a8fcb987e6308d8184d1a2c8692227e58',1,'Dot']]] ]; diff --git a/docs/html/search/functions_6.js b/docs/html/search/functions_6.js index bd75d34..b2c4a8e 100644 --- a/docs/html/search/functions_6.js +++ b/docs/html/search/functions_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] + ['keypress',['keypress',['../classView.html#a60f77156dc4786bb6227d58a3061d2f6',1,'View::keypress()'],['../classViewInfo.html#a7d231a44600aa100ad4a0b9f283e5bd8',1,'ViewInfo::keypress()'],['../classViewMonitor.html#a2224002fe45655df87130fe07a161693',1,'ViewMonitor::keypress()'],['../classViewPromt.html#a24aa1e8887fc5e6631d6cb88adb7f3db',1,'ViewPromt::keypress()'],['../classViewSelection.html#a04341cde5e8355edc5ff3d653d1dbc76',1,'ViewSelection::keypress()']]] ]; diff --git a/docs/html/search/functions_7.js b/docs/html/search/functions_7.js index 454721f..bd75d34 100644 --- a/docs/html/search/functions_7.js +++ b/docs/html/search/functions_7.js @@ -1,5 +1,4 @@ var searchData= [ - ['pwmsetfrequency',['pwmSetFrequency',['../classB15F.html#ac6f6532bb9550a0632c28b98c157d0a1',1,'B15F']]], - ['pwmsetvalue',['pwmSetValue',['../classB15F.html#aae99d74a945039c365ebd2f995b5546e',1,'B15F']]] + ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] ]; diff --git a/docs/html/search/functions_8.js b/docs/html/search/functions_8.js index e68b82b..454721f 100644 --- a/docs/html/search/functions_8.js +++ b/docs/html/search/functions_8.js @@ -1,7 +1,5 @@ var searchData= [ - ['readdipswitch',['readDipSwitch',['../classB15F.html#a6f858f21ea81d491b5031b3644a2239a',1,'B15F']]], - ['receive',['receive',['../classUSART.html#a0fdc238203852f00bd750127602b2a6a',1,'USART']]], - ['reconnect',['reconnect',['../classB15F.html#a52557b375443c180a044e7d4e80a1ae7',1,'B15F']]], - ['reverse',['reverse',['../classB15F.html#a2937f22f1cfc9b533f4b5bf4db726a68',1,'B15F']]] + ['pwmsetfrequency',['pwmSetFrequency',['../classB15F.html#ac6f6532bb9550a0632c28b98c157d0a1',1,'B15F']]], + ['pwmsetvalue',['pwmSetValue',['../classB15F.html#aae99d74a945039c365ebd2f995b5546e',1,'B15F']]] ]; diff --git a/docs/html/search/functions_9.js b/docs/html/search/functions_9.js index fc8198d..d5b8869 100644 --- a/docs/html/search/functions_9.js +++ b/docs/html/search/functions_9.js @@ -1,25 +1,8 @@ var searchData= [ - ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], - ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], - ['setdescpara',['setDescPara',['../classPlottyFile.html#a431904143c3c1164a2e8b8cfec3c77ab',1,'PlottyFile']]], - ['setdescx',['setDescX',['../classPlottyFile.html#aa0449c290265d55d6223b19cf0a88b0a',1,'PlottyFile']]], - ['setdescy',['setDescY',['../classPlottyFile.html#a38a3a4dfc76bc70523727584bf01d590',1,'PlottyFile']]], - ['setfunctiontype',['setFunctionType',['../classPlottyFile.html#a4e5ab1ebb012a5cc1a3d6458a4cd512f',1,'PlottyFile']]], - ['setmem16',['setMem16',['../classB15F.html#a62ef2ee9bd945d30979939fcffa6759a',1,'B15F']]], - ['setmem8',['setMem8',['../classB15F.html#a65c0eee6b40b6d3ec58b0335fd668503',1,'B15F']]], - ['setparafirstcurve',['setParaFirstCurve',['../classPlottyFile.html#aa676414793becb975506f48d6e949dd0',1,'PlottyFile']]], - ['setparastepwidth',['setParaStepWidth',['../classPlottyFile.html#a6caebd31e04e2e7081cc007047350355',1,'PlottyFile']]], - ['setquadrant',['setQuadrant',['../classPlottyFile.html#a1953ee0d9a87b7353c16139584e9c2ae',1,'PlottyFile']]], - ['setrefx',['setRefX',['../classPlottyFile.html#a80c2c2e97a454566f9c1f2c51e1d7f3e',1,'PlottyFile']]], - ['setrefy',['setRefY',['../classPlottyFile.html#a3a371228ddcc007e97eebe7cc04dffc2',1,'PlottyFile']]], - ['setregister',['setRegister',['../classB15F.html#a47d7b797129d1ee7ebee4d8ae4f0ff93',1,'B15F']]], - ['setservodisabled',['setServoDisabled',['../classB15F.html#aad1b3206761c06c7183ae1b8b95b350b',1,'B15F']]], - ['setservoenabled',['setServoEnabled',['../classB15F.html#ab23d8c5a0b520b9d12d94a04f90fcfa0',1,'B15F']]], - ['setservoposition',['setServoPosition',['../classB15F.html#aa76f289274e5d0be41c5d4a58b52a416',1,'B15F']]], - ['settimeout',['setTimeout',['../classUSART.html#ad7fe866cebe920784d2b17602824c7ff',1,'USART']]], - ['setunitpara',['setUnitPara',['../classPlottyFile.html#abbac84109a1e0958a4ca5c270fac0986',1,'PlottyFile']]], - ['setunitx',['setUnitX',['../classPlottyFile.html#ab8d35a841ca9c325fca671cf34e03527',1,'PlottyFile']]], - ['setunity',['setUnitY',['../classPlottyFile.html#abb18c814f435926f741f7ceb310f3059',1,'PlottyFile']]], - ['startplotty',['startPlotty',['../classPlottyFile.html#a08a115ef10458cadfe76077d623313df',1,'PlottyFile']]] + ['readdipswitch',['readDipSwitch',['../classB15F.html#a6f858f21ea81d491b5031b3644a2239a',1,'B15F']]], + ['receive',['receive',['../classUSART.html#a0fdc238203852f00bd750127602b2a6a',1,'USART']]], + ['reconnect',['reconnect',['../classB15F.html#a52557b375443c180a044e7d4e80a1ae7',1,'B15F']]], + ['repaint',['repaint',['../classView.html#aa7b1f1179e3c4f06bef1e99355d0d592',1,'View']]], + ['reverse',['reverse',['../classB15F.html#a2937f22f1cfc9b533f4b5bf4db726a68',1,'B15F']]] ]; diff --git a/docs/html/search/functions_a.js b/docs/html/search/functions_a.js index 190df1c..3b2411d 100644 --- a/docs/html/search/functions_a.js +++ b/docs/html/search/functions_a.js @@ -1,7 +1,28 @@ var searchData= [ - ['testconnection',['testConnection',['../classB15F.html#a6b8c7da1fb9b619543844e0ce7597d83',1,'B15F']]], - ['testintconv',['testIntConv',['../classB15F.html#ac2c7b6d84da5239ee7cc3d44e689d9db',1,'B15F']]], - ['timeoutexception',['TimeoutException',['../classTimeoutException.html#aa45912234da11ffc9dd3594a1bbc0218',1,'TimeoutException::TimeoutException(const char *message)'],['../classTimeoutException.html#ad6e5c200fbfd276f48a6c1163e2d2988',1,'TimeoutException::TimeoutException(const std::string &message)']]], - ['transmit',['transmit',['../classUSART.html#a41b19dd58f307015b73e154048cd74ca',1,'USART']]] + ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], + ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], + ['setdescpara',['setDescPara',['../classPlottyFile.html#a431904143c3c1164a2e8b8cfec3c77ab',1,'PlottyFile']]], + ['setdescx',['setDescX',['../classPlottyFile.html#aa0449c290265d55d6223b19cf0a88b0a',1,'PlottyFile']]], + ['setdescy',['setDescY',['../classPlottyFile.html#a38a3a4dfc76bc70523727584bf01d590',1,'PlottyFile']]], + ['setfunctiontype',['setFunctionType',['../classPlottyFile.html#a4e5ab1ebb012a5cc1a3d6458a4cd512f',1,'PlottyFile']]], + ['setmem16',['setMem16',['../classB15F.html#a62ef2ee9bd945d30979939fcffa6759a',1,'B15F']]], + ['setmem8',['setMem8',['../classB15F.html#a65c0eee6b40b6d3ec58b0335fd668503',1,'B15F']]], + ['setparafirstcurve',['setParaFirstCurve',['../classPlottyFile.html#aa676414793becb975506f48d6e949dd0',1,'PlottyFile']]], + ['setparastepwidth',['setParaStepWidth',['../classPlottyFile.html#a6caebd31e04e2e7081cc007047350355',1,'PlottyFile']]], + ['setquadrant',['setQuadrant',['../classPlottyFile.html#a1953ee0d9a87b7353c16139584e9c2ae',1,'PlottyFile']]], + ['setrefx',['setRefX',['../classPlottyFile.html#a80c2c2e97a454566f9c1f2c51e1d7f3e',1,'PlottyFile']]], + ['setrefy',['setRefY',['../classPlottyFile.html#a3a371228ddcc007e97eebe7cc04dffc2',1,'PlottyFile']]], + ['setregister',['setRegister',['../classB15F.html#a47d7b797129d1ee7ebee4d8ae4f0ff93',1,'B15F']]], + ['setservodisabled',['setServoDisabled',['../classB15F.html#aad1b3206761c06c7183ae1b8b95b350b',1,'B15F']]], + ['setservoenabled',['setServoEnabled',['../classB15F.html#ab23d8c5a0b520b9d12d94a04f90fcfa0',1,'B15F']]], + ['setservoposition',['setServoPosition',['../classB15F.html#aa76f289274e5d0be41c5d4a58b52a416',1,'B15F']]], + ['settimeout',['setTimeout',['../classUSART.html#ad7fe866cebe920784d2b17602824c7ff',1,'USART']]], + ['settitle',['setTitle',['../classView.html#a6c725e4d83fd7474635a7e64200c7a08',1,'View']]], + ['setunitpara',['setUnitPara',['../classPlottyFile.html#abbac84109a1e0958a4ca5c270fac0986',1,'PlottyFile']]], + ['setunitx',['setUnitX',['../classPlottyFile.html#ab8d35a841ca9c325fca671cf34e03527',1,'PlottyFile']]], + ['setunity',['setUnitY',['../classPlottyFile.html#abb18c814f435926f741f7ceb310f3059',1,'PlottyFile']]], + ['setwincontext',['setWinContext',['../classView.html#a990aa2223befde031dfcce54a740c558',1,'View']]], + ['startplotty',['startPlotty',['../classPlottyFile.html#a08a115ef10458cadfe76077d623313df',1,'PlottyFile']]], + ['str_5fsplit',['str_split',['../classView.html#a52c2e2a7bc56388e7d9bfa398ad52668',1,'View']]] ]; diff --git a/docs/html/search/functions_b.js b/docs/html/search/functions_b.js index 7419b81..190df1c 100644 --- a/docs/html/search/functions_b.js +++ b/docs/html/search/functions_b.js @@ -1,5 +1,7 @@ var searchData= [ - ['usart',['USART',['../classUSART.html#a5daed20dc595c43d87c4c28bb08a7449',1,'USART']]], - ['usartexception',['USARTException',['../classUSARTException.html#a3c359db129825703b91392d5128cf93d',1,'USARTException::USARTException(const char *message)'],['../classUSARTException.html#a643c0a8b7f0d81e2f1693a75b378e6c2',1,'USARTException::USARTException(const std::string &message)']]] + ['testconnection',['testConnection',['../classB15F.html#a6b8c7da1fb9b619543844e0ce7597d83',1,'B15F']]], + ['testintconv',['testIntConv',['../classB15F.html#ac2c7b6d84da5239ee7cc3d44e689d9db',1,'B15F']]], + ['timeoutexception',['TimeoutException',['../classTimeoutException.html#aa45912234da11ffc9dd3594a1bbc0218',1,'TimeoutException::TimeoutException(const char *message)'],['../classTimeoutException.html#ad6e5c200fbfd276f48a6c1163e2d2988',1,'TimeoutException::TimeoutException(const std::string &message)']]], + ['transmit',['transmit',['../classUSART.html#a41b19dd58f307015b73e154048cd74ca',1,'USART']]] ]; diff --git a/docs/html/search/functions_c.js b/docs/html/search/functions_c.js index b730bff..7419b81 100644 --- a/docs/html/search/functions_c.js +++ b/docs/html/search/functions_c.js @@ -1,5 +1,5 @@ var searchData= [ - ['what',['what',['../classTimeoutException.html#a97eaf01fc39ddb94b060020b42fefd6e',1,'TimeoutException::what()'],['../classUSARTException.html#a2af5e3c00cd0585c7427c2e0420a8f15',1,'USARTException::what()']]], - ['writetofile',['writeToFile',['../classPlottyFile.html#a82c348e7fade2edcbc907e7c2bc2e305',1,'PlottyFile']]] + ['usart',['USART',['../classUSART.html#a5daed20dc595c43d87c4c28bb08a7449',1,'USART']]], + ['usartexception',['USARTException',['../classUSARTException.html#a3c359db129825703b91392d5128cf93d',1,'USARTException::USARTException(const char *message)'],['../classUSARTException.html#a643c0a8b7f0d81e2f1693a75b378e6c2',1,'USARTException::USARTException(const std::string &message)']]] ]; diff --git a/docs/html/search/functions_d.js b/docs/html/search/functions_d.js index f5a3874..9256ce0 100644 --- a/docs/html/search/functions_d.js +++ b/docs/html/search/functions_d.js @@ -1,6 +1,4 @@ var searchData= [ - ['_7etimeoutexception',['~TimeoutException',['../classTimeoutException.html#a2f686b262d2ccffa0090fda9b44ab540',1,'TimeoutException']]], - ['_7eusart',['~USART',['../classUSART.html#a0c8eb1a939ca00921e22f6cbcc7bb749',1,'USART']]], - ['_7eusartexception',['~USARTException',['../classUSARTException.html#a0e008b3cb4974859e6bc8c8f8eb480be',1,'USARTException']]] + ['view',['View',['../classView.html#a0a9be6e5fb588412aab31cacf5e43b04',1,'View']]] ]; diff --git a/docs/html/search/functions_e.html b/docs/html/search/functions_e.html new file mode 100644 index 0000000..0f20544 --- /dev/null +++ b/docs/html/search/functions_e.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/functions_e.js b/docs/html/search/functions_e.js new file mode 100644 index 0000000..6335f37 --- /dev/null +++ b/docs/html/search/functions_e.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['what',['what',['../classDriverException.html#a781362760bcd75b1bd5448629df58446',1,'DriverException::what()'],['../classTimeoutException.html#a97eaf01fc39ddb94b060020b42fefd6e',1,'TimeoutException::what()'],['../classUSARTException.html#a2af5e3c00cd0585c7427c2e0420a8f15',1,'USARTException::what()']]], + ['writetofile',['writeToFile',['../classPlottyFile.html#a82c348e7fade2edcbc907e7c2bc2e305',1,'PlottyFile']]] +]; diff --git a/docs/html/search/functions_f.html b/docs/html/search/functions_f.html new file mode 100644 index 0000000..0dc9f86 --- /dev/null +++ b/docs/html/search/functions_f.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/functions_f.js b/docs/html/search/functions_f.js new file mode 100644 index 0000000..b756d4d --- /dev/null +++ b/docs/html/search/functions_f.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['_7edriverexception',['~DriverException',['../classDriverException.html#a4e62b528e9a6c1a776b1a08487fac340',1,'DriverException']]], + ['_7etimeoutexception',['~TimeoutException',['../classTimeoutException.html#a2f686b262d2ccffa0090fda9b44ab540',1,'TimeoutException']]], + ['_7eusart',['~USART',['../classUSART.html#a0c8eb1a939ca00921e22f6cbcc7bb749',1,'USART']]], + ['_7eusartexception',['~USARTException',['../classUSARTException.html#a0e008b3cb4974859e6bc8c8f8eb480be',1,'USARTException']]], + ['_7eview',['~View',['../classView.html#a450dfab3f21a52edc03db4310593412f',1,'View']]] +]; diff --git a/docs/html/search/searchdata.js b/docs/html/search/searchdata.js index 9ff7555..72d48e8 100644 --- a/docs/html/search/searchdata.js +++ b/docs/html/search/searchdata.js @@ -1,9 +1,9 @@ var indexSectionsWithContent = { - 0: "abcdefgmoprstuvw~", + 0: "abcdefghkmoprstuvw~", 1: "bdptuv", - 2: "acdefgoprstuw~", - 3: "bmprw", + 2: "acdefgkoprstuvw~", + 3: "bchkmprstw", 4: "b" }; diff --git a/docs/html/search/variables_1.js b/docs/html/search/variables_1.js index 66df4a3..7f4e52c 100644 --- a/docs/html/search/variables_1.js +++ b/docs/html/search/variables_1.js @@ -1,6 +1,4 @@ var searchData= [ - ['msg',['msg',['../classTimeoutException.html#aa625fc0fae48a67737a98eafb91c9624',1,'TimeoutException::msg()'],['../classUSARTException.html#a14c80df95f216d221aa97cffbcd8dd79',1,'USARTException::msg()']]], - ['msg_5ffail',['MSG_FAIL',['../classB15F.html#a77d1ecf24b406c9204665d3b09c36f1e',1,'B15F']]], - ['msg_5fok',['MSG_OK',['../classB15F.html#ab01299858f74a6cec598688562e0ad02',1,'B15F']]] + ['calls',['calls',['../classView.html#a610367214a727e2f7da72ac5bdb60fa3',1,'View']]] ]; diff --git a/docs/html/search/variables_2.js b/docs/html/search/variables_2.js index 570beea..e27dc21 100644 --- a/docs/html/search/variables_2.js +++ b/docs/html/search/variables_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',1,'B15F']]] + ['height',['height',['../classView.html#a6e3e5c18893617490f02166641356746',1,'View']]] ]; diff --git a/docs/html/search/variables_3.js b/docs/html/search/variables_3.js index fbf0a47..e4b84c9 100644 --- a/docs/html/search/variables_3.js +++ b/docs/html/search/variables_3.js @@ -1,5 +1,4 @@ var searchData= [ - ['reconnect_5ftimeout',['RECONNECT_TIMEOUT',['../classB15F.html#a040951746fbfd632e12bd1ad14578816',1,'B15F']]], - ['reconnect_5ftries',['RECONNECT_TRIES',['../classB15F.html#a6c4895bdbcd71ff6743becf97985c2dc',1,'B15F']]] + ['key_5fent',['KEY_ENT',['../classView.html#a3554cf8689cad24c643665aa3d182134',1,'View']]] ]; diff --git a/docs/html/search/variables_4.js b/docs/html/search/variables_4.js index 9a9c561..9a8efba 100644 --- a/docs/html/search/variables_4.js +++ b/docs/html/search/variables_4.js @@ -1,4 +1,7 @@ var searchData= [ - ['wdt_5ftimeout',['WDT_TIMEOUT',['../classB15F.html#a158d13bc84aed6430cdede1396384e06',1,'B15F']]] + ['msg',['msg',['../classUSARTException.html#a14c80df95f216d221aa97cffbcd8dd79',1,'USARTException']]], + ['msg_5f',['msg_',['../classDriverException.html#ab8777afe3f5aed2e66f2b2fcb480a651',1,'DriverException::msg_()'],['../classTimeoutException.html#ae6395f887040521c915b0b8d88dc29e7',1,'TimeoutException::msg_()']]], + ['msg_5ffail',['MSG_FAIL',['../classB15F.html#a77d1ecf24b406c9204665d3b09c36f1e',1,'B15F']]], + ['msg_5fok',['MSG_OK',['../classB15F.html#ab01299858f74a6cec598688562e0ad02',1,'B15F']]] ]; diff --git a/docs/html/search/variables_5.html b/docs/html/search/variables_5.html new file mode 100644 index 0000000..dfa3558 --- /dev/null +++ b/docs/html/search/variables_5.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/variables_5.js b/docs/html/search/variables_5.js new file mode 100644 index 0000000..570beea --- /dev/null +++ b/docs/html/search/variables_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',1,'B15F']]] +]; diff --git a/docs/html/search/variables_6.html b/docs/html/search/variables_6.html new file mode 100644 index 0000000..cd462bd --- /dev/null +++ b/docs/html/search/variables_6.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/variables_6.js b/docs/html/search/variables_6.js new file mode 100644 index 0000000..fbf0a47 --- /dev/null +++ b/docs/html/search/variables_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['reconnect_5ftimeout',['RECONNECT_TIMEOUT',['../classB15F.html#a040951746fbfd632e12bd1ad14578816',1,'B15F']]], + ['reconnect_5ftries',['RECONNECT_TRIES',['../classB15F.html#a6c4895bdbcd71ff6743becf97985c2dc',1,'B15F']]] +]; diff --git a/docs/html/search/variables_7.html b/docs/html/search/variables_7.html new file mode 100644 index 0000000..47994b8 --- /dev/null +++ b/docs/html/search/variables_7.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/variables_7.js b/docs/html/search/variables_7.js new file mode 100644 index 0000000..adf94ab --- /dev/null +++ b/docs/html/search/variables_7.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['start_5fx',['start_x',['../classView.html#a9fc9f3b0c876d063e6f57dee320a43fe',1,'View']]], + ['start_5fy',['start_y',['../classView.html#ac424db4c13776c3ce9d33f9074dfcfaa',1,'View']]] +]; diff --git a/docs/html/search/variables_8.html b/docs/html/search/variables_8.html new file mode 100644 index 0000000..a50ee8f --- /dev/null +++ b/docs/html/search/variables_8.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/variables_8.js b/docs/html/search/variables_8.js new file mode 100644 index 0000000..93eef87 --- /dev/null +++ b/docs/html/search/variables_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['title',['title',['../classView.html#a80441aa81b52e04677a2aa2bd9c47753',1,'View']]] +]; diff --git a/docs/html/search/variables_9.html b/docs/html/search/variables_9.html new file mode 100644 index 0000000..82db8ae --- /dev/null +++ b/docs/html/search/variables_9.html @@ -0,0 +1,30 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/docs/html/search/variables_9.js b/docs/html/search/variables_9.js new file mode 100644 index 0000000..6cde899 --- /dev/null +++ b/docs/html/search/variables_9.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['wdt_5ftimeout',['WDT_TIMEOUT',['../classB15F.html#a158d13bc84aed6430cdede1396384e06',1,'B15F']]], + ['width',['width',['../classView.html#ae039aa744b085db819ae149705b2c32b',1,'View']]], + ['win',['win',['../classView.html#a5ddee2bf0b26dbcfa7780be17ff33dd7',1,'View']]] +]; diff --git a/docs/html/timeoutexception_8h_source.html b/docs/html/timeoutexception_8h_source.html index 0711943..3653e29 100644 --- a/docs/html/timeoutexception_8h_source.html +++ b/docs/html/timeoutexception_8h_source.html @@ -70,16 +70,16 @@ $(function() {
        timeoutexception.h
        -
        1 #ifndef TIMEOUTEXCEPTION_H
        2 #define TIMEOUTEXCEPTION_H
        3 
        4 #include <exception>
        5 #include <string>
        6 
        9 class TimeoutException: public std::exception
        10 {
        11 public:
        16  explicit TimeoutException(const char* message) : msg(message)
        17  {
        18  }
        19 
        24  explicit TimeoutException(const std::string& message) : msg(message)
        25  {
        26  }
        27 
        31  virtual ~TimeoutException() = default;
        32 
        37  virtual const char* what() const throw ()
        38  {
        39  return msg.c_str();
        40  }
        41 
        42 protected:
        43  std::string msg;
        44 };
        45 
        46 #endif // TIMEOUTEXCEPTION_H
        +
        1 #ifndef TIMEOUTEXCEPTION_H
        2 #define TIMEOUTEXCEPTION_H
        3 
        4 #include <exception>
        5 #include <string>
        6 
        9 class TimeoutException: public std::exception
        10 {
        11 public:
        16  explicit TimeoutException(const char* message) : msg_(message)
        17  {
        18  }
        19 
        24  explicit TimeoutException(const std::string& message) : msg_(message)
        25  {
        26  }
        27 
        31  virtual ~TimeoutException() = default;
        32 
        37  virtual const char* what() const throw ()
        38  {
        39  return msg_.c_str();
        40  }
        41 
        42 protected:
        43  std::string msg_;
        44 };
        45 
        46 #endif // TIMEOUTEXCEPTION_H
        virtual ~TimeoutException()=default
        -
        std::string msg
        failure description
        +
        std::string msg_
        failure description
        virtual const char * what() const
        TimeoutException(const char *message)
        TimeoutException(const std::string &message)
        diff --git a/docs/html/ui_8cpp_source.html b/docs/html/ui_8cpp_source.html index 9dbf621..8f73044 100644 --- a/docs/html/ui_8cpp_source.html +++ b/docs/html/ui_8cpp_source.html @@ -70,25 +70,28 @@ $(function() {
        ui.cpp
        -
        1 #include "ui.h"
        2 #include "../drv/b15f.h"
        3 
        4 std::vector<View*> win_stack;
        5 std::thread t_refresh;
        6 
        7 void show_main(int)
        8 {
        9  ViewSelection* view = new ViewSelection();
        10  view->setTitle("B15F - Command Line Interface");
        11  view->addChoice("[ Monitor - Eingaben beobachten ]", &show_monitor);
        12  view->addChoice("[ Digitale Ausgabe BA0 ]", &show_digital_output0);
        13  view->addChoice("[ Digitale Ausgabe BA1 ]", &show_digital_output1);
        14  view->addChoice("[ Analoge Ausgabe AA0 ]", &show_analog_output0);
        15  view->addChoice("[ Analoge Ausgabe AA1 ]", &show_analog_output1);
        16  view->addChoice("[ Selbsttest des B15 ]", &show_selftest_info);
        17  view->addChoice("[ Informationen ]", &show_info);
        18  view->addChoice("", nullptr);
        19  view->addChoice("[ Beenden ]", &finish);
        20  view->repaint();
        21 
        22  win_stack.push_back(view);
        23  input(0);
        24 }
        25 
        26 void input(int)
        27 {
        28  call_t nextCall;
        29  int key;
        30  do
        31  {
        32  key = wgetch(View::getWinContext());
        33  win_stack.back()->repaint();
        34  nextCall = win_stack.back()->keypress(key);
        35 
        36  if(key == -1)
        37  view_back(key);
        38 
        39  if(nextCall)
        40  nextCall(key);
        41  }
        42  while(win_stack.size());
        43 }
        44 
        45 void view_back(int)
        46 {
        47  if(win_stack.size())
        48  {
        49  delete win_stack.back();
        50  win_stack.pop_back();
        51  }
        52  if(win_stack.size())
        53  win_stack.back()->repaint();
        54 }
        55 
        56 void finish(int)
        57 {
        58  cleanup();
        59  exit(EXIT_SUCCESS);
        60 }
        61 
        62 void cleanup()
        63 {
        64  if(t_refresh.joinable())
        65  t_refresh.join();
        66  clrtoeol();
        67  refresh();
        68  endwin();
        69 }
        70 
        71 void show_info(int)
        72 {
        73  ViewInfo* view = new ViewInfo();
        74  view->setTitle("Info");
        75  view->setText("Informationen zu Board 15 Famulus Edition\n \nProjektseite: https://github.com/devfix/b15f/\nDokumentation: https://devfix.github.io/b15f/\n \nB15F Software entwickelt von Tristan Krause für das Hardware-Labor.\nKontakt: tristan.krause@stud.htwk-leipzig.de");
        76  view->setLabelClose("[ Zurueck ]");
        77  view->repaint();
        78 
        79  win_stack.push_back(view);
        80  input(0);
        81 }
        82 
        83 void show_monitor(int)
        84 {
        85  ViewMonitor* view = new ViewMonitor();
        86  view->setTitle("Monitor");
        87  view->setText("\nErfasse Messwerte...");
        88  view->setLabelClose("[ Zurueck ]");
        89  view->repaint();
        90 
        91  win_stack.push_back(view);
        92  input(0);
        93 }
        94 
        95 void show_invalid_port_input(int)
        96 {
        97  ViewInfo* view = new ViewInfo();
        98  view->setTitle("Falsche Eingabe");
        99  view->setText("Bitte geben Sie einen Wert aus dem Intervall [0, FF] an.");
        100  view->setLabelClose("[ Schliessen ]");
        101  view->repaint();
        102 
        103  win_stack.push_back(view);
        104  input(0);
        105 }
        106 
        107 void show_invalid_dac_input(int)
        108 {
        109  ViewInfo* view = new ViewInfo();
        110  view->setTitle("Falsche Eingabe");
        111  view->setText("Bitte geben Sie einen Wert aus dem Intervall [0, 1023] an.");
        112  view->setLabelClose("[ Schliessen ]");
        113  view->repaint();
        114 
        115  win_stack.push_back(view);
        116  input(0);
        117 }
        118 
        119 void write_digital_output0(int)
        120 {
        121  try
        122  {
        123  int d = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput(), 0, 16);
        124  if(d > 255 || 0 > d)
        125  throw std::invalid_argument("bad value");
        126  uint8_t port = static_cast<uint8_t>(d);
        127 
        128  B15F& drv = B15F::getInstance();
        129  drv.digitalWrite0(port);
        130  view_back(0);
        131  }
        132  catch(std::invalid_argument& ex)
        133  {
        134  show_invalid_port_input(0);
        135  }
        136 }
        137 
        138 void write_digital_output1(int)
        139 {
        140  try
        141  {
        142  int d = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput(), 0, 16);
        143  if(d > 255 || 0 > d)
        144  throw std::invalid_argument("bad value");
        145  uint8_t port = static_cast<uint8_t>(d);
        146 
        147  B15F& drv = B15F::getInstance();
        148  drv.digitalWrite1(port);
        149  view_back(0);
        150  }
        151  catch(std::invalid_argument& ex)
        152  {
        153  show_invalid_port_input(0);
        154  }
        155 }
        156 
        157 void write_analog_output0(int)
        158 {
        159  try
        160  {
        161  uint16_t port = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput());
        162  if(port > 1023)
        163  throw std::invalid_argument("bad value");
        164 
        165  B15F& drv = B15F::getInstance();
        166  drv.analogWrite0(port);
        167  view_back(0);
        168  }
        169  catch(std::invalid_argument& ex)
        170  {
        171  show_invalid_dac_input(0);
        172  }
        173 }
        174 
        175 void write_analog_output1(int)
        176 {
        177  try
        178  {
        179  uint16_t port = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput());
        180  if(port > 1023)
        181  throw std::invalid_argument("bad value");
        182 
        183  B15F& drv = B15F::getInstance();
        184  drv.analogWrite1(port);
        185  view_back(0);
        186  }
        187  catch(std::invalid_argument& ex)
        188  {
        189  show_invalid_dac_input(0);
        190  }
        191 }
        192 
        193 void show_digital_output0(int)
        194 {
        195  ViewPromt* view = new ViewPromt();
        196  view->setTitle("Digitale Ausgabe BE0");
        197  view->setMessage("\nAusgabe Port-Wert (hex): 0x");
        198  view->setCancel("[ Zurueck ]", true);
        199  view->setConfirm("[ OK ]", &write_digital_output0);
        200  view->repaint();
        201 
        202  win_stack.push_back(view);
        203  input(0);
        204 }
        205 
        206 void show_digital_output1(int)
        207 {
        208  ViewPromt* view = new ViewPromt();
        209  view->setTitle("Digitale Ausgabe BE1");
        210  view->setMessage("\nAusgabe Port-Wert (hex): 0x");
        211  view->setCancel("[ Zurueck ]", true);
        212  view->setConfirm("[ OK ]", &write_digital_output1);
        213  view->repaint();
        214 
        215  win_stack.push_back(view);
        216  input(0);
        217 }
        218 
        219 void show_analog_output0(int)
        220 {
        221  ViewPromt* view = new ViewPromt();
        222  view->setTitle("Analoge Ausgabe AA0");
        223  view->setMessage("\nAusgabe 10-Bit-Wert (0...1023): ");
        224  view->setCancel("[ Zurueck ]", true);
        225  view->setConfirm("[ OK ]", &write_analog_output0);
        226  view->repaint();
        227 
        228  win_stack.push_back(view);
        229  input(0);
        230 }
        231 
        232 void show_analog_output1(int)
        233 {
        234  ViewPromt* view = new ViewPromt();
        235  view->setTitle("Analoge Ausgabe AA1");
        236  view->setMessage("\nAusgabe 10-Bit-Wert (0...1023): ");
        237  view->setCancel("[ Zurueck ]", true);
        238  view->setConfirm("[ OK ]", &write_analog_output1);
        239  view->repaint();
        240 
        241  win_stack.push_back(view);
        242  input(0);
        243 }
        244 
        245 void start_selftest(int)
        246 {
        247  B15F& drv = B15F::getInstance();
        248  drv.activateSelfTestMode();
        249 
        250  ViewInfo* view = new ViewInfo();
        251  view->setTitle("Selbsttest aktiv");
        252  view->setText("Das B15 befindet sich jetzt im Selbsttestmodus.\n \nSelbsttest:\nZu Beginn geht der Reihe nach jede LED von BA0 bis BA1 an.\nDanach leuchten die LEDs an AA0 und AA1 kurz auf.\nZum Schluss spiegelt in einer Endlosschleife:\n* BA0 Port BE0\n* BA1 die DIP-Schalter S7\n* AA0 ADC0\n* AA1 ADC1");
        253  view->setLabelClose("[ Selbsttest Beenden ]");
        254  view->setCall(&stop_selftest);
        255  view->repaint();
        256 
        257  win_stack.push_back(view);
        258  input(0);
        259 }
        260 
        261 void stop_selftest(int)
        262 {
        263  B15F& drv = B15F::getInstance();
        264  drv.discard();
        266  drv.reconnect();
        267  drv.digitalWrite0(0);
        268  drv.digitalWrite1(0);
        269 }
        270 
        271 void show_selftest_info(int)
        272 {
        273  ViewInfo* view = new ViewInfo();
        274  view->setTitle("Selbsttest");
        275  view->setText("Bitte entfernen Sie jetzt alle Draehte von den Anschlussklemmen und\nbestätigen mit Enter.");
        276  view->setLabelClose("[ Weiter ]");
        277  view->setCall(&start_selftest);
        278  view->repaint();
        279 
        280  win_stack.push_back(view);
        281  input(0);
        282 }
        +
        1 #include "ui.h"
        2 #include "../drv/b15f.h"
        3 
        4 std::vector<View*> win_stack;
        5 std::thread t_refresh;
        6 
        7 void show_main(int)
        8 {
        9  ViewSelection* view = new ViewSelection();
        10  view->setTitle("B15F - Command Line Interface");
        11  view->addChoice("[ Monitor - Eingaben beobachten ]", &show_monitor);
        12  view->addChoice("[ Digitale Ausgabe BA0 ]", &show_digital_output0);
        13  view->addChoice("[ Digitale Ausgabe BA1 ]", &show_digital_output1);
        14  view->addChoice("[ Analoge Ausgabe AA0 ]", &show_analog_output0);
        15  view->addChoice("[ Analoge Ausgabe AA1 ]", &show_analog_output1);
        16  view->addChoice("[ Selbsttest des B15 ]", &show_selftest_info);
        17  view->addChoice("[ Informationen ]", &show_info);
        18  view->addChoice("", nullptr);
        19  view->addChoice("[ Beenden ]", &finish);
        20  view->repaint();
        21 
        22  win_stack.push_back(view);
        23  input(0);
        24 }
        25 
        26 void input(int)
        27 {
        28  call_t nextCall;
        29  int key;
        30  do
        31  {
        32  key = wgetch(View::getWinContext());
        33  win_stack.back()->repaint();
        34  nextCall = win_stack.back()->keypress(key);
        35 
        36  if(key == -1)
        37  view_back(key);
        38 
        39  if(nextCall)
        40  nextCall(key);
        41  }
        42  while(win_stack.size());
        43 }
        44 
        45 void view_back(int)
        46 {
        47  if(win_stack.size())
        48  {
        49  delete win_stack.back();
        50  win_stack.pop_back();
        51  }
        52  if(win_stack.size())
        53  win_stack.back()->repaint();
        54 }
        55 
        56 void finish(int)
        57 {
        58  cleanup();
        59  exit(EXIT_SUCCESS);
        60 }
        61 
        62 void cleanup()
        63 {
        64  if(t_refresh.joinable())
        65  t_refresh.join();
        66  clrtoeol();
        67  refresh();
        68  endwin();
        69 }
        70 
        71 void show_info(int)
        72 {
        73  ViewInfo* view = new ViewInfo();
        74  view->setTitle("Info");
        75  view->setText("Informationen zu Board 15 Famulus Edition\n \nProjektseite: https://github.com/devfix/b15f/\nDokumentation: https://devfix.github.io/b15f/\n \nB15F Software entwickelt von Tristan Krause für das Hardware-Labor.\nKontakt: tristan.krause@stud.htwk-leipzig.de");
        76  view->setLabelClose("[ Zurueck ]");
        77  view->repaint();
        78 
        79  win_stack.push_back(view);
        80  input(0);
        81 }
        82 
        83 void show_monitor(int)
        84 {
        85  ViewMonitor* view = new ViewMonitor();
        86  view->setTitle("Monitor");
        87  view->setText("\nErfasse Messwerte...");
        88  view->setLabelClose("[ Zurueck ]");
        89  view->repaint();
        90 
        91  win_stack.push_back(view);
        92  input(0);
        93 }
        94 
        95 void show_invalid_port_input(int)
        96 {
        97  ViewInfo* view = new ViewInfo();
        98  view->setTitle("Falsche Eingabe");
        99  view->setText("Bitte geben Sie einen Wert aus dem Intervall [0, FF] an.");
        100  view->setLabelClose("[ Schliessen ]");
        101  view->repaint();
        102 
        103  win_stack.push_back(view);
        104  input(0);
        105 }
        106 
        107 void show_invalid_dac_input(int)
        108 {
        109  ViewInfo* view = new ViewInfo();
        110  view->setTitle("Falsche Eingabe");
        111  view->setText("Bitte geben Sie einen Wert aus dem Intervall [0, 1023] an.");
        112  view->setLabelClose("[ Schliessen ]");
        113  view->repaint();
        114 
        115  win_stack.push_back(view);
        116  input(0);
        117 }
        118 
        119 void write_digital_output0(int)
        120 {
        121  try
        122  {
        123  int d = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput(), 0, 16);
        124  if(d > 255 || 0 > d)
        125  throw std::invalid_argument("bad value");
        126  uint8_t port = static_cast<uint8_t>(d);
        127 
        128  B15F& drv = B15F::getInstance();
        129  drv.digitalWrite0(port);
        130  view_back(0);
        131  }
        132  catch(std::invalid_argument& ex)
        133  {
        134  show_invalid_port_input(0);
        135  }
        136 }
        137 
        138 void write_digital_output1(int)
        139 {
        140  try
        141  {
        142  int d = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput(), 0, 16);
        143  if(d > 255 || 0 > d)
        144  throw std::invalid_argument("bad value");
        145  uint8_t port = static_cast<uint8_t>(d);
        146 
        147  B15F& drv = B15F::getInstance();
        148  drv.digitalWrite1(port);
        149  view_back(0);
        150  }
        151  catch(std::invalid_argument& ex)
        152  {
        153  show_invalid_port_input(0);
        154  }
        155 }
        156 
        157 void write_analog_output0(int)
        158 {
        159  try
        160  {
        161  uint16_t port = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput());
        162  if(port > 1023)
        163  throw std::invalid_argument("bad value");
        164 
        165  B15F& drv = B15F::getInstance();
        166  drv.analogWrite0(port);
        167  view_back(0);
        168  }
        169  catch(std::invalid_argument& ex)
        170  {
        171  show_invalid_dac_input(0);
        172  }
        173 }
        174 
        175 void write_analog_output1(int)
        176 {
        177  try
        178  {
        179  uint16_t port = std::stoi(static_cast<ViewPromt*>(win_stack.back())->getInput());
        180  if(port > 1023)
        181  throw std::invalid_argument("bad value");
        182 
        183  B15F& drv = B15F::getInstance();
        184  drv.analogWrite1(port);
        185  view_back(0);
        186  }
        187  catch(std::invalid_argument& ex)
        188  {
        189  show_invalid_dac_input(0);
        190  }
        191 }
        192 
        193 void show_digital_output0(int)
        194 {
        195  ViewPromt* view = new ViewPromt();
        196  view->setTitle("Digitale Ausgabe BE0");
        197  view->setMessage("\nAusgabe Port-Wert (hex): 0x");
        198  view->setCancel("[ Zurueck ]", true);
        199  view->setConfirm("[ OK ]", &write_digital_output0);
        200  view->repaint();
        201 
        202  win_stack.push_back(view);
        203  input(0);
        204 }
        205 
        206 void show_digital_output1(int)
        207 {
        208  ViewPromt* view = new ViewPromt();
        209  view->setTitle("Digitale Ausgabe BE1");
        210  view->setMessage("\nAusgabe Port-Wert (hex): 0x");
        211  view->setCancel("[ Zurueck ]", true);
        212  view->setConfirm("[ OK ]", &write_digital_output1);
        213  view->repaint();
        214 
        215  win_stack.push_back(view);
        216  input(0);
        217 }
        218 
        219 void show_analog_output0(int)
        220 {
        221  ViewPromt* view = new ViewPromt();
        222  view->setTitle("Analoge Ausgabe AA0");
        223  view->setMessage("\nAusgabe 10-Bit-Wert (0...1023): ");
        224  view->setCancel("[ Zurueck ]", true);
        225  view->setConfirm("[ OK ]", &write_analog_output0);
        226  view->repaint();
        227 
        228  win_stack.push_back(view);
        229  input(0);
        230 }
        231 
        232 void show_analog_output1(int)
        233 {
        234  ViewPromt* view = new ViewPromt();
        235  view->setTitle("Analoge Ausgabe AA1");
        236  view->setMessage("\nAusgabe 10-Bit-Wert (0...1023): ");
        237  view->setCancel("[ Zurueck ]", true);
        238  view->setConfirm("[ OK ]", &write_analog_output1);
        239  view->repaint();
        240 
        241  win_stack.push_back(view);
        242  input(0);
        243 }
        244 
        245 void start_selftest(int)
        246 {
        247  B15F& drv = B15F::getInstance();
        248  drv.activateSelfTestMode();
        249 
        250  ViewInfo* view = new ViewInfo();
        251  view->setTitle("Selbsttest aktiv");
        252  view->setText("Das B15 befindet sich jetzt im Selbsttestmodus.\n \nSelbsttest:\nZu Beginn geht der Reihe nach jede LED von BA0 bis BA1 an.\nDanach leuchten die LEDs an AA0 und AA1 kurz auf.\nZum Schluss spiegelt in einer Endlosschleife:\n* BA0 Port BE0\n* BA1 die DIP-Schalter S7\n* AA0 ADC0\n* AA1 ADC1");
        253  view->setLabelClose("[ Selbsttest Beenden ]");
        254  view->setCall(&stop_selftest);
        255  view->repaint();
        256 
        257  win_stack.push_back(view);
        258  input(0);
        259 }
        260 
        261 void stop_selftest(int)
        262 {
        263  B15F& drv = B15F::getInstance();
        264  drv.discard();
        266  drv.reconnect();
        267  drv.digitalWrite0(0);
        268  drv.digitalWrite1(0);
        269 }
        270 
        271 void show_selftest_info(int)
        272 {
        273  ViewInfo* view = new ViewInfo();
        274  view->setTitle("Selbsttest");
        275  view->setText("Bitte entfernen Sie jetzt alle Draehte von den Anschlussklemmen und\nbestätigen mit Enter.");
        276  view->setLabelClose("[ Weiter ]");
        277  view->setCall(&start_selftest);
        278  view->repaint();
        279 
        280  win_stack.push_back(view);
        281  input(0);
        282 }
        void analogWrite0(uint16_t port)
        Definition: b15f.cpp:312
        void analogWrite1(uint16_t port)
        Definition: b15f.cpp:329
        void digitalWrite0(uint8_t)
        Definition: b15f.cpp:219
        +
        static WINDOW * getWinContext(void)
        Definition: view.cpp:24
        void delay_ms(uint16_t ms)
        Definition: b15f.cpp:141
        static B15F & getInstance(void)
        Definition: b15f.cpp:10
        Definition: b15f.h:38
        void activateSelfTestMode(void)
        Definition: b15f.cpp:204
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        void discard(void)
        Definition: b15f.cpp:40
        constexpr static uint16_t WDT_TIMEOUT
        Time in ms after which the watch dog timer resets the MCU.
        Definition: b15f.h:314
        void reconnect(void)
        Definition: b15f.cpp:18
        +
        virtual void setTitle(std::string title)
        Definition: view.cpp:47
        void digitalWrite1(uint8_t)
        Definition: b15f.cpp:237
        diff --git a/docs/html/ui_8h_source.html b/docs/html/ui_8h_source.html index ae641f6..216da07 100644 --- a/docs/html/ui_8h_source.html +++ b/docs/html/ui_8h_source.html @@ -73,7 +73,7 @@ $(function() {
        1 #ifndef UI_H
        2 #define UI_H
        3 
        4 #include <vector>
        5 #include "view_selection.h"
        6 #include "view_info.h"
        7 #include "view_monitor.h"
        8 #include "view_promt.h"
        9 
        10 void show_main(int);
        11 void input(int);
        12 void view_back(int);
        13 void finish(int);
        14 void cleanup();
        15 
        16 void show_info(int);
        17 void show_monitor(int);
        18 void show_invalid_port_input(int);
        19 void show_invalid_dac_input(int);
        20 void write_digital_output0(int);
        21 void write_digital_output1(int);
        22 void write_analog_output0(int);
        23 void write_analog_output1(int);
        24 void show_digital_output0(int);
        25 void show_digital_output1(int);
        26 void show_analog_output0(int);
        27 void show_analog_output1(int);
        28 
        29 // selftest group
        30 void show_selftest_info(int);
        31 void start_selftest(int);
        32 void stop_selftest(int);
        33 
        34 
        35 extern std::vector<View*> win_stack;
        36 extern std::thread t_refresh;
        37 
        38 #endif // UI_H
        diff --git a/docs/html/usart_8cpp_source.html b/docs/html/usart_8cpp_source.html index dca046c..8abba5b 100644 --- a/docs/html/usart_8cpp_source.html +++ b/docs/html/usart_8cpp_source.html @@ -88,7 +88,7 @@ $(function() { diff --git a/docs/html/usart_8h_source.html b/docs/html/usart_8h_source.html index d36230a..8a6c183 100644 --- a/docs/html/usart_8h_source.html +++ b/docs/html/usart_8h_source.html @@ -88,7 +88,7 @@ $(function() {
        void flushOutputBuffer(void)
        Definition: usart.cpp:68
        diff --git a/docs/html/usartexception_8h_source.html b/docs/html/usartexception_8h_source.html index fba8b36..ca58e16 100644 --- a/docs/html/usartexception_8h_source.html +++ b/docs/html/usartexception_8h_source.html @@ -79,7 +79,7 @@ $(function() {
        virtual ~USARTException()=default
        diff --git a/docs/html/view_8cpp_source.html b/docs/html/view_8cpp_source.html index 8fdee39..02eb344 100644 --- a/docs/html/view_8cpp_source.html +++ b/docs/html/view_8cpp_source.html @@ -70,11 +70,25 @@ $(function() {
        view.cpp
        -
        1 #include "view.h"
        2 
        3 WINDOW* View::win = nullptr;
        4 
        5 View::View()
        6 {
        7  if(!win)
        8  {
        9  B15F::abort("View::win not initialized, missing context");
        10  }
        11  getmaxyx(win, height, width); // init width and height
        12  keypad(win, TRUE);
        13 }
        14 
        15 View::~View()
        16 {
        17 }
        18 
        19 void View::setWinContext(WINDOW* win)
        20 {
        21  View::win = win;
        22 }
        23 
        24 WINDOW* View::getWinContext()
        25 {
        26  return win;
        27 }
        28 
        29 // from: https://stackoverflow.com/a/37454181
        30 std::vector<std::string> View::str_split(const std::string& str, const std::string delim)
        31 {
        32  std::vector<std::string> tokens;
        33  size_t prev = 0, pos = 0;
        34  do
        35  {
        36  pos = str.find(delim, prev);
        37  if (pos == std::string::npos) pos = str.length();
        38  std::string token = str.substr(prev, pos-prev);
        39  if (!token.empty()) tokens.push_back(token);
        40  prev = pos + delim.length();
        41  }
        42  while (pos < str.length() && prev < str.length());
        43  return tokens;
        44 }
        45 
        46 
        47 void View::setTitle(std::string title)
        48 {
        49  this->title = title;
        50 }
        51 
        52 void View::repaint()
        53 {
        54  // get screen size
        55  struct winsize size;
        56  if (ioctl(0, TIOCGWINSZ, (char *) &size) < 0)
        57  throw std::runtime_error("TIOCGWINSZ error");
        58 
        59 
        60  start_x = floor((size.ws_col - width) / 2.);
        61  start_y = floor((size.ws_row - height) / 2.);
        62 
        63  curs_set(0); // hide cursor
        64  mvwin(win, start_y, start_x);
        65  clear();
        66  wclear(win);
        67 
        68  // generic draw
        69  box(win, 0, 0);
        70  int offset_x = (width - title.length()) / 2;
        71  mvwprintw(win, 1, offset_x, "%s", title.c_str());
        72 
        73  // specific draw
        74  draw();
        75 
        76  refresh();
        77  wrefresh(win);
        78 }
        +
        1 #include "view.h"
        2 
        3 WINDOW* View::win = nullptr;
        4 
        6 {
        7  if(!win)
        8  {
        9  B15F::abort("View::win not initialized, missing context");
        10  }
        11  getmaxyx(win, height, width); // init width and height
        12  keypad(win, TRUE);
        13 }
        14 
        16 {
        17 }
        18 
        19 void View::setWinContext(WINDOW* win)
        20 {
        21  View::win = win;
        22 }
        23 
        25 {
        26  return win;
        27 }
        28 
        29 // from: https://stackoverflow.com/a/37454181
        30 std::vector<std::string> View::str_split(const std::string& str, const std::string delim)
        31 {
        32  std::vector<std::string> tokens;
        33  size_t prev = 0, pos = 0;
        34  do
        35  {
        36  pos = str.find(delim, prev);
        37  if (pos == std::string::npos) pos = str.length();
        38  std::string token = str.substr(prev, pos-prev);
        39  if (!token.empty()) tokens.push_back(token);
        40  prev = pos + delim.length();
        41  }
        42  while (pos < str.length() && prev < str.length());
        43  return tokens;
        44 }
        45 
        46 
        47 void View::setTitle(std::string title)
        48 {
        49  this->title = title;
        50 }
        51 
        53 {
        54  // get screen size
        55  struct winsize size;
        56  if (ioctl(0, TIOCGWINSZ, (char *) &size) < 0)
        57  throw std::runtime_error("TIOCGWINSZ error");
        58 
        59 
        60  start_x = floor((size.ws_col - width) / 2.);
        61  start_y = floor((size.ws_row - height) / 2.);
        62 
        63  curs_set(0); // hide cursor
        64  mvwin(win, start_y, start_x);
        65  clear();
        66  wclear(win);
        67 
        68  // generic draw
        69  box(win, 0, 0);
        70  int offset_x = (width - title.length()) / 2;
        71  mvwprintw(win, 1, offset_x, "%s", title.c_str());
        72 
        73  // specific draw
        74  draw();
        75 
        76  refresh();
        77  wrefresh(win);
        78 }
        +
        int height
        height of view in terminal characters
        Definition: view.h:80
        +
        int width
        width of view in terminal characters
        Definition: view.h:79
        +
        std::string title
        title of the view
        Definition: view.h:83
        +
        virtual ~View(void)
        Definition: view.cpp:15
        +
        static WINDOW * getWinContext(void)
        Definition: view.cpp:24
        static void abort(std::string msg)
        Definition: b15f.cpp:175
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        +
        static void setWinContext(WINDOW *win)
        Definition: view.cpp:19
        +
        static std::vector< std::string > str_split(const std::string &str, const std::string delim)
        Definition: view.cpp:30
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        View(void)
        Definition: view.cpp:5
        +
        virtual void setTitle(std::string title)
        Definition: view.cpp:47
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        virtual void draw(void)=0
        diff --git a/docs/html/view_8h_source.html b/docs/html/view_8h_source.html index 2400c36..419a51c 100644 --- a/docs/html/view_8h_source.html +++ b/docs/html/view_8h_source.html @@ -70,11 +70,28 @@ $(function() {
        view.h
        -
        1 #ifndef VIEW_H
        2 #define VIEW_H
        3 
        4 #include <iostream>
        5 #include <cmath>
        6 #include <vector>
        7 #include <functional>
        8 #include <ncurses.h> // sudo apt-get install libncurses5-dev
        9 #include <sys/ioctl.h>
        10 #include <unistd.h>
        11 #include <signal.h>
        12 #include "../drv/b15f.h"
        13 
        14 extern std::string ERR_MSG;
        15 typedef std::function<void(int)> call_t;
        16 
        19 class View
        20 {
        21 public:
        22  View(void);
        23  virtual ~View(void);
        24 
        25  static void setWinContext(WINDOW* win);
        26  static WINDOW* getWinContext(void);
        27  static std::vector<std::string> str_split(const std::string& str, const std::string delim);
        28 
        29  virtual void setTitle(std::string title);
        30 
        31  virtual void repaint(void);
        32 
        33  virtual void draw(void) = 0;
        34  virtual call_t keypress(int& key) = 0;
        35 
        36 
        37 protected:
        38  int width, height;
        39  int start_x = 0, start_y = 0;
        40  std::string title;
        41  std::vector<call_t> calls;
        42 
        43  static WINDOW* win;
        44  constexpr static int KEY_ENT = 10;
        45 };
        46 
        47 #endif // VIEW_H
        +
        1 #ifndef VIEW_H
        2 #define VIEW_H
        3 
        4 #include <iostream>
        5 #include <cmath>
        6 #include <vector>
        7 #include <functional>
        8 #include <ncurses.h> // sudo apt-get install libncurses5-dev
        9 #include <sys/ioctl.h>
        10 #include <unistd.h>
        11 #include <signal.h>
        12 #include "../drv/b15f.h"
        13 
        14 extern std::string ERR_MSG;
        15 typedef std::function<void(int)> call_t;
        16 
        19 class View
        20 {
        21 public:
        25  View(void);
        26 
        30  virtual ~View(void);
        31 
        37  static void setWinContext(WINDOW* win);
        38 
        42  static WINDOW* getWinContext(void);
        43 
        50  static std::vector<std::string> str_split(const std::string& str, const std::string delim);
        51 
        56  virtual void setTitle(std::string title);
        57 
        63  virtual void repaint(void);
        64 
        69  virtual void draw(void) = 0;
        70 
        75  virtual call_t keypress(int& key) = 0;
        76 
        77 
        78 protected:
        79  int width;
        80  int height;
        81  int start_x = 0;
        82  int start_y = 0;
        83  std::string title;
        84  std::vector<call_t> calls;
        85 
        86  static WINDOW* win;
        87  constexpr static int KEY_ENT = 10;
        88 };
        89 
        90 #endif // VIEW_H
        +
        int height
        height of view in terminal characters
        Definition: view.h:80
        +
        int width
        width of view in terminal characters
        Definition: view.h:79
        +
        std::string title
        title of the view
        Definition: view.h:83
        +
        virtual ~View(void)
        Definition: view.cpp:15
        +
        static WINDOW * getWinContext(void)
        Definition: view.cpp:24
        Definition: view.h:19
        +
        std::vector< call_t > calls
        calls (function pointers) for different button actions in the view (if any)
        Definition: view.h:84
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        +
        static void setWinContext(WINDOW *win)
        Definition: view.cpp:19
        +
        static std::vector< std::string > str_split(const std::string &str, const std::string delim)
        Definition: view.cpp:30
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        +
        virtual call_t keypress(int &key)=0
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        View(void)
        Definition: view.cpp:5
        +
        virtual void setTitle(std::string title)
        Definition: view.cpp:47
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        virtual void draw(void)=0
        +
        constexpr static int KEY_ENT
        Key value for the Enter key.
        Definition: view.h:87
        diff --git a/docs/html/view__info_8cpp_source.html b/docs/html/view__info_8cpp_source.html index 9c06888..5306e7c 100644 --- a/docs/html/view__info_8cpp_source.html +++ b/docs/html/view__info_8cpp_source.html @@ -70,10 +70,20 @@ $(function() {
        view_info.cpp
        -
        1 #include "view_info.h"
        2 
        3 ViewInfo::ViewInfo()
        4 {
        5  calls.push_back(nullptr);
        6 }
        7 
        8 void ViewInfo::setText(std::string text)
        9 {
        10  this->text = text;
        11 }
        12 
        13 void ViewInfo::setLabelClose(std::string label)
        14 {
        15  this->label_close = label;
        16 }
        17 
        18 void ViewInfo::setCall(call_t call)
        19 {
        20  calls[0] = call;
        21 }
        22 
        23 void ViewInfo::draw()
        24 {
        25  int li = 0;
        26  for(std::string line : str_split(text, "\n"))
        27  mvwprintw(win, text_offset_y + li++, text_offset_x, "%s", line.c_str());
        28 
        29  close_offset_x = (width - label_close.length()) / 2;
        30  close_offset_y = height - 2;
        31 
        32  wattron(win, A_REVERSE);
        33  mvwprintw(win, close_offset_y, close_offset_x, "%s", label_close.c_str());
        34  wattroff(win, A_REVERSE);
        35 }
        36 
        37 call_t ViewInfo::keypress(int& key)
        38 {
        39  switch(key)
        40  {
        41 
        42  case KEY_MOUSE:
        43  {
        44  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        45  MEVENT event;
        46  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        47  {
        48  size_t column = start_x + close_offset_x;
        49  size_t row = start_y + close_offset_y;
        50  size_t mouse_x = event.x, mouse_y = event.y;
        51  if(mouse_y == row && mouse_x >= column && mouse_x < column + label_close.length())
        52  key = -1; // do return from view
        53  }
        54  break;
        55  }
        56  case KEY_ENT:
        57  key = -1; // do return from view
        58  break;
        59  default:
        60  break;
        61  }
        62  return calls[0];
        63 }
        +
        1 #include "view_info.h"
        2 
        3 ViewInfo::ViewInfo()
        4 {
        5  calls.push_back(nullptr);
        6 }
        7 
        8 void ViewInfo::setText(std::string text)
        9 {
        10  this->text = text;
        11 }
        12 
        13 void ViewInfo::setLabelClose(std::string label)
        14 {
        15  this->label_close = label;
        16 }
        17 
        18 void ViewInfo::setCall(call_t call)
        19 {
        20  calls[0] = call;
        21 }
        22 
        24 {
        25  int li = 0;
        26  for(std::string line : str_split(text, "\n"))
        27  mvwprintw(win, text_offset_y + li++, text_offset_x, "%s", line.c_str());
        28 
        29  close_offset_x = (width - label_close.length()) / 2;
        30  close_offset_y = height - 2;
        31 
        32  wattron(win, A_REVERSE);
        33  mvwprintw(win, close_offset_y, close_offset_x, "%s", label_close.c_str());
        34  wattroff(win, A_REVERSE);
        35 }
        36 
        37 call_t ViewInfo::keypress(int& key)
        38 {
        39  switch(key)
        40  {
        41 
        42  case KEY_MOUSE:
        43  {
        44  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        45  MEVENT event;
        46  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        47  {
        48  size_t column = start_x + close_offset_x;
        49  size_t row = start_y + close_offset_y;
        50  size_t mouse_x = event.x, mouse_y = event.y;
        51  if(mouse_y == row && mouse_x >= column && mouse_x < column + label_close.length())
        52  key = -1; // do return from view
        53  }
        54  break;
        55  }
        56  case KEY_ENT:
        57  key = -1; // do return from view
        58  break;
        59  default:
        60  break;
        61  }
        62  return calls[0];
        63 }
        +
        int height
        height of view in terminal characters
        Definition: view.h:80
        +
        int width
        width of view in terminal characters
        Definition: view.h:79
        +
        std::vector< call_t > calls
        calls (function pointers) for different button actions in the view (if any)
        Definition: view.h:84
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        +
        static std::vector< std::string > str_split(const std::string &str, const std::string delim)
        Definition: view.cpp:30
        +
        virtual call_t keypress(int &key) override
        Definition: view_info.cpp:37
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        virtual void draw(void) override
        Definition: view_info.cpp:23
        +
        constexpr static int KEY_ENT
        Key value for the Enter key.
        Definition: view.h:87
        diff --git a/docs/html/view__info_8h_source.html b/docs/html/view__info_8h_source.html index f9894d4..aa8d4ab 100644 --- a/docs/html/view__info_8h_source.html +++ b/docs/html/view__info_8h_source.html @@ -70,12 +70,14 @@ $(function() {
        view_info.h
        -
        1 #ifndef VIEW_INFO
        2 #define VIEW_INFO
        3 
        4 #include "view.h"
        5 
        8 class ViewInfo : public View
        9 {
        10 public:
        11  ViewInfo(void);
        12  virtual void setText(std::string text);
        13  virtual void setLabelClose(std::string label);;
        14  virtual void setCall(call_t call);
        15  virtual void draw(void) override;
        16  virtual call_t keypress(int& key) override;
        17 
        18 protected:
        19  std::string text;
        20  std::string label_close;
        21  int close_offset_x = 0;
        22  int close_offset_y = 0;
        23  constexpr static int text_offset_x = 2;
        24  constexpr static int text_offset_y = 3;
        25 };
        26 
        27 #endif // VIEW_INFO
        +
        1 #ifndef VIEW_INFO
        2 #define VIEW_INFO
        3 
        4 #include "view.h"
        5 
        8 class ViewInfo : public View
        9 {
        10 public:
        11  ViewInfo(void);
        12  virtual void setText(std::string text);
        13  virtual void setLabelClose(std::string label);;
        14  virtual void setCall(call_t call);
        15  virtual void draw(void) override;
        16  virtual call_t keypress(int& key) override;
        17 
        18 protected:
        19  std::string text;
        20  std::string label_close;
        21  int close_offset_x = 0;
        22  int close_offset_y = 0;
        23  constexpr static int text_offset_x = 2;
        24  constexpr static int text_offset_y = 3;
        25 };
        26 
        27 #endif // VIEW_INFO
        Definition: view.h:19
        +
        virtual call_t keypress(int &key) override
        Definition: view_info.cpp:37
        +
        virtual void draw(void) override
        Definition: view_info.cpp:23
        diff --git a/docs/html/view__monitor_8cpp_source.html b/docs/html/view__monitor_8cpp_source.html index 90374ef..d9aa7e2 100644 --- a/docs/html/view__monitor_8cpp_source.html +++ b/docs/html/view__monitor_8cpp_source.html @@ -70,21 +70,30 @@ $(function() {
        view_monitor.cpp
        -
        1 #include "view_monitor.h"
        2 
        3 ViewMonitor::ViewMonitor() : t_worker(&ViewMonitor::worker, this)
        4 {
        5 }
        6 
        7 call_t ViewMonitor::keypress(int& key)
        8 {
        9  switch(key)
        10  {
        11 
        12  case KEY_MOUSE:
        13  {
        14  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        15  MEVENT event;
        16  bool hit = false;
        17  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        18  {
        19  size_t column = start_x + close_offset_x;
        20  size_t row = start_y + close_offset_y;
        21  size_t mouse_x = event.x, mouse_y = event.y;
        22  if(mouse_y == row && mouse_x >= column && mouse_x < column + label_close.length())
        23  hit = true;
        24  }
        25  if(!hit)
        26  break;
        27 
        28  // fall through to next case
        29  [[fallthrough]];
        30  }
        31  case KEY_ENT:
        32  run_worker = false;
        33  key = -1; // do return from view
        34  wclear(win);
        35  wrefresh(win);
        36  t_worker.join();
        37  break;
        38  default:
        39  break;
        40  }
        41  return calls[0];
        42 }
        43 
        44 std::string ViewMonitor::fancyDigitalString(uint8_t& b)
        45 {
        46  std::string bitstring(std::bitset<8>(b).to_string());
        47  // std::reverse(bitstring.begin(), bitstring.end()); nicht mehr notwendig, B15F invertiert automatisch den port
        48 
        49  std::stringstream str;
        50  str << bitstring;
        51  str << " ";
        52  str << "0x" << std::setfill ('0') << std::setw(2) << std::hex << (int) b << std::dec;
        53  return str.str();
        54 }
        55 
        56 std::string ViewMonitor::fancyAnalogString(uint16_t& v)
        57 {
        58  std::stringstream str;
        59  double volt = round(v * 100.0 * 5.0 / 1023.0) / 100.0;
        60 
        61  str << std::setfill ('0') << std::setw(4) << (int) v << " " << std::fixed << std::setprecision(2) << volt << " V ";
        62 
        63  str << "[";
        64  uint8_t p = round(v * 40.0 / 1023.0);
        65  for(uint8_t i = 0; i < p; i++)
        66  str << "X";
        67  for(uint8_t i = 0; i < 40 - p; i++)
        68  str << " ";
        69  str << "]" << std::endl;
        70 
        71  return str.str();
        72 }
        73 
        74 void ViewMonitor::worker()
        75 {
        76  B15F& drv = B15F::getInstance();
        77  while(run_worker)
        78  {
        79  try
        80  {
        81 
        82 #ifdef __arm__
        83  // Raspberry Pi is much slower
        84  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
        85 #else
        86  // normal PC is faster
        87  std::this_thread::sleep_for(std::chrono::milliseconds(100));
        88 #endif
        89 
        90  uint8_t be0 = drv.digitalRead0();
        91  uint8_t be1 = drv.digitalRead1();
        92  uint8_t dsw = drv.readDipSwitch();
        93  uint16_t adc[8];
        94  for(uint8_t i = 0; i < sizeof(adc) / sizeof(adc[0]); i++)
        95  adc[i] = drv.analogRead(i);
        96 
        97 
        98  std::stringstream str;
        99 
        100  // hline
        101  for(uint8_t i = 0; i < width - 2 * text_offset_x; i++)
        102  if(i % 2 == 0)
        103  str << "-";
        104  else
        105  str << " ";
        106  str << std::endl;
        107 
        108  str << "Digitale Enigaenge:" << std::endl;
        109  str << "Binaere Eingabe 0: " << fancyDigitalString(be0) << std::endl;
        110  str << "Binaere Eingabe 1: " << fancyDigitalString(be1) << std::endl;
        111  str << "Dip Schalter (S7): " << fancyDigitalString(dsw) << std::endl;
        112 
        113  // hline
        114  for(uint8_t i = 0; i < width - 2 * text_offset_x; i++)
        115  if(i % 2 == 0)
        116  str << "-";
        117  else
        118  str << " ";
        119  str << std::endl;
        120 
        121  str << "Analoge Eingaenge:" << std::endl;
        122  for(uint8_t i = 0; i < sizeof(adc) / sizeof(adc[0]); i++)
        123  {
        124  str << "Kanal " << std::to_string((int) i) << ": ";
        125  str << fancyAnalogString(adc[i]) << std::endl;
        126  }
        127 
        128  text = str.str();
        129  repaint();
        130  }
        131  catch(DriverException& ex)
        132  {
        133  std::cout << "DriverException: " << ex.what() << std::endl;
        134  drv.delay_ms(1000);
        135  }
        136  catch(...)
        137  {
        138  try
        139  {
        140  drv.reconnect();
        141  }
        142  catch(...)
        143  {
        144  B15F::abort("Die Verbindung ist unterbrochen worden. Wurde ein Stecker gezogen? :D");
        145  return;
        146  }
        147  }
        148  }
        149 }
        +
        1 #include "view_monitor.h"
        2 
        3 ViewMonitor::ViewMonitor() : t_worker(&ViewMonitor::worker, this)
        4 {
        5 }
        6 
        7 call_t ViewMonitor::keypress(int& key)
        8 {
        9  switch(key)
        10  {
        11 
        12  case KEY_MOUSE:
        13  {
        14  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        15  MEVENT event;
        16  bool hit = false;
        17  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        18  {
        19  size_t column = start_x + close_offset_x;
        20  size_t row = start_y + close_offset_y;
        21  size_t mouse_x = event.x, mouse_y = event.y;
        22  if(mouse_y == row && mouse_x >= column && mouse_x < column + label_close.length())
        23  hit = true;
        24  }
        25  if(!hit)
        26  break;
        27 
        28  // fall through to next case
        29  [[fallthrough]];
        30  }
        31  case KEY_ENT:
        32  run_worker = false;
        33  key = -1; // do return from view
        34  wclear(win);
        35  wrefresh(win);
        36  t_worker.join();
        37  break;
        38  default:
        39  break;
        40  }
        41  return calls[0];
        42 }
        43 
        44 std::string ViewMonitor::fancyDigitalString(uint8_t& b)
        45 {
        46  std::string bitstring(std::bitset<8>(b).to_string());
        47  // std::reverse(bitstring.begin(), bitstring.end()); nicht mehr notwendig, B15F invertiert automatisch den port
        48 
        49  std::stringstream str;
        50  str << bitstring;
        51  str << " ";
        52  str << "0x" << std::setfill ('0') << std::setw(2) << std::hex << (int) b << std::dec;
        53  return str.str();
        54 }
        55 
        56 std::string ViewMonitor::fancyAnalogString(uint16_t& v)
        57 {
        58  std::stringstream str;
        59  double volt = round(v * 100.0 * 5.0 / 1023.0) / 100.0;
        60 
        61  str << std::setfill ('0') << std::setw(4) << (int) v << " " << std::fixed << std::setprecision(2) << volt << " V ";
        62 
        63  str << "[";
        64  uint8_t p = round(v * 40.0 / 1023.0);
        65  for(uint8_t i = 0; i < p; i++)
        66  str << "X";
        67  for(uint8_t i = 0; i < 40 - p; i++)
        68  str << " ";
        69  str << "]" << std::endl;
        70 
        71  return str.str();
        72 }
        73 
        74 void ViewMonitor::worker()
        75 {
        76  B15F& drv = B15F::getInstance();
        77  while(run_worker)
        78  {
        79  try
        80  {
        81 
        82 #ifdef __arm__
        83  // Raspberry Pi is much slower
        84  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
        85 #else
        86  // normal PC is faster
        87  std::this_thread::sleep_for(std::chrono::milliseconds(100));
        88 #endif
        89 
        90  uint8_t be0 = drv.digitalRead0();
        91  uint8_t be1 = drv.digitalRead1();
        92  uint8_t dsw = drv.readDipSwitch();
        93  uint16_t adc[8];
        94  for(uint8_t i = 0; i < sizeof(adc) / sizeof(adc[0]); i++)
        95  adc[i] = drv.analogRead(i);
        96 
        97 
        98  std::stringstream str;
        99 
        100  // hline
        101  for(uint8_t i = 0; i < width - 2 * text_offset_x; i++)
        102  if(i % 2 == 0)
        103  str << "-";
        104  else
        105  str << " ";
        106  str << std::endl;
        107 
        108  str << "Digitale Enigaenge:" << std::endl;
        109  str << "Binaere Eingabe 0: " << fancyDigitalString(be0) << std::endl;
        110  str << "Binaere Eingabe 1: " << fancyDigitalString(be1) << std::endl;
        111  str << "Dip Schalter (S7): " << fancyDigitalString(dsw) << std::endl;
        112 
        113  // hline
        114  for(uint8_t i = 0; i < width - 2 * text_offset_x; i++)
        115  if(i % 2 == 0)
        116  str << "-";
        117  else
        118  str << " ";
        119  str << std::endl;
        120 
        121  str << "Analoge Eingaenge:" << std::endl;
        122  for(uint8_t i = 0; i < sizeof(adc) / sizeof(adc[0]); i++)
        123  {
        124  str << "Kanal " << std::to_string((int) i) << ": ";
        125  str << fancyAnalogString(adc[i]) << std::endl;
        126  }
        127 
        128  text = str.str();
        129  repaint();
        130  }
        131  catch(DriverException& ex)
        132  {
        133  std::cout << "DriverException: " << ex.what() << std::endl;
        134  drv.delay_ms(1000);
        135  }
        136  catch(...)
        137  {
        138  try
        139  {
        140  drv.reconnect();
        141  }
        142  catch(...)
        143  {
        144  B15F::abort("Die Verbindung ist unterbrochen worden. Wurde ein Stecker gezogen? :D");
        145  return;
        146  }
        147  }
        148  }
        149 }
        +
        virtual call_t keypress(int &key) override
        Definition: view_monitor.cpp:7
        +
        int width
        width of view in terminal characters
        Definition: view.h:79
        uint8_t digitalRead0(void)
        Definition: b15f.cpp:255
        +
        virtual const char * what() const
        uint8_t readDipSwitch(void)
        Definition: b15f.cpp:293
        void delay_ms(uint16_t ms)
        Definition: b15f.cpp:141
        +
        std::vector< call_t > calls
        calls (function pointers) for different button actions in the view (if any)
        Definition: view.h:84
        static B15F & getInstance(void)
        Definition: b15f.cpp:10
        Definition: b15f.h:38
        static void abort(std::string msg)
        Definition: b15f.cpp:175
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        uint16_t analogRead(uint8_t channel)
        Definition: b15f.cpp:346
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        uint8_t digitalRead1(void)
        Definition: b15f.cpp:274
        void reconnect(void)
        Definition: b15f.cpp:18
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        constexpr static int KEY_ENT
        Key value for the Enter key.
        Definition: view.h:87
        diff --git a/docs/html/view__monitor_8h_source.html b/docs/html/view__monitor_8h_source.html index 10d7674..7e69114 100644 --- a/docs/html/view__monitor_8h_source.html +++ b/docs/html/view__monitor_8h_source.html @@ -70,12 +70,13 @@ $(function() {
        view_monitor.h
        -
        1 #ifndef VIEW_MONITOR_H
        2 #define VIEW_MONITOR_H
        3 
        4 #include <thread>
        5 #include <chrono>
        6 #include <sstream>
        7 #include <bitset>
        8 #include "view_info.h"
        9 #include "../drv/b15f.h"
        10 
        13 class ViewMonitor : public ViewInfo
        14 {
        15 
        16 public:
        17  ViewMonitor(void);
        18  virtual call_t keypress(int& key) override;
        19 
        20 private:
        21  std::string fancyDigitalString(uint8_t& b);
        22  std::string fancyAnalogString(uint16_t& v);
        23 
        24 protected:
        25  virtual void worker(void);
        26  volatile bool run_worker = true;
        27  std::thread t_worker;
        28 
        29 };
        30 
        31 #endif // VIEW_MONITOR_H
        +
        1 #ifndef VIEW_MONITOR_H
        2 #define VIEW_MONITOR_H
        3 
        4 #include <thread>
        5 #include <chrono>
        6 #include <sstream>
        7 #include <bitset>
        8 #include "view_info.h"
        9 #include "../drv/b15f.h"
        10 
        13 class ViewMonitor : public ViewInfo
        14 {
        15 
        16 public:
        17  ViewMonitor(void);
        18  virtual call_t keypress(int& key) override;
        19 
        20 private:
        21  std::string fancyDigitalString(uint8_t& b);
        22  std::string fancyAnalogString(uint16_t& v);
        23 
        24 protected:
        25  virtual void worker(void);
        26  volatile bool run_worker = true;
        27  std::thread t_worker;
        28 
        29 };
        30 
        31 #endif // VIEW_MONITOR_H
        +
        virtual call_t keypress(int &key) override
        Definition: view_monitor.cpp:7
        diff --git a/docs/html/view__promt_8cpp_source.html b/docs/html/view__promt_8cpp_source.html index a60ee8f..96d56be 100644 --- a/docs/html/view__promt_8cpp_source.html +++ b/docs/html/view__promt_8cpp_source.html @@ -70,10 +70,20 @@ $(function() {
        view_promt.cpp
        -
        1 #include "view_promt.h"
        2 
        3 void ViewPromt::draw()
        4 {
        5  curs_set(1); // show cursor
        6 
        7  int li = text_offset_y;
        8  int ci = 0;
        9  for(std::string line : str_split(message + input, "\n"))
        10  {
        11  mvwprintw(win, ++li, text_offset_x, "%s", line.c_str());
        12  ci = line.length() + text_offset_x;
        13  }
        14 
        15  button_offset_x = (width - label_cancel.length() - sep.length() - label_confirm.length()) / 2;
        16  button_offset_y = height - text_offset_y;
        17 
        18  if(selection == 0)
        19  {
        20  wattron(win, A_REVERSE);
        21  mvwprintw(win, button_offset_y, button_offset_x, "%s", label_cancel.c_str());
        22  wattroff(win, A_REVERSE);
        23  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length(), "%s", sep.c_str());
        24  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length() + sep.length(), "%s", label_confirm.c_str());
        25  }
        26  else
        27  {
        28  mvwprintw(win, button_offset_y, button_offset_x, "%s", label_cancel.c_str());
        29  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length(), "%s", sep.c_str());
        30  wattron(win, A_REVERSE);
        31  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length() + sep.length(), "%s", label_confirm.c_str());
        32  wattroff(win, A_REVERSE);
        33  }
        34  wmove(win, li, ci);
        35 }
        36 
        37 void ViewPromt::setMessage(std::string message)
        38 {
        39  this->message = message;
        40 }
        41 
        42 void ViewPromt::setConfirm(std::string name, std::function<void(int)> call)
        43 {
        44  label_confirm = name;
        45  call_confirm = call;
        46 }
        47 
        48 void ViewPromt::setCancel(std::string name, bool cancelable)
        49 {
        50  label_cancel = name;
        51  this->cancelable = cancelable;
        52 }
        53 
        54 std::string ViewPromt::getInput()
        55 {
        56  return input;
        57 }
        58 
        59 std::function<void(int)> ViewPromt::keypress(int& key)
        60 {
        61  std::function<void(int)> ret = nullptr;
        62  switch(key)
        63  {
        64  case KEY_BACKSPACE:
        65  if(input.length())
        66  input.pop_back();
        67  break;
        68  case '\t':
        69  case KEY_LEFT:
        70  case KEY_RIGHT:
        71  selection = (selection + 1 ) % 2;
        72  break;
        73  case KEY_MOUSE:
        74  {
        75  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        76  MEVENT event;
        77  bool hit = false;
        78  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        79  {
        80  size_t column_start = start_x + button_offset_x;
        81  size_t row_start = start_y + button_offset_y;
        82  size_t mouse_x = event.x, mouse_y = event.y;
        83  if(mouse_y == row_start)
        84  {
        85  if(cancelable && mouse_x >= column_start && mouse_x < column_start + label_cancel.length())
        86  {
        87  if(selection == 0 || event.bstate & BUTTON1_DOUBLE_CLICKED)
        88  hit = true;
        89  selection = 0;
        90  }
        91  if(mouse_x >= column_start + label_cancel.length() + sep.length() && mouse_x < column_start + label_cancel.length() + sep.length() + label_confirm.length())
        92  {
        93  if(selection == 1 || event.bstate & BUTTON1_DOUBLE_CLICKED)
        94  hit = true;
        95  selection = 1;
        96  }
        97  }
        98  }
        99  if(!hit)
        100  break;
        101 
        102  // fall through to next case
        103  [[fallthrough]];
        104  }
        105  case KEY_ENT:
        106  if(selection == 0) // exit
        107  key = -1; // do return from view
        108  else
        109  ret = call_confirm;
        110  break;
        111  default:
        112  break;
        113  }
        114 
        115  if(key >= ' ' && key <= '~')
        116  input += (char) key;
        117 
        118  if(key != KEY_ENT)
        119  repaint();
        120  return ret;
        121 }
        +
        1 #include "view_promt.h"
        2 
        4 {
        5  curs_set(1); // show cursor
        6 
        7  int li = text_offset_y;
        8  int ci = 0;
        9  for(std::string line : str_split(message + input, "\n"))
        10  {
        11  mvwprintw(win, ++li, text_offset_x, "%s", line.c_str());
        12  ci = line.length() + text_offset_x;
        13  }
        14 
        15  button_offset_x = (width - label_cancel.length() - sep.length() - label_confirm.length()) / 2;
        16  button_offset_y = height - text_offset_y;
        17 
        18  if(selection == 0)
        19  {
        20  wattron(win, A_REVERSE);
        21  mvwprintw(win, button_offset_y, button_offset_x, "%s", label_cancel.c_str());
        22  wattroff(win, A_REVERSE);
        23  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length(), "%s", sep.c_str());
        24  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length() + sep.length(), "%s", label_confirm.c_str());
        25  }
        26  else
        27  {
        28  mvwprintw(win, button_offset_y, button_offset_x, "%s", label_cancel.c_str());
        29  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length(), "%s", sep.c_str());
        30  wattron(win, A_REVERSE);
        31  mvwprintw(win, button_offset_y, button_offset_x + label_cancel.length() + sep.length(), "%s", label_confirm.c_str());
        32  wattroff(win, A_REVERSE);
        33  }
        34  wmove(win, li, ci);
        35 }
        36 
        37 void ViewPromt::setMessage(std::string message)
        38 {
        39  this->message = message;
        40 }
        41 
        42 void ViewPromt::setConfirm(std::string name, std::function<void(int)> call)
        43 {
        44  label_confirm = name;
        45  call_confirm = call;
        46 }
        47 
        48 void ViewPromt::setCancel(std::string name, bool cancelable)
        49 {
        50  label_cancel = name;
        51  this->cancelable = cancelable;
        52 }
        53 
        54 std::string ViewPromt::getInput()
        55 {
        56  return input;
        57 }
        58 
        59 std::function<void(int)> ViewPromt::keypress(int& key)
        60 {
        61  std::function<void(int)> ret = nullptr;
        62  switch(key)
        63  {
        64  case KEY_BACKSPACE:
        65  if(input.length())
        66  input.pop_back();
        67  break;
        68  case '\t':
        69  case KEY_LEFT:
        70  case KEY_RIGHT:
        71  selection = (selection + 1 ) % 2;
        72  break;
        73  case KEY_MOUSE:
        74  {
        75  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        76  MEVENT event;
        77  bool hit = false;
        78  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        79  {
        80  size_t column_start = start_x + button_offset_x;
        81  size_t row_start = start_y + button_offset_y;
        82  size_t mouse_x = event.x, mouse_y = event.y;
        83  if(mouse_y == row_start)
        84  {
        85  if(cancelable && mouse_x >= column_start && mouse_x < column_start + label_cancel.length())
        86  {
        87  if(selection == 0 || event.bstate & BUTTON1_DOUBLE_CLICKED)
        88  hit = true;
        89  selection = 0;
        90  }
        91  if(mouse_x >= column_start + label_cancel.length() + sep.length() && mouse_x < column_start + label_cancel.length() + sep.length() + label_confirm.length())
        92  {
        93  if(selection == 1 || event.bstate & BUTTON1_DOUBLE_CLICKED)
        94  hit = true;
        95  selection = 1;
        96  }
        97  }
        98  }
        99  if(!hit)
        100  break;
        101 
        102  // fall through to next case
        103  [[fallthrough]];
        104  }
        105  case KEY_ENT:
        106  if(selection == 0) // exit
        107  key = -1; // do return from view
        108  else
        109  ret = call_confirm;
        110  break;
        111  default:
        112  break;
        113  }
        114 
        115  if(key >= ' ' && key <= '~')
        116  input += (char) key;
        117 
        118  if(key != KEY_ENT)
        119  repaint();
        120  return ret;
        121 }
        +
        int height
        height of view in terminal characters
        Definition: view.h:80
        +
        int width
        width of view in terminal characters
        Definition: view.h:79
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        +
        static std::vector< std::string > str_split(const std::string &str, const std::string delim)
        Definition: view.cpp:30
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        +
        virtual void draw(void) override
        Definition: view_promt.cpp:3
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        virtual call_t keypress(int &key) override
        Definition: view_promt.cpp:59
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        constexpr static int KEY_ENT
        Key value for the Enter key.
        Definition: view.h:87
        diff --git a/docs/html/view__promt_8h_source.html b/docs/html/view__promt_8h_source.html index 2c8b9d1..b49ec2b 100644 --- a/docs/html/view__promt_8h_source.html +++ b/docs/html/view__promt_8h_source.html @@ -70,12 +70,14 @@ $(function() {
        view_promt.h
        -
        1 #ifndef VIEW_PROMT_H
        2 #define VIEW_PROMT_H
        3 
        4 #include <vector>
        5 #include <string>
        6 #include "view.h"
        7 
        10 class ViewPromt : public View
        11 {
        12 public:
        13  virtual void draw(void) override;
        14  virtual void setMessage(std::string message);
        15  virtual void setConfirm(std::string name, call_t call);
        16  virtual void setCancel(std::string name, bool cancelable);
        17  virtual std::string getInput(void);
        18  virtual call_t keypress(int& key) override;
        19 
        20 protected:
        21  size_t selection = 1;
        22  std::string input;
        23  std::string message = "Input";
        24  std::string label_confirm = "[ OK ]";
        25  std::string sep = " ";
        26  std::string label_cancel = "[ Cancel ]";
        27  call_t call_confirm = nullptr;
        28  bool cancelable = true;
        29  int button_offset_x = 0, button_offset_y = 0;
        30  constexpr static int text_offset_x = 2;
        31  constexpr static int text_offset_y = 2;
        32 };
        33 
        34 #endif // VIEW_PROMT_H
        +
        1 #ifndef VIEW_PROMT_H
        2 #define VIEW_PROMT_H
        3 
        4 #include <vector>
        5 #include <string>
        6 #include "view.h"
        7 
        10 class ViewPromt : public View
        11 {
        12 public:
        13  virtual void draw(void) override;
        14  virtual void setMessage(std::string message);
        15  virtual void setConfirm(std::string name, call_t call);
        16  virtual void setCancel(std::string name, bool cancelable);
        17  virtual std::string getInput(void);
        18  virtual call_t keypress(int& key) override;
        19 
        20 protected:
        21  size_t selection = 1;
        22  std::string input;
        23  std::string message = "Input";
        24  std::string label_confirm = "[ OK ]";
        25  std::string sep = " ";
        26  std::string label_cancel = "[ Cancel ]";
        27  call_t call_confirm = nullptr;
        28  bool cancelable = true;
        29  int button_offset_x = 0, button_offset_y = 0;
        30  constexpr static int text_offset_x = 2;
        31  constexpr static int text_offset_y = 2;
        32 };
        33 
        34 #endif // VIEW_PROMT_H
        Definition: view.h:19
        +
        virtual void draw(void) override
        Definition: view_promt.cpp:3
        +
        virtual call_t keypress(int &key) override
        Definition: view_promt.cpp:59
        diff --git a/docs/html/view__selection_8cpp_source.html b/docs/html/view__selection_8cpp_source.html index 32272fb..7b7746a 100644 --- a/docs/html/view__selection_8cpp_source.html +++ b/docs/html/view__selection_8cpp_source.html @@ -70,10 +70,18 @@ $(function() {
        view_selection.cpp
        -
        1 #include "view_selection.h"
        2 
        3 void ViewSelection::draw()
        4 {
        5  //curs_set(0); // hide cursor
        6  for(size_t i = 0; i < choices.size(); i++)
        7  {
        8  if(selection == i)
        9  wattron(win, A_REVERSE);
        10  mvwprintw(win, i + choice_offset_y, choice_offset_x, "%s", choices[i].c_str());
        11  if(selection == i)
        12  wattroff(win, A_REVERSE);
        13  }
        14 }
        15 
        16 void ViewSelection::addChoice(std::string name, call_t call)
        17 {
        18  choices.push_back(name);
        19  calls.push_back(call);
        20 }
        21 
        22 call_t ViewSelection::keypress(int& key)
        23 {
        24  call_t ret = nullptr;
        25  switch(key)
        26  {
        27  case KEY_UP:
        28  do
        29  selection = (selection - 1 + choices.size()) % choices.size();
        30  while(!choices[selection].length() && choices.size());
        31  break;
        32 
        33  case '\t':
        34  case KEY_DOWN:
        35  do
        36  selection = (selection + 1) % choices.size();
        37  while(!choices[selection].length() && choices.size());
        38  break;
        39 
        40  case KEY_MOUSE:
        41  {
        42  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        43  MEVENT event;
        44  bool hit = false;
        45  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        46  {
        47  size_t column_start = start_x + choice_offset_x;
        48  size_t row_start = start_y + choice_offset_y;
        49  size_t mouse_x = event.x, mouse_y = event.y;
        50  for(size_t i = 0; i < choices.size(); i++)
        51  if(choices[i].length() && mouse_y == row_start + i && mouse_x >= column_start && mouse_x < column_start + choices[i].length())
        52  {
        53  if(selection == i || event.bstate & BUTTON1_DOUBLE_CLICKED)
        54  hit = true;
        55  selection = i;
        56  }
        57  }
        58  if(!hit)
        59  break;
        60 
        61  // fall through to next case
        62  [[fallthrough]];
        63  }
        64 
        65  case KEY_ENT:
        66  if(selection == choices.size() - 1) // exit
        67  key = -1; // do return from view
        68  else
        69  ret = calls[selection];
        70  break;
        71  default:
        72  break;
        73  }
        74  repaint();
        75  return ret;
        76 }
        +
        1 #include "view_selection.h"
        2 
        4 {
        5  //curs_set(0); // hide cursor
        6  for(size_t i = 0; i < choices.size(); i++)
        7  {
        8  if(selection == i)
        9  wattron(win, A_REVERSE);
        10  mvwprintw(win, i + choice_offset_y, choice_offset_x, "%s", choices[i].c_str());
        11  if(selection == i)
        12  wattroff(win, A_REVERSE);
        13  }
        14 }
        15 
        16 void ViewSelection::addChoice(std::string name, call_t call)
        17 {
        18  choices.push_back(name);
        19  calls.push_back(call);
        20 }
        21 
        22 call_t ViewSelection::keypress(int& key)
        23 {
        24  call_t ret = nullptr;
        25  switch(key)
        26  {
        27  case KEY_UP:
        28  do
        29  selection = (selection - 1 + choices.size()) % choices.size();
        30  while(!choices[selection].length() && choices.size());
        31  break;
        32 
        33  case '\t':
        34  case KEY_DOWN:
        35  do
        36  selection = (selection + 1) % choices.size();
        37  while(!choices[selection].length() && choices.size());
        38  break;
        39 
        40  case KEY_MOUSE:
        41  {
        42  // http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
        43  MEVENT event;
        44  bool hit = false;
        45  if(getmouse(&event) == OK && event.bstate & (BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED))
        46  {
        47  size_t column_start = start_x + choice_offset_x;
        48  size_t row_start = start_y + choice_offset_y;
        49  size_t mouse_x = event.x, mouse_y = event.y;
        50  for(size_t i = 0; i < choices.size(); i++)
        51  if(choices[i].length() && mouse_y == row_start + i && mouse_x >= column_start && mouse_x < column_start + choices[i].length())
        52  {
        53  if(selection == i || event.bstate & BUTTON1_DOUBLE_CLICKED)
        54  hit = true;
        55  selection = i;
        56  }
        57  }
        58  if(!hit)
        59  break;
        60 
        61  // fall through to next case
        62  [[fallthrough]];
        63  }
        64 
        65  case KEY_ENT:
        66  if(selection == choices.size() - 1) // exit
        67  key = -1; // do return from view
        68  else
        69  ret = calls[selection];
        70  break;
        71  default:
        72  break;
        73  }
        74  repaint();
        75  return ret;
        76 }
        +
        std::vector< call_t > calls
        calls (function pointers) for different button actions in the view (if any)
        Definition: view.h:84
        +
        static WINDOW * win
        static window contexts for all views
        Definition: view.h:86
        +
        virtual void repaint(void)
        Definition: view.cpp:52
        +
        virtual call_t keypress(int &key) override
        +
        int start_x
        x offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:81
        +
        int start_y
        y offset (characters) in the terminal, used to center the window on repaint()
        Definition: view.h:82
        +
        virtual void draw(void) override
        +
        constexpr static int KEY_ENT
        Key value for the Enter key.
        Definition: view.h:87
        diff --git a/docs/html/view__selection_8h_source.html b/docs/html/view__selection_8h_source.html index fbfb1bb..95eb6af 100644 --- a/docs/html/view__selection_8h_source.html +++ b/docs/html/view__selection_8h_source.html @@ -70,12 +70,14 @@ $(function() {
        view_selection.h
        -
        1 #ifndef VIEW_SELECTION_H
        2 #define VIEW_SELECTION_H
        3 
        4 #include <vector>
        5 #include <string>
        6 #include "view.h"
        7 
        10 class ViewSelection : public View
        11 {
        12 public:
        13  virtual void draw(void) override;
        14  virtual void addChoice(std::string name, call_t call);
        15  virtual call_t keypress(int& key) override;
        16 
        17 
        18 protected:
        19  size_t selection = 0;
        20  std::vector<std::string> choices;
        21 
        22  constexpr static int choice_offset_x = 2;
        23  constexpr static int choice_offset_y = 3;
        24 };
        25 
        26 #endif // VIEW_SELECTION_H
        +
        1 #ifndef VIEW_SELECTION_H
        2 #define VIEW_SELECTION_H
        3 
        4 #include <vector>
        5 #include <string>
        6 #include "view.h"
        7 
        10 class ViewSelection : public View
        11 {
        12 public:
        13  virtual void draw(void) override;
        14  virtual void addChoice(std::string name, call_t call);
        15  virtual call_t keypress(int& key) override;
        16 
        17 
        18 protected:
        19  size_t selection = 0;
        20  std::vector<std::string> choices;
        21 
        22  constexpr static int choice_offset_x = 2;
        23  constexpr static int choice_offset_y = 3;
        24 };
        25 
        26 #endif // VIEW_SELECTION_H
        Definition: view.h:19
        +
        virtual call_t keypress(int &key) override
        +
        virtual void draw(void) override