Commit 38e4e56e authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Address side-effects of old GUI bugs (crashes when RI name doesn't match PI name)

parent c672f060
......@@ -79,7 +79,38 @@ namespace MSC_Antlr3
if (noSuffix(systemName,"_GUI").ToLower() != gui.systemName.ToLower())
continue;
foreach (var provided in gui.providesList.Concat(gui.requiresList)) {
var pinameInFV = provided.x2.Split(new string[]{"::"}, System.StringSplitOptions.RemoveEmptyEntries).Last().Split('.').First();
Console.WriteLine("Provided interface: {0}", provided.x1);
// Due to the obj_... fiasco of the old versions of the UI, this code used to
// extract the name of the connected PIs that the GUI was using - i.e from the
// RIGHT hand side of the AADL descriptions:
//
// FEATURES
// obj_314 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function1::PI_somework.others {
// ... ^^^^^^^^^^^
// i.e. from this part: ------------------------'
// };
// obj_413 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::LeGUI::PI_TM_something.others {
// ... ^^^^^^^^^^^^^^^
// i.e. from this part: --------------------'
// };
// PROPERTIES
// Source_Language => (C);
//
// But this approach breaks the case where the RI is differently named than the PI it is
// connected to!
//
// Thankfully, Pierre has changed this now - and the proper names appear on the left hand
// side...
//
// So this old code...
//
// var pinameInFV = provided.x2.Split(
// new string[]{"::"},
// System.StringSplitOptions.RemoveEmptyEntries).Last().Split('.').First();
//
// ...is now replaced with this simple one:
//
var pinameInFV = provided.x1;
// find the subprogram with the requested name (to check, remove the _objNNN suffix)
//if (spName != noSuffix(provided.x1, @"_obj\d+"))
if (spName.ToLower() != noPrefix(noSuffix(pinameInFV, @"_obj\d+"), @"[PR]I_").ToLower())
......
......@@ -277,7 +277,37 @@ namespace MSC_Antlr3
continue;
foreach (var provided in gui.providesList.Concat(gui.requiresList)) {
var pinameInFV = provided.x2.Split(new string[]{"::"}, System.StringSplitOptions.RemoveEmptyEntries).Last().Split('.').First();
// Due to the obj_... fiasco of the old versions of the UI, this code used to
// extract the name of the connected PIs that the GUI was using - i.e from the
// RIGHT hand side of the AADL descriptions:
//
// FEATURES
// obj_314 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::Function1::PI_somework.others {
// ... ^^^^^^^^^^^
// i.e. from this part: ------------------------'
// };
// obj_413 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::LeGUI::PI_TM_something.others {
// ... ^^^^^^^^^^^^^^^
// i.e. from this part: --------------------'
// };
// PROPERTIES
// Source_Language => (C);
//
// But this approach breaks the case where the RI is differently named than the PI it is
// connected to!
//
// Thankfully, Pierre has changed this now - and the proper names appear on the left hand
// side...
//
// So this old code...
//
// var pinameInFV = provided.x2.Split(
// new string[]{"::"},
// System.StringSplitOptions.RemoveEmptyEntries).Last().Split('.').First();
//
// is now replaced with this simple one:
//
var pinameInFV = provided.x1;
// find the subprogram with the requested name (to check, remove the _objNNN suffix)
//if (spName != AadlGlobals.noSuffix(provided.x1, @"_obj\d+"))
if (spName.ToLower() != AadlGlobals.noPrefix(AadlGlobals.noSuffix(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment