리크 테스트 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.

160 lines
5.2 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>
/// 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; }
}
/// <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 Mode { get; set; } // 예: 개발/양산
public string LineNo { get; set; }
public string ProductType { 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; }
}
public class ParsedData
{
public string RawData { get; set; }
public double MeasuredValue { get; set; }
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; }
public string LowID { get; set; }
/// <summary>센서 자체 판정 결과 (A=Accept, R=Reject). SPEC 교차 검증에 사용.</summary>
public string SensorJudgment { get; set; }
public ParsedData()
{
Timestamp = DateTime.Now;
}
}
/// <summary>
/// ZMDI 센서에서 읽은 제품 ID 정보.
/// 레거시 ClsSensorReader의 필드를 기반으로 구성.
/// </summary>
public class SensorIdData
{
/// <summary>센서 메모리에서 읽은 원본 Low ID 문자열</summary>
public string LowID { get; set; } = "";
/// <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; } = "";
/// <summary>이전 검사 결과. F=미시험/불합격, P=합격. 불량 제품 필터링에 사용.</summary>
public string PrevResult { get; set; } = "";
}
}