{"action":"closed","issue":{"url":"https://api.github.com/repos/modelica/fmi-standard/issues/41","repository_url":"https://api.github.com/repos/modelica/fmi-standard","labels_url":"https://api.github.com/repos/modelica/fmi-standard/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/modelica/fmi-standard/issues/41/comments","events_url":"https://api.github.com/repos/modelica/fmi-standard/issues/41/events","html_url":"https://github.com/modelica/fmi-standard/issues/41","id":370733111,"node_id":"MDU6SXNzdWUzNzA3MzMxMTE=","number":41,"title":"Wrong argument passed to logger callback","user":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"labels":[{"id":1093397540,"node_id":"MDU6TGFiZWwxMDkzMzk3NTQw","url":"https://api.github.com/repos/modelica/fmi-standard/labels/P:%20major","name":"P: major","color":"f6f6f6","default":false},{"id":1046392991,"node_id":"MDU6TGFiZWwxMDQ2MzkyOTkx","url":"https://api.github.com/repos/modelica/fmi-standard/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":{"login":"MartinOtter","id":7248038,"node_id":"MDQ6VXNlcjcyNDgwMzg=","avatar_url":"https://avatars3.githubusercontent.com/u/7248038?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinOtter","html_url":"https://github.com/MartinOtter","followers_url":"https://api.github.com/users/MartinOtter/followers","following_url":"https://api.github.com/users/MartinOtter/following{/other_user}","gists_url":"https://api.github.com/users/MartinOtter/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinOtter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinOtter/subscriptions","organizations_url":"https://api.github.com/users/MartinOtter/orgs","repos_url":"https://api.github.com/users/MartinOtter/repos","events_url":"https://api.github.com/users/MartinOtter/events{/privacy}","received_events_url":"https://api.github.com/users/MartinOtter/received_events","type":"User","site_admin":false},"assignees":[{"login":"MartinOtter","id":7248038,"node_id":"MDQ6VXNlcjcyNDgwMzg=","avatar_url":"https://avatars3.githubusercontent.com/u/7248038?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinOtter","html_url":"https://github.com/MartinOtter","followers_url":"https://api.github.com/users/MartinOtter/followers","following_url":"https://api.github.com/users/MartinOtter/following{/other_user}","gists_url":"https://api.github.com/users/MartinOtter/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinOtter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinOtter/subscriptions","organizations_url":"https://api.github.com/users/MartinOtter/orgs","repos_url":"https://api.github.com/users/MartinOtter/repos","events_url":"https://api.github.com/users/MartinOtter/events{/privacy}","received_events_url":"https://api.github.com/users/MartinOtter/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-10-16T18:05:34Z","updated_at":"2018-10-16T18:06:25Z","closed_at":"2018-10-16T18:06:25Z","author_association":"COLLABORATOR","body":"**Reported by jakob on 6 Sep 2010 10:07 UTC**\n\nThe logger callback is currently defined as\n```\nvoid logger(fmiComponent c, fmiString instanceName, fmiStatus status,\n      fmiString category, fmiString message, ...);\n```\n\nThe simulation environment that implements the logger is responsible for substituting references such as #r1365# in mesage by variable names. To do this, the environment needs to access the XML file. The bug is that the logger is only called with fmiComponent c as argument, which is a FMU internal handle that does not help the simulation envrionment to access the XML file. \n\nThe simulation environment would need to get its own representation of the FMU here, e.g. a pointer to the AST of the XML file. The simulation environment should pass its own rep. of an FMU instance when setting the callback functions, and the logger must be called by the model with this pointer.\n\nA fairly backward compatible fix would be: Add a fourth field to fmiCallbackFunctions:\n```\ntypedef struct {\n     fmiCallbackLogger         logger;\n     fmiCallbackAllocateMemory allocateMemory;\n     fmiCallbackFreeMemory     freeMemory;\n     fmiComponent              modelInstance; <<< NEW!\n} fmiCallbackFunctions;\n```\n\nDuring simulation, the FMU calls the logger with the specified modelInstance (e.g. a handle to the XML file).\n\n\n\n----\n\nMigrated-From: https://trac.fmi-standard.org/ticket/41"}}
{"actor":{"display_login":"modelica-trac-importer"}}