Zurück zu Willert.de

Newbie C Developer Model and code gen issues

Rhapsody Model or Codegeneration topics

Newbie C Developer Model and code gen issues

Postby KTPIntamac » November 18th, 2011, 1:57 pm

I began using Rhapsody earlier this year for a few Java projects, the current project is using C and is to model a hub and a few sensors. So I have modelled these as separate classes each with its own statechart, so i have a class called Hub, and two others called fire sensor and water sensor which both have associations with the hub at both ends. I wish to generate events and have done using RiCGEN(me, evEvent()) and that works fine within the same statechart/class. The problem I am having is when I want to generate an event in one class say the hub from one of the sensors, ive tried RiCGEN(me->itsHub, evEvent()); but this didnt work but compiled fine. I have now got it so the event in the statechart in a sensor calls a operation in the hub class, printing to screen from this operation works fine but RiCGEN(me, evEvent()) again doesnt work. Also if I try and pass an argument to this operation then assign it to an attribute (me->Attr = argument) I get a runtime error STATUS_ACCESS_VIOLATION.

Any Ideas as to what I have done wrong?, I apologise if i'm missing something obvious, I am a newbie :D
KTPIntamac
 
Posts: 12
Joined: September 22nd, 2011, 1:04 pm

Re: Newbie C Developer Model and code gen issues

Postby Farquad » November 18th, 2011, 4:02 pm

What you are saying makes sense. Perhaps you've forgotten to instantiate the classes as objects, the relations as links or select a class for main to create. It depends on how you are 'building'.

I've attached a model of what I think you've described. It was done in 7.6.
Attachments
ProjectC.zip
Hub and sensors
(12.12 KiB) Downloaded 86 times
Farquad
 
Posts: 407
Joined: September 13th, 2007, 9:34 pm
Location: London


Return to Modelling with Rhapsody

Who is online

Users browsing this forum: No registered users and 1 guest

cron