git-svn-id: file:///srv/dev-disk-by-uuid-17e88007-4d0c-45e0-8757-cacfcc458630/repositories/svn/Diplomarbeit@138 9fe90eed-be63-e94b-8204-d34ff4c2ff93
This commit is contained in:
Matthias
2009-03-17 12:45:50 +00:00
parent 841ad4e7b0
commit b32b2bd87b
11 changed files with 1501 additions and 305 deletions
Binary file not shown.
@@ -40,6 +40,18 @@ namespace QUA_2475_designtest
{ {
public partial class mainWindow public partial class mainWindow
{ {
private void remoteRTCset()
{
string sendString;
sendString = String.Format("setrtc 2 {0} {1}\r", DateTime.Now.ToString("MMddHHmm"), DateTime.Now.ToString("yyyy"));
com1.Write(sendString);
}
private void calibrateAnalogue()
{
com1.Write("cslave 4\r");
}
private void T_MasterInput_TextChanged(object sender, EventArgs e) private void T_MasterInput_TextChanged(object sender, EventArgs e)
@@ -81,26 +93,39 @@ namespace QUA_2475_designtest
else else
{ {
/* Calling Function is in same Thread */ /* Calling Function is in same Thread */
try
/* Search for Text fragments in Input String */
if (text.LastIndexOf("test: PASSED") != -1)
{ {
/* "test: PASSED" indecates that Device successfully /* Search for Text fragments in Input String */
if (text.LastIndexOf("PASSED") != -1)
{
/* "PASSED" indecates that Device successfully
* finished a Test Script or Routine * finished a Test Script or Routine
*/ */
activeTest = false; activeTest = false;
TestResult[actualTest] = true; TestResult[actualTest] = true;
TestIsPassed(actualTest); TestIsPassed(actualTest);
} }
if (text.LastIndexOf("test: FAILED") != -1) if (text.LastIndexOf("FAILED") != -1)
{ {
/* "test: FAILED" indecates that Device finished /* "FAILED" indecates that Device finished
* a Test Script or Routine with Errors * a Test Script or Routine with Errors
*/ */
activeTest = false; activeTest = false;
TestResult[actualTest] = false; TestResult[actualTest] = false;
TestIsFailed(actualTest); TestIsFailed(actualTest);
} }
if (text.LastIndexOf("CALIBRATION PART FINISHED") != -1)
{
activeTest = false;
TestResult[actualTest] = true;
CalibrationFinished();
}
}
catch
{
activeTest = false;
}
} }
} }
@@ -160,9 +185,9 @@ namespace QUA_2475_designtest
* corresponding Test and send the String afterwards * corresponding Test and send the String afterwards
* to CehckForKeyword to find specific Keyword * to CehckForKeyword to find specific Keyword
*/ */
CheckForSlaveKeyword(new string(buffer)); // CheckForSlaveKeyword(new string(buffer));
//TestMessage[actualTest] += new string(buffer); TestMessage[actualTest] += new string(buffer);
//CheckForSlaveKeyword(TestMessage[actualTest]); CheckForSlaveKeyword(TestMessage[actualTest]);
} }
nrOfBytes = com1.BytesToRead; /* Actualise Inputlength*/ nrOfBytes = com1.BytesToRead; /* Actualise Inputlength*/
} }
@@ -50,7 +50,7 @@ namespace QUA_2475_designtest
Thread TestTimeoutThread; /* Test Timeout Thread */ Thread TestTimeoutThread; /* Test Timeout Thread */
/* INTEGER DEFINITION */ /* INTEGER DEFINITION */
const int NrOfTests = 15; /* Indicates number of single Test */ const int NrOfTests = 23; /* Indicates number of single Test */
uint actualTest = 0; /* Indicates number of actual Test */ uint actualTest = 0; /* Indicates number of actual Test */
uint TotalTestNumber = 1; /* Number of total Tests */ uint TotalTestNumber = 1; /* Number of total Tests */
uint TotalPassedNumber = 1; /* Number of passed Tests */ uint TotalPassedNumber = 1; /* Number of passed Tests */
@@ -61,6 +61,10 @@ namespace QUA_2475_designtest
private bool Master_receiveMessages = true; /* Allow COM2 to read */ private bool Master_receiveMessages = true; /* Allow COM2 to read */
private bool activeTest = false; /* Indicates an active Test */ private bool activeTest = false; /* Indicates an active Test */
private bool activeAutomatictest = false; /* autoTest is active */ private bool activeAutomatictest = false; /* autoTest is active */
private bool AllTestResult; /* Shows the autoTest Result */
private bool setRTC = false;
/* ARRAY DEFINITION */ /* ARRAY DEFINITION */
/* Array of all available Textboxes for Tests */ /* Array of all available Textboxes for Tests */
@@ -71,6 +75,10 @@ namespace QUA_2475_designtest
public string[] Testfiles = new string[NrOfTests]; public string[] Testfiles = new string[NrOfTests];
/* Array to contain each Test Result */ /* Array to contain each Test Result */
public bool[] TestResult = new bool[NrOfTests]; public bool[] TestResult = new bool[NrOfTests];
/* Array to enable individual tests */
public bool[] ActivateTest = new bool[NrOfTests];
/* Array for all test messages of single Test */
public string[] TestMessage = new String[NrOfTests];
private string MasterInputString; /* bound to T_MasterInput */ private string MasterInputString; /* bound to T_MasterInput */
@@ -81,45 +89,58 @@ namespace QUA_2475_designtest
*/ */
public enum TestType public enum TestType
{ {
MB_LED = 0, VCC = 0,
MB_EEPROM = 1, VDDAT = 1,
ETH1 = 2, VBAT = 2,
ETH0 = 3, VCORE = 3,
CF = 4, TEMP = 4,
USB = 5, REVNUM = 5,
MB_DIO = 6, LED_MB = 6,
MB_AIO = 7, EEPROM_MB = 7,
MB_RLY = 8, ETH0 = 8,
CAN = 9, ETH1 = 9,
EB_LED = 10, USB = 10,
EB_EEPROM = 11, DIO_MB = 11,
EB_DIO = 12, AIO_MB = 12,
EB_AIO = 13, RLY_MB = 13,
EB_RLY = 14 LED_EB = 14,
EEPROM_EB = 15,
DIO_EB = 16,
AIO_EB = 17,
RLY_EB = 18,
CAL_AOMB = 19,
CAL_AIMB = 20,
CAL_AOEB = 21,
CAL_AIEB = 22
}; };
public void initialise() public void initialise()
{ {
com1.PortName = "COM1"; /* Bind com1 to COM1 */ com1.PortName = "COM9"; /* Bind com1 to COM1 */
com1.Open(); /* Open com1 */ com1.Open(); /* Open com1 */
com1.BaudRate = 115200; /* Set com1 Baudrate */ com1.BaudRate = 115200; /* Set com1 Baudrate */
/* Capture corresponding Textboxes to TextBox Array */ /* Capture corresponding Textboxes to TextBox Array */
TestTextBoxes[(int)TestType.MB_LED] = T_test_MB_LED; TestTextBoxes[(int)TestType.VCC] = T_test_VCC;
TestTextBoxes[(int)TestType.MB_EEPROM] = T_test_MB_EEPROM; TestTextBoxes[(int)TestType.VDDAT] = T_test_VDDAT;
TestTextBoxes[(int)TestType.ETH1] = T_test_eth1; TestTextBoxes[(int)TestType.VBAT] = T_test_VBAT;
TestTextBoxes[(int)TestType.VCORE] = T_test_VCORE;
TestTextBoxes[(int)TestType.TEMP] = T_test_TEMP;
TestTextBoxes[(int)TestType.REVNUM] = T_test_REVNUM;
TestTextBoxes[(int)TestType.LED_MB] = T_test_MB_LED;
TestTextBoxes[(int)TestType.EEPROM_MB] = T_test_MB_EEPROM;
TestTextBoxes[(int)TestType.ETH0] = T_test_eth0; TestTextBoxes[(int)TestType.ETH0] = T_test_eth0;
TestTextBoxes[(int)TestType.CF] = T_test_CF; TestTextBoxes[(int)TestType.ETH1] = T_test_eth1;
TestTextBoxes[(int)TestType.USB] = T_test_USB; TestTextBoxes[(int)TestType.USB] = T_test_USB;
TestTextBoxes[(int)TestType.MB_DIO] = T_test_MB_DIO; TestTextBoxes[(int)TestType.DIO_MB] = T_test_MB_DIO;
TestTextBoxes[(int)TestType.MB_AIO] = T_test_MB_AIO; TestTextBoxes[(int)TestType.AIO_MB] = T_test_MB_AIO;
TestTextBoxes[(int)TestType.MB_RLY] = T_test_MB_RLY; TestTextBoxes[(int)TestType.RLY_MB] = T_test_MB_RLY;
TestTextBoxes[(int)TestType.CAN] = T_test_CAN; TestTextBoxes[(int)TestType.LED_EB] = T_test_EB_LED;
TestTextBoxes[(int)TestType.EB_LED] = T_test_EB_LED; TestTextBoxes[(int)TestType.EEPROM_EB] = T_test_EB_EEPROM;
TestTextBoxes[(int)TestType.EB_EEPROM] = T_test_EB_EEPROM; TestTextBoxes[(int)TestType.DIO_EB] = T_test_EB_DIO;
TestTextBoxes[(int)TestType.EB_DIO] = T_test_EB_DIO; TestTextBoxes[(int)TestType.AIO_EB] = T_test_EB_AIO;
TestTextBoxes[(int)TestType.EB_AIO] = T_test_EB_AIO; TestTextBoxes[(int)TestType.RLY_EB] = T_test_EB_RLY;
TestTextBoxes[(int)TestType.EB_RLY] = T_test_EB_RLY;
/* Reset all Test Results */ /* Reset all Test Results */
TestResult[0] = false; TestResult[0] = false;
@@ -137,28 +158,48 @@ namespace QUA_2475_designtest
TestResult[12] = false; TestResult[12] = false;
TestResult[13] = false; TestResult[13] = false;
TestResult[14] = false; TestResult[14] = false;
TestResult[15] = false;
TestResult[16] = false;
TestResult[17] = false;
TestResult[18] = false;
TestResult[19] = false;
TestResult[20] = false;
TestResult[21] = false;
TestResult[22] = false;
/* Define Commands (path and filename) for test-script calls */ /* Define Commands (path and filename) for test-script calls */
TestCallCommands[0] = "ledtest 2\r"; TestCallCommands[0] = "test_vcc 2\r";
TestCallCommands[1] = "eeprom 2\r"; TestCallCommands[1] = "test_vddat 2\r";
TestCallCommands[2] = "\r"; TestCallCommands[2] = "test_vbat 2\r";
TestCallCommands[3] = "\r"; TestCallCommands[3] = "test_vcore 2\r";
TestCallCommands[4] = "\r"; TestCallCommands[4] = "test_temp 2\r";
TestCallCommands[5] = "\r"; TestCallCommands[5] = "test_revnum 2\r";
TestCallCommands[6] = "dio 2\r"; TestCallCommands[6] = "test_led 2 0\r";
TestCallCommands[7] = "\r"; TestCallCommands[7] = "test_eeprom 2 0\r";
TestCallCommands[8] = "\r"; TestCallCommands[8] = "test_eth 2 0\r";
TestCallCommands[9] = "\r"; TestCallCommands[9] = "test_eth 2 1\r";
TestCallCommands[10] = "\r"; TestCallCommands[10] = "test_usb 2\r";
TestCallCommands[11] = "\r"; TestCallCommands[11] = "test_dio 2 0\r";
TestCallCommands[12] = "\r"; TestCallCommands[12] = "test_aio 2 0\r";
TestCallCommands[13] = "\r"; TestCallCommands[13] = "test_rly 2 0\r";
TestCallCommands[14] = "\r"; TestCallCommands[14] = "test_led 2 1\r";
TestCallCommands[15] = "test_eeprom 2 1\r";
TestCallCommands[16] = "test_dio 2 1\r";
TestCallCommands[17] = "test_aio 2 1\r";
TestCallCommands[18] = "test_rly 2 1\r";
TestCallCommands[19] = "cslave 0\r";
TestCallCommands[20] = "cslave 1\r";
TestCallCommands[21] = "cslave 2\r";
TestCallCommands[22] = "cslave 3\r";
/* Define and start com1 reading Thread */ /* Define and start com1 reading Thread */
com1GetMessage = new Thread(new ThreadStart(com1_DataReceived)); com1GetMessage = new Thread(new ThreadStart(com1_DataReceived));
com1GetMessage.Start(); com1GetMessage.Start();
} }
} }
} }
File diff suppressed because it is too large Load Diff
@@ -61,17 +61,11 @@ namespace QUA_2475_designtest
*/ */
private void TimeoutThread() private void TimeoutThread()
{ {
Thread.Sleep(20000); Thread.Sleep(100000);
if (activeTest == true) if (activeTest == true)
{ {
TestIsTimeout(actualTest); TestIsTimeout(actualTest);
} }
} }
private void B_conf_removeMB_Click(object sender, EventArgs e)
{
}
} }
} }
@@ -40,49 +40,147 @@ namespace QUA_2475_designtest
{ {
public partial class mainWindow public partial class mainWindow
{ {
private void increment_passed()
{
/* If called, increment the TestPassed counter */
L_stats_numberpassed.Text = Convert.ToString(TotalPassedNumber++);
}
private void increment_failed()
{
/* If called, increment the TestFailed counter */
L_stats_numberfailed.Text = Convert.ToString(TotalFailedNumber++);
}
private void TestIsUntested(System.UInt32 TestID) private void TestIsUntested(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Resets the to the parameter corresponding Textbox */ /* Resets the to the parameter corresponding Textbox */
TestTextBoxes[TestID].Text = "untested"; TestTextBoxes[TestID].Text = "untested";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.White; TestTextBoxes[TestID].BackColor = System.Drawing.Color.White;
} }
}
private void TestIsActive(System.UInt32 TestID) private void TestIsActive(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Sets status of the corresponding TextBox to active */ /* Sets status of the corresponding TextBox to active */
TestTextBoxes[TestID].Text = "Active"; TestTextBoxes[TestID].Text = "Active";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.Yellow; TestTextBoxes[TestID].BackColor = System.Drawing.Color.Yellow;
} }
}
private void CalibrationFinished()
{
MessageBox.Show("Calibration Finished");
TestTimeoutThread.Abort(); /* Abort Timeout Thread */
globalActivities(true);
/* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true)
{
automaticTest();
}
}
private void TestIsCanceled(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{
/* Sets status of the corresponding TextBox to active */
TestTextBoxes[TestID].Text = "Canceled";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.DarkOrange;
globalActivities(true);
}
}
private void TestIsPassed(System.UInt32 TestID) private void TestIsPassed(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Sets status of the corresponding TextBox to a passed test */ /* Sets status of the corresponding TextBox to a passed test */
TestTimeoutThread.Abort(); /* Abort Timeout Thread */ TestTimeoutThread.Abort(); /* Abort Timeout Thread */
TestTextBoxes[TestID].Text = "Passed"; TestTextBoxes[TestID].Text = "Passed";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.Green; TestTextBoxes[TestID].BackColor = System.Drawing.Color.Green;
globalActivities(true);
/* If Test was called by automatic test routine, go back there */ /* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true) if (activeAutomatictest == true)
{ {
//automaticTest(); automaticTest();
}
} }
} }
private void TestIsFailed(System.UInt32 TestID) private void TestIsFailed(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Sets status of the corresponding TextBox to a failed test */ /* Sets status of the corresponding TextBox to a failed test */
TestTimeoutThread.Abort(); /* Abort Timeout Thread */ TestTimeoutThread.Abort(); /* Abort Timeout Thread */
TestTextBoxes[TestID].Text = "Failed"; TestTextBoxes[TestID].Text = "Failed";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.Red; TestTextBoxes[TestID].BackColor = System.Drawing.Color.Red;
globalActivities(true);
/* If Test was called by automatic test routine, go back there */ /* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true) if (activeAutomatictest == true)
{ {
//automaticTest(); automaticTest();
}
}
}
private void TestIsSkipped(System.UInt32 TestID)
{
if (TestID > 18)
{
TestResult[TestID] = true;
/* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true)
{
automaticTest();
}
}
else
{
/* Sets status of the corresponding TextBox to a passed test */
TestTextBoxes[TestID].Text = "skipped";
TestTextBoxes[TestID].BackColor = System.Drawing.Color.CornflowerBlue;
TestResult[TestID] = true;
/* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true)
{
automaticTest();
}
} }
} }
private void TestIsUnavailable(System.UInt32 TestID) private void TestIsUnavailable(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Sets status of the corresponding TextBox to unreachable test */ /* Sets status of the corresponding TextBox to unreachable test */
TestTimeoutThread.Abort(); /* Abort Timeout Thread */ TestTimeoutThread.Abort(); /* Abort Timeout Thread */
@@ -92,12 +190,18 @@ namespace QUA_2475_designtest
/* If Test was called by automatic test routine, go back there */ /* If Test was called by automatic test routine, go back there */
if (activeAutomatictest == true) if (activeAutomatictest == true)
{ {
//automaticTest(); automaticTest();
}
} }
} }
delegate void TestIsTimeoutCallback(System.UInt32 TestID); delegate void TestIsTimeoutCallback(System.UInt32 TestID);
private void TestIsTimeout(System.UInt32 TestID) private void TestIsTimeout(System.UInt32 TestID)
{
if (TestID > 18)
{
}
else
{ {
/* Check if Application is called from a subThread */ /* Check if Application is called from a subThread */
if (this.TestTextBoxes[TestID].InvokeRequired) if (this.TestTextBoxes[TestID].InvokeRequired)
@@ -116,21 +220,287 @@ namespace QUA_2475_designtest
/* If Test was called by automatic test routine, go there */ /* If Test was called by automatic test routine, go there */
if (activeAutomatictest == true) if (activeAutomatictest == true)
{ {
//automaticTest(); automaticTest();
} }
} }
} }
}
private void C_test_VCC_CheckedChanged(object sender, EventArgs e)
{
if (C_test_VCC.Checked == true)
{
ActivateTest[(int)TestType.VCC] = true;
}
else
{
ActivateTest[(int)TestType.VCC] = false;
}
}
private void C_test_VDDAT_CheckedChanged(object sender, EventArgs e)
{
if (C_test_VDDAT.Checked == true)
{
ActivateTest[(int)TestType.VDDAT] = true;
}
else
{
ActivateTest[(int)TestType.VDDAT] = false;
}
}
private void C_test_VBAT_CheckedChanged(object sender, EventArgs e)
{
if (C_test_VBAT.Checked == true)
{
ActivateTest[(int)TestType.VBAT] = true;
}
else
{
ActivateTest[(int)TestType.VBAT] = false;
}
}
private void C_test_VCORE_CheckedChanged(object sender, EventArgs e)
{
if (C_test_VCORE.Checked == true)
{
ActivateTest[(int)TestType.VCORE] = true;
}
else
{
ActivateTest[(int)TestType.VCORE] = false;
}
}
private void C_test_TEMP_CheckedChanged(object sender, EventArgs e)
{
if (C_test_TEMP.Checked == true)
{
ActivateTest[(int)TestType.TEMP] = true;
}
else
{
ActivateTest[(int)TestType.TEMP] = false;
}
}
private void C_test_REVNUM_CheckedChanged(object sender, EventArgs e)
{
if (C_test_REVNUM.Checked == true)
{
ActivateTest[(int)TestType.REVNUM] = true;
}
else
{
ActivateTest[(int)TestType.REVNUM] = false;
}
}
private void C_test_MB_LED_CheckedChanged(object sender, EventArgs e)
{
if (C_test_MB_LED.Checked == true)
{
ActivateTest[(int)TestType.LED_MB] = true;
}
else
{
ActivateTest[(int)TestType.LED_MB] = false;
}
}
private void C_test_MB_EEPROM_CheckedChanged(object sender, EventArgs e)
{
if (C_test_MB_EEPROM.Checked == true)
{
ActivateTest[(int)TestType.EEPROM_MB] = true;
}
else
{
ActivateTest[(int)TestType.EEPROM_MB] = false;
}
}
private void C_test_eth0_CheckedChanged(object sender, EventArgs e)
{
if (C_test_eth0.Checked == true)
{
ActivateTest[(int)TestType.ETH0] = true;
}
else
{
ActivateTest[(int)TestType.ETH0] = false;
}
}
private void C_test_eth1_CheckedChanged(object sender, EventArgs e)
{
if (C_test_eth1.Checked == true)
{
ActivateTest[(int)TestType.ETH1] = true;
}
else
{
ActivateTest[(int)TestType.ETH1] = false;
}
}
private void C_test_USB_CheckedChanged(object sender, EventArgs e)
{
if (C_test_USB.Checked == true)
{
ActivateTest[(int)TestType.USB] = true;
}
else
{
ActivateTest[(int)TestType.USB] = false;
}
}
private void C_test_MB_DIO_CheckedChanged(object sender, EventArgs e)
{
if (C_test_MB_DIO.Checked == true)
{
ActivateTest[(int)TestType.DIO_MB] = true;
}
else
{
ActivateTest[(int)TestType.DIO_MB] = false;
}
}
private void C_test_MB_AIO_CheckedChanged(object sender, EventArgs e)
{
if (C_test_MB_AIO.Checked == true)
{
ActivateTest[(int)TestType.AIO_MB] = true;
}
else
{
ActivateTest[(int)TestType.AIO_MB] = false;
}
}
private void C_test_MB_RLY_CheckedChanged(object sender, EventArgs e)
{
if (C_test_MB_RLY.Checked == true)
{
ActivateTest[(int)TestType.RLY_MB] = true;
}
else
{
ActivateTest[(int)TestType.RLY_MB] = false;
}
}
private void C_test_EB_LED_CheckedChanged(object sender, EventArgs e)
{
if (C_test_EB_LED.Checked == true)
{
ActivateTest[(int)TestType.LED_EB] = true;
}
else
{
ActivateTest[(int)TestType.LED_EB] = false;
}
}
private void C_test_EB_EEPROM_CheckedChanged(object sender, EventArgs e)
{
if (C_test_EB_EEPROM.Checked == true)
{
ActivateTest[(int)TestType.EEPROM_EB] = true;
}
else
{
ActivateTest[(int)TestType.EEPROM_EB] = false;
}
}
private void C_test_EB_DIO_CheckedChanged(object sender, EventArgs e)
{
if (C_test_EB_DIO.Checked == true)
{
ActivateTest[(int)TestType.DIO_EB] = true;
}
else
{
ActivateTest[(int)TestType.DIO_EB] = false;
}
}
private void C_test_EB_AIO_CheckedChanged(object sender, EventArgs e)
{
if (C_test_EB_AIO.Checked == true)
{
ActivateTest[(int)TestType.AIO_EB] = true;
}
else
{
ActivateTest[(int)TestType.AIO_EB] = false;
}
}
private void C_test_EB_RLY_CheckedChanged(object sender, EventArgs e)
{
if (C_test_EB_RLY.Checked == true)
{
ActivateTest[(int)TestType.RLY_EB] = true;
}
else
{
ActivateTest[(int)TestType.RLY_EB] = false;
}
}
private void B_test_VCC_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.VCC);
}
private void B_test_VDDAT_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.VDDAT);
}
private void B_test_VBAT_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.VBAT);
}
private void B_test_VCORE_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.VCORE);
}
private void B_test_TEMP_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.TEMP);
}
private void B_test_REVNUM_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.REVNUM);
}
private void B_test_MB_LED_Click(object sender, EventArgs e) private void B_test_MB_LED_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.MB_LED); CallTestRoutine((int)TestType.LED_MB);
} }
private void B_test_MB_EEPROM_Click(object sender, EventArgs e) private void B_test_MB_EEPROM_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.MB_EEPROM); CallTestRoutine((int)TestType.EEPROM_MB);
} }
private void B_test_eth0_Click(object sender, EventArgs e) private void B_test_eth0_Click(object sender, EventArgs e)
@@ -145,12 +515,6 @@ namespace QUA_2475_designtest
CallTestRoutine((int)TestType.ETH1); CallTestRoutine((int)TestType.ETH1);
} }
private void B_test_CF_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.CF);
}
private void B_test_USB_Click(object sender, EventArgs e) private void B_test_USB_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
@@ -160,55 +524,70 @@ namespace QUA_2475_designtest
private void B_test_MB_DIO_Click(object sender, EventArgs e) private void B_test_MB_DIO_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.MB_DIO); CallTestRoutine((int)TestType.DIO_MB);
} }
private void B_test_MB_AIO_Click(object sender, EventArgs e) private void B_test_MB_AIO_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.MB_AIO); CallTestRoutine((int)TestType.AIO_MB);
} }
private void B_test_MB_RLY_Click(object sender, EventArgs e) private void B_test_MB_RLY_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.MB_RLY); CallTestRoutine((int)TestType.RLY_MB);
}
private void B_test_CAN_Click(object sender, EventArgs e)
{
/* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.CAN);
} }
private void B_test_EB_LED_Click(object sender, EventArgs e) private void B_test_EB_LED_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.EB_LED); CallTestRoutine((int)TestType.LED_EB);
} }
private void B_test_EB_EEPROM_Click(object sender, EventArgs e) private void B_test_EB_EEPROM_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.EB_EEPROM); CallTestRoutine((int)TestType.EEPROM_EB);
} }
private void B_test_EB_DIO_Click(object sender, EventArgs e) private void B_test_EB_DIO_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.EB_DIO); CallTestRoutine((int)TestType.DIO_EB);
} }
private void B_test_EB_AIO_Click(object sender, EventArgs e) private void B_test_EB_AIO_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.EB_AIO); CallTestRoutine((int)TestType.AIO_EB);
} }
private void B_test_EB_RLY_Click(object sender, EventArgs e) private void B_test_EB_RLY_Click(object sender, EventArgs e)
{ {
/* CallTestRoutine corresponding TestResult with Parameter */ /* CallTestRoutine corresponding TestResult with Parameter */
CallTestRoutine((int)TestType.EB_RLY); CallTestRoutine((int)TestType.RLY_EB);
}
private void B_test_STOP_Click(object sender, EventArgs e)
{
if (activeTest == true)
{
TestTimeoutThread.Abort(); /* Abort Timeout Thread */
activeTest = false;
activeAutomatictest = false;
TestIsCanceled(actualTest);
globalActivities(true);
testcnt = 0;
}
else
{
activeAutomatictest = false;
globalActivities(true);
testcnt = 0;
}
} }
private void B_test_clear_Click(object sender, EventArgs e) private void B_test_clear_Click(object sender, EventArgs e)
@@ -222,17 +601,23 @@ namespace QUA_2475_designtest
T_MasterOutput.BackColor = System.Drawing.Color.White; T_MasterOutput.BackColor = System.Drawing.Color.White;
TestIsUntested(loopcnt); TestIsUntested(loopcnt);
} }
} }
} }
private void B_test_TESTALL_Click(object sender, EventArgs e)
{
automaticTest();
}
private void CallTestRoutine(uint TestID) private void CallTestRoutine(uint TestID)
{ {
/* Call Test just if no other Test is active */ /* Call Test just if no other Test is active */
if (activeTest == false) if (activeTest == false)
{ {
globalActivities(false);
actualTest = TestID; /* Set actual Test ID to active Test*/ actualTest = TestID; /* Set actual Test ID to active Test*/
TestMessage[actualTest] = "";
/* Define and Start Timeout Thread */ /* Define and Start Timeout Thread */
TestTimeoutThread = new Thread(new ThreadStart(TimeoutThread)); TestTimeoutThread = new Thread(new ThreadStart(TimeoutThread));
TestTimeoutThread.Start(); TestTimeoutThread.Start();
@@ -240,6 +625,378 @@ namespace QUA_2475_designtest
activeTest = true; /* Set Test to global active */ activeTest = true; /* Set Test to global active */
com1.Write(TestCallCommands[actualTest]); /* Call Test */ com1.Write(TestCallCommands[actualTest]); /* Call Test */
TestIsActive(actualTest); /* Set Test TextBox */ TestIsActive(actualTest); /* Set Test TextBox */
globalActivities(true);
}
}
private void automaticTest()
{
activeAutomatictest = true; /* Set autoTest to global active */
globalActivities(false);
/* Reset all Test Results and Test TextBoxes */
if (testcnt == 0)
{
AllTestResult = false;
for (uint loopcnt = 0; loopcnt < NrOfTests; loopcnt++)
{
T_MasterOutput.BackColor = System.Drawing.Color.White;
TestIsUntested(loopcnt);
TestResult[loopcnt] = false;
}
}
if (testcnt < NrOfTests)
{
Thread.Sleep(500);
/* Call single Test */
if (ActivateTest[testcnt] == true)
{
CallTestRoutine(testcnt++);
}
else
{
TestIsSkipped(testcnt++);
}
}
else if (testcnt == NrOfTests)
{
if (setRTC == true)
{
remoteRTCset();
}
//if (cal_Analogue == true)
//{
// TestTimeoutThread = new Thread(new ThreadStart(TimeoutThread));
// TestTimeoutThread.Start();
// calibrateAnalogue();
//}
testcnt = 0; /* reset Test counter to zero */
/* Increment Number of Totals Test */
calculateAllResult(); /* Calculate autoTest Result */
if (AllTestResult == false)
{
// /* If one or more tests failed */
// InfoBox infobox = new InfoBox();
/* Ask if user wants to restart test */
// if (infobox.ShowDialog() == DialogResult.OK)
{
/* If user wants to restart, break out of algorithm
* and return to idle stat. Do not increment counters
* or the automatically calculated values
*/
// return;
}
/* Test failed - Increment FAILED- and overall Counter */
increment_failed();
L_stats_numbertotal.Text = Convert.ToString(TotalTestNumber++);
}
else
{
/* Test passed - Increment PASSED- and overall Counter */
increment_passed();
L_stats_numbertotal.Text = Convert.ToString(TotalTestNumber++);
}
activeAutomatictest = false; /* set autoTest to global off */
globalActivities(true);
}
}
private void calculateAllResult()
{
if ((TestResult[0]
& TestResult[1]
& TestResult[2]
& TestResult[3]
& TestResult[4]
& TestResult[5]
& TestResult[6]
& TestResult[7]
& TestResult[8]
& TestResult[9]
& TestResult[10]
& TestResult[11]
& TestResult[12]
& TestResult[13]
& TestResult[14]
& TestResult[15]
& TestResult[16]
& TestResult[17]
& TestResult[18]
& TestResult[19]
& TestResult[20]
& TestResult[21]
& TestResult[22])
== true)
{
AllTestResult = true;
T_MasterOutput.BackColor = System.Drawing.Color.Green;
MessageBox.Show("Automatic Test Sequence finished\n\rSUCCESSFULLY");
}
else
{
AllTestResult = false;
T_MasterOutput.BackColor = System.Drawing.Color.Red;
MessageBox.Show("Automatic Test Sequence finished\n\rwith ERRORS");
}
}
private void globalActivities (bool control)
{
/* Control checkboxes for Test-Controls */
C_test_VCC.Enabled = control;
C_test_VDDAT.Enabled = control;
C_test_VBAT.Enabled = control;
C_test_VCORE.Enabled = control;
C_test_TEMP.Enabled = control;
C_test_REVNUM.Enabled = control;
C_test_MB_LED.Enabled = control;
C_test_MB_EEPROM.Enabled = control;
C_test_eth0.Enabled = control;
C_test_eth1.Enabled = control;
C_test_USB.Enabled = control;
C_test_MB_DIO.Enabled = control;
C_test_MB_AIO.Enabled = control;
C_test_MB_RLY.Enabled = control;
C_test_EB_LED.Enabled = control;
C_test_EB_EEPROM.Enabled = control;
C_test_EB_DIO.Enabled = control;
C_test_EB_AIO.Enabled = control;
C_test_EB_RLY.Enabled = control;
/* Control Buttons of test section */
B_test_VCC.Enabled = control;
B_test_VDDAT.Enabled = control;
B_test_VBAT.Enabled = control;
B_test_VCORE.Enabled = control;
B_test_TEMP.Enabled = control;
B_test_REVNUM.Enabled = control;
B_test_MB_LED.Enabled = control;
B_test_MB_EEPROM.Enabled = control;
B_test_eth0.Enabled = control;
B_test_eth1.Enabled = control;
B_test_USB.Enabled = control;
B_test_MB_DIO.Enabled = control;
B_test_MB_AIO.Enabled = control;
B_test_MB_RLY.Enabled = control;
B_test_EB_LED.Enabled = control;
B_test_EB_EEPROM.Enabled = control;
B_test_EB_DIO.Enabled = control;
B_test_EB_AIO.Enabled = control;
B_test_EB_RLY.Enabled = control;
/* Control Configuration Buttons */
B_conf_addall.Enabled = control;
B_conf_removeall.Enabled = control;
B_conf_addMB.Enabled = control;
B_conf_removeMB.Enabled = control;
B_conf_addEB.Enabled = control;
B_conf_removeEB.Enabled = control;
B_conf_resettotal.Enabled = control;
/* Control String Input Text Box for Device */
T_MasterInput.Enabled = control;
}
private void B_master_init_Click(object sender, EventArgs e)
{
com1.Write("initForC_S\r");
}
private void B_masterY_Click(object sender, EventArgs e)
{
com1.Write("y");
}
private void B_master_N_Click(object sender, EventArgs e)
{
com1.Write("n");
}
private void B_master_ENTER_Click(object sender, EventArgs e)
{
com1.Write("\r");
}
private void B_conf_addall_Click(object sender, EventArgs e)
{
C_test_VCC.Checked = true;
C_test_VDDAT.Checked = true;
C_test_VBAT.Checked = true;
C_test_VCORE.Checked = true;
C_test_TEMP.Checked = true;
C_test_REVNUM.Checked = true;
C_test_MB_LED.Checked = true;
C_test_MB_EEPROM.Checked = true;
C_test_eth0.Checked = true;
C_test_eth1.Checked = true;
C_test_USB.Checked = true;
C_test_MB_DIO.Checked = true;
C_test_MB_AIO.Checked = true;
C_test_MB_RLY.Checked = true;
C_test_EB_LED.Checked = true;
C_test_EB_EEPROM.Checked = true;
C_test_EB_DIO.Checked = true;
C_test_EB_AIO.Checked = true;
C_test_EB_RLY.Checked = true;
}
private void B_conf_addMB_Click(object sender, EventArgs e)
{
C_test_VCC.Checked = true;
C_test_VDDAT.Checked = true;
C_test_VBAT.Checked = true;
C_test_VCORE.Checked = true;
C_test_TEMP.Checked = true;
C_test_REVNUM.Checked = true;
C_test_MB_LED.Checked = true;
C_test_MB_EEPROM.Checked = true;
C_test_eth0.Checked = true;
C_test_eth1.Checked = true;
C_test_USB.Checked = true;
C_test_MB_DIO.Checked = true;
C_test_MB_AIO.Checked = true;
C_test_MB_RLY.Checked = true;
}
private void B_conf_addEB_Click(object sender, EventArgs e)
{
C_test_EB_LED.Checked = true;
C_test_EB_EEPROM.Checked = true;
C_test_EB_DIO.Checked = true;
C_test_EB_AIO.Checked = true;
C_test_EB_RLY.Checked = true;
}
private void B_conf_removeall_Click(object sender, EventArgs e)
{
C_test_VCC.Checked = false;
C_test_VDDAT.Checked = false;
C_test_VBAT.Checked = false;
C_test_VCORE.Checked = false;
C_test_TEMP.Checked = false;
C_test_REVNUM.Checked = false;
C_test_MB_LED.Checked = false;
C_test_MB_EEPROM.Checked = false;
C_test_eth0.Checked = false;
C_test_eth1.Checked = false;
C_test_USB.Checked = false;
C_test_MB_DIO.Checked = false;
C_test_MB_AIO.Checked = false;
C_test_MB_RLY.Checked = false;
C_test_EB_LED.Checked = false;
C_test_EB_EEPROM.Checked = false;
C_test_EB_DIO.Checked = false;
C_test_EB_AIO.Checked = false;
C_test_EB_RLY.Checked = false;
}
private void B_conf_removeMB_Click(object sender, EventArgs e)
{
C_test_VCC.Checked = false;
C_test_VDDAT.Checked = false;
C_test_VBAT.Checked = false;
C_test_VCORE.Checked = false;
C_test_TEMP.Checked = false;
C_test_REVNUM.Checked = false;
C_test_MB_LED.Checked = false;
C_test_MB_EEPROM.Checked = false;
C_test_eth0.Checked = false;
C_test_eth1.Checked = false;
C_test_USB.Checked = false;
C_test_MB_DIO.Checked = false;
C_test_MB_AIO.Checked = false;
C_test_MB_RLY.Checked = false;
}
private void B_conf_removeEB_Click(object sender, EventArgs e)
{
C_test_EB_LED.Checked = false;
C_test_EB_EEPROM.Checked = false;
C_test_EB_DIO.Checked = false;
C_test_EB_AIO.Checked = false;
C_test_EB_RLY.Checked = false;
}
private void B_conf_resettotal_Click(object sender, EventArgs e)
{
TotalFailedNumber = 0;
TotalPassedNumber = 0;
TotalTestNumber = 0;
L_stats_numberfailed.Text = Convert.ToString(TotalFailedNumber);
L_stats_numberpassed.Text = Convert.ToString(TotalPassedNumber);
L_stats_numbertotal.Text = Convert.ToString(TotalTestNumber);
}
private void C_conf_settings_RTC_CheckedChanged(object sender, EventArgs e)
{
if (C_conf_settings_RTC.Checked)
{
setRTC = true;
}
else
{
setRTC = false;
}
}
private void C_conf_cal_AOMB_CheckedChanged(object sender, EventArgs e)
{
if (C_conf_cal_AOMB.Checked)
{
ActivateTest[(int)TestType.CAL_AOMB] = true;
}
else
{
ActivateTest[(int)TestType.CAL_AOMB] = false;
}
}
private void C_conf_cal_AIMB_CheckedChanged(object sender, EventArgs e)
{
if (C_conf_cal_AOMB.Checked)
{
ActivateTest[(int)TestType.CAL_AIMB] = true;
}
else
{
ActivateTest[(int)TestType.CAL_AIMB] = false;
}
}
private void C_conf_cal_AOEB_CheckedChanged(object sender, EventArgs e)
{
if (C_conf_cal_AOMB.Checked)
{
ActivateTest[(int)TestType.CAL_AOEB] = true;
}
else
{
ActivateTest[(int)TestType.CAL_AOEB] = false;
}
}
private void C_conf_cal_AIEB_CheckedChanged(object sender, EventArgs e)
{
if (C_conf_cal_AOMB.Checked)
{
ActivateTest[(int)TestType.CAL_AIEB] = true;
}
else
{
ActivateTest[(int)TestType.CAL_AIEB] = false;
} }
} }
} }