示例#1
0
        private void buttonDrawingGuide_Click(object sender, EventArgs e)
        {
            string      strHelpFileFullName;
            CultureInfo ctInfo = Thread.CurrentThread.CurrentCulture;

            if (ctInfo.Name == "en-US")
            {
                strHelpFileFullName = Path.Combine(CSettingData.m_strProgramDirPath, "Help", "Drawing_Guide_ENG.pdf");
            }
            else if (ctInfo.Name == "ko-KR")
            {
                strHelpFileFullName = Path.Combine(CSettingData.m_strProgramDirPath, "Help", "Drawing_Guide_KOR.pdf");
            }
            else
            {
                return;
            }

            if (m_manageFile.isExistFile(strHelpFileFullName) == false)
            {
                if (CSettingData.m_emLanguage == EMLanguage.Korean)
                {
                    CNotice.noticeWarning("도움말 파일이 존재하지 않습니다.\nDoSA 디렉토리 > Help > Drawing_Guide_KOR.pdf 를 확인하세요.");
                }
                else
                {
                    CNotice.noticeWarning("Help file does not exist.\nPlease check DoSA Directory > Help > Drawing_Guide_ENG.pdf.");
                }

                return;
            }

            System.Diagnostics.Process.Start(strHelpFileFullName);
        }
示例#2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            /// 완벽한 입력인 상태에서만 Draw 및 저장이 가능한다.
            if (isInputDataOK() == false)
            {
                DialogResult = DialogResult.Cancel;
                return;
            }

            if (PartType == EMKind.COIL && FaceType == EMFaceType.POLYGON)
            {
                if (false == isRectangleShapeInPopup())
                {
                    if (CSettingData.m_emLanguage == EMLanguage.Korean)
                    {
                        CNotice.noticeWarning("Coil 의 형상이 직사각형이 아닙니다.\nCoil 지정을 취소합니다.");
                    }
                    else
                    {
                        CNotice.noticeWarning("The shape of the Coil is not rectangular.\n.Cancels the Coil assignment.");
                    }

                    DialogResult = DialogResult.Cancel;
                    return;
                }
            }

            // 확인을 위해 임시 생성한다.
            CFace faceTemp = makeFaceInPopup();

            if (faceTemp == null)
            {
                CNotice.noticeWarningID("TWAP1");
                DialogResult = DialogResult.Cancel;
                return;
            }

            if (false == faceTemp.isShapeOK())
            {
                CNotice.printLogID("TWAP3");
                DialogResult = DialogResult.Cancel;
                return;
            }

            FormMain formMain = ((FormMain)this.Owner);

            if (formMain != null)
            {
                // 혹시 FEMM 의 화면이 닫힌 경우 FEMM 의 화면을 복원합니다.
                formMain.reopenFEMM();
            }

            m_strPartName = textBoxPartName.Text;

            // 문제가 없으면 정상 종료를 리턴한다.
            DialogResult = DialogResult.OK;
        }
示例#3
0
        public bool addNode(CNode node)
        {
            if (isExistNode(node.NodeName) == true)
            {
                return(false);
            }

            string nodeName = node.NodeName;
            EMKind kind     = node.m_kindKey;

            switch (kind)
            {
            // 형상 파트를 추가하는 경우
            case EMKind.COIL:
            case EMKind.MAGNET:
            case EMKind.STEEL:
                // 남아있는 이름 리스트에 없으면 추가작업을 하지 않는다
                if (m_listRemainedShapeName.Contains(nodeName) == false)
                {
                    CNotice.printTrace("형상이 아닌 node 을 형상 객체처리를 하려고 합니다.");
                    return(false);
                }

                // Shape 명을 제거한다
                m_listRemainedShapeName.Remove(nodeName);
                break;

            // 시험 노드를 추가하는 경우
            default:
                // 남아있는 Shape 형상 명으로 예약되었거나 사용중이 이름이라면 추가 작업을 취소한다.
                if (enableUseNodeName(nodeName) == false)
                {
                    if (CSettingData.m_emLanguage == EMLanguage.Korean)
                    {
                        CNotice.noticeWarning("동일한 이름의 가상실험이 이미 존재 합니다.");
                    }
                    else
                    {
                        CNotice.noticeWarning("There is the same name experiment already.");
                    }

                    return(false);
                }

                break;
            }

            m_listNode.Add(node);

            return(true);
        }
示例#4
0
        private bool isInputDataOK()
        {
            bool bCheck;

            try
            {
                // 빈칸 확인으로 null 비교를 사용하지 말라. (.Length == 0 나 "" 를 사용하라)
                if (textBoxDesignName.Text.Length == 0)
                {
                    CNotice.noticeWarningID("PEAN");
                    return(false);
                }

                if (textBoxSTEPFileFullName.Text.Length == 0)
                {
                    if (CSettingData.m_emLanguage == EMLanguage.Korean)
                    {
                        CNotice.noticeWarning("STEP 파일을 선택해 주세요.");
                    }
                    else
                    {
                        CNotice.noticeWarning("You need to select a STEP file.");
                    }

                    return(false);
                }

                // 가능성은 낮지만 선택한 STEP 파일이 없는지를 검사한다.
                bCheck = m_manageFile.isExistFile(this.textBoxSTEPFileFullName.Text);
                if (bCheck == false)
                {
                    CNotice.printTrace("선택한 STEP 파일이 존재하지 않는다.");
                    return(false);
                }

                // 디자인을 무조건 프로그램 작업디렉토리에 생성하는 것으로 한다.
                // 따라서 디자인을 생성할 때의 적용버튼 임으로 작업 디렉토리는 프로그램 작업 디렉토리를 사용하고 있다.
                List <string> listDirectories = m_manageFile.getDirectoryList(CSettingData.m_strWorkingDirName);

                // 소문자로 비교하기 위해서 임시로 사용한다.
                string strOldTempName, strNewTempName;

                foreach (string directoryName in listDirectories)
                {
                    // 디렉토리 경로에 GetFileName 을 사용하면 가장 마지막 디렉토리가 넘어온다.
                    strOldTempName = Path.GetFileName(directoryName).ToLower();
                    strNewTempName = m_strDesignName.ToLower();

                    if (strOldTempName == strNewTempName)
                    {
                        // 기존 디자인이 이미 존재할 때 삭제하고 새롭게 시작할지를 물어 온다
                        DialogResult ret = CNotice.noticeWarningOKCancelID("TSDA", "W");

                        if (ret == DialogResult.OK)
                        {
                            m_manageFile.deleteDirectory(directoryName);
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CNotice.printTrace(ex.Message);
                return(false);
            }

            return(true);
        }
示例#5
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            // 형상이면 콤보박스 값을 사용한다.
            if (this.m_bShapeNode == true)
            {
                // 형상 데이터가 있는 경우만 동작시킨다.
                if (listViewNodeName.Items.Count != 0)
                {
                    // 콤보박스에 형상이 없어서 선택되지 못한 경우를 제외한다.
                    if (listViewNodeName.SelectedItems.Count != 0)
                    {
                        int nIndex = listViewNodeName.FocusedItem.Index;

                        NodeName = listViewNodeName.Items[nIndex].SubItems[0].Text; //인덱스 번호의 n번째 아이템 얻기
                    }
                    else
                    {
                        if (CSettingData.m_emLanguage == EMLanguage.Korean)
                        {
                            CNotice.noticeWarning("선택된 파트가 존재하지 않습니다.");
                        }
                        else
                        {
                            CNotice.noticeWarning("There is no selected part.");
                        }

                        return;
                    }
                }
                else
                {
                    if (CSettingData.m_emLanguage == EMLanguage.Korean)
                    {
                        CNotice.noticeWarning("선택된 파트가 존재하지 않습니다.");
                    }
                    else
                    {
                        CNotice.noticeWarning("There is no selected part.");
                    }

                    return;
                }
            }
            // 형상이 아니면 text 값을 사용한다.
            else
            {
                NodeName = string.Format("{0}", textBoxNodeName.Text);

                if (NodeName.Length == 0)
                {
                    if (CSettingData.m_emLanguage == EMLanguage.Korean)
                    {
                        CNotice.noticeWarning("가상 실험의 이름을 입력하세요.");
                    }
                    else
                    {
                        CNotice.noticeWarning("You need to enter the Node Name.");
                    }

                    return;
                }
            }

            this.DialogResult = DialogResult.OK;
        }
示例#6
0
        private bool isInputDataOK()
        {
            try
            {
                // 빈칸 확인으로 null 비교를 사용하지 말라. (.Length == 0 나 "" 를 사용하라)
                if (textBoxName.Text.Length == 0)
                {
                    CNotice.noticeWarningID("PEAN");
                    return(false);
                }

                /// Design 생성이다.
                if (m_strNewKind == "Design")
                {
                    // 디자인을 무조건 프로그램 작업디렉토리에 생성하는 것으로 한다.
                    // 따라서 디자인을 생성할 때의 적용버튼 임으로 작업 디렉토리는 프로그램 작업 디렉토리를 사용하고 있다.
                    List <string> listDirectories = m_manageFile.getDirectoryList(CSettingData.m_strCurrentWorkingDirPath);

                    // 소문자로 비교하기 위해서 임시로 사용한다.
                    string strOldTempName, strNewTempName;

                    foreach (string directoryName in listDirectories)
                    {
                        // 디렉토리 경로에 GetFileName 을 사용하면 가장 마지막 디렉토리가 넘어온다.
                        strOldTempName = Path.GetFileName(directoryName).ToLower();
                        strNewTempName = m_strName.ToLower();

                        if (strOldTempName == strNewTempName)
                        {
                            // 신규 디자인 이름이 기존 디자인과 겹칠때 기존 디자인을 삭제하는 것은 위험성이 따른다.
                            // 그래서 아래의 동작을 중지한다.
                            //
                            // 기존 디자인이 이미 존재할 때 삭제하고 새롭게 시작할지를 물어 온다
                            //DialogResult ret = CNotice.noticeWarningOKCancelID("TSDA", "W");

                            //if (ret == DialogResult.OK)
                            //{
                            //    m_manageFile.deleteDirectory(directoryName);
                            //    return true;
                            //}
                            //else
                            //    return false;

                            if (CSettingData.m_emLanguage == EMLanguage.Korean)
                            {
                                CNotice.noticeWarning("동일한 이름의 Design 이 이미 존재 합니다.\n다른 디자인명을 사용해 주세요.");
                            }
                            else
                            {
                                CNotice.noticeWarning("A design with the same name already exists.\nPlease use a different design name.");
                            }

                            return(false);
                        }
                    }
                }
                /// Test 들의 생성이다.
                else
                {
                    /// 호출할 때 Owner 를 FormMain 으로 초기화 해야 확실하게 얻을 수 있다.
                    FormMain formMain = ((FormMain)this.Owner);

                    if (formMain == null)
                    {
                        CNotice.printLogID("CNGM");
                        return(false);
                    }

                    if (true == formMain.m_design.isExistNode(textBoxName.Text))
                    {
                        CNotice.noticeWarningID("IIAE");
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                CNotice.printLog(ex.Message);
                return(false);
            }

            return(true);
        }