-
Notifications
You must be signed in to change notification settings - Fork 814
Thermometer working added and crash fixed #1754
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
Conversation
e2c6c73 to
f3fe57e
Compare
CloudyPadmal
left a comment
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.
Make sure all the wordings have been replaced correctly when copying another class as whole. It might lead to errors. Only make the PR when it is clean and ready. Fixing these kind of stuff is not part of review.
| android:padding="15dp" | ||
| app:sv_speedTextColor="@color/black" | ||
| app:sv_speedTextPosition="BOTTOM_CENTER" | ||
| app:sv_speedTextSize="@dimen/lux_display_font_size" |
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.
Can you make separate variables for thermometer replacing the luxs?
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.
No . I kept it the same knowigly because the dimen value are going to be same eventually in UI but I will change it if that is better
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.
Yes, all needs to be changed. The real reason why we are using resources instead of hard-coded values is that, it will be easier and practical to make modifications from one place. Putting luxmeter dimensions is in fact similar to hard-coding.
app/src/main/res/values/strings.xml
Outdated
| <string name="thermometer_bottom_sheet_text">Thermometer instrument is used to measure ambient temprature. It can be measured using inbuilt ambient temprature sensor or through SHT21.</string> | ||
| <string name="thermometer_bottom_sheet_desc">Thermometer instrument is used to measure ambient temprature. It can be measured using inbuilt ambient temprature sensor or through SHT21.</string> | ||
| <string name="no_thermometer_sensor">Device does not have Thermometer Sensor</string> | ||
| <string name="thermo_unit">F</string> |
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.
We'll use Celcius
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.
And let user select which unit want from configurations
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.
Yes , I am going to add that functionality . I just wanted to confirm it works or not till here.
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.
I was referring to units here. Throughout the app we are using Metric units, not imperial
|
|
||
| count++; | ||
| sum += entry.getY(); | ||
| statMean.setText(String.format(Locale.getDefault(), PSLabSensor.LUXMETER_DATA_FORMAT, (sum / count))); |
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.
All these Lux stuff need to be thermo related
neel1998
left a comment
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.
Do we need to have max value to be 10000 F? It seems too high
|
Besides, i think a gauge is not a good way to represent data in a thermometer. We can implement some color bar instead. Please look into this @ho-dor . Thanks. |
How about we change the background of gauge as the temp changes, like make it green for low temp and red for higher temp ? |
Ok for now. Blue for low temps and red for high temps |
|
@neel1998 @CloudyPadmal please check |
| import android.os.Handler; | ||
| import android.support.annotation.NonNull; | ||
| import android.support.annotation.Nullable; | ||
| import android.support.v14.preference.PreferenceFragment; |
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.
Codacy complains this as unused
|
Rest looks ok. We can progress from here |
|
Looks ok to me as well |
|
codacy resolved |
|
Once this gets merged , I will make a PR for #1756. @CloudyPadmal @neel1998 |
|
I have changed the sensor to SHT21 as that is more suitable for this purpose. |
|
@ho-dor there is still one unused import in codacy. Remove it in this PR or remember to remove in next one. Also can you send the latest apk once to test |
|
@neel1998 check |
|
Can you comment the apk file here? |
The apk file isn't supported to upload here . I have added the latest zip of apk in PR |
|
I have increased the range on x-axis and the graph is more like lux meter. I am unable to understand the graph of baro meter as the max value that pressure can reach is 2 according to the range but the graph only shows till 0.45 atm on y-axis. |
|
This has nothing to do with range, the x - axis should increment every second, which is not happening in the thermometer, also the graph going blank after a while is also not an issue of range |
I have set the graph updation period to 100 ms in place of 1000 ms that is why it is getting updated quick , but the graph going blank is because of the x-axis range that I have set to 800 now , if you will see , now the graph continues till 800 s earlier it was till 80 s. |
|
So have you changed to 1000 ms? |
|
Yes , check the updated apk |
|
looks good now |

Fixes #1750 #1752
Changes: Added backend code for thermometer .
Screenshot/s for the changes:

Checklist: [Please tick following check boxes with
[x]if the respective task is completed]strings.xml,dimens.xmlandcolors.xmlwithout hard-coding themstrings.xml,dimens.xmlorcolors.xmlAPK for testing:
app-debug.zip