|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbt747.model.Controller
public class Controller
Constructor Summary | |
---|---|
Controller()
Currently needed because class is extended. |
|
Controller(Model model)
|
Method Summary | |
---|---|
static void |
addLogFile(BT747Path path)
|
void |
addWayPointStyle(WayPointStyle style)
|
void |
cancelGetLog()
Cancel the log download process. |
void |
closeGPS()
Close the GPS connection. |
void |
connectGPS()
Connect to the GPS (open the serial connection). |
int |
doConvertLog(int logType)
Convert the log given the provided parameters using other methods. |
int |
doConvertLog(int logOutType,
GPSFileInterface gpsFile,
java.lang.String ext)
|
GPSRecord[] |
doConvertLogToTrackPoints()
Convert the log into an array of trackpoints. |
TracksAndWayPoints |
doConvertLogToTracksAndWayPoints()
|
void |
eraseLog()
Do the actual erase. |
int |
getHeightReference(int logType)
|
GPSLogConvertInterface |
getInputConversionInstance()
|
GPSLogConvertInterface |
getInputConversionInstance(int logOutType)
|
int |
getLastError()
|
java.lang.String |
getLastErrorInfo()
|
GPSFilter[] |
getLogFiltersToUse()
|
Model |
getModel()
|
java.lang.String |
getOutFileExt(int logType)
|
GPSFile |
getOutFileHandler(int logType)
|
GPSRecord[] |
getUserWayPoints()
|
void |
gpsCmd(int cmd)
Do a GPS command. |
void |
gpsCmd(int cmd,
CmdParam param)
Do a GPS command. |
void |
init()
Called when the Controller starts. |
boolean |
isEnableStoreOK()
|
boolean |
isLocationServingActive()
Check whether location updates currently are sent out to external servers. |
void |
logImmediate(int value)
Force the logger to record the current position tagged with the given log reason. |
void |
modelEvent(ModelEvent e)
|
void |
openFreeTextPort(java.lang.String portName)
Select a port by its 'path' (/dev/usb9 for example or /dev/com1. |
void |
performOperationsAfterGPSConnect()
This does a number of operations once the GPS is effectively connected. |
void |
recoveryEraseLog()
A 'recovery Erase' attempts to recover memory that was previously identified as 'bad'. |
void |
replyToOkToOverwrite(boolean isOkToOverwrite)
The GpsModel is waiting for a reply to the question if the currently existing log with different data can be overwritten. |
void |
reqDeviceInfo()
Request a set of device information from the GPS device that can be after specific GpsEvent events. |
void |
reqSettingsForStorage()
|
void |
resetFilters()
|
void |
restoreSetting1()
|
void |
saveSettings()
Save all the user settings to disk. |
void |
sendBT747Exception(BT747Exception e)
|
void |
sendCmd(GpsLinkExecCommand cmd)
Send an arbitrary GPS command. |
void |
setAgpsData(byte[] agpsData)
|
void |
setAutoFetch(boolean isAuto)
Some data will be constantly requested from the device to keep it up to date in the application. |
void |
setAutoLog(boolean enable)
|
void |
setBaudRate(int baudRate)
Sets the port's speed (baud rate). |
void |
setBluetooth()
open a Bluetooth connection Calls getStatus to request initial parameters from the device. |
void |
setBooleanOpt(int param,
boolean value)
|
void |
setBTMacAddr(java.lang.String btMacAddr)
Sets the MAC address for bluetooth (for devices that support it). |
void |
setChunkSize(int chunkSize)
|
void |
setDatumMode(int mode)
Set GPS's Datum mode. |
void |
setDebug(boolean isDebugActive)
Set the general debugging state. |
void |
setDebugConn(boolean isConnDebugActive)
Set the debugging state of the connection. |
void |
setDGPSMode(int mode)
Set the DGPS mode to use when SBAS enabled. |
void |
setDownloadMethod(int downloadMethod)
Set the download method. |
void |
setDownloadTimeOut(int timeout)
|
void |
setFileNameBuilder(BT747FileName builder)
|
void |
setFilterEndTime(int d)
|
void |
setFilters()
|
void |
setFilterStartTime(int d)
|
void |
setFixInterval(int value)
|
void |
setFlashUserOption(boolean lock,
int updateRate,
int baudRate,
int periodGLL,
int periodRMC,
int periodVTG,
int periodGSA,
int periodGSV,
int periodGGA,
int periodZDA,
int periodMCHN)
This sets MTK specific settings into its flash. |
void |
setFloatOpt(int param,
float value)
|
void |
setGpsDecode(boolean value)
|
void |
setHoluxName(java.lang.String deviceName)
Set the textual description of the device. |
void |
setIncremental(boolean incrementalDownload)
Deprecated. Use setDownloadMethod(int) instead |
void |
setIntOpt(int param,
int value)
|
void |
setLogDistanceInterval(int value)
|
void |
setLogFormat(int newLogFormat)
Sets a new log format on the device. |
void |
setLoggingActive(boolean on)
Set logging status of device. |
void |
setLogOverwrite(boolean isOverWriteLog)
Set log overwrite mode on the device. |
void |
setLogRequestAhead(int numberOfRequestsAhead)
|
void |
setLogSpeedInterval(int value)
|
void |
setLogTimeInterval(int value)
|
void |
setModel(Model model)
|
void |
setMtkDataNeeded(int dataType)
Indicates that some data is needed from the MtkDevice. |
void |
setNMEADefaultPeriods()
Sets default NMEA periods (as observed on one iBlue 747 device). |
void |
setNMEAPeriods(int[] periods)
Set the NMEA period settings of the device. |
void |
setNMEAset(int formatNMEA)
Sets the NMEA string types to write to the NMEA output file format. |
void |
setOutputFileRelPath(java.lang.String s)
Set the output file path (including basename, no extension) relative to the BaseDirPath. |
void |
setPort(int port)
open a connection on the given port number. |
void |
setPowerSaveEnabled(boolean set)
Enable the power save mode on the device - this setting is untested. |
void |
setSBASEnabled(boolean set)
Enable SBAS (DGPS). |
void |
setSBASTestEnabled(boolean isSBASTestEnabled)
Sets the enable of SBAS (DGPS) satellites that are in test. |
void |
setStats(boolean b)
|
void |
setStringOpt(int param,
java.lang.String value)
|
void |
setUsb()
open a Usb connection Calls getStatus to request initial parameters from the device. |
void |
setUserWayPoints(GPSRecord[] rcrds)
|
void |
setWayPointStyles(WayPointStyleSet set)
|
void |
startDefaultDownload()
Start the default log download process without taking into account the device type. |
void |
startDownload()
Start the log download process. |
void |
startGPSPositionServing()
If there is no LocationSender yet registered with the Model create such a LocationSender and register it with the Model so that it starts sending out position updates. |
void |
startWPDownload()
Initiate the download of a 'Wonde Proud' log. |
void |
stopErase()
The log is being erased - the user request to abandon waiting for the end of this operation. |
void |
stopGPSPositionServing()
If there is a LocationSender currently registered as Listener with the Model of this instance then remove it from the Listeners of the Model and set registeredLocSender to null. |
void |
stopLogConvert()
Stop the conversion that is ongoing. |
void |
storeSetting1()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Controller(Model model)
model
- The model to associate with this controller.public Controller()
Method Detail |
---|
public void setModel(Model model)
public Model getModel()
public void modelEvent(ModelEvent e)
modelEvent
in interface ModelListener
public final void setAutoLog(boolean enable)
public void init()
public void gpsCmd(int cmd)
cmd
- public void gpsCmd(int cmd, CmdParam param)
cmd
- public final void setOutputFileRelPath(java.lang.String s)
s
- The relative log file path (including basename)public final void setChunkSize(int chunkSize)
chunkSize
- The amount of data that is requested from the device in a
single command when downloading the data.public final void setDownloadTimeOut(int timeout)
timeout
- The timeout in ms after which the lack of reply from the
device will be considered as a communication failure.
Depending on the operation, a recovery will be attempted.public final void setLogRequestAhead(int numberOfRequestsAhead)
numberOfRequestsAhead
- Especially when downloading using Bluetooth, downloading is
slow when no request pipeline is implemented. This number
defines how many 'chunk download' request will be sent to
device while the first reply is still pending.public final void stopLogConvert()
public final void setFileNameBuilder(BT747FileName builder)
public final void setWayPointStyles(WayPointStyleSet set)
public final void addWayPointStyle(WayPointStyle style)
public final GPSFile getOutFileHandler(int logType)
public java.lang.String getOutFileExt(int logType)
public final int doConvertLog(int logType)
logType
- Indicates the type of log that should be written. For
example Model.CSV_LOGTYPE .
getLastErrorInfo()
Model.CSV_LOGTYPE
,
Model.TRK_LOGTYPE
,
Model.KML_LOGTYPE
,
Model.PLT_LOGTYPE
,
Model.GPX_LOGTYPE
,
Model.NMEA_LOGTYPE
,
Model.GMAP_LOGTYPE
public int getHeightReference(int logType)
public GPSLogConvertInterface getInputConversionInstance(int logOutType)
public final GPSLogConvertInterface getInputConversionInstance()
public final GPSFilter[] getLogFiltersToUse()
public final void setUserWayPoints(GPSRecord[] rcrds)
public final GPSRecord[] getUserWayPoints()
public final int doConvertLog(int logOutType, GPSFileInterface gpsFile, java.lang.String ext)
public final GPSRecord[] doConvertLogToTrackPoints()
public final TracksAndWayPoints doConvertLogToTracksAndWayPoints()
public final void setIncremental(boolean incrementalDownload)
setDownloadMethod(int)
instead
incrementalDownload
- true if the log download should be incremental.public final void setDownloadMethod(int downloadMethod)
public final void cancelGetLog()
public final void startDownload()
public final void startDefaultDownload()
public final void replyToOkToOverwrite(boolean isOkToOverwrite) throws BT747Exception
isOkToOverwrite
- If true, the existing log can be overwritten
BT747Exception
public final void stopErase()
public final void startWPDownload()
public final void setLoggingActive(boolean on)
on
- When true, logging will be turned on.public final void setMtkDataNeeded(int dataType)
dataType
- public final void setLogOverwrite(boolean isOverWriteLog)
isOverWriteLog
- true - overwrite data in device when full false - stop
logging when device is fullpublic final void reqDeviceInfo()
GpsEvent
events.
public final void setLogFormat(int newLogFormat)
newLogFormat
- BT747Constants.FMT_UTC_IDX
BT747Constants.FMT_VALID_IDX
BT747Constants.FMT_LATITUDE_IDX
BT747Constants.FMT_LONGITUDE_IDX
BT747Constants.FMT_HEIGHT_IDX
BT747Constants.FMT_SPEED_IDX
BT747Constants.FMT_HEADING_IDX
BT747Constants.FMT_DSTA_IDX
BT747Constants.FMT_DAGE_IDX
BT747Constants.FMT_PDOP_IDX
BT747Constants.FMT_HDOP_IDX
BT747Constants.FMT_VDOP_IDX
BT747Constants.FMT_NSAT_IDX
BT747Constants.FMT_SID_IDX
BT747Constants.FMT_ELEVATION_IDX
BT747Constants.FMT_AZIMUTH_IDX
BT747Constants.FMT_SNR_IDX
BT747Constants.FMT_RCR_IDX
BT747Constants.FMT_MILLISECOND_IDX
BT747Constants.FMT_DISTANCE_IDX
BT747Constants.FMT_LOG_PTS_WITH_VALID_FIX_ONLY_IDX
public final void eraseLog()
public final void recoveryEraseLog()
public final void connectGPS()
public final void closeGPS()
public final void sendCmd(GpsLinkExecCommand cmd)
cmd
- Otherwise the class must be an implementation of
GpsLinkExecCommand
.public final void setAutoFetch(boolean isAuto)
isAuto
- When true, the data is fetched automatically.public final void setBluetooth()
public final void setUsb()
public final void setPort(int port)
port
- Port number to openpublic final void setBaudRate(int baudRate)
baudRate
- The baud rate to set.public final void openFreeTextPort(java.lang.String portName)
portName
- The path to the port.public void performOperationsAfterGPSConnect()
public final void setDebugConn(boolean isConnDebugActive)
isConnDebugActive
- When true, the connection debug information is active.public void saveSettings()
public final void setDebug(boolean isDebugActive)
isDebugActive
- If true, activate general debug.for other debug functionality.
public final void resetFilters()
public final void setFlashUserOption(boolean lock, int updateRate, int baudRate, int periodGLL, int periodRMC, int periodVTG, int periodGSA, int periodGSV, int periodGGA, int periodZDA, int periodMCHN)
lock
- When true, subsequent changes in these settings will be
impossible.updateRate
- The 'fix period' of the GPS in ms. When this is 200, then
the Fix is 5Hz.baudRate
- The speed of the serial communication of the MTK chipset. Be
carefull - this may be the internal speed - not the external
speed!periodGLL
- The period of emission of the GLL sentence (relative to the
fix).periodRMC
- The period of emission of the RMC sentence (relative to the
fix).periodVTG
- The period of emission of the VTG sentence (relative to the
fix).periodGSA
- The period of emission of the GSA sentence (relative to the
fix).periodGSV
- The period of emission of the GSV sentence (relative to the
fix).periodGGA
- The period of emission of the GGA sentence (relative to the
fix).periodZDA
- The period of emission of the ZDA sentence (relative to the
fix).periodMCHN
- The period of emission of the MCHN sentence (relative to the
fix).public final void setBTMacAddr(java.lang.String btMacAddr)
btMacAddr
- The Mac address to set in the following format:public final void setHoluxName(java.lang.String deviceName)
deviceName
- The string to set as the Device Name.public final void setNMEAPeriods(int[] periods)
periods
- The array indexes are given by:BT747Constants.NMEA_SEN_GLL_IDX
BT747Constants.NMEA_SEN_RMC_IDX
BT747Constants.NMEA_SEN_VTG_IDX
BT747Constants.NMEA_SEN_GGA_IDX
BT747Constants.NMEA_SEN_GSA_IDX
BT747Constants.NMEA_SEN_GSV_IDX
BT747Constants.NMEA_SEN_GRS_IDX
BT747Constants.NMEA_SEN_GST_IDX
BT747Constants.NMEA_SEN_MALM_IDX
BT747Constants.NMEA_SEN_MEPH_IDX
BT747Constants.NMEA_SEN_MDGP_IDX
BT747Constants.NMEA_SEN_MDBG_IDX
BT747Constants.NMEA_SEN_ZDA_IDX
BT747Constants.NMEA_SEN_MCHN_IDX
public final void setNMEADefaultPeriods()
public final void setSBASTestEnabled(boolean isSBASTestEnabled)
isSBASTestEnabled
- When true, enable test satellites.public final void setSBASEnabled(boolean set)
set
- When true, enables SBAS.public final void setDatumMode(int mode)
mode
- The datum mode to set.public final void setDGPSMode(int mode)
mode
- The mode to use.public final void setPowerSaveEnabled(boolean set)
set
- If true, enable power save mode.public final void logImmediate(int value)
value
- BT747Constants.RCR_TIME_MASK
BT747Constants.RCR_SPEED_MASK
BT747Constants.RCR_DISTANCE_MASK
BT747Constants.RCR_BUTTON_MASK
BT747Constants.RCR_APP0_MASK
BT747Constants.RCR_APP1_MASK
BT747Constants.RCR_APP2_MASK
BT747Constants.RCR_APP3_MASK
BT747Constants.RCR_APP4_MASK
BT747Constants.RCR_APP5_MASK
BT747Constants.RCR_APP6_MASK
BT747Constants.RCR_APP7_MASK
BT747Constants.RCR_APP8_MASK
BT747Constants.RCR_APP9_MASK
BT747Constants.RCR_APPY_MASK
BT747Constants.RCR_APPZ_MASK
BT747Constants.RCR_ALL_APP_MASK
public final void setFixInterval(int value)
public final void setLogTimeInterval(int value)
public final void setLogDistanceInterval(int value)
public final void setLogSpeedInterval(int value)
public final boolean isEnableStoreOK()
public final void setStats(boolean b)
public final void setGpsDecode(boolean value)
public final void setFilterEndTime(int d)
public final void setFilterStartTime(int d)
public final void storeSetting1()
public final void restoreSetting1()
public final void reqSettingsForStorage()
public final void setFilters()
public final void setNMEAset(int formatNMEA)
formatNMEA
- Bit format using following bit indexes:BT747Constants.NMEA_SEN_GLL_IDX
BT747Constants.NMEA_SEN_RMC_IDX
BT747Constants.NMEA_SEN_VTG_IDX
BT747Constants.NMEA_SEN_GGA_IDX
BT747Constants.NMEA_SEN_GSA_IDX
BT747Constants.NMEA_SEN_GSV_IDX
BT747Constants.NMEA_SEN_GRS_IDX
BT747Constants.NMEA_SEN_GST_IDX
BT747Constants.NMEA_SEN_MALM_IDX
BT747Constants.NMEA_SEN_MEPH_IDX
BT747Constants.NMEA_SEN_MDGP_IDX
BT747Constants.NMEA_SEN_MDBG_IDX
BT747Constants.NMEA_SEN_ZDA_IDX
BT747Constants.NMEA_SEN_MCHN_IDX
public final int getLastError()
public final java.lang.String getLastErrorInfo()
public void setBooleanOpt(int param, boolean value)
public void setIntOpt(int param, int value)
public void setFloatOpt(int param, float value)
public void setStringOpt(int param, java.lang.String value)
public static final void addLogFile(BT747Path path)
public final void setAgpsData(byte[] agpsData)
public final void sendBT747Exception(BT747Exception e)
public boolean isLocationServingActive()
public void startGPSPositionServing()
public void stopGPSPositionServing()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |