# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 23:58
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('unloads', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='InVent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vent1', models.BooleanField(verbose_name='химия1')),
                ('vent2', models.BooleanField(verbose_name='химия2')),
                ('vent3', models.BooleanField(verbose_name='химия3')),
                ('vent4', models.BooleanField(verbose_name='химия4')),
                ('vent5', models.BooleanField(verbose_name='вода1')),
                ('vent6', models.BooleanField(verbose_name='вода2')),
                ('vent7', models.BooleanField(verbose_name='цемент1')),
                ('vent8', models.BooleanField(verbose_name='цемент2')),
                ('vent9', models.BooleanField(verbose_name='щебень1')),
                ('vent10', models.BooleanField(verbose_name='щебень2')),
                ('vent11', models.BooleanField(verbose_name='песок1')),
                ('vent12', models.BooleanField(verbose_name='песок2')),
                ('vent13', models.BooleanField(verbose_name='щебень3')),
                ('vent14', models.BooleanField(verbose_name='щебень4')),
            ],
            options={
                'verbose_name_plural': 'состояния наполнительных вентилей',
                'verbose_name': 'состояние наполнительных вентилей',
            },
        ),
        migrations.CreateModel(
            name='LoadBunker',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.PositiveSmallIntegerField(default=30, verbose_name='Задуто')),
                ('is_valid', models.BooleanField(default=False, verbose_name='Подтверждена')),
            ],
        ),
        migrations.CreateModel(
            name='OutVent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=127, null=True, verbose_name='имя')),
                ('him', models.BooleanField(verbose_name='химия')),
                ('water', models.BooleanField(verbose_name='вода')),
                ('cement', models.BooleanField(verbose_name='цемент')),
                ('composite', models.BooleanField(verbose_name='смесь')),
            ],
            options={
                'verbose_name_plural': 'состояние выпускных вентилей',
                'verbose_name': 'состояние выпускных вентилей',
            },
        ),
        migrations.CreateModel(
            name='RbuStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=127, null=True, verbose_name='имя')),
                ('cem_bunker_active', models.CharField(choices=[('L', 'Левый'), ('R', 'Правый'), ('e', 'ОШИБКА')], max_length=1, verbose_name='активный бункер')),
                ('cem_bunker1', models.CharField(choices=[('F', 'Полный'), ('H', 'Полупустой'), ('N', 'Пустой'), ('e', 'ОШИБКА')], max_length=1, verbose_name='первый бункер')),
                ('cem_bunker2', models.CharField(choices=[('F', 'Полный'), ('H', 'Полупустой'), ('N', 'Пустой'), ('e', 'ОШИБКА')], max_length=1, verbose_name='второй бункер')),
                ('skip', models.CharField(choices=[('F', 'Полный'), ('N', 'Пустой'), ('e', 'ОШИБКА')], max_length=1, verbose_name='Скип')),
                ('skip_directions', models.CharField(choices=[('U', 'Вверх быстро'), ('M', 'Вверх'), ('D', 'Вниз'), ('e', 'ОШИБКА')], max_length=1, verbose_name='скип движется')),
                ('mixer', models.CharField(choices=[('C', 'Закрыт'), ('M', 'Изменяется'), ('O', 'Открыт'), ('e', 'ОШИБКА')], max_length=1, verbose_name='выпускной тракт')),
            ],
            options={
                'verbose_name_plural': 'состояния блоков',
                'verbose_name': 'состояние блоков',
            },
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(verbose_name='дата')),
                ('him1', models.FloatField(verbose_name='химия1')),
                ('him2', models.FloatField(verbose_name='химия2')),
                ('water', models.FloatField(verbose_name='вода')),
                ('cement', models.FloatField(verbose_name='цемент')),
                ('breakstone1', models.PositiveSmallIntegerField(verbose_name='щебень1')),
                ('sand', models.PositiveSmallIntegerField(verbose_name='песок')),
                ('breakstone2', models.PositiveSmallIntegerField(verbose_name='щебень2')),
                ('img', models.ImageField(upload_to='', verbose_name='картинка')),
                ('no_error', models.BooleanField(default=False, verbose_name='без ошибок')),
                ('warning', models.BooleanField(default=False, verbose_name='Предупреждение')),
                ('mix_him', models.FloatField(default=0, verbose_name='химия в миксере')),
                ('mix_water', models.FloatField(default=0, verbose_name='вода в миксере')),
                ('mix_cement', models.FloatField(default=0, verbose_name='цемент в миксере')),
                ('mix_breakstone', models.SmallIntegerField(default=0, verbose_name='щебень в миксере')),
                ('mix_sand', models.SmallIntegerField(default=0, verbose_name='песок в миксере')),
                ('skip_breakstone', models.SmallIntegerField(default=0, verbose_name='щебень в скипе')),
                ('skip_sand', models.SmallIntegerField(default=0, verbose_name='песок в скипе')),
                ('storage_breakstone', models.SmallIntegerField(default=0, verbose_name='щебень в накопителе')),
                ('storage_sand', models.SmallIntegerField(default=0, verbose_name='песок в накопителе')),
                ('is_processed', models.BooleanField(default=False, verbose_name='Обработан')),
                ('rbu_statuses', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='statuses.RbuStatus', verbose_name='Состояние блоков')),
                ('unload', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='unloads.Unload', verbose_name='Выгрузка')),
                ('vents1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='statuses.InVent', verbose_name='Впускные вентили')),
                ('vents2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='statuses.OutVent', verbose_name='Выпускные вентили')),
            ],
            options={
                'ordering': ['-date'],
                'verbose_name_plural': 'статусы РБУ',
                'verbose_name': 'статус РБУ',
            },
        ),
        migrations.AddField(
            model_name='loadbunker',
            name='status_curr',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='status_curr', to='statuses.Status', verbose_name='Статус ПОСЛЕ'),
        ),
        migrations.AddField(
            model_name='loadbunker',
            name='status_prev',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='status_prev', to='statuses.Status', verbose_name='Статус ДО'),
        ),
        migrations.AlterUniqueTogether(
            name='loadbunker',
            unique_together=set([('status_prev', 'status_curr')]),
        ),
    ]
