- 오토런 시작 시 RCC 패턴 폴더 변경 감지 → B2506 ON, PLC ACK(B2409) 수신 시 OFF - 서브 패턴 1~10, 패턴 목록에 서브 썸네일 표시(행 내 좌우 스크롤) - 서브 패턴 등록 직후 활성화 OFF - 패턴 파일이 다른 프로그램에서 열려 있으면 삭제하지 않고 안내 - 현장 소스 반영: Train ROI 슬라이더, KS 조명 밝기 저장/적용, 조명 ID 분리, 스캔 후 카메라 라이브 재시작, 레시피 21 RCC NG 우회, 오토런 상태 판단
67 lines
1.9 KiB
C#
67 lines
1.9 KiB
C#
/*
|
|
* Copyright (c) 2025 LG Electronics Inc.
|
|
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
|
|
*/
|
|
using VisionCommon;
|
|
using Hermes;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace MilPattern {
|
|
public class PmParamExt : ICloneable {
|
|
private const string FILE_NAME = "PmParamExt.json";
|
|
public ROI FindROI { get; set; } = new ROI();
|
|
public double TrainRoiSize { get; set; } = 25.0;
|
|
|
|
public PmParamExt() {
|
|
}
|
|
|
|
public PmParamExt(ROI findRoi) {
|
|
FindROI = findRoi.Clone() as ROI;
|
|
}
|
|
|
|
public object Clone() {
|
|
return new PmParamExt() {
|
|
FindROI = FindROI.Clone() as ROI,
|
|
TrainRoiSize = TrainRoiSize
|
|
};
|
|
}
|
|
|
|
internal static bool Exists(string dirPath) {
|
|
string filePath = Path.Combine(dirPath, FILE_NAME);
|
|
return File.Exists(filePath);
|
|
}
|
|
|
|
internal static PmParamExt Load(string dirPath) {
|
|
string filePath = Path.Combine(dirPath, FILE_NAME);
|
|
|
|
if (File.Exists(filePath)) {
|
|
return JsonConvert.DeserializeObject(
|
|
File.ReadAllText(filePath), typeof(PmParamExt)) as PmParamExt;
|
|
}
|
|
|
|
return new PmParamExt();
|
|
}
|
|
|
|
internal static int Save(string dirPath, PmParamExt pmParamExt) {
|
|
string filePath = Path.Combine(dirPath, FILE_NAME);
|
|
|
|
if (!Directory.Exists(dirPath)) {
|
|
Directory.CreateDirectory(dirPath);
|
|
}
|
|
|
|
using (var fs = File.Create(filePath))
|
|
using (var sw = new StreamWriter(fs))
|
|
using (var jtw = new JsonTextWriter(sw) {
|
|
Formatting = Formatting.Indented,
|
|
Indentation = 2,
|
|
}) {
|
|
(new JsonSerializer()).Serialize(jtw, pmParamExt);
|
|
}
|
|
|
|
return E1.OK;
|
|
}
|
|
}
|
|
}
|