initial commit
This commit is contained in:
63
Cs_HMI/Project/StateMachine/Step/_STEP_CLOSE.cs
Normal file
63
Cs_HMI/Project/StateMachine/Step/_STEP_CLOSE.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user