Ejemplo n.º 1
0
        private void FinishJob(Dictionary <string, object> job)
        {
            try
            {
                if (!timeouted)
                {
                    AddLine("reading results for job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                    string result;
                    string resultText;
                    ReadMATLABResults(job, out result, out resultText);
                    if (resultText.Length > 250)
                    {
                        resultText = "% túl hosszú output eleje csonkolva % \r\n" + resultText.Substring(resultText.Length - 250);
                    }
                    UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingFinished, result, resultText, appName, 1);
                    AddLine("finished job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                }
                else
                {
                    UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingFinished, "0", "Időtúllépés (60 s) miatt a Matlab bezárásra került!", appName, 1);
                    AddLine("aborted job due to timeout " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                }
            }
            catch (Exception ex)
            {
                AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingAborted, "0", ex.Message, appName, 1);

                AddLine("aborted job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
            }

            state      = LGMAppState.Idle;
            currentJob = null;
            startTimer();
        }
Ejemplo n.º 2
0
        private void ProcessJob(Dictionary <string, object> job)
        {
            stopTimer();
            state      = LGMAppState.ProcessingOngoing;
            currentJob = job;

            try
            {
                CopyToArchiveAndUnzipToWork(job);

                AddLine("processing job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateUnderAutoProcessing, "0", "Feldolgozás alatt...", appName, 1);

                StartMATLABProcess(job);
            }
            catch (Exception ex)
            {
                AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingAborted, "0", ex.Message, appName, 1);

                AddLine("aborted job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                state      = LGMAppState.Idle;
                currentJob = null;
                stopProcessTimeoutTimer();
                startTimer();
            }
        }
Ejemplo n.º 3
0
        private void LifeGameManagerForm_Load(object sender, EventArgs e)
        {
            ReadSettings();

            state = LGMAppState.Idle;
            ConnectToDatabase();
            FixUnfinishedJobs();
            startTimer();
        }
Ejemplo n.º 4
0
        private MySqlConnection ConnectToDatabase()
        {
            MySqlConnection conn;
            string          cs = "Server=" + mySqlServer + ";Uid=" + mySqlUser + ";Pwd=" + mySqlPassword + ";Database=" + mySqlDatabase;

            //AddLine("CONNECTING: " + cs, 2);
            try
            {
                conn = new MySqlConnection(cs);
                conn.Open();
            }
            catch (Exception ex)
            {
                AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
                return(null);
            }
            //AddLine("CONNECTION SUCCESSFUL", 2);
            state = LGMAppState.Idle;
            return(conn);
        }
        private void ProcessJob(Dictionary<string, object> job)
        {
            stopTimer();
            state = LGMAppState.ProcessingOngoing;
            currentJob = job;

            try
            {
                CopyToArchiveAndUnzipToWork(job);

                AddLine("processing job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateUnderAutoProcessing, "0", "Feldolgozás alatt...", appName, 1);

                StartMATLABProcess(job);
            }
            catch (Exception ex)
            {
                AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingAborted, "0", ex.Message, appName, 1);

                AddLine("aborted job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                state = LGMAppState.Idle;
                currentJob = null;
                stopProcessTimeoutTimer();
                startTimer();
            }
        }
        private void LifeGameManagerForm_Load(object sender, EventArgs e)
        {
            ReadSettings();

            state = LGMAppState.Idle;
            ConnectToDatabase();
            FixUnfinishedJobs();
            startTimer();
        }
        private void FinishJob(Dictionary<string, object> job)
        {
            try
            {
                if (!timeouted)
                {
                    AddLine("reading results for job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                    string result;
                    string resultText;
                    ReadMATLABResults(job, out result, out resultText);
                    if (resultText.Length > 250) {
                        resultText = "% túl hosszú output eleje csonkolva % \r\n" + resultText.Substring(resultText.Length - 250);
                    }
                    UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingFinished, result, resultText, appName, 1);
                    AddLine("finished job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                }
                else
                {
                    UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingFinished, "0", "Időtúllépés (60 s) miatt a Matlab bezárásra került!", appName, 1);
                    AddLine("aborted job due to timeout " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
                }
            }
            catch (Exception ex)
            {
                AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
                UpdateProcedure((uint)job["FeladatID"], (uint)job["ID"], StateProcessingAborted, "0", ex.Message, appName, 1);

                AddLine("aborted job " + (uint)job["ID"] + " id: " + (uint)job["FeladatID"] + " neptun: " + job["Neptun"], 2);
            }

            state = LGMAppState.Idle;
            currentJob = null;
            startTimer();
        }
 private MySqlConnection ConnectToDatabase()
 {
     MySqlConnection conn;
     string cs = "Server=" + mySqlServer + ";Uid=" + mySqlUser + ";Pwd=" + mySqlPassword + ";Database=" + mySqlDatabase;
     //AddLine("CONNECTING: " + cs, 2);
     try
     {
         conn = new MySqlConnection(cs);
         conn.Open();
     }
     catch (Exception ex)
     {
         AddLine("ERROR: " + ex.Message + "\r\n" + ex.StackTrace);
         return null;
     }
     //AddLine("CONNECTION SUCCESSFUL", 2);
     state = LGMAppState.Idle;
     return conn;
 }