# Generated by Django 3.0.3 on 2021-02-17 08:25

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('mainapp', '0002_field_road_serialized'),
    ]

    operations = [
        migrations.CreateModel(
            name='Drone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, verbose_name='Название')),
                ('model', models.CharField(max_length=250, verbose_name='Модель дрона')),
                ('max_speed', models.FloatField(verbose_name='Максимальная скорость')),
                ('max_height', models.FloatField(verbose_name='Максимальная высота')),
                ('max_distance_no_load', models.FloatField(verbose_name='Максимальная дальность полета без доп. нагрузки')),
                ('weight', models.FloatField(verbose_name='Вес дрона')),
            ],
            options={
                'verbose_name': 'Дрон',
                'verbose_name_plural': 'Дроны',
                'unique_together': {('name', 'model')},
            },
        ),
        migrations.CreateModel(
            name='Mission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, unique=True, verbose_name='Название')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание')),
                ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Время создания')),
                ('status', models.SmallIntegerField(choices=[(-2, 'Критическая ошибка'), (-1, 'Отмена'), (0, 'Не запущен'), (1, 'В ожидании'), (2, 'В работе'), (3, 'Завершен')], default=0, verbose_name='Статус')),
                ('type', models.SmallIntegerField(choices=[(1, 'Опрыскивание'), (2, 'Аеро-фото-съемка'), (3, 'Детальная съемка')], verbose_name='Тип задачи')),
                ('grid_step', models.FloatField(default=0.001, verbose_name='Шаг решетки')),
                ('drones', models.ManyToManyField(to='mainapp.Drone', verbose_name='Дроны')),
                ('field', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Field', verbose_name='Поля')),
            ],
            options={
                'verbose_name': 'Миссия',
                'verbose_name_plural': 'Миссии',
            },
        ),
        migrations.CreateModel(
            name='Waypoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datetime', models.DateTimeField(verbose_name='Дата и время Waypointа')),
                ('lat', models.FloatField(verbose_name='Широта')),
                ('lon', models.FloatField(verbose_name='Долгота')),
                ('height', models.FloatField(verbose_name='Высота')),
                ('speed', models.FloatField(verbose_name='Скорость полета')),
                ('acceleration', models.FloatField(verbose_name='Ускорение')),
                ('spray_on', models.BooleanField(blank=True, null=True, verbose_name='Включено ли разбрызгивание')),
                ('drone', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Drone')),
                ('mission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Mission')),
            ],
            options={
                'verbose_name': 'Waypoint облета',
                'verbose_name_plural': 'Waypointы облетов',
            },
        ),
        migrations.AddField(
            model_name='mission',
            name='waypoints_history',
            field=models.ManyToManyField(related_name='mission_obj', to='mainapp.Waypoint', verbose_name='История'),
        ),
    ]
