feat: RTC5 AnalogOut 전압 readback - device 계층 + ViewModel + XAML 표시
ed36f8d에서 분석 문서만 들어가, 실제 구현 소스를 함께 커밋. - ScannerObj.GetAnalogOut(abstract) + RTC5/RTC6(n_get_value, signal=portNo+32)/Simul(0) + Scanner 파사드(-1) - UCScannerLaserControlViewModel: AnalogOut1/2Voltage + ReadbackAnalogOut(raw/4095*10 V), Laser On 직접 분기 WriteDA 직후 호출 - UCScannerLaserControl.xaml: Control Setting에 DA1/DA2 Voltage [V] 표시 - 작업일지 13:55 기록 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
ed36f8deaa
commit
166d1bd2f0
@ -207,6 +207,14 @@ namespace AuroraLaserScanner
|
||||
_scannerObj.WriteDA(portNo, value, type);
|
||||
}
|
||||
|
||||
public int GetAnalogOut(uint portNo)
|
||||
{
|
||||
if (!IsActivated) {
|
||||
return -1;
|
||||
}
|
||||
return _scannerObj.GetAnalogOut(portNo);
|
||||
}
|
||||
|
||||
public void SetEndList()
|
||||
{
|
||||
if (!IsActivated) {
|
||||
|
||||
@ -277,6 +277,12 @@ namespace AuroraLaserScanner
|
||||
public abstract void EnableLaser();
|
||||
// Write DA
|
||||
public abstract void WriteDA(uint portNo, float value/*0~100%*/, eFunctionType type = eFunctionType.COMMAND);
|
||||
/// <summary>
|
||||
/// RTC 보드가 출력 중인 AnalogOut DAC 값을 되읽는다.
|
||||
/// portNo: 1 = AnalogOut1(DA1), 2 = AnalogOut2(DA2)
|
||||
/// 반환: 0 ~ 4095 (12bit DAC). 전압 = 반환값 / 4095.0 * 10.0 [V]
|
||||
/// </summary>
|
||||
public abstract int GetAnalogOut(uint portNo);
|
||||
//Ramping 관련 기능 추가
|
||||
public abstract void SetVectorControl(uint portNo, uint value);
|
||||
public abstract void ParaMarkAbs(double x, double y, float powerValue/*0~100%*/ );
|
||||
|
||||
@ -350,6 +350,13 @@ namespace AuroraLaserScanner
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetAnalogOut(uint portNo)
|
||||
{
|
||||
// eRecordSignal.AnalogOut1 = 33, AnalogOut2 = 34 → signal = portNo + 32
|
||||
uint signal = portNo + 32;
|
||||
return RTC5Wrap.n_get_value(m_deviceNo, signal);
|
||||
}
|
||||
|
||||
|
||||
public override void GetEncoder(out double encoderX, out double encoderY, bool rotateMode = false)
|
||||
{
|
||||
|
||||
@ -350,6 +350,13 @@ namespace AuroraLaserScanner
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetAnalogOut(uint portNo)
|
||||
{
|
||||
// eRecordSignal.AnalogOut1 = 33, AnalogOut2 = 34 → signal = portNo + 32
|
||||
uint signal = portNo + 32;
|
||||
return RTC6Wrap.n_get_value(m_deviceNo, signal);
|
||||
}
|
||||
|
||||
|
||||
public override void GetEncoder(out double encoderX, out double encoderY, bool rotateMode = false)
|
||||
{
|
||||
|
||||
@ -102,6 +102,11 @@ namespace AuroraLaserScanner
|
||||
|
||||
}
|
||||
|
||||
public override int GetAnalogOut(uint portNo)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public override void GetEncoder(out double encoderX, out double encoderY, bool rotateMode = false)
|
||||
{
|
||||
|
||||
@ -52,6 +52,10 @@
|
||||
<usercontrols:UCKeyValue KeyText="Frequency" Value="{Binding LaserPeriod}" DecimalPlaces="0" Unit="kHz" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" />
|
||||
<usercontrols:UCKeyValue KeyText="Pulse Width" Value="{Binding LaserPulseWidth}" DecimalPlaces="0" Unit="us" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" />
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Row="1" Rows="2" VerticalAlignment="Top" Margin="0 5 0 0">
|
||||
<usercontrols:UCKeyValue KeyText="DA1 Voltage" Value="{Binding AnalogOut1Voltage}" DecimalPlaces="3" Unit="V" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" IsReadOnly="True" />
|
||||
<usercontrols:UCKeyValue KeyText="DA2 Voltage" Value="{Binding AnalogOut2Voltage}" DecimalPlaces="3" Unit="V" KeyHorizontalAlignment="Right" KeyTextWidth="0.5*" IsReadOnly="True" />
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
||||
@ -55,6 +55,12 @@ namespace WeldingCommon.Views
|
||||
private double _LaserPower2Watt;
|
||||
public double LaserPower2Watt { get => _LaserPower2Watt; set => SetProperty(ref _LaserPower2Watt, value); }
|
||||
|
||||
// RTC5 AnalogOut(파워 지령 전압) readback 표시값 [V]
|
||||
private double _AnalogOut1Voltage;
|
||||
public double AnalogOut1Voltage { get => _AnalogOut1Voltage; set => SetProperty(ref _AnalogOut1Voltage, value); }
|
||||
private double _AnalogOut2Voltage;
|
||||
public double AnalogOut2Voltage { get => _AnalogOut2Voltage; set => SetProperty(ref _AnalogOut2Voltage, value); }
|
||||
|
||||
|
||||
private uint _LaserPeriod;
|
||||
public uint LaserPeriod { get => _LaserPeriod; set => SetProperty(ref _LaserPeriod, value); }
|
||||
@ -239,6 +245,16 @@ namespace WeldingCommon.Views
|
||||
ListInterationCount = _ListIterationCount;
|
||||
}
|
||||
|
||||
private void ReadbackAnalogOut()
|
||||
{
|
||||
int raw1 = _Scanner.GetAnalogOut((uint)eAnalogPortOut.DA1);
|
||||
int raw2 = _Scanner.GetAnalogOut((uint)eAnalogPortOut.DA2);
|
||||
|
||||
// -1 은 Scanner 미활성(IsActivated == false) sentinel
|
||||
AnalogOut1Voltage = raw1 < 0 ? 0 : raw1 / 4095.0 * 10.0;
|
||||
AnalogOut2Voltage = raw2 < 0 ? 0 : raw2 / 4095.0 * 10.0;
|
||||
}
|
||||
|
||||
private void PerformCmdLaserShotOnPercent(object obj)
|
||||
{
|
||||
if (IsUseLaserAutoOffChecked) {
|
||||
@ -306,6 +322,9 @@ namespace WeldingCommon.Views
|
||||
Thread.Sleep(50);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, powerVolt1, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, powerVolt2, eFunctionType.COMMAND);
|
||||
|
||||
ReadbackAnalogOut(); // DAC에 실린 AnalogOut 전압을 읽어 UI에 표시 (출사 전)
|
||||
|
||||
_Scanner.SetLaserPulseCtrl(LaserPeriod * 1000, LaserPulseWidth);
|
||||
//_Scanner.SetLaserTiming(LaserPeriod * 1000, LaserPulseWidth, LaserPulseWidth);
|
||||
//_Scanner.SetStandby(LaserPeriod * 1000, LaserPulseWidth);
|
||||
@ -382,6 +401,9 @@ namespace WeldingCommon.Views
|
||||
Thread.Sleep(50);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA1, powerVolt1, eFunctionType.COMMAND);
|
||||
_Scanner.WriteDA((uint)eAnalogPortOut.DA2, powerVolt2, eFunctionType.COMMAND);
|
||||
|
||||
ReadbackAnalogOut(); // DAC에 실린 AnalogOut 전압을 읽어 UI에 표시 (출사 전)
|
||||
|
||||
_Scanner.SetLaserPulseCtrl(LaserPeriod * 1000, LaserPulseWidth);
|
||||
//_Scanner.SetLaserTiming(LaserPeriod * 1000, LaserPulseWidth, LaserPulseWidth);
|
||||
//_Scanner.SetStandby(LaserPeriod * 1000, LaserPulseWidth);
|
||||
|
||||
@ -101,3 +101,15 @@
|
||||
- IO 결선을 바꿔서, 레시피의 Laser Ready 판정 입력을 `ReadDI(12) && ReadDI(24)` → **`ReadDI(11) && ReadDI(15)`** 로 수정.
|
||||
- 위치: `UCScannerObjectTeachingControlBoxViewModel`의 `OnMonitoring` Laser Ready 판정부.
|
||||
- 변경된 결선에 맞춘 단순 입력 번호 교체(로직 동일).
|
||||
|
||||
## 13:55
|
||||
|
||||
### RTC5 AnalogOut 전압 Readback 표시 (Laser Shot Control)
|
||||
|
||||
- `docs/RTC5_AnalogOut_Readback_수정가이드.md`(외부 작성 구현 명세)에 맞춰 RTC5 보드의 AnalogOut(파워 지령 전압) readback 기능 구현. 가이드 파일은 적용 후 삭제.
|
||||
- **Device 계층**: `ScannerObj`에 `abstract int GetAnalogOut(uint portNo)` 추가 → `ScannerRTC5`/`ScannerRTC6`(`n_get_value(signal=portNo+32)`, AnalogOut1=33/AnalogOut2=34)/`ScannerSimul`(더미 0) override + `Scanner` 파사드(미활성 시 -1).
|
||||
- **ViewModel**(`UCScannerLaserControlViewModel`): `AnalogOut1Voltage`/`AnalogOut2Voltage` 속성 + `ReadbackAnalogOut()`(raw/4095×10 [V]) 추가, Laser On 직접 분기(No Use Spot Time)의 WriteDA 직후·출사 전 호출.
|
||||
- **XAML**(`UCScannerLaserControl.xaml`): Control Setting(Percent 영역)에 `DA1 Voltage`/`DA2 Voltage` [V] 읽기전용 표시 추가.
|
||||
- 표시 대상은 Power Calibration(dbVoltage)이 아니라 **ScannerLaserControl 화면**으로 확정(요청). LaserSignalOn 발사 동작은 변경 없음(readback만 추가).
|
||||
- AuroraDevices 변경이라 VS Rebuild로 빌드 확인 예정(abstract 추가 → override 3개 모두 구현).
|
||||
- 관련 분석: `docs/분석/2026/06/18/122432_laser_on_no_emission_analysis.md`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user