terzis/Speedometer — comment on commit 013230e3dc90734f7024b905d67c2b1f6568a386
File: android/src/com/google/wireless/speed/speedometer/measurements/UDPBurstTask.java line 44
By mdwelsh:

Hi Andreas,

My suggestion is to have a single UDPBurst type and have a *parameter*
to that measurement type be up or down. This is just like specifying
the target for a ping or the number of times to perform a ping. In
this case the value is binary rather than a text string or an integer,
in which case you could use a checkbox or radio button to specify the
direction. Doesn't that work?

Matt

On Tue, Feb 14, 2012 at 7:57 PM, Andreas Terzis

wrote:
> Let me try to repeat what I said and what my understanding of how things work is:
>
> -OnCreate() in MeasurementCreationActivity creates the entries in the pull down menu from the keys of the measurementDescToType HashMap in MeasurementTask. This HashMap maps description strings (the things that are shown in the pull down menu) to measurement types.
>
> -Then the user selects one of the entries in the pull down menu (e.g., traceroute, HTTP, etc.). onItemSelected() in MeasurementCreationActivity is called. This method sets measurentTypeUnderEdit by looking up the string the user selected into the measurementDescToType HashMap. This HashMap maps the user-visible measurement descriptions to Measurement type names (see MeasurementTask.java).
>
> -Next, ButtonOnClickListener() in MeasurementCreationActivity is called and it creates the appropriate MeasurementTask based on the value of the measurementTypeUnderEdit string. The value of this string is the only thing we have to decide whether we will do a UDP Burst Up or UDP Burst Down measurement. This is why I have defined UDPBurstTask.TYPE_UP and TYPE_DOWN.
>
> One possible solution is to name these strings MEAS_UP and MEAS_DOWN and have a single UDPBurstUp.TYPE. Do you thing is good or do you have another suggestion?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/terzis/Speedometer/commit/013230e3dc90734f7024b905d67c2b1f6568a386#commitcomment-967822