using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using AR;
using COMM;

namespace vmsnet
{
    public partial class FMain
    {
        public void _STEP_INIT_START(ESMStep step)
        {
            //result message
            int progress = 0;
            var ProgressMax = 13;
            Color fColor = Color.DarkViolet;

            //기본폴더를 생성합니다
            string[] basedir = new string[] {  "Temp", "Log" };
            foreach (var dirname in basedir)
            {
                try
                {
                    var di = System.IO.Path.Combine(UTIL.CurrentPath, dirname);
                    if (System.IO.Directory.Exists(di) == false)
                        System.IO.Directory.CreateDirectory(di);
                }
                catch (Exception ex)
                {
                    PUB.log.Add(ex.Message);
                }
            }


            PUB.sm.RaiseStateProgress(++progress, "System Initialize", ProgressMax, fColor); System.Threading.Thread.Sleep(5);
            _SM_RUN_INIT_EVENTS();

            //남은 공간
            PUB.sm.RaiseStateProgress(++progress, "Check Storage Space", ProgressMax, fColor); System.Threading.Thread.Sleep(5);
            PUB.CheckFreeSpace(); //181225

            PUB.sm.RaiseStateProgress(++progress, "User Device Initialize", ProgressMax, fColor); System.Threading.Thread.Sleep(5);

            /* Device 초기화 */    //--> _00_System_Initialize.cs
            _USER_INIT_DEVICE();

        
            PUB.sm.RaiseStateProgress(ProgressMax, "Init Complete", ProgressMax, Color.Gold); System.Threading.Thread.Sleep(5);

            VAR.BOOL.Set(EVarBool.INIT_SYSTEM, true, "INIT");
            PUB.log.Add("init finish");
        }

        public StepResult _STEP_INIT(ESMStep step, TimeSpan stepTime, TimeSpan seqTime)
        {
            PUB.sm.SetNewStep(ESMStep.IDLE);
            return StepResult.Complete;
        }

        /// <summary>
        /// 기본이벤트를 정의 합니다.
        /// </summary>
        public void _SM_RUN_INIT_EVENTS()
        {
      
        }


    }
}
