using System; namespace leak_test_project.Models { public class AppConfig { public string SensorPort { get; set; } = "COM1"; public int SensorBaudRate { get; set; } = 9600; public string Board4251Port { get; set; } = "COM3"; public int Board4251BaudRate { get; set; } = 115200; public int Board4251Timeout { get; set; } = 5000; // 보드가 응답을 주는데 2초 이상 걸리므로 무조건 길게 대기 public double SpecUL { get; set; } = 1.00; public double SpecLL { get; set; } = -1.00; /// /// MSSQL 데이터베이스 연결 문자열 (더 이상 사용되지 않음. 대신 Database.ini의 설정을 읽어 접속합니다.) /// [Obsolete("Use Database.ini ConnectionString instead.")] public string DbConnectionString { get; set; } = "Server=192.168.0.20;Database=NE1aW_PT_SENSOR;User Id=sa;Password=sa1234;"; } /// /// DIO 보드의 개별 포인트(입력 또는 출력)를 나타내는 모델. /// public class DioPoint { /// 포인트 이름 (예: LEFT_START, LEFT_OK, RIGHT_NG) public string Name { get; set; } /// 설명 (예: 좌측 시작 신호) public string Description { get; set; } /// true: 입력, false: 출력 public bool IsInput { get; set; } /// 현재 값 (ON=true, OFF=false) public bool Value { get; set; } /// 하드웨어 IO 포트의 실제 비트 인덱스 (0~31) public int BitIndex { get; set; } = -1; } /// /// DIO 입력 변경 시 사용되는 이벤트 인자. /// public class DioEventArgs : System.EventArgs { public string PointName { get; set; } public bool NewValue { get; set; } public DioEventArgs(string pointName, bool newValue) { PointName = pointName; NewValue = newValue; } } public class InOutItem : System.ComponentModel.INotifyPropertyChanged { public string Address { get; set; } public string Name { get; set; } public string Description { get; set; } private bool _value; /// 현재 값 (ON=true, OFF=false). DIO 실시간 상태 표시용. public bool Value { get => _value; set { if (_value != value) { _value = value; PropertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(nameof(Value))); } } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; } public class InspectData { public string InspectDate { get; set; } public string InspectTime { get; set; } public string Retest { get; set; } public string ProductId { get; set; } public string Channel { get; set; } // 좌/우 public string SpecUL { get; set; } public string SpecLL { get; set; } public string MeasuredValue { get; set; } public string Judgment { get; set; } // 신규 DB 테이블 EOL 컬럼 매핑 및 정합성 보장을 위한 추가 프로퍼티 public string IcSn { get; set; } = string.Empty; public string PcbBarcode { get; set; } = string.Empty; public string Maker { get; set; } = string.Empty; public string Model { get; set; } = string.Empty; public string Variant1 { get; set; } = string.Empty; public string Variant2 { get; set; } = string.Empty; public string Operator { get; set; } = string.Empty; public DateTime? ProductionDate { get; set; } public string Line { get; set; } = string.Empty; public string LotNo { get; set; } = string.Empty; public string JigNo { get; set; } = string.Empty; } public class ParsedData { public string RawData { get; set; } public double MeasuredValue { get; set; } public string MeasuredValueString { get; set; } = "0.0000"; public string Unit { get; set; } public string TestType { get; set; } public string Judgment { get; set; } public DateTime Timestamp { get; set; } // 스크린샷 추가 요구사항 필드 public string ChannelNo { get; set; } public string ProgramNo { get; set; } public string UniqueId { get; set; } public string TestDate { get; set; } public string TestTime { get; set; } public string SerialNo { get; set; } /// 센서 자체 판정 결과 (A=Accept, R=Reject). SPEC 교차 검증에 사용. public string SensorJudgment { get; set; } public ParsedData() { Timestamp = DateTime.Now; } } /// /// 제품 ID 센서에서 읽은 제품 ID 정보. /// 레거시 ClsSensorReader의 필드를 기반으로 구성. /// public class SensorIdData { /// 제조 년도 public int Year { get; set; } /// 제조 월 public int Month { get; set; } /// 제조 일 public int Day { get; set; } /// 시리얼 번호 (5자리 패딩) public string Serial { get; set; } = ""; /// MC Line (개발/양산 구분) public string McLine { get; set; } = ""; /// 라인 번호 public string LineNo { get; set; } = ""; /// 제품 구분 (Item) public string Item { get; set; } = ""; /// 최종 조합 ID (년+월+일+시리얼+라인+항목) public string ID { get; set; } = ""; } }