diff --git a/README.md b/README.md index fd9de38..e24e2e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # B15F - Board 15 Famulus Edition -**Hinweis:** -Die Projekt-Dokumentation befindet sich unter [github pages](https://devfix.github.io/b15f/). +## Dokumentation +Die **Projekt-Dokumentation** befindet sich hier: [https://devfix.github.io/b15f/](https://devfix.github.io/b15f/). ## TODO / Ideen - [X] CLI: Exception catchen, set global error message, raise SIGINT --> ncurses wird richtig beendet diff --git a/control/src/drv/commit_hash.h b/control/src/drv/commit_hash.h index 0d3bd44..904524a 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[] = "9640bb00c8b16073af9eadf9e40ede3c2e0e4020"; +const char COMMIT_HASH[] = "be3545fcbb7c7a41ec40d489efc952369f81bf5a"; #endif // COMMIT_HASH_H diff --git a/control/src/ui/view_info.h b/control/src/ui/view_info.h index 7a3eb4b..903b2f3 100644 --- a/control/src/ui/view_info.h +++ b/control/src/ui/view_info.h @@ -3,25 +3,57 @@ #include "view.h" -/*! View for simple text message output. */ +/** + * Klasse für einfache Textausgaben (Benachrichtigungen). + * Diese können mit einem Button geschlossen werden. + */ class ViewInfo : public View { public: + /** + * Standard-Konstruktor ohne Argumente + */ ViewInfo(void); + + /** + * Setzt den Text dieser Benachrichtigungs-View + * \param text Text der View + */ virtual void setText(std::string text); - virtual void setLabelClose(std::string label);; + + /** + * Setzt die Beschriftung des Buttons zum Schließen + * \param label Beschriftung des Buttons + */ + virtual void setLabelClose(std::string label); + + /** + * Setzt den Call der aufgerufen wird, wenn der Button angewählt wird. + * Wurde setCall weggelassen oder setCall(nullptr) gesetzt, wird diese View nur geschlossen und keine weitere Aktion ausgelöst. + * \param call Nachfolge-Aktion + */ virtual void setCall(call_t call); + + /** + * Zeichnet diese View mit dem Benachrichtigungstext. + */ virtual void draw(void) override; + + /** + * Verarbeitet einen Tastendruck, z.B. Enter = Button angewählt. + * \param key gedrückte Taste + * \return Call, der nach dem keypress ausgeführt werden soll + */ virtual call_t keypress(int& key) override; protected: - std::string text; - std::string label_close; - int close_offset_x = 0; - int close_offset_y = 0; - constexpr static int text_offset_x = 2; - constexpr static int text_offset_y = 3; + std::string text; //!< Benachrichtigungstext dieser View + std::string label_close; //!< Beschriftung für Button zum Schließen + int close_offset_x = 0; //!< Relative X Koordinate des Buttons zum Schließen im Window + int close_offset_y = 0; //!< Relative Y Koordinate des Buttons zum Schließen im Window + constexpr static int text_offset_x = 2; //!< Relativer Abstand des Textes zum linken Rahmen + constexpr static int text_offset_y = 3; //!< Relativer Abstand des Textes zum oberen Rahmen }; #endif // VIEW_INFO diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 3c75bdc..42e0e7e 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 c16b11c..3df8b32 100644 --- a/docs/html/b15f_8cpp_source.html +++ b/docs/html/b15f_8cpp_source.html @@ -121,7 +121,7 @@ $(function() {
DriverException
Definition: driverexception.h:10
diff --git a/docs/html/b15f_8h_source.html b/docs/html/b15f_8h_source.html index 1f7ab2b..18c842a 100644 --- a/docs/html/b15f_8h_source.html +++ b/docs/html/b15f_8h_source.html @@ -117,7 +117,7 @@ $(function() {
DriverException
Definition: driverexception.h:10
diff --git a/docs/html/classB15F-members.html b/docs/html/classB15F-members.html index 40b8468..9546393 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 5f95f3a..c82b4b2 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 0f0670f..8a9f3c5 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 3759bcf..f04fbd9 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 44455f3..835b92d 100644 --- a/docs/html/classDriverException-members.html +++ b/docs/html/classDriverException-members.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/html/classDriverException.html b/docs/html/classDriverException.html index 688ef0a..129358d 100644 --- a/docs/html/classDriverException.html +++ b/docs/html/classDriverException.html @@ -247,7 +247,7 @@ std::string  diff --git a/docs/html/classPlottyFile-members.html b/docs/html/classPlottyFile-members.html index 3a36954..7344642 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 f9b3f83..ca14873 100644 --- a/docs/html/classPlottyFile.html +++ b/docs/html/classPlottyFile.html @@ -811,7 +811,7 @@ Public Member Functions diff --git a/docs/html/classTimeoutException-members.html b/docs/html/classTimeoutException-members.html index 850108d..ed75098 100644 --- a/docs/html/classTimeoutException-members.html +++ b/docs/html/classTimeoutException-members.html @@ -77,7 +77,7 @@ $(function() { diff --git a/docs/html/classTimeoutException.html b/docs/html/classTimeoutException.html index 26950b0..4794db7 100644 --- a/docs/html/classTimeoutException.html +++ b/docs/html/classTimeoutException.html @@ -239,7 +239,7 @@ std::string  diff --git a/docs/html/classUSART-members.html b/docs/html/classUSART-members.html index a1bd4a2..fd40572 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 26b6c3e..452cae6 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 ab4bbff..177d5c4 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 67a3ecf..804be23 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 1e17025..b8890ee 100644 --- a/docs/html/classView-members.html +++ b/docs/html/classView-members.html @@ -89,7 +89,7 @@ $(function() { diff --git a/docs/html/classView.html b/docs/html/classView.html index 9546d4c..6299c49 100644 --- a/docs/html/classView.html +++ b/docs/html/classView.html @@ -290,7 +290,7 @@ constexpr static int 

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.

+

Implemented in ViewInfo, ViewMonitor, ViewPromt, and ViewSelection.

@@ -444,7 +444,7 @@ constexpr static int  diff --git a/docs/html/classViewInfo-members.html b/docs/html/classViewInfo-members.html index 38c18f2..bdbd8a1 100644 --- a/docs/html/classViewInfo-members.html +++ b/docs/html/classViewInfo-members.html @@ -70,36 +70,36 @@ $(function() {

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

- - + + - + - - - + + + - - - + + + - +
callsViewprotected
close_offset_x (defined in ViewInfo)ViewInfoprotected
close_offset_y (defined in ViewInfo)ViewInfoprotected
close_offset_xViewInfoprotected
close_offset_yViewInfoprotected
draw(void) overrideViewInfovirtual
getWinContext(void)Viewstatic
heightViewprotected
KEY_ENTViewprotectedstatic
keypress(int &key) overrideViewInfovirtual
label_close (defined in ViewInfo)ViewInfoprotected
label_closeViewInfoprotected
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
setCall(call_t call)ViewInfovirtual
setLabelClose(std::string label)ViewInfovirtual
setText(std::string text)ViewInfovirtual
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
textViewInfoprotected
text_offset_xViewInfoprotectedstatic
text_offset_yViewInfoprotectedstatic
titleViewprotected
View(void)View
ViewInfo(void) (defined in ViewInfo)ViewInfo
ViewInfo(void)ViewInfo
widthViewprotected
winViewprotectedstatic
~View(void)Viewvirtual
diff --git a/docs/html/classViewInfo.html b/docs/html/classViewInfo.html index ae43c44..eebd3a2 100644 --- a/docs/html/classViewInfo.html +++ b/docs/html/classViewInfo.html @@ -88,14 +88,13 @@ $(function() { - + + + - + - + @@ -114,16 +113,20 @@ virtual void  +std::string  + +std::string  + +int  + +int  + +constexpr static int  + +constexpr static int  +

Public Member Functions

-virtual void setText (std::string text)
 ViewInfo (void)
 
virtual void setText (std::string text)
 
-virtual void setLabelClose (std::string label)
virtual void setLabelClose (std::string label)
 
-virtual void setCall (call_t call)
virtual void setCall (call_t call)
 
virtual void draw (void) override
 
setCall (

Protected Attributes

-std::string text
text
 Benachrichtigungstext dieser View.
 
-std::string label_close
label_close
 Beschriftung für Button zum Schließen.
 
-int close_offset_x = 0
close_offset_x = 0
 Relative X Koordinate des Buttons zum Schließen im Window.
 
-int close_offset_y = 0
close_offset_y = 0
 Relative Y Koordinate des Buttons zum Schließen im Window.
 
- Protected Attributes inherited from View
@@ -154,10 +157,12 @@ std::vector< call_t > <

Static Protected Attributes

-constexpr static int text_offset_x = 2
text_offset_x = 2
 Relativer Abstand des Textes zum linken Rahmen.
 
-constexpr static int text_offset_y = 3
text_offset_y = 3
 Relativer Abstand des Textes zum oberen Rahmen.
 
- Static Protected Attributes inherited from View
@@ -180,10 +185,32 @@ Additional Inherited Members
 

Detailed Description

-

View for simple text message output.

+

Klasse für einfache Textausgaben (Benachrichtigungen). Diese können mit einem Button geschlossen werden.

-

Definition at line 8 of file view_info.h.

-

Member Function Documentation

+

Definition at line 11 of file view_info.h.

+

Constructor & Destructor Documentation

+ +

◆ ViewInfo()

+ +
+
+ + + + + + + + +
ViewInfo::ViewInfo (void )
+
+

Standard-Konstruktor ohne Argumente

+ +

Definition at line 3 of file view_info.cpp.

+ +
+
+

Member Function Documentation

◆ draw()

@@ -207,7 +234,7 @@ Additional Inherited Members
-

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

+

Zeichnet diese View mit dem Benachrichtigungstext.

Implements View.

@@ -238,7 +265,13 @@ Additional Inherited Members
-

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

+

Verarbeitet einen Tastendruck, z.B. Enter = Button angewählt.

Parameters
+ + +
keygedrückte Taste
+
+
+
Returns
Call, der nach dem keypress ausgeführt werden soll

Implements View.

@@ -246,6 +279,108 @@ Additional Inherited Members

Definition at line 37 of file view_info.cpp.

+
+ + +

◆ setCall()

+ +
+
+ + + + + +
+ + + + + + + + +
void ViewInfo::setCall (call_t call)
+
+virtual
+
+

Setzt den Call der aufgerufen wird, wenn der Button angewählt wird. Wurde setCall weggelassen oder setCall(nullptr) gesetzt, wird diese View nur geschlossen und keine weitere Aktion ausgelöst.

Parameters
+ + +
callNachfolge-Aktion
+
+
+ +

Definition at line 18 of file view_info.cpp.

+ +
+
+ +

◆ setLabelClose()

+ +
+
+ + + + + +
+ + + + + + + + +
void ViewInfo::setLabelClose (std::string label)
+
+virtual
+
+

Setzt die Beschriftung des Buttons zum Schließen

Parameters
+ + +
labelBeschriftung des Buttons
+
+
+ +

Definition at line 13 of file view_info.cpp.

+ +
+
+ +

◆ setText()

+ +
+
+ + + + + +
+ + + + + + + + +
void ViewInfo::setText (std::string text)
+
+virtual
+
+

Setzt den Text dieser Benachrichtigungs-View

Parameters
+ + +
textText der View
+
+
+ +

Definition at line 8 of file view_info.cpp.

+

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

- l -

+ +

- m -

@@ -443,6 +474,9 @@ $(function() {
  • View() : View
  • +
  • ViewInfo() +: ViewInfo +
  • @@ -487,7 +521,7 @@ $(function() { diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index e0e5f89..63ae921 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -286,6 +286,9 @@ $(function() {
  • setBaudrate() : USART
  • +
  • setCall() +: ViewInfo +
  • setDescPara() : PlottyFile
  • @@ -298,6 +301,9 @@ $(function() {
  • setFunctionType() : PlottyFile
  • +
  • setLabelClose() +: ViewInfo +
  • setMem16() : B15F
  • @@ -331,6 +337,9 @@ $(function() {
  • setServoPosition() : B15F
  • +
  • setText() +: ViewInfo +
  • setTimeout() : USART
  • @@ -388,6 +397,9 @@ $(function() {
  • View() : View
  • +
  • ViewInfo() +: ViewInfo +
  • @@ -423,7 +435,7 @@ $(function() { diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index ccfc3e6..2151bdd 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -69,12 +69,21 @@ $(function() {
  • calls : View
  • +
  • close_offset_x +: ViewInfo +
  • +
  • close_offset_y +: ViewInfo +
  • height : View
  • KEY_ENT : View
  • +
  • label_close +: ViewInfo +
  • msg : USARTException
  • @@ -103,6 +112,15 @@ $(function() {
  • start_y : View
  • +
  • text +: ViewInfo +
  • +
  • text_offset_x +: ViewInfo +
  • +
  • text_offset_y +: ViewInfo +
  • title : View
  • @@ -119,7 +137,7 @@ $(function() { diff --git a/docs/html/hierarchy.html b/docs/html/hierarchy.html index e6c48e9..1a89836 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 e88cb50..0d38f71 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -82,7 +82,7 @@ Außerdem wird eine Bibliothek (b15fdrv) installiert, die eine einfache 2 Installation

    2.1 Installation mit Installationsscript (empfohlen)

    -

    (a) Laden Sie das Installationsscript herunter, am besten nach **/tmp/**
    +

    (a) Laden Sie das Installationsscript herunter, am besten nach ** /tmp/**
    (b) Setzen Sie die Ausführungsberechtigung
    (c) Schalten Sie die Stromversorgung von B15 an und schließen Sie den ISP Programmer an
    (d) Starten Sie das Installationsscript
    @@ -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 e2fe8f5..1d5d79f 100644 --- a/docs/html/menudata.js +++ b/docs/html/menudata.js @@ -37,6 +37,7 @@ var menudata={children:[ {text:"g",url:"functions.html#index_g"}, {text:"h",url:"functions.html#index_h"}, {text:"k",url:"functions.html#index_k"}, +{text:"l",url:"functions.html#index_l"}, {text:"m",url:"functions.html#index_m"}, {text:"o",url:"functions.html#index_o"}, {text:"p",url:"functions.html#index_p"}, diff --git a/docs/html/plottyfile_8cpp_source.html b/docs/html/plottyfile_8cpp_source.html index 28382f0..baa0b4b 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 f7ab107..62ac267 100644 --- a/docs/html/plottyfile_8h_source.html +++ b/docs/html/plottyfile_8h_source.html @@ -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 fc05140..eff5feb 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 ca1b57d..7e9d9bc 100644 --- a/docs/html/search/all_10.js +++ b/docs/html/search/all_10.js @@ -1,8 +1,5 @@ var searchData= [ - ['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,'']]] + ['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/all_11.js b/docs/html/search/all_11.js index 4f5cf1d..7f009ca 100644 --- a/docs/html/search/all_11.js +++ b/docs/html/search/all_11.js @@ -1,8 +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']]] + ['view',['View',['../classView.html',1,'View'],['../classView.html#a0a9be6e5fb588412aab31cacf5e43b04',1,'View::View()']]], + ['viewinfo',['ViewInfo',['../classViewInfo.html',1,'ViewInfo'],['../classViewInfo.html#a95a3a81de65ef42615bbe5a843e8d5f6',1,'ViewInfo::ViewInfo()']]], + ['viewmonitor',['ViewMonitor',['../classViewMonitor.html',1,'']]], + ['viewpromt',['ViewPromt',['../classViewPromt.html',1,'']]], + ['viewselection',['ViewSelection',['../classViewSelection.html',1,'']]] ]; diff --git a/docs/html/search/all_12.js b/docs/html/search/all_12.js index b756d4d..4f5cf1d 100644 --- a/docs/html/search/all_12.js +++ b/docs/html/search/all_12.js @@ -1,8 +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']]] + ['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_13.html b/docs/html/search/all_13.html new file mode 100644 index 0000000..7e5f42a --- /dev/null +++ b/docs/html/search/all_13.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/docs/html/search/all_13.js b/docs/html/search/all_13.js new file mode 100644 index 0000000..b756d4d --- /dev/null +++ b/docs/html/search/all_13.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 5f43282..8318d90 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -3,5 +3,7 @@ var searchData= ['calls',['calls',['../classView.html#a610367214a727e2f7da72ac5bdb60fa3',1,'View']]], ['clearinputbuffer',['clearInputBuffer',['../classUSART.html#a28a2b4c5ed66b2c3a81196f76884f156',1,'USART']]], ['clearoutputbuffer',['clearOutputBuffer',['../classUSART.html#a756d268a8762c316f91ca3238972b0c1',1,'USART']]], + ['close_5foffset_5fx',['close_offset_x',['../classViewInfo.html#ae4dab70d82761e0f59f51dcae79685fe',1,'ViewInfo']]], + ['close_5foffset_5fy',['close_offset_y',['../classViewInfo.html#a5954adf853cb44d4655ede731faf1a28',1,'ViewInfo']]], ['closedevice',['closeDevice',['../classUSART.html#af80d6291ac1d2df04cfa1d8d27458cc5',1,'USART']]] ]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js index 9a8efba..b6889fd 100644 --- a/docs/html/search/all_9.js +++ b/docs/html/search/all_9.js @@ -1,7 +1,4 @@ var searchData= [ - ['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']]] + ['label_5fclose',['label_close',['../classViewInfo.html#a34879bd1c0a8fe230429cc600dcd6739',1,'ViewInfo']]] ]; diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js index bd75d34..9a8efba 100644 --- a/docs/html/search/all_a.js +++ b/docs/html/search/all_a.js @@ -1,4 +1,7 @@ var searchData= [ - ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] + ['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_b.js b/docs/html/search/all_b.js index 26e6d28..bd75d34 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -1,7 +1,4 @@ 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']]] + ['opendevice',['openDevice',['../classUSART.html#a5f7e2abda2ec4a68a5fdb8ee2f8a940a',1,'USART']]] ]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js index 2c0fc33..26e6d28 100644 --- a/docs/html/search/all_c.js +++ b/docs/html/search/all_c.js @@ -1,10 +1,7 @@ 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']]], - ['repaint',['repaint',['../classView.html#aa7b1f1179e3c4f06bef1e99355d0d592',1,'View']]], - ['reverse',['reverse',['../classB15F.html#a2937f22f1cfc9b533f4b5bf4db726a68',1,'B15F']]] + ['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_d.js b/docs/html/search/all_d.js index be4f36c..2c0fc33 100644 --- a/docs/html/search/all_d.js +++ b/docs/html/search/all_d.js @@ -1,30 +1,10 @@ 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']]], - ['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']]] + ['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_e.js b/docs/html/search/all_e.js index 98b4476..af390b1 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -1,8 +1,33 @@ 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)']]], - ['title',['title',['../classView.html#a80441aa81b52e04677a2aa2bd9c47753',1,'View']]], - ['transmit',['transmit',['../classUSART.html#a41b19dd58f307015b73e154048cd74ca',1,'USART']]] + ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], + ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], + ['setcall',['setCall',['../classViewInfo.html#a45fd0b8b96d15fd92824ce63fb6814ca',1,'ViewInfo']]], + ['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']]], + ['setlabelclose',['setLabelClose',['../classViewInfo.html#a4c3db4806515ea8b0f07a9864f983377',1,'ViewInfo']]], + ['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']]], + ['settext',['setText',['../classViewInfo.html#abc93067b319df17e19f013a86d762f81',1,'ViewInfo']]], + ['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_f.js b/docs/html/search/all_f.js index 7e9d9bc..5d93e26 100644 --- a/docs/html/search/all_f.js +++ b/docs/html/search/all_f.js @@ -1,5 +1,11 @@ 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)']]] + ['testconnection',['testConnection',['../classB15F.html#a6b8c7da1fb9b619543844e0ce7597d83',1,'B15F']]], + ['testintconv',['testIntConv',['../classB15F.html#ac2c7b6d84da5239ee7cc3d44e689d9db',1,'B15F']]], + ['text',['text',['../classViewInfo.html#ac392a569ef16af3dc11ee659f3fa1eb4',1,'ViewInfo']]], + ['text_5foffset_5fx',['text_offset_x',['../classViewInfo.html#a4681a8138f17ea229aca02e6db7357cd',1,'ViewInfo']]], + ['text_5foffset_5fy',['text_offset_y',['../classViewInfo.html#a34a9239c8954a0c27a22cf44d112f5b8',1,'ViewInfo']]], + ['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/functions_a.js b/docs/html/search/functions_a.js index 3b2411d..57a3b55 100644 --- a/docs/html/search/functions_a.js +++ b/docs/html/search/functions_a.js @@ -2,10 +2,12 @@ var searchData= [ ['setaborthandler',['setAbortHandler',['../classB15F.html#a55b0cd1ea582bda53d6979442640f8e9',1,'B15F']]], ['setbaudrate',['setBaudrate',['../classUSART.html#aac63918a8b97ae63ee607cfa39e6d88d',1,'USART']]], + ['setcall',['setCall',['../classViewInfo.html#a45fd0b8b96d15fd92824ce63fb6814ca',1,'ViewInfo']]], ['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']]], + ['setlabelclose',['setLabelClose',['../classViewInfo.html#a4c3db4806515ea8b0f07a9864f983377',1,'ViewInfo']]], ['setmem16',['setMem16',['../classB15F.html#a62ef2ee9bd945d30979939fcffa6759a',1,'B15F']]], ['setmem8',['setMem8',['../classB15F.html#a65c0eee6b40b6d3ec58b0335fd668503',1,'B15F']]], ['setparafirstcurve',['setParaFirstCurve',['../classPlottyFile.html#aa676414793becb975506f48d6e949dd0',1,'PlottyFile']]], @@ -17,6 +19,7 @@ var searchData= ['setservodisabled',['setServoDisabled',['../classB15F.html#aad1b3206761c06c7183ae1b8b95b350b',1,'B15F']]], ['setservoenabled',['setServoEnabled',['../classB15F.html#ab23d8c5a0b520b9d12d94a04f90fcfa0',1,'B15F']]], ['setservoposition',['setServoPosition',['../classB15F.html#aa76f289274e5d0be41c5d4a58b52a416',1,'B15F']]], + ['settext',['setText',['../classViewInfo.html#abc93067b319df17e19f013a86d762f81',1,'ViewInfo']]], ['settimeout',['setTimeout',['../classUSART.html#ad7fe866cebe920784d2b17602824c7ff',1,'USART']]], ['settitle',['setTitle',['../classView.html#a6c725e4d83fd7474635a7e64200c7a08',1,'View']]], ['setunitpara',['setUnitPara',['../classPlottyFile.html#abbac84109a1e0958a4ca5c270fac0986',1,'PlottyFile']]], diff --git a/docs/html/search/functions_d.js b/docs/html/search/functions_d.js index 9256ce0..fcaf074 100644 --- a/docs/html/search/functions_d.js +++ b/docs/html/search/functions_d.js @@ -1,4 +1,5 @@ var searchData= [ - ['view',['View',['../classView.html#a0a9be6e5fb588412aab31cacf5e43b04',1,'View']]] + ['view',['View',['../classView.html#a0a9be6e5fb588412aab31cacf5e43b04',1,'View']]], + ['viewinfo',['ViewInfo',['../classViewInfo.html#a95a3a81de65ef42615bbe5a843e8d5f6',1,'ViewInfo']]] ]; diff --git a/docs/html/search/searchdata.js b/docs/html/search/searchdata.js index 72d48e8..aa45a37 100644 --- a/docs/html/search/searchdata.js +++ b/docs/html/search/searchdata.js @@ -1,9 +1,9 @@ var indexSectionsWithContent = { - 0: "abcdefghkmoprstuvw~", + 0: "abcdefghklmoprstuvw~", 1: "bdptuv", 2: "acdefgkoprstuvw~", - 3: "bchkmprstw", + 3: "bchklmprstw", 4: "b" }; diff --git a/docs/html/search/variables_1.js b/docs/html/search/variables_1.js index 7f4e52c..fb178be 100644 --- a/docs/html/search/variables_1.js +++ b/docs/html/search/variables_1.js @@ -1,4 +1,6 @@ var searchData= [ - ['calls',['calls',['../classView.html#a610367214a727e2f7da72ac5bdb60fa3',1,'View']]] + ['calls',['calls',['../classView.html#a610367214a727e2f7da72ac5bdb60fa3',1,'View']]], + ['close_5foffset_5fx',['close_offset_x',['../classViewInfo.html#ae4dab70d82761e0f59f51dcae79685fe',1,'ViewInfo']]], + ['close_5foffset_5fy',['close_offset_y',['../classViewInfo.html#a5954adf853cb44d4655ede731faf1a28',1,'ViewInfo']]] ]; diff --git a/docs/html/search/variables_4.js b/docs/html/search/variables_4.js index 9a8efba..b6889fd 100644 --- a/docs/html/search/variables_4.js +++ b/docs/html/search/variables_4.js @@ -1,7 +1,4 @@ var searchData= [ - ['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']]] + ['label_5fclose',['label_close',['../classViewInfo.html#a34879bd1c0a8fe230429cc600dcd6739',1,'ViewInfo']]] ]; diff --git a/docs/html/search/variables_5.js b/docs/html/search/variables_5.js index 570beea..9a8efba 100644 --- a/docs/html/search/variables_5.js +++ b/docs/html/search/variables_5.js @@ -1,4 +1,7 @@ var searchData= [ - ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',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_6.js b/docs/html/search/variables_6.js index fbf0a47..570beea 100644 --- a/docs/html/search/variables_6.js +++ b/docs/html/search/variables_6.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']]] + ['pre',['PRE',['../classB15F.html#a3b0fc1f85954b2d9c145af4a3af5b1ec',1,'B15F']]] ]; diff --git a/docs/html/search/variables_7.js b/docs/html/search/variables_7.js index adf94ab..fbf0a47 100644 --- a/docs/html/search/variables_7.js +++ b/docs/html/search/variables_7.js @@ -1,5 +1,5 @@ var searchData= [ - ['start_5fx',['start_x',['../classView.html#a9fc9f3b0c876d063e6f57dee320a43fe',1,'View']]], - ['start_5fy',['start_y',['../classView.html#ac424db4c13776c3ce9d33f9074dfcfaa',1,'View']]] + ['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_8.js b/docs/html/search/variables_8.js index 93eef87..adf94ab 100644 --- a/docs/html/search/variables_8.js +++ b/docs/html/search/variables_8.js @@ -1,4 +1,5 @@ var searchData= [ - ['title',['title',['../classView.html#a80441aa81b52e04677a2aa2bd9c47753',1,'View']]] + ['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_9.js b/docs/html/search/variables_9.js index 6cde899..ce82adb 100644 --- a/docs/html/search/variables_9.js +++ b/docs/html/search/variables_9.js @@ -1,6 +1,7 @@ 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']]] + ['text',['text',['../classViewInfo.html#ac392a569ef16af3dc11ee659f3fa1eb4',1,'ViewInfo']]], + ['text_5foffset_5fx',['text_offset_x',['../classViewInfo.html#a4681a8138f17ea229aca02e6db7357cd',1,'ViewInfo']]], + ['text_5foffset_5fy',['text_offset_y',['../classViewInfo.html#a34a9239c8954a0c27a22cf44d112f5b8',1,'ViewInfo']]], + ['title',['title',['../classView.html#a80441aa81b52e04677a2aa2bd9c47753',1,'View']]] ]; diff --git a/docs/html/search/variables_a.html b/docs/html/search/variables_a.html new file mode 100644 index 0000000..fd8f0d7 --- /dev/null +++ b/docs/html/search/variables_a.html @@ -0,0 +1,30 @@ + + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/docs/html/search/variables_a.js b/docs/html/search/variables_a.js new file mode 100644 index 0000000..6cde899 --- /dev/null +++ b/docs/html/search/variables_a.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 3653e29..727164e 100644 --- a/docs/html/timeoutexception_8h_source.html +++ b/docs/html/timeoutexception_8h_source.html @@ -79,7 +79,7 @@ $(function() {
    TimeoutException(const std::string &message)
    diff --git a/docs/html/ui_8cpp_source.html b/docs/html/ui_8cpp_source.html index 8f73044..9e932c4 100644 --- a/docs/html/ui_8cpp_source.html +++ b/docs/html/ui_8cpp_source.html @@ -70,14 +70,15 @@ $(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 }
    Definition: view_monitor.h:13
    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
    -
    Definition: view_info.h:8
    +
    Definition: view_info.h:11
    static WINDOW * getWinContext(void)
    Definition: view.cpp:24
    void delay_ms(uint16_t ms)
    Definition: b15f.cpp:141
    +
    virtual void setText(std::string text)
    Definition: view_info.cpp:8
    static B15F & getInstance(void)
    Definition: b15f.cpp:10
    Definition: b15f.h:38
    void activateSelfTestMode(void)
    Definition: b15f.cpp:204
    @@ -87,11 +88,13 @@ $(function() {
    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 setLabelClose(std::string label)
    Definition: view_info.cpp:13
    virtual void setTitle(std::string title)
    Definition: view.cpp:47
    +
    virtual void setCall(call_t call)
    Definition: view_info.cpp:18
    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 216da07..71ae0b6 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 8abba5b..67e7ceb 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 8a6c183..eaf2eb7 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 ca58e16..ca27f65 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 02eb344..f2e3888 100644 --- a/docs/html/view_8cpp_source.html +++ b/docs/html/view_8cpp_source.html @@ -88,7 +88,7 @@ $(function() {
    virtual void draw(void)=0
    diff --git a/docs/html/view_8h_source.html b/docs/html/view_8h_source.html index 419a51c..920047c 100644 --- a/docs/html/view_8h_source.html +++ b/docs/html/view_8h_source.html @@ -91,7 +91,7 @@ $(function() {
    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 5306e7c..71a96b6 100644 --- a/docs/html/view__info_8cpp_source.html +++ b/docs/html/view__info_8cpp_source.html @@ -70,20 +70,30 @@ $(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 
    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 
    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
    +
    constexpr static int text_offset_x
    Relativer Abstand des Textes zum linken Rahmen.
    Definition: view_info.h:55
    int width
    width of view in terminal characters
    Definition: view.h:79
    +
    virtual void setText(std::string text)
    Definition: view_info.cpp:8
    std::vector< call_t > calls
    calls (function pointers) for different button actions in the view (if any)
    Definition: view.h:84
    +
    ViewInfo(void)
    Definition: view_info.cpp:3
    static WINDOW * win
    static window contexts for all views
    Definition: view.h:86
    +
    int close_offset_x
    Relative X Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:53
    static std::vector< std::string > str_split(const std::string &str, const std::string delim)
    Definition: view.cpp:30
    +
    std::string label_close
    Beschriftung für Button zum Schließen.
    Definition: view_info.h:52
    +
    constexpr static int text_offset_y
    Relativer Abstand des Textes zum oberen Rahmen.
    Definition: view_info.h:56
    virtual call_t keypress(int &key) override
    Definition: view_info.cpp:37
    +
    int close_offset_y
    Relative Y Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:54
    +
    virtual void setLabelClose(std::string label)
    Definition: view_info.cpp:13
    int start_x
    x offset (characters) in the terminal, used to center the window on repaint()
    Definition: view.h:81
    +
    std::string text
    Benachrichtigungstext dieser View.
    Definition: view_info.h:51
    +
    virtual void setCall(call_t call)
    Definition: view_info.cpp:18
    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 aa8d4ab..d5bf10e 100644 --- a/docs/html/view__info_8h_source.html +++ b/docs/html/view__info_8h_source.html @@ -70,14 +70,24 @@ $(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
    -
    Definition: view_info.h:8
    +
    1 #ifndef VIEW_INFO
    2 #define VIEW_INFO
    3 
    4 #include "view.h"
    5 
    11 class ViewInfo : public View
    12 {
    13 public:
    17  ViewInfo(void);
    18 
    23  virtual void setText(std::string text);
    24 
    29  virtual void setLabelClose(std::string label);
    30 
    36  virtual void setCall(call_t call);
    37 
    41  virtual void draw(void) override;
    42 
    48  virtual call_t keypress(int& key) override;
    49 
    50 protected:
    51  std::string text;
    52  std::string label_close;
    53  int close_offset_x = 0;
    54  int close_offset_y = 0;
    55  constexpr static int text_offset_x = 2;
    56  constexpr static int text_offset_y = 3;
    57 };
    58 
    59 #endif // VIEW_INFO
    +
    constexpr static int text_offset_x
    Relativer Abstand des Textes zum linken Rahmen.
    Definition: view_info.h:55
    +
    Definition: view_info.h:11
    Definition: view.h:19
    +
    virtual void setText(std::string text)
    Definition: view_info.cpp:8
    +
    ViewInfo(void)
    Definition: view_info.cpp:3
    +
    int close_offset_x
    Relative X Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:53
    +
    std::string label_close
    Beschriftung für Button zum Schließen.
    Definition: view_info.h:52
    +
    constexpr static int text_offset_y
    Relativer Abstand des Textes zum oberen Rahmen.
    Definition: view_info.h:56
    virtual call_t keypress(int &key) override
    Definition: view_info.cpp:37
    +
    int close_offset_y
    Relative Y Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:54
    +
    virtual void setLabelClose(std::string label)
    Definition: view_info.cpp:13
    +
    std::string text
    Benachrichtigungstext dieser View.
    Definition: view_info.h:51
    +
    virtual void setCall(call_t call)
    Definition: view_info.cpp:18
    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 d9aa7e2..df59651 100644 --- a/docs/html/view__monitor_8cpp_source.html +++ b/docs/html/view__monitor_8cpp_source.html @@ -70,9 +70,10 @@ $(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
    Definition: view_monitor.h:13
    +
    constexpr static int text_offset_x
    Relativer Abstand des Textes zum linken Rahmen.
    Definition: view_info.h:55
    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
    @@ -83,17 +84,21 @@ $(function() {
    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
    +
    int close_offset_x
    Relative X Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:53
    +
    std::string label_close
    Beschriftung für Button zum Schließen.
    Definition: view_info.h:52
    uint16_t analogRead(uint8_t channel)
    Definition: b15f.cpp:346
    virtual void repaint(void)
    Definition: view.cpp:52
    +
    int close_offset_y
    Relative Y Koordinate des Buttons zum Schließen im Window.
    Definition: view_info.h:54
    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
    +
    std::string text
    Benachrichtigungstext dieser View.
    Definition: view_info.h:51
    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 7e69114..9f22b05 100644 --- a/docs/html/view__monitor_8h_source.html +++ b/docs/html/view__monitor_8h_source.html @@ -73,10 +73,10 @@ $(function() {
    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
    Definition: view_monitor.h:13
    -
    Definition: view_info.h:8
    +
    Definition: view_info.h:11
    diff --git a/docs/html/view__promt_8cpp_source.html b/docs/html/view__promt_8cpp_source.html index 96d56be..d838c02 100644 --- a/docs/html/view__promt_8cpp_source.html +++ b/docs/html/view__promt_8cpp_source.html @@ -83,7 +83,7 @@ $(function() {
    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 b49ec2b..c67bb83 100644 --- a/docs/html/view__promt_8h_source.html +++ b/docs/html/view__promt_8h_source.html @@ -77,7 +77,7 @@ $(function() {
    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 7b7746a..b953db6 100644 --- a/docs/html/view__selection_8cpp_source.html +++ b/docs/html/view__selection_8cpp_source.html @@ -81,7 +81,7 @@ $(function() {
    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 95eb6af..06965d3 100644 --- a/docs/html/view__selection_8h_source.html +++ b/docs/html/view__selection_8h_source.html @@ -77,7 +77,7 @@ $(function() {
    virtual void draw(void) override