# Generated by Django 5.2.8 on 2025-12-09 15:46

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("screens", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="CharacterScreen",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("slug", models.SlugField(max_length=64, unique=True)),
                ("name", models.CharField(max_length=100)),
                (
                    "skin",
                    models.CharField(
                        help_text="Skin, SKU or shell identifier for the device.",
                        max_length=100,
                    ),
                ),
                (
                    "columns",
                    models.PositiveSmallIntegerField(
                        default=0,
                        help_text="Text columns for character displays or pixel width for matrix screens.",
                    ),
                ),
                (
                    "rows",
                    models.PositiveSmallIntegerField(
                        default=0,
                        help_text="Text rows for character displays or pixel height for matrix screens.",
                    ),
                ),
                (
                    "resolution_width",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Pixel width for graphical displays when the resolution differs from columns.",
                        null=True,
                    ),
                ),
                (
                    "resolution_height",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Pixel height for graphical displays when the resolution differs from rows.",
                        null=True,
                    ),
                ),
                (
                    "min_refresh_ms",
                    models.PositiveIntegerField(
                        default=50,
                        help_text="Minimum delay in milliseconds before accepting the next frame.",
                    ),
                ),
                (
                    "last_refresh_at",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "character_buffer",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="Latest character payload received by the screen.",
                    ),
                ),
                (
                    "encoding",
                    models.CharField(
                        default="utf-8",
                        help_text="Encoding used when rendering the character buffer.",
                        max_length=32,
                    ),
                ),
            ],
            options={
                "verbose_name": "Character Screen",
                "verbose_name_plural": "Character Screens",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PixelScreen",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("slug", models.SlugField(max_length=64, unique=True)),
                ("name", models.CharField(max_length=100)),
                (
                    "skin",
                    models.CharField(
                        help_text="Skin, SKU or shell identifier for the device.",
                        max_length=100,
                    ),
                ),
                (
                    "columns",
                    models.PositiveSmallIntegerField(
                        default=0,
                        help_text="Text columns for character displays or pixel width for matrix screens.",
                    ),
                ),
                (
                    "rows",
                    models.PositiveSmallIntegerField(
                        default=0,
                        help_text="Text rows for character displays or pixel height for matrix screens.",
                    ),
                ),
                (
                    "resolution_width",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Pixel width for graphical displays when the resolution differs from columns.",
                        null=True,
                    ),
                ),
                (
                    "resolution_height",
                    models.PositiveIntegerField(
                        blank=True,
                        help_text="Pixel height for graphical displays when the resolution differs from rows.",
                        null=True,
                    ),
                ),
                (
                    "min_refresh_ms",
                    models.PositiveIntegerField(
                        default=50,
                        help_text="Minimum delay in milliseconds before accepting the next frame.",
                    ),
                ),
                (
                    "last_refresh_at",
                    models.DateTimeField(blank=True, editable=False, null=True),
                ),
                (
                    "pixel_buffer",
                    models.BinaryField(
                        blank=True,
                        default=bytes,
                        help_text="Raw pixel buffer in row-major order.",
                    ),
                ),
                (
                    "pixel_format",
                    models.CharField(
                        default="RGB",
                        help_text="Channel order for the pixel buffer (e.g. RGB or RGBA).",
                        max_length=16,
                    ),
                ),
                (
                    "bytes_per_pixel",
                    models.PositiveSmallIntegerField(
                        default=1,
                        help_text="Number of bytes used to represent a single pixel.",
                    ),
                ),
                (
                    "row_stride",
                    models.PositiveIntegerField(
                        default=0,
                        help_text="Optional row stride in bytes; 0 defaults to width * bytes_per_pixel.",
                    ),
                ),
            ],
            options={
                "verbose_name": "Pixel Screen",
                "verbose_name_plural": "Pixel Screens",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.RemoveField(
            model_name="pyxelviewport",
            name="devicescreen_ptr",
        ),
        migrations.DeleteModel(
            name="DeviceScreen",
        ),
        migrations.DeleteModel(
            name="PyxelViewport",
        ),
    ]
