Beispiel #1
0
        void findDispCsvFile()
        {
            try
            {
                setFeaFolder();
                //find the csv file.
                string resfolder = getResFolderName();
                //find latest csv in feafolder
                breakoutDispFileName = FindDispFileInFolder(resfolder);

                if (breakoutDispFileName != null)
                {
                    activeResultType = NasResTypes.csv;
                    breakoutAtNode   = true;
                    breakoutNode     = -1;
                }
                else
                {
                    writeToLog("no displacement csv file");
                }
            }
            catch
            {
                ShowMessage("cannot read displacement csv file. Please make sure it is not open in another program");
            }
        }
Beispiel #2
0
 private void FeaFileBut_Click(object sender, EventArgs e)
 {
     newModel   = true;
     FemapModel = false;
     nodeTB.Clear();
     fearestb.Clear();
     RunGB.Visible        = false;
     f06File              = null;
     op2Name              = null;
     breakoutDispFileName = null;
     activeResultType     = NasResTypes.none;
     getGenericNastranModel();
 }
Beispiel #3
0
        void ReadSettings()
        {
            //read current user settings from settings.txt file

            StreamReader tmp = null;

            try
            {
                if (File.Exists(workingDir + "settings.txt"))
                {
                    tmp = new StreamReader(workingDir + "settings.txt");
                    string s = tmp.ReadLine();
                    feaFolder = s;
                    s         = GetFirstToken(tmp.ReadLine());
                    bool.TryParse(s, out ignoreSacrificial);
                    s = GetFirstToken(tmp.ReadLine());
                    bool.TryParse(s, out econSolve);
                    s = GetFirstToken(tmp.ReadLine());
                    double.TryParse(s, out errTol);
                    s = GetFirstToken(tmp.ReadLine());
                    int.TryParse(s, out maxIts);
                    s = GetFirstToken(tmp.ReadLine());
                    int.TryParse(s, out minP);
                    s = GetFirstToken(tmp.ReadLine());
                    int.TryParse(s, out maxP);
                    s = GetFirstToken(tmp.ReadLine());
                    bool.TryParse(s, out useStressUnits);
                    s = GetFirstToken(tmp.ReadLine());
                    int.TryParse(s, out inStressUnits);
                    s = GetFirstToken(tmp.ReadLine());
                    int.TryParse(s, out stressUnits);
                    s = GetFirstToken(tmp.ReadLine());
                    bool.TryParse(s, out outputF06);
                    s = GetFirstToken(tmp.ReadLine());
                    int restype;
                    int.TryParse(s, out restype);
                    nasResType = (NasResTypes)restype;
                    string line = tmp.ReadLine();
                    s = GetFirstToken(line);
                    bool.TryParse(s, out resFolderIsFeaFolder);
                    if (!resFolderIsFeaFolder)
                    {
                        string[] subs2 = line.Split(',');
                        userResFolderName = subs2[1];
                    }
                    if (useStressUnits)
                    {
                        setStressUnits();
                    }
                    tmp.Close();
                }
            }
            catch
            {
                if (tmp != null)
                {
                    try
                    {
                        tmp.Close();
                    }
                    catch
                    {
                    }
                }
                return;
            }
        }