@ -109,15 +109,31 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
public EditText edtLonCenter = null ; // Долгота
public ListView latlonList = null ;
//Идентификация места мониторинга
public EditText edtObserverHealth = null ; //H Имя руководителя бригады по мониторингу ЗЧ и О С
public EditText edtMonitoringDate = null ; //H Дата мониторинга
public EditText edtMonitoringTimeZone = null ; //H Временная зона для: Дата мониторинга
public View spiFrmLocustDelFilled = null ; //H Заполнялась ли Форма по Мониторингу противосаранчовых обработок бригадой по обработке?
//Бригада по обработке
public EditText edtBrigadeCount = null ; //H Количество работников в бригаде по обработке
public EditText edtBrigadeCountTrained = null ; //H Количество работников, ранее обученных обращению с инсектицидами и их применению
public EditText edtInfestedArea = null ; // заселенная площадь(г а )
public EditText edtTreatedArea = null ; // обработанная площадь(г а )
public View spiVegType = null ; // Тип(дикая, культурная)
public EditText edtVegHeight = null ; // Высота (м)
public View spiVegCover = null ; // Растительный покров (Редкий, С р ., Густой)
public EditText edtVegCrop = null ; // Перечисление культур
public View spiVegDamage = null ; // Повреждения растительного покрова(%)
public EditText edtVegDamageArea = null ; // Площадь повреждений (г а )
// public View spiVegDamage = null; // Повреждения растительного покрова(%)
// public EditText edtVegDamageArea = null; // Площадь повреждений (г а )
//Информация о б инсектицидах
public EditText edtInsName = null ; // коммерческое название
public EditText edtInsPartNumber = null ; //H Номер партии препарата (если указан на контейнере)
public EditText edtInsManufacturedDate = null ; //H Дата производства или Срок годности (срок хранения)
public EditText edtInsActiveSubstance = null ; // Наименование активного вещества отравы
public EditText edtInsConcentration = null ; // концентрация(г д.в./л или%)
public View spiInsFormulation = null ; // формуляция(У М О , КЭ, др.)
@ -154,7 +170,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
public View spiMainPurpose = null ; // Основная цель при обработке (Имаго,Кулиги,Стаи,Разреженные)
public View spiLocustPhaseId = null ; // Фара саранчи
// public View spiLocustPhaseId = null; // Фара саранчи
public View spiSprPlatform = null ; // Вид опрыскивания
public View spiSprPlatformA = null ; // «Авиа» - выпадающий список:«Самолет», «Вертолет», «Дельтаплан».
@ -197,18 +213,18 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
public View spiHlthProtectiveClothingClean = null ; // Защитная одежда чистая и в хорошем состоянии
public View spiProtectiveClothingClean = null ;
// public View spiProtectiveClothingClean = null;
public View spiOperatorExposedInsecticide = null ;
public EditText edtDescription = null ;
public CheckBox cbTest ; //Тестовая ли анкета
public CheckBox cbSafInformFarmer = null ; // Кто был оповещен о б обработках? Фермер
public CheckBox cbSafInformShepherd = null ; // Кто был оповещен о б обработках? Пастух
public CheckBox cbSafInformVillager = null ; // Кто был оповещен о б обработках? Сельский житель
public CheckBox cbSafInformOfficial = null ; // Кто был оповещен о б обработках? Чиновник
public CheckBox cbSafInformBeekeeper = null ; // Кто был оповещен о б обработках? Пчеловод
public CheckBox cbSafInformOther = null ; // Кто был оповещен о б обработках? Другие
public EditText edtInform = null ; // Сборная колонка для (Фермер,Сельский житель,Чиновник,Пчеловод,Другие)
// public CheckBox cbSafInformFarmer = null; // Кто был оповещен о б обработках? Фермер
// public CheckBox cbSafInformShepherd = null; // Кто был оповещен о б обработках? Пастух
// public CheckBox cbSafInformVillager = null; // Кто был оповещен о б обработках? Сельский житель
// public CheckBox cbSafInformOfficial = null; // Кто был оповещен о б обработках? Чиновник
// public CheckBox cbSafInformBeekeeper = null; // Кто был оповещен о б обработках? Пчеловод
// public CheckBox cbSafInformOther = null; // Кто был оповещен о б обработках? Другие
// public EditText edtInform = null; // Сборная колонка для (Фермер,Сельский житель,Чиновник,Пчеловод,Другие)
//public SpinnerDB spiSafEmptyС ontainers = null; // Пустые контейнеры
public CheckBox cbTripleRinsed = null ;
@ -365,7 +381,31 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
// };
//sql = "ALTER TABLE frmlocusthealth ADD timezone text;";
//db.execSQL(sql);
//**********Идентификация места мониторинга**********
//H Имя руководителя бригады по мониторингу ЗЧ и О С
edtObserverHealth = ( EditText ) findViewById ( R . id . edtObserverHealth ) ;
guiTableHealth . add ( edtObserverHealth , " observer " ) ;
//H Дата мониторинга
edtMonitoringDate = ( EditText ) findViewById ( R . id . edtMonitoringDate ) ;
guiTableHealth . add ( edtMonitoringDate , " date " ) ;
//H Временная зона для: Дата мониторинга
edtMonitoringTimeZone = ( EditText ) findViewById ( R . id . edtMonitoringTimeZone ) ;
guiTableHealth . add ( edtMonitoringTimeZone , " timezone " ) ;
//**********Бригада по обработке**********
//H Количество работников в бригаде по обработке
edtBrigadeCount = ( EditText ) findViewById ( R . id . edtBrigadeCount ) ;
guiTableHealth . add ( edtBrigadeCount , " brigade_count " ) ;
//H Количество работников, ранее обученных обращению с инсектицидами и их применению
edtBrigadeCountTrained = ( EditText ) findViewById ( R . id . edtBrigadeCountTrained ) ;
guiTableHealth . add ( edtBrigadeCountTrained , " brigade_count_trained " ) ;
//**********Информация о растительности**********
//Тип растительности
spiVegType = findViewById ( R . id . spiVegType ) ; // Тип(Дикая, Культурная)
guiTableDel . add ( spiVegType , " vegetation_type_id " ) ;
@ -414,9 +454,17 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
edtVegCrop = ( EditText ) findViewById ( R . id . edtVegCrop ) ; // Перечисление культур
guiTableDel . add ( edtVegCrop , " vegetation_crop " ) ;
//Наименование инсектицида
edtInsName = ( EditText ) findViewById ( R . id . edtInsName ) ; // коммерческое название
//**********Информация о б инсектицидах **********
// коммерческое название (Наименование инсектицида)
edtInsName = ( EditText ) findViewById ( R . id . edtInsName ) ;
guiTableDel . add ( edtInsName , " insecticide_name " ) ;
//H Номер партии препарата (если указан на контейнере)
edtInsPartNumber = ( EditText ) findViewById ( R . id . edtInsPartNumber ) ;
guiTableHealth . add ( edtInsPartNumber , " insecticide_part_number " ) ;
//H Дата производства или Срок годности (срок хранения)
edtInsManufacturedDate = ( EditText ) findViewById ( R . id . edtInsPartNumber ) ;
guiTableHealth . add ( edtInsManufacturedDate , " insecticide_manufactured_date " ) ;
+ + + + + + + + +
// Наименование активного вещества отравы
edtInsActiveSubstance = ( EditText ) findViewById ( R . id . edtInsActiveSubstance ) ;
@ -480,6 +528,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
edtInsRate = ( EditText ) findViewById ( R . id . edtInsRate ) ;
guiTableDel . add ( edtInsRate , " insecticide_rate " ) ;
//**********Погодные условия**********
// время начала
spiWeaTimeStart = findViewById ( R . id . spiWeaTimeStart ) ;
guiTableDel . add ( spiWeaTimeStart , " weather_time_start " ) ;
@ -897,6 +946,102 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
( ( selectDB ) spiEffectiveness ) . addField ( getString ( R . string . Yes ) , " 1 " ) ;
( ( selectDB ) spiEffectiveness ) . addField ( getString ( R . string . No ) , " 0 " ) ;
//Оператор случайно подвергся воздействию инсектицида или плохое самочувствие
spiOperatorExposedInsecticide = findViewById ( R . id . spiOperatorExposedInsecticide ) ;
guiTableDel . add ( spiOperatorExposedInsecticide , " safety_operator_health " ) ;
( ( selectDB ) spiOperatorExposedInsecticide ) . addField ( " " , " " ) ;
( ( selectDB ) spiOperatorExposedInsecticide ) . addField ( getString ( R . string . Yes ) , " 1 " ) ;
( ( selectDB ) spiOperatorExposedInsecticide ) . addField ( getString ( R . string . No ) , " 0 " ) ;
// если да, то какое
edtDescription = ( EditText ) findViewById ( R . id . edtDescription ) ;
guiTableDel . add ( edtDescription , " description " ) ;
// Пустые контейнеры (выборка локализованных названий)
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_containers d where d.del=0 order by d.sort,d.name " , null ) ;
if ( cursor . moveToFirst ( ) )
{
do
{
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 1 )
( ( CheckBox ) findViewById ( R . id . cbTripleRinsed ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 2 )
( ( CheckBox ) findViewById ( R . id . cbPunctured ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 3 )
( ( CheckBox ) findViewById ( R . id . cbTakenBackToBase ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 4 )
( ( CheckBox ) findViewById ( R . id . cbLeftInField ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 5 )
( ( CheckBox ) findViewById ( R . id . cbBuried ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
if ( cursor . getLong ( cursor . getColumnIndex ( " id " ) ) = = 6 )
( ( CheckBox ) findViewById ( R . id . cbBurned ) ) . setText ( cursor . getString ( cursor . getColumnIndex ( " name " ) ) ) ;
} while ( cursor . moveToNext ( ) ) ;
}
cursor . close ( ) ;
dboh . close ( ) ;
//Тут сам выбор значений из базы
edtSafEmptyContainers = ( EditText ) findViewById ( R . id . edtSafEmptyContainers ) ;
guiTableDel . add ( edtSafEmptyContainers , " safety_container " ) ;
edtSafEmptyContainers . addTextChangedListener ( new TextWatcher ( )
{
public void afterTextChanged ( Editable s ) { }
public void beforeTextChanged ( CharSequence s , int start , int count , int after ) { }
public void onTextChanged ( CharSequence s , int start , int before , int count )
{
String str = LocustHealthActivity . this . edtSafEmptyContainers . getText ( ) . toString ( ) ;
if ( str . indexOf ( " 1 " ) ! = - 1 )
LocustHealthActivity . this . cbTripleRinsed . setChecked ( true ) ;
if ( str . indexOf ( " 2 " ) ! = - 1 )
LocustHealthActivity . this . cbPunctured . setChecked ( true ) ;
if ( str . indexOf ( " 3 " ) ! = - 1 )
LocustHealthActivity . this . cbTakenBackToBase . setChecked ( true ) ;
if ( str . indexOf ( " 4 " ) ! = - 1 )
LocustHealthActivity . this . cbLeftInField . setChecked ( true ) ;
if ( str . indexOf ( " 5 " ) ! = - 1 )
LocustHealthActivity . this . cbBuried . setChecked ( true ) ;
if ( str . indexOf ( " 6 " ) ! = - 1 )
LocustHealthActivity . this . cbBurned . setChecked ( true ) ;
}
} ) ;
cbTripleRinsed = ( CheckBox ) findViewById ( R . id . cbTripleRinsed ) ;
cbPunctured = ( CheckBox ) findViewById ( R . id . cbPunctured ) ;
cbTakenBackToBase = ( CheckBox ) findViewById ( R . id . cbTakenBackToBase ) ;
cbLeftInField = ( CheckBox ) findViewById ( R . id . cbLeftInField ) ;
cbBuried = ( CheckBox ) findViewById ( R . id . cbBuried ) ;
cbBurned = ( CheckBox ) findViewById ( R . id . cbBurned ) ;
// воздействие на нецелевые организмы
spiSafNonTarget = findViewById ( R . id . spiSafNonTarget ) ;
guiTableDel . add ( spiSafNonTarget , " safety_non_target " ) ;
( ( selectDB ) spiSafNonTarget ) . addField ( " " , " " ) ;
( ( selectDB ) spiSafNonTarget ) . addField ( getString ( R . string . Yes ) , " 1 " ) ;
( ( selectDB ) spiSafNonTarget ) . addField ( getString ( R . string . No ) , " 0 " ) ;
// если да, то какое воздействие на нецелевые организмы
edtSafNonTargetEffect = ( EditText ) findViewById ( R . id . edtSafNonTargetEffect ) ;
guiTableDel . add ( edtSafNonTargetEffect , " safety_non_target_effect " ) ;
// Другие инциденты по здоровью или окружающей среде, возникшие возможно при обработке
spiSafIncident = findViewById ( R . id . spiSafIncident ) ;
guiTableDel . add ( spiSafIncident , " safety_incident " ) ;
( ( selectDB ) spiSafIncident ) . addField ( " " , " " ) ;
( ( selectDB ) spiSafIncident ) . addField ( getString ( R . string . Yes ) , " 1 " ) ;
( ( selectDB ) spiSafIncident ) . addField ( getString ( R . string . No ) , " 0 " ) ;
// Если Да, тип инцидента и кем сообщен (описание)
edtSafIncidentEffect = ( EditText ) findViewById ( R . id . edtSafIncidentEffect ) ;
guiTableDel . add ( edtSafIncidentEffect , " safety_incident_effect " ) ;
edtComments = ( EditText ) findViewById ( R . id . edtComments ) ; // К О М М Е Н Т А Р <D090> ?<3F> ?
guiTableDel . add ( edtComments , " comments " ) ;
@ -1635,14 +1780,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
// ((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("", "");
// ((selectDB)spiOperatorExposedInsecticide).addField(getString(R.string.Yes), "1");
// ((selectDB)spiOperatorExposedInsecticide).addField(getString(R.string.No), "0");
//
// edtDescription = (EditText) findViewById(R.id.edtDescription); // если да, то какое
// guiTable.add(edtDescription, "description");
//
// cbTest = (CheckBox) findViewById(R.id.cbTest);
// guiTable.add(cbTest, "test");