Exemplo n.º 1
0
    private void RemoteCompileMC(SfbClient _net)
    {
        string[] sources = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.f90", SearchOption.TopDirectoryOnly);
        if (sources.Length > 0 && _net.ServerVersionIsAtLeast("0.8") && _net.SupportedFileType(FileType.mccompile))
        {
            string errortext = null;

            foreach (string source in sources)
            {
                WriteToLog(string.Format("uploaded {0}", _net.SendFile(new FileInfo(source))));
            }
            SetStartTime(DateTime.Now);
            SetStatus(Status.compiling);

            // Compileer op de gui thread (hoort eigenlijk niet)
            _net.Run(FileType.mccompile, "mc.f90", this, ref errortext);

            if (errortext != null)
            {
                MessageBox.Show(errortext, "Server error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        else if (sources.Length > 0)
        {
            MessageBox.Show("There are source files found with your input file. \r\nHowever, " + SubItems[(int)Display.where].Text + " does not support remote compiling.", "Server error", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
Exemplo n.º 2
0
    static void RunAndDownload(SfbClient _net, string shortName, string directoryName, JobEntry je)
    {
        je.RunAndDownloadIsActive = true;
        string errortext = null;

        _net.Run(je.filetype, shortName, je, ref errortext);

        if (errortext == "Maximum number of concurrent jobs exceeded.")
        {
            _net.Disconnect();
            je.WriteToLog(errortext.ToLower());
            je.SetStatus(Status.schedulerequest);
        }
        else if (errortext != null)
        {
            _net.Disconnect();
            MessageBoxShow(je._houston, errortext, "Run error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
        else
        {
            _net.GetFinalStatus();
            je.SetCpuAndMem();

            _net.Download(je.DirectoryName);
            //je.WriteToLog("downloading finished");
            _net.Disconnect();
            if (je.stat == Status.aborted)
            {
                je.WriteToLog("abort completed");
            }
        }
    }