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
{
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)
@@ -81,25 +93,38 @@ namespace QUA_2475_designtest
else
{
/* Calling Function is in same Thread */
try
{
/* Search for Text fragments in Input String */
if (text.LastIndexOf("PASSED") != -1)
{
/* "PASSED" indecates that Device successfully
* finished a Test Script or Routine
*/
activeTest = false;
TestResult[actualTest] = true;
TestIsPassed(actualTest);
}
if (text.LastIndexOf("FAILED") != -1)
{
/* "FAILED" indecates that Device finished
* a Test Script or Routine with Errors
*/
activeTest = false;
TestResult[actualTest] = false;
TestIsFailed(actualTest);
}
if (text.LastIndexOf("CALIBRATION PART FINISHED") != -1)
{
activeTest = false;
TestResult[actualTest] = true;
CalibrationFinished();
}
/* Search for Text fragments in Input String */
if (text.LastIndexOf("test: PASSED") != -1)
{
/* "test: PASSED" indecates that Device successfully
* finished a Test Script or Routine
*/
activeTest = false;
TestResult[actualTest] = true;
TestIsPassed(actualTest);
}
if (text.LastIndexOf("test: FAILED") != -1)
catch
{
/* "test: FAILED" indecates that Device finished
* a Test Script or Routine with Errors
*/
activeTest = false;
TestResult[actualTest] = false;
TestIsFailed(actualTest);
}
}
}
@@ -160,9 +185,9 @@ namespace QUA_2475_designtest
* corresponding Test and send the String afterwards
* to CehckForKeyword to find specific Keyword
*/
CheckForSlaveKeyword(new string(buffer));
//TestMessage[actualTest] += new string(buffer);
//CheckForSlaveKeyword(TestMessage[actualTest]);
// CheckForSlaveKeyword(new string(buffer));
TestMessage[actualTest] += new string(buffer);
CheckForSlaveKeyword(TestMessage[actualTest]);
}
nrOfBytes = com1.BytesToRead; /* Actualise Inputlength*/
}
@@ -50,7 +50,7 @@ namespace QUA_2475_designtest
Thread TestTimeoutThread; /* Test Timeout Thread */
/* 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 TotalTestNumber = 1; /* Number of total 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 activeTest = false; /* Indicates an active Test */
private bool activeAutomatictest = false; /* autoTest is active */
private bool AllTestResult; /* Shows the autoTest Result */
private bool setRTC = false;
/* ARRAY DEFINITION */
/* Array of all available Textboxes for Tests */
@@ -71,6 +75,10 @@ namespace QUA_2475_designtest
public string[] Testfiles = new string[NrOfTests];
/* Array to contain each Test Result */
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 */
@@ -81,45 +89,58 @@ namespace QUA_2475_designtest
*/
public enum TestType
{
MB_LED = 0,
MB_EEPROM = 1,
ETH1 = 2,
ETH0 = 3,
CF = 4,
USB = 5,
MB_DIO = 6,
MB_AIO = 7,
MB_RLY = 8,
CAN = 9,
EB_LED = 10,
EB_EEPROM = 11,
EB_DIO = 12,
EB_AIO = 13,
EB_RLY = 14
VCC = 0,
VDDAT = 1,
VBAT = 2,
VCORE = 3,
TEMP = 4,
REVNUM = 5,
LED_MB = 6,
EEPROM_MB = 7,
ETH0 = 8,
ETH1 = 9,
USB = 10,
DIO_MB = 11,
AIO_MB = 12,
RLY_MB = 13,
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()
{
com1.PortName = "COM1"; /* Bind com1 to COM1 */
com1.PortName = "COM9"; /* Bind com1 to COM1 */
com1.Open(); /* Open com1 */
com1.BaudRate = 115200; /* Set com1 Baudrate */
/* Capture corresponding Textboxes to TextBox Array */
TestTextBoxes[(int)TestType.MB_LED] = T_test_MB_LED;
TestTextBoxes[(int)TestType.MB_EEPROM] = T_test_MB_EEPROM;
TestTextBoxes[(int)TestType.ETH1] = T_test_eth1;
TestTextBoxes[(int)TestType.VCC] = T_test_VCC;
TestTextBoxes[(int)TestType.VDDAT] = T_test_VDDAT;
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.CF] = T_test_CF;
TestTextBoxes[(int)TestType.ETH1] = T_test_eth1;
TestTextBoxes[(int)TestType.USB] = T_test_USB;
TestTextBoxes[(int)TestType.MB_DIO] = T_test_MB_DIO;
TestTextBoxes[(int)TestType.MB_AIO] = T_test_MB_AIO;
TestTextBoxes[(int)TestType.MB_RLY] = T_test_MB_RLY;
TestTextBoxes[(int)TestType.CAN] = T_test_CAN;
TestTextBoxes[(int)TestType.EB_LED] = T_test_EB_LED;
TestTextBoxes[(int)TestType.EB_EEPROM] = T_test_EB_EEPROM;
TestTextBoxes[(int)TestType.EB_DIO] = T_test_EB_DIO;
TestTextBoxes[(int)TestType.EB_AIO] = T_test_EB_AIO;
TestTextBoxes[(int)TestType.EB_RLY] = T_test_EB_RLY;
TestTextBoxes[(int)TestType.DIO_MB] = T_test_MB_DIO;
TestTextBoxes[(int)TestType.AIO_MB] = T_test_MB_AIO;
TestTextBoxes[(int)TestType.RLY_MB] = T_test_MB_RLY;
TestTextBoxes[(int)TestType.LED_EB] = T_test_EB_LED;
TestTextBoxes[(int)TestType.EEPROM_EB] = T_test_EB_EEPROM;
TestTextBoxes[(int)TestType.DIO_EB] = T_test_EB_DIO;
TestTextBoxes[(int)TestType.AIO_EB] = T_test_EB_AIO;
TestTextBoxes[(int)TestType.RLY_EB] = T_test_EB_RLY;
/* Reset all Test Results */
TestResult[0] = false;
@@ -137,28 +158,48 @@ namespace QUA_2475_designtest
TestResult[12] = false;
TestResult[13] = 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 */
TestCallCommands[0] = "ledtest 2\r";
TestCallCommands[1] = "eeprom 2\r";
TestCallCommands[2] = "\r";
TestCallCommands[3] = "\r";
TestCallCommands[4] = "\r";
TestCallCommands[5] = "\r";
TestCallCommands[6] = "dio 2\r";
TestCallCommands[7] = "\r";
TestCallCommands[8] = "\r";
TestCallCommands[9] = "\r";
TestCallCommands[10] = "\r";
TestCallCommands[11] = "\r";
TestCallCommands[12] = "\r";
TestCallCommands[13] = "\r";
TestCallCommands[14] = "\r";
TestCallCommands[0] = "test_vcc 2\r";
TestCallCommands[1] = "test_vddat 2\r";
TestCallCommands[2] = "test_vbat 2\r";
TestCallCommands[3] = "test_vcore 2\r";
TestCallCommands[4] = "test_temp 2\r";
TestCallCommands[5] = "test_revnum 2\r";
TestCallCommands[6] = "test_led 2 0\r";
TestCallCommands[7] = "test_eeprom 2 0\r";
TestCallCommands[8] = "test_eth 2 0\r";
TestCallCommands[9] = "test_eth 2 1\r";
TestCallCommands[10] = "test_usb 2\r";
TestCallCommands[11] = "test_dio 2 0\r";
TestCallCommands[12] = "test_aio 2 0\r";
TestCallCommands[13] = "test_rly 2 0\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 */
com1GetMessage = new Thread(new ThreadStart(com1_DataReceived));
com1GetMessage.Start();
}
}
}
File diff suppressed because it is too large Load Diff
@@ -61,17 +61,11 @@ namespace QUA_2475_designtest
*/
private void TimeoutThread()
{
Thread.Sleep(20000);
Thread.Sleep(100000);
if (activeTest == true)
{
TestIsTimeout(actualTest);
}
}
private void B_conf_removeMB_Click(object sender, EventArgs e)
{
}
}
}
File diff suppressed because it is too large Load Diff