리크 테스트 gui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

171 lines
5.9 KiB

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;
/// <summary>
/// MSSQL 데이터베이스 연결 문자열 (더 이상 사용되지 않음. 대신 Database.ini의 설정을 읽어 접속합니다.)
/// </summary>
[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;";
}
/// <summary>
/// DIO 보드의 개별 포인트(입력 또는 출력)를 나타내는 모델.
/// </summary>
public class DioPoint
{
/// <summary>포인트 이름 (예: LEFT_START, LEFT_OK, RIGHT_NG)</summary>
public string Name { get; set; }
/// <summary>설명 (예: 좌측 시작 신호)</summary>
public string Description { get; set; }
/// <summary>true: 입력, false: 출력</summary>
public bool IsInput { get; set; }
/// <summary>현재 값 (ON=true, OFF=false)</summary>
public bool Value { get; set; }
/// <summary>하드웨어 IO 포트의 실제 비트 인덱스 (0~31)</summary>
public int BitIndex { get; set; } = -1;
}
/// <summary>
/// DIO 입력 변경 시 사용되는 이벤트 인자.
/// </summary>
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;
/// <summary>현재 값 (ON=true, OFF=false). DIO 실시간 상태 표시용.</summary>
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; }
/// <summary>센서 자체 판정 결과 (A=Accept, R=Reject). SPEC 교차 검증에 사용.</summary>
public string SensorJudgment { get; set; }
public ParsedData()
{
Timestamp = DateTime.Now;
}
}
/// <summary>
/// 제품 ID 센서에서 읽은 제품 ID 정보.
/// 레거시 ClsSensorReader의 필드를 기반으로 구성.
/// </summary>
public class SensorIdData
{
/// <summary>제조 년도</summary>
public int Year { get; set; }
/// <summary>제조 월</summary>
public int Month { get; set; }
/// <summary>제조 일</summary>
public int Day { get; set; }
/// <summary>시리얼 번호 (5자리 패딩)</summary>
public string Serial { get; set; } = "";
/// <summary>MC Line (개발/양산 구분)</summary>
public string McLine { get; set; } = "";
/// <summary>라인 번호</summary>
public string LineNo { get; set; } = "";
/// <summary>제품 구분 (Item)</summary>
public string Item { get; set; } = "";
/// <summary>최종 조합 ID (년+월+일+시리얼+라인+항목)</summary>
public string ID { get; set; } = "";
}
}