# Generated by Django 3.0.6 on 2020-06-28 12:29

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ACAdministrator',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('password', models.CharField(default='', max_length=256)),
                ('c_time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': '空调管理员',
                'verbose_name_plural': '空调管理员',
            },
        ),
        migrations.CreateModel(
            name='CentralAirConditioner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ac_state', models.CharField(choices=[('close', '关闭'), ('set_Model', '设置模式'), ('ready', '就绪'), ('none', '备用')], default='close', max_length=64, verbose_name='中央空调状态')),
                ('temp_mode', models.SmallIntegerField(choices=[(1, '制冷模式'), (-1, '制热模式')], default=1, verbose_name='制冷制热模式')),
                ('cool_temp_highlimit', models.IntegerField(default=25, verbose_name='制冷温控范围最高温')),
                ('cool_temp_lowlimit', models.IntegerField(default=18, verbose_name='制冷温控范围最低温')),
                ('heat_temp_highlimit', models.IntegerField(default=30, verbose_name='制热温控范围最高温')),
                ('heat_temp_lowlimit', models.IntegerField(default=25, verbose_name='制热温控范围最低温')),
                ('default_temp', models.IntegerField(default=25, verbose_name='缺省温度')),
                ('feerate_H', models.FloatField(default=0.016666666666666666, verbose_name='高风费率')),
                ('feerate_M', models.FloatField(default=0.008333333333333333, verbose_name='中风费率')),
                ('feerate_L', models.FloatField(default=0.005555555555555556, verbose_name='低风费率')),
                ('max_load', models.IntegerField(default=3, verbose_name='最大带机量')),
                ('waiting_duration', models.IntegerField(default=120)),
            ],
        ),
        migrations.CreateModel(
            name='Manager',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('password', models.CharField(default='', max_length=256)),
                ('c_time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': '酒店经理',
                'verbose_name_plural': '酒店经理',
            },
        ),
        migrations.CreateModel(
            name='requestQueue',
            fields=[
                ('room_id', models.CharField(max_length=64, primary_key=True, serialize=False, verbose_name='房间号')),
                ('room_state', models.SmallIntegerField(choices=[(0, '关闭'), (1, '运行'), (2, '挂起')], default=2, verbose_name='房间送风状态')),
                ('temp_mode', models.SmallIntegerField(choices=[(1, '制冷模式'), (-1, '制热模式')], default=1, verbose_name='制冷制热模式')),
                ('blow_mode', models.SmallIntegerField(choices=[(0, '低风'), (1, '中风'), (2, '高风')], default=1, verbose_name='送风模式')),
                ('request_timestamp', models.DateTimeField(auto_now_add=True, verbose_name='请求送风时间戳')),
                ('air_timestamp', models.DateTimeField(null=True, verbose_name='开始送风时间戳')),
                ('service_duration', models.IntegerField(default=0, verbose_name='当前服务时长(秒)')),
            ],
        ),
        migrations.CreateModel(
            name='RequestRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('room_id', models.CharField(max_length=64, verbose_name='房间号')),
                ('room_state', models.SmallIntegerField(choices=[(0, '关闭'), (1, '运行'), (2, '挂起')], default=2, verbose_name='房间送风状态')),
                ('temp_mode', models.SmallIntegerField(choices=[(1, '制冷模式'), (-1, '制热模式')], default=2, verbose_name='送风模式')),
                ('start_temp', models.IntegerField(verbose_name='初始温度')),
                ('target_temp', models.IntegerField(verbose_name='目标温度')),
                ('request_time', models.DateTimeField()),
                ('finished', models.IntegerField(default=0, verbose_name='结束')),
            ],
        ),
        migrations.CreateModel(
            name='Room',
            fields=[
                ('room_id', models.CharField(max_length=64, primary_key=True, serialize=False, unique=True, verbose_name='房间号')),
                ('room_state', models.SmallIntegerField(choices=[(0, '关闭'), (1, '运行'), (2, '挂起')], default=0, verbose_name='房间从控机状态')),
                ('temp_mode', models.SmallIntegerField(choices=[(1, '制冷模式'), (-1, '制热模式')], default=1, verbose_name='制冷制热模式')),
                ('blow_mode', models.SmallIntegerField(choices=[(0, '低风'), (1, '中风'), (2, '高风')], default=1, verbose_name='送风模式')),
                ('current_temp', models.IntegerField(verbose_name='当前温度')),
                ('target_temp', models.IntegerField(default=25, verbose_name='目标温度')),
                ('fee', models.FloatField(verbose_name='总费用')),
                ('duration', models.IntegerField(verbose_name='服务时长(秒)')),
            ],
        ),
        migrations.CreateModel(
            name='RoomDailyReport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('room_id', models.CharField(max_length=64, verbose_name='房间号')),
                ('date', models.DateField(auto_now=True, verbose_name='日期')),
                ('switch_count', models.IntegerField(default=0, verbose_name='开关次数')),
                ('schedule_count', models.IntegerField(default=0, verbose_name='被调度次数')),
                ('change_temp_count', models.IntegerField(default=0, verbose_name='调温次数')),
                ('change_speed_count', models.IntegerField(default=0, verbose_name='调风次数')),
            ],
        ),
        migrations.CreateModel(
            name='TemperatureSensor',
            fields=[
                ('room_id', models.CharField(max_length=64, primary_key=True, serialize=False, unique=True, verbose_name='房间号')),
                ('init_temp', models.FloatField(verbose_name='初始温度')),
                ('current_temp', models.FloatField(verbose_name='当前温度')),
                ('last_update', models.DateTimeField(default=datetime.datetime(2020, 6, 28, 12, 29, 57, 12718), verbose_name='上次更新时间')),
            ],
        ),
        migrations.CreateModel(
            name='Tenant',
            fields=[
                ('name', models.CharField(max_length=128, unique=True)),
                ('password', models.CharField(default='', max_length=256)),
                ('c_time', models.DateTimeField(auto_now_add=True)),
                ('room_id', models.CharField(max_length=64, primary_key=True, serialize=False, verbose_name='房间号')),
                ('date_in', models.DateField(null=True, verbose_name='入住日期')),
                ('date_out', models.DateField(null=True, verbose_name='登出日期')),
            ],
            options={
                'verbose_name': '房客',
                'verbose_name_plural': '房客',
                'ordering': ['-c_time'],
            },
        ),
        migrations.CreateModel(
            name='Waiter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True)),
                ('password', models.CharField(default='', max_length=256)),
                ('c_time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': '前台服务员',
                'verbose_name_plural': '前台服务员',
            },
        ),
        migrations.CreateModel(
            name='ServiceRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('blow_mode', models.SmallIntegerField(choices=[(0, '低风'), (1, '中风'), (2, '高风')], default=2, verbose_name='送风模式')),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('service_time', models.DurationField()),
                ('power_comsumption', models.FloatField(verbose_name='用电度数')),
                ('now_temp', models.FloatField(verbose_name='当前温度')),
                ('fee_rate', models.FloatField(choices=[(0.01666, '高风单位耗电量(度/秒)'), (0.00833, '中风单位耗电量(度/秒)'), (0.00556, '低风单位耗电量(度/秒)')], default=2, verbose_name='费率')),
                ('fee', models.FloatField()),
                ('RR', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.RequestRecord')),
            ],
        ),
    ]
