Collaboration diagram for NDB_CPC::startDatabaseDlg:

Public Member Functions | |
| startDatabaseDlg (Database db) | |
Protected Member Functions | |
| override void | Dispose (bool disposing) |
| Clean up any resources being used. | |
Private Member Functions | |
| void | InitializeComponent () |
| Required method for Designer support - do not modify the contents of this method with the code editor. | |
| void | startDatabase_Load (object sender, System.EventArgs e) |
| void | startDatabase_Paint (object sender, System.Windows.Forms.PaintEventArgs e) |
| void | defineProcesses () |
| void | startProcesses () |
| void | buttonGo_Click (object sender, System.EventArgs e) |
Private Attributes | |
| System.Windows.Forms.TextBox | textAction |
| System.Windows.Forms.Label | label1 |
| System.ComponentModel.Container | components = null |
| Required designer variable. | |
| System.Windows.Forms.ProgressBar | progressBar |
| System.Windows.Forms.Label | label2 |
| System.Windows.Forms.Button | buttonGo |
| Database | m_db |
Definition at line 13 of file startDatabaseDlg.cs.
| NDB_CPC::startDatabaseDlg::startDatabaseDlg | ( | Database | db | ) | [inline] |
Definition at line 25 of file startDatabaseDlg.cs.
References db, InitializeComponent(), and m_db.
00026 { 00027 00028 // 00029 // Required for Windows Form Designer support 00030 // 00031 InitializeComponent(); 00032 00033 // 00034 // TODO: Add any constructor code after InitializeComponent call 00035 // 00036 m_db=db; 00037 }
Here is the call graph for this function:

| void NDB_CPC::startDatabaseDlg::buttonGo_Click | ( | object | sender, | |
| System.EventArgs | e | |||
| ) | [inline, private] |
Definition at line 239 of file startDatabaseDlg.cs.
Referenced by InitializeComponent().
00240 { 00241 buttonGo.Enabled=false; 00242 progressBar.Step=1; 00243 defineProcesses(); 00244 progressBar.Value=0; 00245 startProcesses(); 00246 00247 }
Here is the caller graph for this function:

| void NDB_CPC::startDatabaseDlg::defineProcesses | ( | ) | [inline, private] |
Definition at line 144 of file startDatabaseDlg.cs.
References NDB_CPC::Computer::connectToCpcd(), NDB_CPC::Computer::defineProcess(), NDB_CPC::Computer::isConnected(), and p.
00145 { 00146 ArrayList processes = m_db.getProcesses(); 00147 progressBar.Maximum = processes.Count; 00148 progressBar.Minimum = 0; 00149 00150 int retry=0; 00151 //sc.connect("130.100.232.7"); 00152 foreach (Process p in processes) 00153 { 00154 Computer comp; 00155 retry=0; 00156 //if(p.getName().StartsWith("ndb") || p.getName().StartsWith("mgm")) 00157 //{ 00158 textAction.Text="Defining process " + p.getName(); 00159 textAction.Refresh(); 00160 comp=p.getComputer(); 00161 while(retry<10) 00162 { 00163 if(!comp.isConnected()) 00164 { 00165 comp.connectToCpcd(); 00166 00167 } 00168 else 00169 { 00170 if(comp.defineProcess(p)<0) 00171 { 00172 ; 00173 } 00174 else 00175 break; 00176 } 00177 if(retry==9) 00178 { 00179 if(MessageBox.Show(this,"Failed to define process. Try again?","Warning!!!",MessageBoxButtons.YesNo)==DialogResult.Yes) 00180 retry=0; 00181 } 00182 retry++; 00183 //comp.undefineProcess(p); 00184 } 00185 //} 00186 progressBar.PerformStep(); 00187 } 00188 }
Here is the call graph for this function:

| override void NDB_CPC::startDatabaseDlg::Dispose | ( | bool | disposing | ) | [inline, protected] |
Clean up any resources being used.
Definition at line 42 of file startDatabaseDlg.cs.
References components.
00043 { 00044 if( disposing ) 00045 { 00046 if(components != null) 00047 { 00048 components.Dispose(); 00049 } 00050 } 00051 base.Dispose( disposing ); 00052 }
| void NDB_CPC::startDatabaseDlg::InitializeComponent | ( | ) | [inline, private] |
Required method for Designer support - do not modify the contents of this method with the code editor.
Definition at line 59 of file startDatabaseDlg.cs.
References buttonGo_Click().
Referenced by startDatabaseDlg().
00060 { 00061 this.textAction = new System.Windows.Forms.TextBox(); 00062 this.label1 = new System.Windows.Forms.Label(); 00063 this.progressBar = new System.Windows.Forms.ProgressBar(); 00064 this.label2 = new System.Windows.Forms.Label(); 00065 this.buttonGo = new System.Windows.Forms.Button(); 00066 this.SuspendLayout(); 00067 // 00068 // textAction 00069 // 00070 this.textAction.Location = new System.Drawing.Point(104, 40); 00071 this.textAction.Name = "textAction"; 00072 this.textAction.ReadOnly = true; 00073 this.textAction.Size = new System.Drawing.Size(256, 20); 00074 this.textAction.TabIndex = 0; 00075 this.textAction.Text = ""; 00076 // 00077 // label1 00078 // 00079 this.label1.Location = new System.Drawing.Point(8, 40); 00080 this.label1.Name = "label1"; 00081 this.label1.Size = new System.Drawing.Size(96, 16); 00082 this.label1.TabIndex = 1; 00083 this.label1.Text = "Current activity:"; 00084 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 00085 // 00086 // progressBar 00087 // 00088 this.progressBar.Location = new System.Drawing.Point(104, 88); 00089 this.progressBar.Name = "progressBar"; 00090 this.progressBar.Size = new System.Drawing.Size(152, 16); 00091 this.progressBar.TabIndex = 2; 00092 // 00093 // label2 00094 // 00095 this.label2.Location = new System.Drawing.Point(8, 88); 00096 this.label2.Name = "label2"; 00097 this.label2.Size = new System.Drawing.Size(96, 16); 00098 this.label2.TabIndex = 3; 00099 this.label2.Text = "Activity progress:"; 00100 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 00101 // 00102 // buttonGo 00103 // 00104 this.buttonGo.Location = new System.Drawing.Point(152, 136); 00105 this.buttonGo.Name = "buttonGo"; 00106 this.buttonGo.Size = new System.Drawing.Size(96, 24); 00107 this.buttonGo.TabIndex = 4; 00108 this.buttonGo.Text = "Go!"; 00109 this.buttonGo.Click += new System.EventHandler(this.buttonGo_Click); 00110 // 00111 // startDatabaseDlg 00112 // 00113 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 00114 this.ClientSize = new System.Drawing.Size(378, 167); 00115 this.Controls.AddRange(new System.Windows.Forms.Control[] { 00116 this.buttonGo, 00117 this.label2, 00118 this.progressBar, 00119 this.label1, 00120 this.textAction}); 00121 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 00122 this.MaximizeBox = false; 00123 this.MinimizeBox = false; 00124 this.Name = "startDatabaseDlg"; 00125 this.Text = "Starting database"; 00126 this.Load += new System.EventHandler(this.startDatabase_Load); 00127 this.Paint += new System.Windows.Forms.PaintEventHandler(this.startDatabase_Paint); 00128 this.ResumeLayout(false); 00129 00130 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NDB_CPC::startDatabaseDlg::startDatabase_Load | ( | object | sender, | |
| System.EventArgs | e | |||
| ) | [inline, private] |
| void NDB_CPC::startDatabaseDlg::startDatabase_Paint | ( | object | sender, | |
| System.Windows.Forms.PaintEventArgs | e | |||
| ) | [inline, private] |
| void NDB_CPC::startDatabaseDlg::startProcesses | ( | ) | [inline, private] |
Definition at line 190 of file startDatabaseDlg.cs.
References NDB_CPC::Computer::connectToCpcd(), NDB_CPC::Computer::isConnected(), p, start(), and NDB_CPC::Computer::startProcess().
00191 { 00192 00193 ArrayList processes = m_db.getProcesses(); 00194 progressBar.Maximum = processes.Count; 00195 progressBar.Minimum = 0; 00196 string start = "start process \n"; 00197 00198 int retry=0; 00199 //sc.connect("130.100.232.7"); 00200 foreach (Process p in processes) 00201 { 00202 Computer comp; 00203 if((p.getName().StartsWith("ndb")) || (p.getName().StartsWith("mgm"))) 00204 { 00205 textAction.Text="Starting process " + p.getName(); 00206 textAction.Refresh(); 00207 start = start + "id:" + p.getId() + "\n\n"; 00208 comp=p.getComputer(); 00209 while(retry<10) 00210 { 00211 if(!comp.isConnected()) 00212 { 00213 comp.connectToCpcd(); 00214 } 00215 else 00216 { 00217 if(comp.startProcess(p)<0) 00218 { 00219 ; 00220 } 00221 else 00222 break; 00223 } 00224 if(retry==9) 00225 { 00226 if(MessageBox.Show(this,"Failed to start process. Retry again?","Warning!!!",MessageBoxButtons.YesNo)==DialogResult.Yes) 00227 retry=0; 00228 } 00229 00230 retry++; 00231 } 00232 } 00233 progressBar.PerformStep(); 00234 00235 } 00236 00237 }
Here is the call graph for this function:

System.Windows.Forms.Button NDB_CPC::startDatabaseDlg::buttonGo [private] |
Definition at line 23 of file startDatabaseDlg.cs.
System.ComponentModel.Container NDB_CPC::startDatabaseDlg::components = null [private] |
Required designer variable.
Definition at line 20 of file startDatabaseDlg.cs.
Referenced by Dispose().
System.Windows.Forms.Label NDB_CPC::startDatabaseDlg::label1 [private] |
Definition at line 16 of file startDatabaseDlg.cs.
System.Windows.Forms.Label NDB_CPC::startDatabaseDlg::label2 [private] |
Definition at line 22 of file startDatabaseDlg.cs.
Database NDB_CPC::startDatabaseDlg::m_db [private] |
System.Windows.Forms.ProgressBar NDB_CPC::startDatabaseDlg::progressBar [private] |
Definition at line 21 of file startDatabaseDlg.cs.
System.Windows.Forms.TextBox NDB_CPC::startDatabaseDlg::textAction [private] |
Definition at line 15 of file startDatabaseDlg.cs.
1.4.7

