• R/O
  • SSH
  • HTTPS

ea-addin-dsm: Commit


Commit MetaInfo

Revision51 (tree)
Time2010-07-19 12:20:28
Authorm-usami

Log Message

不恰好だけれどもバックグラウンド処理化完了

Change Summary

Incremental Difference

--- dsm/branches/version-0.5.1.0/EAAddinDSM/DSMDialog.cs (revision 50)
+++ dsm/branches/version-0.5.1.0/EAAddinDSM/DSMDialog.cs (revision 51)
@@ -68,8 +68,8 @@
6868 dsm_ = new DSMModel(repository, diagram, type);
6969 if (dsm_.attach(this))
7070 {
71+ setDialogFormat();
7172 controller_ = new DSMController(ref dsm_);
72- setDialogFormat();
7373 ProgressDialog prog = new ProgressDialog(ref controller_, ref dsm_);
7474 prog.initialize();
7575 prog.ShowDialog();
@@ -98,8 +98,8 @@
9898 dsm_ = new DSMModel(repository, package, type);
9999 if (dsm_.attach(this))
100100 {
101+ setDialogFormat();
101102 controller_ = new DSMController(ref dsm_);
102- setDialogFormat();
103103 ProgressDialog prog = new ProgressDialog(ref controller_, ref dsm_);
104104 prog.initialize();
105105 prog.ShowDialog();
@@ -276,10 +276,6 @@
276276 prog.tearing(grid_.SelectedCells[0].RowIndex - 1, grid_.SelectedCells[0].ColumnIndex - 1);
277277 prog.ShowDialog();
278278 update();
279- //if (controller_.tearing(grid_.SelectedCells[0].RowIndex - 1, grid_.SelectedCells[0].ColumnIndex - 1))
280- //{
281- // return;
282- //}
283279 }
284280 }
285281
--- dsm/branches/version-0.5.1.0/EAAddinDSM/ProgressDialog.Designer.cs (revision 50)
+++ dsm/branches/version-0.5.1.0/EAAddinDSM/ProgressDialog.Designer.cs (revision 51)
@@ -71,7 +71,7 @@
7171 // label1
7272 //
7373 this.label1.AutoSize = true;
74- this.label1.Location = new System.Drawing.Point(12, 9);
74+ this.label1.Location = new System.Drawing.Point(12, 7);
7575 this.label1.Name = "label1";
7676 this.label1.Size = new System.Drawing.Size(17, 12);
7777 this.label1.TabIndex = 1;
@@ -80,7 +80,7 @@
8080 // label2
8181 //
8282 this.label2.AutoSize = true;
83- this.label2.Location = new System.Drawing.Point(256, 9);
83+ this.label2.Location = new System.Drawing.Point(256, 7);
8484 this.label2.Name = "label2";
8585 this.label2.Size = new System.Drawing.Size(29, 12);
8686 this.label2.TabIndex = 2;
@@ -111,8 +111,6 @@
111111 //
112112 this.bgWorker_.WorkerReportsProgress = true;
113113 this.bgWorker_.WorkerSupportsCancellation = true;
114- //this.bgWorker_.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorker__DoWork);
115- //this.bgWorker_.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorker__DoWork2);
116114 this.bgWorker_.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorker__RunWorkerCompleted);
117115 this.bgWorker_.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorker__ProgressChanged);
118116 //
--- dsm/branches/version-0.5.1.0/EAAddinDSM/ProgressDialog.cs (revision 50)
+++ dsm/branches/version-0.5.1.0/EAAddinDSM/ProgressDialog.cs (revision 51)
@@ -54,13 +54,13 @@
5454
5555 public void initialize()
5656 {
57- this.bgWorker_.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorker__DoWork);
57+ this.bgWorker_.DoWork += new DoWorkEventHandler(this.bgWorker__DoInitialize);
5858 bgWorker_.RunWorkerAsync();
5959 }
6060
6161 public void partitioning()
6262 {
63- this.bgWorker_.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorker__DoWork2);
63+ this.bgWorker_.DoWork += new DoWorkEventHandler(this.bgWorker__DoPartitioning);
6464 bgWorker_.RunWorkerAsync();
6565 }
6666
@@ -68,12 +68,12 @@
6868 {
6969 if (controller_.tearing(row, columun))
7070 {
71- this.bgWorker_.DoWork += new DoWorkEventHandler(bgWorker__DoWork3);
71+ this.bgWorker_.DoWork += new DoWorkEventHandler(bgWorker__DoPartitioning);
7272 bgWorker_.RunWorkerAsync();
7373 }
7474 }
7575
76- private void bgWorker__DoWork(object sender, DoWorkEventArgs e)
76+ private void bgWorker__DoInitialize(object sender, DoWorkEventArgs e)
7777 {
7878 BackgroundWorker bg = (BackgroundWorker)sender;
7979 if (controller_.initialize())
@@ -82,17 +82,11 @@
8282 }
8383 }
8484
85- private void bgWorker__DoWork2(object sender, DoWorkEventArgs e)
85+ private void bgWorker__DoPartitioning(object sender, DoWorkEventArgs e)
8686 {
8787 BackgroundWorker bg = (BackgroundWorker)sender;
8888 controller_.partitioning(ref bg);
8989 }
90-
91- private void bgWorker__DoWork3(object sender, DoWorkEventArgs e)
92- {
93- BackgroundWorker bg = (BackgroundWorker)sender;
94- controller_.partitioning(ref bg);
95- }
9690
9791 private void bgWorker__ProgressChanged(object sender, ProgressChangedEventArgs e)
9892 {
--- dsm/branches/version-0.5.1.0/EAAddinDSM/DSMController.cs (revision 50)
+++ dsm/branches/version-0.5.1.0/EAAddinDSM/DSMController.cs (revision 51)
@@ -29,10 +29,13 @@
2929 using System.Linq;
3030 using System.Text;
3131 using System.Collections;
32+using System.Windows.Forms;
3233 using System.IO;
3334
35+
3436 namespace EAAddinDSM
3537 {
38+
3639 /// <summary>
3740 /// MVCモデルにおけるControllerに相当するクラス
3841 /// DSMのパーティショニング等の操作を行う
@@ -39,6 +42,8 @@
3942 /// </summary>
4043 class DSMController : Observer
4144 {
45+ private BackgroundWorker bg_;
46+
4247 /// <summary>
4348 /// DSM本体を持つModel相当のオブジェクト
4449 /// </summary>
@@ -88,15 +93,15 @@
8893 /// <returns>true:パーティショニング成功 false:失敗(未使用)</returns>
8994 public bool partitioning(ref BackgroundWorker bg)
9095 {
96+ bg_ = bg;
97+
9198 int[,] dsm = dsm_.getDSM();
9299 int[,] reach = reachabilityMatrix(dsm);
93- bg.ReportProgress(30);
94100 ArrayList[] row = partitionRow(reach);
95- bg.ReportProgress(60);
96101 ArrayList[] column = partitionColumn(reach);
97- bg.ReportProgress(90);
98102 dsm_.setNewSequence(getNewSequence(row, column));
99103
104+ bg_ = null;
100105 return true;
101106 }
102107
@@ -131,6 +136,7 @@
131136 }
132137 }
133138 }
139+ bg_.ReportProgress((int)(i * 100 / dsm.GetLength(0) * 0.3));
134140 }
135141 return reach;
136142 }
@@ -153,6 +159,7 @@
153159 row[i].Add(j);
154160 }
155161 }
162+ bg_.ReportProgress((int)(i * 100 / reach.GetLength(0) * 0.3 + 0.3));
156163 }
157164 return row;
158165 }
@@ -175,6 +182,7 @@
175182 column[i].Add(j);
176183 }
177184 }
185+ bg_.ReportProgress((int)(i * 100 / reach.GetLength(0) * 0.3 + 0.6));
178186 }
179187 return column;
180188
@@ -261,8 +269,6 @@
261269 if (dsm_.removeDependency(x, y))
262270 {
263271 return true;
264- // partitioningを実行
265- //return partitioning(ref bg);
266272 }
267273 return false;
268274 }
Show on old repository browser