-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[0285] ShowConstantTBT Description Update #1581
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
|
||
/** | ||
* This is a unit test class for the SmartDeviceLink library project class : | ||
* {@link com.smartdevicelink.proxy.rpc.ShowConstantTbt} | ||
* {@link ShowConstantTbt} | ||
*/ | ||
public class ShowConstantTbtTests extends BaseRpcTests { | ||
|
||
|
@@ -71,8 +71,8 @@ protected JSONObject getExpectedParameters(int sdlVersion) { | |
result.put(ShowConstantTbt.KEY_SOFT_BUTTONS, TestValues.JSON_SOFTBUTTONS); | ||
result.put(ShowConstantTbt.KEY_ETA, TestValues.GENERAL_STRING); | ||
result.put(ShowConstantTbt.KEY_MANEUVER_COMPLETE, true); | ||
result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE, TestValues.GENERAL_DOUBLE); | ||
result.put(ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE, TestValues.GENERAL_DOUBLE); | ||
result.put(ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER, TestValues.GENERAL_DOUBLE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss On line 74 I would rename |
||
result.put(ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER_SCALE, TestValues.GENERAL_DOUBLE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss On line 75 I would rename |
||
result.put(ShowConstantTbt.KEY_TEXT1, TestValues.GENERAL_STRING); | ||
result.put(ShowConstantTbt.KEY_TEXT2, TestValues.GENERAL_STRING); | ||
result.put(ShowConstantTbt.KEY_TIME_TO_DESTINATION, TestValues.GENERAL_STRING); | ||
|
@@ -156,8 +156,8 @@ public void testJsonConstructor() { | |
JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS); | ||
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_ETA), cmd.getEta()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_COMPLETE), cmd.getManeuverComplete()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE), cmd.getDistanceToManeuver()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_MANEUVER_DISTANCE_SCALE), cmd.getDistanceToManeuverScale()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER), cmd.getDistanceToManeuver()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readDoubleFromJsonObject(parameters, ShowConstantTbt.KEY_DISTANCE_TO_MANEUVER_SCALE), cmd.getDistanceToManeuverScale()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT1), cmd.getNavigationText1()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TEXT2), cmd.getNavigationText2()); | ||
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, ShowConstantTbt.KEY_TIME_TO_DESTINATION), cmd.getTimeToDestination()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
|
||
/** | ||
* This is a unit test class for the SmartDeviceLink library project class : | ||
* {@link com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse} | ||
* {@link ShowConstantTbtResponse} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete line 24 and replace it with its old line |
||
*/ | ||
public class ShowConstantTbtResponseTests extends BaseRpcTests { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
|
||
import com.smartdevicelink.protocol.enums.FunctionID; | ||
import com.smartdevicelink.proxy.RPCRequest; | ||
import com.smartdevicelink.util.SdlDataTypeConverter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would remove this import on line 36 (The idea is to just make the description changes and nothing else) |
||
|
||
import java.util.Hashtable; | ||
import java.util.List; | ||
|
@@ -55,8 +56,8 @@ public class ShowConstantTbt extends RPCRequest { | |
public static final String KEY_TEXT2 = "navigationText2"; | ||
public static final String KEY_ETA = "eta"; | ||
public static final String KEY_TOTAL_DISTANCE = "totalDistance"; | ||
public static final String KEY_MANEUVER_DISTANCE = "distanceToManeuver"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss Lines 59-60 and 206-252 are good. I would revert the other changes, since they are out of scope of the PR. |
||
public static final String KEY_MANEUVER_DISTANCE_SCALE = "distanceToManeuverScale"; | ||
public static final String KEY_DISTANCE_TO_MANEUVER = "distanceToManeuver"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss On line 59 I would rename this variable back to its old name |
||
public static final String KEY_DISTANCE_TO_MANEUVER_SCALE = "distanceToManeuverScale"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss On line 60 I would rename this variable back to its old name |
||
public static final String KEY_MANEUVER_IMAGE = "turnIcon"; | ||
public static final String KEY_NEXT_MANEUVER_IMAGE = "nextTurnIcon"; | ||
public static final String KEY_MANEUVER_COMPLETE = "maneuverComplete"; | ||
|
@@ -203,45 +204,53 @@ public Image getNextTurnIcon() { | |
} | ||
|
||
/** | ||
* Sets a Fraction of distance till next maneuver | ||
* Sets the distanceToManeuver. | ||
* | ||
* @param distanceToManeuver a Double value representing a Fraction of distance till next maneuver | ||
* <p></p> | ||
* <b>Notes: </b>Minvalue=0; Maxvalue=1000000000 | ||
* @param distanceToManeuver Distance (in meters) until next maneuver. May be used to calculate progress bar. | ||
* {"num_min_value": 0.0, "num_max_value": 1000000000.0} | ||
* @since SmartDeviceLink 2.0.0 | ||
*/ | ||
public ShowConstantTbt setDistanceToManeuver(Double distanceToManeuver) { | ||
setParameters(KEY_MANEUVER_DISTANCE, distanceToManeuver); | ||
setParameters(KEY_DISTANCE_TO_MANEUVER, distanceToManeuver); | ||
return this; | ||
} | ||
|
||
/** | ||
* Gets a Fraction of distance till next maneuver | ||
* Gets the distanceToManeuver. | ||
* | ||
* @return Double -a Double value representing a Fraction of distance till next maneuver | ||
* @return Float Distance (in meters) until next maneuver. May be used to calculate progress bar. | ||
* {"num_min_value": 0.0, "num_max_value": 1000000000.0} | ||
* @since SmartDeviceLink 2.0.0 | ||
*/ | ||
public Double getDistanceToManeuver() { | ||
return getDouble(KEY_MANEUVER_DISTANCE); | ||
Object object = getParameters(KEY_DISTANCE_TO_MANEUVER); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete lines 226 and 227 and replace it with the old code |
||
return SdlDataTypeConverter.objectToDouble(object); | ||
} | ||
|
||
/** | ||
* Sets a Distance till next maneuver (starting from) from previous maneuver | ||
* Sets the distanceToManeuverScale. | ||
* | ||
* @param distanceToManeuverScale a Double value representing a Distance till next maneuver (starting from) from previous maneuver | ||
* <p></p> | ||
* <b>Notes: </b>Minvalue=0; Maxvalue=1000000000 | ||
* @param distanceToManeuverScale Distance (in meters) from previous maneuver to next maneuver. May be used to calculate | ||
* progress bar. | ||
* {"num_min_value": 0.0, "num_max_value": 1000000000.0} | ||
* @since SmartDeviceLink 2.0.0 | ||
*/ | ||
public ShowConstantTbt setDistanceToManeuverScale(Double distanceToManeuverScale) { | ||
setParameters(KEY_MANEUVER_DISTANCE_SCALE, distanceToManeuverScale); | ||
setParameters(KEY_DISTANCE_TO_MANEUVER_SCALE, distanceToManeuverScale); | ||
return this; | ||
} | ||
|
||
/** | ||
* Gets a Distance till next maneuver (starting from) from previous maneuver | ||
* Gets the distanceToManeuverScale. | ||
* | ||
* @return Double -a Double value representing a Distance till next maneuver (starting from) from previous maneuver | ||
* @return Float Distance (in meters) from previous maneuver to next maneuver. May be used to calculate | ||
* progress bar. | ||
* {"num_min_value": 0.0, "num_max_value": 1000000000.0} | ||
* @since SmartDeviceLink 2.0.0 | ||
*/ | ||
public Double getDistanceToManeuverScale() { | ||
return getDouble(KEY_MANEUVER_DISTANCE_SCALE); | ||
Object object = getParameters(KEY_DISTANCE_TO_MANEUVER_SCALE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete lines 252-253 and replace it with the old code |
||
return SdlDataTypeConverter.objectToDouble(object); | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,19 +46,27 @@ | |
*/ | ||
public class ShowConstantTbtResponse extends RPCResponse { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would revert these changes in |
||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete the comment block on lines 49-51. The idea is that nothing should be changed in this file. |
||
* Constructs a new ShowConstantTBTResponse object | ||
*/ | ||
public ShowConstantTbtResponse() { | ||
super(FunctionID.SHOW_CONSTANT_TBT.toString()); | ||
} | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete the comment block on lines 56-60. The idea is that nothing should be changed in this file. |
||
* Constructs a new ShowConstantTBTResponse object indicated by the Hashtable parameter | ||
* | ||
* @param hash The Hashtable to use | ||
*/ | ||
public ShowConstantTbtResponse(Hashtable<String, Object> hash) { | ||
super(hash); | ||
} | ||
|
||
/** | ||
* Constructs a new ShowConstantTbtResponse object | ||
* | ||
* @param success whether the request is successfully processed | ||
* @param resultCode whether the request is successfully processed | ||
* @param success whether the request is successfully processed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KostyaBoss I would delete lines 68-69 and bring back the old formatted code. |
||
* @param resultCode additional information about a response returning a failed outcome | ||
*/ | ||
public ShowConstantTbtResponse(@NonNull Boolean success, @NonNull Result resultCode) { | ||
this(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KostyaBoss On line 33 I would remove it and change it back to
{@link com.smartdevicelink.proxy.rpc.ShowConstantTbt}
The idea is that nothing should be changed in this class.