diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index 8495d3e..14b41cc 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -309,8 +309,8 @@ diff --git a/app/src/main/java/kz/istt/locust/DBGUITable.java b/app/src/main/java/kz/istt/locust/DBGUITable.java index bfce264..2e2da6c 100644 --- a/app/src/main/java/kz/istt/locust/DBGUITable.java +++ b/app/src/main/java/kz/istt/locust/DBGUITable.java @@ -73,7 +73,11 @@ public class DBGUITable } cursor.close(); dboh.close(); - return type; + if(type!=null){ + return type.toLowerCase(); + }else{ + return null; + } } /* diff --git a/app/src/main/java/kz/istt/locust/DbOpenHelper.java b/app/src/main/java/kz/istt/locust/DbOpenHelper.java index 973e947..c460b37 100644 --- a/app/src/main/java/kz/istt/locust/DbOpenHelper.java +++ b/app/src/main/java/kz/istt/locust/DbOpenHelper.java @@ -40,7 +40,6 @@ public class DbOpenHelper extends SQLiteOpenHelper { super(context, DB_NAME, null, DB_VERSION); _context = context; - /* SQLiteDatabase db = this.getWritableDatabase(); db.execSQL("DROP TABLE IF EXISTS frmlocust"); @@ -80,15 +79,15 @@ public class DbOpenHelper extends SQLiteOpenHelper /** Содание новой базы если её нет */ @Override - public void onCreate(SQLiteDatabase sqLiteDatabase) + public void onCreate(SQLiteDatabase db) { String sql; //Из-за проблем с многопотчностью создаю таблицу а то андроит сам её создаст в основном потоке /*sql = "create table if not exists android_metadata(locale TEXT DEFAULT 'en_US')"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "INSERT INTO android_metadata VALUES ('en_US');"; - sqLiteDatabase.execSQL(sql);*/ + db.execSQL(sql);*/ //Таблица пользователей sql = "create table if not exists _user(" + @@ -100,7 +99,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "patronymic text," + "login text," + "password text);"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Список языков (для переводя) sql = "create table if not exists _languages(" + @@ -111,7 +110,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "short_name text NOT NULL," + "name text NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); // Таблица переводов для базы данных (пока все языки загружаются) sql = "create table if not exists _translations(" + @@ -123,7 +122,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "identifier text NOT NULL," + "translation text NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); // Для идентификации терминала как зарегистрированного (должна быть 1 запись) sql = "create table if not exists terminals(" + @@ -138,7 +137,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "serial text," + "phone text" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Список компаний sql = "create table if not exists companies(" + @@ -148,7 +147,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "seq integer NOT NULL DEFAULT 1," + //Время изменения "name text NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Список стран sql = "create table if not exists Countries(" + @@ -158,7 +157,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "seq integer NOT NULL DEFAULT 1," + //Время изменения "name text NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Список регионов для стран sql = "create table if not exists CountriesRegions(" + @@ -174,7 +173,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "lat_min double, " + "area double " + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Коордионаты границы для региона /*sql = "create table if not exists CountriesRegionsPoints(" + @@ -187,7 +186,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "lon double NOT NULL, " + "lat double NOT NULL " + ");"; - sqLiteDatabase.execSQL(sql);*/ + db.execSQL(sql);*/ //Виды саранчи sql = "create table if not exists LocustsTypes(" + @@ -198,7 +197,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Справочник отрождения "Начало", "Массовое". sql = "create table if not exists Borns(" + @@ -209,7 +208,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Справочник окрыление. sql = "create table if not exists Fledgling(" + @@ -220,7 +219,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Справочник плотности «низкая», «средняя» и «высокая». sql = "create table if not exists list_density(" + @@ -231,7 +230,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "percent integer" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Фаза саранчи «одиночная», «переходная» и «стадная». sql = "create table if not exists list_phase(" + @@ -242,7 +241,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Опрыскиватели: "Трактор", "Самолёт" итд. sql = "create table if not exists Sprayers(" + @@ -254,7 +253,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Виды опрыскивания: "Авиа", "Наземное", "Ручное". sql = "create table if not exists sprayers_types(" + @@ -265,7 +264,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Метод подсчёта смертности: «визуальный» или «учетная рамка». sql = "create table if not exists list_mortality(" + @@ -276,7 +275,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Направления sql = "create table if not exists list_directions(" + @@ -287,7 +286,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "degree integer" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Справочник повреждения растительного покрова sql = "create table if not exists list_damage(" + @@ -299,7 +298,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "damage integer NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Справочник зелени «Сухая,Зеленая,Всходы,Засыхающая». sql = "create table if not exists list_greenery(" + @@ -310,7 +309,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_biotope(" + "id integer NOT NULL PRIMARY KEY," + @@ -320,7 +319,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_cover(" + "id integer NOT NULL PRIMARY KEY," + @@ -330,7 +329,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_age(" + "id integer NOT NULL PRIMARY KEY," + @@ -340,7 +339,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_actions(" + "id integer NOT NULL PRIMARY KEY," + @@ -350,7 +349,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_paintings(" + "id integer NOT NULL PRIMARY KEY," + @@ -360,7 +359,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_behaviors(" + "id integer NOT NULL PRIMARY KEY," + @@ -370,7 +369,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Похожая таблица на "list_behaviors" и содержимое sql = "create table if not exists list_breeding(" + @@ -381,7 +380,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_capacities(" + "id integer NOT NULL PRIMARY KEY," + @@ -391,7 +390,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_markings(" + "id integer NOT NULL PRIMARY KEY," + @@ -401,7 +400,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_containers(" + "id integer NOT NULL PRIMARY KEY," + @@ -411,7 +410,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_vegetation(" + "id integer NOT NULL PRIMARY KEY," + @@ -421,7 +420,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_formulation(" + "id integer NOT NULL PRIMARY KEY," + @@ -431,7 +430,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_height(" + "id integer NOT NULL PRIMARY KEY," + @@ -441,7 +440,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists list_enemies(" + "id integer NOT NULL PRIMARY KEY," + @@ -451,8 +450,38 @@ public class DbOpenHelper extends SQLiteOpenHelper "name text NOT NULL," + "sort integer" + //Порядок сортировки (специально для справичников) ");"; - sqLiteDatabase.execSQL(sql); - + db.execSQL(sql); + + sql = "create table if not exists list_purpose(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + + sql = "create table if not exists list_impact(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + + sql = "create table if not exists list_diluted(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + //Форма саранчи id может быть пустым (только если создали на КПК) sql = "create table if not exists frmlocust(" + "id integer," + @@ -555,7 +584,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "description text," + //КОММЕНТАРИИ "test boolean" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); //Для формы уничтожения саранчи id может быть пустым (только если создали на КПК) sql = "create table if not exists frmlocustdel(" + @@ -610,14 +639,17 @@ public class DbOpenHelper extends SQLiteOpenHelper "insecticide_name text," + //коммерческое название "insecticide_active_substance text," + //Наименование активного вещества //"insecticide_concentration double," + //концентрация(г д.в./л или%) - "insecticide_concentration text," + //концентрация(г д.в./л или%) + "insecticide_concentration text," + //концентрация(г д.в./л или%) раньше был тип double сказали сделать строкой "insecticide_formulation_id integer," + //формуляция(1 - УМО, 2 - КЭ, 3 - др.) "insecticide_dose float," + //норма расхода(л/га) + "insecticide_diluted_id integer," + + "insecticide_Proportion float," + "insecticide_rate float," + //расход рабочей жидкости(л/га) "insecticide_used_volume float," + //Общий объем использованной рабочей жидкости (л) "insecticide_number_spores float," + //Концентрация спор (/мл) (--------- В 2024 ссказали удалить поэтому не используется ---------) "insecticide_expiry_date integer," + //окончание срока действия (в нов. версии не используется) "insecticide_mixed text," + //смешивается ли инсектицид с водой или растворителем? (в нов. версии не используется) + "insecticide_mixed_name text," + //если да, то с чем (в нов. версии не используется) "insecticide_mixed_ratio float," + //если да, то в каком соотношении (%) (в нов. версии не используется) @@ -663,18 +695,19 @@ public class DbOpenHelper extends SQLiteOpenHelper "spray_width float," + //Ширина захвата (м) //"spray_spacing float," + //Расстояние между проходами опрыскивателя (м) "spray_barrier boolean," + //Барьеры (да, нет) - "spray_barrier_width float," + //Ширина (м) + "spray_barrier_width float," + //Ширина (м) В 2024 сказали убрать, теперь не используется "spray_barrier_space float," + //промежуток (м) "spray_speed float," + //Скорость движения (км/ч) "spray_gps boolean," + //Антена: DGPS использовалась "spray_marking_id boolean," + //Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет) "efficiency boolean NOT NULL DEFAULT 0," + //For CheckBox + "efficacy_impact_id integer," + //Тип оцениваемого биологического воздействия "efficacy_mortality float," + //смертность саранчи(%) "efficacy_passed_time float," + //Прошло времени после обработки "efficacy_mortality_method integer," + //метод подсчета смертности "safety_clothing text," + //Какой защитной одеждой пользовался оператор - "safety_clothing_clean boolean," + + "safety_clothing_clean boolean," + //В 2024 сказали оставить только в форме по ЗЧ и ОС "safety_operator_health boolean," + "description text," + //Описание "safety_inform text," + //Кто был оповещен об обработках? @@ -687,7 +720,148 @@ public class DbOpenHelper extends SQLiteOpenHelper "comments text," + //КОММЕНТАР�?�? "test boolean" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); + + //Для формы уничтожения саранчи id может быть пустым (только если создали на КПК) + sql = "create table if not exists frmlocusthealth(" + + "id integer," + //Локальный идентификатор на сервере для убыстрения доступа + "uid text NOT NULL, " + //Уникальный идентификатор + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + + "send boolean NOT NULL DEFAULT 0," + + + "frmlocustdel_uid text NOT NULL," + //На основе какой формы заполняется анкета + + + + "filled boolean," + //Заполнена ли анкета (спец поле а не проверка на NULL потому что обязательность полей можно выставлять галочкой в интерфейсе) + "device_id text, " + //Идентификатор устройства + + "user_id integer," + //Идентификатор пользователя который заполняет анкету + + + //Идентификация места мониторинга + "observer text, " + //Имя руководителя бригады по мониторингу ЗЧ и ОС + "date integer," + //Дата мониторинга (секунд с 1970 года) + "frmlocustdel_filled boolean," + //Заполнялась ли Форма по Мониторингу противосаранчовых обработок бригадой по обработке? (Похоже что это бесполезное поле так как есть поле frmlocustdel_uid) + + //Бригада по обработке + "brigade_count integer," + //Количество работников в бригаде по обработке + "brigade_count_trained integer," + //Количество работников, ранее обученных обращению с инсектицидами и их применению + + //Информация об инсектицидах + "insecticide_part_number text," + //Номер партии препарата (если указан на контейнере) + "insecticide_manufactured_date integer," + //Дата производства или срок годности (срок хранения) + "insecticide_expiration_date integer," + //********** На всякий случай, может и не пригодиться ********** + "insecticide_container_state_id integer," + //Состояние пакетов или контейнеров с инсектицидами + + //Сведения по опрыскиванию + "spr_leak boolean," + //Механическая безопасность: наблюдалась ли утечка инсектицида? (Да, Нет) + "spr_leak_plase text," + //Если Да, в какой части опрыскивателя имеется утечка? (Текст) + "spr_damage boolean," + //Система опрыскивания: повреждены распылители или сопла? (Да, Нет) + "spr_damage_plase text," + //Если Да, какие повреждения? (Текст) + + "spr_treated_area_check boolean,"+// Обработанная площадь (проверено бригадой по мониторингу) (га) + //"spr_fact_volume float," + // Фактическая норма объема опрыскивания (л/га) Расчет: (объем/площадь) + "spr_observation boolean," + // Если проводилось наблюдение за опрыскиванием: соблюдалась ли надлежащая практика применения инсектицидов? + "spr_description text," + // Замечания относительно наблюдаемой практики опрыскивания + + //Калибровка опрыскивателя + "calibr_consumption_check boolean," + // Калибровка расхода жидкости: проверялся ли расход жидкости опрыскивателя во время мониторинга? + "calibr_time integer," + // Время калибровки (мин.): + "calibr_volume integer," + // Собранный объем (л): + "calibr_rate integer," + // Расход жидкости (л/мин): + "calibr_precipitation boolean," + // Качество применения: проверялось ли осаждение капель во время мониторинга? + "calibr_width_card float," + // Длина трансекты, определенная с использованием масляно-/водочувствительной бумаги (м) + "calibr_wind_speed float," + // Средняя скорость ветра при осаждении капель (м/с) + "calibr_droplet_coating float," + // Ширина дорожки с хорошим покрытием капель (м) + "calibr_passes_interval float," + // Рекомендуемый интервал между проходами (м) + + // Контроль эффективности + "efficacy_control boolean," + // Проведен ли контроль эффективности (бригада мониторинга)? + "efficacy_impact_type_id integer," + // Тип оцениваемого биологического воздействия + "efficacy_mortality float," + // Наблюдаемая эффективность обработки (%) + "efficacy_passed_time float," + // Прошло времени после обработки + "efficacy_mortality_method integer," + // Метод оценки эффективности обработки (выбор: подсчет квадратов; подсчет по разрезам; подсчет кулиг личинок; другое) + + // Здоровье человека + "hlth_clothing_state text," + // Замечания относительно типа и состояния средств индивидуальной защиты + "hlth_clothing_reserve boolean," + // В бригаде или на ближайшей противосаранчовой базе имеется запасная защитная одежда (в частности, комбинезоны и перчатки) + "hlth_operator_passport integer," + // Количество операторов с паспортами использования пестицидов + "hlth_filled_passport integer," + // Количество правильно заполненных паспортов использования пестицидов + "hlth_passport_count integer," + // Во время мониторинга измерялось ли ингибирование холинэстеразы? + "hlth_description text," + // Дополнительные сведения о случайном воздействии или отравлении + + // Состояние окружающей среды + "safety_observed_pollution boolean," + // Наблюдалось или сообщалось о случайном загрязнении? (например, разлив инсектицидов, неправильная очистка оборудования и т. д.) + "safety_type_pollution text," + // Если Да, то где и какой тип загрязнения? + + "safety_non_target boolean," + // Наблюдалось или сообщалось о воздействии на нецелевые организмы? (например, болезни домашнего скота, смертность рыб, гибель пчел и т.д.) + "safety_non_target_effect text," + // Если Да, то где и какое воздействие? + "safety_non_target_effect_person text," + // Если информация поступила от прочих лиц, от кого именно? (укажите имя, номер телефона, адрес) + + "safety_Control boolean," + // Осуществлялся ли бригадой по мониторингу ЗЧ и ОС контроль в отношении наблюдаемого или зарегистрированного воздействия на окружающую среду + "safety_Control_Actions text," + // Если Да, опишите последующее действие(я) + + "map_treatment boolean," + // Была ли составлена ситуационная карта обработки? + + "image_name1 text," + //Наименование рисунка 1 + "image_send1 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name2 text," + //Наименование рисунка 2 + "image_send2 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name3 text," + //Наименование рисунка 3 + "image_send3 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name4 text," + //Наименование рисунка 4 + "image_send4 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name5 text," + //Наименование рисунка 5 + "image_send5 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + + "Risk_House boolean," + // Имеются ли в непосредственной близости от обработок жилые дома или жилье (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_House_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего жилья: + "Risk_House_Buffer_Zones," + // Соблюдались ли буферные зоны? + "Risk_House_Impact boolean," + // Существует ли вероятность воздействия на жилые дома/жилье? + "Risk_House_Informed boolean," + // Были ли проинформированы жители о применении инсектицидов? (проверка бригадой по мониторингу) + + "Risk_Water boolean," + // Имеются ли в непосредственной близости от обработок поверхностные воды (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_Water_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего источника поверхностной воды: + "Risk_Water_Buffer_Zones boolean," + // Соблюдались ли буферные зоны? + "Risk_Water_Impact boolean," + // Существует ли вероятность воздействия на поверхностные воды? + + "Risk_Apiary boolean," + // Имеются ли в непосредственной близости от обработок пчеловодства (в радиусе 5 км вокруг обрабатываемого участка) + "Risk_Apiary_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до пасеки + "Risk_Apiary_Informed boolean," + // Были ли пчеловоды проинформированы о применении инсектицидов + "Risk_Apiary_Measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на пчел + "Risk_Apiary_Impact boolean," + // Существует ли вероятность воздействия на пчел + + "Risk_Agricultural boolean," + // Были ли обработаны или подверглись воздействию какие-либо сельхозкультуры? + "Risk_Agricultural_Name text," + // Наименование сельхозкультуры + "Risk_Agricultural_Phase text," + // Фаза развития сельхозкультуры + "Risk_Agricultural_Toxic boolean," + // Наблюдалась ли фитотоксичность + "Risk_Agricultural_Inform boolean," + // Были ли фермеры проинформированы о предуборочном периоде + + "Risk_Silk boolean," + // Имеются ли в непосредственной близости от обработок шелководства (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_Silk_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до тутовой плантации + "Risk_Silk_Inform boolean," + // Были ли шелководы проинформированы о применении инсектицидов? + "Risk_Silk_Trees_Measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на тутовые деревья + "Risk_Silk_Trees_Impact boolean," + // Существует ли вероятность воздействия на тутовые деревья + + "Risk_Pastures boolean," + // Были ли обработаны луга или пастбища? + "Risk_Pastures_Inform boolean," + // Были ли пастухи проинформированы о периодах удержания домашнего скота? + + "Risk_Park boolean," + // Имеются ли в непосредственной близости от обработок другие экологически чувствительные зоны + "Risk_Park_Type text," + // Какой тип экологически чувствительной зоны + "Risk_Park_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до экологически чувствительной зоны + "Risk_Park_Buffer_Zones boolean," + // Соблюдались ли буферные зоны? + "Risk_Park_Impact boolean," + // Существует ли вероятность воздействия на экологически чувствительные зоны? + + "Risk_Probe_Analysis boolean," + // Пробы, взятые для анализа остатков + "Risk_Probe_Analysis_Name text," + // Проба какого субстрата или организма была взята + "Risk_Probe_Analysis_Number text," + // Регистрационный номер формы отбора проб + + + "test boolean" + //Тестовая ли анкета + ");"; + db.execSQL(sql); sql = "create table if not exists frmlocust_locations(" + "id integer NOT NULL PRIMARY KEY," + @@ -699,7 +873,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "lon double NOT NULL," + "lat double NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); sql = "create table if not exists frmlocustdel_locations(" + "id integer NOT NULL PRIMARY KEY," + @@ -711,7 +885,19 @@ public class DbOpenHelper extends SQLiteOpenHelper "lon double NOT NULL," + "lat double NOT NULL" + ");"; - sqLiteDatabase.execSQL(sql); + db.execSQL(sql); + + sql = "create table if not exists frmlocusthealth_locations(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "frmlocusthealth_uid text," + + "pos integer NOT NULL," + //Позиция + "lon double NOT NULL," + + "lat double NOT NULL" + + ");"; + db.execSQL(sql); Log.i("igor", "Создали базы"); } @@ -807,7 +993,7 @@ public class DbOpenHelper extends SQLiteOpenHelper "spray_height float," + "spray_width float," + "spray_barrier boolean," + - "spray_barrier_width float," + + "spray_barrier_width float," + //В 2024 сказали убрать, теперь не используется "spray_barrier_space float," + "spray_speed float," + "spray_gps boolean," + @@ -991,6 +1177,193 @@ public class DbOpenHelper extends SQLiteOpenHelper sql = "ALTER TABLE frmlocustdel ADD locust_purpose_id integer;"; db.execSQL(sql); + sql = "ALTER TABLE frmlocustdel ADD efficacy_impact_id integer;"; + db.execSQL(sql); + sql = "ALTER TABLE frmlocustdel ADD insecticide_diluted_id integer;"; + db.execSQL(sql); + sql = "ALTER TABLE frmlocustdel ADD insecticide_proportion float;"; + db.execSQL(sql); + + sql = "create table if not exists list_purpose(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + + sql = "create table if not exists list_impact(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + + sql = "create table if not exists list_diluted(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "name text NOT NULL," + + "sort integer" + //Порядок сортировки (специально для справичников) + ");"; + db.execSQL(sql); + + sql = "create table if not exists frmlocusthealth_locations(" + + "id integer NOT NULL PRIMARY KEY," + + "uid text, " + //Уникальный идентификатор (пока не используется) + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + //Время изменения + "frmlocusthealth_uid text," + + "pos integer NOT NULL," + //Позиция + "lon double NOT NULL," + + "lat double NOT NULL" + + ");"; + db.execSQL(sql); + + //Для формы уничтожения саранчи id может быть пустым (только если создали на КПК) + sql = "create table if not exists frmlocusthealth(" + + "id integer," + //Локальный идентификатор на сервере для убыстрения доступа + "uid text NOT NULL, " + //Уникальный идентификатор + "del boolean NOT NULL DEFAULT 0," + + "seq integer NOT NULL DEFAULT 1," + + "send boolean NOT NULL DEFAULT 0," + + + "frmlocustdel_uid text NOT NULL," + //На основе какой формы заполняется анкета + + "filled boolean," + //Заполнена ли анкета (спец поле а не проверка на NULL потому что обязательность полей можно выставлять галочкой в интерфейсе) + "device_id text, " + //Идентификатор устройства + + "user_id integer," + //Идентификатор пользователя который заполняет анкету + + + //Идентификация места мониторинга + "observer text, " + //Имя руководителя бригады по мониторингу ЗЧ и ОС + "date integer," + //Дата мониторинга (секунд с 1970 года) + "frmlocustdel_filled boolean," + //Заполнялась ли Форма по Мониторингу противосаранчовых обработок бригадой по обработке? (Похоже что это бесполезное поле так как есть поле frmlocustdel_uid) + + //Бригада по обработке + "brigade_count integer," + //Количество работников в бригаде по обработке + "brigade_count_trained integer," + //Количество работников, ранее обученных обращению с инсектицидами и их применению + + //Информация об инсектицидах + "insecticide_part_number text," + //Номер партии препарата (если указан на контейнере) + "insecticide_manufactured_date integer," + //Дата производства или срок годности (срок хранения) + "insecticide_expiration_date integer," + //********** На всякий случай, может и не пригодиться ********** + "insecticide_container_state_id integer," + //Состояние пакетов или контейнеров с инсектицидами + + //Сведения по опрыскиванию + "spr_leak boolean," + //Механическая безопасность: наблюдалась ли утечка инсектицида? (Да, Нет) + "spr_leak_plase text," + //Если Да, в какой части опрыскивателя имеется утечка? (Текст) + "spr_damage boolean," + //Система опрыскивания: повреждены распылители или сопла? (Да, Нет) + "spr_damage_plase text," + //Если Да, какие повреждения? (Текст) + + "spr_treated_area_check boolean,"+// Обработанная площадь (проверено бригадой по мониторингу) (га) + //"spr_fact_volume float," + // Фактическая норма объема опрыскивания (л/га) Расчет: (объем/площадь) + "spr_observation boolean," + // Если проводилось наблюдение за опрыскиванием: соблюдалась ли надлежащая практика применения инсектицидов? + "spr_description text," + // Замечания относительно наблюдаемой практики опрыскивания + + //Калибровка опрыскивателя + "calibr_consumption_check boolean," + // Калибровка расхода жидкости: проверялся ли расход жидкости опрыскивателя во время мониторинга? + "calibr_time integer," + // Время калибровки (мин.): + "calibr_volume integer," + // Собранный объем (л): + "calibr_rate integer," + // Расход жидкости (л/мин): + "calibr_precipitation boolean," + // Качество применения: проверялось ли осаждение капель во время мониторинга? + "calibr_width_card float," + // Длина трансекты, определенная с использованием масляно-/водочувствительной бумаги (м) + "calibr_wind_speed float," + // Средняя скорость ветра при осаждении капель (м/с) + "calibr_droplet_coating float," + // Ширина дорожки с хорошим покрытием капель (м) + "calibr_passes_interval float," + // Рекомендуемый интервал между проходами (м) + + // Контроль эффективности + "efficacy_control boolean," + // Проведен ли контроль эффективности (бригада мониторинга)? + "efficacy_impact_type_id integer," + // Тип оцениваемого биологического воздействия + "efficacy_mortality float," + // Наблюдаемая эффективность обработки (%) + "efficacy_passed_time float," + // Прошло времени после обработки + "efficacy_mortality_method integer," + // Метод оценки эффективности обработки (выбор: подсчет квадратов; подсчет по разрезам; подсчет кулиг личинок; другое) + + // Здоровье человека + "hlth_clothing_state text," + // Замечания относительно типа и состояния средств индивидуальной защиты + "hlth_clothing_reserve boolean," + // В бригаде или на ближайшей противосаранчовой базе имеется запасная защитная одежда (в частности, комбинезоны и перчатки) + "hlth_operator_passport integer," + // Количество операторов с паспортами использования пестицидов + "hlth_filled_passport integer," + // Количество правильно заполненных паспортов использования пестицидов + "hlth_passport_count integer," + // Во время мониторинга измерялось ли ингибирование холинэстеразы? + "hlth_description text," + // Дополнительные сведения о случайном воздействии или отравлении + + // Состояние окружающей среды + "safety_observed_pollution boolean," + // Наблюдалось или сообщалось о случайном загрязнении? (например, разлив инсектицидов, неправильная очистка оборудования и т. д.) + "safety_type_pollution text," + // Если Да, то где и какой тип загрязнения? + + "safety_non_target boolean," + // Наблюдалось или сообщалось о воздействии на нецелевые организмы? (например, болезни домашнего скота, смертность рыб, гибель пчел и т.д.) + "safety_non_target_effect text," + // Если Да, то где и какое воздействие? + "safety_non_target_effect_person text," + // Если информация поступила от прочих лиц, от кого именно? (укажите имя, номер телефона, адрес) + + "safety_Control boolean," + // Осуществлялся ли бригадой по мониторингу ЗЧ и ОС контроль в отношении наблюдаемого или зарегистрированного воздействия на окружающую среду + "safety_Control_Actions text," + // Если Да, опишите последующее действие(я) + + "map_treatment boolean," + // Была ли составлена ситуационная карта обработки? + + "image_name1 text," + //Наименование рисунка 1 + "image_send1 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name2 text," + //Наименование рисунка 2 + "image_send2 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name3 text," + //Наименование рисунка 3 + "image_send3 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name4 text," + //Наименование рисунка 4 + "image_send4 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + "image_name5 text," + //Наименование рисунка 5 + "image_send5 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false) + + "Risk_House boolean," + // Имеются ли в непосредственной близости от обработок жилые дома или жилье (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_House_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего жилья: + "Risk_House_Buffer_Zones," + // Соблюдались ли буферные зоны? + "Risk_House_Impact boolean," + // Существует ли вероятность воздействия на жилые дома/жилье? + "Risk_House_Informed boolean," + // Были ли проинформированы жители о применении инсектицидов? (проверка бригадой по мониторингу) + + "Risk_Water boolean," + // Имеются ли в непосредственной близости от обработок поверхностные воды (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_Water_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего источника поверхностной воды: + "Risk_Water_Buffer_Zones boolean," + // Соблюдались ли буферные зоны? + "Risk_Water_Impact boolean," + // Существует ли вероятность воздействия на поверхностные воды? + + "Risk_Apiary boolean," + // Имеются ли в непосредственной близости от обработок пчеловодства (в радиусе 5 км вокруг обрабатываемого участка) + "Risk_Apiary_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до пасеки + "Risk_Apiary_Informed boolean," + // Были ли пчеловоды проинформированы о применении инсектицидов + "Risk_Apiary_Measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на пчел + "Risk_Apiary_Impact boolean," + // Существует ли вероятность воздействия на пчел + + "Risk_Agricultural boolean," + // Были ли обработаны или подверглись воздействию какие-либо сельхозкультуры? + "Risk_Agricultural_Name text," + // Наименование сельхозкультуры + "Risk_Agricultural_Phase text," + // Фаза развития сельхозкультуры + "Risk_Agricultural_Toxic boolean," + // Наблюдалась ли фитотоксичность + "Risk_Agricultural_Inform boolean," + // Были ли фермеры проинформированы о предуборочном периоде + + "Risk_Silk boolean," + // Имеются ли в непосредственной близости от обработок шелководства (в радиусе 2 км вокруг обрабатываемого участка) + "Risk_Silk_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до тутовой плантации + "Risk_Silk_Inform boolean," + // Были ли шелководы проинформированы о применении инсектицидов? + "Risk_Silk_Trees_Measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на тутовые деревья + "Risk_Silk_Trees_Impact boolean," + // Существует ли вероятность воздействия на тутовые деревья + + "Risk_Pastures boolean," + // Были ли обработаны луга или пастбища? + "Risk_Pastures_Inform boolean," + // Были ли пастухи проинформированы о периодах удержания домашнего скота? + + "Risk_Park boolean," + // Имеются ли в непосредственной близости от обработок другие экологически чувствительные зоны + "Risk_Park_Type text," + // Какой тип экологически чувствительной зоны + "Risk_Park_Distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до экологически чувствительной зоны + "Risk_Park_Buffer_Zones boolean," + // Соблюдались ли буферные зоны? + "Risk_Park_Impact boolean," + // Существует ли вероятность воздействия на экологически чувствительные зоны? + + "Risk_Probe_Analysis boolean," + // Пробы, взятые для анализа остатков + "Risk_Probe_Analysis_Name text," + // Проба какого субстрата или организма была взята + "Risk_Probe_Analysis_Number text," + // Регистрационный номер формы отбора проб + + + "test boolean" + //Тестовая ли анкета + ");"; + db.execSQL(sql); oldVersion=152; } @@ -1026,13 +1399,15 @@ public class DbOpenHelper extends SQLiteOpenHelper db.execSQL("DROP TABLE IF EXISTS list_breeding"); //«Одиночные, разреженные, группы» db.execSQL("DROP TABLE IF EXISTS list_capacities"); //«Полнообъемное», «Малообъемное», «Ультрамалообъемное». db.execSQL("DROP TABLE IF EXISTS list_markings"); + db.execSQL("DROP TABLE IF EXISTS list_purpose"); + db.execSQL("DROP TABLE IF EXISTS list_impact"); + db.execSQL("DROP TABLE IF EXISTS list_diluted"); db.execSQL("DROP TABLE IF EXISTS sprayers"); //Опрыскиватели: "Трактор", "Самолёт" итд. db.execSQL("DROP TABLE IF EXISTS sprayers_types"); //Виды опрыскивания: "Авиа", "Наземное", "Ручное". db.execSQL("DROP TABLE IF EXISTS Fledgling"); onCreate(db); } - } //Функция по изменению типа столбца @@ -1283,7 +1658,7 @@ public class DbOpenHelper extends SQLiteOpenHelper Integer vegetation_damage_area, //Площадь повреждений (га) String insecticide_name, //коммерческое название String insecticide_active_substance, //Наименование активного вещества - Integer insecticide_concentration, //концентрация(г д.в./л или%) + String insecticide_concentration, //концентрация(г д.в./л или%) String insecticide_formulation, //формуляция(УМО, КЭ, др.) Integer insecticide_dose, //норма расхода(л/га) Integer insecticide_rate, //расход рабочей жидкости(л/га) diff --git a/app/src/main/java/kz/istt/locust/LocustActivity.java b/app/src/main/java/kz/istt/locust/LocustActivity.java index d00bd13..ad4ae83 100644 --- a/app/src/main/java/kz/istt/locust/LocustActivity.java +++ b/app/src/main/java/kz/istt/locust/LocustActivity.java @@ -2134,7 +2134,10 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Name_of_survey_team_leader) + "\"!"; eFields = true; } - if(isGONE(edtDate)) ((fieldDB)LocustActivity.this.edtDate).setValue(null); + if(isGONE(edtDate)) { + ((fieldDB) LocustActivity.this.edtDate).setValue(null); + } + if(!eFields && !isGONE(edtDate) && edtDate.getText().toString().equals("")) { scrollTo(edtDate); @@ -2173,7 +2176,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Surveyed_area_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtBioHectare,0,1000)!="") + if(!checkMinMaxI(edtBioHectare,0,1000).isEmpty()) { scrollTo(edtBioHectare); atxt = checkMinMaxI(edtBioHectare,0,1000) + " \"" + getResources().getString(R.string.Surveyed_area_ha) + "\"!"; @@ -2213,7 +2216,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener if(isGONE(edtBioTemperature)) edtBioTemperature.setText(null); if(!eFields && !isGONE(edtBioTemperature)) { - if(checkMinMaxI(edtBioTemperature,0,50)!="") + if(!checkMinMaxI(edtBioTemperature,0,50).isEmpty()) { scrollTo(edtBioTemperature); atxt = checkMinMaxI(edtBioTemperature,0,50) + " \"" + getResources().getString(R.string.Air_temperature) + "\"!"; @@ -2223,7 +2226,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener if(isGONE(edtBioWind)) edtBioWind.setText(null); if(!eFields && !isGONE(edtBioWind)) { - if(checkMinMaxI(edtBioWind,0,20)!="") //Проверка на интервалы + if(!checkMinMaxI(edtBioWind,0,20).isEmpty()) //Проверка на интервалы { scrollTo(edtBioWind); atxt = checkMinMaxI(edtBioWind,0,20) + " \"" + getResources().getString(R.string.Wind_m_s) + "\"!"; @@ -2253,7 +2256,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtLocustPopulated,0,1000)!="") + if(!checkMinMaxI(edtLocustPopulated,0,1000).isEmpty()) { scrollTo(edtLocustPopulated); atxt = checkMinMaxI(edtLocustPopulated,0,1000) + " \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; @@ -2271,7 +2274,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Egg_bed_surface_in_ha) + "\"!"; eFields = true; }else*/ - if(checkMinMaxI(edtEggsCapsulesArea,0,10000)!="") + if(!checkMinMaxI(edtEggsCapsulesArea,0,10000).isEmpty()) { scrollTo(edtEggsCapsulesArea); atxt = checkMinMaxI(edtEggsCapsulesArea,0,10000) + " \"" + getResources().getString(R.string.Egg_bed_surface_in_ha) + "\"!"; @@ -2288,7 +2291,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Egg_pods_density_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEggsCapsulesDensity,0,1000)!="") + if(!checkMinMaxI(edtEggsCapsulesDensity,0,1000).isEmpty()) { scrollTo(edtEggsCapsulesDensity); atxt = checkMinMaxI(edtEggsCapsulesDensity,0,1000) + " \"" + getResources().getString(R.string.Egg_pods_density_m2) + "\"!"; @@ -2305,7 +2308,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Egg_pods_density_m2) + " "+ getResources().getString(R.string.to) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEggsCapsulesDensityTo,0,5000)!="") + if(!checkMinMaxI(edtEggsCapsulesDensityTo,0,5000).isEmpty()) { scrollTo(edtEggsCapsulesDensityTo); atxt = checkMinMaxI(edtEggsCapsulesDensityTo,0,5000) + " \"" + getResources().getString(R.string.Egg_pods_density_m2) + " "+ getResources().getString(R.string.to) + "\"!"; @@ -2316,7 +2319,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener if(isGONE(edtEggsCapsules)) edtEggsCapsules.setText(null); if(!eFields && !isGONE(edtEggsCapsules)) { - if(checkMinMaxI(edtEggsCapsules,0,150)!="") + if(!checkMinMaxI(edtEggsCapsules,0,150).isEmpty()) { scrollTo(edtEggsCapsules); atxt = checkMinMaxI(edtEggsCapsules,0,150) + " \"" + getResources().getString(R.string.Eggs_average_number_egg_pod) + "\"!"; @@ -2333,7 +2336,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Eggs_viable) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEggsLive,0,100)!="") + if(!checkMinMaxI(edtEggsLive,0,100).isEmpty()) { scrollTo(edtEggsLive); atxt = checkMinMaxI(edtEggsLive,0,100) + " \"" + getResources().getString(R.string.Eggs_viable) + "\"!"; @@ -2385,7 +2388,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Hopper_density_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtLarvaDensity,0,80000)!="") + if(!checkMinMaxI(edtLarvaDensity,0,80000).isEmpty()) { scrollTo(edtLarvaDensity); atxt = checkMinMaxI(edtLarvaDensity,0,80000) + " \"" + getResources().getString(R.string.Hopper_density_m2) + "\"!"; @@ -2411,7 +2414,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Minimum_density_in_the_band_in_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtKuliguliDensity,0,80000)!="") + if(!checkMinMaxI(edtKuliguliDensity,0,80000).isEmpty()) { scrollTo(edtKuliguliDensity); atxt = checkMinMaxI(edtKuliguliDensity,0,80000) + " \"" + getResources().getString(R.string.Minimum_density_in_the_band_in_m2) + "\"!"; @@ -2428,7 +2431,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Minimum_density_in_the_band_in_m2) + " " + getResources().getString(R.string.to) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtKuliguliDensityTo,0,80000)!="") + if(!checkMinMaxI(edtKuliguliDensityTo,0,80000).isEmpty()) { scrollTo(edtKuliguliDensityTo); atxt = checkMinMaxI(edtKuliguliDensityTo,0,80000) + " \"" + getResources().getString(R.string.Minimum_density_in_the_band_in_m2) + " " + getResources().getString(R.string.to) + "\"!"; @@ -2445,7 +2448,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Band_sizes_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtKuliguliSize,0,10000)!="") + if(!checkMinMaxI(edtKuliguliSize,0,10000).isEmpty()) { scrollTo(edtKuliguliSize); atxt = checkMinMaxI(edtKuliguliSize,0,10000) + " \"" + getResources().getString(R.string.Band_sizes_m2) + "\"!"; @@ -2462,7 +2465,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Number_of_bands_ha) + "\"!"; eFields = true; }else*/ - if(checkMinMaxI(edtKuliguliCount,1,50)!="") + if(!checkMinMaxI(edtKuliguliCount,1,50).isEmpty()) { scrollTo(edtKuliguliCount); atxt = checkMinMaxI(edtKuliguliCount,1,50) + " \"" + getResources().getString(R.string.Number_of_bands) + "\"!"; @@ -2528,7 +2531,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener atxt = atxt + ": \"" + getResources().getString(R.string.Adult_density_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtImagoDensity,0,3000)!="") + if(!checkMinMaxI(edtImagoDensity,0,3000).isEmpty()) { scrollTo(edtImagoDensity); atxt = checkMinMaxI(edtImagoDensity,0,3000) + " \"" + getResources().getString(R.string.Adult_density_m2) + "\"!"; @@ -2539,7 +2542,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener if(isGONE(edtImagoDensityGa)) edtImagoDensityGa.setText(null); if(!eFields && !isGONE(edtImagoDensityGa)) { - if(checkMinMaxI(edtImagoDensityGa,0,50000)!="") + if(!checkMinMaxI(edtImagoDensityGa,0,50000).isEmpty()) { scrollTo(edtImagoDensityGa); atxt = checkMinMaxI(edtImagoDensityGa,0,50000) + " \"" + getResources().getString(R.string.Adult_density_ha) + "\"!"; @@ -2596,7 +2599,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener //Размер стаи if (isGONE(edtSwarmSize)) edtSwarmSize.setText(null); if (!eFields && !isGONE(edtSwarmSize)) { - if (checkMinMaxI(edtSwarmSize, 0, 100000) != "") { + if (!checkMinMaxI(edtSwarmSize, 0, 100000).isEmpty()) { scrollTo(edtSwarmSize); atxt = checkMinMaxI(edtSwarmSize, 0, 100000) + " \"" + getResources().getString(R.string.Swarm_size_ha) + "\"!"; eFields = true; @@ -2605,7 +2608,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener //Число стай if (isGONE(edtSwarmCount)) edtSwarmCount.setText(null); if (!eFields && !isGONE(edtSwarmCount)) { - if (checkMinMaxI(edtSwarmCount, 0, 10) != "") { + if (!checkMinMaxI(edtSwarmCount, 0, 10).isEmpty()) { scrollTo(edtSwarmCount); atxt = checkMinMaxI(edtSwarmCount, 0, 10) + " \"" + getResources().getString(R.string.Number_of_swarms) + "\"!"; eFields = true; diff --git a/app/src/main/java/kz/istt/locust/LocustDelActivity.java b/app/src/main/java/kz/istt/locust/LocustDelActivity.java index 0e19e9c..b74646d 100644 --- a/app/src/main/java/kz/istt/locust/LocustDelActivity.java +++ b/app/src/main/java/kz/istt/locust/LocustDelActivity.java @@ -128,8 +128,9 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe public EditText edtInsConcentration = null; // концентрация(г д.в./л или%) public View spiInsFormulation = null; // формуляция(УМО, КЭ, др.) public EditText edtInsDose = null; // норма расхода(л/га) + public View spiInsDiluted = null; // Коммерческий припарат разбавлен? + public EditText edtInsProportion = null; // пропорция разбавления рабочей жидкости public EditText edtInsRate = null; // расход рабочей жидкости(л/га) - public EditText edtInsUsedVolume = null; // Общий объем использованной рабочей жидкости (л) // public DateInput edtInsExpiryDate = null; // окончание срока действия (дата) @@ -148,7 +149,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe public View spiSprayDirectionStart = null; // направление опрыскивания нач. public View spiSprayDirectionEnd = null; // направление опрыскивания кон. - public View spiLocSpeciese = null; // вид: CIT, DMA, LMI, др. + public View spiLocSpecies = null; // вид: CIT, DMA, LMI, др. public View spiLocHoppers = null; // Стадии личинок, возраста: Младшие Средние Старшие //public View spiImago = null; // Имаго (да, нет) @@ -175,13 +176,14 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe // public EditText edtSprWidth = null; // Ширина захвата (м) // public EditText edtSprSpacing = null; // Расстояние между проходами опрыскивателя (м) (Надия Рашидовна сказала удалить) public View spiSprBarrier = null; // Барьеры (да, нет) - public EditText edtSprBarrierWidth = null; // ширина (м) + //public EditText edtSprBarrierWidth = null; // ширина (м) public EditText edtSprBarrierSpace = null; // промежуток (м) public EditText edtSprSpeed = null; // Скорость движения (км/ч) public View spiSprMarking = null; // Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет) public CheckBox cbEffectiveness = null; // Галочка чтоб сделать поля не обязательными + public View spiTypeImpact = null; // Тип оцениваемого биологического воздействия public EditText edtEffMortality = null; // смертность саранчи(%) public EditText edtEffTime = null; // Прошло времени после обработки в часах public View spiEffMethod = null; // метод подсчета смертности @@ -577,6 +579,29 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe edtInsDose = (EditText) findViewById(R.id.edtInsDose); // норма расхода(л/га) guiTable.add(edtInsDose, "insecticide_dose"); + spiInsDiluted = findViewById(R.id.spiInsDiluted); // Коммерческий припарат разбавлен? + guiTable.add(spiInsDiluted, "insecticide_diluted_id"); + ((selectDB)spiInsDiluted).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_diluted d where d.del=0 order by d.sort, d.name", null); + if (cursor.moveToFirst()) + { + do + { + ((selectDB)spiInsDiluted).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); + } while (cursor.moveToNext()); + } + cursor.close(); + dboh.close(); + edtInsProportion = (EditText) findViewById(R.id.edtInsProportion); // расход рабочей жидкости(л/га) + guiTable.add(edtInsProportion, "insecticide_proportion"); + + edtInsRate = (EditText) findViewById(R.id.edtInsRate); // расход рабочей жидкости(л/га) guiTable.add(edtInsRate, "insecticide_rate"); edtInsUsedVolume = (EditText) findViewById(R.id.edtInsUsedVolume); // Общий объем использованной рабочей жидкости (л) @@ -684,9 +709,9 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe dboh.close(); // locuststypes - spiLocSpeciese = findViewById(R.id.spiLocSpeciese); - guiTable.add(spiLocSpeciese, "locust_type_id"); - ((selectDB)spiLocSpeciese).addField("", ""); + spiLocSpecies = findViewById(R.id.spiLocSpecies); + guiTable.add(spiLocSpecies, "locust_type_id"); + ((selectDB)spiLocSpecies).addField("", ""); dboh = new DbOpenHelper(this); cursor = dboh .getReadableDatabase() @@ -697,7 +722,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe { do { - ((selectDB)spiLocSpeciese).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); + ((selectDB)spiLocSpecies).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); } while (cursor.moveToNext()); } cursor.close(); @@ -756,8 +781,24 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe // ((selectDB)spiSparse).addField(getString(R.string.No), "0"); spiMainPurpose = findViewById(R.id.spiMainPurpose); - guiTable.add(spiMainPurpose, "main_purpose"); -//TODO добавить выборку из справочника! + guiTable.add(spiMainPurpose, "locust_purpose_id"); + ((selectDB)spiMainPurpose).addField("", ""); + dboh = new DbOpenHelper(this); + cursor = dboh + .getReadableDatabase() + .rawQuery( + "select lt.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = lt.name AND l.short_name='" + + Tools.getLang() + "' LIMIT 1),lt.name) name from list_purpose lt where lt.del=0 order by lt.sort,lt.name", null); + if (cursor.moveToFirst()) + { + do + { + ((selectDB)spiMainPurpose).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); + } while (cursor.moveToNext()); + } + cursor.close(); + dboh.close(); + spiLocustPhaseId = findViewById(R.id.spiLocustPhaseId); guiTable.add(spiLocustPhaseId, "locust_phase_id"); @@ -883,10 +924,10 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe spiSprBarrier = findViewById(R.id.spiSprBarrier); // Барьеры (да, нет) guiTable.add(spiSprBarrier, "spray_barrier"); ((selectDB)spiSprBarrier).addField("", ""); - ((selectDB)spiSprBarrier).addField(getString(R.string.Yes), "1"); - ((selectDB)spiSprBarrier).addField(getString(R.string.No), "0"); - edtSprBarrierWidth = (EditText) findViewById(R.id.edtSprBarrierWidth); // ширина (м) - guiTable.add(edtSprBarrierWidth, "spray_barrier_width"); + ((selectDB)spiSprBarrier).addField(getString(R.string.Barriers), "1"); + ((selectDB)spiSprBarrier).addField(getString(R.string.Continuous), "0"); + //edtSprBarrierWidth = (EditText) findViewById(R.id.edtSprBarrierWidth); // ширина (м) + //guiTable.add(edtSprBarrierWidth, "spray_barrier_width"); edtSprBarrierSpace = (EditText) findViewById(R.id.edtSprBarrierSpace); // промежуток (м) guiTable.add(edtSprBarrierSpace, "spray_barrier_space"); @@ -949,6 +990,24 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe }; cbEffectiveness.setOnClickListener(oclCbBoxEggs); + spiTypeImpact = findViewById(R.id.spiTypeImpact); //Тип оцениваемого биологического воздействия + guiTable.add(spiTypeImpact, "efficacy_impact_id"); + ((selectDB)spiTypeImpact).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_impact d where d.del=0 order by d.sort,d.name", null); + if (cursor.moveToFirst()) + { + do + { + ((selectDB)spiTypeImpact).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); + } while (cursor.moveToNext()); + } + cursor.close(); + dboh.close(); edtEffMortality = (EditText) findViewById(R.id.edtEffMortality); // смертность саранчи(%) guiTable.add(edtEffMortality, "efficacy_mortality"); @@ -1581,7 +1640,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe if(spiWindDirectionEnd.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiWindDirectionEnd).updateAdapter(this); if(spiSprayDirectionStart.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprayDirectionStart).updateAdapter(this); if(spiSprayDirectionEnd.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprayDirectionEnd).updateAdapter(this); - if(spiLocSpeciese.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocSpeciese).updateAdapter(this); + //if(spiLocSpecies.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocSpeciese).updateAdapter(this); if(spiLocHoppers.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocHoppers).updateAdapter(this); //if(spiImago.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiImago).updateAdapter(this); //if(spiKuliguli.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiKuliguli).updateAdapter(this); @@ -2009,7 +2068,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtInfestedArea,0,1000)!="") + if(!checkMinMaxI(edtInfestedArea,0,1000).isEmpty()) { scrollTo(edtInfestedArea); atxt = checkMinMaxI(edtInfestedArea,0,1000) + " \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; @@ -2024,7 +2083,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Area_treated_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtTreatedArea,0,1000)!="") + if(!checkMinMaxI(edtTreatedArea,0,1000).isEmpty()) { scrollTo(edtTreatedArea); atxt = checkMinMaxI(edtTreatedArea,0,1000) + " \"" + getResources().getString(R.string.Area_treated_ha) + "\"!"; @@ -2045,7 +2104,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Height_cm) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtVegHeight,0,600)!="") + if(!checkMinMaxI(edtVegHeight,0,600).isEmpty()) { scrollTo(edtVegHeight); atxt = checkMinMaxI(edtVegHeight,0,600) + " \"" + getResources().getString(R.string.Height_cm) + "\"!"; @@ -2066,7 +2125,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtVegDamageArea)) { - if(checkMinMaxI(edtVegDamageArea,0,100000)!="") + if(!checkMinMaxI(edtVegDamageArea,0,100000).isEmpty()) { scrollTo(edtVegDamageArea); atxt = checkMinMaxI(edtVegDamageArea,0,100000) + " \"" + getResources().getString(R.string.Damage_area_ha) + "\"!"; @@ -2093,7 +2152,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Concentration_A_S) + "\"!"; eFields = true; }/*else - if(checkMinMaxI(edtInsConcentration,0,100)!="") + if(!checkMinMaxI(edtInsConcentration,0,100).isEmpty()) { scrollTo(edtInsConcentration); atxt = checkMinMaxI(edtInsConcentration,0,100) + " \"" + getResources().getString(R.string.Concentration_A_S) + "\"!"; @@ -2108,7 +2167,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtInsDose)) { - if(checkMinMaxI(edtInsDose,0.005f,5)!="") + if(!checkMinMaxI(edtInsDose,0.005f,5).isEmpty()) { scrollTo(edtInsDose); atxt = checkMinMaxI(edtInsDose,0.005f,5) + " \"" + getResources().getString(R.string.Dose_rate_l_of_commercial_product_ha) + "\"!"; @@ -2117,7 +2176,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtInsRate)) { - if(checkMinMaxI(edtInsRate,0.1f,600)!="") + if(!checkMinMaxI(edtInsRate,0.1f,600).isEmpty()) { scrollTo(edtInsRate); atxt = checkMinMaxI(edtInsRate,0.1f,600) + " \"" + getResources().getString(R.string.Rate_of_working_solution_l_ha) + "\"!"; @@ -2132,7 +2191,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtInsUsedVolume,1,450000)!="") + if(!checkMinMaxI(edtInsUsedVolume,1,450000).isEmpty()) { scrollTo(edtInsUsedVolume); atxt = checkMinMaxI(edtInsUsedVolume,1,450000) + " \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!"; @@ -2153,7 +2212,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtWeaTemperatureStart)) { - if(checkMinMaxI(edtWeaTemperatureStart,0,50)!="") + if(!checkMinMaxI(edtWeaTemperatureStart,0,50).isEmpty()) { scrollTo(edtWeaTemperatureStart); atxt = checkMinMaxI(edtWeaTemperatureStart,0,50) + " \"" + getResources().getString(R.string.Temperature_start) + "\"!"; @@ -2162,7 +2221,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtWeaTemperatureEnd)) { - if(checkMinMaxI(edtWeaTemperatureEnd,0,50)!="") + if(!checkMinMaxI(edtWeaTemperatureEnd,0,50).isEmpty()) { scrollTo(edtWeaTemperatureEnd); atxt = checkMinMaxI(edtWeaTemperatureEnd,0,50) + " \"" + getResources().getString(R.string.Temperature_end) + "\"!"; @@ -2172,7 +2231,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe if (!eFields && !isGONE(edtWeaWindSpeedStart)) { - if(checkMinMaxI(edtWeaWindSpeedStart,0,20)!="") + if(!checkMinMaxI(edtWeaWindSpeedStart,0,20).isEmpty()) { scrollTo(edtWeaWindSpeedStart); atxt = checkMinMaxI(edtWeaWindSpeedStart,0,20) + " \"" + getResources().getString(R.string.Wind_speed_start_m_s) + "\"!"; @@ -2181,16 +2240,16 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtWeaWindSpeedEnd)) { - if(checkMinMaxI(edtWeaWindSpeedEnd,0,20)!="") + if(!checkMinMaxI(edtWeaWindSpeedEnd,0,20).isEmpty()) { scrollTo(edtWeaWindSpeedEnd); atxt = checkMinMaxI(edtWeaWindSpeedEnd,0,20) + " \"" + getResources().getString(R.string.Wind_speed_end_m_s) + "\"!"; eFields = true; } } - if (!eFields && !isGONE(spiLocSpeciese) && ((selectDB)spiLocSpeciese).getText().toString().equals("")) + if (!eFields && !isGONE(spiLocSpecies) && ((selectDB)spiLocSpecies).getText().toString().equals("")) { - scrollTo(spiLocSpeciese); + scrollTo(spiLocSpecies); atxt = atxt + ": \"" + getResources().getString(R.string.Type) + "\"!"; eFields = true; } @@ -2208,31 +2267,38 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Density_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtLocDensity,0,80000)!="") + if(!checkMinMaxI(edtLocDensity,0,80000).isEmpty()) { scrollTo(edtLocDensity); atxt = checkMinMaxI(edtLocDensity,0,80000) + " \"" + getResources().getString(R.string.Density_m2) + "\"!"; eFields = true; } } - if (!eFields && !isGONE(spiKuliguli) && ((selectDB)spiKuliguli).getText().toString().equals("")) + + if (!eFields && !isGONE(spiMainPurpose) && ((selectDB)spiMainPurpose).getText().toString().equals("")) { - scrollTo(spiKuliguli); - atxt = atxt + ": \"" + getResources().getString(R.string.Bands) + "\"!"; - eFields = true; - } - if (!eFields && !isGONE(spiSwarm) && ((selectDB)spiSwarm).getText().toString().equals("")) - { - scrollTo(spiSwarm); - atxt = atxt + ": \"" + getResources().getString(R.string.Swarms) + "\"!"; - eFields = true; - } - if (!eFields && !isGONE(spiSparse) && ((selectDB)spiSparse).getText().toString().equals("")) - { - scrollTo(spiSparse); - atxt = atxt + ": \"" + getResources().getString(R.string.Del_Scattered) + "\"!"; + scrollTo(spiMainPurpose); + atxt = atxt + ": \"" + getResources().getString(R.string.Main_purpose_of_treatment) + "\"!"; eFields = true; } +// if (!eFields && !isGONE(spiKuliguli) && ((selectDB)spiKuliguli).getText().toString().equals("")) +// { +// scrollTo(spiKuliguli); +// atxt = atxt + ": \"" + getResources().getString(R.string.Bands) + "\"!"; +// eFields = true; +// } +// if (!eFields && !isGONE(spiSwarm) && ((selectDB)spiSwarm).getText().toString().equals("")) +// { +// scrollTo(spiSwarm); +// atxt = atxt + ": \"" + getResources().getString(R.string.Swarms) + "\"!"; +// eFields = true; +// } +// if (!eFields && !isGONE(spiSparse) && ((selectDB)spiSparse).getText().toString().equals("")) +// { +// scrollTo(spiSparse); +// atxt = atxt + ": \"" + getResources().getString(R.string.Del_Scattered) + "\"!"; +// eFields = true; +// } if (!eFields && !isGONE(spiSprPlatform) && ((selectDB)spiSprPlatform).getText().toString().equals("")) { scrollTo(spiSprPlatform); @@ -2241,7 +2307,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe } if (!eFields && !isGONE(edtSprHeight)) { - if(checkMinMaxI(edtSprHeight,1,100)!="") + if(!checkMinMaxI(edtSprHeight,1,100).isEmpty()) { scrollTo(edtSprHeight); atxt = checkMinMaxI(edtSprHeight,1,100) + " \"" + getResources().getString(R.string.Atomizer_height_above_ground_m) + "\"!"; @@ -2255,15 +2321,15 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe eFields = true; } - if (!eFields && !isGONE(edtSprBarrierWidth)) - { - if(checkMinMaxI(edtSprBarrierWidth,1,300)!="") - { - scrollTo(edtSprBarrierWidth); - atxt = checkMinMaxI(edtSprBarrierWidth,1,300) + " \"" + getResources().getString(R.string.Barrier_width_m) + "\"!"; - eFields = true; - } - } +// if (!eFields && !isGONE(edtSprBarrierWidth)) +// { +// if(!checkMinMaxI(edtSprBarrierWidth,1,300).isEmpty()) +// { +// scrollTo(edtSprBarrierWidth); +// atxt = checkMinMaxI(edtSprBarrierWidth,1,300) + " \"" + getResources().getString(R.string.Barrier_width_m) + "\"!"; +// eFields = true; +// } +// } if (!eFields && !isGONE(edtSprBarrierSpace)) { if(edtSprBarrierSpace.getText().toString().equals("")) @@ -2272,7 +2338,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Spacing_of_barriers_m) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtSprBarrierSpace,1,1000)!="") + if(!checkMinMaxI(edtSprBarrierSpace,1,1000).isEmpty()) { scrollTo(edtSprBarrierSpace); atxt = checkMinMaxI(edtSprBarrierSpace,1,1000) + " \"" + getResources().getString(R.string.Spacing_of_barriers_m) + "\"!"; @@ -2288,7 +2354,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtSprSpeed,1,300)!="") + if(!checkMinMaxI(edtSprSpeed,1,300).isEmpty()) { scrollTo(edtSprSpeed); atxt = checkMinMaxI(edtSprSpeed,1,300) + " \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!"; @@ -2303,7 +2369,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEffMortality,0,100)!="") + if(!checkMinMaxI(edtEffMortality,0,100).isEmpty()) { scrollTo(edtEffMortality); atxt = checkMinMaxI(edtEffMortality,0,100) + " \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!"; @@ -2318,7 +2384,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe atxt = atxt + ": \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEffTime,0,240)!="") + if(!checkMinMaxI(edtEffTime,0,240).isEmpty()) { scrollTo(edtEffTime); atxt = checkMinMaxI(edtEffTime,0,240) + " \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!"; diff --git a/app/src/main/java/kz/istt/locust/LocustHealthActivity.java b/app/src/main/java/kz/istt/locust/LocustHealthActivity.java index 3510252..7e2000c 100644 --- a/app/src/main/java/kz/istt/locust/LocustHealthActivity.java +++ b/app/src/main/java/kz/istt/locust/LocustHealthActivity.java @@ -142,7 +142,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi public View spiSprayDirectionStart = null; // направление опрыскивания нач. public View spiSprayDirectionEnd = null; // направление опрыскивания кон. - public View spiLocSpeciese = null; // вид: CIT, DMA, LMI, др. + public View spiLocSpecies = null; // вид: CIT, DMA, LMI, др. public View spiLocHoppers = null; // Стадии личинок, возраста: Младшие Средние Старшие //public View spiImago = null; // Имаго (да, нет) @@ -168,7 +168,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi // public EditText edtSprWidth = null; // Ширина захвата (м) // public EditText edtSprSpacing = null; // Расстояние между проходами опрыскивателя (м) (Надия Рашидовна сказала удалить) public View spiSprBarrier = null; // Барьеры (да, нет) - public EditText edtSprBarrierWidth = null; // ширина (м) + //public EditText edtSprBarrierWidth = null; // ширина (м) public EditText edtSprBarrierSpace = null; // промежуток (м) public EditText edtSprSpeed = null; // Скорость движения (км/ч) public View spiSprMarking = null; // Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет) @@ -678,9 +678,9 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi dboh.close(); // locuststypes - spiLocSpeciese = findViewById(R.id.spiLocSpeciese); - guiTable.add(spiLocSpeciese, "locust_type_id"); - ((selectDB)spiLocSpeciese).addField("", ""); + /*spiLocSpecies = findViewById(R.id.spiLocSpeciese); + guiTable.add(spiLocSpecies, "locust_type_id"); + ((selectDB)spiLocSpecies).addField("", ""); dboh = new DbOpenHelper(this); cursor = dboh .getReadableDatabase() @@ -691,11 +691,11 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi { do { - ((selectDB)spiLocSpeciese).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); + ((selectDB)spiLocSpecies).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id"))); } while (cursor.moveToNext()); } cursor.close(); - dboh.close(); + dboh.close();*/ spiLocHoppers = findViewById(R.id.spiLocHoppers); // Стадии личинок guiTable.add(spiLocHoppers, "locust_hoppers_id"); @@ -877,10 +877,10 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi spiSprBarrier = findViewById(R.id.spiSprBarrier); // Барьеры (да, нет) guiTable.add(spiSprBarrier, "spray_barrier"); ((selectDB)spiSprBarrier).addField("", ""); - ((selectDB)spiSprBarrier).addField(getString(R.string.Yes), "1"); - ((selectDB)spiSprBarrier).addField(getString(R.string.No), "0"); - edtSprBarrierWidth = (EditText) findViewById(R.id.edtSprBarrierWidth); // ширина (м) - guiTable.add(edtSprBarrierWidth, "spray_barrier_width"); + ((selectDB)spiSprBarrier).addField(getString(R.string.Barriers), "1"); + ((selectDB)spiSprBarrier).addField(getString(R.string.Continuous), "0"); + //edtSprBarrierWidth = (EditText) findViewById(R.id.edtSprBarrierWidth); // ширина (м) + //guiTable.add(edtSprBarrierWidth, "spray_barrier_width"); edtSprBarrierSpace = (EditText) findViewById(R.id.edtSprBarrierSpace); // промежуток (м) guiTable.add(edtSprBarrierSpace, "spray_barrier_space"); @@ -1581,7 +1581,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi if(spiWindDirectionEnd.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiWindDirectionEnd).updateAdapter(this); if(spiSprayDirectionStart.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprayDirectionStart).updateAdapter(this); if(spiSprayDirectionEnd.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiSprayDirectionEnd).updateAdapter(this); - if(spiLocSpeciese.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocSpeciese).updateAdapter(this); + //if(spiLocSpecies.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocSpeciese).updateAdapter(this); if(spiLocHoppers.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiLocHoppers).updateAdapter(this); //if(spiImago.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiImago).updateAdapter(this); //if(spiKuliguli.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)spiKuliguli).updateAdapter(this); @@ -2010,7 +2010,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtInfestedArea,0,1000)!="") + if(!checkMinMaxI(edtInfestedArea,0,1000).isEmpty()) { scrollTo(edtInfestedArea); atxt = checkMinMaxI(edtInfestedArea,0,1000) + " \"" + getResources().getString(R.string.Area_infested_ha) + "\"!"; @@ -2025,7 +2025,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Area_treated_ha) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtTreatedArea,0,1000)!="") + if(!checkMinMaxI(edtTreatedArea,0,1000).isEmpty()) { scrollTo(edtTreatedArea); atxt = checkMinMaxI(edtTreatedArea,0,1000) + " \"" + getResources().getString(R.string.Area_treated_ha) + "\"!"; @@ -2046,7 +2046,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Height_cm) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtVegHeight,0,600)!="") + if(!checkMinMaxI(edtVegHeight,0,600).isEmpty()) { scrollTo(edtVegHeight); atxt = checkMinMaxI(edtVegHeight,0,600) + " \"" + getResources().getString(R.string.Height_cm) + "\"!"; @@ -2067,7 +2067,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtVegDamageArea)) { - if(checkMinMaxI(edtVegDamageArea,0,100000)!="") + if(!checkMinMaxI(edtVegDamageArea,0,100000).isEmpty()) { scrollTo(edtVegDamageArea); atxt = checkMinMaxI(edtVegDamageArea,0,100000) + " \"" + getResources().getString(R.string.Damage_area_ha) + "\"!"; @@ -2094,7 +2094,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Concentration_A_S) + "\"!"; eFields = true; }/*else - if(checkMinMaxI(edtInsConcentration,0,100)!="") + if(!checkMinMaxI(edtInsConcentration,0,100).isEmpty()) { scrollTo(edtInsConcentration); atxt = checkMinMaxI(edtInsConcentration,0,100) + " \"" + getResources().getString(R.string.Concentration_A_S) + "\"!"; @@ -2109,7 +2109,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtInsDose)) { - if(checkMinMaxI(edtInsDose,0.005f,5)!="") + if(!checkMinMaxI(edtInsDose,0.005f,5).isEmpty()) { scrollTo(edtInsDose); atxt = checkMinMaxI(edtInsDose,0.005f,5) + " \"" + getResources().getString(R.string.Dose_rate_l_of_commercial_product_ha) + "\"!"; @@ -2118,7 +2118,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtInsRate)) { - if(checkMinMaxI(edtInsRate,0.1f,600)!="") + if(!checkMinMaxI(edtInsRate,0.1f,600).isEmpty()) { scrollTo(edtInsRate); atxt = checkMinMaxI(edtInsRate,0.1f,600) + " \"" + getResources().getString(R.string.Rate_of_working_solution_l_ha) + "\"!"; @@ -2133,7 +2133,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtInsUsedVolume,1,450000)!="") + if(!checkMinMaxI(edtInsUsedVolume,1,450000).isEmpty()) { scrollTo(edtInsUsedVolume); atxt = checkMinMaxI(edtInsUsedVolume,1,450000) + " \"" + getResources().getString(R.string.Total_volume_of_working_solution_actually_applied_l) + "\"!"; @@ -2154,7 +2154,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtWeaTemperatureStart)) { - if(checkMinMaxI(edtWeaTemperatureStart,0,50)!="") + if(!checkMinMaxI(edtWeaTemperatureStart,0,50).isEmpty()) { scrollTo(edtWeaTemperatureStart); atxt = checkMinMaxI(edtWeaTemperatureStart,0,50) + " \"" + getResources().getString(R.string.Temperature_start) + "\"!"; @@ -2163,7 +2163,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtWeaTemperatureEnd)) { - if(checkMinMaxI(edtWeaTemperatureEnd,0,50)!="") + if(!checkMinMaxI(edtWeaTemperatureEnd,0,50).isEmpty()) { scrollTo(edtWeaTemperatureEnd); atxt = checkMinMaxI(edtWeaTemperatureEnd,0,50) + " \"" + getResources().getString(R.string.Temperature_end) + "\"!"; @@ -2173,7 +2173,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi if (!eFields && !isGONE(edtWeaWindSpeedStart)) { - if(checkMinMaxI(edtWeaWindSpeedStart,0,20)!="") + if(!checkMinMaxI(edtWeaWindSpeedStart,0,20).isEmpty()) { scrollTo(edtWeaWindSpeedStart); atxt = checkMinMaxI(edtWeaWindSpeedStart,0,20) + " \"" + getResources().getString(R.string.Wind_speed_start_m_s) + "\"!"; @@ -2182,16 +2182,16 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtWeaWindSpeedEnd)) { - if(checkMinMaxI(edtWeaWindSpeedEnd,0,20)!="") + if(!checkMinMaxI(edtWeaWindSpeedEnd,0,20).isEmpty()) { scrollTo(edtWeaWindSpeedEnd); atxt = checkMinMaxI(edtWeaWindSpeedEnd,0,20) + " \"" + getResources().getString(R.string.Wind_speed_end_m_s) + "\"!"; eFields = true; } } - if (!eFields && !isGONE(spiLocSpeciese) && ((selectDB)spiLocSpeciese).getText().toString().equals("")) + if (!eFields && !isGONE(spiLocSpecies) && ((selectDB)spiLocSpecies).getText().toString().equals("")) { - scrollTo(spiLocSpeciese); + scrollTo(spiLocSpecies); atxt = atxt + ": \"" + getResources().getString(R.string.Type) + "\"!"; eFields = true; } @@ -2209,31 +2209,37 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Density_m2) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtLocDensity,0,80000)!="") + if(!checkMinMaxI(edtLocDensity,0,80000).isEmpty()) { scrollTo(edtLocDensity); atxt = checkMinMaxI(edtLocDensity,0,80000) + " \"" + getResources().getString(R.string.Density_m2) + "\"!"; eFields = true; } } - if (!eFields && !isGONE(spiKuliguli) && ((selectDB)spiKuliguli).getText().toString().equals("")) + if (!eFields && !isGONE(spiMainPurpose) && ((selectDB)spiMainPurpose).getText().toString().equals("")) { - scrollTo(spiKuliguli); - atxt = atxt + ": \"" + getResources().getString(R.string.Bands) + "\"!"; - eFields = true; - } - if (!eFields && !isGONE(spiSwarm) && ((selectDB)spiSwarm).getText().toString().equals("")) - { - scrollTo(spiSwarm); - atxt = atxt + ": \"" + getResources().getString(R.string.Swarms) + "\"!"; - eFields = true; - } - if (!eFields && !isGONE(spiSparse) && ((selectDB)spiSparse).getText().toString().equals("")) - { - scrollTo(spiSparse); - atxt = atxt + ": \"" + getResources().getString(R.string.Del_Scattered) + "\"!"; + scrollTo(spiMainPurpose); + atxt = atxt + ": \"" + getResources().getString(R.string.Main_purpose_of_treatment) + "\"!"; eFields = true; } +// if (!eFields && !isGONE(spiKuliguli) && ((selectDB)spiKuliguli).getText().toString().equals("")) +// { +// scrollTo(spiKuliguli); +// atxt = atxt + ": \"" + getResources().getString(R.string.Bands) + "\"!"; +// eFields = true; +// } +// if (!eFields && !isGONE(spiSwarm) && ((selectDB)spiSwarm).getText().toString().equals("")) +// { +// scrollTo(spiSwarm); +// atxt = atxt + ": \"" + getResources().getString(R.string.Swarms) + "\"!"; +// eFields = true; +// } +// if (!eFields && !isGONE(spiSparse) && ((selectDB)spiSparse).getText().toString().equals("")) +// { +// scrollTo(spiSparse); +// atxt = atxt + ": \"" + getResources().getString(R.string.Del_Scattered) + "\"!"; +// eFields = true; +// } if (!eFields && !isGONE(spiSprPlatform) && ((selectDB)spiSprPlatform).getText().toString().equals("")) { scrollTo(spiSprPlatform); @@ -2242,7 +2248,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi } if (!eFields && !isGONE(edtSprHeight)) { - if(checkMinMaxI(edtSprHeight,1,100)!="") + if(!checkMinMaxI(edtSprHeight,1,100).isEmpty()) { scrollTo(edtSprHeight); atxt = checkMinMaxI(edtSprHeight,1,100) + " \"" + getResources().getString(R.string.Atomizer_height_above_ground_m) + "\"!"; @@ -2255,19 +2261,18 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Barriers) + "\"!"; eFields = true; } - - if (!eFields && !isGONE(edtSprBarrierWidth)) - { - if(checkMinMaxI(edtSprBarrierWidth,1,300)!="") - { - scrollTo(edtSprBarrierWidth); - atxt = checkMinMaxI(edtSprBarrierWidth,1,300) + " \"" + getResources().getString(R.string.Barrier_width_m) + "\"!"; - eFields = true; - } - } +// if (!eFields && !isGONE(edtSprBarrierWidth)) +// { +// if(!checkMinMaxI(edtSprBarrierWidth,1,300).isEmpty()) +// { +// scrollTo(edtSprBarrierWidth); +// atxt = checkMinMaxI(edtSprBarrierWidth,1,300) + " \"" + getResources().getString(R.string.Barrier_width_m) + "\"!"; +// eFields = true; +// } +// } if (!eFields && !isGONE(edtSprBarrierSpace)) { - if(checkMinMaxI(edtSprBarrierSpace,1,1000)!="") + if(!checkMinMaxI(edtSprBarrierSpace,1,1000).isEmpty()) { scrollTo(edtSprBarrierSpace); atxt = checkMinMaxI(edtSprBarrierSpace,1,1000) + " \"" + getResources().getString(R.string.Spacing_of_barriers_m) + "\"!"; @@ -2283,7 +2288,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtSprSpeed,1,300)!="") + if(!checkMinMaxI(edtSprSpeed,1,300).isEmpty()) { scrollTo(edtSprSpeed); atxt = checkMinMaxI(edtSprSpeed,1,300) + " \"" + getResources().getString(R.string.Forward_speed_km_h) + "\"!"; @@ -2298,7 +2303,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEffMortality,0,100)!="") + if(!checkMinMaxI(edtEffMortality,0,100).isEmpty()) { scrollTo(edtEffMortality); atxt = checkMinMaxI(edtEffMortality,0,100) + " \"" + getResources().getString(R.string.Biological_efficiency_of_treatment) + "\"!"; @@ -2313,7 +2318,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi atxt = atxt + ": \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!"; eFields = true; }else - if(checkMinMaxI(edtEffTime,0,240)!="") + if(!checkMinMaxI(edtEffTime,0,240).isEmpty()) { scrollTo(edtEffTime); atxt = checkMinMaxI(edtEffTime,0,240) + " \"" + getResources().getString(R.string.Time_after_treatment_hours) + "\"!"; diff --git a/app/src/main/java/kz/istt/locust/MySynchronizationNew.java b/app/src/main/java/kz/istt/locust/MySynchronizationNew.java index 1f290f7..840f90b 100644 --- a/app/src/main/java/kz/istt/locust/MySynchronizationNew.java +++ b/app/src/main/java/kz/istt/locust/MySynchronizationNew.java @@ -92,6 +92,8 @@ public class MySynchronizationNew sd.addTask("list_formulation"); sd.addTask("list_height"); sd.addTask("list_enemies"); + sd.addTask("list_purpose"); + sd.addTask("list_impact"); sd.addTask("terminals"); sd.addTask("_languages"); sd.addTask("_translations"); diff --git a/app/src/main/java/kz/istt/locust/MySynchronizationOld.java b/app/src/main/java/kz/istt/locust/MySynchronizationOld.java index c3e1585..42c47b8 100644 --- a/app/src/main/java/kz/istt/locust/MySynchronizationOld.java +++ b/app/src/main/java/kz/istt/locust/MySynchronizationOld.java @@ -68,8 +68,8 @@ import tctable.TCTable; * */ public class MySynchronizationOld { - public static String URL="https://ccalm.org"; - //public static String URL="http://192.168.0.89:8080/CCALM"; + //public static String URL="https://ccalm.org"; + public static String URL="http://192.168.200.100:8080"; private Context _context; //От какого контекста показывать алерты //private boolean _showAlert; //Показывать ли окно подождите пожалуйста (его нельзя создавать если в сервисе) @@ -112,6 +112,9 @@ public class MySynchronizationOld private int rid_list_formulation = -1; private int rid_list_height = -1; private int rid_list_enemies = -1; + private int rid_list_purpose = -1; + private int rid_list_impact = -1; + private int rid_list_diluted = -1; private int rid_terminals = -1; //На кого зарегистрирован данныей планшет private int rid_companies = -1; @@ -361,6 +364,9 @@ public class MySynchronizationOld rid_list_formulation = makeRequest("list_formulation"); rid_list_height = makeRequest("list_height"); rid_list_enemies = makeRequest("list_enemies"); + rid_list_purpose = makeRequest("list_purpose"); + rid_list_impact = makeRequest("list_impact"); + rid_list_diluted = makeRequest("list_diluted"); rid_terminals = makeRequest("terminals"); rid_companies = makeRequest("companies"); @@ -417,6 +423,9 @@ public class MySynchronizationOld (rid == rid_list_formulation && rid_list_formulation!=-1) || (rid == rid_list_height && rid_list_height!=-1) || (rid == rid_list_enemies && rid_list_enemies!=-1) || + (rid == rid_list_purpose && rid_list_purpose!=-1) || + (rid == rid_list_impact && rid_list_impact!=-1) || + (rid == rid_list_diluted && rid_list_diluted!=-1) || (rid == rid_terminals && rid_terminals!=-1) || (rid == rid_companies && rid_companies!=-1) ) diff --git a/app/src/main/res/layout-land/activity_locust_del.xml b/app/src/main/res/layout-land/activity_locust_del.xml index 0873e30..0f45a8b 100644 --- a/app/src/main/res/layout-land/activity_locust_del.xml +++ b/app/src/main/res/layout-land/activity_locust_del.xml @@ -1436,9 +1436,9 @@ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/Locust_type"> + android:hint="@string/Species"> @@ -1780,7 +1780,7 @@ - - + + + + + + + + @@ -1757,7 +1757,7 @@ - - + @@ -1635,7 +1635,7 @@ android:layout_height="wrap_content" /> - @@ -1654,7 +1654,7 @@ android:ems="10" android:inputType="numberDecimal" > - + + + + + + + + @@ -1583,7 +1583,7 @@ android:layout_height="wrap_content" /> - @@ -1602,7 +1602,7 @@ android:ems="10" android:inputType="numberDecimal" > - + + + + + + + + + + + + + + android:hint="@string/Species"> @@ -1766,7 +1807,7 @@ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/Barriers"> + android:hint="@string/Type_of_treatment"> - - + + + + + + + @@ -27,232 +24,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:paddingRight="0dp"> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -291,7 +68,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -313,7 +93,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> - - - - - - - - + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> @@ -364,7 +122,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> - - - - - - - - - + android:src="@drawable/ic_star" + android:contentDescription="@null"/> - + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> + android:visibility="invisible" + android:inputType="text"/> + app:iconSize="24dp" + android:enabled="false" + android:focusable="false"/> + android:minWidth="2dp" + android:visibility="invisible" + android:inputType="text"/> + + + android:gravity="center"> + + + + + + + + + + + + + + + + + + + + + + + + + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -802,7 +665,6 @@ android:layout_height="wrap_content" > + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -884,7 +749,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> - - - - - - - - - - - - - - + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + + + + + + + + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> @@ -1039,7 +954,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:inputType="text" + android:enabled="false" + android:focusable="false"/> @@ -1067,7 +985,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1108,7 +1033,57 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + + + + + + + + + + + + + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1132,56 +1109,28 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> - + + android:enabled="false" + android:focusable="false"/> - - + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1220,7 +1172,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1286,56 +1249,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> - - - - - - - - - - - - - + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1352,7 +1269,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1369,7 +1289,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1386,7 +1309,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:hint="@string/Species"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1442,7 +1371,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> - + android:src="@drawable/ic_star" + android:contentDescription="@null"/> - + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1510,80 +1446,27 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:hint="@string/Main_purpose_of_treatment"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> - - - - - - - - - - - - - - - - - - - - + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1619,7 +1505,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1636,7 +1525,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -1653,7 +1545,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> - - + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + android:inputType="text" + android:enabled="false" + android:focusable="false"/> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> - - - - - - - + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1755,7 +1619,27 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" - android:paddingLeft="@dimen/activity_horizontal_margin"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="0dp"> + + + + + + + android:inputType="text"/> + + + + + + + + + + + + + @@ -1782,7 +1711,31 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + android:inputType="numberDecimal" + android:enabled="false" + android:focusable="false"/> @@ -1809,7 +1764,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1836,14 +2164,45 @@ android:gravity="center" android:paddingLeft="@dimen/activity_horizontal_margin"> - + + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@color/transparent" + android:hint="Ширина захвата с хорошим покрытием капель (м)" + android:maxLines="1" + android:singleLine="true" + android:inputType="numberDecimal"/> + + + + + + @@ -1851,22 +2210,86 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="@dimen/activity_horizontal_margin"> - + + + + + + + + + + + + + + + + + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content"/> - + + + @@ -1964,7 +2537,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:text="@string/Goggles" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Masks" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Gloves" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Overalls" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Caps" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Boots" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Protection_is_absent" + android:enabled="false" + android:focusable="false"/> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2081,7 +2781,8 @@ + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -2113,82 +2816,49 @@ android:background="@color/transparent" android:hint="@string/If_yes_describe_what_happened_description" android:maxLines="1" - android:singleLine="true" /> + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> - - - - - - + - - + + android:layout_weight="1" + android:background="@color/transparent" + android:hint="Дополнительные сведения о случайном воздействии или отравлении" + android:maxLines="1" + android:singleLine="true" /> + + - - - - - - - - - - + + + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + android:text="@string/Farmer" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Shepherd" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Beekeeper" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Villager" + android:enabled="false" + android:focusable="false"/> + android:text="@string/Official" + android:enabled="false" + android:focusable="false"/> + android:layout_gravity="left|top" + android:text="@string/Other" + android:enabled="false" + android:focusable="false"/> + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -2305,11 +3037,12 @@ android:background="@color/transparent" android:hint="@string/If_Yes_type_of_organisms_and_effects_description" android:maxLines="1" - android:singleLine="true" /> + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> - + android:src="@drawable/ic_star" + android:contentDescription="@null"/> + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content" + android:enabled="false" + android:focusable="false"/> @@ -2349,6 +3178,48 @@ android:background="@color/transparent" android:hint="@string/If_Yes_type_of_incident_and_reported_by_whom_description" android:maxLines="1" + android:singleLine="true" + android:enabled="false" + android:focusable="false"/> + + + + + + + + + + + + @@ -2370,15 +3241,999 @@ android:textStyle="bold" /> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index dc8b7f5..cafff43 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -114,7 +114,7 @@ android:layout_marginLeft="62dp" android:layout_marginRight="62dp" android:minHeight="70dp" - android:text="@string/title_activity_locust_del"/> + android:text="Мониторинг здоровья человека и окружающей среды"/>