Skip to content

Commit

Permalink
fix source code for Exingtech Y1 scale
Browse files Browse the repository at this point in the history
add Exingtech Y1 photo
add translation for Turkish
  • Loading branch information
oliexdev committed Dec 7, 2017
1 parent c9a8c1a commit e8170ac
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,18 @@ boolean nextInitCmd(int stateNr) {
setNotificationOn(WEIGHT_MEASUREMENT_SERVICE, WEIGHT_MEASUREMENT_CHARACTERISTIC, WEIGHT_MEASUREMENT_CONFIG);
break;
case 1:
sendUserData();
final ScaleUser selectedUser = OpenScale.getInstance(context).getSelectedScaleUser();

byte gender = selectedUser.isMale() ? (byte)0x00 : (byte)0x01; // 00 - male; 01 - female
byte height = (byte)(selectedUser.body_height & 0xff); // cm
byte age = (byte)(selectedUser.getAge(new Date()) & 0xff);

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
int userId = prefs.getInt("selectedUserId", -1);

byte cmdByte[] = {(byte)0x10, (byte)userId, gender, age, height};

writeBytes(WEIGHT_MEASUREMENT_SERVICE, CMD_MEASUREMENT_CHARACTERISTIC, cmdByte);
break;
default:
return false;
Expand All @@ -81,7 +92,7 @@ public void onBluetoothDataChange(BluetoothGatt bluetoothGatt, BluetoothGattChar

if (data != null && data.length > 0) {
// if data is body scale type
if (data.length == 20) {
if (data[0] == (byte)0x01 && data.length == 20) {
parseBytes(data);
}
}
Expand Down Expand Up @@ -114,19 +125,4 @@ private void parseBytes(byte[] weightBytes) {

addScaleData(scaleBtData);
}

private void sendUserData() {
final ScaleUser selectedUser = OpenScale.getInstance(context).getSelectedScaleUser();

byte gender = selectedUser.isMale() ? (byte)0x00 : (byte)0x01; // 00 - male; 01 - female
byte height = (byte)(selectedUser.body_height & 0xff); // cm
byte age = (byte)(selectedUser.getAge(new Date()) & 0xff);

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
int userId = prefs.getInt("selectedUserId", -1);

byte cmdByte[] = {(byte)0x10, (byte)userId, gender, age, height};

writeBytes(WEIGHT_MEASUREMENT_SERVICE, CMD_MEASUREMENT_CHARACTERISTIC, cmdByte);
}
}
180 changes: 180 additions & 0 deletions android_app/app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name= "app_name">openScale</string>
<string name="title_overview">Genel Bakýþ</string>
<string name="title_graph">Çizelge</string>
<string name="title_table">Tablo</string>
<string name="title_statistics">Ýstatistik</string>
<string name="title_users">Kullanýcý</string>
<string name="title_data">Veri</string>
<string name="title_measurements">Ölçüler</string>
<string name="title_about">Yaklaþýk</string>

<string name="action_settings">Ayarlar</string>
<string name="action_bluetooth_status">Bluetooth Konumu</string>

<string name="label_add">Ekle</string>
<string name="label_cancel">Ýptal</string>
<string name="label_ok">Tamam</string>
<string name="label_yes">Evet</string>
<string name="label_no">Hayýr</string>
<string name="label_delete">Sil</string>
<string name="label_add_user">Kullanýcý ekle</string>

<string name="label_id">Id</string>
<string name="label_weight">Aðýrlýk</string>
<string name="label_bmi">Vucüt Kitle Endeksi (BMI)</string>
<string name="label_bmr">Bazal Metabolik Oraný (BMR)</string>
<string name="label_fat">Vücüt Yað Yüzdesi</string>
<string name="label_water">Su Yüzdesi</string>
<string name="label_muscle">Kas Yüzdesi</string>
<string name="label_lbw">Yaðsýz vücüt aðýrlýðý</string>
<string name="label_waist">Bel çevresi</string>
<string name="label_hip">Kalça çevresi</string>
<string name="label_comment">Yorum</string>
<string name="label_whtr">Bel-Boy oraný</string>
<string name="label_whr">Bel-Kalça oraný</string>
<string name="label_bone">Kemik kütlesi</string>
<string name="label_smartUserAssign">Akýllý kullanýcý atamasý</string>

<string name="label_days">Günler</string>
<string name="label_measures">Ölçüler</string>
<string name="label_last_week">Son 7 Gün</string>
<string name="label_last_month">Son 30 Gün</string>
<string name="label_weight_difference">Aðýrlýk farký</string>
<string name="label_goal_date_is">Hedef tarihi</string>
<string name="label_days_left">Geçen günler</string>

<string name="label_date">Tarih</string>
<string name="label_time">Zaman</string>
<string name="label_birthday">Doðum Tarihi</string>
<string name="label_user_name">Ýsim</string>
<string name="label_body_height">Boy uzunluðu</string>
<string name="label_scale_unit">Ölçek birimi</string>
<string name="label_gender">Cinsiyet</string>
<string name="label_male">Erkek</string>
<string name="label_woman">Kadýn</string>
<string name="label_goal_weight">Hedef Kilo</string>
<string name="label_goal_date">Hedef Tarihi</string>


<string name="label_title_user">Kullanýcý</string>
<string name="label_title_last_measurement">Son ölçüm</string>
<string name="label_title_goal">Hedef</string>
<string name="label_title_statistics">Ýstatistik</string>

<string name="label_import">Import</string>
<string name="label_export">Export</string>
<string name="label_delete_all">Hepsini Sil</string>

<string name="error_value_required">Deðer gerekli</string>
<string name="error_value_range">Deðer aralýkta deðil</string>
<string name="error_exporting">Hatalý export</string>
<string name="error_importing">Hatalý import</string>
<string name="error_user_name_required">Hata: kullanýcý adý gerekiyor</string>
<string name="error_body_height_required">Error: Vücut boyu gerekli</string>
<string name="error_initial_weight_required">Error: Baþlangýç aðýrlýðý gerekli</string>
<string name="error_goal_weight_required">Error: Hedef aðýrlýk gerekli</string>
<string name="error_hip_value_required">Kalça çevre aðýrlýðý gerekli</string>

<string name="info_data_deleted">Database entry deleted</string>
<string name="info_data_all_deleted">Veri tabaný giriþi silindi</string>
<string name="info_data_exported">Veri dýþarý aktarma</string>
<string name="info_data_imported">Veri içeri aktarma</string>
<string name="info_set_filename">Dosya adýný ayarla</string>
<string name="info_enter_value_cm">Deðeri cm olarak girin</string>
<string name="info_enter_value_percent">Deðeri % olarak girin</string>
<string name="info_enter_value_unit">Ýçine deðer girin</string>
<string name="info_enter_comment">Ýsteðebaðlý açýklama girin</string>
<string name="info_enter_initial_weight">Kendi baþlangýç aðýrlýðýnýzý girin</string>
<string name="info_enter_goal_weight">Kendi Hedef hedef kilonuzu girin </string>
<string name="info_is_visible">görünür</string>
<string name="info_is_not_visible">görünmez</string>
<string name="info_is_enable">etkindir</string>
<string name="info_is_not_enable">etkin deðildir</string>
<string name="info_is_not_available">Mevcut deðil</string>
<string name="info_delete_bluetooth_data">Tüm Bluetooth verisini sil</string>
<string name="info_delete_bluetooth_data_success">Bluetooth veri silinmesi baþarýlý oldu</string>
<string name="info_bluetooth_try_connection">Baðlanmaya çalýþýyorsunuz</string>
<string name="info_bluetooth_connection_lost">Bluetooth baðlantýsý koptu</string>
<string name="info_bluetooth_no_device">Bluetooth cihazý bulunamadý</string>
<string name="info_bluetooth_connection_successful">Baðlantý baþarýyla kuruldu</string>
<string name="info_bluetooth_init">Bluetooth cihazý bulunmaya çalýþýlýyor</string>
<string name="info_bluetooth_connection_error">Beklenmedik Bluetooth hatasý</string>
<string name="info_new_data_added">%1$.2f%2$s [%3$s] to %4$s added</string>

<string name="info_enter_user_name">Ýsminizi girin</string>
<string name="info_no_selected_user">Kullanýcý bulunmuyor. Lütfen ayarlardan yeni kullanýcý oluþturun.</string>
<string name="info_no_evaluation_available">Can\'t evaluate the value</string>

<string name="question_really_delete">Veri tabanýný gerçekten silmek istiyormusunuz?</string>
<string name="question_really_delete_all">Tüm girilen verileri gerçekten silmek istiyormusunuz?</string>
<string name="question_really_delete_user">Kullanýcýyý gerçekten silmek istiyormusunuz? </string>

<string name="label_bluetooth_title">Bluetooth</string>
<string name="label_bluetooth_enable">Baskülü aramaya baþlandý</string>
<string name="label_bluetooth_searching">Bluetooth Baskül aranýyor</string>
<string name="label_device_type">Cihaz Tipi</string>

<string name="label_enable_labels">Label on data point</string>
<string name="label_enable_points">Point on data point</string>

<string name="label_delete_confirmation">Delete confirmation</string>

<string name="label_estimate_water">Tahmini Vücüt suyu oraný</string>
<string name="label_estimate_lbw">Tahmini Yaðsýz vücüt oraný</string>
<string name="label_estimate_fat">Tahmini Vücüt yað oraný</string>

<string name="label_category_display">Display</string>
<string name="label_category_body_metrics_estimation">Vücüt ölçütleri tahmini</string>
<string name="label_category_measurement_database">Ölçüm veritabaný</string>
<string name="label_category_misc">Miscellaneous</string>

<string name="label_maintainer">Maintainer</string>
<string name="label_website">Websitesi</string>
<string name="label_license">Lisan</string>

<string name="label_estimate_water_formula">Vücüt oraný hesaplama formulü</string>
<string name="label_estimate_lbw_formula">Yað oraný hesaplama formulü</string>
<string name="label_estimate_fat_formula">Vücut yaðý formülü</string>
<string name="label_automatic">otomatik</string>

<string name="label_reminder">Hatýrlatma</string>
<string name="label_reminder_weekdays">Hafta içi</string>
<string name="label_reminder_time">Zaman</string>
<string name="label_reminder_notify_text">Bildirim metni</string>
<string name="default_value_reminder_notify_text">Aðýrlýk zamaný</string>

<string name="info_your_weight">Kilonuz</string>
<string name="info_your_fat">Yað oranýnýz</string>
<string name="info_your_water">Su oraný yüzdeniz</string>
<string name="info_your_muscle">Kas oraný yüzdeniz</string>
<string name="info_your_waist">Bel çevreniz</string>
<string name="info_your_hip">Kalça çevreniz</string>
<string name="info_on_date">Üzerinde</string>

<string name="Monday">Pazartesi</string>
<string name="Tuesday">Salý</string>
<string name="Wednesday">Çarþamba</string>
<string name="Thursday">Perþembe</string>
<string name="Friday">Cuma</string>
<string name="Saturday">Cumartesi</string>
<string name="Sunday">Pazar</string>
<string name="label_bt_device_no_support">Cihazýnýz desteklenmiyor</string>
<string name="label_exportBackup">Export yedekleme</string>
<string name="label_importBackup">Import yedekleme</string>
<string name="label_backup">Yedekleme</string>
<string name="label_export_dir">Export rehberi</string>
<string name="label_not_found">Bulunamadý</string>
<string name="label_ignoreOutOfRange">Mesafenin dýþýndaki verileri yoksay</string>
<string name="label_initial_weight">Baþlangýç ??aðýrlýðý</string>
<string name="label_average_data">Ortalama hesap Günlük/Aylýk</string>
<string name="label_regression_line">Regresyon aðýrlýk çizgisi</string>
<string name="label_regression_line_degree">Regresyon polinom derecesi</string>
<string name="label_goal_line">Hedef çizgisi</string>


<string name="error_max_scale_users">Maksimum eþzamanlý ölçekli kullanýcý sayýsý ulaþtý.</string>
<string name="info_step_on_scale">Referans ölçümleri için lütfen ölçekte çýplak ayakla adým atýn.</string>
<string name="info_measuring">Aðýrlýðý ölçme: %.2f</string>
</resources>
Binary file added doc/scales/exingtech_y1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e8170ac

Please sign in to comment.