64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using static Project.StateMachine;
|
|
|
|
namespace Project
|
|
{
|
|
public partial class fMain
|
|
{
|
|
/// <summary>
|
|
/// 프로그램을 닫을때 1회 실행되는 함수
|
|
/// </summary>
|
|
private void _STEP_CLOSING_START(eSMStep step)
|
|
{
|
|
PUB.bShutdown = true;
|
|
if (PUB.PLC != null) PUB.PLC.Dispose();
|
|
|
|
PUB.AddEEDB("프로그램 종료");
|
|
PUB.log.Add("Program Close");
|
|
PUB.log.Flush();
|
|
PUB.logagv.Flush();
|
|
PUB.logplc.Flush();
|
|
PUB.logbms.Flush();
|
|
PUB.logcal.Flush();
|
|
// PUB.sm.Stop();
|
|
|
|
}
|
|
public StepResult _STEP_CLOSING(eSMStep step, TimeSpan stepTime, TimeSpan seqTime)
|
|
{
|
|
|
|
//############################
|
|
//#### 사용자 전용 코드
|
|
//############################
|
|
|
|
|
|
//############################
|
|
//#### 개발자 권장코드
|
|
//############################
|
|
PUB.sm.SetNewStep(eSMStep.CLOSED);
|
|
return StepResult.Complete;
|
|
}
|
|
|
|
public void _STEP_CLOSED_START(eSMStep step)
|
|
{
|
|
try
|
|
{
|
|
this.BeginInvoke(new Action(() =>
|
|
{
|
|
//화면을 닫는다
|
|
PUB.sm.Stop();
|
|
this.Close();
|
|
}));
|
|
}
|
|
catch { }
|
|
}
|
|
public StepResult _STEP_CLOSED(eSMStep step, TimeSpan stepTime, TimeSpan seqTime)
|
|
{
|
|
return StepResult.Wait;
|
|
}
|
|
}
|
|
}
|