Imports System.Drawing
Imports UTS_Core.UTSModule.Project

Namespace UTSModule.Station

    Public Class ProcessStation
        Enum StationTypeEnum
            ''' <summary>
            ''' 未知类型
            ''' </summary>
            None
            ''' <summary>
            ''' 扫码目检站
            ''' </summary>
            AOI
            ''' <summary>
            ''' 测试站
            ''' </summary>
            Test
            ''' <summary>
            ''' 条码关联站
            ''' </summary>
            Assem
            ''' <summary>
            ''' 成品录入站
            ''' </summary>
            PE
            ''' <summary>
            ''' 抽检站
            ''' </summary>
            QA

            ''' <summary>
            ''' 包装站位
            ''' </summary>
            Package

            ''' <summary>
            ''' 唯一条码测试站
            ''' </summary>
            Test2

            ''' <summary>
            ''' 包装测试站，2023-05-09添加，参考uts-win的方式做包装站
            ''' </summary>
            PackageTest
        End Enum


        Enum SnTypeEnum
            ''' <summary>
            ''' 无序列号
            ''' </summary>
            None
            ''' <summary>
            ''' 系统生成
            ''' </summary>
            Auto

            ''' <summary>
            ''' 测试时录入
            ''' </summary>
            Test

            ''' <summary>
            ''' 用户录入
            ''' </summary>
            Excel
        End Enum


        Sub New(project As ProjectInfo)
            StationID = -1

            Name = String.Empty
            Description = String.Empty

            _stationType = StationTypeEnum.None
            PreViewImage = Nothing

            UserId = -1

            DevType = String.Empty
            DevApp = String.Empty

            SnListOrder = -1
            IsValid = True

            Packet = New StationPacket(Me)
            ParentProject = project

            SnType = SnTypeEnum.Auto
        End Sub

        ''' <summary>
        ''' 当前站位类型
        ''' </summary>
        Private _stationType As StationTypeEnum

        ''' <summary>
        ''' 项目站索引，项目站唯一索引,新建站时自动生成,生成后不能修改
        ''' </summary>
        ''' <returns></returns>
        Public Property StationID As Integer

        ''' <summary>
        ''' 项目站名称
        ''' </summary>
        ''' <returns></returns>
        Public Property Name As String

        Public Property StationType As StationTypeEnum
            Get
                Return _stationType
            End Get
            Set(value As StationTypeEnum)
                _stationType = value
                Packet.StationType = _stationType
            End Set
        End Property


        ''' <summary>
        ''' 项目站序号,表示该站在项目站总流程中测试顺序
        ''' 例如1，表示当前为第一站
        ''' </summary>
        ''' <returns></returns>
        Public Property ArtworkOrder() As Integer

        ''' <summary>
        ''' 项目站内容描述
        ''' </summary>
        ''' <returns></returns>
        Public Property Description As String


        ''' <summary>
        ''' 工艺站预览图
        ''' </summary>
        ''' <returns></returns>
        Public Property PreViewImage() As Image



        ''' <summary>
        ''' 使用测试站的设备类型,待删除
        ''' </summary>
        ''' <returns></returns>
        Public Property DevType() As String

        ''' <summary>
        ''' 使用测试站的设备软件名,待删除
        ''' </summary>
        ''' <returns></returns>
        Public Property DevApp() As String


        ''' <summary>
        ''' 项目站当前操作人员,为当前登录人员账号
        ''' </summary>
        ''' <returns></returns>
        Public Property UserId As Integer


        ''' <summary>
        ''' 生成测试站时的顺序，从1开始
        ''' </summary>
        ''' <returns></returns>
        Public Property SnListOrder As Integer

        ''' <summary>
        ''' 当前站位是否有效
        ''' </summary>
        ''' <returns></returns>
        Public Property IsValid As Boolean

        ''' <summary>
        ''' 条码生成规则，1系统生成，2客户录入
        ''' </summary>
        ''' <returns></returns>
        Public Property SnType() As SnTypeEnum

        ''' <summary>
        ''' 项目站关联的项目站包信息
        ''' </summary>
        ''' <returns></returns>
        Public Property Packet() As StationPacket

        ''' <summary>
        ''' 项目站所属项目信息
        ''' </summary>
        ''' <returns></returns>
        Public Property ParentProject() As ProjectInfo

        ''' <summary>
        ''' 工艺站信息已被修改
        ''' </summary>
        ''' <returns></returns>
        Public Property InfoChanged() As Boolean

        ''' <summary>
        ''' 工艺站类型已被修改
        ''' </summary>
        ''' <returns></returns>
        Public Property TypeChange() As Boolean

        ''' <summary>
        ''' 工艺站预览图已被修改
        ''' </summary>
        ''' <returns></returns>
        Public Property PreviewImageChanged() As Boolean
    End Class
End Namespace