bp

## Class Functions

- java.lang.Object
- - bp.Functions

-     public class Functions
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `loggedUserName`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `displayData(java.lang.String mainLog, java.awt.Color colorMainLog, char addType)` Disply data and activity for user control.
    `void` | `displayData(java.lang.String mainLog, java.awt.Color colorMainLog, char addType, java.lang.String log, java.awt.Color colorLog)` Disply data and activity for user control.
    `int` | `getBaudRate()` Getting set baudrate
    `int` | `getDataBits()` Getting set data bits
    `boolean` | `getDeviceWakedUp()` Getting the state of the device.
    `void` | `getLastConfId()` Getting last conf id in the database.
    `java.util.ArrayList<Conf>` | `getLoadedConfs()` Getting set of the loaded configurations depends on the logged user.
    `java.lang.String` | `getLoggedUserId()` Getting logged used id
    `java.lang.String` | `getLoggedUserName()` Getting the name of the logged user
    `int` | `getParity()` Getting set parity
    `int` | `getStopBits()` Getting set stop bits
    `int` | `IndexOfNth(java.lang.String string, java.lang.String substring, int nth)`
    `void` | `initCboxes()` Initialization of Cboxes for setup serial communication with network device.
    `void` | `insertConfToDatabase(java.lang.String conf_body)` Inserting new configuration to the database on the lastConfId++ place.
    `void` | `loadConfs()` Loading all user configurations.
    `void` | `loadPortParams()` Loading parameters from actual selection of cboxem fo init serial communication.
    `void` | `logoutUser()` Logout user and change toogleControls.
    `java.lang.String` | `modifyReceivedMsg()` Modifying received msg from the network device.
    `java.lang.String` | `removeSpaces(java.lang.String msg)` Modifying msg for properly display ind the gui.
    `void` | `setDeviceWakedUp(boolean deviceWakedUp)` Setting the state of the device.
    `void` | `toggleControls()` This functions enebales/disables parts of main GUI.
    `void` | `updateLoadedConfs(java.util.ArrayList<Conf> loadedConfs)` Updating user configurations depends on the downloaded list from the DB.
    `boolean` | `validate_login(java.lang.String email, java.lang.String password)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### loggedUserName

          public java.lang.String loggedUserName

  - ### Method Detail

    - #### toggleControls

          public void toggleControls()

      This functions enebales/disables parts of main GUI.

    - #### initCboxes

          public void initCboxes()

      Initialization of Cboxes for setup serial communication with network device.

    - #### loadPortParams

          public void loadPortParams()

      Loading parameters from actual selection of cboxem fo init serial communication.

    - #### validate_login

          public boolean validate_login(java.lang.String email,
                                        java.lang.String password)

      Parameters:
        `email` - - user email
        `password` - - user password
      Returns:
        true if email and password inserted to the fiels is known and correct by database - users table.

    - #### getLastConfId

          public void getLastConfId()

      Getting last conf id in the database.

    - #### insertConfToDatabase

          public void insertConfToDatabase(java.lang.String conf_body)

      Inserting new configuration to the database on the lastConfId++ place.
      Parameters:
        `conf_body` - - configuration body

    - #### loadConfs

          public void loadConfs()

      Loading all user configurations.

    - #### updateLoadedConfs

          public void updateLoadedConfs(java.util.ArrayList<Conf> loadedConfs)

      Updating user configurations depends on the downloaded list from the DB.
      Parameters:
        `loadedConfs` - - set of loaded configuration

    - #### logoutUser

          public void logoutUser()

      Logout user and change toogleControls.

    - #### modifyReceivedMsg

          public java.lang.String modifyReceivedMsg()

      Modifying received msg from the network device.
      Returns:
        - modifyend msg withou spaces

    - #### removeSpaces

          public java.lang.String removeSpaces(java.lang.String msg)

      Modifying msg for properly display ind the gui.
      Parameters:
        `msg` - - received msg from network devica via serial communication port.
      Returns:
        modyfied msg

    - #### IndexOfNth

          public int IndexOfNth(java.lang.String string,
                                java.lang.String substring,
                                int nth)

      Parameters:
        `string` - - main string to find in
        `substring` - - finding substring
        `nth` - - count of the finding.
      Returns:
        index of substring

    - #### displayData

          public void displayData(java.lang.String mainLog,
                                  java.awt.Color colorMainLog,
                                  char addType)

      Disply data and activity for user control.
      Parameters:
        `mainLog` - - mani log with all detailed msgs
        `colorMainLog` - - color of the font in the field
        `addType` - - 'a' = append, 'w' = write

    - #### displayData

          public void displayData(java.lang.String mainLog,
                                  java.awt.Color colorMainLog,
                                  char addType,
                                  java.lang.String log,
                                  java.awt.Color colorLog)

      Disply data and activity for user control.
      Parameters:
        `mainLog` - - mani log with all detailed msgs
        `colorMainLog` - - color of the font in the field
        `addType` - - 'a' = append, 'w' = write
        `log` - - log to the activity box
        `colorLog` - - color of the font in the field

    - #### getDeviceWakedUp

          public boolean getDeviceWakedUp()

      Getting the state of the device.
      Returns:
        bool if is device waked up

    - #### setDeviceWakedUp

          public void setDeviceWakedUp(boolean deviceWakedUp)

      Setting the state of the device.
      Parameters:
        `deviceWakedUp` - - true if device is waked up

    - #### getLoggedUserId

          public java.lang.String getLoggedUserId()

      Getting logged used id
      Returns:
        - logged user id

    - #### getLoggedUserName

          public java.lang.String getLoggedUserName()

      Getting the name of the logged user
      Returns:
        - return name of the logged user

    - #### getLoadedConfs

          public java.util.ArrayList<Conf> getLoadedConfs()

      Getting set of the loaded configurations depends on the logged user.
      Returns:
        - retunr set of configurations.

    - #### getBaudRate

          public int getBaudRate()

      Getting set baudrate
      Returns:
        baudrate

    - #### getDataBits

          public int getDataBits()

      Getting set data bits
      Returns:
        data bits

    - #### getStopBits

          public int getStopBits()

      Getting set stop bits
      Returns:
        stop bits

    - #### getParity

          public int getParity()

      Getting set parity
      Returns:
        parity