Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MatlabRunner m = FmriCommon.getMatlabRunner(Application, Server);

        List <FmriRequest> reqList;

        reqList = m.GetQueueList();
        reqList.Reverse();
        foreach (FmriRequest req in reqList)
        {
            TableRow r = new TableRow();
            r.Height = 40;

            TableCell c;

            c           = new TableCell();
            c.Text      = "Queue";
            c.BackColor = Color.Orange;
            r.Cells.Add(c);

            AddCells(r.Cells, req);

            tblReq.Rows.Add(r);
        }
        reqList.Reverse();


        FmriRequest currReq = m.CurrentRequest;

        if (currReq != null)
        {
            TableRow r = new TableRow();
            r.Height = 40;

            TableCell c;

            c           = new TableCell();
            c.Text      = "In Progress";
            c.BackColor = Color.DarkGreen;
            c.ForeColor = Color.White;
            r.Cells.Add(c);

            AddCells(r.Cells, currReq);

            c      = new TableCell();
            c.Text = Convert.ToString(currReq.TimeExecuted);
            r.Cells.Add(c);

            tblReq.Rows.Add(r);
        }

        handleDone(m.GetDoneList(), tblReq, "Finished", Color.DarkSlateBlue, Color.White);
        handleDone((List <FmriRequest>)Application["ReqHist"], tblReq, "History", Color.LightGray, Color.Black);
    }
Ejemplo n.º 2
0
    private void execute(string imageName,
                         int x1, int x2,
                         int y1, int y2,
                         int z1, int z2,
                         double threshold,
                         int t1, int t2,
                         int cs1, int cs2)
    {
        debugString("Running on image: " + imageName);
        debugString("X=[" + x1 + "," + x2 + "]");
        debugString("Y=[" + y1 + "," + y2 + "]");
        debugString("Z=[" + z1 + "," + z2 + "]");
        debugString("Threshold: " + threshold);

        FmriRequest req = new FmriRequest(imageName, x1, x2, y1, y2, z1, z2, threshold, t1, t2, cs1, cs2, Request.UserHostAddress);

        refStr.Value         = req.AreaStringWithThresholdMD5;
        refNoThreshold.Value = req.AreaStringMD5;

        debugString("AreaString: " + req.AreaString + " (" + req.AreaStringMD5 + ")");
        debugString("AreaStringWithThreshold: " + req.AreaStringWithThreshold + " (" + req.AreaStringWithThresholdMD5 + ")");

        if (FmriCommon.isOutImageExists(req.AreaStringWithThresholdMD5, Server))
        {
            debugString("Filename: \"" + FmriCommon.getOutImageDir(Server) + req.AreaStringWithThresholdMD5 + ".png" + "\" exists. good.");
            lblRef.ForeColor = System.Drawing.Color.Green;
            lblRef.Text      = "Your request is completed. See results page!";
        }
        else
        {
            MatlabRunner m = FmriCommon.getMatlabRunner(Application, Server);
            m.EnqueueRequest(req);
            debugString("Posted to queue.");
            lblRef.ForeColor = System.Drawing.Color.Blue;
            lblRef.Text      = "Your request was posted to the queue. Try the results page later.";
        }
    }