본 문서는
1. 문제 설명
1-1. [CASE-1] 기존 방식으로 프로그램 로딩
2. 기존 방식(화면 로딩 중인지 식별 불가)
3. 개선 방식(화면 로딩 중인지 빠르게 식별 가능)
4. 기존 방식과 개선 방식의 동영상 비교 자료
순서로 진행합니다.
IEC-Series를 RunTime 모드(부팅 후 응용 프로그램 실행 모드)로 부팅하는 경우 프로그램을 실행하고 나서 메인 화면 출력(=프로그램 로딩 완료)까지 일정 시간이 걸리며 이 동안 화면은 검정 화면(Black Screen)으로 표시되어
사용자는 프로그램이 로딩 중인지 알기 어렵습니다.
이 문제를 해결하기 위해 SmartSplash 기능 또는 SmartForm.NoneBlockingDialog 기능을 사용하면 됩니다.
- SmartSplash 기능 사용 : 검정 화면(Black Screen)에서 로딩화면 출력이 빠름
- SmartForm.NoneBlockingDialog 기능 사용 : 검정 화면(Black Screen)에서 메인 화면 출력(= 프로그램 로딩 완료)가 빠름
1. 기존 방식(화면 로딩 중인지 식별 불가) 1-1. [CASE-1] 기존 방식으로 프로그램 로딩 설명
Form_Load() 이벤트 내에서 자식 폼 생성
실행 순서 및 측정 시간
private void Form1_Load(object sender, EventArgs e)
{
frm2 = new Form2();
// ~… 중략…
frm10 = new Form10();
smartForm1.MainForm = this;
smartForm1.Show(0);
// 다른 폼을 자식 폼으로 설정
smartForm1.AddChildForm(frm2);
// ~… 중략…
smartForm1.AddChildForm(frm10);
}
2. 개선 방식(화면 로딩 중인지 빠르게 식별 가능) 2-1. 프로그램 로딩 시 SmartSplash 사용 Vs NoneBlockingDialog(안내창) 사용 비교
- [CASE-2] SmartSplash 사용
설명
Form 생성자에서 SmartSplash를 로딩하고 Form_Load() 이벤트 내에서 메인 화면 출력(= 프로그램 로딩 완료) 시점에서 SmartSplash 종료
특징[CASE-1]보다 검정 화면(Black Screen) 표시 시간이 짧습니다.
검정 화면(Black Screen)에서 Loading 화면 출력이 가장 빠릅니다.실행 순서 및 측정 시간핵심 소스 코드
// SmartSplash 선언
private SmartX.SmartSplash smartSplash1;
public Form1()
{
smartSplash1 = new SmartX.SmartSplash();
smartSplash1.AnimationInterval = 100;
smartSplash1.CenterPosition = true;
smartSplash1.LoadingImagePathname = "SmartLoading2";
// SmartSplash 시작
smartSplash1.Start();
InitializeComponent();
}
private void Form1_Load()
{
frm2 = new Form2();
// ~… 중략…
frm10 = new Form10();
smartForm1.MainForm = this;
smartForm1.Show(0);
// 다른 폼을 자식 폼으로 설정
smartForm1.AddChildForm(frm2);
// ~… 중략…
smartForm1.AddChildForm(frm10);
// SmartSplash 종료
smartSplash1.Finish();
} - [CASE-3] NoneBlockingDialog 사용(검정 화면이 빨리 사라지는 방식)
설명
※ NoneBlockingDialog로 Loading 상태를 표시하기 위한 처리
STEP-1. MainForm 출력
STEP-2. NoneBlockingDialog로 Loading 창 출력
STEP-3. 나머지 Child(Sub) Form Loading 처리
STEP-4. Child(Sub) Form Load 완료에 따른 NoneBlocking Dialog Loading 창 Close 처리특징[CASE-1]보다 검정 화면(Black Screen) 표시 시간이 짧습니다.
검정 화면(Black Screen)에서 MainForm 화면 출력이 가장 빠릅니다.실행 순서 및 측정 시간핵심 소스 코드
private void Form1_Load()
{
smartForm1.MainForm = this;
smartForm1.Show(0);
// 로딩 중… 다이얼로그 창 표시
alrt = new Alert();
SmartX.SmartForm.NoneBlockingDialog frmNoneBlocking =
new SmartX.SmartForm.NoneBlockingDialog(alrt);
alrt.Location = new Point(100, 150);
frmNoneBlocking.ShowDialogNoneBlock(this);
Application.DoEvents();
frm2 = new Form2();
// ~… 중략…
frm10 = new Form10();
// 다른 폼을 자식 폼으로 설정
smartForm1.AddChildForm(frm2);
// ~… 중략…
smartForm1.AddChildForm(frm10);
// 로딩 중… 안내창 닫기
alrt.Close();
}
3. 기존 방식과 개선 방식의 동영상 비교 자료