096111e983
.claude/ 제외(.gitignore 추가). 기존 초기커밋(5a96a69) 위에 신규·수정·이동분 커밋.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.Windows;
|
|
using ErvDashboard.Model;
|
|
using ErvProtocol;
|
|
|
|
namespace ErvDashboard
|
|
{
|
|
// 풍량 VSP 팝업 (환기1~4 / 바이패스 / 공청1~4 SA·EA 편집)
|
|
// - 편집 필드는 로컬 작업본(_work). STATUS(1초)가 덮어쓰지 않아 편집이 유지됨.
|
|
// - 읽어오기 : ERV 통신값(_state) → 작업본 / 프리셋 : 사양 기본값 → 작업본 / VSP 적용 : 작업본 → ERV
|
|
public partial class VspWindow : Window
|
|
{
|
|
readonly MainWindow _owner;
|
|
readonly DashboardState _state;
|
|
readonly ObservableCollection<VspRow> _work = new();
|
|
|
|
public VspWindow(MainWindow owner, DashboardState state)
|
|
{
|
|
InitializeComponent();
|
|
_owner = owner; _state = state;
|
|
|
|
for (int i = 0; i < VspInfo.Count; i++)
|
|
_work.Add(new VspRow(VspInfo.Labels[i], VspInfo.Group[i], VspInfo.Index[i]));
|
|
VspList.ItemsSource = _work;
|
|
|
|
ReadFromErv(); // 열 때 ERV 현재값으로 시작
|
|
}
|
|
|
|
// ERV 통신값(_state, STATUS 갱신) → 작업본
|
|
void ReadFromErv()
|
|
{
|
|
for (int i = 0; i < _work.Count && i < _state.Vsp.Count; i++)
|
|
{ _work[i].Sa = _state.Vsp[i].Sa; _work[i].Ea = _state.Vsp[i].Ea; }
|
|
}
|
|
|
|
void Read_Click(object sender, RoutedEventArgs e) => ReadFromErv();
|
|
|
|
// 사양서 기본 VSP → 작업본 (전송은 'VSP 적용')
|
|
void PresetDefault_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
var d = DashboardState.DefVsp;
|
|
for (int i = 0; i < _work.Count && i < d.Length; i++)
|
|
{ _work[i].Sa = d[i].Sa; _work[i].Ea = d[i].Ea; }
|
|
}
|
|
|
|
// 작업본 → _state → ERV 전송
|
|
void Apply_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
for (int i = 0; i < _work.Count && i < _state.Vsp.Count; i++)
|
|
{ _state.Vsp[i].Sa = _work[i].Sa; _state.Vsp[i].Ea = _work[i].Ea; }
|
|
_owner.ApplyVsp();
|
|
}
|
|
|
|
void Close_Click(object sender, RoutedEventArgs e) => Close();
|
|
}
|
|
}
|