예제 #1
0
        public static void CheckiErr(int iErr)
        {
            StringBuilder sb = new StringBuilder(St7.kMaxStrLen);
            string        errorstring;

            St7.St7GetAPIErrorString(iErr, sb, sb.Capacity);
            errorstring = sb.ToString();
            if (errorstring == "")
            {
                St7.St7GetSolverErrorString(iErr, sb, sb.Capacity);
                errorstring = sb.ToString();
            }
            if (errorstring != "No error.")
            {
                MessageBox.Show(errorstring);
                //Console.WriteLine("");
                //Console.WriteLine("Strand7 API error: " + errorstring);
                //Console.WriteLine("The program has terminated early.");

                string sFilePath = System.IO.Path.GetTempPath() + "API Error Log.txt";
                System.IO.File.WriteAllText(sFilePath, errorstring);

                Environment.Exit(0);
            }
        }
예제 #2
0
        public static bool St7NoteCustom(int code, string customString)
        {
            if (code == St7.ERR7_NoError)
            {
                return(true);
            }
            StringBuilder errorSb = new StringBuilder(St7.kMaxStrLen);

            if (St7.ERR7_NoError == St7.St7GetAPIErrorString(code, errorSb, St7.kMaxStrLen))
            {
                Engine.Base.Compute.RecordNote(errorSb.ToString() + ". " + customString);
            }
            else if (St7.ERR7_NoError == St7.St7GetSolverErrorString(code, errorSb, St7.kMaxStrLen))
            {
                Engine.Base.Compute.RecordNote(errorSb.ToString() + ". " + customString);
            }
            return(false);
        }
예제 #3
0
        public static bool St7Error(int code)
        {
            if (code == St7.ERR7_NoError)
            {
                return(true);
            }
            StringBuilder errorSb = new StringBuilder(St7.kMaxStrLen);

            if (St7.ERR7_NoError == St7.St7GetAPIErrorString(code, errorSb, St7.kMaxStrLen))
            {
                Engine.Base.Compute.RecordError(errorSb.ToString());
            }
            else if (St7.ERR7_NoError == St7.St7GetSolverErrorString(code, errorSb, St7.kMaxStrLen))
            {
                Engine.Base.Compute.RecordError(errorSb.ToString());
            }
            return(false);
        }