cu-ecen-aeld / final-project-abbottwhitley

final-project-abbottwhitley created by GitHub Classroom
0 stars 0 forks source link

Add user input functionality to C++ server #25

Closed abbottwhitley closed 3 years ago

abbottwhitley commented 3 years ago

Current C++ socket communication is one way. Add input functionality to the client end of the connection to allow for user input and control.

DoD: The following program inputs are available to the user from the client connection

abbottwhitley commented 3 years ago

Added polling to video display thread handler. Allows thread to poll for inputs from the client. Currently supports basic char input.

Output shows continuous communication between video stream server and the client:

Process flow:

image

abbottwhitley commented 3 years ago

Commit

abbottwhitley commented 3 years ago

Reworked user input from CLI. C++ and python Server to run in background, don't need the userInput processing threads or the userInput thread handler function to accept user input from the command line.

Separated sig handlers. Created one signal handler for SIGPIPE and one for SIGTERM & SIGINT. SIGPIPE doesn't currently do anything other than catch the SIGBAL and allow the server to continue running in the event that the client kills the connection. SIGTERM & SIGINT set a global endProgram variable.

Currently updating user input from web client to adjust program settings.

abbottwhitley commented 3 years ago

Python/flask server HTML interface was reloading the web page every time user input was provided. This cause the socket connection to close and a new connection to be created. Ideal operation would maintain connection. Updated Python and HTML to incorporate jQuery and ajax using the how to reference below.

https://www.geeksforgeeks.org/flask-form-submission-without-page-reload/

Socket now stays in tact until browser is closed.

abbottwhitley commented 3 years ago

Updated HTML GUI buttons and drop down menu to support toggling Face Detection settings, pausing video feed, and a djusting frame rate. Video recording button currently inoperable. Updated C++ server side to respond accordingly." [master f88d687] Reworked user input from CLI. C++ and python Server to run in background, don't need the userInput processing threads or the userInput thread handler function to accept user input from the command line

Output below showing server startup, innitial connection from web browser, and input command from browser sent to C++ server. image

Web Browser results from the above process flow. image

Reference this commit