\hypertarget{classcpphlib_1_1PPSTATEMACHINE}{\section{cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E \-Class \-Reference}
\label{classcpphlib_1_1PPSTATEMACHINE}\index{cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
}


\-The statemachine.  


\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_af4ab55e1c0964b2f21798bb9125e6523}{\-\_\-\-\_\-init\-\_\-\-\_\-}
\begin{DoxyCompactList}\small\item\em \-Documentation for method. \end{DoxyCompactList}\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_a2c64ee9b36737614f8180e0badb541da}{additemtostatetable}
\begin{DoxyCompactList}\small\item\em \-Documentation for method. \end{DoxyCompactList}\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_a55e5767e889c073ab218e1a2810a65f3}{inputchange}
\begin{DoxyCompactList}\small\item\em \-Documentation for method. \end{DoxyCompactList}\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_a88cdba72a78388b85b61424cbda7ebd7}{getactualstate}
\begin{DoxyCompactList}\small\item\em \-Documentation for method. \end{DoxyCompactList}\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_a13eb83b5d39392bf7d99a784e56c853e}{run}
\begin{DoxyCompactList}\small\item\em \-Documentation for method. \end{DoxyCompactList}\item 
def \hyperlink{classcpphlib_1_1PPSTATEMACHINE_adfde34aa4cc91f259041f285946db264}{stop}
\end{DoxyCompactItemize}
\subsection*{\-Public \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a714a75323bd74cfca475d69662facee8}{{\bfseries \-Run\-Flag}}\label{classcpphlib_1_1PPSTATEMACHINE_a714a75323bd74cfca475d69662facee8}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_af9a1f3d68fa01ce4f88b4604fc234236}{{\bfseries \-Out\-Actions}}\label{classcpphlib_1_1PPSTATEMACHINE_af9a1f3d68fa01ce4f88b4604fc234236}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a1d528b9fac7fe692cde6d0626859d47d}{{\bfseries \-Input\-Blocks}}\label{classcpphlib_1_1PPSTATEMACHINE_a1d528b9fac7fe692cde6d0626859d47d}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_aa5fcf54254763e4291f29dad8c594c84}{{\bfseries \-State\-Table}}\label{classcpphlib_1_1PPSTATEMACHINE_aa5fcf54254763e4291f29dad8c594c84}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a9685f7830a69179ad674d7ba129c5af2}{{\bfseries \-State}}\label{classcpphlib_1_1PPSTATEMACHINE_a9685f7830a69179ad674d7ba129c5af2}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_afb357d6ea06b6376d7e6f56a1baf9920}{{\bfseries prev\-Search\-State\-Change}}\label{classcpphlib_1_1PPSTATEMACHINE_afb357d6ea06b6376d7e6f56a1baf9920}

\item 
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_addd9cdcbd3651c385506c45c99c2a273}{{\bfseries \-Silent\-Mode}}\label{classcpphlib_1_1PPSTATEMACHINE_addd9cdcbd3651c385506c45c99c2a273}

\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}
\-The statemachine. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-This class is a general purpose state machine, what is able to run independently from the main thread of the controller program. \-It must be stopped before quitting from the main thread using {\bfseries stop} method, because this class is defined by a different thread. \-Output changes caused by state changes can be described using methods. \-These methods must be collected in a separate class, and must be implemented, and this new class's instance is used by the statemachine.(fx. see how \-S\-M implemented in \hyperlink{classcpphlib_1_1PPKMREHANDLER}{\-P\-P\-K\-M\-R\-E\-H\-A\-N\-D\-L\-E\-R} uses methods implemented in \hyperlink{classcpphlib_1_1PPRENCOUTACTIONS}{\-P\-P\-R\-E\-N\-C\-O\-U\-T\-A\-C\-T\-I\-O\-N\-S}.) \-State machine can be awaken using method {\bfseries run}, but before starting, its temporary table must be loaded with method {\bfseries additemtostatetable}. \-Definig table, strings must be used when defining input lists, states, new states, and names of change handling methods. \-Inputs must be given in lists, this way it is easy to change changed values of inputs with the position of the list index. \-The operation of the statemachine\-: \-The statemachine adds the jointed input list, and the actual state together. \-If this string is not the same as calculated in the previous cycle, then changes occured on the inputs, which causes changes on the outputs, and output action starting, if an element can be found in the state table with the jointed input list, and the actual state's result, as key. \-This element is a dicionary, which contains the name of the new state, where we became, and also contains the name of the executable action's method. \-We can execute the executable action, and we can make actual state equal to the new state. \-From this point, the process restarts from the beginig. \-The statemachine is running in an endless cycle, until we stop it using method {\bfseries stop}. 

\subsection{\-Constructor \& \-Destructor \-Documentation}
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_af4ab55e1c0964b2f21798bb9125e6523}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!\-\_\-\-\_\-init\-\_\-\-\_\-@{\-\_\-\-\_\-init\-\_\-\-\_\-}}
\index{\-\_\-\-\_\-init\-\_\-\-\_\-@{\-\_\-\-\_\-init\-\_\-\-\_\-}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{\-\_\-\-\_\-init\-\_\-\-\_\-}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-\_\-\-\_\-init\-\_\-\-\_\-} (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{\-Init\-State, }
\item[{}]{\-Init\-Inputs, }
\item[{}]{\-Out\-Actions\-Object, }
\item[{}]{\-Silent\-Mode = {\ttfamily \-True}}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_af4ab55e1c0964b2f21798bb9125e6523}


\-Documentation for method. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-It is the \hyperlink{classcpphlib_1_1PPSTATEMACHINE}{\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}'s constructor. \-In this costructor, the starting state of the statemachine, the valid input combination at the start, and the object class instance, which contains the method collection of the output changes must be given. \-Defining inputs can be done using lists, fx. binary (\mbox{[}\char`\"{}1\char`\"{},\char`\"{}0\char`\"{},\char`\"{}1\char`\"{}\mbox{]}), it can be one, or more complete byte (\mbox{[}\char`\"{}0\-A\char`\"{}\mbox{]} or \mbox{[}\char`\"{}01\char`\"{},\char`\"{}\-F8\char`\"{}\mbox{]}), word, or long sting as well. \-In case of changes of certain input channels, we can send the input changes into the state machine with the help of the index of list given at initialising, with the help of method {\bfseries inputchange} 
\begin{DoxyParams}{\-Parameters}
{\em \-Init\-State} & \-The initial state \\
\hline
{\em \-Init\-Inputs} & \-The valid input combination at the start given in list \\
\hline
{\em \-Out\-Actions\-Object} & \-Is the object class instance, which contains the method collection of the output changes \\
\hline
{\em \-Silent\-Mode} & \-If \-Silent\-Mode is set to {\bfseries {\itshape \-False\/}} then you can follow on the console how the statemachine works \par
\par
 \begin{DoxyVerb}Short description: Constructs PPSTATEMACHINE class\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}


\subsection{\-Member \-Function \-Documentation}
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a2c64ee9b36737614f8180e0badb541da}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!additemtostatetable@{additemtostatetable}}
\index{additemtostatetable@{additemtostatetable}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{additemtostatetable}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-additemtostatetable} (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{state, }
\item[{}]{input, }
\item[{}]{outaction, }
\item[{}]{newstate}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_a2c64ee9b36737614f8180e0badb541da}


\-Documentation for method. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-It gives state change to the state table of the state machine. \-It shows us from what state, with which input combination, and what output action brings us to which state. 
\begin{DoxyParams}{\-Parameters}
{\em state} & \-Starting state, what the state machine is in \\
\hline
{\em input} & \-The changed input combination (must be given, if it was a jointed list) \\
\hline
{\em outaction} & \-The outaction method's name to run \\
\hline
{\em newstate} & \-The new state, what the statemachine came into \par
\par
 \begin{DoxyVerb}Short description: It gives state change to the state table\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a88cdba72a78388b85b61424cbda7ebd7}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!getactualstate@{getactualstate}}
\index{getactualstate@{getactualstate}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{getactualstate}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-getactualstate} (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_a88cdba72a78388b85b61424cbda7ebd7}


\-Documentation for method. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-Inquiring actual state of the state machine \-It returns with the actual state of the state machine. \par
\par
 \begin{DoxyVerb}Short description: Inquiring actual state of the state machine\end{DoxyVerb}
 \hypertarget{classcpphlib_1_1PPSTATEMACHINE_a55e5767e889c073ab218e1a2810a65f3}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!inputchange@{inputchange}}
\index{inputchange@{inputchange}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{inputchange}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-inputchange} (
\begin{DoxyParamCaption}
\item[{}]{self, }
\item[{}]{inputblock, }
\item[{}]{input}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_a55e5767e889c073ab218e1a2810a65f3}


\-Documentation for method. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-Telling input changes to the state machine. 
\begin{DoxyParams}{\-Parameters}
{\em inputblock} & \-The index of the list given at initialising, what points to the input \\
\hline
{\em input} & \-The changed input value \par
\par
 \begin{DoxyVerb}Short description: Telling input changes to the state machine\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\hypertarget{classcpphlib_1_1PPSTATEMACHINE_a13eb83b5d39392bf7d99a784e56c853e}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!run@{run}}
\index{run@{run}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{run}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-run} (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_a13eb83b5d39392bf7d99a784e56c853e}


\-Documentation for method. 

{\bfseries } {\itshape \/} {\bfseries {\itshape \/}} \-The working loop of the state machine. \-It is an endless cycle, until we stop it using method {\bfseries stop}. \par
\par
 \begin{DoxyVerb}Short description: The working loop of the state machine\end{DoxyVerb}
 \hypertarget{classcpphlib_1_1PPSTATEMACHINE_adfde34aa4cc91f259041f285946db264}{\index{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}!stop@{stop}}
\index{stop@{stop}!cpphlib::PPSTATEMACHINE@{cpphlib\-::\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E}}
\subsubsection[{stop}]{\setlength{\rightskip}{0pt plus 5cm}def {\bf cpphlib.\-P\-P\-S\-T\-A\-T\-E\-M\-A\-C\-H\-I\-N\-E.\-stop} (
\begin{DoxyParamCaption}
\item[{}]{self}
\end{DoxyParamCaption}
)}}\label{classcpphlib_1_1PPSTATEMACHINE_adfde34aa4cc91f259041f285946db264}
\begin{DoxyVerb}Short description: It stops the state machine\end{DoxyVerb}
 

\-The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
cpphlib.\-py\end{DoxyCompactItemize}
