JDMaintenanceManager Class Reference

Creates a manager used to safely request and create user data. More...

List of all members.

Public Member Functions

(instancetype) - init
(NSArray *) - getFieldsForTractor:
(NSArray *) - getUnrestrictedFieldsForTractor:
(NSArray *) - getHistoryForTractor:
(BOOL) - setField:withText:forTractor:
(BOOL) - setField:withReal:forTractor:
(BOOL) - isFieldText:
(BOOL) - isFieldReal:
(NSString *) - getFieldText:
(NSNumber *) - getFieldReal:
(BOOL) - updateWithDownloadBlock:forTractor:
(BOOL) - setNumerical:withParam:forTractor:
(BOOL) - setFuelLevel:forTractor:
(BOOL) - setEngineHours:forTractor:
(BOOL) - setMachineID:forTractor:
(BOOL) - setEngineTurnOnCount:forTractor:
(BOOL) - setKeyTurnOnCount:forTractor:
(BOOL) - setTirePressure:forTractor:
(BOOL) - setBool:withParam:forTractor:
(BOOL) - setIsGPSAvailable:forTractor:
(BOOL) - setIsRDALicenseAvailable:forTractor:
(BOOL) - setString:withParam:forTractor:
(BOOL) - setTerminalSerialNumber:forTractor:
(BOOL) - check:
(BOOL) - unCheck:
(BOOL) - parseGeneral:withResponse:forTractor:
(BOOL) - parseFuelLevel:forTractor:
(BOOL) - parseMachineHours:forTractor:
(bool) - createMaintenanceTable
(BOOL) - setFieldValue:withType:withText:withNumber:forTractor:

Properties

JDDatabaseManagerdbManager

Detailed Description

Creates a manager used to safely request and create user data.


Member Function Documentation

- (BOOL) check: (unsigned long)  itemID  

Set checked on the maintenance item.

Parameters:
itemID the item to set IsChecked for
Returns:
true on success false on failure
- (NSNumber *) getFieldReal: (JDFieldArray *)  fields  

get the real value from the field array

Parameters:
fields The Field Array to get from
Returns:
number result stored in field array FieldNumberValue entry
- (NSArray *) getFieldsForTractor: (unsigned long)  tractorID  

Gets current available maintenance data for tractor from database restricted by user type

Parameters:
tractorID ID of the tractor to get info for
Returns:
List of maintenance information or null if nothing. Output restricted by user type.
- (NSString *) getFieldText: (JDFieldArray *)  fields  

get the text value from the field array

Parameters:
fields The Field Array to get from
Returns:
text result stored in field array FieldTextValue entry
- (NSArray *) getHistoryForTractor: (unsigned long)  tractorID  

Gets all available maintenance data for tractor from database

Parameters:
tractorID ID of the tractor to get info for
Returns:
List of maintenance information or null if nothing
- (NSArray *) getUnrestrictedFieldsForTractor: (unsigned long)  tractorID  

Gets current available maintenance data for tractor from database with out regard for user type

Parameters:
tractorID ID of the tractor to get info for
Returns:
List of maintenance information or null if nothing
- (instancetype) init  

Initializes Tractor Manager and makes sure databases exists.

- (BOOL) isFieldReal: (JDFieldArray *)  fields  

check if the maintenance field is a real value

Parameters:
fields The Field Array to check
Returns:
true of a real field, false otherwise
- (BOOL) isFieldText: (JDFieldArray *)  fields  

check if the maintenance field is a text value

Parameters:
fields The Field Array to check
Returns:
true of a text field, false otherwise
- (BOOL) parseFuelLevel: (NSString *)  responseString
forTractor: (unsigned long)  tractorID 

parse the response string from a download and add to database for machine hours

Parameters:
responseString response string from an MTG download
tractorID id of the tractor to add field for
Returns:
false if response string is NULL or if the add to db failed. Otherwise true.
- (BOOL) parseGeneral: (NSString *)  fieldName
withResponse: (NSString *)  responseString
forTractor: (unsigned long)  tractorID 

parse the response string from a download and add to database for general fields

Parameters:
fieldName name of the maintenance field to parse/update
responseString response string from an MTG download
tractorID id of the tractor to add field for
Returns:
false if response string is NULL or if the add to db failed. Otherwise true.
- (BOOL) parseMachineHours: (NSString *)  responseString
forTractor: (unsigned long)  tractorID 

parse the response string from a download and add to database for machine hours

Parameters:
responseString response string from an MTG download
tractorID id of the tractor to add field for
Returns:
false if response string is NULL or if the add to db failed. Otherwise true.
- (BOOL) setBool: (NSString *)  fieldName
withParam: (bool)  parameter
forTractor: (unsigned long)  tractorID 

Sets a boolean value for a parameter and tractor, currently just uses text field

Todo:
update to use boolean perhaps? not necessary at this time but maybe future will need
Parameters:
fieldName name of the field to set in maintenance table
parameter the bool value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setEngineHours: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Update engine hours

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setEngineTurnOnCount: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Update engine turn on count

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setField: (NSString *)  field
withReal: (NSNumber *)  value
forTractor: (unsigned long)  tractorID 

Set a field to the maintenance list for the given tractor id, adds if not exist

Parameters:
field name of maintenance field to set
value Number of real value to set for value
tractorID ID of the tractor to get info for
Returns:
True on success, false on failure
- (BOOL) setField: (NSString *)  field
withText: (NSString *)  value
forTractor: (unsigned long)  tractorID 

Set a field to the maintenance list for the given tractor id, adds if not exist

Parameters:
field name of maintenance field to set
value String of text to set for value
tractorID ID of the tractor to get info for
Returns:
True on success, false on failure
- (BOOL) setFuelLevel: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Udate fuel level

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setIsGPSAvailable: (bool)  parameter
forTractor: (unsigned long)  tractorID 

update is gps available

Parameters:
fieldName name of the field to set in maintenance table
parameter the bool value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setIsRDALicenseAvailable: (bool)  parameter
forTractor: (unsigned long)  tractorID 

update is rda license available

Parameters:
parameter the bool value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setKeyTurnOnCount: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Update Key turn on count

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setMachineID: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Update Machine ID

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setNumerical: (NSString *)  fieldName
withParam: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

Sets a numerical value for a parameter and tractor, currently just unsigned long

Parameters:
fieldName name of the field to set in maintenance table
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setString: (NSString *)  fieldName
withParam: (const char*)  parameter
forTractor: (unsigned long)  tractorID 

Sets a string value for a parameter and tractor

Todo:
update to use boolean perhaps? not necessary at this time but maybe future will need
Parameters:
fieldName name of the field to set in maintenance table
parameter the text value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setTerminalSerialNumber: (const char*)  parameter
forTractor: (unsigned long)  tractorID 

update is rda license available

Parameters:
fieldName name of the field to set in maintenance table
parameter the text value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) setTirePressure: (unsigned long)  parameter
forTractor: (unsigned long)  tractorID 

update tire pressure

Parameters:
parameter the numerical value for the field
tractorID ID of the tractor to store data for
Returns:
true on success false on failure
- (BOOL) unCheck: (unsigned long)  itemID  

Set not checked on the maintenance item.

Parameters:
itemID the item to set not IsChecked for
Returns:
true on success false on failure
- (BOOL) updateWithDownloadBlock: (JDDownloadBlock dlb
forTractor: (unsigned long)  tractorID 

================================================================================================================ These functions handle data from a download block Take data from a download block and insert it into maintenance database

Parameters:
dlb the download block to scrape out data
Returns:
true on complete success, false on failure or partial falure

The documentation for this class was generated from the following files:
 All Classes Functions Properties

Generated on 27 Apr 2015 for My Project by  doxygen 1.6.1