Анкета здоровья
This commit is contained in:
@ -615,7 +615,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
"insecticide_dose float," + //норма расхода(л/га)
|
||||
"insecticide_rate float," + //расход рабочей жидкости(л/га)
|
||||
"insecticide_used_volume float," + //Общий объем использованной рабочей жидкости (л)
|
||||
"insecticide_number_spores float," + //Концентрация спор (/мл)
|
||||
"insecticide_number_spores float," + //Концентрация спор (/мл) (--------- В 2024 ссказали удалить поэтому не используется ---------)
|
||||
"insecticide_expiry_date integer," + //окончание срока действия (в нов. версии не используется)
|
||||
"insecticide_mixed text," + //смешивается ли инсектицид с водой или растворителем? (в нов. версии не используется)
|
||||
"insecticide_mixed_name text," + //если да, то с чем (в нов. версии не используется)
|
||||
@ -649,13 +649,13 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
"spray_platform_g integer," + //2) «Наземное» - выпадающий список:«Трактор», «Машина», «Аэроз.генераторG».
|
||||
"spray_platform_h integer," + //3) «Ручное» - выпадающий список:«Ранцевый», «Моторный», «Батарейный».
|
||||
|
||||
"spray_capacity_id integer," + //Поле “Вид опрыскивания” (Объём) «Полнообъемное», «Малообъемное», «Ультрамалообъемное».
|
||||
"spray_capacity_id integer," + //Поле “Вид опрыскивания” (Объём) «Полнообъемное», «Малообъемное», «Ультрамалообъемное». (Сказали поле удалить удалил)
|
||||
|
||||
//"spray_operator text," + //Оператор (пилот, водитель, др...)
|
||||
"spray_operatortype_id integer," + //Оператор (пилот, водитель, др...)
|
||||
//"spray_operator_name text," + //<2F>?мя оператора
|
||||
"spray_manufacturer_name text," + //Марка опрыскивателя
|
||||
"spray_model_name text," + //Модель опрыскивателя
|
||||
"spray_manufacturer_name text," + //Марка опрыскивателя/модель
|
||||
"spray_model_name text," + //Модель опрыскивателя (теперь не используется всё пишется в поле выше)
|
||||
//"spray_date_calibration integer," + //Дата последней калибровки
|
||||
"spray_height float," + //Высота над поверхностью почвы (м)
|
||||
"spray_width float," + //Ширина захвата (м)
|
||||
@ -798,7 +798,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
"spray_platform_a integer," +
|
||||
"spray_platform_g integer," +
|
||||
"spray_platform_h integer," +
|
||||
"spray_capacity_id integer," +
|
||||
"spray_capacity_id integer," + //Сказали удалить удалил
|
||||
"spray_operatortype_id integer," +
|
||||
"spray_manufacturer_name text," +
|
||||
"spray_model_name text," +
|
||||
|
||||
@ -131,7 +131,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
public EditText edtInsRate = null; // расход рабочей жидкости(л/га)
|
||||
|
||||
public EditText edtInsUsedVolume = null; // Общий объем использованной рабочей жидкости (л)
|
||||
public EditText edtInsNumberSpores = null; // Концентрация спор (/мл)
|
||||
|
||||
// public DateInput edtInsExpiryDate = null; // окончание срока действия (дата)
|
||||
// public SpinnerDB spiInsMixed = null; // смешивается ли инсектицид с водой или растворителем?
|
||||
@ -166,7 +165,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
public View spiSprPlatformA = null; // «Авиа» - выпадающий список:«Самолет», «Вертолет», «Дельтаплан».
|
||||
public View spiSprPlatformG = null; // «Наземное» - выпадающий список:«Трактор», «Машина», «Аэроз.генераторG».
|
||||
public View spiSprPlatformH = null; // «Ручное» - выпадающий список:«Ранцевый», «Моторный», «Батарейный».
|
||||
public View spiSprCapacity = null; // Объём опрыскивателя
|
||||
|
||||
// public SpinnerDB spiSprOperator = null; // Оператор (пилот, водитель, др...)
|
||||
// public EditText edtSprOperatorName = null; // <20>?мя оператора
|
||||
@ -180,7 +178,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
public EditText edtSprBarrierWidth = null; // ширина (м)
|
||||
public EditText edtSprBarrierSpace = null; // промежуток (м)
|
||||
public EditText edtSprSpeed = null; // Скорость движения (км/ч)
|
||||
public View spiSprGPS = null; // Антена: DGPS использовалась
|
||||
public View spiSprMarking = null; // Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет)
|
||||
|
||||
public CheckBox cbEffectiveness = null; // Галочка чтоб сделать поля не обязательными
|
||||
@ -199,7 +196,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
|
||||
public EditText edtClothing = null; // Сборная колонка
|
||||
|
||||
public View spiProtectiveClothingClean = null;
|
||||
public View spiOperatorExposedInsecticide = null;
|
||||
public EditText edtDescription = null;
|
||||
public CheckBox cbTest; //Тестовая ли анкета
|
||||
@ -583,18 +579,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
guiTable.add(edtInsDose, "insecticide_dose");
|
||||
edtInsRate = (EditText) findViewById(R.id.edtInsRate); // расход рабочей жидкости(л/га)
|
||||
guiTable.add(edtInsRate, "insecticide_rate");
|
||||
|
||||
/*
|
||||
* edtInsExpiryDate = (DateInput) findViewById(R.id.edtInsExpiryDate); // окончание срока годности (дата) guiTable.add(edtInsExpiryDate,"insecticide_expiry_date"); edtInsExpiryDate.setVisibleDMY("my"); //Кроме дня
|
||||
*
|
||||
* spiInsMixed = findViewById(R.id.spiInsMixed); // смешивается ли инсектицид с водой или растворителем? guiTable.add(spiInsMixed,"insecticide_mixed"); spiInsMixed.addField(this, "", ""); spiInsMixed.addField(this, getString(R.string.Yes),"1"); spiInsMixed.addField(this, getString(R.string.No),"0");
|
||||
*
|
||||
* edtInsMixedName = (EditText) findViewById(R.id.edtInsMixedName); guiTable.add(edtInsMixedName,"insecticide_mixed_name"); edtInsMixedRatio = (EditText) findViewById(R.id.edtInsMixedRatio); // если да, то в каком соотношении (%) guiTable.add(edtInsMixedRatio,"insecticide_mixed_ratio"); edtInsMixedRatio.setFilters(new InputFilter[]{ new InputFilterMinMax("0", "100")});
|
||||
*/
|
||||
edtInsUsedVolume = (EditText) findViewById(R.id.edtInsUsedVolume); // Общий объем использованной рабочей жидкости (л)
|
||||
guiTable.add(edtInsUsedVolume, "insecticide_used_volume");
|
||||
edtInsNumberSpores = (EditText) findViewById(R.id.edtInsNumberSpores); // Концентрация спор (/мл)
|
||||
guiTable.add(edtInsNumberSpores, "insecticide_number_spores");
|
||||
|
||||
spiWeaTimeStart = findViewById(R.id.spiWeaTimeStart); // время начала
|
||||
guiTable.add(spiWeaTimeStart, "weather_time_start");
|
||||
@ -874,25 +860,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
spiSprCapacity = findViewById(R.id.spiSprCapacity);
|
||||
guiTable.add(spiSprCapacity, "spray_capacity_id");
|
||||
((selectDB)spiSprCapacity).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.rawQuery(
|
||||
"select d.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = d.name AND l.short_name='"
|
||||
+ Tools.getLang() + "' LIMIT 1),d.name) name from list_capacities d where d.del=0 order by d.sort,d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprCapacity).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
/*
|
||||
* spiSprOperator = findViewById(R.id.spiSprOperator); // Оператор (пилот, водитель, др...) guiTable.add(spiSprOperator,"spray_operatortype_id"); spiSprOperator.addField(this, "", ""); dboh = new DbOpenHelper(this); cursor =
|
||||
* dboh.getReadableDatabase().rawQuery("select d.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = d.name AND l.short_name='"+Tools.getLang()+"' LIMIT 1),d.name) name from list_operatorstypes d where d.del=0 order by d.sort,d.name", null); if (cursor.moveToFirst()) { do { spiSprOperator.addField(this, cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); } while
|
||||
@ -903,8 +870,8 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
// guiTable.add(edtSprOperatorName,"spray_operator_name");
|
||||
edtSprManufacturer = (EditText) findViewById(R.id.edtSprManufacturer); // Марка опрыскивателя
|
||||
guiTable.add(edtSprManufacturer, "spray_manufacturer_name");
|
||||
edtSprModel = (EditText) findViewById(R.id.edtSprModel); // Модель опрыскивателя
|
||||
guiTable.add(edtSprModel, "spray_model_name");
|
||||
//edtSprModel = (EditText) findViewById(R.id.edtSprModel); // Модель опрыскивателя
|
||||
//guiTable.add(edtSprModel, "spray_model_name");
|
||||
|
||||
// edtDateCalibration = (DateInput) findViewById(R.id.edtDateCalibration); // Дата последней калибровки
|
||||
// guiTable.add(edtDateCalibration,"spray_date_calibration");
|
||||
@ -929,12 +896,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
edtSprSpeed = (EditText) findViewById(R.id.edtSprSpeed); // Скорость движения (км/ч)
|
||||
guiTable.add(edtSprSpeed, "spray_speed");
|
||||
|
||||
spiSprGPS = findViewById(R.id.spiSprGPS); // Антена: DGPS использовалась
|
||||
guiTable.add(spiSprGPS, "spray_gps");
|
||||
((selectDB)spiSprGPS).addField("", "");
|
||||
((selectDB)spiSprGPS).addField(getString(R.string.Yes), "1");
|
||||
((selectDB)spiSprGPS).addField(getString(R.string.No), "0");
|
||||
|
||||
spiSprMarking = findViewById(R.id.spiSprMarking); // Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет)
|
||||
guiTable.add(spiSprMarking, "spray_marking_id");
|
||||
((selectDB)spiSprMarking).addField("", "");
|
||||
@ -1107,12 +1068,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
}
|
||||
});
|
||||
|
||||
spiProtectiveClothingClean = findViewById(R.id.spiProtectiveClothingClean);
|
||||
guiTable.add(spiProtectiveClothingClean, "safety_clothing_clean");
|
||||
((selectDB)spiProtectiveClothingClean).addField("", "");
|
||||
((selectDB)spiProtectiveClothingClean).addField(getString(R.string.Yes), "1");
|
||||
((selectDB)spiProtectiveClothingClean).addField(getString(R.string.No), "0");
|
||||
|
||||
spiOperatorExposedInsecticide = findViewById(R.id.spiOperatorExposedInsecticide);
|
||||
guiTable.add(spiOperatorExposedInsecticide, "safety_operator_health");
|
||||
((selectDB)spiOperatorExposedInsecticide).addField("", "");
|
||||
@ -1640,12 +1595,9 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
if(spiSprPlatformA.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprPlatformA).updateAdapter(this);
|
||||
if(spiSprPlatformG.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprPlatformG).updateAdapter(this);
|
||||
if(spiSprPlatformH.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprPlatformH).updateAdapter(this);
|
||||
if(spiSprCapacity.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprCapacity).updateAdapter(this);
|
||||
if(spiSprBarrier.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprBarrier).updateAdapter(this);
|
||||
if(spiSprGPS.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprGPS).updateAdapter(this);
|
||||
if(spiSprMarking.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprMarking).updateAdapter(this);
|
||||
if(spiEffMethod.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiEffMethod).updateAdapter(this);
|
||||
if(spiProtectiveClothingClean.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiProtectiveClothingClean).updateAdapter(this);
|
||||
if(spiOperatorExposedInsecticide.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiOperatorExposedInsecticide).updateAdapter(this);
|
||||
if(spiSafNonTarget.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSafNonTarget).updateAdapter(this);
|
||||
if(spiSafIncident.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSafIncident).updateAdapter(this);
|
||||
@ -2176,6 +2128,12 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
}
|
||||
if (!eFields && !isGONE(edtInsUsedVolume))
|
||||
{
|
||||
if(edtInsUsedVolume.getText().toString().equals(""))
|
||||
{
|
||||
scrollTo(edtInsUsedVolume);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!";
|
||||
eFields = true;
|
||||
}else
|
||||
if(checkMinMaxI(edtInsUsedVolume,1,450000)!="")
|
||||
{
|
||||
scrollTo(edtInsUsedVolume);
|
||||
@ -2183,15 +2141,6 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
eFields = true;
|
||||
}
|
||||
}
|
||||
if (!eFields && !isGONE(edtInsNumberSpores))
|
||||
{
|
||||
if(checkMinMaxI(edtInsNumberSpores,1f,1000000000)!="")
|
||||
{
|
||||
scrollTo(edtInsNumberSpores);
|
||||
atxt = checkMinMaxI(edtInsNumberSpores,1f,1000000000) + " \"" + getResources().getString(R.string.Number_of_spores_ml) + "\"!";
|
||||
eFields = true;
|
||||
}
|
||||
}
|
||||
if (!eFields && !isGONE(spiWeaTimeStart) && ((selectDB)spiWeaTimeStart).getText().toString().equals(""))
|
||||
{
|
||||
scrollTo(spiWeaTimeStart);
|
||||
@ -2337,6 +2286,12 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
}
|
||||
if (!eFields && !isGONE(edtSprBarrierSpace))
|
||||
{
|
||||
if(edtSprBarrierSpace.getText().toString().equals(""))
|
||||
{
|
||||
scrollTo(edtSprBarrierSpace);
|
||||
atxt = atxt + ": \"" + getResources().getString(R.string.Spacing_of_barriers_m) + "\"!";
|
||||
eFields = true;
|
||||
}else
|
||||
if(checkMinMaxI(edtSprBarrierSpace,1,1000)!="")
|
||||
{
|
||||
scrollTo(edtSprBarrierSpace);
|
||||
|
||||
@ -282,8 +282,7 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Spray_platform_h) + "</b></td>";
|
||||
//html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Spray_operator) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Name_of_operator) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Spray_manufacturer) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Model_sprayer) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Spray_manufacturer_model) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Date_of_last_calibration) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Atomizer_height_above_ground_m) + "</b></td>";
|
||||
html += "<td bgcolor=\"#d1d1d1\" width=\"100px\"><b>" + getString(R.string.Coverage_width) + "</b></td>";
|
||||
|
||||
2428
app/src/main/java/kz/istt/locust/LocustHealthActivity.java
Normal file
2428
app/src/main/java/kz/istt/locust/LocustHealthActivity.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -52,6 +52,7 @@ public class MainActivity extends Activity {
|
||||
private Button btnSetup;
|
||||
private Button btnLocust;
|
||||
private Button btnLocustDel;
|
||||
private Button btnLocustHealth;
|
||||
private TextView tvAndroidID;
|
||||
private TextView tvCountTasks;
|
||||
|
||||
@ -154,7 +155,7 @@ public class MainActivity extends Activity {
|
||||
//Кнопка вызова формы настроек
|
||||
btnSetup = (Button) findViewById(R.id.btnSetup);
|
||||
OnClickListener oclBtnSetup = new OnClickListener(){@Override
|
||||
public void onClick(View v){ onGetPermissions(3); }};
|
||||
public void onClick(View v){ onGetPermissions(4); }};
|
||||
btnSetup.setOnClickListener(oclBtnSetup);
|
||||
|
||||
//Кнопка вызова формы
|
||||
@ -169,6 +170,10 @@ public class MainActivity extends Activity {
|
||||
public void onClick(View v){ onGetPermissions(2); }};
|
||||
btnLocustDel.setOnClickListener(oclBtnLocustDel);
|
||||
|
||||
btnLocustHealth = (Button) findViewById(R.id.btnLocustHealth);
|
||||
OnClickListener oclBtnLocustHealth = new OnClickListener(){@Override
|
||||
public void onClick(View v){ onGetPermissions(3); }};
|
||||
btnLocustHealth.setOnClickListener(oclBtnLocustHealth);
|
||||
|
||||
tvAndroidID = (TextView) findViewById(R.id.tvAndroidID);
|
||||
String android_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);
|
||||
@ -247,13 +252,14 @@ public class MainActivity extends Activity {
|
||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
list.add(Manifest.permission.CAMERA);
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
list.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2){
|
||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
list.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
list.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
}
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
list.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
}
|
||||
|
||||
|
||||
if(!list.isEmpty())
|
||||
{
|
||||
@ -277,6 +283,10 @@ public class MainActivity extends Activity {
|
||||
ShowLocustDelActivity();
|
||||
}
|
||||
if(granted && button==3)
|
||||
{
|
||||
ShowLocustHealthActivity();
|
||||
}
|
||||
if(granted && button==4)
|
||||
{
|
||||
ShowSetupActivity();;
|
||||
}
|
||||
@ -330,7 +340,13 @@ public class MainActivity extends Activity {
|
||||
Intent intent = new Intent(this, LocustListActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
public void ShowLocustHealthActivity()
|
||||
{
|
||||
Intent intent = new Intent(this, LocustHealthActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
public void ShowLocustDelActivity()
|
||||
{
|
||||
//_translations
|
||||
|
||||
Reference in New Issue
Block a user