Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/08 15:19:02 (16 years ago)
Author:
whackl
Message:

Graph fixed (#397)

Location:
trunk/sources/HeuristicLab.Hive.Client.Console
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.Designer.cs

    r1002 r1010  
    6262      this.lbCs = new System.Windows.Forms.Label();
    6363      this.lbConnectionStatus = new System.Windows.Forms.Label();
    64       this.zGJobs = new ZedGraph.ZedGraphControl();
    6564      this.lbConnectionStatusCaption = new System.Windows.Forms.Label();
    6665      this.lbJobsAbortedCaption = new System.Windows.Forms.Label();
     
    8786      this.lbServerIPCaption = new System.Windows.Forms.Label();
    8887      this.lbPortCaption = new System.Windows.Forms.Label();
     88      this.pbGraph = new System.Windows.Forms.PictureBox();
    8989      this.tcClientConsole.SuspendLayout();
    9090      this.tpConnection.SuspendLayout();
     
    9595      this.gbOnlineTime.SuspendLayout();
    9696      this.gbServerConnection.SuspendLayout();
     97      ((System.ComponentModel.ISupportInitialize)(this.pbGraph)).BeginInit();
    9798      this.SuspendLayout();
    9899      //
     
    163164      // gbCommon
    164165      //
     166      this.gbCommon.Controls.Add(this.pbGraph);
    165167      this.gbCommon.Controls.Add(this.lbJobsAborted);
    166168      this.gbCommon.Controls.Add(this.lbJobdone);
     
    170172      this.gbCommon.Controls.Add(this.lbCs);
    171173      this.gbCommon.Controls.Add(this.lbConnectionStatus);
    172       this.gbCommon.Controls.Add(this.zGJobs);
    173174      this.gbCommon.Controls.Add(this.lbConnectionStatusCaption);
    174175      this.gbCommon.Controls.Add(this.lbJobsAbortedCaption);
     
    245246      this.lbConnectionStatus.TabIndex = 16;
    246247      this.lbConnectionStatus.Text = "loading...";
    247       //
    248       // zGJobs
    249       //
    250       this.zGJobs.BackColor = System.Drawing.SystemColors.Control;
    251       this.zGJobs.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
    252       this.zGJobs.Location = new System.Drawing.Point(255, 14);
    253       this.zGJobs.Name = "zGJobs";
    254       this.zGJobs.ScrollGrace = 0;
    255       this.zGJobs.ScrollMaxX = 0;
    256       this.zGJobs.ScrollMaxY = 0;
    257       this.zGJobs.ScrollMaxY2 = 0;
    258       this.zGJobs.ScrollMinX = 0;
    259       this.zGJobs.ScrollMinY = 0;
    260       this.zGJobs.ScrollMinY2 = 0;
    261       this.zGJobs.Size = new System.Drawing.Size(149, 111);
    262       this.zGJobs.TabIndex = 14;
    263248      //
    264249      // lbConnectionStatusCaption
     
    379364      // gbOnlineTime
    380365      //
     366      this.gbOnlineTime.BackColor = System.Drawing.SystemColors.Control;
    381367      this.gbOnlineTime.Controls.Add(this.label1);
    382368      this.gbOnlineTime.Location = new System.Drawing.Point(9, 117);
     
    484470      this.lbPortCaption.Text = "Port:";
    485471      //
     472      // pbGraph
     473      //
     474      this.pbGraph.Location = new System.Drawing.Point(292, 19);
     475      this.pbGraph.Name = "pbGraph";
     476      this.pbGraph.Size = new System.Drawing.Size(112, 108);
     477      this.pbGraph.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     478      this.pbGraph.TabIndex = 21;
     479      this.pbGraph.TabStop = false;
     480      //
    486481      // HiveClientConsole
    487482      //
    488483      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    489484      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     485      this.BackColor = System.Drawing.SystemColors.Control;
    490486      this.ClientSize = new System.Drawing.Size(437, 508);
    491487      this.Controls.Add(this.tcClientConsole);
     
    505501      this.gbServerConnection.ResumeLayout(false);
    506502      this.gbServerConnection.PerformLayout();
     503      ((System.ComponentModel.ISupportInitialize)(this.pbGraph)).EndInit();
    507504      this.ResumeLayout(false);
    508505
     
    539536    private System.Windows.Forms.Button btnDisconnect;
    540537    private System.Windows.Forms.Button btConnect;
    541     private ZedGraph.ZedGraphControl zGJobs;
    542538    private System.Windows.Forms.ColumnHeader chId;
    543539    private System.Windows.Forms.ImageList ilEventLog;
     
    551547    private System.Windows.Forms.Label lbJobsAborted;
    552548    private System.Windows.Forms.Label label1;
     549    private System.Windows.Forms.PictureBox pbGraph;
    553550  }
    554551}
  • trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs

    r1002 r1010  
    134134        }
    135135
    136         UpdateGraph(zGJobs, sc.JobsDone, sc.JobsAborted);
     136        UpdateGraph(sc.JobsDone, sc.JobsAborted);
    137137
    138138        if (sc.Status == NetworkEnumWcfConnState.Connected) {
     
    194194    }
    195195
    196     private void UpdateGraph(ZedGraphControl zgc, int jobsDone, int jobsAborted) {
     196    private void UpdateGraph(int jobsDone, int jobsAborted) {
     197      ZedGraphControl zgc = new ZedGraphControl();
    197198      GraphPane myPane = zgc.GraphPane;
    198199      myPane.GraphObjList.Clear();
    199 
    200200
    201201      myPane.Title.IsVisible = false;  // no title
     
    205205      myPane.YAxis.IsVisible = false;  // no y-axis
    206206      myPane.Legend.IsVisible = false; // no legend
    207      
     207
     208      myPane.Fill.Color = Color.FromKnownColor(KnownColor.Control);
     209
    208210      myPane.Chart.Fill.Type = FillType.None;
    209       myPane.Fill.Type = FillType.None;
    210 
    211       //// Set the titles and axis labels
    212       //myPane.Legend.IsVisible = false;
    213       //myPane.Title.IsVisible = false;
    214       ////myPane.Fill.Type = FillType.None;
    215       ////myPane.Fill = new Fill();
    216       ////myPane.Fill.Color = Color.Transparent;
     211      myPane.Fill.Type = FillType.Solid;
    217212
    218213      double sum = (double)jobsDone + jobsAborted;
     
    220215      double perAborted = (double)jobsAborted / sum * 100;
    221216
    222       myPane.AddPieSlice(perDone, Color.Green, 0.1, "Jobs done");
    223       myPane.AddPieSlice(perAborted, Color.Red, 0.1, "Jobs aborted");
     217      myPane.AddPieSlice(perDone, Color.Green, 0.1, "");
     218      myPane.AddPieSlice(perAborted, Color.Red, 0.1, "");
    224219     
    225220      myPane.AxisChange();
     221
     222      pbGraph.Image = zgc.GetImage();
    226223    }
    227224
     
    246243        cc.IPAdress = tbIPAdress.Text;
    247244        cc.Port = port;
    248         cccc.SetConnection(cc);
     245        cccc.SetConnectionAsync(cc);
    249246      } else {
    250247        MessageBox.Show("IP Adress and/or Port Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    251248      }
    252      
    253249    }
    254250
    255251    private void btnDisconnect_Click(object sender, EventArgs e) {
    256       cccc.Disconnect();
     252      cccc.DisconnectAsync();
    257253    }
    258254
Note: See TracChangeset for help on using the changeset viewer.