Skip to content

Commit 8c2e4f3

Browse files
#TDP - 3 Fixed bug with time
1 parent fa18455 commit 8c2e4f3

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

ModelingWorkMachineWithBreakdowns/ModelingWorkForm.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ System::Void ModelingWorkMachineWithBreakdowns::ModelingWorkForm::Btn_execution_
7878
double totalTimeWorkMachine = 0;
7979
int countBrokenDetails = 0;
8080
double totalTimeRepair = 0;
81+
double totalTimeWait = 0;
8182
while (countDetails > 0)
8283
{
8384
if (timeBeforeNextTask > 0)
8485
{
85-
totalTimeWorkMachine += timeBeforeNextTask; //äîáàâëÿåì âðåìÿ îæèäàíèÿ çàäàíèÿ
86+
//totalTimeWorkMachine += timeBeforeNextTask; //äîáàâëÿåì âðåìÿ îæèäàíèÿ çàäàíèÿ
8687
timeBeforeNextTask = 0;
8788
}
8889

@@ -101,11 +102,12 @@ System::Void ModelingWorkMachineWithBreakdowns::ModelingWorkForm::Btn_execution_
101102
else
102103
{
103104
countBrokenDetails++;
104-
totalTimeWorkMachine += timeBeforeBreakdownMachine; //îáùåå âðåìÿ ðàáîòû ñòàíêà + âðåìÿ ïðîñòîÿ
105+
totalTimeWait += timeBeforeBreakdownMachine;
106+
//totalTimeWorkMachine += timeBeforeBreakdownMachine; //îáùåå âðåìÿ ðàáîòû ñòàíêà + âðåìÿ ïðîñòîÿ
105107
timeBeforeNextTask -= timeBeforeBreakdownMachine;
106108
double repairTime = getTimeRepair(timeTroubleshootinFrom, timeTroubleshootinTo);
107109
//cout repairTime
108-
totalTimeWorkMachine += repairTime;
110+
//totalTimeWorkMachine += repairTime;
109111
timeBeforeNextTask -= repairTime;
110112
timeBeforeBreakdownMachine = getTimeBeforeBreakdownMachine(timeBreakDown_M_X, timeBreakdown_StandartDeviation);
111113
totalTimeRepair += repairTime;
@@ -121,9 +123,10 @@ System::Void ModelingWorkMachineWithBreakdowns::ModelingWorkForm::Btn_execution_
121123

122124
lbl_countTask->Text = "Êîëè÷åñòâî äåòàëåé: " + allDetails.ToString();
123125
lbl_CountBreakdown->Text = "Êîëè÷åñòâî ïîëîìîê: " + countBrokenDetails.ToString();
124-
lbl_TimeWork->Text = "Âðåìÿ ðàáîòû: " + (static_cast<int>(totalTimeWorkMachine)).ToString() +" ÷. " + (static_cast<int>((int)totalTimeWorkMachine % 1 * 60)).ToString() +" ìèí.";
126+
lbl_TimeWork->Text = "Âðåìÿ ðàáîòû ñòàíêà: " + (static_cast<int>(totalTimeWorkMachine)).ToString() +" ÷. " + (static_cast<int>((int)totalTimeWorkMachine % 1 * 60)).ToString() +" ìèí.";
125127
lbl_DetailInQueue->Text = "Äåòàëåé â î÷åðåäè: " + countDetailInQueue.ToString();
126128
lbl_TotalTimeRepair->Text = "Îáùåå âðåìÿ ðåìîíòà: " + (static_cast<int>(totalTimeRepair)).ToString() + " ÷. " + (static_cast<int>((int)totalTimeRepair % 1 * 60)).ToString() + " ìèí.";
129+
lbl_totaltimeWait->Text = "Îáùåå âðåìÿ ïðîñòîÿ: " + (static_cast<int>(totalTimeWait)).ToString() + " ÷. " + (static_cast<int>((int)totalTimeWait % 1 * 60)).ToString() + " ìèí.";
127130
//return brokenDetails,totalTimeWorkMachine, totalTimeWorkMachine/allDetails,countDetailInQueue,
128131
}
129132

ModelingWorkMachineWithBreakdowns/ModelingWorkForm.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ namespace ModelingWorkMachineWithBreakdowns {
5555
private: System::Windows::Forms::Label^ lbl_TimeWork;
5656
private: System::Windows::Forms::Label^ lbl_DetailInQueue;
5757
private: System::Windows::Forms::Label^ lbl_TotalTimeRepair;
58+
private: System::Windows::Forms::Label^ lbl_totaltimeWait;
5859

5960

6061

@@ -94,6 +95,7 @@ namespace ModelingWorkMachineWithBreakdowns {
9495
this->lbl_TimeWork = (gcnew System::Windows::Forms::Label());
9596
this->lbl_DetailInQueue = (gcnew System::Windows::Forms::Label());
9697
this->lbl_TotalTimeRepair = (gcnew System::Windows::Forms::Label());
98+
this->lbl_totaltimeWait = (gcnew System::Windows::Forms::Label());
9799
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->numericUpDown1))->BeginInit();
98100
this->SuspendLayout();
99101
//
@@ -308,11 +310,21 @@ namespace ModelingWorkMachineWithBreakdowns {
308310
this->lbl_TotalTimeRepair->TabIndex = 19;
309311
this->lbl_TotalTimeRepair->Text = L"label_answer";
310312
//
313+
// lbl_totaltimeWait
314+
//
315+
this->lbl_totaltimeWait->AutoSize = true;
316+
this->lbl_totaltimeWait->Location = System::Drawing::Point(12, 387);
317+
this->lbl_totaltimeWait->Name = L"lbl_totaltimeWait";
318+
this->lbl_totaltimeWait->Size = System::Drawing::Size(69, 13);
319+
this->lbl_totaltimeWait->TabIndex = 20;
320+
this->lbl_totaltimeWait->Text = L"label_answer";
321+
//
311322
// ModelingWorkForm
312323
//
313324
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
314325
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
315326
this->ClientSize = System::Drawing::Size(628, 409);
327+
this->Controls->Add(this->lbl_totaltimeWait);
316328
this->Controls->Add(this->lbl_TotalTimeRepair);
317329
this->Controls->Add(this->lbl_DetailInQueue);
318330
this->Controls->Add(this->lbl_TimeWork);

0 commit comments

Comments
 (0)