Changeset 51

Show
Ignore:
Timestamp:
03/30/05 23:47:58 (4 years ago)
Author:
altba\rryu
Message:

メモリ関係のグラフ表示の内容をもう少し充実させてみた。

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/MacFaceFloat/MacFaceApp.cs

    r50 r51  
    268268                        patternWindow.UpdatePattern(suite, pattern, markers); 
    269269 
    270                         statusWindow.Refresh(); 
     270                        statusWindow.Invalidate(); 
    271271                } 
    272272 
     
    322322                                g.DrawLine(pen, 5, y, 305, y); 
    323323                        } 
     324                        g.DrawLine(Pens.Gray, 5, 55, 305, 55); 
     325 
    324326                        g.DrawRectangle(Pens.Black, 4, 4, 301, 101); 
    325327 
    326328                        g.FillRectangle(new SolidBrush(Color.White), 5, 110, 300, 100); 
    327                         for (int y = 110; y < 210; y += 10)  
     329                        for (int y = 210; y > 110; y -= 7)  
    328330                        { 
    329331                                g.DrawLine(pen, 5, y, 305, y); 
    330332                        } 
     333                        g.DrawLine(Pens.Gray, 5, 210-5*7, 305, 210-5*7); 
    331334                        g.DrawRectangle(Pens.Black, 4, 109, 301, 101); 
    332335 
     
    358361                                } 
    359362 
    360                                 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 0, 0, 255)), userGraph); 
     363                                g.FillPolygon(new SolidBrush(Color.FromArgb(50, 0, 0, 255)), userGraph); 
    361364                                g.DrawPolygon(new Pen(Color.FromArgb(0, 0, 255), 1F), userGraph); 
    362                                 g.FillPolygon(new SolidBrush(Color.FromArgb(64, 255, 0, 0)), sysGraph); 
    363                         } 
    364  
    365                         double rate = 70.0 / (MemoryUsageCounter.TotalVisibleMemorySize * 1024); 
     365                                g.FillPolygon(new SolidBrush(Color.FromArgb(50, 255, 0, 0)), sysGraph); 
     366                        } 
     367 
     368                        int totalMemory = (int)MemoryUsageCounter.TotalVisibleMemorySize * 1024; 
     369                        double rate = 70.0 / totalMemory; 
    366370 
    367371                        g.SmoothingMode = SmoothingMode.None; 
    368                         Brush brush = new SolidBrush(Color.FromArgb(180, 255, 145, 0)); 
     372                        Brush commitedBrush = new SolidBrush(Color.FromArgb(180, 255, 145, 0)); 
     373                        Brush uncommitedBrush = new SolidBrush(Color.FromArgb(180, 180, 200, 255)); 
     374                        Brush availableBrush = new SolidBrush(Color.FromArgb(180, 100, 100, 255)); 
     375 
    369376                        int posu = memHistoryHead - 1; 
    370377                        for (int i = 0; i < memHistoryCount; i++)  
     
    377384                                x = 305 - i * 5 - 5; 
    378385                                w = 5; 
     386 
    379387                                h = (int)(usage.Committed * rate); 
    380388                                y = 210 - h; 
    381                                 g.FillRectangle(brush, x, y, w, h); 
     389                                g.FillRectangle(commitedBrush, x, y, w, h); 
     390 
     391                                if (h < 100)  
     392                                { 
     393                                        h = 100 - h; 
     394                                        y = 110; 
     395                                        g.FillRectangle(uncommitedBrush, x, y, w, h); 
     396                                } 
     397 
     398                                h = (int)(usage.Available * rate); 
     399                                y = 210-70; 
     400                                g.FillRectangle(availableBrush, x, y, w, h); 
    382401 
    383402                                x = 305 - i * 5 - 5; 
     
    395414                                posu--; 
    396415                        } 
    397                         g.DrawLine(Pens.Red, 5, 210-70, 305, 210-70); 
     416                        g.DrawLine(Pens.Black, 5, 210-70, 305, 210-70); 
    398417                } 
    399418        }