- Database
- Website
- Database Daemon
- Android App
- XAMPP or equivalent MySQL server
- Install XAMPP
- Run XAMPP and run Apache and MySQL
- Go to localhost/phpmyadmin in browser
- Make a new database called
wave_lab_database
- Run MySQL code within wave_lab_database.sql
- Create a user and add to
user
table- Must be done within PHPMyAdmin
- Needs
Username
,Password
, andName
- Database is now ready for use
- DWB : 0 | LWF : 1
- Javascript
- NodeJS
- Completion of Database setup
- Install NodeJS
- Clone repository
- Inside the repository, run
npm install
to download dependencies - Open
Website
directory - Run
node server.js
- Website is now live at localhost:port
- Port is printed when server starts
- Heart of the server and opens the port and launches the web server
- Calls on helper functions to render website
- Routes functions to buttons on webpage
- Used for login and adding depth requests
- Handles all webpage rendering
- Connects to database to get information before rendering pages
- Changes available page content if user is logged in
- Contains functions for logging in and posting depth requests
- Python2
- MySQL
- SQLite
- Description: Accesses SQLite DB and transfers most recent depths to MySQL DB
- Dependencies: N/A
- Software: MySQL, SQLAlchemy, SQLite
python depth_sensor.py [Path] [Log] [Interval]
- Path the absolute path to the SQLite DB
- Log absolute path to output log file
- Interval seconds to wait before looping
- Description: Accesses MySQL DB to actuate valves
- Dependencies: control.py, conf.py, adam.py
- Software: MySQL
python valves.py [Interval] [DWB] [LWF] [Stag] [Log] [Error]
- Interval seconds to wait before looping
- DWB directional wave basin max fill level (cm)
- LWF large wave flume max fill level (cm)
- Stag min fill amount / 10 intervals
- Log absolute path to output log file
- Error absolute path to error log file
- Description: Tests valve.py for correct actuation of the vavles when appropriate
- Dependencies: control.py, conf.py
- Software: MySQL
python test_valves.py
- Dart
- Flutter
- AndroidStudio
- XAMPP
- Completion of Database setup
- Install XAMPP
- To add the SQL commands to the local database:
- Enter the xampp/htdocs folder.
- Create a new folder /WavelabDB.
- add get.depth.php from /wave-lab-app/wavelab_android/lib/database and add it to xampp/htdocs/WavelabDB.
- To connect the app to the database:
- Enter /wave-lab-app/wavelab_android/lib/models and the ROOT variable will be what is changed.
- Run ipconfig in the command prompt to find the Link-local IPv6 Address.
- Copy this address into the ROOT variable replacing "192.168.1.19" or a similar address in the string.
- Install Android Studio onto the computer: Android Studio Download.
- Install Flutter and Dart onto the computer: Download.
- Follow these steps to create an emulator on the computer: Emulator Steps.
- Choose an emulator by clicking on AVD Manager in Android Studio to enter Your Virtual Devices page and pressing the green button to start the emulator up.
- To run go back to the original Android Studio Page and click the green arrow to launch the app on the Android emulator.
-
Before trying to download the app onto the android phone, Android Studio must be installed onto the computer: Android Studio Download.
-
Connect the Android phone to the computer with a USB cable.
- If the computer uses Windows, a USB Driver needs to be installed to communicate with the phone.
- Here is the link for the USB Driver connecting to Android: Android Connector.
-
For Windows 10:
- Make sure the Android phone is connected to the computer.
- From Windows Explorer, open Computer Management.
- In the Computer Management left pane, select Device Manager.
- In the Device Manager right pane, locate and expand Portable Devices or Other Devices, depending on which one you see.
- Right-click the name of the device you connected, and then select Update Driver Software.
- In the Hardware Update wizard, select Browse my computer for driver software and click Next.
- Click Browse and then locate the USB driver folder. For example, the Google USB Driver is located in android_sdk\extras\google\usb_driver.
- Click Next to install the driver.
-
For earlier Windows versions follow the steps here
-
To put the Android phone in developer mode(needed for this app):
- Open the Settings app on your Android phone. 1.a If the Android phone is a model v8.0 or high select System. Otherwise, proceed to the next step.
- Scroll to the bottom and select About phone.
- Scroll to the bottom and tap Build number seven times. 3.a If Build number isn’t here click on Software Information and Build number should be there.
- Return to the previous screen, scroll to the bottom, and tap Developer options.
- In the Developer options window, scroll down to find and enable USB debugging.
-
Now in AndroidStudio:
- Select the WaveLab app file.
- Click run/run from the toolbar.
- Select Choose a running device and select the Android phone connected.
- Click the Ok button.
- Where the connection to the database is.
- Holds all of the SQL querys for the android app.
- Encodes all of the data before sending it to /wavelab_android/lib/database/get_depth.php.
- Decodes the json data from SQL response into a list of strings.
- Controls the tab movement in the app.
- Formats the header and tab bar at the bottom of each screen.
- Holds each screen file: home.dart, directional_wave_basin.dart, large_wave_flume.dart, and settings.dart.
- Prints the body of each tab but the screen_controller.dart controlls which tab is printed at a time.
- A Mac with Xcode installed
- Clone repository
- Open
/Apple Apps/
in Xcode - Either plug in phone and prepare for development or use emulator
- Click the build button to build
- App will either be installed on target iPhone or emulator will start