private void StartGetTemp() //start getting signal without click { timerDrawTemp.Start(); //start timer TempGraph.f_ClearAllPix(); TempGraph.f_reXY(); TempGraph.f_LoadOnePix(ref x2, ref y2, Color.Red, 2); TempGraph.f_AddPix(ref x3, ref y3, Color.Blue, 2); }
private void StartDraw()//start getting signal without click { TempGraph.f_ClearAllPix(); TempGraph.f_reXY(); TempGraph.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); TempGraph.f_AddPix(ref x_b, ref y_b, Color.Blue, 2); TempGraph.f_AddPix(ref x_p, ref y_p, Color.Green, 2); }
/*******************************************************************************************************************/ private void btnGetAnalogIn_Click(object sender, EventArgs e) //start the timer when click the button { timerDraw.Start(); //start timer Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); Graph1D.f_LoadOnePix(ref x1, ref y1, Color.Red, 2); TempGraph.f_LoadOnePix(ref x2, ref y2, Color.Red, 2); TempGraph.f_AddPix(ref x3, ref y3, Color.Blue, 2); }
private void initial_set_Ports_Low() { for (int i = 0; i < 8; i++) { digitalOutLow(i); } digitalOutLow(10); digitalOutLow(11); digitalOutLow(12); digitalOutLow(13); pumpIndicator.BackColor = Color.Gray;//clear all expected valveIndicator1.BackColor = Color.Gray; preconOnIndicator1.BackColor = Color.Gray; preconHighIndicator1.BackColor = Color.Gray; columnIndicator.BackColor = Color.Gray; valvaIndicator2.BackColor = Color.Gray; preconOnIndicator2.BackColor = Color.Gray; preconHighIndicator2.BackColor = Color.Gray; //TempGraph initial TempGraph.f_ClearAllPix(); TempGraph.f_reXY(); TempGraph.f_LoadOnePix(ref x2, ref y2, Color.Red, 2); TempGraph.f_AddPix(ref x3, ref y3, Color.Blue, 2); }
private void overallStart_Click(object sender, EventArgs e) { x1.Clear(); x2.Clear(); x3.Clear(); x4.Clear(); y1.Clear(); y2.Clear(); y3.Clear(); y4.Clear(); initial_set_Ports_Low(); DrawSingalIndex = 0; DrawTempIndex = 0; SignalOnFlag = 0; heartcuttingNumber = 0; heartcuttingflag = 0; Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); timerMenu.Start(); StartGetTemp(); startTime = System.DateTime.Now; //ports control pumpingTvalue = float.Parse(pumpingTime.Text); //s waitingTvalue = float.Parse(waitingTime.Text); //s preconHighTvalue = float.Parse(preconHighTime.Text); //s preconLowTvalue = float.Parse(preconLowTime.Text); //s lowestTempvalue = float.Parse(lowestTemp.Text); //C lowestTvalue = float.Parse(lowestHold.Text) * 60; //s HighestTempvalue = float.Parse(highestTemp.Text); //C HighestTvalue = float.Parse(highestHold.Text) * 60; //s RampSpeedvalue = float.Parse(rampSpeed.Text) / 60; //c/s analysisTotalT = lowestTvalue + HighestTvalue + (HighestTempvalue - lowestTempvalue) / RampSpeedvalue; //s cleaningPvalue = float.Parse(cleaningPreconTime.Text); //s cleaningTvalue = float.Parse(cleaningTotalTime.Text) * 60; //s if (Start1.Text != "" && End1.Text != "") { if (float.Parse(Start1.Text) > float.Parse(End1.Text)) { EndBeforeStartError(); } else { heartcuttingStartList[1] = float.Parse(Start1.Text); //s heartcuttingEndList[1] = float.Parse(End1.Text); //s heartcuttingNumber++; } } if (Start2.Text != "" && End2.Text != "") { if (float.Parse(Start2.Text) > float.Parse(End2.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 1) { EmptyBetweenError(); } else if (float.Parse(Start2.Text) < heartcuttingEndList[1] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[2] = float.Parse(Start2.Text); //s heartcuttingEndList[2] = float.Parse(End2.Text); //s heartcuttingNumber++; } } if (Start3.Text != "" && End3.Text != "") { if (float.Parse(Start3.Text) > float.Parse(End3.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 2) { EmptyBetweenError(); } else if (float.Parse(Start3.Text) < heartcuttingEndList[2] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[3] = float.Parse(Start3.Text); //s heartcuttingEndList[3] = float.Parse(End3.Text); //s heartcuttingNumber++; } } if (Start4.Text != "" && End4.Text != "") { if (float.Parse(Start4.Text) > float.Parse(End4.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 3) { EmptyBetweenError(); } else if (float.Parse(Start4.Text) < heartcuttingEndList[3] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[4] = float.Parse(Start4.Text); //s heartcuttingEndList[4] = float.Parse(End4.Text); //s heartcuttingNumber++; } } if (Start5.Text != "" && End5.Text != "") { if (float.Parse(Start5.Text) > float.Parse(End5.Text)) { EndBeforeStartError(); } else if (heartcuttingNumber != 4) { EmptyBetweenError(); } else if (float.Parse(Start5.Text) < heartcuttingEndList[4] + preconHighTvalue + preconLowTvalue) { TooCloseError(); } else { heartcuttingStartList[5] = float.Parse(Start5.Text); //s heartcuttingEndList[5] = float.Parse(End5.Text); //s heartcuttingNumber++; } } if (ExperienceName.Text == "") { timerMenu.Stop(); timerDrawSignal.Stop(); timerDrawTemp.Stop(); MessageBox.Show("Experience Name cannot be empty.", "Heartcutting Input Error"); } else { ExperienceNamevalue = ExperienceName.Text; file = new System.IO.StreamWriter(@"C:\Users\Nanova\Documents\Software\GC\c#\TestOutputs\" + ExperienceNamevalue + ".dat"); } }
/*******************************************************************************************************************/ private void overallStart_Click(object sender, EventArgs e) { x1.Clear(); x2.Clear(); x3.Clear(); y1.Clear(); y2.Clear(); y3.Clear(); initial_set_Ports_Low(); DrawSingalIndex = 0; DrawTempIndex = 0; SignalOnFlag = 0; heartcuttingNumber = 0; Graph1D.f_ClearAllPix(); TempGraph.f_ClearAllPix(); Graph1D.f_reXY(); TempGraph.f_reXY(); timerMenu.Start(); StartGetTemp(); startTime = System.DateTime.Now; //ports control pumpingTvalue = float.Parse(pumpingTime.Text); //s waitingTvalue = float.Parse(waitingTime.Text); //s preconHighTvalue = float.Parse(preconHighTime.Text); //s preconLowTvalue = float.Parse(preconLowTime.Text); //s lowestTempvalue = float.Parse(lowestTemp.Text); //C lowestTvalue = float.Parse(lowestHold.Text) * 60; //s HighestTempvalue = float.Parse(highestTemp.Text); //C HighestTvalue = float.Parse(highestHold.Text) * 60; //s RampSpeedvalue = float.Parse(rampSpeed.Text) / 60; //c/s analysisTotalT = lowestTvalue + HighestTvalue + (HighestTempvalue - lowestTempvalue) / RampSpeedvalue; //s cleaningPvalue = float.Parse(cleaningPreconTime.Text); //s cleaningTvalue = float.Parse(cleaningTotalTime.Text) * 60; //s if (Start1.Text != "" && float.Parse(Start1.Text) < float.Parse(End1.Text)) { heartcuttingStartList[1] = float.Parse(Start1.Text); //s heartcuttingEndList[1] = float.Parse(End1.Text); //s heartcuttingNumber++; } if (Start2.Text != "" && float.Parse(Start2.Text) > heartcuttingEndList[1] && float.Parse(Start2.Text) < float.Parse(End2.Text)) { heartcuttingStartList[2] = float.Parse(Start2.Text); //s heartcuttingEndList[2] = float.Parse(End2.Text); //s heartcuttingNumber++; } if (Start3.Text != "" && float.Parse(Start3.Text) > heartcuttingEndList[2] && float.Parse(Start3.Text) < float.Parse(End3.Text)) { heartcuttingStartList[3] = float.Parse(Start3.Text); //s heartcuttingEndList[3] = float.Parse(End3.Text); //s heartcuttingNumber++; } if (Start4.Text != "" && float.Parse(Start4.Text) > heartcuttingEndList[3] && float.Parse(Start4.Text) < float.Parse(End4.Text)) { heartcuttingStartList[4] = float.Parse(Start4.Text); //s heartcuttingEndList[4] = float.Parse(End4.Text); //s heartcuttingNumber++; } if (Start5.Text != "" && float.Parse(Start5.Text) > heartcuttingEndList[4] && float.Parse(Start5.Text) < float.Parse(End5.Text)) { heartcuttingStartList[5] = float.Parse(Start5.Text); //s heartcuttingEndList[5] = float.Parse(End5.Text); //s heartcuttingNumber++; } }