0

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.

AS Mackay
  • 2,831
  • 9
  • 19
  • 25
  • Cfg files never contain the dbc message instance definitions, or signal definitions. cfg only stores the dbc file path necessary for compilation. So you cannot check this through cfg file alone. You need to specify the attributes you wish to consider correct in a cfg. – VioletVynil Dec 27 '18 at 09:14
  • Yes, that is correct. But currently I am not able to fetch which of the attributes I need to specify to differentiate between different configurations. Once I get that info, I can run through multiple configurations and provide a notification in-case user loads wrong cfg. – Pavan Kulkarni Dec 27 '18 at 10:06
  • You get versioning info and generation date in the first 20 lines of the cfg file if you open it by text editor. I will check after the holidays. – VioletVynil Dec 27 '18 at 11:04

0 Answers0