Ejemplo n.º 1
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (m_kindKey != EMKind.STEEL)
            {
                CNotice.printTraceID("YATT6");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');

                    if (arrayString.Length != 2)
                    {
                        CNotice.noticeWarningID("TIAP5");
                        return(false);
                    }

                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        m_kindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // CParts
                    case "MovingParts":
                        MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                        break;

                    // CSteel
                    case "Material":
                        Material = arrayString[1];
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                CNotice.printTrace(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (m_kindKey != EMKind.COIL)
            {
                CNotice.printTraceID("YATT7");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');


                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        m_kindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // CParts
                    case "MovingParts":
                        MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                        break;

                    // CCoil
                    case "Material":
                        Material = arrayString[1];
                        break;

                    case "CurrentDirection":
                        CurrentDirection = (EMCurrentDirection)Enum.Parse(typeof(EMCurrentDirection), arrayString[1]);
                        break;

                    case "Turns":
                        Turns = Convert.ToInt16(arrayString[1]);
                        break;

                    case "Resistance":
                        Resistance = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Layers":
                        Layers = Convert.ToInt16(arrayString[1]);
                        break;

                    case "TurnsOfOneLayer":
                        TurnsOfOneLayer = Convert.ToInt16(arrayString[1]);
                        break;

                    case "CoilWireGrade":
                        CoilWireGrade = (EMCoilWireGrade)Enum.Parse(typeof(EMCoilWireGrade), arrayString[1]);
                        break;

                    case "InnerDiameter":
                        InnerDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "OuterDiameter":
                        OuterDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Height":
                        Height = Convert.ToDouble(arrayString[1]);
                        break;

                    case "CopperDiameter":
                        CopperDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "WireDiameter":
                        WireDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Temperature":
                        Temperature = Convert.ToDouble(arrayString[1]);
                        break;

                    case "HorizontalCoefficient":
                        HorizontalCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    case "VerticalCoefficient":
                        VerticalCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    case "ResistanceCoefficient":
                        ResistanceCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                CNotice.printTrace(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (KindKey != EMKind.MAGNET)
            {
                CNotice.printLogID("YATT5");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');

                    if (arrayString.Length != 2)
                    {
                        CNotice.noticeWarningID("TIAP4");
                        return(false);
                    }

                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        KindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // CParts
                    case "MovingParts":
                        MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                        break;

                    // CMagnet
                    case "Material":

                        m_strMaterialName = arrayString[1];

                        // FEMM (21Apr2019)에서 NdFeB 40 MGOe 빠져 있어서 호환이 되지 않아 강제로 N40 으로 변경한다.
                        // 추후에 FEMM 에 NdFeB 40 MGOe 가 Legacy 로 추가되면 아래의 코드를 삭제하라.
                        if (CProgramFEMM.getYearFEMM() >= 2019)
                        {
                            if (m_strMaterialName == "NdFeB 40 MGOe")
                            {
                                m_strMaterialName = "N40";
                            }
                        }

                        if (CMaterialListInFEMM.isMagnetlInList(m_strMaterialName) == false)
                        {
                            // 현재의 버전에서 사용할 수 없는 재질이 존재한다면 공백으로 처리하고
                            // 동작 중에 공백을 사용해서 재질이 초기화 되지 않음을 확인한다.
                            m_strMaterialName = "";
                        }

                        break;

                    case "MagnetDirection":
                        emMagnetDirection = (EMMagnetDirection)Enum.Parse(typeof(EMMagnetDirection), arrayString[1]);
                        break;

                    default:
                        break;
                    }
                }

                // Shape 정보가 있는 경우만 m_face 를 생성하고 읽기 작업을 진행한다.
                if (listShapeLines.Count > 0)
                {
                    m_face = new CFace();
                    m_face.readObject(listShapeLines);
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 4
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (KindKey != EMKind.COIL)
            {
                CNotice.printLogID("YATT7");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');


                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        KindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // CParts
                    case "MovingParts":
                        MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                        break;

                    // CCoil
                    case "Material":
                        if (CMaterialListInFEMM.isCoilWIreInList(arrayString[1]) == true)
                        {
                            m_strMaterialName = arrayString[1];
                        }
                        else
                        {
                            // 현재의 버전에서 사용할 수 없는 재질이 존재한다면 공백으로 처리하고
                            // 동작 중에 공백을 사용해서 재질이 초기화 되지 않음을 확인한다.
                            m_strMaterialName = "";
                        }
                        break;

                    case "CurrentDirection":
                        CurrentDirection = (EMCurrentDirection)Enum.Parse(typeof(EMCurrentDirection), arrayString[1]);
                        break;

                    case "Turns":
                        Turns = Convert.ToInt16(arrayString[1]);
                        break;

                    case "Resistance":
                        Resistance = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Resistance_20":
                        Resistance_20 = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Layers":
                        Layers = Convert.ToInt16(arrayString[1]);
                        break;

                    case "TurnsOfOneLayer":
                        TurnsOfOneLayer = Convert.ToInt16(arrayString[1]);
                        break;

                    case "CoilWireGrade":
                        CoilWireGrade = (EMCoilWireGrade)Enum.Parse(typeof(EMCoilWireGrade), arrayString[1]);
                        break;

                    case "InnerDiameter":
                        InnerDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "OuterDiameter":
                        OuterDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Height":
                        Height = Convert.ToDouble(arrayString[1]);
                        break;

                    case "CopperDiameter":
                        CopperDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "WireDiameter":
                        WireDiameter = Convert.ToDouble(arrayString[1]);
                        break;

                    case "Temperature":
                        Temperature = Convert.ToDouble(arrayString[1]);
                        break;

                    case "HorizontalCoefficient":
                        HorizontalCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    case "VerticalCoefficient":
                        VerticalCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    case "ResistanceCoefficient":
                        ResistanceCoefficient = Convert.ToDouble(arrayString[1]);
                        break;

                    default:
                        break;
                    }
                }

                // Shape 정보가 있는 경우만 m_face 를 생성하고 읽기 작업을 진행한다.
                if (listShapeLines.Count > 0)
                {
                    m_face = new CFace();
                    m_face.readObject(listShapeLines);
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 5
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (KindKey != EMKind.NON_KIND)
            {
                CNotice.printLog("NON_KIND 가 아닌 객체가 CNonKind 로 열리려고 한다.");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');

                    /// 각 줄의 String 배열은 항상 2개이여야 한다.
                    if (arrayString.Length != 2)
                    {
                        CNotice.printLog("Non-Kind 데이터에 문제가 있습니다.");
                        return(false);
                    }

                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        KindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // Non Kind 는 CNode 의 정보와 CShapParts 의 Face 정보만 필요하기 때문에
                    // 나머지 정보는 저장하지 않는다.
                    //
                    // CShapeParts
                    //case "MovingParts":
                    //    MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                    //    break;

                    default:
                        break;
                    }
                }

                // Shape 정보가 있는 경우만 m_face 를 생성하고 읽기 작업을 진행한다.
                if (listShapeLines.Count > 0)
                {
                    m_face = new CFace();

                    if (m_face == null)
                    {
                        CNotice.printLogID("IIAT");
                    }
                    else
                    {
                        m_face.readObject(listShapeLines);
                    }
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 6
0
        // 코일에 대한 문자열 라인을 넘겨 받아서 코일 객체를 초기화 한다.
        public bool readObject(List <string> listStringLines)
        {
            CReadFile readFile = new CReadFile();
            string    strTemp;

            string[] arrayString;

            List <string> listInformationLines = new List <string>();
            List <string> listShapeLines       = new List <string>();

            bool bShapeLine = false;

            if (KindKey != EMKind.STEEL)
            {
                CNotice.printLogID("YATT6");
                return(false);
            }

            try
            {
                // Shape 라인과 정보 라인을 분리한다.
                foreach (string strLine in listStringLines)
                {
                    if (readFile.isEndLine(strLine) == "Shape")
                    {
                        bShapeLine = false;
                    }

                    if (bShapeLine == true)
                    {
                        listShapeLines.Add(strLine);
                    }
                    else
                    {
                        if (readFile.isBeginLine(strLine) == "Shape")
                        {
                            bShapeLine = true;
                        }
                        else
                        {
                            listInformationLines.Add(strLine);
                        }
                    }
                }

                // 정보 라인을 처리한다.
                foreach (string strLine in listInformationLines)
                {
                    strTemp = strLine.Trim('\t');

                    arrayString = strTemp.Split('=');

                    if (arrayString.Length != 2)
                    {
                        CNotice.noticeWarningID("TIAP5");
                        return(false);
                    }

                    switch (arrayString[0])
                    {
                    // CNode
                    case "NodeName":
                        NodeName = arrayString[1];
                        break;

                    case "KindKey":
                        KindKey = (EMKind)Enum.Parse(typeof(EMKind), arrayString[1]);
                        break;

                    // CParts
                    case "MovingParts":
                        MovingPart = (EMMoving)Enum.Parse(typeof(EMMoving), arrayString[1]);
                        break;

                    // CSteel
                    case "Material":
                        if (CMaterialListInFEMM.isSteelInList(arrayString[1]) == true)
                        {
                            m_strMaterialName = arrayString[1];
                        }
                        else
                        {
                            // 현재의 버전에서 사용할 수 없는 재질이 존재한다면 공백으로 처리하고
                            // 동작 중에 공백을 사용해서 재질이 초기화 되지 않음을 확인한다.
                            m_strMaterialName = "";
                        }
                        break;

                    default:
                        break;
                    }
                }

                // Shape 정보가 있는 경우만 m_face 를 생성하고 읽기 작업을 진행한다.
                if (listShapeLines.Count > 0)
                {
                    m_face = new CFace();
                    m_face.readObject(listShapeLines);
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }

            return(true);
        }