FileInfomation.cs 3.0 KB
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text; 

namespace OnlineStore.DeviceLibrary.doubleStore
{
    public class FileInfomation
    {
        public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        public FileInfomation()
        { 
        } 
        /**
         * 构造函数,除了AUTORUN和TROUBLE_STOP,其他都是固定值
         */
        public FileInfomation(int AUTORUN, int TROUBLE_STOP)
        {
            this.AUTORUN = AUTORUN;
            this.TROUBLE_STOP = TROUBLE_STOP;
        }
        
        /**
         * 转换为文件内容
         */
        public string[] ToFileString()
        {
            //String nextLine = "\r\n";
            string[] data = new string[] {
            "[STATUS]",
            "ONLINE=" + ONLINE ,
                    "AUTORUN=" + AUTORUN ,
                    "PROCESS_WAITE=" + PROCESS_WAITE ,
                    "OTHER_LANE_WAIT=" + OTHER_LANE_WAIT ,
                    "TROUBLE_STOP=" + TROUBLE_STOP,
                    "PWAIT=" + PWAIT ,
                    "PCB_CHECK=" + PCB_CHECK ,
                    "CHANGE_OVER=" + CHANGE_OVER ,
            };
            return data;
        }

        public string[] WarnMsgToFileString(string Msg)
        {
            string jpnMsg = "テスト テスト テスト テスト テスト";
            string engMsg = "test test test test test ";
            string[] data = new string[]
            {
                "[Text_JPN]",
                "MESSAGE=\""+jpnMsg+"\"",
                "[Text_ENG]",
                "MESSAGE=\""+engMsg+"\"",
                "[Text_CHN]",
                "MESSAGE=\""+Msg+"\"",
            };
            return data;
        }

        /**
         * Online mode state     1:固定     fixed to 1
         */
        public int ONLINE = 1; 
        /**
         * 自動運転状態     * Auto operation state
         * 0:停止中/1:自動運転中     * 0: Stopped/1: In auto operation
         */
        public int AUTORUN = 1;

        /**
         * 工程待ち状態     * Process wait state     * 0:固定     * fixed to 0
         */
        public int PROCESS_WAITE = 0;

        /**
         * Other lane waiting     * 0:固定     * fixed to 0
         */
        public int OTHER_LANE_WAIT = 0;

        /**
         * In trouble stop     * 0:トラブル停止中でない/1:トラブル停止中
         * 0: Not in trouble stop/1: In trouble stop
         */
        public int TROUBLE_STOP = 0;

        /**
         * 材料供給待ち停止中     * In material supply stop     * 0:固定     * fixed to 0
         */
        public int PWAIT = 0;

        /**
         * 基板確認中     * In board checking     * 0:固定     * fixed to 0
         */
        public int PCB_CHECK = 0;

        /**
         * 段取り替え中     * In changeover     * 0:固定     * fixed to 0
         */
        public int CHANGE_OVER = 0;
    }
}