When user is selecting a wrong CANoe cfg file for a particular variant, user should be notified of the wrong cfg file. The correctness of the cfg file should be validated against the content( for example: based on the dbc files loaded into each configuration)
Please find the below code for the current implementation: I need to do a check based on the content probably dbc( the resp. messages and signals within the cfg) and user has to be notified on the Frontend if wrong cfg is selected. Currently I have mentioned the respective configurations but I haven't done any content check for the configurations.
private void button2_Click(object sender, EventArgs e)
//Function to run/start CANoe measurement
{
// Execute CANoe(Obtain CANoe application objectg)
var mApp = new CANoe.Application();
var mMsr = (CANoe.Measurement)mApp.Measurement;
try
{
if (tcu == '1')
{
CANoe = new cCANoe1();
}
else if (tcu == '2')
{
CANoe = new cCANoe2();
}
log.WritetoFile("Opening CANoe configuration");
Console.WriteLine("Opening CANoe configuration");
// mApp.Open("C:\\Users\\uidr3024\\Downloads\\SRLCam4T0_Validation_ControlTool\\cfg\\SVT_SRLCam4T0_025B.cfg", true, true);
mApp.Open("C:\\MMC_Project\\Dheepika KT\\2013_42_Multibus - Simultaneous\\BR205_Multibus_2013_42_CANoe76.CFG", true, true);
log.WritetoFile("Starting measurement ");
CANoe.startMeasurement(this);
}
catch (System.Exception ex)
{
System.Console.WriteLine(ex.Message);
log.WritetoFile("Exception:" + ex.Message);
MessageBox.Show("CANoe application error", "Error");
}
if (textBox1.Text != String.Empty && System.IO.File.Exists(textBox1.Text))
{
// The textbox has a filename in it, use it
mApp.Open(textBox1.Text, true, true);
}
else
{
// The user hasn't selected a config file, launch with default
mApp.Open("C:\\MMC_Project\\Dheepika KT\\2013_42_Multibus - Simultaneous\\BR205_Multibus_2013_42_CANoe76.CFG", true, true);
}
}
Content validation in the cfg should be done and the user should be notified if wrong cfg is selected.