public class DBHandler
extends java.lang.Object
Constructor and Description |
---|
DBHandler()
The general constructor for the DBHandler, looks for (or creates) SCADA.db
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getEquations()
This method returns all of the equations/destinations from the DB.
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getIDDescUnitsTag(java.lang.String[] tags)
This method returns imformation on tags that have previously been entered into the DB.
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getIDs()
This method gets a list of all ID's in the DB
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getInfo(java.lang.String tags,
java.lang.String systems,
java.lang.String date1,
java.lang.String date2)
This method will return information from a date range (or all if you don't specify a start/end time.
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getLatestData(int seconds)
This method will return the most recent data put into the DB.
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getSensorcharacterization()
This method returns all information from the SensorLabels table.
|
java.util.ArrayList<java.util.ArrayList<java.lang.String>> |
getSensorInfo()
This function gets all information from the SensorLabels table.
|
void |
insertData(java.lang.String IDVals)
This function will allow for insertion of a multiple data entries.
|
void |
insertData(java.lang.String ID,
java.lang.String value)
This function will allow for insertion of a single data entry
|
void |
removeSensor(java.lang.String tag)
This method will remove a sensor from the DB.
|
void |
updateEquations(java.util.ArrayList<javax.swing.JTextField> destinations,
java.util.ArrayList<javax.swing.JTextField> equations)
This method updates equations in the DB.
|
void |
updateSensor(java.lang.Boolean isNew,
java.lang.String[] data)
This method will update the information of the sensor selected.
|
public DBHandler()
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getEquations()
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getIDDescUnitsTag(java.lang.String[] tags)
tags
- the human readable tags that you would like to search forpublic java.util.ArrayList<java.util.ArrayList<java.lang.String>> getIDs()
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getInfo(java.lang.String tags, java.lang.String systems, java.lang.String date1, java.lang.String date2)
tags
- The tag(s) of the sensors we desiresystems
- The system(s) of the sensors we wantdate1
- Start date in same format as 2017-04-09 23:29:58date2
- End date in same format as 2017-04-09 23:29:58public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getLatestData(int seconds)
seconds
- The number of seconds before the last data time.public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getSensorcharacterization()
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> getSensorInfo()
public void insertData(java.lang.String IDVals)
IDVals
- The data to be inserted into the DBpublic void insertData(java.lang.String ID, java.lang.String value)
ID
- of the sensorvalue
- of the sensorpublic void removeSensor(java.lang.String tag)
tag
- The tag of the sensor you would like to remove.public void updateEquations(java.util.ArrayList<javax.swing.JTextField> destinations, java.util.ArrayList<javax.swing.JTextField> equations)
destinations
- The destination of the equationequations
- The equation to be used when evaluationpublic void updateSensor(java.lang.Boolean isNew, java.lang.String[] data)
isNew
- Whether or not this is a new entry or one to editdata
- THe data in the aforementioned format.