vanetsim.gui.helpers
Class LogAnalyser

java.lang.Object
  extended by vanetsim.gui.helpers.LogAnalyser

public class LogAnalyser
extends java.lang.Object


Constructor Summary
LogAnalyser()
          Constructor for Console Mode.
LogAnalyser(LogAnalyserDialog logDialog)
          Constructor for GUI-Mode
 
Method Summary
 void addJob(java.lang.String filePath)
          Adds a job with all parameters
 void addNewJobs()
          Checks if there is a file named addJobs.txt.
 void addToProgressBar(int value)
          Adds a value to the progress bar.
 void documentJobsToFile(java.lang.String job)
          saves jobs to jobs_done.txt file for documentation
 java.lang.String getActualJob()
           
 java.lang.String getAdvancedFilePath_()
           
 java.lang.String getAttackType()
           
 double getBiggerStreetValue()
           
 double getDrivesStraigthValue()
           
 double getGuiElement(java.lang.String name)
          Returns a GUI element.
 java.util.ArrayList<java.lang.String> getJobs()
           
 double getLimitToAngle()
           
 java.lang.String getLogName()
           
 java.lang.String getLogOutput_()
           
 java.lang.String getLogType()
           
 double getMakesUTurnValue()
           
 LogOperations getOperation_()
           
 java.lang.String getPlainJob()
           
 double getSmallerStreetValue()
           
 double getTimeBufferValue()
           
 double getTuneTimeValue()
           
 double getTurnsValue()
           
 void guiControl(java.lang.String element, boolean value)
          Handles the control elements of the GUI
 boolean isAdvancedFilePathChanged()
           
 boolean isFilePathChanged()
           
 boolean isProbabilitiesOn()
          check if probabilities are used for the attack
 boolean isUseProbability()
           
static void main(java.lang.String[] args)
           
 void readJobs()
          reads the jobs in jobs.txt
 void saveJobsToFile()
          saves jobs to file
 void setActualJob(java.lang.String actualJob)
           
 void setAdvancedFilePath_(java.lang.String advancedFilePath_)
           
 void setAdvancedFilePathChanged(boolean advancedFilePathChanged)
           
 void setAttackType(java.lang.String attackType)
           
 void setBiggerStreetValue(double biggerStreetValue)
           
 void setDrivesStraigthValue(double drivesStraigthValue)
           
 void setFilePathChanged(boolean filePathChanged)
           
 void setJobs(java.util.ArrayList<java.lang.String> jobs)
           
 void setLimitToAngle(double limitToAngle)
           
 void setLogName(java.lang.String logName)
           
 void setLogOutput_(java.lang.String logOutput_)
           
 void setLogType(java.lang.String logType)
           
 void setMakesUTurnValue(double makesUTurnValue)
           
 void setOperation_(LogOperations operation_)
           
 void setPlainJob(java.lang.String plainJob)
           
 void setSmallerStreetValue(double smallerStreetValue)
           
 void setTimeBufferValue(double timeBufferValue)
           
 void setTuneTimeValue(double tuneTimeValue)
           
 void setTurnsValue(double turnsValue)
           
 void setUseProbability(boolean useProbability)
           
 void startNextJob(boolean firstJob)
          Starts the next job and handles documentation
 void updateInformationArea(int numberOfCarsChecked, int numberOfCorrectVehiclesFound, boolean finished)
          Updates status text area
 void updateInformationArea(java.lang.String text)
          Updates status text area in GUI and console mode
 void updateInformationArea(java.lang.String text, boolean b)
          Updates status text area.
 void updateProgressBar(int value)
          Updates the progress bar to the given value
 void writeResultsToFile(java.lang.String fileName)
          writes the log to file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogAnalyser

public LogAnalyser(LogAnalyserDialog logDialog)
Constructor for GUI-Mode

Parameters:
logDialog -

LogAnalyser

public LogAnalyser()
Constructor for Console Mode. The class will look for the file jobs.txt, read it and calculate the jobs

Method Detail

main

public static void main(java.lang.String[] args)

guiControl

public void guiControl(java.lang.String element,
                       boolean value)
Handles the control elements of the GUI

Parameters:
element -
value -

updateProgressBar

public void updateProgressBar(int value)
Updates the progress bar to the given value

Parameters:
value -

addToProgressBar

public void addToProgressBar(int value)
Adds a value to the progress bar. Also supports the console mode.

Parameters:
value -

getGuiElement

public double getGuiElement(java.lang.String name)
Returns a GUI element. Needed because of MVC

Parameters:
name -
Returns:

isProbabilitiesOn

public boolean isProbabilitiesOn()
check if probabilities are used for the attack

Returns:
the probability

startNextJob

public void startNextJob(boolean firstJob)
Starts the next job and handles documentation


addJob

public void addJob(java.lang.String filePath)
Adds a job with all parameters

Parameters:
filePath -

addNewJobs

public void addNewJobs()
Checks if there is a file named addJobs.txt. If yes it adds this jobs to the queue.


readJobs

public void readJobs()
reads the jobs in jobs.txt


saveJobsToFile

public void saveJobsToFile()
saves jobs to file


documentJobsToFile

public void documentJobsToFile(java.lang.String job)
saves jobs to jobs_done.txt file for documentation


updateInformationArea

public void updateInformationArea(int numberOfCarsChecked,
                                  int numberOfCorrectVehiclesFound,
                                  boolean finished)
Updates status text area


updateInformationArea

public void updateInformationArea(java.lang.String text)
Updates status text area in GUI and console mode


updateInformationArea

public void updateInformationArea(java.lang.String text,
                                  boolean b)
Updates status text area. If true the data will be written to a file


writeResultsToFile

public void writeResultsToFile(java.lang.String fileName)
writes the log to file

Parameters:
fileName -

isFilePathChanged

public boolean isFilePathChanged()

setFilePathChanged

public void setFilePathChanged(boolean filePathChanged)

getJobs

public java.util.ArrayList<java.lang.String> getJobs()

setJobs

public void setJobs(java.util.ArrayList<java.lang.String> jobs)

getLogOutput_

public java.lang.String getLogOutput_()

setLogOutput_

public void setLogOutput_(java.lang.String logOutput_)

getLogName

public java.lang.String getLogName()

setLogName

public void setLogName(java.lang.String logName)

getLogType

public java.lang.String getLogType()

setLogType

public void setLogType(java.lang.String logType)

getAttackType

public java.lang.String getAttackType()

setAttackType

public void setAttackType(java.lang.String attackType)

getOperation_

public LogOperations getOperation_()

setOperation_

public void setOperation_(LogOperations operation_)

getActualJob

public java.lang.String getActualJob()

setActualJob

public void setActualJob(java.lang.String actualJob)

isAdvancedFilePathChanged

public boolean isAdvancedFilePathChanged()

setAdvancedFilePathChanged

public void setAdvancedFilePathChanged(boolean advancedFilePathChanged)

getAdvancedFilePath_

public java.lang.String getAdvancedFilePath_()

setAdvancedFilePath_

public void setAdvancedFilePath_(java.lang.String advancedFilePath_)

getPlainJob

public java.lang.String getPlainJob()

setPlainJob

public void setPlainJob(java.lang.String plainJob)

getTimeBufferValue

public double getTimeBufferValue()

setTimeBufferValue

public void setTimeBufferValue(double timeBufferValue)

getTuneTimeValue

public double getTuneTimeValue()

setTuneTimeValue

public void setTuneTimeValue(double tuneTimeValue)

getBiggerStreetValue

public double getBiggerStreetValue()

setBiggerStreetValue

public void setBiggerStreetValue(double biggerStreetValue)

getSmallerStreetValue

public double getSmallerStreetValue()

setSmallerStreetValue

public void setSmallerStreetValue(double smallerStreetValue)

getDrivesStraigthValue

public double getDrivesStraigthValue()

setDrivesStraigthValue

public void setDrivesStraigthValue(double drivesStraigthValue)

getTurnsValue

public double getTurnsValue()

setTurnsValue

public void setTurnsValue(double turnsValue)

getMakesUTurnValue

public double getMakesUTurnValue()

setMakesUTurnValue

public void setMakesUTurnValue(double makesUTurnValue)

getLimitToAngle

public double getLimitToAngle()

setLimitToAngle

public void setLimitToAngle(double limitToAngle)

isUseProbability

public boolean isUseProbability()

setUseProbability

public void setUseProbability(boolean useProbability)