diff --git a/.DS_Store b/.DS_Store index a38dfc9ff61253bdf03fed2438fa5bfcc77cfa17..f37e537f9aece3d1c2a2cc5b6a4737bc8d3c07a0 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/executablecode/.DS_Store b/executablecode/.DS_Store index ac8091b1da224bc3cd92055428e332b8a4ba2d1a..4ee5f9329d9766b6c9dc90965d2243b62319a90e 100644 Binary files a/executablecode/.DS_Store and b/executablecode/.DS_Store differ diff --git a/executablecode/generated_src/mainArduino2.ino b/executablecode/generated_src/mainArduino2.ino new file mode 100644 index 0000000000000000000000000000000000000000..becfee868d40acca56834e4358b39d9e90355ecf --- /dev/null +++ b/executablecode/generated_src/mainArduino2.ino @@ -0,0 +1,1379 @@ +#include <Arduino_FreeRTOS.h> +#include <frt.h> + + +#define SEND_SYNC_REQUEST 0 +#define RECEIVE_SYNC_REQUEST 2 +#define SEND_ASYNC_REQUEST 4 +#define RECEIVE_ASYNC_REQUEST 6 +#define DELAY 8 +#define IMMEDIATE 10 +#define SEND_BROADCAST_REQUEST 12 +#define RECEIVE_BROADCAST_REQUEST 14 + +#define DEBUG_ON 1 +#define DEBUG_OFF 2 + +int debug = DEBUG_ON; + +struct timespec +{ + int tv_sec; /* Seconds. */ + int tv_nsec; /* Nanoseconds. */ +}; + +struct message { + struct message *next; + int nbOfParams; + int *params; + long id; +}; + +long __id_message = 0; +frt::Mutex __message_mutex; +frt::Mutex mutex ; +int mainConditionaVariable = 0; +struct request; + +struct setOfRequests { + char* owner; + struct request *head; + timespec startTime; + timespec completionTime; + int *conditionVariable; + frt::Mutex *mutex; + + int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay + timespec minTimeToWait; + struct request *selectedRequest; +}; + +struct request { + struct request *next; + struct setOfRequests* listOfRequests; + struct request* nextRequestInList; + struct request* relatedRequest; // For synchro and broadcast + struct syncchannel *syncChannel; + struct asyncchannel *asyncChannel; + + int type; + int ID; + int hasDelay;; + timespec delay; + int nbOfParams; // synchronous com. + int **params; // synchronous com. + message *msg; // Asynchronous comm. + + + // Filled by the request manager + int executable; + int selected; + int alreadyPending; // Whether it has been taken into account for execution or not + int delayElapsed; + timespec myStartTime; // Time at which the delay has expired +}; + +struct asyncchannel { + char *outname; + char *inname; + int isBlocking; // In writing. Reading is always blocking + int maxNbOfMessages; // + struct request* outWaitQueue; + struct request* inWaitQueue; + message *pendingMessages; + int currentNbOfMessages; +}; + +struct syncchannel { + char *outname; + char *inname; + struct request* inWaitQueue; + struct request* outWaitQueue; + bool isBroadcast; +}; +/* User code */ +void __user_init() { +} + +/* End of User code */ + +// Header code defined in the model + +void __userImplemented__MainBlock__ledOn(){ + digitalWrite(13,HIGH) ; + Serial.println("Led ON from Task1"); +} + +void __userImplemented__MainBlock__ledOff(){ + digitalWrite(13,LOW) ; + Serial.println("Led OFF from Task1"); +} +void __userImplemented__MainBlock__initLed(){ + pinMode(13,OUTPUT) ; +} + +// End of header code defined in the model + + +void MainBlock__ledOn() { + __userImplemented__MainBlock__ledOn(); +} + + +void MainBlock__ledOff() { + __userImplemented__MainBlock__ledOff(); +} + + +void MainBlock__initLed() { + __userImplemented__MainBlock__initLed(); +} + + +#define MainBlock_STATE__START__STATE 0 +#define MainBlock_STATE__waitingForPeriodOn 1 +#define MainBlock_STATE__onPeriodOK 2 +#define MainBlock_STATE__waitingForPeriodOff 3 +#define MainBlock_STATE__offPeriodOK 4 +#define MainBlock_STATE__STOP__STATE 5 +void Task_MainBlock( void *pvParameters ); + +int MainBlock__currentState = MainBlock_STATE__START__STATE; +request MainBlock__req0; +int *MainBlock__params0[0]; +request MainBlock__req1; +int *MainBlock__params1[0]; +setOfRequests MainBlock__list; +request *MainBlock__returnRequest; + +// Header code defined in the model +const int trigPin = 2; +const int echoPin = 3; + +long duration; +int distance; + + +void __userImplemented__MainBlock_0__initPins(){ + pinMode(trigPin, OUTPUT); + pinMode(echoPin, INPUT); +} + +void __userImplemented__MainBlock_0__getDistance(){ + digitalWrite(trigPin, LOW); + delayMicroseconds(2); + // Sets the trigPin on HIGH state for 10 micro seconds + digitalWrite(trigPin, HIGH); + delayMicroseconds(10); + digitalWrite(trigPin, LOW); + // Reads the echoPin, returns the sound wave travel time in microseconds + duration = pulseIn(echoPin, HIGH); + // Calculating the distance + distance = duration * 0.034 / 2; + // Prints the distance on the Serial Monitor + Serial.print("Distance from Task 2: "); + Serial.println(distance); +} + +// End of header code defined in the model + + +void MainBlock_0__getDistance() { + __userImplemented__MainBlock_0__getDistance(); +} + + +void MainBlock_0__initPins() { + __userImplemented__MainBlock_0__initPins(); +} + + +#define MainBlock_0_STATE__START__STATE 0 +#define MainBlock_0_STATE__waitingForPeriodOn 1 +#define MainBlock_0_STATE__onPeriodOK 2 +#define MainBlock_0_STATE__waitingForPeriodOff 3 +#define MainBlock_0_STATE__offPeriodOK 4 +#define MainBlock_0_STATE__STOP__STATE 5 +void Task_MainBlock_0( void *pvParameters ); + +int MainBlock_0__currentState = MainBlock_0_STATE__START__STATE; +request MainBlock_0__req0; +int *MainBlock_0__params0[0]; +request MainBlock_0__req1; +int *MainBlock_0__params1[0]; +setOfRequests MainBlock_0__list; +request *MainBlock_0__returnRequest; + + +void setup() { + Serial.begin(9600); + /* Activating randomness */ + initRandom(0); + char __myname[] = ""; + fillListOfRequests(&MainBlock__list, __myname, &mainConditionaVariable, &mutex); + xTaskCreate (Task_MainBlock, (const portCHAR *)"MainBlock", 128, NULL, 1, NULL); + fillListOfRequests(&MainBlock_0__list, __myname, &mainConditionaVariable, &mutex); + xTaskCreate (Task_MainBlock_0, (const portCHAR *)"MainBlock_0", 128, NULL, 1, NULL); + +} + +void loop() { + +} + +void Task_MainBlock( void *pvParameters ) +{ + (void) pvParameters; + int period = 1000; + int x = 0; + int period2 = 100; + + mutex.unlock(); + + /* Main loop on states */ + while(MainBlock__currentState != MainBlock_STATE__STOP__STATE) { + switch(MainBlock__currentState) { + case MainBlock_STATE__START__STATE: + MainBlock__initLed(); + MainBlock__currentState = MainBlock_STATE__waitingForPeriodOn; + break; + + case MainBlock_STATE__waitingForPeriodOn: + waitFor(period,period); + MainBlock__currentState = MainBlock_STATE__onPeriodOK; + break; + + case MainBlock_STATE__onPeriodOK: + MainBlock__ledOn(); + x = x+1; + MainBlock__currentState = MainBlock_STATE__waitingForPeriodOff; + break; + + case MainBlock_STATE__waitingForPeriodOff: + waitFor(period,period); + MainBlock__currentState = MainBlock_STATE__offPeriodOK; + break; + + case MainBlock_STATE__offPeriodOK: + if (!(x > 5)) { + makeNewRequest(&MainBlock__req0, 210, IMMEDIATE, 0, 0, 0, 0, MainBlock__params0); + addRequestToList(&MainBlock__list, &MainBlock__req0); + } + if (x > 5) { + makeNewRequest(&MainBlock__req1, 227, IMMEDIATE, 0, 0, 0, 0, MainBlock__params1); + addRequestToList(&MainBlock__list, &MainBlock__req1); + } + if (nbOfRequests(&MainBlock__list) == 0) { + debug2Msg("No possible request"); + MainBlock__currentState = MainBlock_STATE__STOP__STATE; + break; + } + MainBlock__returnRequest = executeListOfRequests(&MainBlock__list); + clearListOfRequests(&MainBlock__list); + if (MainBlock__returnRequest == &MainBlock__req0) { + MainBlock__ledOff(); + MainBlock__currentState = MainBlock_STATE__waitingForPeriodOn; + + } + else if (MainBlock__returnRequest == &MainBlock__req1) { + MainBlock__ledOff(); + MainBlock__currentState = MainBlock_STATE__STOP__STATE; + + } + break; + + } + } +while(1){}; +} +void Task_MainBlock_0( void *pvParameters ) +{ + (void) pvParameters; + int period = 2000; + int x = 0; + int period2 = 100; + + mutex.unlock(); + + /* Main loop on states */ + while(MainBlock_0__currentState != MainBlock_0_STATE__STOP__STATE) { + switch(MainBlock_0__currentState) { + case MainBlock_0_STATE__START__STATE: + waitFor(500,500); + MainBlock_0__initPins(); + MainBlock_0__currentState = MainBlock_0_STATE__waitingForPeriodOn; + break; + + case MainBlock_0_STATE__waitingForPeriodOn: + waitFor(period,period); + MainBlock_0__currentState = MainBlock_0_STATE__onPeriodOK; + break; + + case MainBlock_0_STATE__onPeriodOK: + x = x+1; + MainBlock_0__getDistance(); + MainBlock_0__currentState = MainBlock_0_STATE__waitingForPeriodOff; + break; + + case MainBlock_0_STATE__waitingForPeriodOff: + MainBlock_0__currentState = MainBlock_0_STATE__offPeriodOK; + break; + + case MainBlock_0_STATE__offPeriodOK: + if (x > 10) { + makeNewRequest(&MainBlock_0__req0, 239, IMMEDIATE, 0, 0, 0, 0, MainBlock_0__params0); + addRequestToList(&MainBlock_0__list, &MainBlock_0__req0); + } + if (!(x > 10)) { + makeNewRequest(&MainBlock_0__req1, 243, IMMEDIATE, 0, 0, 0, 0, MainBlock_0__params1); + addRequestToList(&MainBlock_0__list, &MainBlock_0__req1); + } + if (nbOfRequests(&MainBlock_0__list) == 0) { + debug2Msg("No possible request"); + MainBlock_0__currentState = MainBlock_0_STATE__STOP__STATE; + break; + } + MainBlock_0__returnRequest = executeListOfRequests(&MainBlock_0__list); + clearListOfRequests(&MainBlock_0__list); + if (MainBlock_0__returnRequest == &MainBlock_0__req0) { + MainBlock_0__currentState = MainBlock_0_STATE__STOP__STATE; + + } + else if (MainBlock_0__returnRequest == &MainBlock_0__req1) { + MainBlock_0__currentState = MainBlock_0_STATE__waitingForPeriodOn; + + } + break; + + } + } +while(1){}; +} + +void criticalErrorInt(String msg, int Int) { + Serial.print("Critical error : ") ; + Serial.print(msg) ; + Serial.print(", ") ; + Serial.println(Int) ; +} + +void criticalError(String msg) { + Serial.print("Critical error : ") ; + Serial.println(msg) ; +} + +int computeRandom(int min, int max) { + return random(min, max); +} + +long computeLongRandom(long min, long max) { + + return (long)random(min, max); +} + +void initRandom(int pin) { + randomSeed(analogRead(pin)); +} + +int my_clock_gettime(struct timespec *ts) { + ts->tv_sec = millis() / 1000; + ts->tv_nsec = micros(); + return 0; +} + + +void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { + dest->tv_nsec = src1->tv_nsec + src2->tv_nsec; + dest->tv_sec = src1->tv_sec + src2->tv_sec; + if (dest->tv_nsec > 1000000000) { + dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000); + dest->tv_nsec = dest->tv_nsec % 1000000000; + } +} + +void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { + int diff = 0; + if (src1->tv_nsec > src2->tv_nsec) { + diff ++; + dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000; + } else { + dest->tv_nsec = src2->tv_nsec - src1->tv_nsec; + } + + dest->tv_sec = src2->tv_sec - src1->tv_sec - diff; +} + + + +int isBefore(struct timespec *src1, struct timespec *src2) { + if (src1->tv_sec > src2->tv_sec) { + return 0; + } + + if (src1->tv_sec < src2->tv_sec) { + return 1; + } + + if (src1->tv_nsec < src2->tv_nsec) { + return 1; + } + return 0; +} + +void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { + + if (isBefore(src1, src2)) { + dest->tv_nsec = src1->tv_nsec; + dest->tv_sec = src1->tv_sec; + } else { + dest->tv_nsec = src2->tv_nsec; + dest->tv_sec = src2->tv_sec; + } + +} + +void delayToTimeSpec(struct timespec *ts, long delay) { + ts->tv_nsec = (delay % 1000000) * 1000; + ts->tv_sec = (delay / 1000000); +} + + +void waitFor(long minDelay, long maxDelay) { + long delay; + delay = computeLongRandom(minDelay, maxDelay); + vTaskDelay( delay / portTICK_PERIOD_MS ); +} + +long getMessageID() { + long tmp; + __message_mutex.lock(); + tmp = __id_message; + __id_message ++; + __message_mutex.unlock(); + return tmp; +} + +struct message *getNewMessageWithParams(int nbOfParams) { + + message *msg = (message *)(malloc(sizeof(struct message))); + if (msg == NULL) { + criticalError("Allocation of request failed"); + } + msg->nbOfParams = nbOfParams; + msg->params = (int *)(malloc(sizeof(int) * nbOfParams)); + msg->id = getMessageID(); + return msg; +} + +struct message *getNewMessage(int nbOfParams, int *params) { + + message *msg = (message *)(malloc(sizeof(struct message))); + if (msg == NULL) { + criticalError("Allocation of request failed"); + } + msg->nbOfParams = nbOfParams; + msg->params = params; + msg->id = getMessageID(); + return msg; +} + + + +void destroyMessageWithParams(message *msg) { + free(msg->params); + free(msg); +} + +void destroyMessage(message *msg) { + free(msg); +} + +struct asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) { + asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel))); + if (asyncch == NULL) { + criticalError("Allocation of asyncchannel failed"); + } + asyncch->inname = inname; + asyncch->outname = outname; + asyncch->isBlocking = isBlocking; + asyncch->maxNbOfMessages = maxNbOfMessages; + + return asyncch; +} + +void destroyAsyncchannel(asyncchannel *asyncch) { + free(asyncch); +} + +message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) { + message *msg; + message *previous; + + if (channel->currentNbOfMessages == 0) { + return NULL; + } + + if (channel->currentNbOfMessages == 1) { + channel->currentNbOfMessages = 0; + msg = channel->pendingMessages; + channel->pendingMessages = NULL; + return msg; + } + + msg = channel->pendingMessages; + previous = msg; + while (msg->next != NULL) { + previous = msg; + msg = msg->next; + } + + channel->currentNbOfMessages = channel->currentNbOfMessages - 1; + previous->next = NULL; + return msg; +} + +void addMessageToAsyncChannel(asyncchannel *channel, message *msg) { + msg->next = channel->pendingMessages; + channel->pendingMessages = msg; + channel->currentNbOfMessages = channel->currentNbOfMessages + 1; +} + +struct syncchannel *getNewSyncchannel(char *outname, char *inname) { + syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel))); + if (syncch == NULL) { + criticalError("Allocation of request failed"); + } + syncch->inname = inname; + syncch->outname = outname; + syncch->inWaitQueue = NULL; + syncch->outWaitQueue = NULL; + syncch->isBroadcast = false; + return syncch; +} + +void setBroadcast(syncchannel *syncch, bool b) { + syncch->isBroadcast = b; +} + + +void destroySyncchannel(syncchannel *syncch) { + free(syncch); +} + +struct request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { + request *req = (request *)(malloc(sizeof(struct request))); + + if (req == NULL) { + criticalError("Allocation of request failed"); + } + + makeNewRequest(req, ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params); + return req; +} + + +// Delays are in microseconds +void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { + long delay; + int i; + + req->next = NULL; + req->listOfRequests = NULL; + req->nextRequestInList = NULL; + + req->type = type; + req->ID = ID; + req->hasDelay = hasDelay; + + if (req->hasDelay > 0) { + delay = computeLongRandom(minDelay, maxDelay); + delayToTimeSpec(&(req->delay), delay); + } + + req->selected = 0; + req->nbOfParams = nbOfParams; + req->params = params; + + req->alreadyPending = 0; + req->delayElapsed = 0; + + req->relatedRequest = NULL; + + if (type == SEND_ASYNC_REQUEST) { + // Must create a new message + req->msg = getNewMessageWithParams(nbOfParams); + for (i = 0; i < nbOfParams; i++) { + req->msg->params[i] = *(params[i]); + } + } + +} + + + + +void destroyRequest(request *req) { + free((void *)req); +} + +int isRequestSelected(request *req) { + return req->selected; +} + +int nbOfRequests(struct setOfRequests *list) { + int cpt = 0; + request *req; + + req = list->head; + + while (req != NULL) { + cpt ++; + req = req->nextRequestInList; + } + + return cpt; +} + +struct request *getRequestAtIndex(struct setOfRequests *list, int index) { + int cpt = 0; + request * req = list->head; + + while (cpt < index) { + req = req->nextRequestInList; + cpt ++; + } + + return req; + +} + + +struct request * addToRequestQueue(request *list, request *requestToAdd) { + request *origin = list; + + if (list == NULL) { + return requestToAdd; + } + + while (list->next != NULL) { + list = list->next; + } + + list->next = requestToAdd; + + requestToAdd->next = NULL; + + return origin; +} + +struct request * removeRequestFromList(request *list, request *requestToRemove) { + request *origin = list; + + if (list == requestToRemove) { + return list->next; + } + + + while (list->next != requestToRemove) { + list = list->next; + } + + list->next = requestToRemove->next; + + return origin; +} + + +void copyParameters(request *src, request *dst) { + int i; + for (i = 0; i < dst->nbOfParams; i++) { + *(dst->params[i]) = *(src->params[i]); + } +} + + +void clearListOfRequests(struct setOfRequests *list) { + list->head = NULL; +} + +struct setOfRequests *newListOfRequests(int variable, frt::Mutex *mutex) { + setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests))); + list->head = NULL; + *(list->conditionVariable) = variable; + list->mutex = mutex; + + return list; +} + +void fillListOfRequests(struct setOfRequests *list, char* name, int* variable, frt::Mutex *mutex) { + list->head = NULL; + list->owner = name; + list->conditionVariable = variable; + list->mutex = mutex; +} + + +void addRequestToList(struct setOfRequests *list, request* req) { + request *tmpreq; + + if (list == NULL) { + criticalError("NULL List in addRequestToList"); + } + + if (req == NULL) { + criticalError("NULL req in addRequestToList"); + } + + req->listOfRequests = list; + + if (list->head == NULL) { + list->head = req; + req->nextRequestInList = NULL; + return; + } + + tmpreq = list->head; + while (tmpreq->nextRequestInList != NULL) { + tmpreq = tmpreq->nextRequestInList; + } + + tmpreq->nextRequestInList = req; + req->nextRequestInList = NULL; +} + +void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) { + setOfRequests *list = req->listOfRequests; + request *reqtmp; + + if (list == NULL) { + return; + } + + reqtmp = list->head; + + while (reqtmp != NULL) { + + if (reqtmp->alreadyPending) { + if (reqtmp->type == RECEIVE_SYNC_REQUEST) { + debug2Msg("Removing send sync request from inWaitQueue"); + reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); + + } + + if (reqtmp->type == SEND_SYNC_REQUEST) { + debug2Msg("Removing receive sync request from outWaitQueue"); + reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp); + + } + + if (reqtmp->type == RECEIVE_BROADCAST_REQUEST) { + debug2Msg("Removing broadcast receive request from inWaitQueue"); + reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); + + } + } + reqtmp = reqtmp->nextRequestInList; + } +} + + +// Identical means belonging to the same ListOfRequest +// Returns the identical request if found, otherwise, null +struct request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) { + + while (list != NULL) { + if (list->listOfRequests == req->listOfRequests) { + return list; + } + list = list->relatedRequest; + } + + return NULL; +} + +struct request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) { + request *head = list; + + if (list == oldRequest) { + newRequest->relatedRequest = oldRequest->relatedRequest; + return newRequest; + } + + //list=list->relatedRequest; + while (list->relatedRequest != oldRequest) { + list = list->relatedRequest; + } + + list->relatedRequest = newRequest; + newRequest->relatedRequest = oldRequest->relatedRequest; + + return head; +} + + +int nbOfRelatedRequests(request *list) { + int cpt = 0; + while (list->relatedRequest != NULL) { + cpt ++; + list = list->relatedRequest; + } + + return cpt; +} + + +void executeSendSyncTransaction(request *req) { + int cpt; + request *selectedReq; + + // At least one transaction available -> must select one randomly + // First: count how many of them are available + // Then, select one + // Broadcast the new condition! + + cpt = 0; + request* currentReq = req->syncChannel->inWaitQueue; + debug2Msg("Execute send sync tr"); + + while (currentReq != NULL) { + cpt ++; + currentReq = currentReq->next; + } + + cpt = random() % cpt; + + // Head of the list? + selectedReq = req->syncChannel->inWaitQueue; + while (cpt > 0) { + selectedReq = selectedReq->next; + cpt --; + } + + // Remove all related request from list requests + //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq); + debug2Msg("Setting related request"); + req->relatedRequest = selectedReq; + + // Select the selected request, and notify the information + selectedReq->selected = 1; + selectedReq->listOfRequests->selectedRequest = selectedReq; + + // Handle parameters + copyParameters(req, selectedReq); + debug2Msg("Signaling"); + + *(selectedReq->listOfRequests->conditionVariable) = 1 ; + + +} + +void executeReceiveSyncTransaction(request *req) { + int cpt; + request *selectedReq; + + // At least one transaction available -> must select one randomly + // First: count how many of them are available + // Then, select one + // Broadcast the new condition! + + request* currentReq = req->syncChannel->outWaitQueue; + cpt = 0; + debug2Msg("Execute receive sync tr"); + + while (currentReq != NULL) { + cpt ++; + //debugInt("cpt", cpt); + currentReq = currentReq->next; + } + cpt = random() % cpt; + selectedReq = req->syncChannel->outWaitQueue; + while (cpt > 0) { + selectedReq = selectedReq->next; + cpt --; + } + + //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq); + debug2Msg("Setting related request"); + req->relatedRequest = selectedReq; + + // Select the request, and notify the information in the channel + selectedReq->selected = 1; + selectedReq->listOfRequests->selectedRequest = selectedReq; + + // Handle parameters + copyParameters(selectedReq, req); + debug2Msg("Signaling"); + *(selectedReq->listOfRequests->conditionVariable) = 1; + + +} + + +void executeSendAsyncTransaction(request *req) { + request *selectedReq; + + // Full FIFO? + if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) { + // Must remove the oldest message + getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); + } + + addMessageToAsyncChannel(req->asyncChannel, req->msg); + debug2Msg("Signaling async write to all requests waiting "); + selectedReq = req->asyncChannel->inWaitQueue; + while (selectedReq != NULL) { + + *(selectedReq->listOfRequests->conditionVariable) = 1; + selectedReq = selectedReq->next; + } + debug2Msg("Signaling done"); + +} + +void executeReceiveAsyncTransaction(request *req) { + int i; + request *selectedReq; + + req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); + + selectedReq = req->asyncChannel->outWaitQueue; + + // Must recopy parameters + for (i = 0; i < req->nbOfParams; i++) { + *(req->params[i]) = req->msg->params[i]; + } + + + // unallocate message + destroyMessageWithParams(req->msg); + debug2Msg("Signaling async read to all requests waiting "); + while (selectedReq != NULL) { + *(selectedReq->listOfRequests->conditionVariable) = 1; + selectedReq = selectedReq->next; + } + debug2Msg("Signaling done"); +} + + +void executeSendBroadcastTransaction(request *req) { + int cpt; + request *tmpreq; + + // At least one transaction available -> must select all of them + // but at most one per task + // Then, broadcast the new condition! + + request* currentReq = req->syncChannel->inWaitQueue; + request* currentLastReq = req; + debug2Msg("Execute broadcast sync tr"); + + + while (currentReq != NULL) { + tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest); + if (tmpreq != NULL) { + // Must select one of the two + // If =1, replace, otherwise, just do nothing + cpt = random() % 2; + if (cpt == 1) { + debug2Msg("Replacing broadcast request"); + req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest); + currentReq->listOfRequests->selectedRequest = currentReq; + copyParameters(req, currentReq); + currentReq->selected = 1; + currentLastReq = req; + while (currentLastReq->relatedRequest != NULL) { + currentLastReq = currentLastReq->relatedRequest; + } + } + } else { + currentLastReq->relatedRequest = currentReq; + currentReq->relatedRequest = NULL; + currentReq->selected = 1; + currentReq->listOfRequests->selectedRequest = currentReq; + copyParameters(req, currentReq); + currentLastReq = currentReq; + } + + currentReq = currentReq->next; + + + } + + + currentReq = req->relatedRequest; + cpt = 0; + while (currentReq != NULL) { + cpt ++; + *(currentReq->listOfRequests->conditionVariable) = 1; + currentReq = currentReq->relatedRequest; + } + + +} + + +int executable(setOfRequests *list, int nb) { + int cpt = 0; + //int index = 0; + request *req = list->head; + timespec ts; + int tsDone = 0; + debug2Msg("Starting loop"); + list->hasATimeRequest = 0; + + while (req != NULL) { + if (!(req->delayElapsed)) { + if (req->hasDelay) { + // Is the delay elapsed??? + if (tsDone == 0) { + my_clock_gettime(&ts); + tsDone = 1; + } + + if (isBefore(&ts, &(req->myStartTime)) == 1) { + // Delay not elapsed + debug2Msg("---------t--------> delay NOT elapsed"); + if (list->hasATimeRequest == 0) { + list->hasATimeRequest = 1; + list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec; + list->minTimeToWait.tv_sec = req->myStartTime.tv_sec; + } else { + minTime(&(req->myStartTime), &(list->minTimeToWait), &(list->minTimeToWait)); + } + } else { + // Delay elapsed + debug2Msg("---------t--------> delay elapsed"); + req->delayElapsed = 1; + } + } else { + req->delayElapsed = 1; + } + } + req = req->nextRequestInList; + } + + req = list->head; + while ((req != NULL) && (cpt < nb)) { + req->executable = 0; + if (req->delayElapsed) { + if (req->type == SEND_SYNC_REQUEST) { + debug2Msg("Send sync"); + if (req->syncChannel->inWaitQueue != NULL) { + debug2Msg("Send sync executable"); + req->executable = 1; + cpt ++; + } else { + debug2Msg("Send sync not executable"); + } + //index ++; + } + + if (req->type == RECEIVE_SYNC_REQUEST) { + debug2Msg("receive sync"); + if (req->syncChannel->outWaitQueue != NULL) { + req->executable = 1; + cpt ++; + } + //index ++; + } + + if (req->type == SEND_ASYNC_REQUEST) { + debug2Msg("Send async"); + if (!(req->asyncChannel->isBlocking)) { + // Can always add a message -> executable + debug2Msg("Send async executable since non blocking"); + req->executable = 1; + cpt ++; + + //blocking case ... channel full? + } else { + if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) { + // Not full! + debug2Msg("Send async executable since channel not full"); + req->executable = 1; + cpt ++; + } else { + debug2Msg("Send async not executable: full, and channel is blocking"); + } + } + } + + if (req->type == RECEIVE_ASYNC_REQUEST) { + debug2Msg("receive async"); + if (req->asyncChannel->currentNbOfMessages > 0) { + debug2Msg("Receive async executable: not empty"); + req->executable = 1; + cpt ++; + } else { + debug2Msg("Receive async not executable: empty"); + } + //index ++; + } + + + if (req->type == SEND_BROADCAST_REQUEST) { + debug2Msg("send broadcast"); + req->executable = 1; + cpt ++; + } + + if (req->type == RECEIVE_BROADCAST_REQUEST) { + debug2Msg("receive broadcast"); + // A receive broadcast is never executable + req->executable = 0; + //index ++; + } + + + + + if (req->type == IMMEDIATE) { + debug2Msg("immediate"); + req->executable = 1; + cpt ++; + } + } + + req = req->nextRequestInList; + + } + + return cpt; +} + +void private__makeRequestPending(setOfRequests *list) { + request *req = list->head; + while (req != NULL) { + if ((req->delayElapsed) && (!(req->alreadyPending))) { + if (req->type == SEND_SYNC_REQUEST) { + debug2Msg("Adding pending request in outWaitqueue"); + req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); + req->alreadyPending = 1; + } + + if (req->type == RECEIVE_SYNC_REQUEST) { + debug2Msg("Adding pending request in inWaitqueue"); + req->alreadyPending = 1; + req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); + } + + if (req->type == SEND_ASYNC_REQUEST) { + debug2Msg("Adding pending request in outWaitqueue"); + req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req); + req->alreadyPending = 1; + } + + if (req->type == RECEIVE_ASYNC_REQUEST) { + debug2Msg("Adding pending request in inWaitqueue"); + req->alreadyPending = 1; + req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req); + } + + if (req->type == RECEIVE_BROADCAST_REQUEST) { + debug2Msg("Adding pending broadcast request in inWaitqueue"); + req->alreadyPending = 1; + req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); + } + + if (req->type == SEND_BROADCAST_REQUEST) { + debug2Msg("Adding pending broadcast request in outWaitqueue"); + req->alreadyPending = 1; + req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); + } + + } + + req = req->nextRequestInList; + } +} + +void private__makeRequest(request *req) { + if (req->type == SEND_SYNC_REQUEST) { + executeSendSyncTransaction(req); + } + + if (req->type == RECEIVE_SYNC_REQUEST) { + executeReceiveSyncTransaction(req); + } + + if (req->type == SEND_ASYNC_REQUEST) { + executeSendAsyncTransaction(req); + } + + if (req->type == RECEIVE_ASYNC_REQUEST) { + executeReceiveAsyncTransaction(req); + } + + if (req->type == SEND_BROADCAST_REQUEST) { + executeSendBroadcastTransaction(req); + } + // IMMEDIATE: Nothing to do + + // In all cases: remove other requests of the same list from their pending form1 + debug2Msg("Removing original req"); + removeAllPendingRequestsFromPendingLists(req, 1); + removeAllPendingRequestsFromPendingListsRelatedRequests(req); + if (req->relatedRequest != NULL) { + debug2Msg("Removing related req"); + removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); + } + + +} + +void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) { + if (req->relatedRequest != NULL) { + debug2Msg("Removing related req"); + removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); + // Recursive call + removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest); + } +} + + +request *private__executeRequests0(setOfRequests *list, int nb) { + int howMany, found; + int selectedIndex, realIndex; + request *selectedReq; + request *req; + + // Compute which requests can be executed + debug2Msg("Counting requests"); + howMany = executable(list, nb); + + + + if (howMany == 0) { + debug2Msg("No pending requests"); + // Must make them pending + + private__makeRequestPending(list); + + return NULL; + } + + + + // Select a request + req = list->head; + selectedIndex = (rand() % howMany) + 1; + + realIndex = 0; + found = 0; + while (req != NULL) { + if (req->executable == 1) { + found ++; + if (found == selectedIndex) { + break; + } + } + realIndex ++; + req = req->nextRequestInList; + } + + selectedReq = getRequestAtIndex(list, realIndex); + selectedReq->selected = 1; + selectedReq->listOfRequests->selectedRequest = selectedReq; + + // Execute that request + private__makeRequest(selectedReq); + + return selectedReq; +} + + +request *private__executeRequests(setOfRequests *list) { + // Is a request already selected? + + if (list->selectedRequest != NULL) { + return list->selectedRequest; + } + debug2Msg("No request selected -> looking for one!"); + return private__executeRequests0(list, nbOfRequests(list)); +} + + + + +request *executeOneRequest(setOfRequests *list, request *req) { + req->nextRequestInList = NULL; + req->listOfRequests = list; + list->head = req; + return executeListOfRequests(list); +} + + +void setLocalStartTime(setOfRequests *list) { + + request *req = list->head; + + while (req != NULL) { + if (req->hasDelay) { + req->delayElapsed = 0; + addTime(&(list->startTime), &(req->delay), &(req->myStartTime)); + debug2Msg(" -----t------>: Request with delay"); + } else { + debug2Msg(" -----t------>: Request without delay"); + req->delayElapsed = 1; + req->myStartTime.tv_nsec = list->startTime.tv_nsec; + req->myStartTime.tv_sec = list->startTime.tv_sec; + } + req = req->nextRequestInList; + list->mutex->unlock(); + list->mutex->lock(); + } +} + + +// Return the executed request +struct request *executeListOfRequests(struct setOfRequests *list) { + request *req; + + my_clock_gettime(&list->startTime); + list->selectedRequest = NULL; + setLocalStartTime(list); + + // Try to find a request that could be executed + debug2Msg("Locking mutex"); + list->mutex->unlock(); + list->mutex->lock(); + debug2Msg("Mutex locked"); + debug2Msg("Going to execute request"); + while ((req = private__executeRequests(list)) == NULL) { + debug2Msg("Waiting for request!"); + if (list->hasATimeRequest == 1) { + debug2Msg("Waiting for a request and at most for a given time"); + list->mutex->unlock(); + waitFor(list->minTimeToWait.tv_sec * 1000, list->minTimeToWait.tv_sec * 1000); + *(list->conditionVariable) = 0 ; + while (*(list->conditionVariable) != 1) { + vTaskDelay( portTICK_PERIOD_MS ); + } + + list->mutex->lock(); + + } else { + debug2Msg("Releasing mutex"); + list->mutex->unlock(); + *(list->conditionVariable) = 0 ; + while (*(list->conditionVariable) != 1) { + vTaskDelay( portTICK_PERIOD_MS ); + } + + list->mutex->lock(); + } + debug2Msg("Waking up for requests! -> getting mutex"); + } + debug2Msg("Request selected!"); + my_clock_gettime(&list->completionTime); + list->mutex->unlock(); + debug2Msg("Mutex unlocked"); + return req; +} + + +void debug2Msg(char* val ) { + if (debug == DEBUG_ON) { + Serial.println(val) ; + } +} \ No newline at end of file diff --git a/modeling/.DS_Store b/modeling/.DS_Store index 9c9a6e7f9a09faa86de2165583dfa1453974e00a..f36e1a6322d375468707decfcae614ddfbaa64c4 100644 Binary files a/modeling/.DS_Store and b/modeling/.DS_Store differ diff --git a/modeling/Arduino_Blinking.ttool/Arduino_Blinking.xml b/modeling/Arduino_Blinking.ttool/Arduino_Blinking.xml new file mode 100644 index 0000000000000000000000000000000000000000..bcaa4dc5c9635dd45805e960f9f3d4d13467c2d1 --- /dev/null +++ b/modeling/Arduino_Blinking.ttool/Arduino_Blinking.xml @@ -0,0 +1,524 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<TURTLEGMODELING version="1.0beta"> + +<Modeling type="AVATAR Design" nameTab="Design" > +<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" > +<MainCode value="void __user_init() {"/> +<MainCode value="}"/> +<Optimized value="true" /> +<Validated value="MainBlock;" /> +<Ignored value="" /> + +<COMPONENT type="5000" id="25" > +<cdparam x="158" y="141" /> +<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Block0" value="MainBlock" /> +<TGConnectingPoint num="0" id="1" /> +<TGConnectingPoint num="1" id="2" /> +<TGConnectingPoint num="2" id="3" /> +<TGConnectingPoint num="3" id="4" /> +<TGConnectingPoint num="4" id="5" /> +<TGConnectingPoint num="5" id="6" /> +<TGConnectingPoint num="6" id="7" /> +<TGConnectingPoint num="7" id="8" /> +<TGConnectingPoint num="8" id="9" /> +<TGConnectingPoint num="9" id="10" /> +<TGConnectingPoint num="10" id="11" /> +<TGConnectingPoint num="11" id="12" /> +<TGConnectingPoint num="12" id="13" /> +<TGConnectingPoint num="13" id="14" /> +<TGConnectingPoint num="14" id="15" /> +<TGConnectingPoint num="15" id="16" /> +<TGConnectingPoint num="16" id="17" /> +<TGConnectingPoint num="17" id="18" /> +<TGConnectingPoint num="18" id="19" /> +<TGConnectingPoint num="19" id="20" /> +<TGConnectingPoint num="20" id="21" /> +<TGConnectingPoint num="21" id="22" /> +<TGConnectingPoint num="22" id="23" /> +<TGConnectingPoint num="23" id="24" /> +<extraparam> +<blockType data="block" color="-4072719" /> +<CryptoBlock value="false" /> +<Attribute access="0" id="period" value="1000" type="8" typeOther="" /> +<Attribute access="0" id="x" value="0" type="8" typeOther="" /> +<Method value="$ledOn()" /> +<Method value="$ledOff()" /> +<Method value="$initLed()" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock__ledOn(){" /> +<globalCode value="digitalWrite(13,HIGH) ; " /> +<globalCode value="}" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock__ledOff(){" /> +<globalCode value="digitalWrite(13,LOW) ; " /> +<globalCode value="}" /> +<globalCode value="void __userImplemented__MainBlock__initLed(){" /> +<globalCode value="pinMode(13,OUTPUT) ;" /> +<globalCode value="}" /> +</extraparam> +</COMPONENT> + + +</AVATARBlockDiagramPanel> + +<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="1173" minY="10" maxY="1630" > +<CONNECTOR type="5102" id="40" > +<cdparam x="478" y="506" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="35" /> +<TGConnectingPoint num="1" id="36" /> +<TGConnectingPoint num="2" id="37" /> +<TGConnectingPoint num="3" id="38" /> +<TGConnectingPoint num="4" id="39" /> +<P1 x="488" y="515" id="82" /> +<P2 x="527" y="173" id="205" /> +<Point x="488" y="535" /> +<Point x="684" y="535" /> +<Point x="684" y="153" /> +<Point x="547" y="153" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="26" > +<father id="40" num="0" /> +<cdparam x="488" y="535" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="27" > +<father id="40" num="1" /> +<cdparam x="684" y="535" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="28" > +<father id="40" num="2" /> +<cdparam x="684" y="153" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="29" > +<father id="40" num="3" /> +<cdparam x="547" y="153" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="34" > +<father id="40" num="4" /> +<cdparam x="623" y="340" /> +<sizeparam width="73" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="30" /> +<TGConnectingPoint num="1" id="31" /> +<TGConnectingPoint num="2" id="32" /> +<TGConnectingPoint num="3" id="33" /> +<extraparam> +<guard value="[ else ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOff()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="47" > +<cdparam x="406" y="206" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="46" /> +<P1 x="428" y="198" id="207" /> +<P2 x="428" y="259" id="161" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="45" > +<father id="47" num="0" /> +<cdparam x="430" y="232" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="41" /> +<TGConnectingPoint num="1" id="42" /> +<TGConnectingPoint num="2" id="43" /> +<TGConnectingPoint num="3" id="44" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="54" > +<cdparam x="407" y="70" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="53" /> +<P1 x="428" y="94" id="242" /> +<P2 x="428" y="148" id="202" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="52" > +<father id="54" num="0" /> +<cdparam x="439" y="118" /> +<sizeparam width="51" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="48" /> +<TGConnectingPoint num="1" id="49" /> +<TGConnectingPoint num="2" id="50" /> +<TGConnectingPoint num="3" id="51" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="initLed()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="61" > +<cdparam x="468" y="332" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="60" /> +<P1 x="428" y="309" id="166" /> +<P2 x="428" y="379" id="120" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="59" > +<father id="61" num="0" /> +<cdparam x="435" y="340" /> +<sizeparam width="115" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="55" /> +<TGConnectingPoint num="1" id="56" /> +<TGConnectingPoint num="2" id="57" /> +<TGConnectingPoint num="3" id="58" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOn()" enabled="true"/> +<actions value="x=x+1" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="68" > +<cdparam x="537" y="410" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="67" /> +<P1 x="428" y="429" id="125" /> +<P2 x="427" y="494" id="79" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="66" > +<father id="68" num="0" /> +<cdparam x="432" y="458" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="62" /> +<TGConnectingPoint num="1" id="63" /> +<TGConnectingPoint num="2" id="64" /> +<TGConnectingPoint num="3" id="65" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="75" > +<cdparam x="442" y="536" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="74" /> +<P1 x="427" y="536" id="84" /> +<P2 x="427" y="593" id="76" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="73" > +<father id="75" num="0" /> +<cdparam x="445" y="574" /> +<sizeparam width="54" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="69" /> +<TGConnectingPoint num="1" id="70" /> +<TGConnectingPoint num="2" id="71" /> +<TGConnectingPoint num="3" id="72" /> +<extraparam> +<guard value="[ x > 10]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOff()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5101" id="77" > +<cdparam x="417" y="598" /> +<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="stop state" value="null" /> +<TGConnectingPoint num="0" id="76" /> +</COMPONENT> + +<COMPONENT type="5106" id="118" > +<cdparam x="367" y="494" /> +<sizeparam width="121" height="42" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="offPeriodOK" /> +<TGConnectingPoint num="0" id="78" /> +<TGConnectingPoint num="1" id="79" /> +<TGConnectingPoint num="2" id="80" /> +<TGConnectingPoint num="3" id="81" /> +<TGConnectingPoint num="4" id="82" /> +<TGConnectingPoint num="5" id="83" /> +<TGConnectingPoint num="6" id="84" /> +<TGConnectingPoint num="7" id="85" /> +<TGConnectingPoint num="8" id="86" /> +<TGConnectingPoint num="9" id="87" /> +<TGConnectingPoint num="10" id="88" /> +<TGConnectingPoint num="11" id="89" /> +<TGConnectingPoint num="12" id="90" /> +<TGConnectingPoint num="13" id="91" /> +<TGConnectingPoint num="14" id="92" /> +<TGConnectingPoint num="15" id="93" /> +<TGConnectingPoint num="16" id="94" /> +<TGConnectingPoint num="17" id="95" /> +<TGConnectingPoint num="18" id="96" /> +<TGConnectingPoint num="19" id="97" /> +<TGConnectingPoint num="20" id="98" /> +<TGConnectingPoint num="21" id="99" /> +<TGConnectingPoint num="22" id="100" /> +<TGConnectingPoint num="23" id="101" /> +<TGConnectingPoint num="24" id="102" /> +<TGConnectingPoint num="25" id="103" /> +<TGConnectingPoint num="26" id="104" /> +<TGConnectingPoint num="27" id="105" /> +<TGConnectingPoint num="28" id="106" /> +<TGConnectingPoint num="29" id="107" /> +<TGConnectingPoint num="30" id="108" /> +<TGConnectingPoint num="31" id="109" /> +<TGConnectingPoint num="32" id="110" /> +<TGConnectingPoint num="33" id="111" /> +<TGConnectingPoint num="34" id="112" /> +<TGConnectingPoint num="35" id="113" /> +<TGConnectingPoint num="36" id="114" /> +<TGConnectingPoint num="37" id="115" /> +<TGConnectingPoint num="38" id="116" /> +<TGConnectingPoint num="39" id="117" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="159" > +<cdparam x="324" y="379" /> +<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOff" /> +<TGConnectingPoint num="0" id="119" /> +<TGConnectingPoint num="1" id="120" /> +<TGConnectingPoint num="2" id="121" /> +<TGConnectingPoint num="3" id="122" /> +<TGConnectingPoint num="4" id="123" /> +<TGConnectingPoint num="5" id="124" /> +<TGConnectingPoint num="6" id="125" /> +<TGConnectingPoint num="7" id="126" /> +<TGConnectingPoint num="8" id="127" /> +<TGConnectingPoint num="9" id="128" /> +<TGConnectingPoint num="10" id="129" /> +<TGConnectingPoint num="11" id="130" /> +<TGConnectingPoint num="12" id="131" /> +<TGConnectingPoint num="13" id="132" /> +<TGConnectingPoint num="14" id="133" /> +<TGConnectingPoint num="15" id="134" /> +<TGConnectingPoint num="16" id="135" /> +<TGConnectingPoint num="17" id="136" /> +<TGConnectingPoint num="18" id="137" /> +<TGConnectingPoint num="19" id="138" /> +<TGConnectingPoint num="20" id="139" /> +<TGConnectingPoint num="21" id="140" /> +<TGConnectingPoint num="22" id="141" /> +<TGConnectingPoint num="23" id="142" /> +<TGConnectingPoint num="24" id="143" /> +<TGConnectingPoint num="25" id="144" /> +<TGConnectingPoint num="26" id="145" /> +<TGConnectingPoint num="27" id="146" /> +<TGConnectingPoint num="28" id="147" /> +<TGConnectingPoint num="29" id="148" /> +<TGConnectingPoint num="30" id="149" /> +<TGConnectingPoint num="31" id="150" /> +<TGConnectingPoint num="32" id="151" /> +<TGConnectingPoint num="33" id="152" /> +<TGConnectingPoint num="34" id="153" /> +<TGConnectingPoint num="35" id="154" /> +<TGConnectingPoint num="36" id="155" /> +<TGConnectingPoint num="37" id="156" /> +<TGConnectingPoint num="38" id="157" /> +<TGConnectingPoint num="39" id="158" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="200" > +<cdparam x="346" y="259" /> +<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="onPeriodOK" /> +<TGConnectingPoint num="0" id="160" /> +<TGConnectingPoint num="1" id="161" /> +<TGConnectingPoint num="2" id="162" /> +<TGConnectingPoint num="3" id="163" /> +<TGConnectingPoint num="4" id="164" /> +<TGConnectingPoint num="5" id="165" /> +<TGConnectingPoint num="6" id="166" /> +<TGConnectingPoint num="7" id="167" /> +<TGConnectingPoint num="8" id="168" /> +<TGConnectingPoint num="9" id="169" /> +<TGConnectingPoint num="10" id="170" /> +<TGConnectingPoint num="11" id="171" /> +<TGConnectingPoint num="12" id="172" /> +<TGConnectingPoint num="13" id="173" /> +<TGConnectingPoint num="14" id="174" /> +<TGConnectingPoint num="15" id="175" /> +<TGConnectingPoint num="16" id="176" /> +<TGConnectingPoint num="17" id="177" /> +<TGConnectingPoint num="18" id="178" /> +<TGConnectingPoint num="19" id="179" /> +<TGConnectingPoint num="20" id="180" /> +<TGConnectingPoint num="21" id="181" /> +<TGConnectingPoint num="22" id="182" /> +<TGConnectingPoint num="23" id="183" /> +<TGConnectingPoint num="24" id="184" /> +<TGConnectingPoint num="25" id="185" /> +<TGConnectingPoint num="26" id="186" /> +<TGConnectingPoint num="27" id="187" /> +<TGConnectingPoint num="28" id="188" /> +<TGConnectingPoint num="29" id="189" /> +<TGConnectingPoint num="30" id="190" /> +<TGConnectingPoint num="31" id="191" /> +<TGConnectingPoint num="32" id="192" /> +<TGConnectingPoint num="33" id="193" /> +<TGConnectingPoint num="34" id="194" /> +<TGConnectingPoint num="35" id="195" /> +<TGConnectingPoint num="36" id="196" /> +<TGConnectingPoint num="37" id="197" /> +<TGConnectingPoint num="38" id="198" /> +<TGConnectingPoint num="39" id="199" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="241" > +<cdparam x="329" y="148" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOn" /> +<TGConnectingPoint num="0" id="201" /> +<TGConnectingPoint num="1" id="202" /> +<TGConnectingPoint num="2" id="203" /> +<TGConnectingPoint num="3" id="204" /> +<TGConnectingPoint num="4" id="205" /> +<TGConnectingPoint num="5" id="206" /> +<TGConnectingPoint num="6" id="207" /> +<TGConnectingPoint num="7" id="208" /> +<TGConnectingPoint num="8" id="209" /> +<TGConnectingPoint num="9" id="210" /> +<TGConnectingPoint num="10" id="211" /> +<TGConnectingPoint num="11" id="212" /> +<TGConnectingPoint num="12" id="213" /> +<TGConnectingPoint num="13" id="214" /> +<TGConnectingPoint num="14" id="215" /> +<TGConnectingPoint num="15" id="216" /> +<TGConnectingPoint num="16" id="217" /> +<TGConnectingPoint num="17" id="218" /> +<TGConnectingPoint num="18" id="219" /> +<TGConnectingPoint num="19" id="220" /> +<TGConnectingPoint num="20" id="221" /> +<TGConnectingPoint num="21" id="222" /> +<TGConnectingPoint num="22" id="223" /> +<TGConnectingPoint num="23" id="224" /> +<TGConnectingPoint num="24" id="225" /> +<TGConnectingPoint num="25" id="226" /> +<TGConnectingPoint num="26" id="227" /> +<TGConnectingPoint num="27" id="228" /> +<TGConnectingPoint num="28" id="229" /> +<TGConnectingPoint num="29" id="230" /> +<TGConnectingPoint num="30" id="231" /> +<TGConnectingPoint num="31" id="232" /> +<TGConnectingPoint num="32" id="233" /> +<TGConnectingPoint num="33" id="234" /> +<TGConnectingPoint num="34" id="235" /> +<TGConnectingPoint num="35" id="236" /> +<TGConnectingPoint num="36" id="237" /> +<TGConnectingPoint num="37" id="238" /> +<TGConnectingPoint num="38" id="239" /> +<TGConnectingPoint num="39" id="240" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="243" > +<cdparam x="421" y="74" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="242" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +</Modeling> + + + + +</TURTLEGMODELING> \ No newline at end of file diff --git a/modeling/BlinkingLed.ttool/project_config.xml b/modeling/Arduino_Blinking.ttool/project_config.xml similarity index 74% rename from modeling/BlinkingLed.ttool/project_config.xml rename to modeling/Arduino_Blinking.ttool/project_config.xml index af16091e2363455364258ba7c54cec415551f2c0..45d7a5f955224b152dc57ad1e4b9b9b58ca0561c 100644 --- a/modeling/BlinkingLed.ttool/project_config.xml +++ b/modeling/Arduino_Blinking.ttool/project_config.xml @@ -2,5 +2,5 @@ <PROJECTCONFIGURATION> <LastVCD data=""/> -<LastOpenDiagram tab="0" panel="0"/> +<LastOpenDiagram tab="0" panel="0" /> </PROJECTCONFIGURATION> diff --git a/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar.xml b/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a2400d5ceb11fc272cd187ebaf7a08118cba9a1 --- /dev/null +++ b/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar.xml @@ -0,0 +1,1004 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<TURTLEGMODELING version="1.0beta"> + +<Modeling type="AVATAR Design" nameTab="Design" > +<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" > +<MainCode value="void __user_init() {"/> +<MainCode value="}"/> +<Optimized value="false" /> +<Validated value="" /> +<Ignored value="" /> + +<COMPONENT type="5000" id="25" > +<cdparam x="177" y="146" /> +<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Block0" value="MainBlock" /> +<TGConnectingPoint num="0" id="1" /> +<TGConnectingPoint num="1" id="2" /> +<TGConnectingPoint num="2" id="3" /> +<TGConnectingPoint num="3" id="4" /> +<TGConnectingPoint num="4" id="5" /> +<TGConnectingPoint num="5" id="6" /> +<TGConnectingPoint num="6" id="7" /> +<TGConnectingPoint num="7" id="8" /> +<TGConnectingPoint num="8" id="9" /> +<TGConnectingPoint num="9" id="10" /> +<TGConnectingPoint num="10" id="11" /> +<TGConnectingPoint num="11" id="12" /> +<TGConnectingPoint num="12" id="13" /> +<TGConnectingPoint num="13" id="14" /> +<TGConnectingPoint num="14" id="15" /> +<TGConnectingPoint num="15" id="16" /> +<TGConnectingPoint num="16" id="17" /> +<TGConnectingPoint num="17" id="18" /> +<TGConnectingPoint num="18" id="19" /> +<TGConnectingPoint num="19" id="20" /> +<TGConnectingPoint num="20" id="21" /> +<TGConnectingPoint num="21" id="22" /> +<TGConnectingPoint num="22" id="23" /> +<TGConnectingPoint num="23" id="24" /> +<extraparam> +<blockType data="block" color="-4072719" /> +<CryptoBlock value="false" /> +<Attribute access="0" id="period" value="1000" type="8" typeOther="" /> +<Attribute access="0" id="x" value="0" type="8" typeOther="" /> +<Attribute access="0" id="period2" value="100" type="8" typeOther="" /> +<Method value="$ledOn()" /> +<Method value="$ledOff()" /> +<Method value="$initLed()" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock__ledOn(){" /> +<globalCode value="digitalWrite(13,HIGH) ; " /> +<globalCode value="Serial.println("Led ON from Task1");" /> +<globalCode value="}" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock__ledOff(){" /> +<globalCode value="digitalWrite(13,LOW) ; " /> +<globalCode value="Serial.println("Led OFF from Task1");" /> +<globalCode value="}" /> +<globalCode value="void __userImplemented__MainBlock__initLed(){" /> +<globalCode value="pinMode(13,OUTPUT) ;" /> +<globalCode value="}" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5000" id="50" > +<cdparam x="471" y="147" /> +<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Block0" value="MainBlock_0" /> +<TGConnectingPoint num="0" id="26" /> +<TGConnectingPoint num="1" id="27" /> +<TGConnectingPoint num="2" id="28" /> +<TGConnectingPoint num="3" id="29" /> +<TGConnectingPoint num="4" id="30" /> +<TGConnectingPoint num="5" id="31" /> +<TGConnectingPoint num="6" id="32" /> +<TGConnectingPoint num="7" id="33" /> +<TGConnectingPoint num="8" id="34" /> +<TGConnectingPoint num="9" id="35" /> +<TGConnectingPoint num="10" id="36" /> +<TGConnectingPoint num="11" id="37" /> +<TGConnectingPoint num="12" id="38" /> +<TGConnectingPoint num="13" id="39" /> +<TGConnectingPoint num="14" id="40" /> +<TGConnectingPoint num="15" id="41" /> +<TGConnectingPoint num="16" id="42" /> +<TGConnectingPoint num="17" id="43" /> +<TGConnectingPoint num="18" id="44" /> +<TGConnectingPoint num="19" id="45" /> +<TGConnectingPoint num="20" id="46" /> +<TGConnectingPoint num="21" id="47" /> +<TGConnectingPoint num="22" id="48" /> +<TGConnectingPoint num="23" id="49" /> +<extraparam> +<blockType data="block" color="-4072719" /> +<CryptoBlock value="false" /> +<Attribute access="0" id="period" value="2000" type="8" typeOther="" /> +<Attribute access="0" id="x" value="0" type="8" typeOther="" /> +<Attribute access="0" id="period2" value="100" type="8" typeOther="" /> +<Method value="$getDistance()" /> +<Method value="$initPins()" /> +<globalCode value="const int trigPin = 2;" /> +<globalCode value="const int echoPin = 3;" /> +<globalCode value="" /> +<globalCode value="long duration;" /> +<globalCode value="int distance;" /> +<globalCode value="" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock_0__initPins(){" /> +<globalCode value=" pinMode(trigPin, OUTPUT); " /> +<globalCode value=" pinMode(echoPin, INPUT);" /> +<globalCode value="}" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__MainBlock_0__getDistance(){" /> +<globalCode value="digitalWrite(trigPin, LOW);" /> +<globalCode value=" delayMicroseconds(2);" /> +<globalCode value=" // Sets the trigPin on HIGH state for 10 micro seconds" /> +<globalCode value=" digitalWrite(trigPin, HIGH);" /> +<globalCode value=" delayMicroseconds(10);" /> +<globalCode value=" digitalWrite(trigPin, LOW);" /> +<globalCode value=" // Reads the echoPin, returns the sound wave travel time in microseconds" /> +<globalCode value=" duration = pulseIn(echoPin, HIGH);" /> +<globalCode value=" // Calculating the distance" /> +<globalCode value=" distance = duration * 0.034 / 2;" /> +<globalCode value=" // Prints the distance on the Serial Monitor" /> +<globalCode value=" Serial.print("Distance from Task 2: ");" /> +<globalCode value=" Serial.println(distance);" /> +<globalCode value="}" /> +</extraparam> +</COMPONENT> + + +</AVATARBlockDiagramPanel> + +<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="1173" minY="10" maxY="1630" > +<CONNECTOR type="5102" id="61" > +<cdparam x="478" y="506" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="58" /> +<TGConnectingPoint num="1" id="59" /> +<TGConnectingPoint num="2" id="60" /> +<P1 x="400" y="528" id="111" /> +<P2 x="334" y="173" id="225" /> +<Point x="179" y="527" /> +<Point x="177" y="173" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="51" > +<father id="61" num="0" /> +<cdparam x="179" y="527" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="673" minY="10" maxY="630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="52" > +<father id="61" num="1" /> +<cdparam x="177" y="173" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="673" minY="10" maxY="630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="57" > +<father id="61" num="2" /> +<cdparam x="184" y="393" /> +<sizeparam width="73" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="53" /> +<TGConnectingPoint num="1" id="54" /> +<TGConnectingPoint num="2" id="55" /> +<TGConnectingPoint num="3" id="56" /> +<extraparam> +<guard value="[ else ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOff()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="68" > +<cdparam x="406" y="206" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="67" /> +<P1 x="407" y="198" id="251" /> +<P2 x="407" y="259" id="198" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="66" > +<father id="68" num="0" /> +<cdparam x="410" y="232" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="62" /> +<TGConnectingPoint num="1" id="63" /> +<TGConnectingPoint num="2" id="64" /> +<TGConnectingPoint num="3" id="65" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="75" > +<cdparam x="407" y="70" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="74" /> +<P1 x="406" y="117" id="263" /> +<P2 x="407" y="148" id="239" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="73" > +<father id="75" num="0" /> +<cdparam x="412" y="128" /> +<sizeparam width="51" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="69" /> +<TGConnectingPoint num="1" id="70" /> +<TGConnectingPoint num="2" id="71" /> +<TGConnectingPoint num="3" id="72" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="initLed()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="82" > +<cdparam x="468" y="332" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="81" /> +<P1 x="407" y="309" id="210" /> +<P2 x="408" y="379" id="141" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="80" > +<father id="82" num="0" /> +<cdparam x="411" y="338" /> +<sizeparam width="115" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="76" /> +<TGConnectingPoint num="1" id="77" /> +<TGConnectingPoint num="2" id="78" /> +<TGConnectingPoint num="3" id="79" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOn()" enabled="true"/> +<actions value="x=x+1" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="89" > +<cdparam x="537" y="410" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="88" /> +<P1 x="460" y="429" id="155" /> +<P2 x="460" y="497" id="100" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="87" > +<father id="89" num="0" /> +<cdparam x="465" y="462" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="83" /> +<TGConnectingPoint num="1" id="84" /> +<TGConnectingPoint num="2" id="85" /> +<TGConnectingPoint num="3" id="86" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="96" > +<cdparam x="410" y="540" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="95" /> +<P1 x="414" y="539" id="127" /> +<P2 x="415" y="600" id="97" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="94" > +<father id="96" num="0" /> +<cdparam x="424" y="564" /> +<sizeparam width="46" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="90" /> +<TGConnectingPoint num="1" id="91" /> +<TGConnectingPoint num="2" id="92" /> +<TGConnectingPoint num="3" id="93" /> +<extraparam> +<guard value="[x>5 ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOff()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5101" id="98" > +<cdparam x="405" y="605" /> +<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="stop state" value="null" /> +<TGConnectingPoint num="0" id="97" /> +</COMPONENT> + +<COMPONENT type="5106" id="139" > +<cdparam x="400" y="497" /> +<sizeparam width="121" height="42" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="offPeriodOK" /> +<TGConnectingPoint num="0" id="99" /> +<TGConnectingPoint num="1" id="100" /> +<TGConnectingPoint num="2" id="101" /> +<TGConnectingPoint num="3" id="102" /> +<TGConnectingPoint num="4" id="103" /> +<TGConnectingPoint num="5" id="104" /> +<TGConnectingPoint num="6" id="105" /> +<TGConnectingPoint num="7" id="106" /> +<TGConnectingPoint num="8" id="107" /> +<TGConnectingPoint num="9" id="108" /> +<TGConnectingPoint num="10" id="109" /> +<TGConnectingPoint num="11" id="110" /> +<TGConnectingPoint num="12" id="111" /> +<TGConnectingPoint num="13" id="112" /> +<TGConnectingPoint num="14" id="113" /> +<TGConnectingPoint num="15" id="114" /> +<TGConnectingPoint num="16" id="115" /> +<TGConnectingPoint num="17" id="116" /> +<TGConnectingPoint num="18" id="117" /> +<TGConnectingPoint num="19" id="118" /> +<TGConnectingPoint num="20" id="119" /> +<TGConnectingPoint num="21" id="120" /> +<TGConnectingPoint num="22" id="121" /> +<TGConnectingPoint num="23" id="122" /> +<TGConnectingPoint num="24" id="123" /> +<TGConnectingPoint num="25" id="124" /> +<TGConnectingPoint num="26" id="125" /> +<TGConnectingPoint num="27" id="126" /> +<TGConnectingPoint num="28" id="127" /> +<TGConnectingPoint num="29" id="128" /> +<TGConnectingPoint num="30" id="129" /> +<TGConnectingPoint num="31" id="130" /> +<TGConnectingPoint num="32" id="131" /> +<TGConnectingPoint num="33" id="132" /> +<TGConnectingPoint num="34" id="133" /> +<TGConnectingPoint num="35" id="134" /> +<TGConnectingPoint num="36" id="135" /> +<TGConnectingPoint num="37" id="136" /> +<TGConnectingPoint num="38" id="137" /> +<TGConnectingPoint num="39" id="138" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="180" > +<cdparam x="304" y="379" /> +<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOff" /> +<TGConnectingPoint num="0" id="140" /> +<TGConnectingPoint num="1" id="141" /> +<TGConnectingPoint num="2" id="142" /> +<TGConnectingPoint num="3" id="143" /> +<TGConnectingPoint num="4" id="144" /> +<TGConnectingPoint num="5" id="145" /> +<TGConnectingPoint num="6" id="146" /> +<TGConnectingPoint num="7" id="147" /> +<TGConnectingPoint num="8" id="148" /> +<TGConnectingPoint num="9" id="149" /> +<TGConnectingPoint num="10" id="150" /> +<TGConnectingPoint num="11" id="151" /> +<TGConnectingPoint num="12" id="152" /> +<TGConnectingPoint num="13" id="153" /> +<TGConnectingPoint num="14" id="154" /> +<TGConnectingPoint num="15" id="155" /> +<TGConnectingPoint num="16" id="156" /> +<TGConnectingPoint num="17" id="157" /> +<TGConnectingPoint num="18" id="158" /> +<TGConnectingPoint num="19" id="159" /> +<TGConnectingPoint num="20" id="160" /> +<TGConnectingPoint num="21" id="161" /> +<TGConnectingPoint num="22" id="162" /> +<TGConnectingPoint num="23" id="163" /> +<TGConnectingPoint num="24" id="164" /> +<TGConnectingPoint num="25" id="165" /> +<TGConnectingPoint num="26" id="166" /> +<TGConnectingPoint num="27" id="167" /> +<TGConnectingPoint num="28" id="168" /> +<TGConnectingPoint num="29" id="169" /> +<TGConnectingPoint num="30" id="170" /> +<TGConnectingPoint num="31" id="171" /> +<TGConnectingPoint num="32" id="172" /> +<TGConnectingPoint num="33" id="173" /> +<TGConnectingPoint num="34" id="174" /> +<TGConnectingPoint num="35" id="175" /> +<TGConnectingPoint num="36" id="176" /> +<TGConnectingPoint num="37" id="177" /> +<TGConnectingPoint num="38" id="178" /> +<TGConnectingPoint num="39" id="179" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="221" > +<cdparam x="346" y="259" /> +<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="onPeriodOK" /> +<TGConnectingPoint num="0" id="181" /> +<TGConnectingPoint num="1" id="182" /> +<TGConnectingPoint num="2" id="183" /> +<TGConnectingPoint num="3" id="184" /> +<TGConnectingPoint num="4" id="185" /> +<TGConnectingPoint num="5" id="186" /> +<TGConnectingPoint num="6" id="187" /> +<TGConnectingPoint num="7" id="188" /> +<TGConnectingPoint num="8" id="189" /> +<TGConnectingPoint num="9" id="190" /> +<TGConnectingPoint num="10" id="191" /> +<TGConnectingPoint num="11" id="192" /> +<TGConnectingPoint num="12" id="193" /> +<TGConnectingPoint num="13" id="194" /> +<TGConnectingPoint num="14" id="195" /> +<TGConnectingPoint num="15" id="196" /> +<TGConnectingPoint num="16" id="197" /> +<TGConnectingPoint num="17" id="198" /> +<TGConnectingPoint num="18" id="199" /> +<TGConnectingPoint num="19" id="200" /> +<TGConnectingPoint num="20" id="201" /> +<TGConnectingPoint num="21" id="202" /> +<TGConnectingPoint num="22" id="203" /> +<TGConnectingPoint num="23" id="204" /> +<TGConnectingPoint num="24" id="205" /> +<TGConnectingPoint num="25" id="206" /> +<TGConnectingPoint num="26" id="207" /> +<TGConnectingPoint num="27" id="208" /> +<TGConnectingPoint num="28" id="209" /> +<TGConnectingPoint num="29" id="210" /> +<TGConnectingPoint num="30" id="211" /> +<TGConnectingPoint num="31" id="212" /> +<TGConnectingPoint num="32" id="213" /> +<TGConnectingPoint num="33" id="214" /> +<TGConnectingPoint num="34" id="215" /> +<TGConnectingPoint num="35" id="216" /> +<TGConnectingPoint num="36" id="217" /> +<TGConnectingPoint num="37" id="218" /> +<TGConnectingPoint num="38" id="219" /> +<TGConnectingPoint num="39" id="220" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="262" > +<cdparam x="334" y="148" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOn" /> +<TGConnectingPoint num="0" id="222" /> +<TGConnectingPoint num="1" id="223" /> +<TGConnectingPoint num="2" id="224" /> +<TGConnectingPoint num="3" id="225" /> +<TGConnectingPoint num="4" id="226" /> +<TGConnectingPoint num="5" id="227" /> +<TGConnectingPoint num="6" id="228" /> +<TGConnectingPoint num="7" id="229" /> +<TGConnectingPoint num="8" id="230" /> +<TGConnectingPoint num="9" id="231" /> +<TGConnectingPoint num="10" id="232" /> +<TGConnectingPoint num="11" id="233" /> +<TGConnectingPoint num="12" id="234" /> +<TGConnectingPoint num="13" id="235" /> +<TGConnectingPoint num="14" id="236" /> +<TGConnectingPoint num="15" id="237" /> +<TGConnectingPoint num="16" id="238" /> +<TGConnectingPoint num="17" id="239" /> +<TGConnectingPoint num="18" id="240" /> +<TGConnectingPoint num="19" id="241" /> +<TGConnectingPoint num="20" id="242" /> +<TGConnectingPoint num="21" id="243" /> +<TGConnectingPoint num="22" id="244" /> +<TGConnectingPoint num="23" id="245" /> +<TGConnectingPoint num="24" id="246" /> +<TGConnectingPoint num="25" id="247" /> +<TGConnectingPoint num="26" id="248" /> +<TGConnectingPoint num="27" id="249" /> +<TGConnectingPoint num="28" id="250" /> +<TGConnectingPoint num="29" id="251" /> +<TGConnectingPoint num="30" id="252" /> +<TGConnectingPoint num="31" id="253" /> +<TGConnectingPoint num="32" id="254" /> +<TGConnectingPoint num="33" id="255" /> +<TGConnectingPoint num="34" id="256" /> +<TGConnectingPoint num="35" id="257" /> +<TGConnectingPoint num="36" id="258" /> +<TGConnectingPoint num="37" id="259" /> +<TGConnectingPoint num="38" id="260" /> +<TGConnectingPoint num="39" id="261" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="264" > +<cdparam x="399" y="97" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="263" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +<AVATARStateMachineDiagramPanel name="MainBlock_0" minX="10" maxX="1173" minY="10" maxY="1630" > +<CONNECTOR type="5102" id="271" > +<cdparam x="471" y="540" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="270" /> +<P1 x="473" y="538" id="343" /> +<P2 x="473" y="594" id="311" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="269" > +<father id="271" num="0" /> +<cdparam x="483" y="562" /> +<sizeparam width="46" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="265" /> +<TGConnectingPoint num="1" id="266" /> +<TGConnectingPoint num="2" id="267" /> +<TGConnectingPoint num="3" id="268" /> +<extraparam> +<guard value="[ x>10]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="282" > +<cdparam x="478" y="506" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="279" /> +<TGConnectingPoint num="1" id="280" /> +<TGConnectingPoint num="2" id="281" /> +<P1 x="398" y="528" id="325" /> +<P2 x="334" y="173" id="439" /> +<Point x="181" y="528" /> +<Point x="177" y="173" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="272" > +<father id="282" num="0" /> +<cdparam x="181" y="528" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="673" minY="10" maxY="630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="273" > +<father id="282" num="1" /> +<cdparam x="177" y="173" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="673" minY="10" maxY="630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="278" > +<father id="282" num="2" /> +<cdparam x="242" y="375" /> +<sizeparam width="73" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="274" /> +<TGConnectingPoint num="1" id="275" /> +<TGConnectingPoint num="2" id="276" /> +<TGConnectingPoint num="3" id="277" /> +<extraparam> +<guard value="[ else ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="289" > +<cdparam x="406" y="206" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="288" /> +<P1 x="407" y="198" id="465" /> +<P2 x="407" y="259" id="412" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="287" > +<father id="289" num="0" /> +<cdparam x="411" y="228" /> +<sizeparam width="148" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="283" /> +<TGConnectingPoint num="1" id="284" /> +<TGConnectingPoint num="2" id="285" /> +<TGConnectingPoint num="3" id="286" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="296" > +<cdparam x="407" y="70" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="295" /> +<P1 x="407" y="124" id="477" /> +<P2 x="407" y="148" id="453" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="294" > +<father id="296" num="0" /> +<cdparam x="414" y="123" /> +<sizeparam width="100" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="290" /> +<TGConnectingPoint num="1" id="291" /> +<TGConnectingPoint num="2" id="292" /> +<TGConnectingPoint num="3" id="293" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="500" enabled="true"/> +<afterMax value="500" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="initPins()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="303" > +<cdparam x="468" y="332" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="302" /> +<P1 x="407" y="309" id="424" /> +<P2 x="407" y="376" id="355" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="301" > +<father id="303" num="0" /> +<cdparam x="413" y="336" /> +<sizeparam width="115" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="297" /> +<TGConnectingPoint num="1" id="298" /> +<TGConnectingPoint num="2" id="299" /> +<TGConnectingPoint num="3" id="300" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="x=x+1" enabled="true"/> +<actions value="getDistance()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="310" > +<cdparam x="537" y="410" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="309" /> +<P1 x="459" y="426" id="369" /> +<P2 x="458" y="501" id="314" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="308" > +<father id="310" num="0" /> +<cdparam x="942" y="938" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="304" /> +<TGConnectingPoint num="1" id="305" /> +<TGConnectingPoint num="2" id="306" /> +<TGConnectingPoint num="3" id="307" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5101" id="312" > +<cdparam x="463" y="599" /> +<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="stop state" value="null" /> +<TGConnectingPoint num="0" id="311" /> +</COMPONENT> + +<COMPONENT type="5106" id="353" > +<cdparam x="398" y="501" /> +<sizeparam width="121" height="37" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="offPeriodOK" /> +<TGConnectingPoint num="0" id="313" /> +<TGConnectingPoint num="1" id="314" /> +<TGConnectingPoint num="2" id="315" /> +<TGConnectingPoint num="3" id="316" /> +<TGConnectingPoint num="4" id="317" /> +<TGConnectingPoint num="5" id="318" /> +<TGConnectingPoint num="6" id="319" /> +<TGConnectingPoint num="7" id="320" /> +<TGConnectingPoint num="8" id="321" /> +<TGConnectingPoint num="9" id="322" /> +<TGConnectingPoint num="10" id="323" /> +<TGConnectingPoint num="11" id="324" /> +<TGConnectingPoint num="12" id="325" /> +<TGConnectingPoint num="13" id="326" /> +<TGConnectingPoint num="14" id="327" /> +<TGConnectingPoint num="15" id="328" /> +<TGConnectingPoint num="16" id="329" /> +<TGConnectingPoint num="17" id="330" /> +<TGConnectingPoint num="18" id="331" /> +<TGConnectingPoint num="19" id="332" /> +<TGConnectingPoint num="20" id="333" /> +<TGConnectingPoint num="21" id="334" /> +<TGConnectingPoint num="22" id="335" /> +<TGConnectingPoint num="23" id="336" /> +<TGConnectingPoint num="24" id="337" /> +<TGConnectingPoint num="25" id="338" /> +<TGConnectingPoint num="26" id="339" /> +<TGConnectingPoint num="27" id="340" /> +<TGConnectingPoint num="28" id="341" /> +<TGConnectingPoint num="29" id="342" /> +<TGConnectingPoint num="30" id="343" /> +<TGConnectingPoint num="31" id="344" /> +<TGConnectingPoint num="32" id="345" /> +<TGConnectingPoint num="33" id="346" /> +<TGConnectingPoint num="34" id="347" /> +<TGConnectingPoint num="35" id="348" /> +<TGConnectingPoint num="36" id="349" /> +<TGConnectingPoint num="37" id="350" /> +<TGConnectingPoint num="38" id="351" /> +<TGConnectingPoint num="39" id="352" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="394" > +<cdparam x="303" y="376" /> +<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOff" /> +<TGConnectingPoint num="0" id="354" /> +<TGConnectingPoint num="1" id="355" /> +<TGConnectingPoint num="2" id="356" /> +<TGConnectingPoint num="3" id="357" /> +<TGConnectingPoint num="4" id="358" /> +<TGConnectingPoint num="5" id="359" /> +<TGConnectingPoint num="6" id="360" /> +<TGConnectingPoint num="7" id="361" /> +<TGConnectingPoint num="8" id="362" /> +<TGConnectingPoint num="9" id="363" /> +<TGConnectingPoint num="10" id="364" /> +<TGConnectingPoint num="11" id="365" /> +<TGConnectingPoint num="12" id="366" /> +<TGConnectingPoint num="13" id="367" /> +<TGConnectingPoint num="14" id="368" /> +<TGConnectingPoint num="15" id="369" /> +<TGConnectingPoint num="16" id="370" /> +<TGConnectingPoint num="17" id="371" /> +<TGConnectingPoint num="18" id="372" /> +<TGConnectingPoint num="19" id="373" /> +<TGConnectingPoint num="20" id="374" /> +<TGConnectingPoint num="21" id="375" /> +<TGConnectingPoint num="22" id="376" /> +<TGConnectingPoint num="23" id="377" /> +<TGConnectingPoint num="24" id="378" /> +<TGConnectingPoint num="25" id="379" /> +<TGConnectingPoint num="26" id="380" /> +<TGConnectingPoint num="27" id="381" /> +<TGConnectingPoint num="28" id="382" /> +<TGConnectingPoint num="29" id="383" /> +<TGConnectingPoint num="30" id="384" /> +<TGConnectingPoint num="31" id="385" /> +<TGConnectingPoint num="32" id="386" /> +<TGConnectingPoint num="33" id="387" /> +<TGConnectingPoint num="34" id="388" /> +<TGConnectingPoint num="35" id="389" /> +<TGConnectingPoint num="36" id="390" /> +<TGConnectingPoint num="37" id="391" /> +<TGConnectingPoint num="38" id="392" /> +<TGConnectingPoint num="39" id="393" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="435" > +<cdparam x="346" y="259" /> +<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="onPeriodOK" /> +<TGConnectingPoint num="0" id="395" /> +<TGConnectingPoint num="1" id="396" /> +<TGConnectingPoint num="2" id="397" /> +<TGConnectingPoint num="3" id="398" /> +<TGConnectingPoint num="4" id="399" /> +<TGConnectingPoint num="5" id="400" /> +<TGConnectingPoint num="6" id="401" /> +<TGConnectingPoint num="7" id="402" /> +<TGConnectingPoint num="8" id="403" /> +<TGConnectingPoint num="9" id="404" /> +<TGConnectingPoint num="10" id="405" /> +<TGConnectingPoint num="11" id="406" /> +<TGConnectingPoint num="12" id="407" /> +<TGConnectingPoint num="13" id="408" /> +<TGConnectingPoint num="14" id="409" /> +<TGConnectingPoint num="15" id="410" /> +<TGConnectingPoint num="16" id="411" /> +<TGConnectingPoint num="17" id="412" /> +<TGConnectingPoint num="18" id="413" /> +<TGConnectingPoint num="19" id="414" /> +<TGConnectingPoint num="20" id="415" /> +<TGConnectingPoint num="21" id="416" /> +<TGConnectingPoint num="22" id="417" /> +<TGConnectingPoint num="23" id="418" /> +<TGConnectingPoint num="24" id="419" /> +<TGConnectingPoint num="25" id="420" /> +<TGConnectingPoint num="26" id="421" /> +<TGConnectingPoint num="27" id="422" /> +<TGConnectingPoint num="28" id="423" /> +<TGConnectingPoint num="29" id="424" /> +<TGConnectingPoint num="30" id="425" /> +<TGConnectingPoint num="31" id="426" /> +<TGConnectingPoint num="32" id="427" /> +<TGConnectingPoint num="33" id="428" /> +<TGConnectingPoint num="34" id="429" /> +<TGConnectingPoint num="35" id="430" /> +<TGConnectingPoint num="36" id="431" /> +<TGConnectingPoint num="37" id="432" /> +<TGConnectingPoint num="38" id="433" /> +<TGConnectingPoint num="39" id="434" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="476" > +<cdparam x="334" y="148" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOn" /> +<TGConnectingPoint num="0" id="436" /> +<TGConnectingPoint num="1" id="437" /> +<TGConnectingPoint num="2" id="438" /> +<TGConnectingPoint num="3" id="439" /> +<TGConnectingPoint num="4" id="440" /> +<TGConnectingPoint num="5" id="441" /> +<TGConnectingPoint num="6" id="442" /> +<TGConnectingPoint num="7" id="443" /> +<TGConnectingPoint num="8" id="444" /> +<TGConnectingPoint num="9" id="445" /> +<TGConnectingPoint num="10" id="446" /> +<TGConnectingPoint num="11" id="447" /> +<TGConnectingPoint num="12" id="448" /> +<TGConnectingPoint num="13" id="449" /> +<TGConnectingPoint num="14" id="450" /> +<TGConnectingPoint num="15" id="451" /> +<TGConnectingPoint num="16" id="452" /> +<TGConnectingPoint num="17" id="453" /> +<TGConnectingPoint num="18" id="454" /> +<TGConnectingPoint num="19" id="455" /> +<TGConnectingPoint num="20" id="456" /> +<TGConnectingPoint num="21" id="457" /> +<TGConnectingPoint num="22" id="458" /> +<TGConnectingPoint num="23" id="459" /> +<TGConnectingPoint num="24" id="460" /> +<TGConnectingPoint num="25" id="461" /> +<TGConnectingPoint num="26" id="462" /> +<TGConnectingPoint num="27" id="463" /> +<TGConnectingPoint num="28" id="464" /> +<TGConnectingPoint num="29" id="465" /> +<TGConnectingPoint num="30" id="466" /> +<TGConnectingPoint num="31" id="467" /> +<TGConnectingPoint num="32" id="468" /> +<TGConnectingPoint num="33" id="469" /> +<TGConnectingPoint num="34" id="470" /> +<TGConnectingPoint num="35" id="471" /> +<TGConnectingPoint num="36" id="472" /> +<TGConnectingPoint num="37" id="473" /> +<TGConnectingPoint num="38" id="474" /> +<TGConnectingPoint num="39" id="475" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="478" > +<cdparam x="400" y="104" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="477" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +</Modeling> + + + + +</TURTLEGMODELING> \ No newline at end of file diff --git a/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar_Circuit b/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar_Circuit new file mode 100755 index 0000000000000000000000000000000000000000..b4d58401a41f7d5dd8ca19013a1a0f74efa976d1 Binary files /dev/null and b/modeling/Arduino_Blinking_and_Sonar.ttool/Arduino_Blinking_and_Sonar_Circuit differ diff --git a/modeling/Arduino_Blinking_and_Sonar.ttool/project_config.xml b/modeling/Arduino_Blinking_and_Sonar.ttool/project_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..45d7a5f955224b152dc57ad1e4b9b9b58ca0561c --- /dev/null +++ b/modeling/Arduino_Blinking_and_Sonar.ttool/project_config.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<PROJECTCONFIGURATION> +<LastVCD data=""/> +<LastOpenDiagram tab="0" panel="0" /> +</PROJECTCONFIGURATION> diff --git a/modeling/Arduino_Signals_Test.ttool/Arduino_Signals_Test.xml b/modeling/Arduino_Signals_Test.ttool/Arduino_Signals_Test.xml new file mode 100644 index 0000000000000000000000000000000000000000..dda7217d44e357367d8e1939203a4edfb4a076ea --- /dev/null +++ b/modeling/Arduino_Signals_Test.ttool/Arduino_Signals_Test.xml @@ -0,0 +1,1058 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<TURTLEGMODELING version="1.0beta"> + +<Modeling type="AVATAR Design" nameTab="Design" > +<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" > +<MainCode value="void __user_init() {"/> +<MainCode value="}"/> +<Optimized value="false" /> +<Validated value="" /> +<Ignored value="" /> + +<CONNECTOR type="5002" id="2" > +<cdparam x="338" y="195" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="" /> +<TGConnectingPoint num="0" id="1" /> +<P1 x="338" y="195" id="14" /> +<P2 x="551" y="198" id="38" /> +<AutomaticDrawing data="true" /> +<extraparam> +<isd value="in TurnOn()" /> +<isd value="in TurnOff()" /> +<oso value="out TurnOn()" /> +<oso value="out TurnOff()" /> +<FIFOType asynchronous="true" size="1" blocking="false" private="true" broadcast="false" lossy="false" /> +</extraparam> +</CONNECTOR> +<COMPONENT type="5000" id="27" > +<cdparam x="88" y="145" /> +<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Block0" value="Commander" /> +<TGConnectingPoint num="0" id="3" /> +<TGConnectingPoint num="1" id="4" /> +<TGConnectingPoint num="2" id="5" /> +<TGConnectingPoint num="3" id="6" /> +<TGConnectingPoint num="4" id="7" /> +<TGConnectingPoint num="5" id="8" /> +<TGConnectingPoint num="6" id="9" /> +<TGConnectingPoint num="7" id="10" /> +<TGConnectingPoint num="8" id="11" /> +<TGConnectingPoint num="9" id="12" /> +<TGConnectingPoint num="10" id="13" /> +<TGConnectingPoint num="11" id="14" /> +<TGConnectingPoint num="12" id="15" /> +<TGConnectingPoint num="13" id="16" /> +<TGConnectingPoint num="14" id="17" /> +<TGConnectingPoint num="15" id="18" /> +<TGConnectingPoint num="16" id="19" /> +<TGConnectingPoint num="17" id="20" /> +<TGConnectingPoint num="18" id="21" /> +<TGConnectingPoint num="19" id="22" /> +<TGConnectingPoint num="20" id="23" /> +<TGConnectingPoint num="21" id="24" /> +<TGConnectingPoint num="22" id="25" /> +<TGConnectingPoint num="23" id="26" /> +<extraparam> +<blockType data="block" color="-4072719" /> +<CryptoBlock value="false" /> +<Attribute access="0" id="period" value="1000" type="8" typeOther="" /> +<Attribute access="0" id="x" value="0" type="8" typeOther="" /> +<Attribute access="0" id="period2" value="100" type="8" typeOther="" /> +<Signal value="out TurnOn()" attached="true" /> +<Signal value="out TurnOff()" attached="true" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5000" id="52" > +<cdparam x="551" y="148" /> +<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Block0" value="Executer" /> +<TGConnectingPoint num="0" id="28" /> +<TGConnectingPoint num="1" id="29" /> +<TGConnectingPoint num="2" id="30" /> +<TGConnectingPoint num="3" id="31" /> +<TGConnectingPoint num="4" id="32" /> +<TGConnectingPoint num="5" id="33" /> +<TGConnectingPoint num="6" id="34" /> +<TGConnectingPoint num="7" id="35" /> +<TGConnectingPoint num="8" id="36" /> +<TGConnectingPoint num="9" id="37" /> +<TGConnectingPoint num="10" id="38" /> +<TGConnectingPoint num="11" id="39" /> +<TGConnectingPoint num="12" id="40" /> +<TGConnectingPoint num="13" id="41" /> +<TGConnectingPoint num="14" id="42" /> +<TGConnectingPoint num="15" id="43" /> +<TGConnectingPoint num="16" id="44" /> +<TGConnectingPoint num="17" id="45" /> +<TGConnectingPoint num="18" id="46" /> +<TGConnectingPoint num="19" id="47" /> +<TGConnectingPoint num="20" id="48" /> +<TGConnectingPoint num="21" id="49" /> +<TGConnectingPoint num="22" id="50" /> +<TGConnectingPoint num="23" id="51" /> +<extraparam> +<blockType data="block" color="-4072719" /> +<CryptoBlock value="false" /> +<Method value="ledOn()" /> +<Method value="ledOff()" /> +<Signal value="in TurnOn()" attached="true" /> +<Signal value="in TurnOff()" attached="true" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__Executer__ledOn(){" /> +<globalCode value="digitalWrite(13,HIGH) ; " /> +<globalCode value="}" /> +<globalCode value="" /> +<globalCode value="void __userImplemented__Executer__ledOff(){" /> +<globalCode value="digitalWrite(13,LOW) ; " /> +<globalCode value="}" /> +<globalCode value="void __userImplemented__Executer__initLed(){" /> +<globalCode value="pinMode(13,OUTPUT) ;" /> +<globalCode value="}" /> +</extraparam> +</COMPONENT> + + +</AVATARBlockDiagramPanel> + +<AVATARStateMachineDiagramPanel name="Commander" minX="10" maxX="1173" minY="10" maxY="1630" > +<CONNECTOR type="5102" id="59" > +<cdparam x="540" y="642" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="58" /> +<P1 x="540" y="642" id="304" /> +<P2 x="609" y="699" id="135" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="57" > +<father id="59" num="0" /> +<cdparam x="574" y="670" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="53" /> +<TGConnectingPoint num="1" id="54" /> +<TGConnectingPoint num="2" id="55" /> +<TGConnectingPoint num="3" id="56" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="74" > +<cdparam x="311" y="599" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="69" /> +<TGConnectingPoint num="1" id="70" /> +<TGConnectingPoint num="2" id="71" /> +<TGConnectingPoint num="3" id="72" /> +<TGConnectingPoint num="4" id="73" /> +<P1 x="357" y="597" id="315" /> +<P2 x="334" y="166" id="281" /> +<Point x="311" y="619" /> +<Point x="162" y="619" /> +<Point x="162" y="146" /> +<Point x="314" y="146" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="60" > +<father id="74" num="0" /> +<cdparam x="311" y="619" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="61" > +<father id="74" num="1" /> +<cdparam x="162" y="619" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="62" > +<father id="74" num="2" /> +<cdparam x="162" y="146" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="63" > +<father id="74" num="3" /> +<cdparam x="314" y="146" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="68" > +<father id="74" num="4" /> +<cdparam x="691" y="763" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="64" /> +<TGConnectingPoint num="1" id="65" /> +<TGConnectingPoint num="2" id="66" /> +<TGConnectingPoint num="3" id="67" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="81" > +<cdparam x="463" y="541" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="80" /> +<P1 x="463" y="541" id="152" /> +<P2 x="357" y="567" id="314" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="79" > +<father id="81" num="0" /> +<cdparam x="399" y="581" /> +<sizeparam width="44" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="75" /> +<TGConnectingPoint num="1" id="76" /> +<TGConnectingPoint num="2" id="77" /> +<TGConnectingPoint num="3" id="78" /> +<extraparam> +<guard value="[ else ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="88" > +<cdparam x="408" y="369" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="87" /> +<P1 x="408" y="366" id="125" /> +<P2 x="409" y="390" id="179" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="86" > +<father id="88" num="0" /> +<cdparam x="408" y="379" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="82" /> +<TGConnectingPoint num="1" id="83" /> +<TGConnectingPoint num="2" id="84" /> +<TGConnectingPoint num="3" id="85" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="95" > +<cdparam x="406" y="206" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="94" /> +<P1 x="407" y="198" id="289" /> +<P2 x="407" y="259" id="236" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="93" > +<father id="95" num="0" /> +<cdparam x="405" y="251" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="89" /> +<TGConnectingPoint num="1" id="90" /> +<TGConnectingPoint num="2" id="91" /> +<TGConnectingPoint num="3" id="92" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="102" > +<cdparam x="407" y="70" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="101" /> +<P1 x="407" y="70" id="301" /> +<P2 x="407" y="148" id="277" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="100" > +<father id="102" num="0" /> +<cdparam x="411" y="89" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="96" /> +<TGConnectingPoint num="1" id="97" /> +<TGConnectingPoint num="2" id="98" /> +<TGConnectingPoint num="3" id="99" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="109" > +<cdparam x="468" y="332" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="108" /> +<P1 x="407" y="309" id="248" /> +<P2 x="408" y="336" id="124" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="107" > +<father id="109" num="0" /> +<cdparam x="418" y="329" /> +<sizeparam width="40" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="103" /> +<TGConnectingPoint num="1" id="104" /> +<TGConnectingPoint num="2" id="105" /> +<TGConnectingPoint num="3" id="106" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="x=x+1" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="116" > +<cdparam x="537" y="410" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="115" /> +<P1 x="434" y="440" id="208" /> +<P2 x="433" y="499" id="138" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="114" > +<father id="116" num="0" /> +<cdparam x="541" y="447" /> +<sizeparam width="132" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="110" /> +<TGConnectingPoint num="1" id="111" /> +<TGConnectingPoint num="2" id="112" /> +<TGConnectingPoint num="3" id="113" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="period" enabled="true"/> +<afterMax value="period" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="123" > +<cdparam x="515" y="529" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="122" /> +<P1 x="494" y="541" id="144" /> +<P2 x="540" y="612" id="303" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="121" > +<father id="123" num="0" /> +<cdparam x="594" y="632" /> +<sizeparam width="46" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="117" /> +<TGConnectingPoint num="1" id="118" /> +<TGConnectingPoint num="2" id="119" /> +<TGConnectingPoint num="3" id="120" /> +<extraparam> +<guard value="[x>5 ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5103" id="134" > +<cdparam x="376" y="341" /> +<sizeparam width="65" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="Send signal" value="TurnOn()" /> +<TGConnectingPoint num="0" id="124" /> +<TGConnectingPoint num="1" id="125" /> +<TGConnectingPoint num="2" id="126" /> +<TGConnectingPoint num="3" id="127" /> +<TGConnectingPoint num="4" id="128" /> +<TGConnectingPoint num="5" id="129" /> +<TGConnectingPoint num="6" id="130" /> +<TGConnectingPoint num="7" id="131" /> +<TGConnectingPoint num="8" id="132" /> +<TGConnectingPoint num="9" id="133" /> +</COMPONENT> + +<COMPONENT type="5101" id="136" > +<cdparam x="599" y="704" /> +<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="stop state" value="null" /> +<TGConnectingPoint num="0" id="135" /> +</COMPONENT> + +<COMPONENT type="5106" id="177" > +<cdparam x="373" y="499" /> +<sizeparam width="121" height="42" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="offPeriodOK" /> +<TGConnectingPoint num="0" id="137" /> +<TGConnectingPoint num="1" id="138" /> +<TGConnectingPoint num="2" id="139" /> +<TGConnectingPoint num="3" id="140" /> +<TGConnectingPoint num="4" id="141" /> +<TGConnectingPoint num="5" id="142" /> +<TGConnectingPoint num="6" id="143" /> +<TGConnectingPoint num="7" id="144" /> +<TGConnectingPoint num="8" id="145" /> +<TGConnectingPoint num="9" id="146" /> +<TGConnectingPoint num="10" id="147" /> +<TGConnectingPoint num="11" id="148" /> +<TGConnectingPoint num="12" id="149" /> +<TGConnectingPoint num="13" id="150" /> +<TGConnectingPoint num="14" id="151" /> +<TGConnectingPoint num="15" id="152" /> +<TGConnectingPoint num="16" id="153" /> +<TGConnectingPoint num="17" id="154" /> +<TGConnectingPoint num="18" id="155" /> +<TGConnectingPoint num="19" id="156" /> +<TGConnectingPoint num="20" id="157" /> +<TGConnectingPoint num="21" id="158" /> +<TGConnectingPoint num="22" id="159" /> +<TGConnectingPoint num="23" id="160" /> +<TGConnectingPoint num="24" id="161" /> +<TGConnectingPoint num="25" id="162" /> +<TGConnectingPoint num="26" id="163" /> +<TGConnectingPoint num="27" id="164" /> +<TGConnectingPoint num="28" id="165" /> +<TGConnectingPoint num="29" id="166" /> +<TGConnectingPoint num="30" id="167" /> +<TGConnectingPoint num="31" id="168" /> +<TGConnectingPoint num="32" id="169" /> +<TGConnectingPoint num="33" id="170" /> +<TGConnectingPoint num="34" id="171" /> +<TGConnectingPoint num="35" id="172" /> +<TGConnectingPoint num="36" id="173" /> +<TGConnectingPoint num="37" id="174" /> +<TGConnectingPoint num="38" id="175" /> +<TGConnectingPoint num="39" id="176" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="218" > +<cdparam x="305" y="390" /> +<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOff" /> +<TGConnectingPoint num="0" id="178" /> +<TGConnectingPoint num="1" id="179" /> +<TGConnectingPoint num="2" id="180" /> +<TGConnectingPoint num="3" id="181" /> +<TGConnectingPoint num="4" id="182" /> +<TGConnectingPoint num="5" id="183" /> +<TGConnectingPoint num="6" id="184" /> +<TGConnectingPoint num="7" id="185" /> +<TGConnectingPoint num="8" id="186" /> +<TGConnectingPoint num="9" id="187" /> +<TGConnectingPoint num="10" id="188" /> +<TGConnectingPoint num="11" id="189" /> +<TGConnectingPoint num="12" id="190" /> +<TGConnectingPoint num="13" id="191" /> +<TGConnectingPoint num="14" id="192" /> +<TGConnectingPoint num="15" id="193" /> +<TGConnectingPoint num="16" id="194" /> +<TGConnectingPoint num="17" id="195" /> +<TGConnectingPoint num="18" id="196" /> +<TGConnectingPoint num="19" id="197" /> +<TGConnectingPoint num="20" id="198" /> +<TGConnectingPoint num="21" id="199" /> +<TGConnectingPoint num="22" id="200" /> +<TGConnectingPoint num="23" id="201" /> +<TGConnectingPoint num="24" id="202" /> +<TGConnectingPoint num="25" id="203" /> +<TGConnectingPoint num="26" id="204" /> +<TGConnectingPoint num="27" id="205" /> +<TGConnectingPoint num="28" id="206" /> +<TGConnectingPoint num="29" id="207" /> +<TGConnectingPoint num="30" id="208" /> +<TGConnectingPoint num="31" id="209" /> +<TGConnectingPoint num="32" id="210" /> +<TGConnectingPoint num="33" id="211" /> +<TGConnectingPoint num="34" id="212" /> +<TGConnectingPoint num="35" id="213" /> +<TGConnectingPoint num="36" id="214" /> +<TGConnectingPoint num="37" id="215" /> +<TGConnectingPoint num="38" id="216" /> +<TGConnectingPoint num="39" id="217" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="259" > +<cdparam x="346" y="259" /> +<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="onPeriodOK" /> +<TGConnectingPoint num="0" id="219" /> +<TGConnectingPoint num="1" id="220" /> +<TGConnectingPoint num="2" id="221" /> +<TGConnectingPoint num="3" id="222" /> +<TGConnectingPoint num="4" id="223" /> +<TGConnectingPoint num="5" id="224" /> +<TGConnectingPoint num="6" id="225" /> +<TGConnectingPoint num="7" id="226" /> +<TGConnectingPoint num="8" id="227" /> +<TGConnectingPoint num="9" id="228" /> +<TGConnectingPoint num="10" id="229" /> +<TGConnectingPoint num="11" id="230" /> +<TGConnectingPoint num="12" id="231" /> +<TGConnectingPoint num="13" id="232" /> +<TGConnectingPoint num="14" id="233" /> +<TGConnectingPoint num="15" id="234" /> +<TGConnectingPoint num="16" id="235" /> +<TGConnectingPoint num="17" id="236" /> +<TGConnectingPoint num="18" id="237" /> +<TGConnectingPoint num="19" id="238" /> +<TGConnectingPoint num="20" id="239" /> +<TGConnectingPoint num="21" id="240" /> +<TGConnectingPoint num="22" id="241" /> +<TGConnectingPoint num="23" id="242" /> +<TGConnectingPoint num="24" id="243" /> +<TGConnectingPoint num="25" id="244" /> +<TGConnectingPoint num="26" id="245" /> +<TGConnectingPoint num="27" id="246" /> +<TGConnectingPoint num="28" id="247" /> +<TGConnectingPoint num="29" id="248" /> +<TGConnectingPoint num="30" id="249" /> +<TGConnectingPoint num="31" id="250" /> +<TGConnectingPoint num="32" id="251" /> +<TGConnectingPoint num="33" id="252" /> +<TGConnectingPoint num="34" id="253" /> +<TGConnectingPoint num="35" id="254" /> +<TGConnectingPoint num="36" id="255" /> +<TGConnectingPoint num="37" id="256" /> +<TGConnectingPoint num="38" id="257" /> +<TGConnectingPoint num="39" id="258" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="300" > +<cdparam x="334" y="148" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="State" value="waitingForPeriodOn" /> +<TGConnectingPoint num="0" id="260" /> +<TGConnectingPoint num="1" id="261" /> +<TGConnectingPoint num="2" id="262" /> +<TGConnectingPoint num="3" id="263" /> +<TGConnectingPoint num="4" id="264" /> +<TGConnectingPoint num="5" id="265" /> +<TGConnectingPoint num="6" id="266" /> +<TGConnectingPoint num="7" id="267" /> +<TGConnectingPoint num="8" id="268" /> +<TGConnectingPoint num="9" id="269" /> +<TGConnectingPoint num="10" id="270" /> +<TGConnectingPoint num="11" id="271" /> +<TGConnectingPoint num="12" id="272" /> +<TGConnectingPoint num="13" id="273" /> +<TGConnectingPoint num="14" id="274" /> +<TGConnectingPoint num="15" id="275" /> +<TGConnectingPoint num="16" id="276" /> +<TGConnectingPoint num="17" id="277" /> +<TGConnectingPoint num="18" id="278" /> +<TGConnectingPoint num="19" id="279" /> +<TGConnectingPoint num="20" id="280" /> +<TGConnectingPoint num="21" id="281" /> +<TGConnectingPoint num="22" id="282" /> +<TGConnectingPoint num="23" id="283" /> +<TGConnectingPoint num="24" id="284" /> +<TGConnectingPoint num="25" id="285" /> +<TGConnectingPoint num="26" id="286" /> +<TGConnectingPoint num="27" id="287" /> +<TGConnectingPoint num="28" id="288" /> +<TGConnectingPoint num="29" id="289" /> +<TGConnectingPoint num="30" id="290" /> +<TGConnectingPoint num="31" id="291" /> +<TGConnectingPoint num="32" id="292" /> +<TGConnectingPoint num="33" id="293" /> +<TGConnectingPoint num="34" id="294" /> +<TGConnectingPoint num="35" id="295" /> +<TGConnectingPoint num="36" id="296" /> +<TGConnectingPoint num="37" id="297" /> +<TGConnectingPoint num="38" id="298" /> +<TGConnectingPoint num="39" id="299" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="302" > +<cdparam x="400" y="50" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="301" /> +</COMPONENT> + +<COMPONENT type="5103" id="313" > +<cdparam x="508" y="617" /> +<sizeparam width="65" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="Send signal" value="TurnOff()" /> +<TGConnectingPoint num="0" id="303" /> +<TGConnectingPoint num="1" id="304" /> +<TGConnectingPoint num="2" id="305" /> +<TGConnectingPoint num="3" id="306" /> +<TGConnectingPoint num="4" id="307" /> +<TGConnectingPoint num="5" id="308" /> +<TGConnectingPoint num="6" id="309" /> +<TGConnectingPoint num="7" id="310" /> +<TGConnectingPoint num="8" id="311" /> +<TGConnectingPoint num="9" id="312" /> +</COMPONENT> + +<COMPONENT type="5103" id="324" > +<cdparam x="325" y="572" /> +<sizeparam width="65" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="1173" minY="10" maxY="1630" /> +<infoparam name="Send signal" value="TurnOff()" /> +<TGConnectingPoint num="0" id="314" /> +<TGConnectingPoint num="1" id="315" /> +<TGConnectingPoint num="2" id="316" /> +<TGConnectingPoint num="3" id="317" /> +<TGConnectingPoint num="4" id="318" /> +<TGConnectingPoint num="5" id="319" /> +<TGConnectingPoint num="6" id="320" /> +<TGConnectingPoint num="7" id="321" /> +<TGConnectingPoint num="8" id="322" /> +<TGConnectingPoint num="9" id="323" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +<AVATARStateMachineDiagramPanel name="Executer" minX="10" maxX="2500" minY="10" maxY="1500" > +<CONNECTOR type="5102" id="337" > +<cdparam x="405" y="523" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="333" /> +<TGConnectingPoint num="1" id="334" /> +<TGConnectingPoint num="2" id="335" /> +<TGConnectingPoint num="3" id="336" /> +<P1 x="405" y="523" id="367" /> +<P2 x="383" y="165" id="441" /> +<Point x="405" y="543" /> +<Point x="257" y="542" /> +<Point x="257" y="164" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="325" > +<father id="337" num="0" /> +<cdparam x="405" y="543" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="326" > +<father id="337" num="1" /> +<cdparam x="257" y="542" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="327" > +<father id="337" num="2" /> +<cdparam x="257" y="164" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="332" > +<father id="337" num="3" /> +<cdparam x="412" y="453" /> +<sizeparam width="46" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="328" /> +<TGConnectingPoint num="1" id="329" /> +<TGConnectingPoint num="2" id="330" /> +<TGConnectingPoint num="3" id="331" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOff()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="344" > +<cdparam x="405" y="394" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="343" /> +<P1 x="405" y="394" id="406" /> +<P2 x="405" y="493" id="366" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="342" > +<father id="344" num="0" /> +<cdparam x="449" y="448" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="338" /> +<TGConnectingPoint num="1" id="339" /> +<TGConnectingPoint num="2" id="340" /> +<TGConnectingPoint num="3" id="341" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="351" > +<cdparam x="432" y="178" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="350" /> +<P1 x="432" y="178" id="443" /> +<P2 x="432" y="247" id="418" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="349" > +<father id="351" num="0" /> +<cdparam x="443" y="216" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="345" /> +<TGConnectingPoint num="1" id="346" /> +<TGConnectingPoint num="2" id="347" /> +<TGConnectingPoint num="3" id="348" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="358" > +<cdparam x="407" y="70" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="357" /> +<P1 x="407" y="70" id="470" /> +<P2 x="406" y="128" id="445" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="356" > +<father id="358" num="0" /> +<cdparam x="410" y="97" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="352" /> +<TGConnectingPoint num="1" id="353" /> +<TGConnectingPoint num="2" id="354" /> +<TGConnectingPoint num="3" id="355" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="365" > +<cdparam x="432" y="277" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="null" /> +<TGConnectingPoint num="0" id="364" /> +<P1 x="432" y="277" id="419" /> +<P2 x="432" y="344" id="378" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="363" > +<father id="365" num="0" /> +<cdparam x="447" y="303" /> +<sizeparam width="46" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="359" /> +<TGConnectingPoint num="1" id="360" /> +<TGConnectingPoint num="2" id="361" /> +<TGConnectingPoint num="3" id="362" /> +<extraparam> +<guard value="[ ]" enabled="true"/> +<afterMin value="" enabled="true"/> +<afterMax value="" enabled="true"/> +<computeMin value="" enabled="true"/> +<computeMax value="" enabled="true"/> +<probability value="" enabled="true"/> +<actions value="ledOn()" enabled="true"/> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5104" id="376" > +<cdparam x="369" y="498" /> +<sizeparam width="73" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Receive signal" value="TurnOff()" /> +<TGConnectingPoint num="0" id="366" /> +<TGConnectingPoint num="1" id="367" /> +<TGConnectingPoint num="2" id="368" /> +<TGConnectingPoint num="3" id="369" /> +<TGConnectingPoint num="4" id="370" /> +<TGConnectingPoint num="5" id="371" /> +<TGConnectingPoint num="6" id="372" /> +<TGConnectingPoint num="7" id="373" /> +<TGConnectingPoint num="8" id="374" /> +<TGConnectingPoint num="9" id="375" /> +</COMPONENT> + +<COMPONENT type="5106" id="417" > +<cdparam x="328" y="344" /> +<sizeparam width="209" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="State" value="waitingForOffSignal" /> +<TGConnectingPoint num="0" id="377" /> +<TGConnectingPoint num="1" id="378" /> +<TGConnectingPoint num="2" id="379" /> +<TGConnectingPoint num="3" id="380" /> +<TGConnectingPoint num="4" id="381" /> +<TGConnectingPoint num="5" id="382" /> +<TGConnectingPoint num="6" id="383" /> +<TGConnectingPoint num="7" id="384" /> +<TGConnectingPoint num="8" id="385" /> +<TGConnectingPoint num="9" id="386" /> +<TGConnectingPoint num="10" id="387" /> +<TGConnectingPoint num="11" id="388" /> +<TGConnectingPoint num="12" id="389" /> +<TGConnectingPoint num="13" id="390" /> +<TGConnectingPoint num="14" id="391" /> +<TGConnectingPoint num="15" id="392" /> +<TGConnectingPoint num="16" id="393" /> +<TGConnectingPoint num="17" id="394" /> +<TGConnectingPoint num="18" id="395" /> +<TGConnectingPoint num="19" id="396" /> +<TGConnectingPoint num="20" id="397" /> +<TGConnectingPoint num="21" id="398" /> +<TGConnectingPoint num="22" id="399" /> +<TGConnectingPoint num="23" id="400" /> +<TGConnectingPoint num="24" id="401" /> +<TGConnectingPoint num="25" id="402" /> +<TGConnectingPoint num="26" id="403" /> +<TGConnectingPoint num="27" id="404" /> +<TGConnectingPoint num="28" id="405" /> +<TGConnectingPoint num="29" id="406" /> +<TGConnectingPoint num="30" id="407" /> +<TGConnectingPoint num="31" id="408" /> +<TGConnectingPoint num="32" id="409" /> +<TGConnectingPoint num="33" id="410" /> +<TGConnectingPoint num="34" id="411" /> +<TGConnectingPoint num="35" id="412" /> +<TGConnectingPoint num="36" id="413" /> +<TGConnectingPoint num="37" id="414" /> +<TGConnectingPoint num="38" id="415" /> +<TGConnectingPoint num="39" id="416" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5104" id="428" > +<cdparam x="396" y="252" /> +<sizeparam width="73" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="Receive signal" value="TurnOn()" /> +<TGConnectingPoint num="0" id="418" /> +<TGConnectingPoint num="1" id="419" /> +<TGConnectingPoint num="2" id="420" /> +<TGConnectingPoint num="3" id="421" /> +<TGConnectingPoint num="4" id="422" /> +<TGConnectingPoint num="5" id="423" /> +<TGConnectingPoint num="6" id="424" /> +<TGConnectingPoint num="7" id="425" /> +<TGConnectingPoint num="8" id="426" /> +<TGConnectingPoint num="9" id="427" /> +</COMPONENT> + +<COMPONENT type="5106" id="469" > +<cdparam x="383" y="128" /> +<sizeparam width="198" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<enabled value="true" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="State" value="waitingForOnSignal" /> +<TGConnectingPoint num="0" id="429" /> +<TGConnectingPoint num="1" id="430" /> +<TGConnectingPoint num="2" id="431" /> +<TGConnectingPoint num="3" id="432" /> +<TGConnectingPoint num="4" id="433" /> +<TGConnectingPoint num="5" id="434" /> +<TGConnectingPoint num="6" id="435" /> +<TGConnectingPoint num="7" id="436" /> +<TGConnectingPoint num="8" id="437" /> +<TGConnectingPoint num="9" id="438" /> +<TGConnectingPoint num="10" id="439" /> +<TGConnectingPoint num="11" id="440" /> +<TGConnectingPoint num="12" id="441" /> +<TGConnectingPoint num="13" id="442" /> +<TGConnectingPoint num="14" id="443" /> +<TGConnectingPoint num="15" id="444" /> +<TGConnectingPoint num="16" id="445" /> +<TGConnectingPoint num="17" id="446" /> +<TGConnectingPoint num="18" id="447" /> +<TGConnectingPoint num="19" id="448" /> +<TGConnectingPoint num="20" id="449" /> +<TGConnectingPoint num="21" id="450" /> +<TGConnectingPoint num="22" id="451" /> +<TGConnectingPoint num="23" id="452" /> +<TGConnectingPoint num="24" id="453" /> +<TGConnectingPoint num="25" id="454" /> +<TGConnectingPoint num="26" id="455" /> +<TGConnectingPoint num="27" id="456" /> +<TGConnectingPoint num="28" id="457" /> +<TGConnectingPoint num="29" id="458" /> +<TGConnectingPoint num="30" id="459" /> +<TGConnectingPoint num="31" id="460" /> +<TGConnectingPoint num="32" id="461" /> +<TGConnectingPoint num="33" id="462" /> +<TGConnectingPoint num="34" id="463" /> +<TGConnectingPoint num="35" id="464" /> +<TGConnectingPoint num="36" id="465" /> +<TGConnectingPoint num="37" id="466" /> +<TGConnectingPoint num="38" id="467" /> +<TGConnectingPoint num="39" id="468" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="471" > +<cdparam x="400" y="50" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="470" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +</Modeling> + + + + +</TURTLEGMODELING> \ No newline at end of file diff --git a/modeling/Blinking.ttool/project_config.xml b/modeling/Arduino_Signals_Test.ttool/project_config.xml similarity index 100% rename from modeling/Blinking.ttool/project_config.xml rename to modeling/Arduino_Signals_Test.ttool/project_config.xml diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h deleted file mode 100644 index 07444898d21d3af927e8f9e1b14973c95676c1fe..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef MainBlock_H -#define MainBlock_H -#include <stdio.h> -#include <pthread.h> -#include <unistd.h> -#include <stdlib.h> - -#include "request.h" -#include "syncchannel.h" -#include "request_manager.h" -#include "debug.h" -#include "defs.h" -#include "mytimelib.h" -#include "random.h" -#include "tracemanager.h" -#include "main.h" - -extern void *mainFunc__MainBlock(void *arg); - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c deleted file mode 100644 index 8c57dc06ccb12c9affa30494b868b0e5c792081c..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <stdio.h> -#include <pthread.h> -#include <unistd.h> -#include <stdlib.h> - -#include "request.h" -#include "syncchannel.h" -#include "request_manager.h" -#include "debug.h" -#include "random.h" -#include "tracemanager.h" - -/* User code */ -void __user_init() { -} - -/* End of User code */ - -/* Main mutex */ -pthread_mutex_t __mainMutex; - -/* Synchronous channels */ -/* Asynchronous channels */ - -#include "MainBlock.h" - - -int main(int argc, char *argv[]) { - - /* disable buffering on stdout */ - setvbuf(stdout, NULL, _IONBF, 0); - - /* Synchronous channels */ - /* Asynchronous channels */ - - /* Threads of tasks */ - pthread_t thread__MainBlock; - /* Activating tracing */ - if (argc>1){ - activeTracingInFile(argv[1]); - } else { - activeTracingInConsole(); - } - /* Activating randomness */ - initRandom(); - /* Initializing the main mutex */ -if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);} - - /* Initializing mutex of messages */ - initMessages(); - /* User initialization */ - __user_init(); - - - pthread_create(&thread__MainBlock, NULL, mainFunc__MainBlock, (void *)"MainBlock"); - - - pthread_join(thread__MainBlock, NULL); - - - return 0; - -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h deleted file mode 100644 index e96bd1901b8aca37e1aeefbb38eabfc1aea9de74..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/main.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H -/* Main mutex */ -extern pthread_mutex_t __mainMutex; - -/* Synchronous channels */ -/* Asynchronous channels */ -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c deleted file mode 100644 index e2ce2ac48a62b888eedc7940c74b1ae1f3953013..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <stdlib.h> - -#include "message.h" -#include "asyncchannel.h" -#include "myerrors.h" - - -asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) { - asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel))); - if (asyncch == NULL) { - criticalError("Allocation of asyncchannel failed"); - } - asyncch->inname = inname; - asyncch->outname = outname; - asyncch->isBlocking = isBlocking; - asyncch->maxNbOfMessages = maxNbOfMessages; - - return asyncch; -} - -void destroyAsyncchannel(asyncchannel *asyncch) { - free(asyncch); -} - -message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) { - message *msg; - message *previous; - - if (channel->currentNbOfMessages == 0) { - return NULL; - } - - if (channel->currentNbOfMessages == 1) { - channel->currentNbOfMessages = 0; - msg = channel->pendingMessages; - channel->pendingMessages = NULL; - return msg; - } - - msg = channel->pendingMessages; - previous = msg; - while(msg->next != NULL) { - previous = msg; - msg = msg->next; - } - - channel->currentNbOfMessages = channel->currentNbOfMessages -1; - previous->next = NULL; - return msg; -} - -void addMessageToAsyncChannel(asyncchannel *channel, message *msg) { - msg->next = channel->pendingMessages; - channel->pendingMessages = msg; - channel->currentNbOfMessages = channel->currentNbOfMessages+1; -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h deleted file mode 100644 index 8f812359dbd67311f37391807b883890ee163f04..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/asyncchannel.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ASYNCCHANNEL_H -#define ASYNCCHANNEL_H - -struct asyncchannel; - -#include "message.h" -#include "request.h" - - -struct asyncchannel { - char *outname; - char *inname; - int isBlocking; // In writing. Reading is always blocking - int maxNbOfMessages; // - struct request* outWaitQueue; - struct request* inWaitQueue; - message *pendingMessages; - int currentNbOfMessages; -}; - -typedef struct asyncchannel asyncchannel; - -asyncchannel *getNewAsyncchannel(char *inname, char *outname, int isBlocking, int maxNbOfMessages); -void destroyAsyncchannel(asyncchannel *syncch); -message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel); -void addMessageToAsyncChannel(asyncchannel *channel, message *msg); - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c deleted file mode 100644 index 067d0a8c17e3861ce60191884c13041d9e88431b..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.c +++ /dev/null @@ -1,86 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <time.h> - -#include "debug.h" - - -#define DEBUG_ON 1 -#define DEBUG_OFF 2 - -int debug = DEBUG_OFF; - -void activeDebug() { - debug = DEBUG_ON; -} - -void unactiveDebug() { - debug = DEBUG_OFF; -} - -void debugThreeInts(char *msg, int value1, int value2, int value3) { - if (debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - printf("DT> %s: %d, %d, %d\n", msg, value1, value2, value3); - } -} - -void debugTwoInts(char *msg, int value1, int value2) { - if (debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - printf("DT> %s: %d, %d\n", msg, value1, value2); - } -} - -void debugInt(char *msg, int value) { - if (debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - printf("DT> %s: %d\n", msg, value); - } -} - -void debugLong(char *msg, long value) { - if (debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - printf("DT> %s: %ld\n", msg, value); - } -} - -void debugMsg(char *msg) { - if (debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - printf("DT> %s\n", msg); - } -} - -void debug2Msg(char *name, char *msg) { - if (debug == DEBUG_OFF) { - return; - } - - if ((name != NULL) && (msg != NULL)) { - printf("DT - %s -> %s\n", name, msg); - } -} - -void debugTime(char *msg, struct timespec *ts) { - if (debug == DEBUG_OFF) { - return; - } - printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h deleted file mode 100644 index 7e73f3ce91684420195a07eb365184b0629e74f3..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/debug.h +++ /dev/null @@ -1,19 +0,0 @@ - - -#ifndef DEBUG_H -#define DEBUG_H - -void activeDebug(); -void unactiveDebug(); - -void debugThreeInts(char *msg, int value1, int value2, int value3); -void debugTwoInts(char *msg, int value1, int value2); -void debugLong(char *msg, long value); -void debugInt(char *msg, int value); -void debugMsg(char *msg); -void debug2Msg(char *name, char* msg); -void debugTime(char* msg, struct timespec *ts); - -#endif - - diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h deleted file mode 100644 index 3b997bfdf885b560dc4fde8264e8b5026565de10..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/defs.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DEFS_H -#define DEFS_H - -#define bool int -#define true 1 -#define false 0 - - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c deleted file mode 100644 index 1153a882f51d93d8596621162f82278bc01d7158..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.c +++ /dev/null @@ -1,59 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> -#include <pthread.h> - -#include "message.h" -#include "myerrors.h" - -long __id_message = 0; -pthread_mutex_t __message_mutex; - - -void initMessages() { - if (pthread_mutex_init(&__message_mutex, NULL) < 0) { exit(-1);} -} - -long getMessageID() { - long tmp; - pthread_mutex_lock(&__message_mutex); - tmp = __id_message; - __id_message ++; - pthread_mutex_unlock(&__message_mutex); - return tmp; -} - -message *getNewMessageWithParams(int nbOfParams) { - - message *msg = (message *)(malloc(sizeof(struct message))); - if (msg == NULL) { - criticalError("Allocation of request failed"); - } - msg->nbOfParams = nbOfParams; - msg->params = (int *)(malloc(sizeof(int) * nbOfParams)); - msg->id = getMessageID(); - return msg; -} - -message *getNewMessage(int nbOfParams, int *params) { - - message *msg = (message *)(malloc(sizeof(struct message))); - if (msg == NULL) { - criticalError("Allocation of request failed"); - } - msg->nbOfParams = nbOfParams; - msg->params = params; - msg->id = getMessageID(); - return msg; -} - - - -void destroyMessageWithParams(message *msg) { - free(msg->params); - free(msg); -} - -void destroyMessage(message *msg) { - free(msg); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h deleted file mode 100644 index 700ed07d97f6ae925ceeb6c172238a2f4bd37680..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/message.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MESSAGE_H -#define MESSAGE_H - - -struct message { - struct message *next; - int nbOfParams; - int *params; - long id; -}; - -typedef struct message message; - -void initMessages(); -message *getNewMessageWithParams(int nbOfParams); -message *getNewMessage(int nbOfParams, int *params); -void destroyMessageWithParams(message *msg); -void destroyMessage(message *msg); - - - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c deleted file mode 100644 index dfe16a1c469f6e11382dfae037b3d4ff89cf8c7b..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.c +++ /dev/null @@ -1,24 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> - -#include "myerrors.h" - - - - -void criticalErrorInt(char *msg, int value) { - if (msg != NULL) { - printf("\nCritical error: %s, %d\n", msg, value); - } - - exit(-1); -} - - -void criticalError(char *msg) { - if (msg != NULL) { - printf("\nCritical error: %s\n", msg); - } - - exit(-1); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c deleted file mode 100644 index d39c07ea85c258ce227365364163ce1761038663..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.c +++ /dev/null @@ -1,108 +0,0 @@ -#include<time.h> - -#include "mytimelib.h" -#include "random.h" -#include "debug.h" - -#ifndef CLOCK_REALTIME -#define CLOCK_REALTIME - -int clock_gettime(struct timespec *ts) { - struct timeval tv; - gettimeofday(&tv, NULL); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; - return 0; -} - -int my_clock_gettime(struct timespec *tp) { - return clock_gettime(tp); -} - -#else - -int my_clock_gettime(struct timespec *tp) { - return clock_gettime(CLOCK_REALTIME, tp); -} - -#endif - - - -void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - dest->tv_nsec = src1->tv_nsec + src2->tv_nsec; - dest->tv_sec = src1->tv_sec + src2->tv_sec; - if (dest->tv_nsec > 1000000000) { - dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000); - dest->tv_nsec = dest->tv_nsec % 1000000000; - } -} - -void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - int diff = 0; - if (src1->tv_nsec > src2->tv_nsec) { - diff ++; - dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000; - } else { - dest->tv_nsec = src2->tv_nsec - src1->tv_nsec; - } - - dest->tv_sec = src2->tv_sec - src1->tv_sec - diff; -} - - - -int isBefore(struct timespec *src1, struct timespec *src2) { - if (src1->tv_sec > src2->tv_sec) { - return 0; - } - - if (src1->tv_sec < src2->tv_sec) { - return 1; - } - - if (src1->tv_nsec < src2->tv_nsec) { - return 1; - } - return 0; -} - -void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - debugMsg("MIN TIME COMPUTATION"); - if (isBefore(src1,src2)) { - dest->tv_nsec = src1->tv_nsec; - dest->tv_sec = src1->tv_sec; - } else { - dest->tv_nsec = src2->tv_nsec; - dest->tv_sec = src2->tv_sec; - } - -} - - -void delayToTimeSpec(struct timespec *ts, long delay) { - ts->tv_nsec = (delay % 1000000)*1000; - ts->tv_sec = (delay / 1000000); -} - -void waitFor(long minDelay, long maxDelay) { - struct timespec tssrc; - struct timespec tsret; - int delay; - - - - debugMsg("Computing random delay"); - //debugLong("Min delay", minDelay); - //debugLong("Max delay", maxDelay); - delay = computeLongRandom(minDelay, maxDelay); - - debugLong("Random delay=", delay); - - delayToTimeSpec(&tssrc, delay); - - debugLong("............. waiting For", delay); - nanosleep(&tssrc, &tsret); - debugLong("............. waiting Done for: ", delay); -} - diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h deleted file mode 100644 index 76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/mytimelib.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef MYTIMELIB_H -#define MYTIMELIB_H - -#include <time.h> -#include <sys/time.h> - - - -// in usec - -int my_clock_gettime(struct timespec *tp); -void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -int isBefore(struct timespec *src1, struct timespec *src2); -void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -void delayToTimeSpec(struct timespec *ts, long delay); -extern void waitFor(long minDelay, long maxDelay); - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c deleted file mode 100644 index b4bbddb19ac1e4a51bf5c0205aab571a7580dd32..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/random.c +++ /dev/null @@ -1,43 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> -#include <time.h> -#include <limits.h> - -#include "random.h" -#include "debug.h" -#include <math.h> - -#include "mytimelib.h" - -int computeRandom(int min, int max) { - if (min == max) { - return min; - } - return (rand() % (max - min)) + min; -} - -long computeLongRandom(long min, long max) { - - if (min == max) { - return min; - } - - - long rand0 = (long)rand(); - long rand1 = rand0 % (max - min); - //debugLong("min=", min); - //debugLong("max=", max); - //debugLong("rand0", rand0); - //debugLong("rand1", rand1); - //debugLong("Random long", rand1 + min); - return rand1 + min; -} - -void initRandom() { - struct timespec ts; - - my_clock_gettime(&ts); - - srand((int)(ts.tv_nsec)); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c deleted file mode 100644 index af1231c61b71a7aab28063dfcf5eefc9faabf6b5..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.c +++ /dev/null @@ -1,271 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> - -#include "request.h" -#include "mytimelib.h" -#include "myerrors.h" -#include "random.h" -#include "debug.h" - - -request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { - request *req = (request *)(malloc(sizeof(struct request))); - - if (req == NULL) { - criticalError("Allocation of request failed"); - } - - makeNewRequest(req, ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params); - return req; -} - - -// Delays are in microseconds -void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { - long delay; - int i; - - req->next = NULL; - req->listOfRequests = NULL; - req->nextRequestInList = NULL; - - req->type = type; - req->ID = ID; - req->hasDelay = hasDelay; - - if (req->hasDelay > 0) { - delay = computeLongRandom(minDelay, maxDelay); - delayToTimeSpec(&(req->delay), delay); - } - - req->selected = 0; - req->nbOfParams = nbOfParams; - req->params = params; - - req->alreadyPending = 0; - req->delayElapsed = 0; - - req->relatedRequest = NULL; - - if (type == SEND_ASYNC_REQUEST) { - // Must create a new message - req->msg = getNewMessageWithParams(nbOfParams); - for(i=0; i<nbOfParams; i++) { - req->msg->params[i] = *(params[i]); - } - } - -} - - - - -void destroyRequest(request *req) { - free((void *)req); -} - -int isRequestSelected(request *req) { - return req->selected; -} - -int nbOfRequests(setOfRequests *list) { - int cpt = 0; - request *req; - - req = list->head; - - while(req != NULL) { - cpt ++; - req = req->nextRequestInList; - } - - return cpt; -} - -request *getRequestAtIndex(setOfRequests *list, int index) { - int cpt = 0; - request * req = list->head; - - while(cpt < index) { - req = req->nextRequestInList; - cpt ++; - } - - return req; - -} - - -request * addToRequestQueue(request *list, request *requestToAdd) { - request *origin = list; - - if (list == NULL) { - return requestToAdd; - } - - while(list->next != NULL) { - list = list->next; - } - - list->next = requestToAdd; - - requestToAdd->next = NULL; - - return origin; -} - -request * removeRequestFromList(request *list, request *requestToRemove) { - request *origin = list; - - if (list == requestToRemove) { - return list->next; - } - - - while(list->next != requestToRemove) { - list = list->next; - } - - list->next = requestToRemove->next; - - return origin; -} - - -void copyParameters(request *src, request *dst) { - int i; - for(i=0; i<dst->nbOfParams; i++) { - *(dst->params[i]) = *(src->params[i]); - } -} - - -void clearListOfRequests(setOfRequests *list) { - list->head = NULL; -} - -setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) { - setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests))); - list->head = NULL; - list->wakeupCondition = wakeupCondition; - list->mutex = mutex; - - return list; -} - -void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) { - list->head = NULL; - list->owner = name; - list->wakeupCondition = wakeupCondition; - list->mutex = mutex; -} - - -void addRequestToList(setOfRequests *list, request* req) { - request *tmpreq; - - if (list == NULL) { - criticalError("NULL List in addRequestToList"); - } - - if (req == NULL) { - criticalError("NULL req in addRequestToList"); - } - - req->listOfRequests = list; - - if (list->head == NULL) { - list->head = req; - req->nextRequestInList = NULL; - return; - } - - tmpreq = list->head; - while(tmpreq->nextRequestInList != NULL) { - tmpreq = tmpreq->nextRequestInList; - } - - tmpreq->nextRequestInList = req; - req->nextRequestInList = NULL; -} - -void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) { - setOfRequests *list = req->listOfRequests; - request *reqtmp; - - if (list == NULL) { - return; - } - - reqtmp = list->head; - - while(reqtmp != NULL) { - debugInt("Considering request of type", reqtmp->type); - if (reqtmp->alreadyPending) { - if (reqtmp->type == RECEIVE_SYNC_REQUEST) { - debugMsg("Removing send sync request from inWaitQueue"); - reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); - debugMsg("done"); - } - - if (reqtmp->type == SEND_SYNC_REQUEST) { - debugMsg("Removing receive sync request from outWaitQueue"); - reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp); - debugMsg("done"); - } - - if (reqtmp->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("Removing broadcast receive request from inWaitQueue"); - reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); - debugMsg("done"); - } - } - reqtmp = reqtmp->nextRequestInList; - } -} - - -// Identical means belonging to the same ListOfRequest -// Returns the identical request if found, otherwise, null -request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) { - - while(list != NULL) { - if (list->listOfRequests == req->listOfRequests) { - return list; - } - list = list->relatedRequest; - } - - return NULL; -} - -request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) { - request *head = list; - - if (list == oldRequest) { - newRequest->relatedRequest = oldRequest->relatedRequest; - return newRequest; - } - - //list=list->relatedRequest; - while(list->relatedRequest != oldRequest) { - list = list->relatedRequest; - } - - list->relatedRequest = newRequest; - newRequest->relatedRequest = oldRequest->relatedRequest; - - return head; -} - - -int nbOfRelatedRequests(request *list) { - int cpt = 0; - while(list->relatedRequest != NULL) { - cpt ++; - list = list->relatedRequest; - } - - return cpt; -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h deleted file mode 100644 index 00b93c8e5a007e2eecf6bde40417cdfb9457edc2..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/request.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef REQUEST_H -#define REQUEST_H - -#include <time.h> -#include <pthread.h> - -struct request; - -#include "syncchannel.h" -#include "asyncchannel.h" -#include "message.h" - -#define SEND_SYNC_REQUEST 0 -#define RECEIVE_SYNC_REQUEST 2 -#define SEND_ASYNC_REQUEST 4 -#define RECEIVE_ASYNC_REQUEST 6 -#define DELAY 8 -#define IMMEDIATE 10 -#define SEND_BROADCAST_REQUEST 12 -#define RECEIVE_BROADCAST_REQUEST 14 - -typedef struct timespec timespec; - -struct setOfRequests { - char* owner; - struct request *head; - timespec startTime; - timespec completionTime; - pthread_cond_t *wakeupCondition; - pthread_mutex_t *mutex; - - int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay - timespec minTimeToWait; - struct request *selectedRequest; -}; - -typedef struct setOfRequests setOfRequests; - -struct request { - struct request *next; - struct setOfRequests* listOfRequests; - struct request* nextRequestInList; - struct request* relatedRequest; // For synchro and broadcast - struct syncchannel *syncChannel; - struct asyncchannel *asyncChannel; - - int type; - int ID; - int hasDelay;; - timespec delay; - int nbOfParams; // synchronous com. - int **params; // synchronous com. - message *msg; // Asynchronous comm. - - - // Filled by the request manager - int executable; - int selected; - int alreadyPending; // Whether it has been taken into account for execution or not - int delayElapsed; - timespec myStartTime; // Time at which the delay has expired -}; - -typedef struct request request; - -void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params); -request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params); -void destroyRequest(request *req); -extern int isRequestSelected(request *req); - -int nbOfRequests(setOfRequests *list); -request *getRequestAtIndex(setOfRequests *list, int index); - -request * addToRequestQueue(request *list, request *requestToAdd); -request * removeRequestFromList(request *list, request *requestToRemove); - -void copyParameters(request *src, request *dst); - -setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex); -void addRequestToList(setOfRequests *list, request* req); -void clearListOfRequests(setOfRequests *list); -void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex); - -void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne); -request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list); -request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list); -int nbOfRelatedRequests(request *list); - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c deleted file mode 100644 index e1c39ba777944c41c018918f4fa7594eaf3f96b5..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.c +++ /dev/null @@ -1,570 +0,0 @@ -#include <stdlib.h> -#include <pthread.h> -#include <time.h> - -#include "request_manager.h" -#include "request.h" -#include "myerrors.h" -#include "debug.h" -#include "mytimelib.h" -#include "random.h" -#include "asyncchannel.h" -#include "tracemanager.h" - - - -void executeSendSyncTransaction(request *req) { - int cpt; - request *selectedReq; - - // At least one transaction available -> must select one randomly - // First: count how many of them are available - // Then, select one - // Broadcast the new condition! - - cpt = 0; - request* currentReq = req->syncChannel->inWaitQueue; - debugMsg("Execute send sync tr"); - - while(currentReq != NULL) { - cpt ++; - currentReq = currentReq->next; - } - - cpt = random() % cpt; - - // Head of the list? - selectedReq = req->syncChannel->inWaitQueue; - while (cpt > 0) { - selectedReq = selectedReq->next; - cpt --; - } - - // Remove all related request from list requests - //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq); - debugMsg("Setting related request"); - req->relatedRequest = selectedReq; - - // Select the selected request, and notify the information - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - // Handle parameters - copyParameters(req, selectedReq); - - debugMsg("Signaling"); - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - - traceSynchroRequest(req, selectedReq); -} - -void executeReceiveSyncTransaction(request *req) { - int cpt; - request *selectedReq; - - // At least one transaction available -> must select one randomly - // First: count how many of them are available - // Then, select one - // Broadcast the new condition! - - request* currentReq = req->syncChannel->outWaitQueue; - cpt = 0; - debugMsg("Execute receive sync tr"); - - while(currentReq != NULL) { - cpt ++; - //debugInt("cpt", cpt); - currentReq = currentReq->next; - } - cpt = random() % cpt; - selectedReq = req->syncChannel->outWaitQueue; - while (cpt > 0) { - selectedReq = selectedReq->next; - cpt --; - } - - //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq); - debugMsg("Setting related request"); - req->relatedRequest = selectedReq; - - // Select the request, and notify the information in the channel - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - // Handle parameters - copyParameters(selectedReq, req); - - debugMsg("Signaling"); - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - - traceSynchroRequest(selectedReq, req); -} - - -void executeSendAsyncTransaction(request *req) { - request *selectedReq; - - // Full FIFO? - if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) { - // Must remove the oldest message - getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); - } - - addMessageToAsyncChannel(req->asyncChannel, req->msg); - - debugMsg("Signaling async write to all requests waiting "); - selectedReq = req->asyncChannel->inWaitQueue; - while (selectedReq != NULL) { - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - selectedReq = selectedReq->next; - } - debugMsg("Signaling done"); - - traceAsynchronousSendRequest(req); -} - -void executeReceiveAsyncTransaction(request *req) { - int i; - request *selectedReq; - - req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); - - selectedReq = req->asyncChannel->outWaitQueue; - - // Must recopy parameters - for(i=0; i<req->nbOfParams; i++) { - *(req->params[i]) = req->msg->params[i]; - } - - traceAsynchronousReceiveRequest(req); - - // unallocate message - destroyMessageWithParams(req->msg); - - debugMsg("Signaling async read to all requests waiting "); - while (selectedReq != NULL) { - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - selectedReq = selectedReq->next; - } - debugMsg("Signaling done"); -} - - -void executeSendBroadcastTransaction(request *req) { - int cpt; - request *tmpreq; - - // At least one transaction available -> must select all of them - // but at most one per task - // Then, broadcast the new condition! - - request* currentReq = req->syncChannel->inWaitQueue; - request* currentLastReq = req; - debugMsg("Execute broadcast sync tr"); - - - while(currentReq != NULL) { - tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest); - if (tmpreq != NULL) { - // Must select one of the two - // If =1, replace, otherwise, just do nothing - cpt = random() % 2; - if (cpt == 1) { - debugMsg("Replacing broadcast request"); - req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest); - currentReq->listOfRequests->selectedRequest = currentReq; - copyParameters(req, currentReq); - currentReq->selected = 1; - currentLastReq = req; - while(currentLastReq->relatedRequest != NULL) { - currentLastReq = currentLastReq->relatedRequest; - } - } - } else { - currentLastReq->relatedRequest = currentReq; - currentReq->relatedRequest = NULL; - currentReq->selected = 1; - currentReq->listOfRequests->selectedRequest = currentReq; - copyParameters(req, currentReq); - currentLastReq = currentReq; - } - - currentReq = currentReq->next; - - debugInt("Nb of requests selected:", nbOfRelatedRequests(req)); - } - - - debugMsg("Signaling"); - currentReq = req->relatedRequest; - cpt = 0; - while(currentReq != NULL) { - cpt ++; - pthread_cond_signal(currentReq->listOfRequests->wakeupCondition); - traceSynchroRequest(req, currentReq); - currentReq = currentReq->relatedRequest; - } - - debugInt("NUMBER of broadcast Requests", cpt); -} - - -int executable(setOfRequests *list, int nb) { - int cpt = 0; - //int index = 0; - request *req = list->head; - timespec ts; - int tsDone = 0; - - debugMsg("Starting loop"); - - list->hasATimeRequest = 0; - - while(req != NULL) { - if (!(req->delayElapsed)) { - if (req->hasDelay) { - // Is the delay elapsed??? - debugTime("begin time of list of request", &list->startTime); - debugTime("start time of this request", &req->myStartTime); - if (tsDone == 0) { - my_clock_gettime(&ts); - debugTime("Current time", &ts); - tsDone = 1; - } - - if (isBefore(&ts, &(req->myStartTime)) == 1) { - // Delay not elapsed - debugMsg("---------t--------> delay NOT elapsed"); - if (list->hasATimeRequest == 0) { - list->hasATimeRequest = 1; - list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec; - list->minTimeToWait.tv_sec = req->myStartTime.tv_sec; - } else { - minTime(&(req->myStartTime), &(list->minTimeToWait),&(list->minTimeToWait)); - } - } else { - // Delay elapsed - debugMsg("---------t--------> delay elapsed"); - req->delayElapsed = 1; - } - } else { - req->delayElapsed = 1; - } - } - req = req->nextRequestInList; - } - - req = list->head; - while((req != NULL) && (cpt < nb)) { - req->executable = 0; - if (req->delayElapsed) { - if (req->type == SEND_SYNC_REQUEST) { - debugMsg("Send sync"); - - if (req->syncChannel->inWaitQueue != NULL) { - debugMsg("Send sync executable"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Send sync not executable"); - } - //index ++; - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - debugMsg("receive sync"); - if (req->syncChannel->outWaitQueue != NULL) { - req->executable = 1; - cpt ++; - } - //index ++; - } - - if (req->type == SEND_ASYNC_REQUEST) { - debugMsg("Send async"); - - if (!(req->asyncChannel->isBlocking)) { - // Can always add a message -> executable - debugMsg("Send async executable since non blocking"); - req->executable = 1; - cpt ++; - - //blocking case ... channel full? - } else { - if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) { - // Not full! - debugMsg("Send async executable since channel not full"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Send async not executable: full, and channel is blocking"); - } - } - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - debugMsg("receive async"); - if (req->asyncChannel->currentNbOfMessages >0) { - debugMsg("Receive async executable: not empty"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Receive async not executable: empty"); - } - //index ++; - } - - - if (req->type == SEND_BROADCAST_REQUEST) { - debugMsg("send broadcast"); - req->executable = 1; - cpt ++; - } - - if (req->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("receive broadcast"); - // A receive broadcast is never executable - req->executable = 0; - //index ++; - } - - - - - if (req->type == IMMEDIATE) { - debugMsg("immediate"); - req->executable = 1; - cpt ++; - } - } - - req = req->nextRequestInList; - - } - - return cpt; -} - -void private__makeRequestPending(setOfRequests *list) { - request *req = list->head; - while(req != NULL) { - if ((req->delayElapsed) && (!(req->alreadyPending))) { - if (req->type == SEND_SYNC_REQUEST) { - debugMsg("Adding pending request in outWaitqueue"); - req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); - req->alreadyPending = 1; - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - debugMsg("Adding pending request in inWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); - } - - if (req->type == SEND_ASYNC_REQUEST) { - debugMsg("Adding pending request in outWaitqueue"); - req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req); - req->alreadyPending = 1; - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - debugMsg("Adding pending request in inWaitqueue"); - req->alreadyPending = 1; - req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req); - } - - if (req->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("Adding pending broadcast request in inWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); - } - - if (req->type == SEND_BROADCAST_REQUEST) { - debugMsg("Adding pending broadcast request in outWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); - } - - } - - req = req->nextRequestInList; - } -} - -void private__makeRequest(request *req) { - if (req->type == SEND_SYNC_REQUEST) { - executeSendSyncTransaction(req); - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - executeReceiveSyncTransaction(req); - } - - if (req->type == SEND_ASYNC_REQUEST) { - executeSendAsyncTransaction(req); - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - executeReceiveAsyncTransaction(req); - } - - if (req->type == SEND_BROADCAST_REQUEST) { - executeSendBroadcastTransaction(req); - } - - // IMMEDIATE: Nothing to do - - // In all cases: remove other requests of the same list from their pending form - debugMsg("Removing original req"); - removeAllPendingRequestsFromPendingLists(req, 1); - removeAllPendingRequestsFromPendingListsRelatedRequests(req); - /*if (req->relatedRequest != NULL) { - debugMsg("Removing related req"); - removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); - }*/ - -} - -void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) { - if (req->relatedRequest != NULL) { - debugMsg("Removing related req"); - removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); - // Recursive call - removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest); - } -} - - -request *private__executeRequests0(setOfRequests *list, int nb) { - int howMany, found; - int selectedIndex, realIndex; - request *selectedReq; - request *req; - - // Compute which requests can be executed - debugMsg("Counting requests"); - howMany = executable(list, nb); - - debugInt("Counting requests=", howMany); - - if (howMany == 0) { - debugMsg("No pending requests"); - // Must make them pending - - private__makeRequestPending(list); - - return NULL; - } - - debugInt("At least one pending request is executable", howMany); - - - // Select a request - req = list->head; - selectedIndex = (rand() % howMany)+1; - debugInt("selectedIndex=", selectedIndex); - realIndex = 0; - found = 0; - while(req != NULL) { - if (req->executable == 1) { - found ++; - if (found == selectedIndex) { - break; - } - } - realIndex ++; - req = req->nextRequestInList; - } - - debugInt("Getting request at index", realIndex); - selectedReq = getRequestAtIndex(list, realIndex); - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - debugInt("Selected request of type", selectedReq->type); - - // Execute that request - private__makeRequest(selectedReq); - - return selectedReq; -} - - -request *private__executeRequests(setOfRequests *list) { - // Is a request already selected? - - if (list->selectedRequest != NULL) { - return list->selectedRequest; - } - - debugMsg("No request selected -> looking for one!"); - - return private__executeRequests0(list, nbOfRequests(list)); -} - - - - -request *executeOneRequest(setOfRequests *list, request *req) { - req->nextRequestInList = NULL; - req->listOfRequests = list; - list->head = req; - return executeListOfRequests(list); -} - - -void setLocalStartTime(setOfRequests *list) { - request *req = list->head; - - while(req != NULL) { - if (req->hasDelay) { - req->delayElapsed = 0; - addTime(&(list->startTime), &(req->delay), &(req->myStartTime)); - debug2Msg(list->owner, " -----t------>: Request with delay"); - } else { - req->delayElapsed = 1; - req->myStartTime.tv_nsec = list->startTime.tv_nsec; - req->myStartTime.tv_sec = list->startTime.tv_sec; - } - req = req->nextRequestInList; - } -} - - -// Return the executed request -request *executeListOfRequests(setOfRequests *list) { - request *req; - - my_clock_gettime(&list->startTime); - list->selectedRequest = NULL; - setLocalStartTime(list); - - // Try to find a request that could be executed - debug2Msg(list->owner, "Locking mutex"); - pthread_mutex_lock(list->mutex); - debug2Msg(list->owner, "Mutex locked"); - - debug2Msg(list->owner, "Going to execute request"); - - while((req = private__executeRequests(list)) == NULL) { - debug2Msg(list->owner, "Waiting for request!"); - if (list->hasATimeRequest == 1) { - debug2Msg(list->owner, "Waiting for a request and at most for a given time"); - debugTime("Min time to wait=", &(list->minTimeToWait)); - pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait)); - } else { - debug2Msg(list->owner, "Releasing mutex"); - pthread_cond_wait(list->wakeupCondition, list->mutex); - } - debug2Msg(list->owner, "Waking up for requests! -> getting mutex"); - } - - debug2Msg(list->owner, "Request selected!"); - - my_clock_gettime(&list->completionTime); - - pthread_mutex_unlock(list->mutex); - debug2Msg(list->owner, "Mutex unlocked"); - return req; -} - diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c deleted file mode 100644 index e1c90875f2574a15318facbda32b27f918f82592..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <stdlib.h> - - -#include "syncchannel.h" -#include "request.h" -#include "myerrors.h" -#include "debug.h" - - -syncchannel *getNewSyncchannel(char *outname, char *inname) { - syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel))); - if (syncch == NULL) { - criticalError("Allocation of request failed"); - } - syncch->inname = inname; - syncch->outname = outname; - syncch->inWaitQueue = NULL; - syncch->outWaitQueue = NULL; - syncch->isBroadcast = false; - return syncch; -} - -void setBroadcast(syncchannel *syncch, bool b) { - syncch->isBroadcast = b; -} - - - -/*request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]) { - request *req = getNewRequest(SEND_SYNC_REQUEST, hasDelay, delay, nbOfParams, params); - return req; -} - -request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]) { - request *req = getNewRequest(RECEIVE_SYNC_REQUEST, hasDelay, delay, nbOfParams, params); - return req; - }*/ - -void destroySyncchannel(syncchannel *syncch) { - free(syncch); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h deleted file mode 100644 index 6f4f92de5531f14c36b7d520992eb3decb305cdd..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/syncchannel.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SYNCCHANNEL_H -#define SYNCCHANNEL_H - -struct syncchannel; - -#include "request.h" -#include "defs.h" - -struct syncchannel { - char *outname; - char *inname; - struct request* inWaitQueue; - struct request* outWaitQueue; - bool isBroadcast; -}; - -typedef struct syncchannel syncchannel; - - -void setBroadcast(syncchannel *syncch, bool b); -syncchannel *getNewSyncchannel(char *inname, char *outname); -//request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]); -//request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]); -void destroySyncchannel(syncchannel *syncch); - - -#endif diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c deleted file mode 100644 index fda3a0db1c76a9861708dd422c2cea7f180688b0..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.c +++ /dev/null @@ -1,304 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <time.h> - -#include "tracemanager.h" -#include "debug.h" -#include "mytimelib.h" - - -#define TRACE_OFF 0 -#define TRACE_IN_FILE 1 -#define TRACE_IN_CONSOLE 2 - -#define TRACE_FILE_NAME "Trace.txt" - - -pthread_mutex_t __traceMutex; - -int trace = TRACE_OFF; -int id = 0; - -FILE *file; - -struct timespec begints; - - -void addInfo(char *dest, char *info) { - //char s1[10]; - long tmp; - //long tmp1; - //int i; - struct timespec ts, ts1; - my_clock_gettime(&ts); - - debugMsg("DIFF TIME"); - diffTime(&begints, &ts, &ts1); - - tmp = ts1.tv_nsec; - - if (tmp < 0) { - tmp = -tmp; - } - - /*tmp1 = 100000000; - - for(i=0; i<9; i++) { - s1[i] = 48 + (tmp / tmp1); - tmp = tmp % tmp1; - tmp1 = tmp1 / 10; - } - s1[9] = '\0';*/ - - /* s1 -> tmp */ - sprintf(dest, "#%d time=%ld.%09ld %s", id, ts1.tv_sec, tmp, info); - id ++; -} - - -void writeInTrace(char *info) { - pthread_mutex_lock(&__traceMutex); - char s[CHAR_ALLOC_SIZE]; - addInfo(s, info); - //printf("Write in file\n"); - switch(trace){ - case TRACE_IN_FILE: - if (file != NULL) { - debug2Msg("Saving in file", s); - fprintf(file, s); - fflush(file); - } - break; - case TRACE_IN_CONSOLE: - printf("%s\n", s); - break; - } - - pthread_mutex_unlock(&__traceMutex); -} - - -void activeTracingInFile(char *fileName) { - char *name; - trace = TRACE_IN_FILE; - my_clock_gettime(&begints); - if (fileName == NULL) { - name = TRACE_FILE_NAME; - } else { - name = fileName; - } - file = fopen(name,"w"); - - /* Initializing mutex */ - if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);} -} - -void activeTracingInConsole() { - trace = TRACE_IN_CONSOLE; - my_clock_gettime(&begints); - - /* Initializing mutex */ - if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);} -} - -void unactiveTracing() { - trace = TRACE_OFF; -} - - -void traceStateEntering(char *myname, char *statename) { - char s[CHAR_ALLOC_SIZE]; - - debugMsg("Trace function"); - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=state_entering state=%s\n", myname, statename); - - // Saving trace - writeInTrace(s); -} - -void traceFunctionCall(char *block, char *func, char *params) { - char s[CHAR_ALLOC_SIZE]; - - debugMsg("Trace function"); - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=function_call func=%s parameters=%s\n", block, func, params); - - // Saving trace - writeInTrace(s); -} - - -// type=0: int type = 1:bool -void traceVariableModification(char *block, char *var, int value, int type) { - char s[CHAR_ALLOC_SIZE]; - debugMsg("Trace variable modification"); - - if (trace == TRACE_OFF) { - return; - } - - - if (type == 0) { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=%d\n", block, var, value); - } - - if (type == 1) { - if (value == 0) { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=false\n", block, var); - } else { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=true\n", block, var); - } - } - - // Saving trace - writeInTrace(s); - -} - -void traceSynchroRequest(request *from, request *to) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s blockdestination=%s type=synchro channel=%s params=", from->listOfRequests->owner, to->listOfRequests->owner, from->syncChannel->outname); - for(i=0; i<from->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, *(from->params[i])); - } - sprintf(s, "%s\n", s); - - debugMsg("Trace request synchro"); - - - // Saving trace - writeInTrace(s); -} - - -void traceAsynchronousSendRequest(request *req) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=send_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id); - if (req->msg != NULL) { - debugMsg("Computing params"); - for(i=0; i<req->msg->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, req->msg->params[i]); - } - } - sprintf(s, "%s\n", s); - - - - // Saving trace - writeInTrace(s); -} - - -void traceAsynchronousReceiveRequest(request *req) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=receive_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id); - if (req->msg != NULL) { - debugMsg("Computing params"); - for(i=0; i<req->msg->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, req->msg->params[i]); - } - } - sprintf(s, "%s\n", s); - - - - // Saving trace - writeInTrace(s); -} - - - -void traceRequest(char *myname, request *req) { - char s[1024]; - int i; - - - debugMsg("Trace request"); - - - if (trace == TRACE_OFF) { - return; - } - - // Build corresponding char*; - - switch(req->type) { - case SEND_SYNC_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname); - for(i=0; i<req->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, *(req->params[i])); - } - sprintf(s, "%s\n", s); - - break; - case RECEIVE_SYNC_REQUEST: - sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname); - break; - case SEND_ASYNC_REQUEST: - debug2Msg("Async channel", req->asyncChannel->outname); - sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname); - break; - case RECEIVE_ASYNC_REQUEST: - sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname); - break; - case SEND_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case RECEIVE_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case IMMEDIATE: - sprintf(s, "block=%s type=action\n", myname); - break; - default: - sprintf(s, "block=%s type=unknown\n", myname); - } - - debugMsg("Trace request 2"); - - - // Saving trace - writeInTrace(s); -} diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h b/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h deleted file mode 100644 index d33f3532a4bcb9fc7b96ddda00bcfee9cfb2a4bc..0000000000000000000000000000000000000000 --- a/modeling/Blinking.ttool/AVATAR_executablecode/src/tracemanager.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef TRACEMANAGER_H -#define TRACEMANAGER_H - -#include "request.h" - -#define CHAR_ALLOC_SIZE 1024 - - -void activeTracingInFile(); -void unactiveTracing(); -void traceRequest(char *myname, request *req); -void traceFunctionCall(char *block, char *func, char* params); -void traceVariableModification(char *block, char *var, int value, int type); // type=0: int type = 1:bool -void traceStateEntering(char *myname, char *statename); -void traceSynchroRequest(request *from, request *to); -void traceAsynchronousSendRequest(request *req); -void traceAsynchronousReceiveRequest(request *req); - -#endif - - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store b/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store deleted file mode 100644 index e07abf6bee883ef2e77ca2c673adee53105d99cd..0000000000000000000000000000000000000000 Binary files a/modeling/BlinkingLed.ttool/AVATAR_executablecode/.DS_Store and /dev/null differ diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE b/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE deleted file mode 100644 index 80a6487e0e38fde802e5fa47fd63578fdacb6262..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -/**Copyright or (C) or Copr. Intitut Telecom, Telecom ParisTech, -Ludovic Apvrille, Renaud Pacalet - * - * ludovic.apvrille AT telecom-paristech.fr - * - * This software is a computer program whose purpose is to allow the - * edition of TURTLE analysis, design and deployment diagrams, to - * allow the generation of RT-LOTOS or Java code from this diagram, - * and at last to allow the analysis of formal validation traces - * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP - * from INRIA Rhone-Alpes. - * - * This software is governed by the CeCILL license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL license and that you accept its terms. - * - * /** diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG b/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG deleted file mode 100644 index 2813867170ada86df401c9e49d9f69a02bbeaa9e..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG +++ /dev/null @@ -1,504 +0,0 @@ -CeCILL FREE SOFTWARE LICENSE AGREEMENT - - - Notice - -This Agreement is a Free Software license agreement that is the result -of discussions between its authors in order to ensure compliance with -the two main principles guiding its drafting: - - * firstly, compliance with the principles governing the distribution - of Free Software: access to source code, broad rights granted to - users, - * secondly, the election of a governing law, French law, with which - it is conformant, both as regards the law of torts and - intellectual property law, and the protection that it offers to - both authors and holders of the economic rights over software. - -The authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[logiciel] L[ibre]) -license are: - -Commissariat à l'Energie Atomique - CEA, a public scientific, technical -and industrial establishment, having its principal place of business at -31-33 rue de la Fédération, 75752 Paris cedex 15, France. - -Centre National de la Recherche Scientifique - CNRS, a public scientific -and technological establishment, having its principal place of business -at 3 rue Michel-Ange 75794 Paris cedex 16, France. - -Institut National de Recherche en Informatique et en Automatique - -INRIA, a public scientific and technological establishment, having its -principal place of business at Domaine de Voluceau, Rocquencourt, BP -105, 78153 Le Chesnay cedex, France. - - - Preamble - -The purpose of this Free Software license agreement is to grant users -the right to modify and redistribute the software governed by this -license within the framework of an open source distribution model. - -The exercising of these rights is conditional upon certain obligations -for users so as to preserve this status for all subsequent redistributions. - -In consideration of access to the source code and the rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors only have limited liability. - -In this respect, the risks associated with loading, using, modifying -and/or developing or reproducing the software by the user are brought to -the user's attention, given its Free Software status, which may make it -complicated to use, with the result that its use is reserved for -developers and experienced professionals having in-depth computer -knowledge. Users are therefore encouraged to load and test the -Software's suitability as regards their requirements in conditions -enabling the security of their systems and/or data to be ensured and, -more generally, to use and operate it in the same conditions of -security. This Agreement may be freely reproduced and published, -provided it is not altered, and that no provisions are either added or -removed herefrom. - -This Agreement may apply to any or all software for which the holder of -the economic rights decides to submit the use thereof to its provisions. - - - Article 1 - DEFINITIONS - -For the purpose of this Agreement, when the following expressions -commence with a capital letter, they shall have the following meaning: - -Agreement: means this license agreement, and its possible subsequent -versions and annexes. - -Software: means the software in its Object Code and/or Source Code form -and, where applicable, its documentation, "as is" when the Licensee -accepts the Agreement. - -Initial Software: means the Software in its Source Code and possibly its -Object Code form and, where applicable, its documentation, "as is" when -it is first distributed under the terms and conditions of the Agreement. - -Modified Software: means the Software modified by at least one -Contribution. - -Source Code: means all the Software's instructions and program lines to -which access is required so as to modify the Software. - -Object Code: means the binary files originating from the compilation of -the Source Code. - -Holder: means the holder(s) of the economic rights over the Initial -Software. - -Licensee: means the Software user(s) having accepted the Agreement. - -Contributor: means a Licensee having made at least one Contribution. - -Licensor: means the Holder, or any other individual or legal entity, who -distributes the Software under the Agreement. - -Contribution: means any or all modifications, corrections, translations, -adaptations and/or new functions integrated into the Software by any or -all Contributors, as well as any or all Internal Modules. - -Module: means a set of sources files including their documentation that -enables supplementary functions or services in addition to those offered -by the Software. - -External Module: means any or all Modules, not derived from the -Software, so that this Module and the Software run in separate address -spaces, with one calling the other when they are run. - -Internal Module: means any or all Module, connected to the Software so -that they both execute in the same address space. - -GNU GPL: means the GNU General Public License version 2 or any -subsequent version, as published by the Free Software Foundation Inc. - -Parties: mean both the Licensee and the Licensor. - -These expressions may be used both in singular and plural form. - - - Article 2 - PURPOSE - -The purpose of the Agreement is the grant by the Licensor to the -Licensee of a non-exclusive, transferable and worldwide license for the -Software as set forth in Article 5 hereinafter for the whole term of the -protection granted by the rights over said Software. - - - Article 3 - ACCEPTANCE - -3.1 The Licensee shall be deemed as having accepted the terms and -conditions of this Agreement upon the occurrence of the first of the -following events: - - * (i) loading the Software by any or all means, notably, by - downloading from a remote server, or by loading from a physical - medium; - * (ii) the first time the Licensee exercises any of the rights - granted hereunder. - -3.2 One copy of the Agreement, containing a notice relating to the -characteristics of the Software, to the limited warranty, and to the -fact that its use is restricted to experienced users has been provided -to the Licensee prior to its acceptance as set forth in Article 3.1 -hereinabove, and the Licensee hereby acknowledges that it has read and -understood it. - - - Article 4 - EFFECTIVE DATE AND TERM - - - 4.1 EFFECTIVE DATE - -The Agreement shall become effective on the date when it is accepted by -the Licensee as set forth in Article 3.1. - - - 4.2 TERM - -The Agreement shall remain in force for the entire legal term of -protection of the economic rights over the Software. - - - Article 5 - SCOPE OF RIGHTS GRANTED - -The Licensor hereby grants to the Licensee, who accepts, the following -rights over the Software for any or all use, and for the term of the -Agreement, on the basis of the terms and conditions set forth hereinafter. - -Besides, if the Licensor owns or comes to own one or more patents -protecting all or part of the functions of the Software or of its -components, the Licensor undertakes not to enforce the rights granted by -these patents against successive Licensees using, exploiting or -modifying the Software. If these patents are transferred, the Licensor -undertakes to have the transferees subscribe to the obligations set -forth in this paragraph. - - - 5.1 RIGHT OF USE - -The Licensee is authorized to use the Software, without any limitation -as to its fields of application, with it being hereinafter specified -that this comprises: - - 1. permanent or temporary reproduction of all or part of the Software - by any or all means and in any or all form. - - 2. loading, displaying, running, or storing the Software on any or - all medium. - - 3. entitlement to observe, study or test its operation so as to - determine the ideas and principles behind any or all constituent - elements of said Software. This shall apply when the Licensee - carries out any or all loading, displaying, running, transmission - or storage operation as regards the Software, that it is entitled - to carry out hereunder. - - - 5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS - -The right to make Contributions includes the right to translate, adapt, -arrange, or make any or all modifications to the Software, and the right -to reproduce the resulting Software. - -The Licensee is authorized to make any or all Contributions to the -Software provided that it includes an explicit notice that it is the -author of said Contribution and indicates the date of the creation thereof. - - - 5.3 RIGHT OF DISTRIBUTION - -In particular, the right of distribution includes the right to publish, -transmit and communicate the Software to the general public on any or -all medium, and by any or all means, and the right to market, either in -consideration of a fee, or free of charge, one or more copies of the -Software by any means. - -The Licensee is further authorized to distribute copies of the modified -or unmodified Software to third parties according to the terms and -conditions set forth hereinafter. - - - 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION - -The Licensee is authorized to distribute true copies of the Software in -Source Code or Object Code form, provided that said distribution -complies with all the provisions of the Agreement and is accompanied by: - - 1. a copy of the Agreement, - - 2. a notice relating to the limitation of both the Licensor's - warranty and liability as set forth in Articles 8 and 9, - -and that, in the event that only the Object Code of the Software is -redistributed, the Licensee allows future Licensees unhindered access to -the full Source Code of the Software by indicating how to access it, it -being understood that the additional cost of acquiring the Source Code -shall not exceed the cost of transferring the data. - - - 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE - -When the Licensee makes a Contribution to the Software, the terms and -conditions for the distribution of the Modified Software become subject -to all the provisions of this Agreement. - -The Licensee is authorized to distribute the Modified Software, in -Source Code or Object Code form, provided that said distribution -complies with all the provisions of the Agreement and is accompanied by: - - 1. a copy of the Agreement, - - 2. a notice relating to the limitation of both the Licensor's - warranty and liability as set forth in Articles 8 and 9, - -and that, in the event that only the Object Code of the Modified -Software is redistributed, the Licensee allows future Licensees -unhindered access to the full Source Code of the Modified Software by -indicating how to access it, it being understood that the additional -cost of acquiring the Source Code shall not exceed the cost of -transferring the data. - - - 5.3.3 DISTRIBUTION OF EXTERNAL MODULES - -When the Licensee has developed an External Module, the terms and -conditions of this Agreement do not apply to said External Module, that -may be distributed under a separate license agreement. - - - 5.3.4 COMPATIBILITY WITH THE GNU GPL - -The Licensee can include a code that is subject to the provisions of one -of the versions of the GNU GPL in the Modified or unmodified Software, -and distribute that entire code under the terms of the same version of -the GNU GPL. - -The Licensee can include the Modified or unmodified Software in a code -that is subject to the provisions of one of the versions of the GNU GPL, -and distribute that entire code under the terms of the same version of -the GNU GPL. - - - Article 6 - INTELLECTUAL PROPERTY - - - 6.1 OVER THE INITIAL SOFTWARE - -The Holder owns the economic rights over the Initial Software. Any or -all use of the Initial Software is subject to compliance with the terms -and conditions under which the Holder has elected to distribute its work -and no one shall be entitled to modify the terms and conditions for the -distribution of said Initial Software. - -The Holder undertakes that the Initial Software will remain ruled at -least by the current license, for the duration set forth in article 4.2. - - - 6.2 OVER THE CONTRIBUTIONS - -A Licensee who develops a Contribution is the owner of the intellectual -property rights over this Contribution as defined by applicable law. - - - 6.3 OVER THE EXTERNAL MODULES - -A Licensee who develops an External Module is the owner of the -intellectual property rights over this External Module as defined by -applicable law and is free to choose the type of agreement that shall -govern its distribution. - - - 6.4 JOINT PROVISIONS - -The Licensee expressly undertakes: - - 1. not to remove, or modify, in any manner, the intellectual property - notices attached to the Software; - - 2. to reproduce said notices, in an identical manner, in the copies - of the Software modified or not. - -The Licensee undertakes not to directly or indirectly infringe the -intellectual property rights of the Holder and/or Contributors on the -Software and to take, where applicable, vis-à -vis its staff, any and all -measures required to ensure respect of said intellectual property rights -of the Holder and/or Contributors. - - - Article 7 - RELATED SERVICES - -7.1 Under no circumstances shall the Agreement oblige the Licensor to -provide technical assistance or maintenance services for the Software. - -However, the Licensor is entitled to offer this type of services. The -terms and conditions of such technical assistance, and/or such -maintenance, shall be set forth in a separate instrument. Only the -Licensor offering said maintenance and/or technical assistance services -shall incur liability therefor. - -7.2 Similarly, any Licensor is entitled to offer to its licensees, under -its sole responsibility, a warranty, that shall only be binding upon -itself, for the redistribution of the Software and/or the Modified -Software, under terms and conditions that it is free to decide. Said -warranty, and the financial terms and conditions of its application, -shall be subject of a separate instrument executed between the Licensor -and the Licensee. - - - Article 8 - LIABILITY - -8.1 Subject to the provisions of Article 8.2, the Licensee shall be -entitled to claim compensation for any direct loss it may have suffered -from the Software as a result of a fault on the part of the relevant -Licensor, subject to providing evidence thereof. - -8.2 The Licensor's liability is limited to the commitments made under -this Agreement and shall not be incurred as a result of in particular: -(i) loss due the Licensee's total or partial failure to fulfill its -obligations, (ii) direct or consequential loss that is suffered by the -Licensee due to the use or performance of the Software, and (iii) more -generally, any consequential loss. In particular the Parties expressly -agree that any or all pecuniary or business loss (i.e. loss of data, -loss of profits, operating loss, loss of customers or orders, -opportunity cost, any disturbance to business activities) or any or all -legal proceedings instituted against the Licensee by a third party, -shall constitute consequential loss and shall not provide entitlement to -any or all compensation from the Licensor. - - - Article 9 - WARRANTY - -9.1 The Licensee acknowledges that the scientific and technical -state-of-the-art when the Software was distributed did not enable all -possible uses to be tested and verified, nor for the presence of -possible defects to be detected. In this respect, the Licensee's -attention has been drawn to the risks associated with loading, using, -modifying and/or developing and reproducing the Software which are -reserved for experienced users. - -The Licensee shall be responsible for verifying, by any or all means, -the product's suitability for its requirements, its good working order, -and for ensuring that it shall not cause damage to either persons or -properties. - -9.2 The Licensor hereby represents, in good faith, that it is entitled -to grant all the rights over the Software (including in particular the -rights set forth in Article 5). - -9.3 The Licensee acknowledges that the Software is supplied "as is" by -the Licensor without any other express or tacit warranty, other than -that provided for in Article 9.2 and, in particular, without any warranty -as to its commercial value, its secured, safe, innovative or relevant -nature. - -Specifically, the Licensor does not warrant that the Software is free -from any error, that it will operate without interruption, that it will -be compatible with the Licensee's own equipment and software -configuration, nor that it will meet the Licensee's requirements. - -9.4 The Licensor does not either expressly or tacitly warrant that the -Software does not infringe any third party intellectual property right -relating to a patent, software or any other property right. Therefore, -the Licensor disclaims any and all liability towards the Licensee -arising out of any or all proceedings for infringement that may be -instituted in respect of the use, modification and redistribution of the -Software. Nevertheless, should such proceedings be instituted against -the Licensee, the Licensor shall provide it with technical and legal -assistance for its defense. Such technical and legal assistance shall be -decided on a case-by-case basis between the relevant Licensor and the -Licensee pursuant to a memorandum of understanding. The Licensor -disclaims any and all liability as regards the Licensee's use of the -name of the Software. No warranty is given as regards the existence of -prior rights over the name of the Software or as regards the existence -of a trademark. - - - Article 10 - TERMINATION - -10.1 In the event of a breach by the Licensee of its obligations -hereunder, the Licensor may automatically terminate this Agreement -thirty (30) days after notice has been sent to the Licensee and has -remained ineffective. - -10.2 A Licensee whose Agreement is terminated shall no longer be -authorized to use, modify or distribute the Software. However, any -licenses that it may have granted prior to termination of the Agreement -shall remain valid subject to their having been granted in compliance -with the terms and conditions hereof. - - - Article 11 - MISCELLANEOUS - - - 11.1 EXCUSABLE EVENTS - -Neither Party shall be liable for any or all delay, or failure to -perform the Agreement, that may be attributable to an event of force -majeure, an act of God or an outside cause, such as defective -functioning or interruptions of the electricity or telecommunications -networks, network paralysis following a virus attack, intervention by -government authorities, natural disasters, water damage, earthquakes, -fire, explosions, strikes and labor unrest, war, etc. - -11.2 Any Failure by either Party, on one or more occasions, to invoke -one or more of the provisions hereof, shall under no circumstances be -interpreted as being a waiver by the interested Party of its right to -invoke said provision(s) subsequently. - -11.3 The Agreement cancels and replaces any or all previous agreements, -whether written or oral, between the Parties and having the same -purpose, and constitutes the entirety of the agreement between said -Parties concerning said purpose. No supplement or modification to the -terms and conditions hereof shall be effective as between the Parties -unless it is made in writing and signed by their duly authorized -representatives. - -11.4 In the event that one or more of the provisions hereof were to -conflict with a current or future applicable act or legislative text, -said act or legislative text shall prevail, and the Parties shall make -the necessary amendments so as to comply with said act or legislative -text. All other provisions shall remain effective. Similarly, invalidity -of a provision of the Agreement, for any reason whatsoever, shall not -cause the Agreement as a whole to be invalid. - - - 11.5 LANGUAGE - -The Agreement is drafted in both French and English and both versions -are deemed authentic. - - - Article 12 - NEW VERSIONS OF THE AGREEMENT - -12.1 Any person is authorized to duplicate and distribute copies of this -Agreement. - -12.2 So as to ensure coherence, the wording of this Agreement is -protected and may only be modified by the authors of the License, who -reserve the right to periodically publish updates or new versions of the -Agreement, each with a separate number. These subsequent versions may -address new issues encountered by Free Software. - -12.3 Any Software distributed under a given version of the Agreement may -only be subsequently distributed under the same version of the Agreement -or a subsequent version, subject to the provisions of Article 5.3.4. - - - Article 13 - GOVERNING LAW AND JURISDICTION - -13.1 The Agreement is governed by French law. The Parties agree to -endeavor to seek an amicable solution to any disagreements or disputes -that may arise during the performance of the Agreement. - -13.2 Failing an amicable solution within two (2) months as from their -occurrence, and unless emergency proceedings are necessary, the -disagreements or disputes shall be referred to the Paris Courts having -jurisdiction, by the more diligent Party. - - -Version 2.0 dated 2005-05-21. \ No newline at end of file diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_FR b/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_FR deleted file mode 100644 index 32ac7d2182f825f627e5f5409415f869dc1b02d0..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/LICENSE_CECILL_FR +++ /dev/null @@ -1,511 +0,0 @@ -CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL - - - Avertissement - -Ce contrat est une licence de logiciel libre issue d'une concertation -entre ses auteurs afin que le respect de deux grands principes préside à -sa rédaction: - - * d'une part, le respect des principes de diffusion des logiciels - libres: accès au code source, droits étendus conférés aux - utilisateurs, - * d'autre part, la désignation d'un droit applicable, le droit - français, auquel elle est conforme, tant au regard du droit de la - responsabilité civile que du droit de la propriété intellectuelle - et de la protection qu'il offre aux auteurs et titulaires des - droits patrimoniaux sur un logiciel. - -Les auteurs de la licence CeCILL (pour Ce[a] C[nrs] I[nria] L[ogiciel] -L[ibre]) sont: - -Commissariat à l'Energie Atomique - CEA, établissement public de -caractère scientifique technique et industriel, dont le siège est situé -31-33 rue de la Fédération, 75752 Paris cedex 15. - -Centre National de la Recherche Scientifique - CNRS, établissement -public à caractère scientifique et technologique, dont le siège est -situé 3 rue Michel-Ange 75794 Paris cedex 16. - -Institut National de Recherche en Informatique et en Automatique - -INRIA, établissement public à caractère scientifique et technologique, -dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153 -Le Chesnay cedex. - - - Préambule - -Ce contrat est une licence de logiciel libre dont l'objectif est de -conférer aux utilisateurs la liberté de modification et de -redistribution du logiciel régi par cette licence dans le cadre d'un -modèle de diffusion en logiciel libre. - -L'exercice de ces libertés est assorti de certains devoirs à la charge -des utilisateurs afin de préserver ce statut au cours des -redistributions ultérieures. - -L'accessibilité au code source et les droits de copie, de modification -et de redistribution qui en découlent ont pour contrepartie de n'offrir -aux utilisateurs qu'une garantie limitée et de ne faire peser sur -l'auteur du logiciel, le titulaire des droits patrimoniaux et les -concédants successifs qu'une responsabilité restreinte. - -A cet égard l'attention de l'utilisateur est attirée sur les risques -associés au chargement, à l'utilisation, à la modification et/ou au -développement et à la reproduction du logiciel par l'utilisateur étant -donné sa spécificité de logiciel libre, qui peut le rendre complexe à -manipuler et qui le réserve donc à des développeurs ou des -professionnels avertis possédant des connaissances informatiques -approfondies. Les utilisateurs sont donc invités à charger et tester -l'adéquation du Logiciel à leurs besoins dans des conditions permettant -d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus -généralement, à l'utiliser et l'exploiter dans les même conditions de -sécurité. Ce contrat peut être reproduit et diffusé librement, sous -réserve de le conserver en l'état, sans ajout ni suppression de clauses. - -Ce contrat est susceptible de s'appliquer à tout logiciel dont le -titulaire des droits patrimoniaux décide de soumettre l'exploitation aux -dispositions qu'il contient. - - - Article 1 - DEFINITIONS - -Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une -lettre capitale, auront la signification suivante: - -Contrat: désigne le présent contrat de licence, ses éventuelles versions -postérieures et annexes. - -Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code -Source et le cas échéant sa documentation, dans leur état au moment de -l'acceptation du Contrat par le Licencié. - -Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et -éventuellement de Code Objet et le cas échéant sa documentation, dans -leur état au moment de leur première diffusion sous les termes du Contrat. - -Logiciel Modifié: désigne le Logiciel modifié par au moins une -Contribution. - -Code Source: désigne l'ensemble des instructions et des lignes de -programme du Logiciel et auquel l'accès est nécessaire en vue de -modifier le Logiciel. - -Code Objet: désigne les fichiers binaires issus de la compilation du -Code Source. - -Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur -sur le Logiciel Initial - -Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le -Contrat. - -Contributeur: désigne le Licencié auteur d'au moins une Contribution. - -Concédant: désigne le Titulaire ou toute personne physique ou morale -distribuant le Logiciel sous le Contrat. - -Contribution: désigne l'ensemble des modifications, corrections, -traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans -le Logiciel par tout Contributeur, ainsi que tout Module Interne. - -Module: désigne un ensemble de fichiers sources y compris leur -documentation qui permet de réaliser des fonctionnalités ou services -supplémentaires à ceux fournis par le Logiciel. - -Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce -Module et le Logiciel s'exécutent dans des espaces d'adressages -différents, l'un appelant l'autre au moment de leur exécution. - -Module Interne: désigne tout Module lié au Logiciel de telle sorte -qu'ils s'exécutent dans le même espace d'adressage. - -GNU GPL: désigne la GNU General Public License dans sa version 2 ou -toute version ultérieure, telle que publiée par Free Software Foundation -Inc. - -Parties: désigne collectivement le Licencié et le Concédant. - -Ces termes s'entendent au singulier comme au pluriel. - - - Article 2 - OBJET - -Le Contrat a pour objet la concession par le Concédant au Licencié d'une -licence non exclusive, cessible et mondiale du Logiciel telle que -définie ci-après à l'article 5 pour toute la durée de protection des -droits portant sur ce Logiciel. - - - Article 3 - ACCEPTATION - -3.1 L'acceptation par le Licencié des termes du Contrat est réputée -acquise du fait du premier des faits suivants: - - * (i) le chargement du Logiciel par tout moyen notamment par - téléchargement à partir d'un serveur distant ou par chargement à - partir d'un support physique; - * (ii) le premier exercice par le Licencié de l'un quelconque des - droits concédés par le Contrat. - -3.2 Un exemplaire du Contrat, contenant notamment un avertissement -relatif aux spécificités du Logiciel, à la restriction de garantie et à -la limitation à un usage par des utilisateurs expérimentés a été mis à -disposition du Licencié préalablement à son acceptation telle que -définie à l'article 3.1 ci dessus et le Licencié -reconnaît en avoir pris connaissance. - - - Article 4 - ENTREE EN VIGUEUR ET DUREE - - - 4.1 ENTREE EN VIGUEUR - -Le Contrat entre en vigueur à la date de son acceptation par le Licencié -telle que définie en 3.1. - - - 4.2 DUREE - -Le Contrat produira ses effets pendant toute la durée légale de -protection des droits patrimoniaux portant sur le Logiciel. - - - Article 5 - ETENDUE DES DROITS CONCEDES - -Le Concédant concède au Licencié, qui accepte, les droits suivants sur -le Logiciel pour toutes destinations et pour la durée du Contrat dans -les conditions ci-après détaillées. - -Par ailleurs, si le Concédant détient ou venait à détenir un ou -plusieurs brevets d'invention protégeant tout ou partie des -fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas -opposer les éventuels droits conférés par ces brevets aux Licenciés -successifs qui utiliseraient, exploiteraient ou modifieraient le -Logiciel. En cas de cession de ces brevets, le Concédant s'engage à -faire reprendre les obligations du présent alinéa aux cessionnaires. - - - 5.1 DROIT D'UTILISATION - -Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant -aux domaines d'application, étant ci-après précisé que cela comporte: - - 1. la reproduction permanente ou provisoire du Logiciel en tout ou - partie par tout moyen et sous toute forme. - - 2. le chargement, l'affichage, l'exécution, ou le stockage du - Logiciel sur tout support. - - 3. la possibilité d'en observer, d'en étudier, ou d'en tester le - fonctionnement afin de déterminer les idées et principes qui sont - à la base de n'importe quel élément de ce Logiciel; et ceci, - lorsque le Licencié effectue toute opération de chargement, - d'affichage, d'exécution, de transmission ou de stockage du - Logiciel qu'il est en droit d'effectuer en vertu du Contrat. - - - 5.2 DROIT D'APPORTER DES CONTRIBUTIONS - -Le droit d'apporter des Contributions comporte le droit de traduire, -d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel -et le droit de reproduire le Logiciel en résultant. - -Le Licencié est autorisé à apporter toute Contribution au Logiciel sous -réserve de mentionner, de façon explicite, son nom en tant qu'auteur de -cette Contribution et la date de création de celle-ci. - - - 5.3 DROIT DE DISTRIBUTION - -Le droit de distribution comporte notamment le droit de diffuser, de -transmettre et de communiquer le Logiciel au public sur tout support et -par tout moyen ainsi que le droit de mettre sur le marché à titre -onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé. - -Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou -non, à des tiers dans les conditions ci-après détaillées. - - - 5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION - -Le Licencié est autorisé à distribuer des copies conformes du Logiciel, -sous forme de Code Source ou de Code Objet, à condition que cette -distribution respecte les dispositions du Contrat dans leur totalité et -soit accompagnée: - - 1. d'un exemplaire du Contrat, - - 2. d'un avertissement relatif à la restriction de garantie et de - responsabilité du Concédant telle que prévue aux articles 8 - et 9, - -et que, dans le cas où seul le Code Objet du Logiciel est redistribué, -le Licencié permette aux futurs Licenciés d'accéder facilement au Code -Source complet du Logiciel en indiquant les modalités d'accès, étant -entendu que le coût additionnel d'acquisition du Code Source ne devra -pas excéder le simple coût de transfert des données. - - - 5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE - -Lorsque le Licencié apporte une Contribution au Logiciel, les conditions -de distribution du Logiciel Modifié sont alors soumises à l'intégralité -des dispositions du Contrat. - -Le Licencié est autorisé à distribuer le Logiciel Modifié, sous forme de -Code Source ou de Code Objet, à condition que cette distribution -respecte les dispositions du Contrat dans leur totalité et soit -accompagnée: - - 1. d'un exemplaire du Contrat, - - 2. d'un avertissement relatif à la restriction de garantie et de - responsabilité du Concédant telle que prévue aux articles 8 - et 9, - -et que, dans le cas où seul le Code Objet du Logiciel Modifié est -redistribué, le Licencié permette aux futurs Licenciés d'accéder -facilement au Code Source complet du Logiciel Modifié en indiquant les -modalités d'accès, étant entendu que le coût additionnel d'acquisition -du Code Source ne devra pas excéder le simple coût de transfert des données. - - - 5.3.3 DISTRIBUTION DES MODULES EXTERNES - -Lorsque le Licencié a développé un Module Externe les conditions du -Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué -sous un contrat de licence différent. - - - 5.3.4 COMPATIBILITE AVEC LA LICENCE GNU GPL - -Le Licencié peut inclure un code soumis aux dispositions d'une des -versions de la licence GNU GPL dans le Logiciel modifié ou non et -distribuer l'ensemble sous les conditions de la même version de la -licence GNU GPL. - -Le Licencié peut inclure le Logiciel modifié ou non dans un code soumis -aux dispositions d'une des versions de la licence GNU GPL et distribuer -l'ensemble sous les conditions de la même version de la licence GNU GPL. - - - Article 6 - PROPRIETE INTELLECTUELLE - - - 6.1 SUR LE LOGICIEL INITIAL - -Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel -Initial. Toute utilisation du Logiciel Initial est soumise au respect -des conditions dans lesquelles le Titulaire a choisi de diffuser son -oeuvre et nul autre n'a la faculté de modifier les conditions de -diffusion de ce Logiciel Initial. - -Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi -par la présente licence et ce, pour la durée visée à l'article 4.2. - - - 6.2 SUR LES CONTRIBUTIONS - -Le Licencié qui a développé une Contribution est titulaire sur celle-ci -des droits de propriété intellectuelle dans les conditions définies par -la législation applicable. - - - 6.3 SUR LES MODULES EXTERNES - -Le Licencié qui a développé un Module Externe est titulaire sur celui-ci -des droits de propriété intellectuelle dans les conditions définies par -la législation applicable et reste libre du choix du contrat régissant -sa diffusion. - - - 6.4 DISPOSITIONS COMMUNES - -Le Licencié s'engage expressément: - - 1. à ne pas supprimer ou modifier de quelque manière que ce soit les - mentions de propriété intellectuelle apposées sur le Logiciel; - - 2. à reproduire à l'identique lesdites mentions de propriété - intellectuelle sur les copies du Logiciel modifié ou non. - -Le Licencié s'engage à ne pas porter atteinte, directement ou -indirectement, aux droits de propriété intellectuelle du Titulaire et/ou -des Contributeurs sur le Logiciel et à prendre, le cas échéant, à -l'égard de son personnel toutes les mesures nécessaires pour assurer le -respect des dits droits de propriété intellectuelle du Titulaire et/ou -des Contributeurs. - - - Article 7 - SERVICES ASSOCIES - -7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de -prestations d'assistance technique ou de maintenance du Logiciel. - -Cependant le Concédant reste libre de proposer ce type de services. Les -termes et conditions d'une telle assistance technique et/ou d'une telle -maintenance seront alors déterminés dans un acte séparé. Ces actes de -maintenance et/ou assistance technique n'engageront que la seule -responsabilité du Concédant qui les propose. - -7.2 De même, tout Concédant est libre de proposer, sous sa seule -responsabilité, à ses licenciés une garantie, qui n'engagera que lui, -lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce, -dans les conditions qu'il souhaite. Cette garantie et les modalités -financières de son application feront l'objet d'un acte séparé entre le -Concédant et le Licencié. - - - Article 8 - RESPONSABILITE - -8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la -faculté, sous réserve de prouver la faute du Concédant concerné, de -solliciter la réparation du préjudice direct qu'il subirait du fait du -logiciel et dont il apportera la preuve. - -8.2 La responsabilité du Concédant est limitée aux engagements pris en -application du Contrat et ne saurait être engagée en raison notamment: -(i) des dommages dus à l'inexécution, totale ou partielle, de ses -obligations par le Licencié, (ii) des dommages directs ou indirects -découlant de l'utilisation ou des performances du Logiciel subis par le -Licencié et (iii) plus généralement d'un quelconque dommage indirect. En -particulier, les Parties conviennent expressément que tout préjudice -financier ou commercial (par exemple perte de données, perte de -bénéfices, perte d'exploitation, perte de clientèle ou de commandes, -manque à gagner, trouble commercial quelconque) ou toute action dirigée -contre le Licencié par un tiers, constitue un dommage indirect et -n'ouvre pas droit à réparation par le Concédant. - - - Article 9 - GARANTIE - -9.1 Le Licencié reconnaît que l'état actuel des connaissances -scientifiques et techniques au moment de la mise en circulation du -Logiciel ne permet pas d'en tester et d'en vérifier toutes les -utilisations ni de détecter l'existence d'éventuels défauts. L'attention -du Licencié a été attirée sur ce point sur les risques associés au -chargement, à l'utilisation, la modification et/ou au développement et à -la reproduction du Logiciel qui sont réservés à des utilisateurs avertis. - -Il relève de la responsabilité du Licencié de contrôler, par tous -moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et -de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens. - -9.2 Le Concédant déclare de bonne foi être en droit de concéder -l'ensemble des droits attachés au Logiciel (comprenant notamment les -droits visés à l'article 5). - -9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le -Concédant sans autre garantie, expresse ou tacite, que celle prévue à -l'article 9.2 et notamment sans aucune garantie sur sa valeur -commerciale, son caractère sécurisé, innovant ou pertinent. - -En particulier, le Concédant ne garantit pas que le Logiciel est exempt -d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible -avec l'équipement du Licencié et sa configuration logicielle ni qu'il -remplira les besoins du Licencié. - -9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le -Logiciel ne porte pas atteinte à un quelconque droit de propriété -intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout -autre droit de propriété. Ainsi, le Concédant exclut toute garantie au -profit du Licencié contre les actions en contrefaçon qui pourraient être -diligentées au titre de l'utilisation, de la modification, et de la -redistribution du Logiciel. Néanmoins, si de telles actions sont -exercées contre le Licencié, le Concédant lui apportera son aide -technique et juridique pour sa défense. Cette aide technique et -juridique est déterminée au cas par cas entre le Concédant concerné et -le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage -toute responsabilité quant à l'utilisation de la dénomination du -Logiciel par le Licencié. Aucune garantie n'est apportée quant à -l'existence de droits antérieurs sur le nom du Logiciel et sur -l'existence d'une marque. - - - Article 10 - RESILIATION - -10.1 En cas de manquement par le Licencié aux obligations mises à sa -charge par le Contrat, le Concédant pourra résilier de plein droit le -Contrat trente (30) jours après notification adressée au Licencié et -restée sans effet. - -10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à -utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les -licences qu'il aura concédées antérieurement à la résiliation du Contrat -resteront valides sous réserve qu'elles aient été effectuées en -conformité avec le Contrat. - - - Article 11 - DISPOSITIONS DIVERSES - - - 11.1 CAUSE EXTERIEURE - -Aucune des Parties ne sera responsable d'un retard ou d'une défaillance -d'exécution du Contrat qui serait dû à un cas de force majeure, un cas -fortuit ou une cause extérieure, telle que, notamment, le mauvais -fonctionnement ou les interruptions du réseau électrique ou de -télécommunication, la paralysie du réseau liée à une attaque -informatique, l'intervention des autorités gouvernementales, les -catastrophes naturelles, les dégâts des eaux, les tremblements de terre, -le feu, les explosions, les grèves et les conflits sociaux, l'état de -guerre... - -11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou -plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du -Contrat, ne pourra en aucun cas impliquer renonciation par la Partie -intéressée à s'en prévaloir ultérieurement. - -11.3 Le Contrat annule et remplace toute convention antérieure, écrite -ou orale, entre les Parties sur le même objet et constitue l'accord -entier entre les Parties sur cet objet. Aucune addition ou modification -aux termes du Contrat n'aura d'effet à l'égard des Parties à moins -d'être faite par écrit et signée par leurs représentants dûment habilités. - -11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat -s'avèrerait contraire à une loi ou à un texte applicable, existants ou -futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les -amendements nécessaires pour se conformer à cette loi ou à ce texte. -Toutes les autres dispositions resteront en vigueur. De même, la -nullité, pour quelque raison que ce soit, d'une des dispositions du -Contrat ne saurait entraîner la nullité de l'ensemble du Contrat. - - - 11.5 LANGUE - -Le Contrat est rédigé en langue française et en langue anglaise, ces -deux versions faisant également foi. - - - Article 12 - NOUVELLES VERSIONS DU CONTRAT - -12.1 Toute personne est autorisée à copier et distribuer des copies de -ce Contrat. - -12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé -et ne peut être modifié que par les auteurs de la licence, lesquels se -réservent le droit de publier périodiquement des mises à jour ou de -nouvelles versions du Contrat, qui possèderont chacune un numéro -distinct. Ces versions ultérieures seront susceptibles de prendre en -compte de nouvelles problématiques rencontrées par les logiciels libres. - -12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra -faire l'objet d'une diffusion ultérieure que sous la même version du -Contrat ou une version postérieure, sous réserve des dispositions de -l'article 5.3.4. - - - Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE - -13.1 Le Contrat est régi par la loi française. Les Parties conviennent -de tenter de régler à l'amiable les différends ou litiges qui -viendraient à se produire par suite ou à l'occasion du Contrat. - -13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter -de leur survenance et sauf situation relevant d'une procédure d'urgence, -les différends ou litiges seront portés par la Partie la plus diligente -devant les Tribunaux compétents de Paris. - - -Version 2.0 du 2005-05-21. \ No newline at end of file diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile deleted file mode 100644 index 1678a90ea9235bc5e820653343b58edb7ac41fc0..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -UNAME := $(shell uname -s) -CC = /usr/bin/gcc -#CC = test2.sh -#CC = /packages/gcc_3.2.2/bin/g++32 -OPT = -O1 -pthread -# Solaris -#LOPT = -O1 -pthread -ldl -lnsl -lsocket -#Linux -LOPT_UNIX = -O1 -pthread -ldl -lrt -LOPT_MAC = -O1 -pthread -ldl - -DEBUG = -g -OTHER = -Wall -TRY = -CFLAGS = $(OPT) $(OTHER) $(TRY) -LFLAGS_MAC = $(LOPT_MAC) $(OTHER) $(TRY) -LFLAGS_UNIX = $(LOPT_UNIX) $(OTHER) $(TRY) -# CFLAGS = $(DEBUG) $(OTHER) -OBJDIR = lib - -MODULE = run -SRCS_generated_DIR = generated_src/ -include Makefile.src -SRCS_base = src/request.c src/message.c src/myerrors.c src/debug.c src/syncchannel.c src/asyncchannel.c src/request_manager.c src/random.c src/mytimelib.c src/tracemanager.c -SRCS_base_DIR = . -SRCS_base_DIRSRC = src/ -OBJS_executor = $(SRCS_base:%.c=lib/%.o) -OBJS = $(SRCS:%.c=lib/%.o) - -include Makefile.defs - -include Makefile.forsoclib diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.defs b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.defs deleted file mode 100644 index fa9276ff99651594a42f44ddcb827ffefe68c4c2..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.defs +++ /dev/null @@ -1,36 +0,0 @@ -## Variable that points to SystemC installation path - - -INCDIR = -I. -I$(SRCS_base_DIR) -I$(SRCS_base_DIRSRC) -I$(SRCS_generated_DIR) -LIBDIR = -L. -L.. -LIBS = -lm $(EXTRA_LIBS) - -EXE = $(MODULE).x - -.SUFFIXES: .c .o .x - - -$(EXE): makedir $(OBJS) $(OBJS_executor) -ifeq ($(UNAME),Darwin) - $(CC) $(LFLAGS_MAC) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt -endif -ifneq ($(UNAME),Darwin) - $(CC) $(LFLAGS_UNIX) $(INCDIR) $(LIBDIR) -o $@ $(OBJS) $(OBJS_executor) $(LIBS) 2>&1 | c++filt -endif - -makedir: - echo Making directories - mkdir -p ./lib - mkdir -p ./lib/$(SRCS_generated_DIR) - mkdir -p ./lib/$(SRCS_base_DIRSRC) - -$(OBJDIR)/%.o: $(SRCS_base_DIR)/%.c - $(CC) $(CFLAGS) $(INCDIR) -o $@ -c $< - - -clean: - rm -f $(OBJS_simulator) $(OBJS_executor) $(OBJS) *~ $(EXE) core - -ultraclean: clean - rm -f Makefile.deps - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.forsoclib b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.forsoclib deleted file mode 100644 index 9f685d88168abf74e444f54116858668b96e1f55..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.forsoclib +++ /dev/null @@ -1,23 +0,0 @@ -SOCLIB_CPU=ppc -MUTEKH_CPU=ppc - -PATH+=/opt/mutekh/bin -export PATH - -updateruntime: - cp ~/TTool/executablecode/src/*.c ~/TTool/MPSoC/mutekh/libavatar/ - cp ~/TTool/executablecode/src/*.h ~/TTool/MPSoC/mutekh/libavatar/include/ - -updategeneratedcode: - cp ~/TTool/executablecode/generated_src/*.h ~/TTool/MPSoC/mutekh/examples/avatar - cp ~/TTool/executablecode/generated_src/*.c ~/TTool/MPSoC/mutekh/examples/avatar - cp ~/TTool/executablecode/Makefile.soclib ~/TTool/MPSoC/mutekh/examples/avatar/Makefile - -compilesoclib: - cd ~/TTool/MPSoC/mutekh; make CONF=examples/avatar/config BUILD=soclib-$(MUTEKH_CPU):pf-tutorial - -runsoclib: - echo "running soclib" - cd ~/TTool/MPSoC/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial; SOCLIB_GDB=S ./system.x $(SOCLIB_CPU):$(SOCLIB_CPU_COUNT) ~/TTool/MPSoC/mutekh/avatar-soclib-$(MUTEKH_CPU).out -allsoclib: updateruntime updategeneratedcode compilesoclib runsoclib - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib deleted file mode 100644 index aa40bd7d2e96f87549605fe56c635b5f61c539eb..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.soclib +++ /dev/null @@ -1 +0,0 @@ -objs = main.o SecondaryBlock.o MainBlock.o \ No newline at end of file diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src b/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src deleted file mode 100644 index 2f6da4749f31f01213975afcd9629e735529dbb5..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/Makefile.src +++ /dev/null @@ -1 +0,0 @@ -SRCS = generated_src/main.c generated_src/SecondaryBlock.c generated_src/MainBlock.c \ No newline at end of file diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c deleted file mode 100644 index 6d312505b8abdea09bb61a88732def3f254d47a0..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "MainBlock.h" - - -// Header code defined in the model -DigitalOut myled1(LED1); - -void __userImplemented__MainBlock__LED1on() { - myled1 = 1; - printf("Led1 on.\n"); -} -void __userImplemented__MainBlock__LED1off(int val){ - myled1 = 0; - printf("Led1 off.\n"); - printf("value of x=%d\n",val); -} - -// End of header code defined in the model - -#define STATE__START__STATE 0 -#define STATE__Waiting_For_Value 1 -#define STATE__choice__0 2 -#define STATE__Led1On 3 -#define STATE__Led1Off 4 -#define STATE__STOP__STATE 5 - -void MainBlock__LED1on() { - traceFunctionCall("MainBlock", "LED1on", "-"); - __userImplemented__MainBlock__LED1on(); -} - - -void MainBlock__LED1off(int x) { - char my__attr[CHAR_ALLOC_SIZE]; - sprintf(my__attr, "%d",x); - traceFunctionCall("MainBlock", "LED1off", my__attr); - __userImplemented__MainBlock__LED1off(x); -} - - -void *mainFunc__MainBlock(void *arg){ - int period = 2; - int x = 0; - int currentRand = 0; - - int __currentState = STATE__START__STATE; - __attribute__((unused)) request __req0; - __attribute__((unused))int *__params0[1]; - __attribute__((unused)) request __req1; - __attribute__((unused))int *__params1[1]; - __attribute__((unused))setOfRequests __list; - __attribute__((unused))pthread_cond_t __myCond; - __attribute__((unused))request *__returnRequest; - - char * __myname = (char *)arg; - - pthread_cond_init(&__myCond, NULL); - - fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex); - //printf("my name = %s\n", __myname); - - /* Main loop on states */ - while(__currentState != STATE__STOP__STATE) { - switch(__currentState) { - case STATE__START__STATE: - traceStateEntering(__myname, "__StartState"); - __currentState = STATE__Waiting_For_Value; - break; - - case STATE__Waiting_For_Value: - traceStateEntering(__myname, "Waiting_For_Value"); - __params0[0] = ¤tRand; - makeNewRequest(&__req0, 281, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0); - __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal; - __returnRequest = executeOneRequest(&__list, &__req0); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - __currentState = STATE__choice__0; - break; - - case STATE__choice__0: - traceStateEntering(__myname, "choice__0"); - if (!(currentRand > 5)) { - makeNewRequest(&__req0, 286, IMMEDIATE, 0, 0, 0, 0, __params0); - addRequestToList(&__list, &__req0); - } - if (currentRand > 5) { - makeNewRequest(&__req1, 291, IMMEDIATE, 0, 0, 0, 0, __params1); - addRequestToList(&__list, &__req1); - } - if (nbOfRequests(&__list) == 0) { - debug2Msg(__myname, "No possible request"); - __currentState = STATE__STOP__STATE; - break; - } - __returnRequest = executeListOfRequests(&__list); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - if (__returnRequest == &__req0) { - __currentState = STATE__Waiting_For_Value; - - } - else if (__returnRequest == &__req1) { - __currentState = STATE__Led1On; - - } - break; - - case STATE__Led1On: - traceStateEntering(__myname, "Led1On"); - waitFor((period)*1000000, (period)*1000000); - x = x+1; - traceVariableModification("MainBlock", "x", x,0); - MainBlock__LED1off(x); - __currentState = STATE__Led1Off; - break; - - case STATE__Led1Off: - traceStateEntering(__myname, "Led1Off"); - if (!(x > 10)) { - makeNewRequest(&__req0, 287, IMMEDIATE, 1, (period)*1000000, (period)*1000000, 0, __params0); - addRequestToList(&__list, &__req0); - } - if (x > 10) { - makeNewRequest(&__req1, 305, IMMEDIATE, 0, 0, 0, 0, __params1); - addRequestToList(&__list, &__req1); - } - if (nbOfRequests(&__list) == 0) { - debug2Msg(__myname, "No possible request"); - __currentState = STATE__STOP__STATE; - break; - } - __returnRequest = executeListOfRequests(&__list); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - if (__returnRequest == &__req0) { - __currentState = STATE__Waiting_For_Value; - - } - else if (__returnRequest == &__req1) { - __currentState = STATE__STOP__STATE; - - } - break; - - } - } - //printf("Exiting = %s\n", __myname); - return NULL; -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp deleted file mode 100644 index 4c74846ea81a681f6ea48065cd949731b04b4cbd..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include "MainBlock.h" - - -// Header code defined in the model -DigitalOut myled1(LED1); - -void __userImplemented__MainBlock__LED1on() { - myled1 = 1; - printf("Led1 on.\n"); -} -void __userImplemented__MainBlock__LED1off(int val){ - myled1 = 0; - printf("Led1 off.\n"); - printf("value of x=%d\n",val); -} - -// End of header code defined in the model - -#define STATE__START__STATE 0 -#define STATE__Waiting_For_Value 1 -#define STATE__choice__0 2 -#define STATE__Led1On 3 -#define STATE__Led1Off 4 -#define STATE__STOP__STATE 5 - -void MainBlock__LED1on() { - traceFunctionCall("MainBlock", "LED1on", "-"); - __userImplemented__MainBlock__LED1on(); -} - - -void MainBlock__LED1off(int x) { - char my__attr[CHAR_ALLOC_SIZE]; - sprintf(my__attr, "%d",x); - traceFunctionCall("MainBlock", "LED1off", my__attr); - __userImplemented__MainBlock__LED1off(x); -} - - -void mainFunc__MainBlock(){ - int period = 2; - int x = 0; - int currentRand = 0; - - int __currentState = STATE__START__STATE; - __attribute__((unused)) request __req0; - __attribute__((unused))int *__params0[1]; - __attribute__((unused)) request __req1; - __attribute__((unused))int *__params1[1]; - __attribute__((unused))setOfRequests __list; - __attribute__((unused))size_t __myCond; - __attribute__((unused))request *__returnRequest; - - char * __myname = "mainFunc__MainBlock"; - - fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex); - //printf("my name = %s\n", __myname); - - /* Main loop on states */ - while(__currentState != STATE__STOP__STATE) { - switch(__currentState) { - case STATE__START__STATE: - traceStateEntering(__myname, "__StartState"); - __currentState = STATE__Waiting_For_Value; - break; - - case STATE__Waiting_For_Value: - traceStateEntering(__myname, "Waiting_For_Value"); - __params0[0] = ¤tRand; - makeNewRequest(&__req0, 163, RECEIVE_SYNC_REQUEST, 0, 0, 0, 1, __params0); - __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal; - __returnRequest = executeOneRequest(&__list, &__req0); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - __currentState = STATE__choice__0; - break; - - case STATE__choice__0: - traceStateEntering(__myname, "choice__0"); - if (!(currentRand > 5)) { - makeNewRequest(&__req0, 168, IMMEDIATE, 0, 0, 0, 0, __params0); - addRequestToList(&__list, &__req0); - } - if (currentRand > 5) { - makeNewRequest(&__req1, 173, IMMEDIATE, 0, 0, 0, 0, __params1); - addRequestToList(&__list, &__req1); - } - if (nbOfRequests(&__list) == 0) { - debug2Msg(__myname, "No possible request"); - __currentState = STATE__STOP__STATE; - break; - } - __returnRequest = executeListOfRequests(&__list); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - if (__returnRequest == &__req0) { - __currentState = STATE__Waiting_For_Value; - - } - else if (__returnRequest == &__req1) { - __currentState = STATE__Led1On; - - } - break; - - case STATE__Led1On: - traceStateEntering(__myname, "Led1On"); - wait_us((period)*1000000); - x = x+1; - traceVariableModification("MainBlock", "x", x,0); - MainBlock__LED1off(x); - __currentState = STATE__Led1Off; - break; - - case STATE__Led1Off: - traceStateEntering(__myname, "Led1Off"); - if (!(x > 10)) { - makeNewRequest(&__req0, 169, IMMEDIATE, 1, (period)*1000000, (period)*1000000, 0, __params0); - addRequestToList(&__list, &__req0); - } - if (x > 10) { - makeNewRequest(&__req1, 187, IMMEDIATE, 0, 0, 0, 0, __params1); - addRequestToList(&__list, &__req1); - } - if (nbOfRequests(&__list) == 0) { - debug2Msg(__myname, "No possible request"); - __currentState = STATE__STOP__STATE; - break; - } - __returnRequest = executeListOfRequests(&__list); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - if (__returnRequest == &__req0) { - __currentState = STATE__Waiting_For_Value; - - } - else if (__returnRequest == &__req1) { - __currentState = STATE__STOP__STATE; - - } - break; - - } - } - //printf("Exiting = %s\n", __myname); - return ; -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c deleted file mode 100644 index 836c0ad99c3ee6e5b1f42635573a03ae226263d0..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "SecondaryBlock.h" - - -// Header code defined in the model -extern int val; - -// End of header code defined in the model - -#define STATE__START__STATE 0 -#define STATE__Waiting_Cycle 1 -#define STATE__CalculatingRand 2 -#define STATE__SendingRand 3 -#define STATE__STOP__STATE 4 - -void *mainFunc__SecondaryBlock(void *arg){ - int val = 0; - - int __currentState = STATE__START__STATE; - __attribute__((unused)) request __req0; - __attribute__((unused))int *__params0[1]; - __attribute__((unused))setOfRequests __list; - __attribute__((unused))pthread_cond_t __myCond; - __attribute__((unused))request *__returnRequest; - - char * __myname = (char *)arg; - - pthread_cond_init(&__myCond, NULL); - - fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex); - //printf("my name = %s\n", __myname); - - /* Main loop on states */ - while(__currentState != STATE__STOP__STATE) { - switch(__currentState) { - case STATE__START__STATE: - traceStateEntering(__myname, "__StartState"); - __currentState = STATE__Waiting_Cycle; - break; - - case STATE__Waiting_Cycle: - traceStateEntering(__myname, "Waiting_Cycle"); - waitFor((4)*1000000, (4)*1000000); - __currentState = STATE__CalculatingRand; - break; - - case STATE__CalculatingRand: - traceStateEntering(__myname, "CalculatingRand"); - val = computeRandom(1, 10); - __currentState = STATE__SendingRand; - break; - - case STATE__SendingRand: - traceStateEntering(__myname, "SendingRand"); - __params0[0] = &val; - makeNewRequest(&__req0, 272, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0); - __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal; - __returnRequest = executeOneRequest(&__list, &__req0); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - __currentState = STATE__Waiting_Cycle; - break; - - } - } - //printf("Exiting = %s\n", __myname); - return NULL; -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp deleted file mode 100644 index ee7bcdaec799d5c4b6d6a90e8c75e7146b9edad9..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "SecondaryBlock.h" - - -// Header code defined in the model -extern int val; - -// End of header code defined in the model - -#define STATE__START__STATE 0 -#define STATE__Waiting_Cycle 1 -#define STATE__CalculatingRand 2 -#define STATE__SendingRand 3 -#define STATE__STOP__STATE 4 - -void mainFunc__SecondaryBlock(){ - int val = 0; - - int __currentState = STATE__START__STATE; - __attribute__((unused)) request __req0; - __attribute__((unused))int *__params0[1]; - __attribute__((unused))setOfRequests __list; - __attribute__((unused))size_t __myCond; - __attribute__((unused))request *__returnRequest; - - char * __myname = "mainFunc__SecondaryBlock"; - - fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex); - //printf("my name = %s\n", __myname); - - /* Main loop on states */ - while(__currentState != STATE__STOP__STATE) { - switch(__currentState) { - case STATE__START__STATE: - traceStateEntering(__myname, "__StartState"); - __currentState = STATE__Waiting_Cycle; - break; - - case STATE__Waiting_Cycle: - traceStateEntering(__myname, "Waiting_Cycle"); - wait_us((4)*1000000); - __currentState = STATE__CalculatingRand; - break; - - case STATE__CalculatingRand: - traceStateEntering(__myname, "CalculatingRand"); - val = computeRandom(1, 10); - __currentState = STATE__SendingRand; - break; - - case STATE__SendingRand: - traceStateEntering(__myname, "SendingRand"); - __params0[0] = &val; - makeNewRequest(&__req0, 154, SEND_SYNC_REQUEST, 0, 0, 0, 1, __params0); - __req0.syncChannel = &__MainBlock_RandVal__SecondaryBlock_RanVal; - __returnRequest = executeOneRequest(&__list, &__req0); - clearListOfRequests(&__list); - traceRequest(__myname, __returnRequest); - __currentState = STATE__Waiting_Cycle; - break; - - } - } - //printf("Exiting = %s\n", __myname); - return ; -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h deleted file mode 100644 index 901896f23259f570eabdc4563bd8de4dee6d14f2..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/SecondaryBlock.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SecondaryBlock_H -#define SecondaryBlock_H -#include <stdio.h> -#include <pthread.h> -#include <unistd.h> -#include <stdlib.h> - -#include "request.h" -#include "syncchannel.h" -#include "request_manager.h" -#include "debug.h" -#include "defs.h" -#include "mytimelib.h" -#include "random.h" -#include "tracemanager.h" -#include "main.h" - -extern void *mainFunc__SecondaryBlock(void *arg); - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c deleted file mode 100644 index f77ce651f55e62e03d5ebfb1cc907f78845ae681..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <stdio.h> -#include <pthread.h> -#include <unistd.h> -#include <stdlib.h> - -#include "request.h" -#include "syncchannel.h" -#include "request_manager.h" -#include "debug.h" -#include "random.h" -#include "tracemanager.h" - -/* User code */ -void __user_init() { -} - -/* End of User code */ - -/* Main mutex */ -pthread_mutex_t __mainMutex; - -/* Synchronous channels */ -syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal; -/* Asynchronous channels */ - -#include "SecondaryBlock.h" -#include "MainBlock.h" - - -int main(int argc, char *argv[]) { - - /* disable buffering on stdout */ - setvbuf(stdout, NULL, _IONBF, 0); - - /* Synchronous channels */ - __MainBlock_RandVal__SecondaryBlock_RanVal.inname ="RandVal"; - __MainBlock_RandVal__SecondaryBlock_RanVal.outname ="RanVal"; - /* Asynchronous channels */ - - /* Threads of tasks */ - pthread_t thread__SecondaryBlock; - pthread_t thread__MainBlock; - /* Activating tracing */ - if (argc>1){ - activeTracingInFile(argv[1]); - } else { - activeTracingInConsole(); - } - /* Activating randomness */ - initRandom(); - /* Initializing the main mutex */ -if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);} - - /* Initializing mutex of messages */ - initMessages(); - /* User initialization */ - __user_init(); - - - pthread_create(&thread__SecondaryBlock, NULL, mainFunc__SecondaryBlock, (void *)"SecondaryBlock"); - pthread_create(&thread__MainBlock, NULL, mainFunc__MainBlock, (void *)"MainBlock"); - - - pthread_join(thread__SecondaryBlock, NULL); - pthread_join(thread__MainBlock, NULL); - - - return 0; - -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h deleted file mode 100644 index e2eb31884c1656f442ef7f3da2b7f2612981b22a..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H -/* Main mutex */ -extern pthread_mutex_t __mainMutex; - -/* Synchronous channels */ -extern syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal; -/* Asynchronous channels */ -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c deleted file mode 100644 index e2ce2ac48a62b888eedc7940c74b1ae1f3953013..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <stdlib.h> - -#include "message.h" -#include "asyncchannel.h" -#include "myerrors.h" - - -asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) { - asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel))); - if (asyncch == NULL) { - criticalError("Allocation of asyncchannel failed"); - } - asyncch->inname = inname; - asyncch->outname = outname; - asyncch->isBlocking = isBlocking; - asyncch->maxNbOfMessages = maxNbOfMessages; - - return asyncch; -} - -void destroyAsyncchannel(asyncchannel *asyncch) { - free(asyncch); -} - -message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) { - message *msg; - message *previous; - - if (channel->currentNbOfMessages == 0) { - return NULL; - } - - if (channel->currentNbOfMessages == 1) { - channel->currentNbOfMessages = 0; - msg = channel->pendingMessages; - channel->pendingMessages = NULL; - return msg; - } - - msg = channel->pendingMessages; - previous = msg; - while(msg->next != NULL) { - previous = msg; - msg = msg->next; - } - - channel->currentNbOfMessages = channel->currentNbOfMessages -1; - previous->next = NULL; - return msg; -} - -void addMessageToAsyncChannel(asyncchannel *channel, message *msg) { - msg->next = channel->pendingMessages; - channel->pendingMessages = msg; - channel->currentNbOfMessages = channel->currentNbOfMessages+1; -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h deleted file mode 100644 index 8f812359dbd67311f37391807b883890ee163f04..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/asyncchannel.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ASYNCCHANNEL_H -#define ASYNCCHANNEL_H - -struct asyncchannel; - -#include "message.h" -#include "request.h" - - -struct asyncchannel { - char *outname; - char *inname; - int isBlocking; // In writing. Reading is always blocking - int maxNbOfMessages; // - struct request* outWaitQueue; - struct request* inWaitQueue; - message *pendingMessages; - int currentNbOfMessages; -}; - -typedef struct asyncchannel asyncchannel; - -asyncchannel *getNewAsyncchannel(char *inname, char *outname, int isBlocking, int maxNbOfMessages); -void destroyAsyncchannel(asyncchannel *syncch); -message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel); -void addMessageToAsyncChannel(asyncchannel *channel, message *msg); - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h deleted file mode 100644 index 7e73f3ce91684420195a07eb365184b0629e74f3..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.h +++ /dev/null @@ -1,19 +0,0 @@ - - -#ifndef DEBUG_H -#define DEBUG_H - -void activeDebug(); -void unactiveDebug(); - -void debugThreeInts(char *msg, int value1, int value2, int value3); -void debugTwoInts(char *msg, int value1, int value2); -void debugLong(char *msg, long value); -void debugInt(char *msg, int value); -void debugMsg(char *msg); -void debug2Msg(char *name, char* msg); -void debugTime(char* msg, struct timespec *ts); - -#endif - - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h deleted file mode 100644 index 3b997bfdf885b560dc4fde8264e8b5026565de10..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/defs.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DEFS_H -#define DEFS_H - -#define bool int -#define true 1 -#define false 0 - - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c deleted file mode 100644 index 1153a882f51d93d8596621162f82278bc01d7158..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.c +++ /dev/null @@ -1,59 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> -#include <pthread.h> - -#include "message.h" -#include "myerrors.h" - -long __id_message = 0; -pthread_mutex_t __message_mutex; - - -void initMessages() { - if (pthread_mutex_init(&__message_mutex, NULL) < 0) { exit(-1);} -} - -long getMessageID() { - long tmp; - pthread_mutex_lock(&__message_mutex); - tmp = __id_message; - __id_message ++; - pthread_mutex_unlock(&__message_mutex); - return tmp; -} - -message *getNewMessageWithParams(int nbOfParams) { - - message *msg = (message *)(malloc(sizeof(struct message))); - if (msg == NULL) { - criticalError("Allocation of request failed"); - } - msg->nbOfParams = nbOfParams; - msg->params = (int *)(malloc(sizeof(int) * nbOfParams)); - msg->id = getMessageID(); - return msg; -} - -message *getNewMessage(int nbOfParams, int *params) { - - message *msg = (message *)(malloc(sizeof(struct message))); - if (msg == NULL) { - criticalError("Allocation of request failed"); - } - msg->nbOfParams = nbOfParams; - msg->params = params; - msg->id = getMessageID(); - return msg; -} - - - -void destroyMessageWithParams(message *msg) { - free(msg->params); - free(msg); -} - -void destroyMessage(message *msg) { - free(msg); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h deleted file mode 100644 index 700ed07d97f6ae925ceeb6c172238a2f4bd37680..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/message.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MESSAGE_H -#define MESSAGE_H - - -struct message { - struct message *next; - int nbOfParams; - int *params; - long id; -}; - -typedef struct message message; - -void initMessages(); -message *getNewMessageWithParams(int nbOfParams); -message *getNewMessage(int nbOfParams, int *params); -void destroyMessageWithParams(message *msg); -void destroyMessage(message *msg); - - - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h deleted file mode 100644 index 8300da3ccfd1b5f2efd2f3514a8f543409363003..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.h +++ /dev/null @@ -1,11 +0,0 @@ - - -#ifndef MY_ERRORS_H -#define MY_ERRORS_H - -void criticalErrorInt(char *msg, int value); -void criticalError(char *msg); - -#endif - - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c deleted file mode 100644 index d39c07ea85c258ce227365364163ce1761038663..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.c +++ /dev/null @@ -1,108 +0,0 @@ -#include<time.h> - -#include "mytimelib.h" -#include "random.h" -#include "debug.h" - -#ifndef CLOCK_REALTIME -#define CLOCK_REALTIME - -int clock_gettime(struct timespec *ts) { - struct timeval tv; - gettimeofday(&tv, NULL); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; - return 0; -} - -int my_clock_gettime(struct timespec *tp) { - return clock_gettime(tp); -} - -#else - -int my_clock_gettime(struct timespec *tp) { - return clock_gettime(CLOCK_REALTIME, tp); -} - -#endif - - - -void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - dest->tv_nsec = src1->tv_nsec + src2->tv_nsec; - dest->tv_sec = src1->tv_sec + src2->tv_sec; - if (dest->tv_nsec > 1000000000) { - dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000); - dest->tv_nsec = dest->tv_nsec % 1000000000; - } -} - -void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - int diff = 0; - if (src1->tv_nsec > src2->tv_nsec) { - diff ++; - dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000; - } else { - dest->tv_nsec = src2->tv_nsec - src1->tv_nsec; - } - - dest->tv_sec = src2->tv_sec - src1->tv_sec - diff; -} - - - -int isBefore(struct timespec *src1, struct timespec *src2) { - if (src1->tv_sec > src2->tv_sec) { - return 0; - } - - if (src1->tv_sec < src2->tv_sec) { - return 1; - } - - if (src1->tv_nsec < src2->tv_nsec) { - return 1; - } - return 0; -} - -void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) { - debugMsg("MIN TIME COMPUTATION"); - if (isBefore(src1,src2)) { - dest->tv_nsec = src1->tv_nsec; - dest->tv_sec = src1->tv_sec; - } else { - dest->tv_nsec = src2->tv_nsec; - dest->tv_sec = src2->tv_sec; - } - -} - - -void delayToTimeSpec(struct timespec *ts, long delay) { - ts->tv_nsec = (delay % 1000000)*1000; - ts->tv_sec = (delay / 1000000); -} - -void waitFor(long minDelay, long maxDelay) { - struct timespec tssrc; - struct timespec tsret; - int delay; - - - - debugMsg("Computing random delay"); - //debugLong("Min delay", minDelay); - //debugLong("Max delay", maxDelay); - delay = computeLongRandom(minDelay, maxDelay); - - debugLong("Random delay=", delay); - - delayToTimeSpec(&tssrc, delay); - - debugLong("............. waiting For", delay); - nanosleep(&tssrc, &tsret); - debugLong("............. waiting Done for: ", delay); -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h deleted file mode 100644 index 76ed5d22fcd7cf9a2750cf2a9726f5cdb89e48f2..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/mytimelib.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef MYTIMELIB_H -#define MYTIMELIB_H - -#include <time.h> -#include <sys/time.h> - - - -// in usec - -int my_clock_gettime(struct timespec *tp); -void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -int isBefore(struct timespec *src1, struct timespec *src2); -void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest); -void delayToTimeSpec(struct timespec *ts, long delay); -extern void waitFor(long minDelay, long maxDelay); - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c deleted file mode 100644 index b4bbddb19ac1e4a51bf5c0205aab571a7580dd32..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.c +++ /dev/null @@ -1,43 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> -#include <time.h> -#include <limits.h> - -#include "random.h" -#include "debug.h" -#include <math.h> - -#include "mytimelib.h" - -int computeRandom(int min, int max) { - if (min == max) { - return min; - } - return (rand() % (max - min)) + min; -} - -long computeLongRandom(long min, long max) { - - if (min == max) { - return min; - } - - - long rand0 = (long)rand(); - long rand1 = rand0 % (max - min); - //debugLong("min=", min); - //debugLong("max=", max); - //debugLong("rand0", rand0); - //debugLong("rand1", rand1); - //debugLong("Random long", rand1 + min); - return rand1 + min; -} - -void initRandom() { - struct timespec ts; - - my_clock_gettime(&ts); - - srand((int)(ts.tv_nsec)); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h deleted file mode 100644 index ecff7cb43cb9d3c38fd390243ad0cbd186fead97..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/random.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef RANDOM_H -#define RANDOM_H - -extern void initRandom(); -extern int computeRandom(int min, int max); -extern long computeLongRandom(long min, long max); -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c deleted file mode 100644 index af1231c61b71a7aab28063dfcf5eefc9faabf6b5..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.c +++ /dev/null @@ -1,271 +0,0 @@ - -#include <stdlib.h> -#include <unistd.h> - -#include "request.h" -#include "mytimelib.h" -#include "myerrors.h" -#include "random.h" -#include "debug.h" - - -request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { - request *req = (request *)(malloc(sizeof(struct request))); - - if (req == NULL) { - criticalError("Allocation of request failed"); - } - - makeNewRequest(req, ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params); - return req; -} - - -// Delays are in microseconds -void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) { - long delay; - int i; - - req->next = NULL; - req->listOfRequests = NULL; - req->nextRequestInList = NULL; - - req->type = type; - req->ID = ID; - req->hasDelay = hasDelay; - - if (req->hasDelay > 0) { - delay = computeLongRandom(minDelay, maxDelay); - delayToTimeSpec(&(req->delay), delay); - } - - req->selected = 0; - req->nbOfParams = nbOfParams; - req->params = params; - - req->alreadyPending = 0; - req->delayElapsed = 0; - - req->relatedRequest = NULL; - - if (type == SEND_ASYNC_REQUEST) { - // Must create a new message - req->msg = getNewMessageWithParams(nbOfParams); - for(i=0; i<nbOfParams; i++) { - req->msg->params[i] = *(params[i]); - } - } - -} - - - - -void destroyRequest(request *req) { - free((void *)req); -} - -int isRequestSelected(request *req) { - return req->selected; -} - -int nbOfRequests(setOfRequests *list) { - int cpt = 0; - request *req; - - req = list->head; - - while(req != NULL) { - cpt ++; - req = req->nextRequestInList; - } - - return cpt; -} - -request *getRequestAtIndex(setOfRequests *list, int index) { - int cpt = 0; - request * req = list->head; - - while(cpt < index) { - req = req->nextRequestInList; - cpt ++; - } - - return req; - -} - - -request * addToRequestQueue(request *list, request *requestToAdd) { - request *origin = list; - - if (list == NULL) { - return requestToAdd; - } - - while(list->next != NULL) { - list = list->next; - } - - list->next = requestToAdd; - - requestToAdd->next = NULL; - - return origin; -} - -request * removeRequestFromList(request *list, request *requestToRemove) { - request *origin = list; - - if (list == requestToRemove) { - return list->next; - } - - - while(list->next != requestToRemove) { - list = list->next; - } - - list->next = requestToRemove->next; - - return origin; -} - - -void copyParameters(request *src, request *dst) { - int i; - for(i=0; i<dst->nbOfParams; i++) { - *(dst->params[i]) = *(src->params[i]); - } -} - - -void clearListOfRequests(setOfRequests *list) { - list->head = NULL; -} - -setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) { - setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests))); - list->head = NULL; - list->wakeupCondition = wakeupCondition; - list->mutex = mutex; - - return list; -} - -void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex) { - list->head = NULL; - list->owner = name; - list->wakeupCondition = wakeupCondition; - list->mutex = mutex; -} - - -void addRequestToList(setOfRequests *list, request* req) { - request *tmpreq; - - if (list == NULL) { - criticalError("NULL List in addRequestToList"); - } - - if (req == NULL) { - criticalError("NULL req in addRequestToList"); - } - - req->listOfRequests = list; - - if (list->head == NULL) { - list->head = req; - req->nextRequestInList = NULL; - return; - } - - tmpreq = list->head; - while(tmpreq->nextRequestInList != NULL) { - tmpreq = tmpreq->nextRequestInList; - } - - tmpreq->nextRequestInList = req; - req->nextRequestInList = NULL; -} - -void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) { - setOfRequests *list = req->listOfRequests; - request *reqtmp; - - if (list == NULL) { - return; - } - - reqtmp = list->head; - - while(reqtmp != NULL) { - debugInt("Considering request of type", reqtmp->type); - if (reqtmp->alreadyPending) { - if (reqtmp->type == RECEIVE_SYNC_REQUEST) { - debugMsg("Removing send sync request from inWaitQueue"); - reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); - debugMsg("done"); - } - - if (reqtmp->type == SEND_SYNC_REQUEST) { - debugMsg("Removing receive sync request from outWaitQueue"); - reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp); - debugMsg("done"); - } - - if (reqtmp->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("Removing broadcast receive request from inWaitQueue"); - reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp); - debugMsg("done"); - } - } - reqtmp = reqtmp->nextRequestInList; - } -} - - -// Identical means belonging to the same ListOfRequest -// Returns the identical request if found, otherwise, null -request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) { - - while(list != NULL) { - if (list->listOfRequests == req->listOfRequests) { - return list; - } - list = list->relatedRequest; - } - - return NULL; -} - -request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) { - request *head = list; - - if (list == oldRequest) { - newRequest->relatedRequest = oldRequest->relatedRequest; - return newRequest; - } - - //list=list->relatedRequest; - while(list->relatedRequest != oldRequest) { - list = list->relatedRequest; - } - - list->relatedRequest = newRequest; - newRequest->relatedRequest = oldRequest->relatedRequest; - - return head; -} - - -int nbOfRelatedRequests(request *list) { - int cpt = 0; - while(list->relatedRequest != NULL) { - cpt ++; - list = list->relatedRequest; - } - - return cpt; -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h deleted file mode 100644 index 00b93c8e5a007e2eecf6bde40417cdfb9457edc2..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef REQUEST_H -#define REQUEST_H - -#include <time.h> -#include <pthread.h> - -struct request; - -#include "syncchannel.h" -#include "asyncchannel.h" -#include "message.h" - -#define SEND_SYNC_REQUEST 0 -#define RECEIVE_SYNC_REQUEST 2 -#define SEND_ASYNC_REQUEST 4 -#define RECEIVE_ASYNC_REQUEST 6 -#define DELAY 8 -#define IMMEDIATE 10 -#define SEND_BROADCAST_REQUEST 12 -#define RECEIVE_BROADCAST_REQUEST 14 - -typedef struct timespec timespec; - -struct setOfRequests { - char* owner; - struct request *head; - timespec startTime; - timespec completionTime; - pthread_cond_t *wakeupCondition; - pthread_mutex_t *mutex; - - int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay - timespec minTimeToWait; - struct request *selectedRequest; -}; - -typedef struct setOfRequests setOfRequests; - -struct request { - struct request *next; - struct setOfRequests* listOfRequests; - struct request* nextRequestInList; - struct request* relatedRequest; // For synchro and broadcast - struct syncchannel *syncChannel; - struct asyncchannel *asyncChannel; - - int type; - int ID; - int hasDelay;; - timespec delay; - int nbOfParams; // synchronous com. - int **params; // synchronous com. - message *msg; // Asynchronous comm. - - - // Filled by the request manager - int executable; - int selected; - int alreadyPending; // Whether it has been taken into account for execution or not - int delayElapsed; - timespec myStartTime; // Time at which the delay has expired -}; - -typedef struct request request; - -void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params); -request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params); -void destroyRequest(request *req); -extern int isRequestSelected(request *req); - -int nbOfRequests(setOfRequests *list); -request *getRequestAtIndex(setOfRequests *list, int index); - -request * addToRequestQueue(request *list, request *requestToAdd); -request * removeRequestFromList(request *list, request *requestToRemove); - -void copyParameters(request *src, request *dst); - -setOfRequests *newListOfRequests(pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex); -void addRequestToList(setOfRequests *list, request* req); -void clearListOfRequests(setOfRequests *list); -void fillListOfRequests(setOfRequests *list, char *name, pthread_cond_t *wakeupCondition, pthread_mutex_t *mutex); - -void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne); -request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list); -request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list); -int nbOfRelatedRequests(request *list); - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c deleted file mode 100644 index e1c39ba777944c41c018918f4fa7594eaf3f96b5..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.c +++ /dev/null @@ -1,570 +0,0 @@ -#include <stdlib.h> -#include <pthread.h> -#include <time.h> - -#include "request_manager.h" -#include "request.h" -#include "myerrors.h" -#include "debug.h" -#include "mytimelib.h" -#include "random.h" -#include "asyncchannel.h" -#include "tracemanager.h" - - - -void executeSendSyncTransaction(request *req) { - int cpt; - request *selectedReq; - - // At least one transaction available -> must select one randomly - // First: count how many of them are available - // Then, select one - // Broadcast the new condition! - - cpt = 0; - request* currentReq = req->syncChannel->inWaitQueue; - debugMsg("Execute send sync tr"); - - while(currentReq != NULL) { - cpt ++; - currentReq = currentReq->next; - } - - cpt = random() % cpt; - - // Head of the list? - selectedReq = req->syncChannel->inWaitQueue; - while (cpt > 0) { - selectedReq = selectedReq->next; - cpt --; - } - - // Remove all related request from list requests - //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq); - debugMsg("Setting related request"); - req->relatedRequest = selectedReq; - - // Select the selected request, and notify the information - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - // Handle parameters - copyParameters(req, selectedReq); - - debugMsg("Signaling"); - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - - traceSynchroRequest(req, selectedReq); -} - -void executeReceiveSyncTransaction(request *req) { - int cpt; - request *selectedReq; - - // At least one transaction available -> must select one randomly - // First: count how many of them are available - // Then, select one - // Broadcast the new condition! - - request* currentReq = req->syncChannel->outWaitQueue; - cpt = 0; - debugMsg("Execute receive sync tr"); - - while(currentReq != NULL) { - cpt ++; - //debugInt("cpt", cpt); - currentReq = currentReq->next; - } - cpt = random() % cpt; - selectedReq = req->syncChannel->outWaitQueue; - while (cpt > 0) { - selectedReq = selectedReq->next; - cpt --; - } - - //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq); - debugMsg("Setting related request"); - req->relatedRequest = selectedReq; - - // Select the request, and notify the information in the channel - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - // Handle parameters - copyParameters(selectedReq, req); - - debugMsg("Signaling"); - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - - traceSynchroRequest(selectedReq, req); -} - - -void executeSendAsyncTransaction(request *req) { - request *selectedReq; - - // Full FIFO? - if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) { - // Must remove the oldest message - getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); - } - - addMessageToAsyncChannel(req->asyncChannel, req->msg); - - debugMsg("Signaling async write to all requests waiting "); - selectedReq = req->asyncChannel->inWaitQueue; - while (selectedReq != NULL) { - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - selectedReq = selectedReq->next; - } - debugMsg("Signaling done"); - - traceAsynchronousSendRequest(req); -} - -void executeReceiveAsyncTransaction(request *req) { - int i; - request *selectedReq; - - req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel); - - selectedReq = req->asyncChannel->outWaitQueue; - - // Must recopy parameters - for(i=0; i<req->nbOfParams; i++) { - *(req->params[i]) = req->msg->params[i]; - } - - traceAsynchronousReceiveRequest(req); - - // unallocate message - destroyMessageWithParams(req->msg); - - debugMsg("Signaling async read to all requests waiting "); - while (selectedReq != NULL) { - pthread_cond_signal(selectedReq->listOfRequests->wakeupCondition); - selectedReq = selectedReq->next; - } - debugMsg("Signaling done"); -} - - -void executeSendBroadcastTransaction(request *req) { - int cpt; - request *tmpreq; - - // At least one transaction available -> must select all of them - // but at most one per task - // Then, broadcast the new condition! - - request* currentReq = req->syncChannel->inWaitQueue; - request* currentLastReq = req; - debugMsg("Execute broadcast sync tr"); - - - while(currentReq != NULL) { - tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest); - if (tmpreq != NULL) { - // Must select one of the two - // If =1, replace, otherwise, just do nothing - cpt = random() % 2; - if (cpt == 1) { - debugMsg("Replacing broadcast request"); - req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest); - currentReq->listOfRequests->selectedRequest = currentReq; - copyParameters(req, currentReq); - currentReq->selected = 1; - currentLastReq = req; - while(currentLastReq->relatedRequest != NULL) { - currentLastReq = currentLastReq->relatedRequest; - } - } - } else { - currentLastReq->relatedRequest = currentReq; - currentReq->relatedRequest = NULL; - currentReq->selected = 1; - currentReq->listOfRequests->selectedRequest = currentReq; - copyParameters(req, currentReq); - currentLastReq = currentReq; - } - - currentReq = currentReq->next; - - debugInt("Nb of requests selected:", nbOfRelatedRequests(req)); - } - - - debugMsg("Signaling"); - currentReq = req->relatedRequest; - cpt = 0; - while(currentReq != NULL) { - cpt ++; - pthread_cond_signal(currentReq->listOfRequests->wakeupCondition); - traceSynchroRequest(req, currentReq); - currentReq = currentReq->relatedRequest; - } - - debugInt("NUMBER of broadcast Requests", cpt); -} - - -int executable(setOfRequests *list, int nb) { - int cpt = 0; - //int index = 0; - request *req = list->head; - timespec ts; - int tsDone = 0; - - debugMsg("Starting loop"); - - list->hasATimeRequest = 0; - - while(req != NULL) { - if (!(req->delayElapsed)) { - if (req->hasDelay) { - // Is the delay elapsed??? - debugTime("begin time of list of request", &list->startTime); - debugTime("start time of this request", &req->myStartTime); - if (tsDone == 0) { - my_clock_gettime(&ts); - debugTime("Current time", &ts); - tsDone = 1; - } - - if (isBefore(&ts, &(req->myStartTime)) == 1) { - // Delay not elapsed - debugMsg("---------t--------> delay NOT elapsed"); - if (list->hasATimeRequest == 0) { - list->hasATimeRequest = 1; - list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec; - list->minTimeToWait.tv_sec = req->myStartTime.tv_sec; - } else { - minTime(&(req->myStartTime), &(list->minTimeToWait),&(list->minTimeToWait)); - } - } else { - // Delay elapsed - debugMsg("---------t--------> delay elapsed"); - req->delayElapsed = 1; - } - } else { - req->delayElapsed = 1; - } - } - req = req->nextRequestInList; - } - - req = list->head; - while((req != NULL) && (cpt < nb)) { - req->executable = 0; - if (req->delayElapsed) { - if (req->type == SEND_SYNC_REQUEST) { - debugMsg("Send sync"); - - if (req->syncChannel->inWaitQueue != NULL) { - debugMsg("Send sync executable"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Send sync not executable"); - } - //index ++; - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - debugMsg("receive sync"); - if (req->syncChannel->outWaitQueue != NULL) { - req->executable = 1; - cpt ++; - } - //index ++; - } - - if (req->type == SEND_ASYNC_REQUEST) { - debugMsg("Send async"); - - if (!(req->asyncChannel->isBlocking)) { - // Can always add a message -> executable - debugMsg("Send async executable since non blocking"); - req->executable = 1; - cpt ++; - - //blocking case ... channel full? - } else { - if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) { - // Not full! - debugMsg("Send async executable since channel not full"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Send async not executable: full, and channel is blocking"); - } - } - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - debugMsg("receive async"); - if (req->asyncChannel->currentNbOfMessages >0) { - debugMsg("Receive async executable: not empty"); - req->executable = 1; - cpt ++; - } else { - debugMsg("Receive async not executable: empty"); - } - //index ++; - } - - - if (req->type == SEND_BROADCAST_REQUEST) { - debugMsg("send broadcast"); - req->executable = 1; - cpt ++; - } - - if (req->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("receive broadcast"); - // A receive broadcast is never executable - req->executable = 0; - //index ++; - } - - - - - if (req->type == IMMEDIATE) { - debugMsg("immediate"); - req->executable = 1; - cpt ++; - } - } - - req = req->nextRequestInList; - - } - - return cpt; -} - -void private__makeRequestPending(setOfRequests *list) { - request *req = list->head; - while(req != NULL) { - if ((req->delayElapsed) && (!(req->alreadyPending))) { - if (req->type == SEND_SYNC_REQUEST) { - debugMsg("Adding pending request in outWaitqueue"); - req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); - req->alreadyPending = 1; - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - debugMsg("Adding pending request in inWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); - } - - if (req->type == SEND_ASYNC_REQUEST) { - debugMsg("Adding pending request in outWaitqueue"); - req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req); - req->alreadyPending = 1; - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - debugMsg("Adding pending request in inWaitqueue"); - req->alreadyPending = 1; - req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req); - } - - if (req->type == RECEIVE_BROADCAST_REQUEST) { - debugMsg("Adding pending broadcast request in inWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req); - } - - if (req->type == SEND_BROADCAST_REQUEST) { - debugMsg("Adding pending broadcast request in outWaitqueue"); - req->alreadyPending = 1; - req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req); - } - - } - - req = req->nextRequestInList; - } -} - -void private__makeRequest(request *req) { - if (req->type == SEND_SYNC_REQUEST) { - executeSendSyncTransaction(req); - } - - if (req->type == RECEIVE_SYNC_REQUEST) { - executeReceiveSyncTransaction(req); - } - - if (req->type == SEND_ASYNC_REQUEST) { - executeSendAsyncTransaction(req); - } - - if (req->type == RECEIVE_ASYNC_REQUEST) { - executeReceiveAsyncTransaction(req); - } - - if (req->type == SEND_BROADCAST_REQUEST) { - executeSendBroadcastTransaction(req); - } - - // IMMEDIATE: Nothing to do - - // In all cases: remove other requests of the same list from their pending form - debugMsg("Removing original req"); - removeAllPendingRequestsFromPendingLists(req, 1); - removeAllPendingRequestsFromPendingListsRelatedRequests(req); - /*if (req->relatedRequest != NULL) { - debugMsg("Removing related req"); - removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); - }*/ - -} - -void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) { - if (req->relatedRequest != NULL) { - debugMsg("Removing related req"); - removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0); - // Recursive call - removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest); - } -} - - -request *private__executeRequests0(setOfRequests *list, int nb) { - int howMany, found; - int selectedIndex, realIndex; - request *selectedReq; - request *req; - - // Compute which requests can be executed - debugMsg("Counting requests"); - howMany = executable(list, nb); - - debugInt("Counting requests=", howMany); - - if (howMany == 0) { - debugMsg("No pending requests"); - // Must make them pending - - private__makeRequestPending(list); - - return NULL; - } - - debugInt("At least one pending request is executable", howMany); - - - // Select a request - req = list->head; - selectedIndex = (rand() % howMany)+1; - debugInt("selectedIndex=", selectedIndex); - realIndex = 0; - found = 0; - while(req != NULL) { - if (req->executable == 1) { - found ++; - if (found == selectedIndex) { - break; - } - } - realIndex ++; - req = req->nextRequestInList; - } - - debugInt("Getting request at index", realIndex); - selectedReq = getRequestAtIndex(list, realIndex); - selectedReq->selected = 1; - selectedReq->listOfRequests->selectedRequest = selectedReq; - - debugInt("Selected request of type", selectedReq->type); - - // Execute that request - private__makeRequest(selectedReq); - - return selectedReq; -} - - -request *private__executeRequests(setOfRequests *list) { - // Is a request already selected? - - if (list->selectedRequest != NULL) { - return list->selectedRequest; - } - - debugMsg("No request selected -> looking for one!"); - - return private__executeRequests0(list, nbOfRequests(list)); -} - - - - -request *executeOneRequest(setOfRequests *list, request *req) { - req->nextRequestInList = NULL; - req->listOfRequests = list; - list->head = req; - return executeListOfRequests(list); -} - - -void setLocalStartTime(setOfRequests *list) { - request *req = list->head; - - while(req != NULL) { - if (req->hasDelay) { - req->delayElapsed = 0; - addTime(&(list->startTime), &(req->delay), &(req->myStartTime)); - debug2Msg(list->owner, " -----t------>: Request with delay"); - } else { - req->delayElapsed = 1; - req->myStartTime.tv_nsec = list->startTime.tv_nsec; - req->myStartTime.tv_sec = list->startTime.tv_sec; - } - req = req->nextRequestInList; - } -} - - -// Return the executed request -request *executeListOfRequests(setOfRequests *list) { - request *req; - - my_clock_gettime(&list->startTime); - list->selectedRequest = NULL; - setLocalStartTime(list); - - // Try to find a request that could be executed - debug2Msg(list->owner, "Locking mutex"); - pthread_mutex_lock(list->mutex); - debug2Msg(list->owner, "Mutex locked"); - - debug2Msg(list->owner, "Going to execute request"); - - while((req = private__executeRequests(list)) == NULL) { - debug2Msg(list->owner, "Waiting for request!"); - if (list->hasATimeRequest == 1) { - debug2Msg(list->owner, "Waiting for a request and at most for a given time"); - debugTime("Min time to wait=", &(list->minTimeToWait)); - pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait)); - } else { - debug2Msg(list->owner, "Releasing mutex"); - pthread_cond_wait(list->wakeupCondition, list->mutex); - } - debug2Msg(list->owner, "Waking up for requests! -> getting mutex"); - } - - debug2Msg(list->owner, "Request selected!"); - - my_clock_gettime(&list->completionTime); - - pthread_mutex_unlock(list->mutex); - debug2Msg(list->owner, "Mutex unlocked"); - return req; -} - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h deleted file mode 100644 index e2ae0f800025b9394d6488c012b47f7396aaf609..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/request_manager.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef REQUEST_MANAGER_H -#define REQUEST_MANAGER_H - - -#include "request.h" -#include "syncchannel.h" - - -request *executeOneRequest(setOfRequests *list, request *req); -request *executeListOfRequests(setOfRequests *list); - -void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req); - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c deleted file mode 100644 index e1c90875f2574a15318facbda32b27f918f82592..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <stdlib.h> - - -#include "syncchannel.h" -#include "request.h" -#include "myerrors.h" -#include "debug.h" - - -syncchannel *getNewSyncchannel(char *outname, char *inname) { - syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel))); - if (syncch == NULL) { - criticalError("Allocation of request failed"); - } - syncch->inname = inname; - syncch->outname = outname; - syncch->inWaitQueue = NULL; - syncch->outWaitQueue = NULL; - syncch->isBroadcast = false; - return syncch; -} - -void setBroadcast(syncchannel *syncch, bool b) { - syncch->isBroadcast = b; -} - - - -/*request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]) { - request *req = getNewRequest(SEND_SYNC_REQUEST, hasDelay, delay, nbOfParams, params); - return req; -} - -request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]) { - request *req = getNewRequest(RECEIVE_SYNC_REQUEST, hasDelay, delay, nbOfParams, params); - return req; - }*/ - -void destroySyncchannel(syncchannel *syncch) { - free(syncch); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h deleted file mode 100644 index 6f4f92de5531f14c36b7d520992eb3decb305cdd..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/syncchannel.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef SYNCCHANNEL_H -#define SYNCCHANNEL_H - -struct syncchannel; - -#include "request.h" -#include "defs.h" - -struct syncchannel { - char *outname; - char *inname; - struct request* inWaitQueue; - struct request* outWaitQueue; - bool isBroadcast; -}; - -typedef struct syncchannel syncchannel; - - -void setBroadcast(syncchannel *syncch, bool b); -syncchannel *getNewSyncchannel(char *inname, char *outname); -//request *makeNewSendSync(int hasDelay, long delay, int nbOfParams, int *params[]); -//request *makeNewReceiveSync(int hasDelay, long delay, int nbOfParams, int *params[]); -void destroySyncchannel(syncchannel *syncch); - - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c deleted file mode 100644 index fda3a0db1c76a9861708dd422c2cea7f180688b0..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.c +++ /dev/null @@ -1,304 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <time.h> - -#include "tracemanager.h" -#include "debug.h" -#include "mytimelib.h" - - -#define TRACE_OFF 0 -#define TRACE_IN_FILE 1 -#define TRACE_IN_CONSOLE 2 - -#define TRACE_FILE_NAME "Trace.txt" - - -pthread_mutex_t __traceMutex; - -int trace = TRACE_OFF; -int id = 0; - -FILE *file; - -struct timespec begints; - - -void addInfo(char *dest, char *info) { - //char s1[10]; - long tmp; - //long tmp1; - //int i; - struct timespec ts, ts1; - my_clock_gettime(&ts); - - debugMsg("DIFF TIME"); - diffTime(&begints, &ts, &ts1); - - tmp = ts1.tv_nsec; - - if (tmp < 0) { - tmp = -tmp; - } - - /*tmp1 = 100000000; - - for(i=0; i<9; i++) { - s1[i] = 48 + (tmp / tmp1); - tmp = tmp % tmp1; - tmp1 = tmp1 / 10; - } - s1[9] = '\0';*/ - - /* s1 -> tmp */ - sprintf(dest, "#%d time=%ld.%09ld %s", id, ts1.tv_sec, tmp, info); - id ++; -} - - -void writeInTrace(char *info) { - pthread_mutex_lock(&__traceMutex); - char s[CHAR_ALLOC_SIZE]; - addInfo(s, info); - //printf("Write in file\n"); - switch(trace){ - case TRACE_IN_FILE: - if (file != NULL) { - debug2Msg("Saving in file", s); - fprintf(file, s); - fflush(file); - } - break; - case TRACE_IN_CONSOLE: - printf("%s\n", s); - break; - } - - pthread_mutex_unlock(&__traceMutex); -} - - -void activeTracingInFile(char *fileName) { - char *name; - trace = TRACE_IN_FILE; - my_clock_gettime(&begints); - if (fileName == NULL) { - name = TRACE_FILE_NAME; - } else { - name = fileName; - } - file = fopen(name,"w"); - - /* Initializing mutex */ - if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);} -} - -void activeTracingInConsole() { - trace = TRACE_IN_CONSOLE; - my_clock_gettime(&begints); - - /* Initializing mutex */ - if (pthread_mutex_init(&__traceMutex, NULL) < 0) { exit(-1);} -} - -void unactiveTracing() { - trace = TRACE_OFF; -} - - -void traceStateEntering(char *myname, char *statename) { - char s[CHAR_ALLOC_SIZE]; - - debugMsg("Trace function"); - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=state_entering state=%s\n", myname, statename); - - // Saving trace - writeInTrace(s); -} - -void traceFunctionCall(char *block, char *func, char *params) { - char s[CHAR_ALLOC_SIZE]; - - debugMsg("Trace function"); - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=function_call func=%s parameters=%s\n", block, func, params); - - // Saving trace - writeInTrace(s); -} - - -// type=0: int type = 1:bool -void traceVariableModification(char *block, char *var, int value, int type) { - char s[CHAR_ALLOC_SIZE]; - debugMsg("Trace variable modification"); - - if (trace == TRACE_OFF) { - return; - } - - - if (type == 0) { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=%d\n", block, var, value); - } - - if (type == 1) { - if (value == 0) { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=false\n", block, var); - } else { - sprintf(s, "block=%s type=variable_modification variable=%s setTo=true\n", block, var); - } - } - - // Saving trace - writeInTrace(s); - -} - -void traceSynchroRequest(request *from, request *to) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s blockdestination=%s type=synchro channel=%s params=", from->listOfRequests->owner, to->listOfRequests->owner, from->syncChannel->outname); - for(i=0; i<from->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, *(from->params[i])); - } - sprintf(s, "%s\n", s); - - debugMsg("Trace request synchro"); - - - // Saving trace - writeInTrace(s); -} - - -void traceAsynchronousSendRequest(request *req) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=send_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id); - if (req->msg != NULL) { - debugMsg("Computing params"); - for(i=0; i<req->msg->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, req->msg->params[i]); - } - } - sprintf(s, "%s\n", s); - - - - // Saving trace - writeInTrace(s); -} - - -void traceAsynchronousReceiveRequest(request *req) { - char s[1024]; - int i; - - if (trace == TRACE_OFF) { - return; - } - - sprintf(s, "block=%s type=receive_async channel=%s msgid=%ld params=", req->listOfRequests->owner, req->asyncChannel->outname, req->msg->id); - if (req->msg != NULL) { - debugMsg("Computing params"); - for(i=0; i<req->msg->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, req->msg->params[i]); - } - } - sprintf(s, "%s\n", s); - - - - // Saving trace - writeInTrace(s); -} - - - -void traceRequest(char *myname, request *req) { - char s[1024]; - int i; - - - debugMsg("Trace request"); - - - if (trace == TRACE_OFF) { - return; - } - - // Build corresponding char*; - - switch(req->type) { - case SEND_SYNC_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname); - for(i=0; i<req->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); - } - sprintf(s, "%s%d", s, *(req->params[i])); - } - sprintf(s, "%s\n", s); - - break; - case RECEIVE_SYNC_REQUEST: - sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname); - break; - case SEND_ASYNC_REQUEST: - debug2Msg("Async channel", req->asyncChannel->outname); - sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname); - break; - case RECEIVE_ASYNC_REQUEST: - sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname); - break; - case SEND_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case RECEIVE_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case IMMEDIATE: - sprintf(s, "block=%s type=action\n", myname); - break; - default: - sprintf(s, "block=%s type=unknown\n", myname); - } - - debugMsg("Trace request 2"); - - - // Saving trace - writeInTrace(s); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h deleted file mode 100644 index d33f3532a4bcb9fc7b96ddda00bcfee9cfb2a4bc..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/tracemanager.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef TRACEMANAGER_H -#define TRACEMANAGER_H - -#include "request.h" - -#define CHAR_ALLOC_SIZE 1024 - - -void activeTracingInFile(); -void unactiveTracing(); -void traceRequest(char *myname, request *req); -void traceFunctionCall(char *block, char *func, char* params); -void traceVariableModification(char *block, char *var, int value, int type); // type=0: int type = 1:bool -void traceStateEntering(char *myname, char *statename); -void traceSynchroRequest(request *from, request *to); -void traceAsynchronousSendRequest(request *req); -void traceAsynchronousReceiveRequest(request *req); - -#endif - - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp deleted file mode 100644 index 9602c6c20bb42ff09cdb674f559ec216d5bb791e..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//#include <stdlib.h> -//#include <stdio.h> -#include <time.h> -#include <mbed.h> -#define DEBUG_ON 1 -#define DEBUG_OFF 2 -Serial pc(USBTX,USBRX); - -#include "debug.h" - -int _debug = DEBUG_OFF; - -void activeDebug() { - _debug = DEBUG_ON; - pc.printf("Modo debug activado"); -} - -void unactiveDebug() { - _debug = DEBUG_OFF; - pc.printf("Modo debug desactivado"); -} - -void debugThreeInts(char *msg, int value1, int value2, int value3) { - if (_debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - pc.printf("DT> %s: %d, %d, %d\n", msg, value1, value2, value3); - } -} - -void debugTwoInts(char *msg, int value1, int value2) { - if (_debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - pc.printf("DT> %s: %d, %d\n", msg, value1, value2); - } -} - -void debugInt(char *msg, int value) { - if (_debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - pc.printf("DT> %s: %d\n", msg, value); - } -} - -void debugLong(char *msg, long value) { - if (_debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - pc.printf("DT> %s: %ld\n", msg, value); - } -} - -void debugMsg(char *msg) { - if (_debug == DEBUG_OFF) { - return; - } - - if (msg != NULL) { - pc.printf("DT> %s\n", msg); - } -} - -void debug2Msg(char *name, char *msg) { - if (_debug == DEBUG_OFF) { - return; - } - - if ((name != NULL) && (msg != NULL)) { - pc.printf("DT - %s -> %s\n", name, msg); - } -} - -void debugTime(char *msg, struct timespec *ts) { - if (_debug == DEBUG_OFF) { - return; - } - pc.printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/defs.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/defs.h deleted file mode 100644 index 3b997bfdf885b560dc4fde8264e8b5026565de10..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/defs.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DEFS_H -#define DEFS_H - -#define bool int -#define true 1 -#define false 0 - - -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp deleted file mode 100644 index c3ac566a1263b4c5b572bdb04453ce9ac176add7..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//#include <stdlib.h> -//#include <stdio.h> - -#include "myerrors.h" -#include <mbed.h> -Serial pc(USBTX,USBRX); - - -void criticalErrorInt(char *msg, int value) { - if (msg != NULL) { - pc.printf("\nCritical error: %s, %d\n", msg, value); - } - - exit(-1); -} - - -void criticalError(char *msg) { - if (msg != NULL) { - pc.printf("\nCritical error: %s\n", msg); - } - - exit(-1); -} diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.h deleted file mode 100644 index 8300da3ccfd1b5f2efd2f3514a8f543409363003..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/myerrors.h +++ /dev/null @@ -1,11 +0,0 @@ - - -#ifndef MY_ERRORS_H -#define MY_ERRORS_H - -void criticalErrorInt(char *msg, int value); -void criticalError(char *msg); - -#endif - - diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.h deleted file mode 100644 index ecff7cb43cb9d3c38fd390243ad0cbd186fead97..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef RANDOM_H -#define RANDOM_H - -extern void initRandom(); -extern int computeRandom(int min, int max); -extern long computeLongRandom(long min, long max); -#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.h b/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.h deleted file mode 100644 index e2ae0f800025b9394d6488c012b47f7396aaf609..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef REQUEST_MANAGER_H -#define REQUEST_MANAGER_H - - -#include "request.h" -#include "syncchannel.h" - - -request *executeOneRequest(setOfRequests *list, request *req); -request *executeListOfRequests(setOfRequests *list); - -void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req); - -#endif diff --git a/modeling/BlinkingLed.ttool/BlinkingLed.xml b/modeling/BlinkingLed.ttool/BlinkingLed.xml deleted file mode 100644 index 2ae49e3f57c0e0f9799c405fd99127d35d8057d5..0000000000000000000000000000000000000000 --- a/modeling/BlinkingLed.ttool/BlinkingLed.xml +++ /dev/null @@ -1,1047 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<TURTLEGMODELING version="1.0beta"> - -<Modeling type="AVATAR Design" nameTab="Design" > -<AVATARBlockDiagramPanel name="Block Diagram" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0" > -<MainCode value="void __user_init() {"/> -<MainCode value="}"/> -<Optimized value="true" /> -<Validated value="SecondaryBlock;MainBlock;" /> -<Ignored value="" /> - -<CONNECTOR type="5002" id="2" > -<cdparam x="444" y="162" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="" /> -<TGConnectingPoint num="0" id="1" /> -<P1 x="444" y="162" id="32" /> -<P2 x="533" y="164" id="6" /> -<AutomaticDrawing data="true" /> -<extraparam> -<iso value="in RandVal(int val)" /> -<osd value="out RanVal(int val)" /> -<FIFOType asynchronous="false" size="1" blocking="false" private="true" broadcast="false" lossy="false" /> -</extraparam> -</CONNECTOR> -<COMPONENT type="5000" id="27" > -<cdparam x="533" y="64" /> -<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="Block0" value="SecondaryBlock" /> -<TGConnectingPoint num="0" id="3" /> -<TGConnectingPoint num="1" id="4" /> -<TGConnectingPoint num="2" id="5" /> -<TGConnectingPoint num="3" id="6" /> -<TGConnectingPoint num="4" id="7" /> -<TGConnectingPoint num="5" id="8" /> -<TGConnectingPoint num="6" id="9" /> -<TGConnectingPoint num="7" id="10" /> -<TGConnectingPoint num="8" id="11" /> -<TGConnectingPoint num="9" id="12" /> -<TGConnectingPoint num="10" id="13" /> -<TGConnectingPoint num="11" id="14" /> -<TGConnectingPoint num="12" id="15" /> -<TGConnectingPoint num="13" id="16" /> -<TGConnectingPoint num="14" id="17" /> -<TGConnectingPoint num="15" id="18" /> -<TGConnectingPoint num="16" id="19" /> -<TGConnectingPoint num="17" id="20" /> -<TGConnectingPoint num="18" id="21" /> -<TGConnectingPoint num="19" id="22" /> -<TGConnectingPoint num="20" id="23" /> -<TGConnectingPoint num="21" id="24" /> -<TGConnectingPoint num="22" id="25" /> -<TGConnectingPoint num="23" id="26" /> -<extraparam> -<blockType data="block" color="-4072719" /> -<CryptoBlock value="false" /> -<Attribute access="0" id="val" value="" type="8" typeOther="" /> -<Signal value="out RanVal(int val)" attached="true" /> -<globalCode value="extern int val;" /> -</extraparam> -</COMPONENT> - -<COMPONENT type="5000" id="52" > -<cdparam x="194" y="62" /> -<sizeparam width="250" height="200" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="Block0" value="MainBlock" /> -<TGConnectingPoint num="0" id="28" /> -<TGConnectingPoint num="1" id="29" /> -<TGConnectingPoint num="2" id="30" /> -<TGConnectingPoint num="3" id="31" /> -<TGConnectingPoint num="4" id="32" /> -<TGConnectingPoint num="5" id="33" /> -<TGConnectingPoint num="6" id="34" /> -<TGConnectingPoint num="7" id="35" /> -<TGConnectingPoint num="8" id="36" /> -<TGConnectingPoint num="9" id="37" /> -<TGConnectingPoint num="10" id="38" /> -<TGConnectingPoint num="11" id="39" /> -<TGConnectingPoint num="12" id="40" /> -<TGConnectingPoint num="13" id="41" /> -<TGConnectingPoint num="14" id="42" /> -<TGConnectingPoint num="15" id="43" /> -<TGConnectingPoint num="16" id="44" /> -<TGConnectingPoint num="17" id="45" /> -<TGConnectingPoint num="18" id="46" /> -<TGConnectingPoint num="19" id="47" /> -<TGConnectingPoint num="20" id="48" /> -<TGConnectingPoint num="21" id="49" /> -<TGConnectingPoint num="22" id="50" /> -<TGConnectingPoint num="23" id="51" /> -<extraparam> -<blockType data="block" color="-4072719" /> -<CryptoBlock value="false" /> -<Attribute access="0" id="period" value="2" type="8" typeOther="" /> -<Attribute access="0" id="x" value="0" type="8" typeOther="" /> -<Attribute access="0" id="currentRand" value="0" type="8" typeOther="" /> -<Method value="$LED1on()" /> -<Method value="$LED1off(int x)" /> -<Signal value="in RandVal(int val)" attached="true" /> -<globalCode value="DigitalOut myled1(LED1);" /> -<globalCode value="" /> -<globalCode value="void __userImplemented__MainBlock__LED1on() {" /> -<globalCode value=" myled1 = 1;" /> -<globalCode value=" printf("Led1 on.\n");" /> -<globalCode value="}" /> -<globalCode value="void __userImplemented__MainBlock__LED1off(int val){" /> -<globalCode value=" myled1 = 0;" /> -<globalCode value=" printf("Led1 off.\n");" /> -<globalCode value=" printf("value of x=%d\n",val);" /> -<globalCode value="}" /> -</extraparam> -</COMPONENT> - - -</AVATARBlockDiagramPanel> - -<AVATARStateMachineDiagramPanel name="SecondaryBlock" minX="10" maxX="2500" minY="10" maxY="1500" > -<COMPONENT type="5106" id="501" > -<cdparam x="414" y="102" /> -<sizeparam width="143" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="Waiting_Cycle" /> -<TGConnectingPoint num="0" id="502" /> -<TGConnectingPoint num="1" id="503" /> -<TGConnectingPoint num="2" id="504" /> -<TGConnectingPoint num="3" id="505" /> -<TGConnectingPoint num="4" id="506" /> -<TGConnectingPoint num="5" id="507" /> -<TGConnectingPoint num="6" id="508" /> -<TGConnectingPoint num="7" id="509" /> -<TGConnectingPoint num="8" id="510" /> -<TGConnectingPoint num="9" id="511" /> -<TGConnectingPoint num="10" id="512" /> -<TGConnectingPoint num="11" id="513" /> -<TGConnectingPoint num="12" id="514" /> -<TGConnectingPoint num="13" id="515" /> -<TGConnectingPoint num="14" id="516" /> -<TGConnectingPoint num="15" id="517" /> -<TGConnectingPoint num="16" id="518" /> -<TGConnectingPoint num="17" id="519" /> -<TGConnectingPoint num="18" id="520" /> -<TGConnectingPoint num="19" id="521" /> -<TGConnectingPoint num="20" id="522" /> -<TGConnectingPoint num="21" id="523" /> -<TGConnectingPoint num="22" id="524" /> -<TGConnectingPoint num="23" id="525" /> -<TGConnectingPoint num="24" id="526" /> -<TGConnectingPoint num="25" id="527" /> -<TGConnectingPoint num="26" id="528" /> -<TGConnectingPoint num="27" id="529" /> -<TGConnectingPoint num="28" id="530" /> -<TGConnectingPoint num="29" id="531" /> -<TGConnectingPoint num="30" id="532" /> -<TGConnectingPoint num="31" id="533" /> -<TGConnectingPoint num="32" id="534" /> -<TGConnectingPoint num="33" id="535" /> -<TGConnectingPoint num="34" id="536" /> -<TGConnectingPoint num="35" id="537" /> -<TGConnectingPoint num="36" id="538" /> -<TGConnectingPoint num="37" id="539" /> -<TGConnectingPoint num="38" id="540" /> -<TGConnectingPoint num="39" id="541" /> -<extraparam> -</extraparam> -</COMPONENT> - -<CONNECTOR type="5102" id="488" > -<cdparam x="488" y="498" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="492" /> -<TGConnectingPoint num="1" id="493" /> -<TGConnectingPoint num="2" id="494" /> -<TGConnectingPoint num="3" id="495" /> -<P1 x="488" y="498" id="472" /> -<P2 x="557" y="127" id="506" /> -<Point x="557" y="530" /> -<Point x="617" y="336" /> -<Point x="591" y="234" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="489" > -<father id="488" num="0" /> -<cdparam x="557" y="530" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="490" > -<father id="488" num="1" /> -<cdparam x="617" y="336" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="491" > -<father id="488" num="2" /> -<cdparam x="591" y="234" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="496" > -<father id="488" num="3" /> -<cdparam x="497" y="367" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="497" /> -<TGConnectingPoint num="1" id="498" /> -<TGConnectingPoint num="2" id="499" /> -<TGConnectingPoint num="3" id="500" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<COMPONENT type="5103" id="470" > -<cdparam x="451" y="473" /> -<sizeparam width="74" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="Send signal" value="RanVal(val)" /> -<TGConnectingPoint num="0" id="471" /> -<TGConnectingPoint num="1" id="472" /> -<TGConnectingPoint num="2" id="473" /> -<TGConnectingPoint num="3" id="474" /> -<TGConnectingPoint num="4" id="475" /> -<TGConnectingPoint num="5" id="476" /> -<TGConnectingPoint num="6" id="477" /> -<TGConnectingPoint num="7" id="478" /> -<TGConnectingPoint num="8" id="479" /> -<TGConnectingPoint num="9" id="480" /> -</COMPONENT> - -<COMPONENT type="5106" id="422" > -<cdparam x="407" y="368" /> -<sizeparam width="121" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="SendingRand" /> -<TGConnectingPoint num="0" id="423" /> -<TGConnectingPoint num="1" id="424" /> -<TGConnectingPoint num="2" id="425" /> -<TGConnectingPoint num="3" id="426" /> -<TGConnectingPoint num="4" id="427" /> -<TGConnectingPoint num="5" id="428" /> -<TGConnectingPoint num="6" id="429" /> -<TGConnectingPoint num="7" id="430" /> -<TGConnectingPoint num="8" id="431" /> -<TGConnectingPoint num="9" id="432" /> -<TGConnectingPoint num="10" id="433" /> -<TGConnectingPoint num="11" id="434" /> -<TGConnectingPoint num="12" id="435" /> -<TGConnectingPoint num="13" id="436" /> -<TGConnectingPoint num="14" id="437" /> -<TGConnectingPoint num="15" id="438" /> -<TGConnectingPoint num="16" id="439" /> -<TGConnectingPoint num="17" id="440" /> -<TGConnectingPoint num="18" id="441" /> -<TGConnectingPoint num="19" id="442" /> -<TGConnectingPoint num="20" id="443" /> -<TGConnectingPoint num="21" id="444" /> -<TGConnectingPoint num="22" id="445" /> -<TGConnectingPoint num="23" id="446" /> -<TGConnectingPoint num="24" id="447" /> -<TGConnectingPoint num="25" id="448" /> -<TGConnectingPoint num="26" id="449" /> -<TGConnectingPoint num="27" id="450" /> -<TGConnectingPoint num="28" id="451" /> -<TGConnectingPoint num="29" id="452" /> -<TGConnectingPoint num="30" id="453" /> -<TGConnectingPoint num="31" id="454" /> -<TGConnectingPoint num="32" id="455" /> -<TGConnectingPoint num="33" id="456" /> -<TGConnectingPoint num="34" id="457" /> -<TGConnectingPoint num="35" id="458" /> -<TGConnectingPoint num="36" id="459" /> -<TGConnectingPoint num="37" id="460" /> -<TGConnectingPoint num="38" id="461" /> -<TGConnectingPoint num="39" id="462" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5108" id="394" > -<cdparam x="331" y="307" /> -<sizeparam width="145" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="TGComponent" value="null" /> -<TGConnectingPoint num="0" id="395" /> -<TGConnectingPoint num="1" id="396" /> -<extraparam> -<Data variable="val" minValue="1" maxValue="10" functionId="0" /> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="186" > -<cdparam x="342" y="212" /> -<sizeparam width="165" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="CalculatingRand" /> -<TGConnectingPoint num="0" id="146" /> -<TGConnectingPoint num="1" id="147" /> -<TGConnectingPoint num="2" id="148" /> -<TGConnectingPoint num="3" id="149" /> -<TGConnectingPoint num="4" id="150" /> -<TGConnectingPoint num="5" id="151" /> -<TGConnectingPoint num="6" id="152" /> -<TGConnectingPoint num="7" id="153" /> -<TGConnectingPoint num="8" id="154" /> -<TGConnectingPoint num="9" id="155" /> -<TGConnectingPoint num="10" id="156" /> -<TGConnectingPoint num="11" id="157" /> -<TGConnectingPoint num="12" id="158" /> -<TGConnectingPoint num="13" id="159" /> -<TGConnectingPoint num="14" id="160" /> -<TGConnectingPoint num="15" id="161" /> -<TGConnectingPoint num="16" id="162" /> -<TGConnectingPoint num="17" id="163" /> -<TGConnectingPoint num="18" id="164" /> -<TGConnectingPoint num="19" id="165" /> -<TGConnectingPoint num="20" id="166" /> -<TGConnectingPoint num="21" id="167" /> -<TGConnectingPoint num="22" id="168" /> -<TGConnectingPoint num="23" id="169" /> -<TGConnectingPoint num="24" id="170" /> -<TGConnectingPoint num="25" id="171" /> -<TGConnectingPoint num="26" id="172" /> -<TGConnectingPoint num="27" id="173" /> -<TGConnectingPoint num="28" id="174" /> -<TGConnectingPoint num="29" id="175" /> -<TGConnectingPoint num="30" id="176" /> -<TGConnectingPoint num="31" id="177" /> -<TGConnectingPoint num="32" id="178" /> -<TGConnectingPoint num="33" id="179" /> -<TGConnectingPoint num="34" id="180" /> -<TGConnectingPoint num="35" id="181" /> -<TGConnectingPoint num="36" id="182" /> -<TGConnectingPoint num="37" id="183" /> -<TGConnectingPoint num="38" id="184" /> -<TGConnectingPoint num="39" id="185" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="188" > -<cdparam x="400" y="50" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="187" /> -</COMPONENT> - -<CONNECTOR type="5102" id="397" > -<cdparam x="404" y="262" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="398" /> -<P1 x="444" y="262" id="176" /> -<P2 x="403" y="302" id="395" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="399" > -<father id="397" num="0" /> -<cdparam x="403" y="282" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="400" /> -<TGConnectingPoint num="1" id="401" /> -<TGConnectingPoint num="2" id="402" /> -<TGConnectingPoint num="3" id="403" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="463" > -<cdparam x="403" y="332" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="464" /> -<P1 x="403" y="332" id="396" /> -<P2 x="407" y="368" id="423" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="465" > -<father id="463" num="0" /> -<cdparam x="405" y="350" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="466" /> -<TGConnectingPoint num="1" id="467" /> -<TGConnectingPoint num="2" id="468" /> -<TGConnectingPoint num="3" id="469" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="481" > -<cdparam x="482" y="418" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="482" /> -<P1 x="482" y="418" id="453" /> -<P2 x="488" y="468" id="471" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="483" > -<father id="481" num="0" /> -<cdparam x="485" y="443" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="484" /> -<TGConnectingPoint num="1" id="485" /> -<TGConnectingPoint num="2" id="486" /> -<TGConnectingPoint num="3" id="487" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="542" > -<cdparam x="407" y="70" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="543" /> -<P1 x="407" y="70" id="187" /> -<P2 x="414" y="102" id="502" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="544" > -<father id="542" num="0" /> -<cdparam x="410" y="86" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="545" /> -<TGConnectingPoint num="1" id="546" /> -<TGConnectingPoint num="2" id="547" /> -<TGConnectingPoint num="3" id="548" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="549" > -<cdparam x="464" y="152" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="550" /> -<P1 x="485" y="152" id="508" /> -<P2 x="465" y="212" id="155" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="551" > -<father id="549" num="0" /> -<cdparam x="464" y="182" /> -<sizeparam width="63" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="552" /> -<TGConnectingPoint num="1" id="553" /> -<TGConnectingPoint num="2" id="554" /> -<TGConnectingPoint num="3" id="555" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="4" enabled="true"/> -<afterMax value="4" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - - -</AVATARStateMachineDiagramPanel> - -<AVATARStateMachineDiagramPanel name="MainBlock" minX="10" maxX="2500" minY="10" maxY="1500" > -<CONNECTOR type="5102" id="715" > -<cdparam x="139" y="304" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="718" /> -<TGConnectingPoint num="1" id="719" /> -<TGConnectingPoint num="2" id="720" /> -<P1 x="139" y="304" id="576" /> -<P2 x="65" y="169" id="332" /> -<Point x="41" y="263" /> -<Point x="37" y="169" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="716" > -<father id="715" num="0" /> -<cdparam x="41" y="263" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="717" > -<father id="715" num="1" /> -<cdparam x="37" y="169" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="721" > -<father id="715" num="2" /> -<cdparam x="50" y="247" /> -<sizeparam width="39" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="722" /> -<TGConnectingPoint num="1" id="723" /> -<TGConnectingPoint num="2" id="724" /> -<TGConnectingPoint num="3" id="725" /> -<extraparam> -<guard value="[ else ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="702" > -<cdparam x="301" y="528" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="706" /> -<TGConnectingPoint num="1" id="707" /> -<TGConnectingPoint num="2" id="708" /> -<TGConnectingPoint num="3" id="709" /> -<P1 x="301" y="528" id="650" /> -<P2 x="252" y="169" id="333" /> -<Point x="434" y="528" /> -<Point x="415" y="329" /> -<Point x="397" y="163" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="703" > -<father id="702" num="0" /> -<cdparam x="434" y="528" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="704" > -<father id="702" num="1" /> -<cdparam x="415" y="329" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="705" > -<father id="702" num="2" /> -<cdparam x="397" y="163" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="point " value="null" /> -</SUBCOMPONENT> -<SUBCOMPONENT type="-1" id="710" > -<father id="702" num="3" /> -<cdparam x="426" y="353" /> -<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="711" /> -<TGConnectingPoint num="1" id="712" /> -<TGConnectingPoint num="2" id="713" /> -<TGConnectingPoint num="3" id="714" /> -<extraparam> -<guard value="[ else ]" enabled="true"/> -<afterMin value="period" enabled="true"/> -<afterMax value="period" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -<actions value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<COMPONENT type="5101" id="693" > -<cdparam x="240" y="641" /> -<sizeparam width="20" height="20" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="stop state" value="null" /> -<TGConnectingPoint num="0" id="694" /> -</COMPONENT> - -<COMPONENT type="5106" id="645" > -<cdparam x="201" y="487" /> -<sizeparam width="100" height="82" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="Led1Off" /> -<TGConnectingPoint num="0" id="646" /> -<TGConnectingPoint num="1" id="647" /> -<TGConnectingPoint num="2" id="648" /> -<TGConnectingPoint num="3" id="649" /> -<TGConnectingPoint num="4" id="650" /> -<TGConnectingPoint num="5" id="651" /> -<TGConnectingPoint num="6" id="652" /> -<TGConnectingPoint num="7" id="653" /> -<TGConnectingPoint num="8" id="654" /> -<TGConnectingPoint num="9" id="655" /> -<TGConnectingPoint num="10" id="656" /> -<TGConnectingPoint num="11" id="657" /> -<TGConnectingPoint num="12" id="658" /> -<TGConnectingPoint num="13" id="659" /> -<TGConnectingPoint num="14" id="660" /> -<TGConnectingPoint num="15" id="661" /> -<TGConnectingPoint num="16" id="662" /> -<TGConnectingPoint num="17" id="663" /> -<TGConnectingPoint num="18" id="664" /> -<TGConnectingPoint num="19" id="665" /> -<TGConnectingPoint num="20" id="666" /> -<TGConnectingPoint num="21" id="667" /> -<TGConnectingPoint num="22" id="668" /> -<TGConnectingPoint num="23" id="669" /> -<TGConnectingPoint num="24" id="670" /> -<TGConnectingPoint num="25" id="671" /> -<TGConnectingPoint num="26" id="672" /> -<TGConnectingPoint num="27" id="673" /> -<TGConnectingPoint num="28" id="674" /> -<TGConnectingPoint num="29" id="675" /> -<TGConnectingPoint num="30" id="676" /> -<TGConnectingPoint num="31" id="677" /> -<TGConnectingPoint num="32" id="678" /> -<TGConnectingPoint num="33" id="679" /> -<TGConnectingPoint num="34" id="680" /> -<TGConnectingPoint num="35" id="681" /> -<TGConnectingPoint num="36" id="682" /> -<TGConnectingPoint num="37" id="683" /> -<TGConnectingPoint num="38" id="684" /> -<TGConnectingPoint num="39" id="685" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5106" id="597" > -<cdparam x="145" y="366" /> -<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="Led1On" /> -<TGConnectingPoint num="0" id="598" /> -<TGConnectingPoint num="1" id="599" /> -<TGConnectingPoint num="2" id="600" /> -<TGConnectingPoint num="3" id="601" /> -<TGConnectingPoint num="4" id="602" /> -<TGConnectingPoint num="5" id="603" /> -<TGConnectingPoint num="6" id="604" /> -<TGConnectingPoint num="7" id="605" /> -<TGConnectingPoint num="8" id="606" /> -<TGConnectingPoint num="9" id="607" /> -<TGConnectingPoint num="10" id="608" /> -<TGConnectingPoint num="11" id="609" /> -<TGConnectingPoint num="12" id="610" /> -<TGConnectingPoint num="13" id="611" /> -<TGConnectingPoint num="14" id="612" /> -<TGConnectingPoint num="15" id="613" /> -<TGConnectingPoint num="16" id="614" /> -<TGConnectingPoint num="17" id="615" /> -<TGConnectingPoint num="18" id="616" /> -<TGConnectingPoint num="19" id="617" /> -<TGConnectingPoint num="20" id="618" /> -<TGConnectingPoint num="21" id="619" /> -<TGConnectingPoint num="22" id="620" /> -<TGConnectingPoint num="23" id="621" /> -<TGConnectingPoint num="24" id="622" /> -<TGConnectingPoint num="25" id="623" /> -<TGConnectingPoint num="26" id="624" /> -<TGConnectingPoint num="27" id="625" /> -<TGConnectingPoint num="28" id="626" /> -<TGConnectingPoint num="29" id="627" /> -<TGConnectingPoint num="30" id="628" /> -<TGConnectingPoint num="31" id="629" /> -<TGConnectingPoint num="32" id="630" /> -<TGConnectingPoint num="33" id="631" /> -<TGConnectingPoint num="34" id="632" /> -<TGConnectingPoint num="35" id="633" /> -<TGConnectingPoint num="36" id="634" /> -<TGConnectingPoint num="37" id="635" /> -<TGConnectingPoint num="38" id="636" /> -<TGConnectingPoint num="39" id="637" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5107" id="574" > -<cdparam x="149" y="289" /> -<sizeparam width="30" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="choice" value="null" /> -<TGConnectingPoint num="0" id="575" /> -<TGConnectingPoint num="1" id="576" /> -<TGConnectingPoint num="2" id="577" /> -<TGConnectingPoint num="3" id="578" /> -<TGConnectingPoint num="4" id="579" /> -<TGConnectingPoint num="5" id="580" /> -<TGConnectingPoint num="6" id="581" /> -<TGConnectingPoint num="7" id="582" /> -<TGConnectingPoint num="8" id="583" /> -<TGConnectingPoint num="9" id="584" /> -<TGConnectingPoint num="10" id="585" /> -<TGConnectingPoint num="11" id="586" /> -<TGConnectingPoint num="12" id="587" /> -<TGConnectingPoint num="13" id="588" /> -<TGConnectingPoint num="14" id="589" /> -</COMPONENT> - -<COMPONENT type="5104" id="556" > -<cdparam x="91" y="231" /> -<sizeparam width="145" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="Receive signal" value="RandVal(currentRand)" /> -<TGConnectingPoint num="0" id="557" /> -<TGConnectingPoint num="1" id="558" /> -<TGConnectingPoint num="2" id="559" /> -<TGConnectingPoint num="3" id="560" /> -<TGConnectingPoint num="4" id="561" /> -<TGConnectingPoint num="5" id="562" /> -<TGConnectingPoint num="6" id="563" /> -<TGConnectingPoint num="7" id="564" /> -<TGConnectingPoint num="8" id="565" /> -<TGConnectingPoint num="9" id="566" /> -</COMPONENT> - -<COMPONENT type="5106" id="328" > -<cdparam x="65" y="148" /> -<sizeparam width="187" height="43" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="State" value="Waiting_For_Value" /> -<TGConnectingPoint num="0" id="329" /> -<TGConnectingPoint num="1" id="330" /> -<TGConnectingPoint num="2" id="331" /> -<TGConnectingPoint num="3" id="332" /> -<TGConnectingPoint num="4" id="333" /> -<TGConnectingPoint num="5" id="334" /> -<TGConnectingPoint num="6" id="335" /> -<TGConnectingPoint num="7" id="336" /> -<TGConnectingPoint num="8" id="337" /> -<TGConnectingPoint num="9" id="338" /> -<TGConnectingPoint num="10" id="339" /> -<TGConnectingPoint num="11" id="340" /> -<TGConnectingPoint num="12" id="341" /> -<TGConnectingPoint num="13" id="342" /> -<TGConnectingPoint num="14" id="343" /> -<TGConnectingPoint num="15" id="344" /> -<TGConnectingPoint num="16" id="345" /> -<TGConnectingPoint num="17" id="346" /> -<TGConnectingPoint num="18" id="347" /> -<TGConnectingPoint num="19" id="348" /> -<TGConnectingPoint num="20" id="349" /> -<TGConnectingPoint num="21" id="350" /> -<TGConnectingPoint num="22" id="351" /> -<TGConnectingPoint num="23" id="352" /> -<TGConnectingPoint num="24" id="353" /> -<TGConnectingPoint num="25" id="354" /> -<TGConnectingPoint num="26" id="355" /> -<TGConnectingPoint num="27" id="356" /> -<TGConnectingPoint num="28" id="357" /> -<TGConnectingPoint num="29" id="358" /> -<TGConnectingPoint num="30" id="359" /> -<TGConnectingPoint num="31" id="360" /> -<TGConnectingPoint num="32" id="361" /> -<TGConnectingPoint num="33" id="362" /> -<TGConnectingPoint num="34" id="363" /> -<TGConnectingPoint num="35" id="364" /> -<TGConnectingPoint num="36" id="365" /> -<TGConnectingPoint num="37" id="366" /> -<TGConnectingPoint num="38" id="367" /> -<TGConnectingPoint num="39" id="368" /> -<extraparam> -</extraparam> -</COMPONENT> - -<COMPONENT type="5100" id="326" > -<cdparam x="109" y="76" /> -<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="327" /> -</COMPONENT> - -<CONNECTOR type="5102" id="369" > -<cdparam x="116" y="96" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="370" /> -<P1 x="116" y="96" id="327" /> -<P2 x="65" y="148" id="329" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="371" > -<father id="369" num="0" /> -<cdparam x="116" y="121" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="372" /> -<TGConnectingPoint num="1" id="373" /> -<TGConnectingPoint num="2" id="374" /> -<TGConnectingPoint num="3" id="375" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="567" > -<cdparam x="158" y="191" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="568" /> -<P1 x="158" y="191" id="335" /> -<P2 x="163" y="226" id="557" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="569" > -<father id="567" num="0" /> -<cdparam x="160" y="208" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="570" /> -<TGConnectingPoint num="1" id="571" /> -<TGConnectingPoint num="2" id="572" /> -<TGConnectingPoint num="3" id="573" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="590" > -<cdparam x="163" y="256" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="591" /> -<P1 x="163" y="256" id="558" /> -<P2 x="164" y="279" id="575" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="592" > -<father id="590" num="0" /> -<cdparam x="170" y="266" /> -<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="593" /> -<TGConnectingPoint num="1" id="594" /> -<TGConnectingPoint num="2" id="595" /> -<TGConnectingPoint num="3" id="596" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="638" > -<cdparam x="164" y="329" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="639" /> -<P1 x="164" y="329" id="581" /> -<P2 x="232" y="366" id="617" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="640" > -<father id="638" num="0" /> -<cdparam x="174" y="330" /> -<sizeparam width="113" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="641" /> -<TGConnectingPoint num="1" id="642" /> -<TGConnectingPoint num="2" id="643" /> -<TGConnectingPoint num="3" id="644" /> -<extraparam> -<guard value="[ currentRand > 5 ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -<actions value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="686" > -<cdparam x="245" y="416" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="687" /> -<P1 x="245" y="416" id="605" /> -<P2 x="251" y="487" id="647" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="688" > -<father id="686" num="0" /> -<cdparam x="248" y="451" /> -<sizeparam width="123" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="689" /> -<TGConnectingPoint num="1" id="690" /> -<TGConnectingPoint num="2" id="691" /> -<TGConnectingPoint num="3" id="692" /> -<extraparam> -<guard value="[ ]" enabled="true"/> -<afterMin value="period" enabled="true"/> -<afterMax value="period" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -<actions value="x = x +1" enabled="true"/> -<actions value="LED1off(x)" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - -<CONNECTOR type="5102" id="695" > -<cdparam x="251" y="569" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector" value="null" /> -<TGConnectingPoint num="0" id="696" /> -<P1 x="251" y="569" id="652" /> -<P2 x="250" y="636" id="694" /> -<AutomaticDrawing data="true" /> -</CONNECTOR><SUBCOMPONENT type="-1" id="697" > -<father id="695" num="0" /> -<cdparam x="250" y="602" /> -<sizeparam width="57" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<enabled value="true" /> -<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> -<TGConnectingPoint num="0" id="698" /> -<TGConnectingPoint num="1" id="699" /> -<TGConnectingPoint num="2" id="700" /> -<TGConnectingPoint num="3" id="701" /> -<extraparam> -<guard value="[ x > 10 ]" enabled="true"/> -<afterMin value="" enabled="true"/> -<afterMax value="" enabled="true"/> -<computeMin value="" enabled="true"/> -<computeMax value="" enabled="true"/> -<probability value="" enabled="true"/> -</extraparam> -</SUBCOMPONENT> - - -</AVATARStateMachineDiagramPanel> - -</Modeling> - - - - -</TURTLEGMODELING> \ No newline at end of file diff --git a/modeling/CoffeeMachine_Avatar.ttool/CoffeeMachine_Avatar.xml b/modeling/CoffeeMachine_Avatar.ttool/CoffeeMachine_Avatar.xml new file mode 100644 index 0000000000000000000000000000000000000000..600d23c64741149a35aea9da7aed60917dcacb82 --- /dev/null +++ b/modeling/CoffeeMachine_Avatar.ttool/CoffeeMachine_Avatar.xml @@ -0,0 +1,3134 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<TURTLEGMODELING version="0.98-beta1"> + +<Modeling type="Avatar Requirement" nameTab="AVATAR Requirements" > +<AvatarRDPanel name="AVATAR RD" minX="10" maxX="1900" minY="10" maxY="900" zoom="1.0" > +<COMPONENT type="5200" id="32" > +<cdparam x="661" y="17" /> +<sizeparam width="278" height="120" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="59" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="req00" /> +<TGConnectingPoint num="0" id="1" /> +<TGConnectingPoint num="1" id="2" /> +<TGConnectingPoint num="2" id="3" /> +<TGConnectingPoint num="3" id="4" /> +<TGConnectingPoint num="4" id="5" /> +<TGConnectingPoint num="5" id="6" /> +<TGConnectingPoint num="6" id="7" /> +<TGConnectingPoint num="7" id="8" /> +<TGConnectingPoint num="8" id="9" /> +<TGConnectingPoint num="9" id="10" /> +<TGConnectingPoint num="10" id="11" /> +<TGConnectingPoint num="11" id="12" /> +<TGConnectingPoint num="12" id="13" /> +<TGConnectingPoint num="13" id="14" /> +<TGConnectingPoint num="14" id="15" /> +<TGConnectingPoint num="15" id="16" /> +<TGConnectingPoint num="16" id="17" /> +<TGConnectingPoint num="17" id="18" /> +<TGConnectingPoint num="18" id="19" /> +<TGConnectingPoint num="19" id="20" /> +<TGConnectingPoint num="20" id="21" /> +<TGConnectingPoint num="21" id="22" /> +<TGConnectingPoint num="22" id="23" /> +<TGConnectingPoint num="23" id="24" /> +<TGConnectingPoint num="24" id="25" /> +<TGConnectingPoint num="25" id="26" /> +<TGConnectingPoint num="26" id="27" /> +<TGConnectingPoint num="27" id="28" /> +<TGConnectingPoint num="28" id="29" /> +<TGConnectingPoint num="29" id="30" /> +<TGConnectingPoint num="30" id="31" /> +<extraparam> +<textline data="A coin not used within 50 seconds " /> +<textline data="must be ejected" /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="0" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5200" id="64" > +<cdparam x="47" y="457" /> +<sizeparam width="301" height="120" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="113" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="Req_Availability" /> +<TGConnectingPoint num="0" id="33" /> +<TGConnectingPoint num="1" id="34" /> +<TGConnectingPoint num="2" id="35" /> +<TGConnectingPoint num="3" id="36" /> +<TGConnectingPoint num="4" id="37" /> +<TGConnectingPoint num="5" id="38" /> +<TGConnectingPoint num="6" id="39" /> +<TGConnectingPoint num="7" id="40" /> +<TGConnectingPoint num="8" id="41" /> +<TGConnectingPoint num="9" id="42" /> +<TGConnectingPoint num="10" id="43" /> +<TGConnectingPoint num="11" id="44" /> +<TGConnectingPoint num="12" id="45" /> +<TGConnectingPoint num="13" id="46" /> +<TGConnectingPoint num="14" id="47" /> +<TGConnectingPoint num="15" id="48" /> +<TGConnectingPoint num="16" id="49" /> +<TGConnectingPoint num="17" id="50" /> +<TGConnectingPoint num="18" id="51" /> +<TGConnectingPoint num="19" id="52" /> +<TGConnectingPoint num="20" id="53" /> +<TGConnectingPoint num="21" id="54" /> +<TGConnectingPoint num="22" id="55" /> +<TGConnectingPoint num="23" id="56" /> +<TGConnectingPoint num="24" id="57" /> +<TGConnectingPoint num="25" id="58" /> +<TGConnectingPoint num="26" id="59" /> +<TGConnectingPoint num="27" id="60" /> +<TGConnectingPoint num="28" id="61" /> +<TGConnectingPoint num="29" id="62" /> +<TGConnectingPoint num="30" id="63" /> +<extraparam> +<textline data="The availability of the machine shall be" /> +<textline data="no less than 99.99%" /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="0" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5200" id="96" > +<cdparam x="10" y="182" /> +<sizeparam width="150" height="120" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="136" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="Req_CoffeeMachine" /> +<TGConnectingPoint num="0" id="65" /> +<TGConnectingPoint num="1" id="66" /> +<TGConnectingPoint num="2" id="67" /> +<TGConnectingPoint num="3" id="68" /> +<TGConnectingPoint num="4" id="69" /> +<TGConnectingPoint num="5" id="70" /> +<TGConnectingPoint num="6" id="71" /> +<TGConnectingPoint num="7" id="72" /> +<TGConnectingPoint num="8" id="73" /> +<TGConnectingPoint num="9" id="74" /> +<TGConnectingPoint num="10" id="75" /> +<TGConnectingPoint num="11" id="76" /> +<TGConnectingPoint num="12" id="77" /> +<TGConnectingPoint num="13" id="78" /> +<TGConnectingPoint num="14" id="79" /> +<TGConnectingPoint num="15" id="80" /> +<TGConnectingPoint num="16" id="81" /> +<TGConnectingPoint num="17" id="82" /> +<TGConnectingPoint num="18" id="83" /> +<TGConnectingPoint num="19" id="84" /> +<TGConnectingPoint num="20" id="85" /> +<TGConnectingPoint num="21" id="86" /> +<TGConnectingPoint num="22" id="87" /> +<TGConnectingPoint num="23" id="88" /> +<TGConnectingPoint num="24" id="89" /> +<TGConnectingPoint num="25" id="90" /> +<TGConnectingPoint num="26" id="91" /> +<TGConnectingPoint num="27" id="92" /> +<TGConnectingPoint num="28" id="93" /> +<TGConnectingPoint num="29" id="94" /> +<TGConnectingPoint num="30" id="95" /> +<extraparam> +<textline data="Requirements of the coffee machine" /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="0" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5201" id="112" > +<cdparam x="627" y="376" /> +<sizeparam width="171" height="30" minWidth="10" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="158" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="AvatarProperty" value="BeverageDeliverProperty" /> +<TGConnectingPoint num="0" id="97" /> +<TGConnectingPoint num="1" id="98" /> +<TGConnectingPoint num="2" id="99" /> +<TGConnectingPoint num="3" id="100" /> +<TGConnectingPoint num="4" id="101" /> +<TGConnectingPoint num="5" id="102" /> +<TGConnectingPoint num="6" id="103" /> +<TGConnectingPoint num="7" id="104" /> +<TGConnectingPoint num="8" id="105" /> +<TGConnectingPoint num="9" id="106" /> +<TGConnectingPoint num="10" id="107" /> +<TGConnectingPoint num="11" id="108" /> +<TGConnectingPoint num="12" id="109" /> +<TGConnectingPoint num="13" id="110" /> +<TGConnectingPoint num="14" id="111" /> +</COMPONENT> + +<COMPONENT type="5201" id="128" > +<cdparam x="580" y="246" /> +<sizeparam width="150" height="30" minWidth="10" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="128" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="AvatarProperty" value="WalletCoinProperty" /> +<TGConnectingPoint num="0" id="113" /> +<TGConnectingPoint num="1" id="114" /> +<TGConnectingPoint num="2" id="115" /> +<TGConnectingPoint num="3" id="116" /> +<TGConnectingPoint num="4" id="117" /> +<TGConnectingPoint num="5" id="118" /> +<TGConnectingPoint num="6" id="119" /> +<TGConnectingPoint num="7" id="120" /> +<TGConnectingPoint num="8" id="121" /> +<TGConnectingPoint num="9" id="122" /> +<TGConnectingPoint num="10" id="123" /> +<TGConnectingPoint num="11" id="124" /> +<TGConnectingPoint num="12" id="125" /> +<TGConnectingPoint num="13" id="126" /> +<TGConnectingPoint num="14" id="127" /> +</COMPONENT> + +<COMPONENT type="5200" id="160" > +<cdparam x="234" y="147" /> +<sizeparam width="271" height="104" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="48" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="req1" /> +<TGConnectingPoint num="0" id="129" /> +<TGConnectingPoint num="1" id="130" /> +<TGConnectingPoint num="2" id="131" /> +<TGConnectingPoint num="3" id="132" /> +<TGConnectingPoint num="4" id="133" /> +<TGConnectingPoint num="5" id="134" /> +<TGConnectingPoint num="6" id="135" /> +<TGConnectingPoint num="7" id="136" /> +<TGConnectingPoint num="8" id="137" /> +<TGConnectingPoint num="9" id="138" /> +<TGConnectingPoint num="10" id="139" /> +<TGConnectingPoint num="11" id="140" /> +<TGConnectingPoint num="12" id="141" /> +<TGConnectingPoint num="13" id="142" /> +<TGConnectingPoint num="14" id="143" /> +<TGConnectingPoint num="15" id="144" /> +<TGConnectingPoint num="16" id="145" /> +<TGConnectingPoint num="17" id="146" /> +<TGConnectingPoint num="18" id="147" /> +<TGConnectingPoint num="19" id="148" /> +<TGConnectingPoint num="20" id="149" /> +<TGConnectingPoint num="21" id="150" /> +<TGConnectingPoint num="22" id="151" /> +<TGConnectingPoint num="23" id="152" /> +<TGConnectingPoint num="24" id="153" /> +<TGConnectingPoint num="25" id="154" /> +<TGConnectingPoint num="26" id="155" /> +<TGConnectingPoint num="27" id="156" /> +<TGConnectingPoint num="28" id="157" /> +<TGConnectingPoint num="29" id="158" /> +<TGConnectingPoint num="30" id="159" /> +<extraparam> +<textline data="A wallet must never contain a " /> +<textline data="negative number of coins" /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="0" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5201" id="176" > +<cdparam x="582" y="155" /> +<sizeparam width="150" height="30" minWidth="10" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="117" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="AvatarProperty" value="OneCoinProperty" /> +<TGConnectingPoint num="0" id="161" /> +<TGConnectingPoint num="1" id="162" /> +<TGConnectingPoint num="2" id="163" /> +<TGConnectingPoint num="3" id="164" /> +<TGConnectingPoint num="4" id="165" /> +<TGConnectingPoint num="5" id="166" /> +<TGConnectingPoint num="6" id="167" /> +<TGConnectingPoint num="7" id="168" /> +<TGConnectingPoint num="8" id="169" /> +<TGConnectingPoint num="9" id="170" /> +<TGConnectingPoint num="10" id="171" /> +<TGConnectingPoint num="11" id="172" /> +<TGConnectingPoint num="12" id="173" /> +<TGConnectingPoint num="13" id="174" /> +<TGConnectingPoint num="14" id="175" /> +</COMPONENT> + +<COMPONENT type="5200" id="208" > +<cdparam x="192" y="16" /> +<sizeparam width="304" height="110" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="48" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="req0" /> +<TGConnectingPoint num="0" id="177" /> +<TGConnectingPoint num="1" id="178" /> +<TGConnectingPoint num="2" id="179" /> +<TGConnectingPoint num="3" id="180" /> +<TGConnectingPoint num="4" id="181" /> +<TGConnectingPoint num="5" id="182" /> +<TGConnectingPoint num="6" id="183" /> +<TGConnectingPoint num="7" id="184" /> +<TGConnectingPoint num="8" id="185" /> +<TGConnectingPoint num="9" id="186" /> +<TGConnectingPoint num="10" id="187" /> +<TGConnectingPoint num="11" id="188" /> +<TGConnectingPoint num="12" id="189" /> +<TGConnectingPoint num="13" id="190" /> +<TGConnectingPoint num="14" id="191" /> +<TGConnectingPoint num="15" id="192" /> +<TGConnectingPoint num="16" id="193" /> +<TGConnectingPoint num="17" id="194" /> +<TGConnectingPoint num="18" id="195" /> +<TGConnectingPoint num="19" id="196" /> +<TGConnectingPoint num="20" id="197" /> +<TGConnectingPoint num="21" id="198" /> +<TGConnectingPoint num="22" id="199" /> +<TGConnectingPoint num="23" id="200" /> +<TGConnectingPoint num="24" id="201" /> +<TGConnectingPoint num="25" id="202" /> +<TGConnectingPoint num="26" id="203" /> +<TGConnectingPoint num="27" id="204" /> +<TGConnectingPoint num="28" id="205" /> +<TGConnectingPoint num="29" id="206" /> +<TGConnectingPoint num="30" id="207" /> +<extraparam> +<textline data="The coffee machine never has one coin " /> +<textline data=" inserted more than 50 units of time" /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="123" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5200" id="240" > +<cdparam x="206" y="294" /> +<sizeparam width="357" height="135" minWidth="1" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="48" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> +<infoparam name="Requirement" value="req2" /> +<TGConnectingPoint num="0" id="209" /> +<TGConnectingPoint num="1" id="210" /> +<TGConnectingPoint num="2" id="211" /> +<TGConnectingPoint num="3" id="212" /> +<TGConnectingPoint num="4" id="213" /> +<TGConnectingPoint num="5" id="214" /> +<TGConnectingPoint num="6" id="215" /> +<TGConnectingPoint num="7" id="216" /> +<TGConnectingPoint num="8" id="217" /> +<TGConnectingPoint num="9" id="218" /> +<TGConnectingPoint num="10" id="219" /> +<TGConnectingPoint num="11" id="220" /> +<TGConnectingPoint num="12" id="221" /> +<TGConnectingPoint num="13" id="222" /> +<TGConnectingPoint num="14" id="223" /> +<TGConnectingPoint num="15" id="224" /> +<TGConnectingPoint num="16" id="225" /> +<TGConnectingPoint num="17" id="226" /> +<TGConnectingPoint num="18" id="227" /> +<TGConnectingPoint num="19" id="228" /> +<TGConnectingPoint num="20" id="229" /> +<TGConnectingPoint num="21" id="230" /> +<TGConnectingPoint num="22" id="231" /> +<TGConnectingPoint num="23" id="232" /> +<TGConnectingPoint num="24" id="233" /> +<TGConnectingPoint num="25" id="234" /> +<TGConnectingPoint num="26" id="235" /> +<TGConnectingPoint num="27" id="236" /> +<TGConnectingPoint num="28" id="237" /> +<TGConnectingPoint num="29" id="238" /> +<TGConnectingPoint num="30" id="239" /> +<extraparam> +<textline data="When the application starts, if the wallet contains " /> +<textline data="at least 2 coins, then a beverage may be delivered. " /> +<textline data="On the contrary, if the wallet contains less than 2" /> +<textline data="coins, no beverage will be delivered by the" /> +<textline data="machine." /> +<kind data="Functional" /> +<criticality data="Low" /> +<reqType data="0" /> +<id data="0" /> +<satisfied data="false" /> +<verified data="false" /> +<attackTreeNode data="" /> +<violatedAction data="" /> +<referenceElements data="" /> +</extraparam> +</COMPONENT> + +<CONNECTOR type="5202" id="242" > +<cdparam x="659" y="79" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Requirement to Requirement" value="<<deriveReqt>>" /> +<TGConnectingPoint num="0" id="241" /> +<P1 x="661" y="47" id="1" /> +<P2 x="496" y="43" id="180" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5205" id="244" > +<cdparam x="124" y="457" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Requirement to Requirement" value="<<composition>>" /> +<TGConnectingPoint num="0" id="243" /> +<P1 x="122" y="457" id="39" /> +<P2 x="122" y="302" id="76" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5205" id="246" > +<cdparam x="244" y="315" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Requirement to Requirement" value="<<composition>>" /> +<TGConnectingPoint num="0" id="245" /> +<P1 x="206" y="327" id="209" /> +<P2 x="160" y="272" id="70" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5205" id="248" > +<cdparam x="249" y="199" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Requirement to Requirement" value="<<composition>>" /> +<TGConnectingPoint num="0" id="247" /> +<P1 x="234" y="199" id="130" /> +<P2 x="160" y="212" id="68" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5205" id="250" > +<cdparam x="237" y="98" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Requirement to Requirement" value="<<composition>>" /> +<TGConnectingPoint num="0" id="249" /> +<P1 x="192" y="98" id="179" /> +<P2 x="122" y="182" id="73" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5203" id="252" > +<cdparam x="538" y="537" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from AvatarProperty to Requirement" value="<<verify>>" /> +<TGConnectingPoint num="0" id="251" /> +<P1 x="627" y="391" id="98" /> +<P2 x="563" y="361" id="225" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5203" id="254" > +<cdparam x="545" y="329" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from AvatarProperty to Requirement" value="<<verify>>" /> +<TGConnectingPoint num="0" id="253" /> +<P1 x="580" y="261" id="114" /> +<P2 x="505" y="199" id="145" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5203" id="256" > +<cdparam x="563" y="148" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from AvatarProperty to Requirement" value="<<verify>>" /> +<TGConnectingPoint num="0" id="255" /> +<P1 x="582" y="170" id="162" /> +<P2 x="496" y="98" id="194" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> + +</AvatarRDPanel> + +<AvatarPDPanel name="AVATAR PD" minX="10" maxX="1400" minY="10" maxY="900" zoom="1.0000000000000004" > +<CONNECTOR type="5312" id="258" > +<cdparam x="582" y="248" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="257" /> +<P1 x="502" y="258" id="383" /> +<P2 x="502" y="334" id="271" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5310" id="264" > +<cdparam x="247" y="616" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="261" /> +<TGConnectingPoint num="1" id="262" /> +<TGConnectingPoint num="2" id="263" /> +<P1 x="492" y="126" id="346" /> +<P2 x="492" y="209" id="387" /> +<Point x="467" y="147" /> +<Point x="467" y="192" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="259" > +<father id="264" num="0" /> +<cdparam x="467" y="147" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="260" > +<father id="264" num="1" /> +<cdparam x="467" y="192" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> + +<CONNECTOR type="5311" id="266" > +<cdparam x="280" y="200" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="265" /> +<P1 x="313" y="261" id="296" /> +<P2 x="361" y="261" id="284" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5312" id="268" > +<cdparam x="473" y="190" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="267" /> +<P1 x="390" y="286" id="282" /> +<P2 x="390" y="331" id="276" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5311" id="270" > +<cdparam x="276" y="190" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="269" /> +<P1 x="309" y="211" id="309" /> +<P2 x="361" y="211" id="283" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<COMPONENT type="5308" id="275" > +<cdparam x="446" y="334" /> +<sizeparam width="112" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="TGComponent" value="WalletCoinProperty" /> +<TGConnectingPoint num="0" id="271" /> +<TGConnectingPoint num="1" id="272" /> +<TGConnectingPoint num="2" id="273" /> +<TGConnectingPoint num="3" id="274" /> +<extraparam> +<liveness data="0" /> +<not data="false" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5308" id="280" > +<cdparam x="340" y="331" /> +<sizeparam width="100" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="TGComponent" value="oneCoinProperty" /> +<TGConnectingPoint num="0" id="276" /> +<TGConnectingPoint num="1" id="277" /> +<TGConnectingPoint num="2" id="278" /> +<TGConnectingPoint num="3" id="279" /> +<extraparam> +<liveness data="1" /> +<not data="true" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5302" id="293" > +<cdparam x="361" y="187" /> +<sizeparam width="59" height="99" minWidth="50" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="TGComponent" value=">50" /> +<TGConnectingPoint num="0" id="281" /> +<TGConnectingPoint num="1" id="282" /> +<TGConnectingPoint num="2" id="283" /> +<TGConnectingPoint num="3" id="284" /> +<TGConnectingPoint num="4" id="285" /> +<TGConnectingPoint num="5" id="286" /> +<TGConnectingPoint num="6" id="287" /> +<TGConnectingPoint num="7" id="288" /> +<TGConnectingPoint num="8" id="289" /> +<TGConnectingPoint num="9" id="290" /> +<TGConnectingPoint num="10" id="291" /> +<TGConnectingPoint num="11" id="292" /> +</COMPONENT> + +<COMPONENT type="5300" id="344" > +<cdparam x="150" y="142" /> +<sizeparam width="168" height="154" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Block0" value="CoffeeMachine" /> +<TGConnectingPoint num="0" id="320" /> +<TGConnectingPoint num="1" id="321" /> +<TGConnectingPoint num="2" id="322" /> +<TGConnectingPoint num="3" id="323" /> +<TGConnectingPoint num="4" id="324" /> +<TGConnectingPoint num="5" id="325" /> +<TGConnectingPoint num="6" id="326" /> +<TGConnectingPoint num="7" id="327" /> +<TGConnectingPoint num="8" id="328" /> +<TGConnectingPoint num="9" id="329" /> +<TGConnectingPoint num="10" id="330" /> +<TGConnectingPoint num="11" id="331" /> +<TGConnectingPoint num="12" id="332" /> +<TGConnectingPoint num="13" id="333" /> +<TGConnectingPoint num="14" id="334" /> +<TGConnectingPoint num="15" id="335" /> +<TGConnectingPoint num="16" id="336" /> +<TGConnectingPoint num="17" id="337" /> +<TGConnectingPoint num="18" id="338" /> +<TGConnectingPoint num="19" id="339" /> +<TGConnectingPoint num="20" id="340" /> +<TGConnectingPoint num="21" id="341" /> +<TGConnectingPoint num="22" id="342" /> +<TGConnectingPoint num="23" id="343" /> +</COMPONENT> +<SUBCOMPONENT type="5304" id="306" > +<father id="344" num="0" /> +<cdparam x="165" y="241" /> +<sizeparam width="148" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="20" minY="0" maxY="114" /> +<infoparam name="TGComponent" value="WaitingForFirstCoin_enter" /> +<TGConnectingPoint num="0" id="294" /> +<TGConnectingPoint num="1" id="295" /> +<TGConnectingPoint num="2" id="296" /> +<TGConnectingPoint num="3" id="297" /> +<TGConnectingPoint num="4" id="298" /> +<TGConnectingPoint num="5" id="299" /> +<TGConnectingPoint num="6" id="300" /> +<TGConnectingPoint num="7" id="301" /> +<TGConnectingPoint num="8" id="302" /> +<TGConnectingPoint num="9" id="303" /> +<TGConnectingPoint num="10" id="304" /> +<TGConnectingPoint num="11" id="305" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5304" id="319" > +<father id="344" num="1" /> +<cdparam x="170" y="191" /> +<sizeparam width="139" height="40" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="29" minY="0" maxY="114" /> +<infoparam name="TGComponent" value="WaitingForFirstCoin_exit" /> +<TGConnectingPoint num="0" id="307" /> +<TGConnectingPoint num="1" id="308" /> +<TGConnectingPoint num="2" id="309" /> +<TGConnectingPoint num="3" id="310" /> +<TGConnectingPoint num="4" id="311" /> +<TGConnectingPoint num="5" id="312" /> +<TGConnectingPoint num="6" id="313" /> +<TGConnectingPoint num="7" id="314" /> +<TGConnectingPoint num="8" id="315" /> +<TGConnectingPoint num="9" id="316" /> +<TGConnectingPoint num="10" id="317" /> +<TGConnectingPoint num="11" id="318" /> +</SUBCOMPONENT> + +<COMPONENT type="5300" id="382" > +<cdparam x="459" y="61" /> +<sizeparam width="150" height="116" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Block0" value="Wallet" /> +<TGConnectingPoint num="0" id="358" /> +<TGConnectingPoint num="1" id="359" /> +<TGConnectingPoint num="2" id="360" /> +<TGConnectingPoint num="3" id="361" /> +<TGConnectingPoint num="4" id="362" /> +<TGConnectingPoint num="5" id="363" /> +<TGConnectingPoint num="6" id="364" /> +<TGConnectingPoint num="7" id="365" /> +<TGConnectingPoint num="8" id="366" /> +<TGConnectingPoint num="9" id="367" /> +<TGConnectingPoint num="10" id="368" /> +<TGConnectingPoint num="11" id="369" /> +<TGConnectingPoint num="12" id="370" /> +<TGConnectingPoint num="13" id="371" /> +<TGConnectingPoint num="14" id="372" /> +<TGConnectingPoint num="15" id="373" /> +<TGConnectingPoint num="16" id="374" /> +<TGConnectingPoint num="17" id="375" /> +<TGConnectingPoint num="18" id="376" /> +<TGConnectingPoint num="19" id="377" /> +<TGConnectingPoint num="20" id="378" /> +<TGConnectingPoint num="21" id="379" /> +<TGConnectingPoint num="22" id="380" /> +<TGConnectingPoint num="23" id="381" /> +</COMPONENT> +<SUBCOMPONENT type="5303" id="357" > +<father id="382" num="0" /> +<cdparam x="492" y="102" /> +<sizeparam width="100" height="49" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="50" minY="0" maxY="67" /> +<infoparam name="TGComponent" value="nbOfCoins" /> +<TGConnectingPoint num="0" id="345" /> +<TGConnectingPoint num="1" id="346" /> +<TGConnectingPoint num="2" id="347" /> +<TGConnectingPoint num="3" id="348" /> +<TGConnectingPoint num="4" id="349" /> +<TGConnectingPoint num="5" id="350" /> +<TGConnectingPoint num="6" id="351" /> +<TGConnectingPoint num="7" id="352" /> +<TGConnectingPoint num="8" id="353" /> +<TGConnectingPoint num="9" id="354" /> +<TGConnectingPoint num="10" id="355" /> +<TGConnectingPoint num="11" id="356" /> +<extraparam> +<Toggle value="" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5306" id="394" > +<cdparam x="467" y="209" /> +<sizeparam width="100" height="49" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="TGComponent" value="nbOfCoins >= 0" /> +<TGConnectingPoint num="0" id="383" /> +<TGConnectingPoint num="1" id="384" /> +<TGConnectingPoint num="2" id="385" /> +<TGConnectingPoint num="3" id="386" /> +<TGConnectingPoint num="4" id="387" /> +<TGConnectingPoint num="5" id="388" /> +<TGConnectingPoint num="6" id="389" /> +<TGConnectingPoint num="7" id="390" /> +<TGConnectingPoint num="8" id="391" /> +<TGConnectingPoint num="9" id="392" /> +<TGConnectingPoint num="10" id="393" /> +<extraparam> +<Toggle value="" /> +</extraparam> +</COMPONENT> + + +</AvatarPDPanel> + +<AvatarPDPanel name="AVATAR PD" minX="10" maxX="1400" minY="10" maxY="1400" zoom="1.0" > +<CONNECTOR type="5312" id="396" > +<cdparam x="580" y="547" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="395" /> +<P1 x="634" y="495" id="571" /> +<P2 x="635" y="562" id="428" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5312" id="398" > +<cdparam x="506" y="493" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="397" /> +<P1 x="577" y="471" id="582" /> +<P2 x="654" y="495" id="572" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5312" id="400" > +<cdparam x="694" y="460" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="399" /> +<P1 x="694" y="472" id="424" /> +<P2 x="674" y="505" id="573" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5311" id="406" > +<cdparam x="581" y="133" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="403" /> +<TGConnectingPoint num="1" id="404" /> +<TGConnectingPoint num="2" id="405" /> +<P1 x="581" y="154" id="492" /> +<P2 x="546" y="305" id="549" /> +<Point x="518" y="154" /> +<Point x="518" y="305" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="401" > +<father id="406" num="0" /> +<cdparam x="518" y="154" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="-1" id="402" > +<father id="406" num="1" /> +<cdparam x="518" y="305" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> + +<CONNECTOR type="5311" id="410" > +<cdparam x="631" y="143" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="408" /> +<TGConnectingPoint num="1" id="409" /> +<P1 x="631" y="164" id="487" /> +<P2 x="667" y="310" id="536" /> +<Point x="631" y="310" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="407" > +<father id="410" num="0" /> +<cdparam x="631" y="310" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> + +<CONNECTOR type="5312" id="412" > +<cdparam x="695" y="396" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="411" /> +<P1 x="696" y="385" id="535" /> +<P2 x="694" y="417" id="423" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5310" id="416" > +<cdparam x="877" y="168" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="414" /> +<TGConnectingPoint num="1" id="415" /> +<P1 x="721" y="158" id="472" /> +<P2 x="700" y="204" id="526" /> +<Point x="700" y="158" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="413" > +<father id="416" num="0" /> +<cdparam x="700" y="158" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="point " value="null" /> +</SUBCOMPONENT> + +<CONNECTOR type="5312" id="418" > +<cdparam x="915" y="307" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="417" /> +<P1 x="710" y="254" id="522" /> +<P2 x="711" y="285" id="534" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5312" id="420" > +<cdparam x="993" y="581" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="reg" /> +<TGConnectingPoint num="0" id="419" /> +<P1 x="576" y="385" id="548" /> +<P2 x="577" y="416" id="581" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<CONNECTOR type="5311" id="422" > +<cdparam x="426" y="264" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from TGComponent to TGComponent" value="" /> +<TGConnectingPoint num="0" id="421" /> +<P1 x="491" y="345" id="435" /> +<P2 x="546" y="345" id="553" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<COMPONENT type="5308" id="427" > +<cdparam x="644" y="417" /> +<sizeparam width="100" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="prop01" /> +<TGConnectingPoint num="0" id="423" /> +<TGConnectingPoint num="1" id="424" /> +<TGConnectingPoint num="2" id="425" /> +<TGConnectingPoint num="3" id="426" /> +<extraparam> +<liveness data="1" /> +<not data="false" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5308" id="432" > +<cdparam x="562" y="562" /> +<sizeparam width="146" height="54" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="BeverageDeliverProperty" /> +<TGConnectingPoint num="0" id="428" /> +<TGConnectingPoint num="1" id="429" /> +<TGConnectingPoint num="2" id="430" /> +<TGConnectingPoint num="3" id="431" /> +<extraparam> +<liveness data="0" /> +<not data="false" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5300" id="470" > +<cdparam x="372" y="227" /> +<sizeparam width="132" height="153" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="Block0" value="CoffeeMachine" /> +<TGConnectingPoint num="0" id="446" /> +<TGConnectingPoint num="1" id="447" /> +<TGConnectingPoint num="2" id="448" /> +<TGConnectingPoint num="3" id="449" /> +<TGConnectingPoint num="4" id="450" /> +<TGConnectingPoint num="5" id="451" /> +<TGConnectingPoint num="6" id="452" /> +<TGConnectingPoint num="7" id="453" /> +<TGConnectingPoint num="8" id="454" /> +<TGConnectingPoint num="9" id="455" /> +<TGConnectingPoint num="10" id="456" /> +<TGConnectingPoint num="11" id="457" /> +<TGConnectingPoint num="12" id="458" /> +<TGConnectingPoint num="13" id="459" /> +<TGConnectingPoint num="14" id="460" /> +<TGConnectingPoint num="15" id="461" /> +<TGConnectingPoint num="16" id="462" /> +<TGConnectingPoint num="17" id="463" /> +<TGConnectingPoint num="18" id="464" /> +<TGConnectingPoint num="19" id="465" /> +<TGConnectingPoint num="20" id="466" /> +<TGConnectingPoint num="21" id="467" /> +<TGConnectingPoint num="22" id="468" /> +<TGConnectingPoint num="23" id="469" /> +</COMPONENT> +<SUBCOMPONENT type="5304" id="445" > +<father id="470" num="0" /> +<cdparam x="391" y="326" /> +<sizeparam width="100" height="39" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="32" minY="0" maxY="114" /> +<infoparam name="TGComponent" value="beverageReady" /> +<TGConnectingPoint num="0" id="433" /> +<TGConnectingPoint num="1" id="434" /> +<TGConnectingPoint num="2" id="435" /> +<TGConnectingPoint num="3" id="436" /> +<TGConnectingPoint num="4" id="437" /> +<TGConnectingPoint num="5" id="438" /> +<TGConnectingPoint num="6" id="439" /> +<TGConnectingPoint num="7" id="440" /> +<TGConnectingPoint num="8" id="441" /> +<TGConnectingPoint num="9" id="442" /> +<TGConnectingPoint num="10" id="443" /> +<TGConnectingPoint num="11" id="444" /> +</SUBCOMPONENT> + +<COMPONENT type="5300" id="521" > +<cdparam x="563" y="78" /> +<sizeparam width="268" height="115" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="Block0" value="Wallet" /> +<TGConnectingPoint num="0" id="497" /> +<TGConnectingPoint num="1" id="498" /> +<TGConnectingPoint num="2" id="499" /> +<TGConnectingPoint num="3" id="500" /> +<TGConnectingPoint num="4" id="501" /> +<TGConnectingPoint num="5" id="502" /> +<TGConnectingPoint num="6" id="503" /> +<TGConnectingPoint num="7" id="504" /> +<TGConnectingPoint num="8" id="505" /> +<TGConnectingPoint num="9" id="506" /> +<TGConnectingPoint num="10" id="507" /> +<TGConnectingPoint num="11" id="508" /> +<TGConnectingPoint num="12" id="509" /> +<TGConnectingPoint num="13" id="510" /> +<TGConnectingPoint num="14" id="511" /> +<TGConnectingPoint num="15" id="512" /> +<TGConnectingPoint num="16" id="513" /> +<TGConnectingPoint num="17" id="514" /> +<TGConnectingPoint num="18" id="515" /> +<TGConnectingPoint num="19" id="516" /> +<TGConnectingPoint num="20" id="517" /> +<TGConnectingPoint num="21" id="518" /> +<TGConnectingPoint num="22" id="519" /> +<TGConnectingPoint num="23" id="520" /> +</COMPONENT> +<SUBCOMPONENT type="5303" id="483" > +<father id="521" num="0" /> +<cdparam x="721" y="133" /> +<sizeparam width="100" height="50" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="168" minY="0" maxY="65" /> +<infoparam name="TGComponent" value="nbOfCoins" /> +<TGConnectingPoint num="0" id="471" /> +<TGConnectingPoint num="1" id="472" /> +<TGConnectingPoint num="2" id="473" /> +<TGConnectingPoint num="3" id="474" /> +<TGConnectingPoint num="4" id="475" /> +<TGConnectingPoint num="5" id="476" /> +<TGConnectingPoint num="6" id="477" /> +<TGConnectingPoint num="7" id="478" /> +<TGConnectingPoint num="8" id="479" /> +<TGConnectingPoint num="9" id="480" /> +<TGConnectingPoint num="10" id="481" /> +<TGConnectingPoint num="11" id="482" /> +<extraparam> +<Toggle value="" /> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5304" id="496" > +<father id="521" num="1" /> +<cdparam x="581" y="125" /> +<sizeparam width="100" height="39" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="168" minY="0" maxY="76" /> +<infoparam name="TGComponent" value="Start" /> +<TGConnectingPoint num="0" id="484" /> +<TGConnectingPoint num="1" id="485" /> +<TGConnectingPoint num="2" id="486" /> +<TGConnectingPoint num="3" id="487" /> +<TGConnectingPoint num="4" id="488" /> +<TGConnectingPoint num="5" id="489" /> +<TGConnectingPoint num="6" id="490" /> +<TGConnectingPoint num="7" id="491" /> +<TGConnectingPoint num="8" id="492" /> +<TGConnectingPoint num="9" id="493" /> +<TGConnectingPoint num="10" id="494" /> +<TGConnectingPoint num="11" id="495" /> +</SUBCOMPONENT> + +<COMPONENT type="5306" id="533" > +<cdparam x="675" y="204" /> +<sizeparam width="100" height="50" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="nbOfCoins > 1" /> +<TGConnectingPoint num="0" id="522" /> +<TGConnectingPoint num="1" id="523" /> +<TGConnectingPoint num="2" id="524" /> +<TGConnectingPoint num="3" id="525" /> +<TGConnectingPoint num="4" id="526" /> +<TGConnectingPoint num="5" id="527" /> +<TGConnectingPoint num="6" id="528" /> +<TGConnectingPoint num="7" id="529" /> +<TGConnectingPoint num="8" id="530" /> +<TGConnectingPoint num="9" id="531" /> +<TGConnectingPoint num="10" id="532" /> +<extraparam> +<Toggle value="" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5302" id="546" > +<cdparam x="667" y="285" /> +<sizeparam width="59" height="100" minWidth="50" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="=0" /> +<TGConnectingPoint num="0" id="534" /> +<TGConnectingPoint num="1" id="535" /> +<TGConnectingPoint num="2" id="536" /> +<TGConnectingPoint num="3" id="537" /> +<TGConnectingPoint num="4" id="538" /> +<TGConnectingPoint num="5" id="539" /> +<TGConnectingPoint num="6" id="540" /> +<TGConnectingPoint num="7" id="541" /> +<TGConnectingPoint num="8" id="542" /> +<TGConnectingPoint num="9" id="543" /> +<TGConnectingPoint num="10" id="544" /> +<TGConnectingPoint num="11" id="545" /> +</COMPONENT> + +<COMPONENT type="5301" id="567" > +<cdparam x="546" y="285" /> +<sizeparam width="60" height="100" minWidth="50" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="<<LS>>" /> +<TGConnectingPoint num="0" id="547" /> +<TGConnectingPoint num="1" id="548" /> +<TGConnectingPoint num="2" id="549" /> +<TGConnectingPoint num="3" id="550" /> +<TGConnectingPoint num="4" id="551" /> +<TGConnectingPoint num="5" id="552" /> +<TGConnectingPoint num="6" id="553" /> +<TGConnectingPoint num="7" id="554" /> +<TGConnectingPoint num="8" id="555" /> +<TGConnectingPoint num="9" id="556" /> +<TGConnectingPoint num="10" id="557" /> +<TGConnectingPoint num="11" id="558" /> +<TGConnectingPoint num="12" id="559" /> +<TGConnectingPoint num="13" id="560" /> +<TGConnectingPoint num="14" id="561" /> +<TGConnectingPoint num="15" id="562" /> +<TGConnectingPoint num="16" id="563" /> +<TGConnectingPoint num="17" id="564" /> +<TGConnectingPoint num="18" id="565" /> +<TGConnectingPoint num="19" id="566" /> +</COMPONENT> + +<COMPONENT type="5309" id="580" > +<cdparam x="594" y="495" /> +<sizeparam width="80" height="40" minWidth="75" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="<=>" /> +<TGConnectingPoint num="0" id="568" /> +<TGConnectingPoint num="1" id="569" /> +<TGConnectingPoint num="2" id="570" /> +<TGConnectingPoint num="3" id="571" /> +<TGConnectingPoint num="4" id="572" /> +<TGConnectingPoint num="5" id="573" /> +<TGConnectingPoint num="6" id="574" /> +<TGConnectingPoint num="7" id="575" /> +<TGConnectingPoint num="8" id="576" /> +<TGConnectingPoint num="9" id="577" /> +<TGConnectingPoint num="10" id="578" /> +<TGConnectingPoint num="11" id="579" /> +</COMPONENT> + +<COMPONENT type="5308" id="585" > +<cdparam x="527" y="416" /> +<sizeparam width="100" height="55" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="TGComponent" value="prop02" /> +<TGConnectingPoint num="0" id="581" /> +<TGConnectingPoint num="1" id="582" /> +<TGConnectingPoint num="2" id="583" /> +<TGConnectingPoint num="3" id="584" /> +<extraparam> +<liveness data="1" /> +<not data="false" /> +</extraparam> +</COMPONENT> + + +</AvatarPDPanel> + +</Modeling> + + + + +<Modeling type="AVATAR Design" nameTab="AVATAR Design" > +<AVATARBlockDiagramPanel name="AVATAR Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" > +<MainCode value="void __user_init() {"/> +<MainCode value="}"/> +<Optimized value="true" /> +<Validated value="Wallet;CoffeeMachine;CoffeeButton;TeaButton;" /> +<Ignored value="" /> + +<CONNECTOR type="5002" id="587" > +<cdparam x="321" y="567" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Block1 to Block0" value="" /> +<TGConnectingPoint num="0" id="586" /> +<P1 x="559" y="330" id="623" /> +<P2 x="560" y="377" id="681" /> +<AutomaticDrawing data="true" /> +<extraparam> +<isd value="in pushCoffeeButton()" /> +<oso value="out push()" /> +<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> +</extraparam> +</CONNECTOR> +<CONNECTOR type="5002" id="589" > +<cdparam x="275" y="114" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Block0 to Block0" value="" /> +<TGConnectingPoint num="0" id="588" /> +<P1 x="306" y="109" id="603" /> +<P2 x="445" y="108" id="677" /> +<AutomaticDrawing data="true" /> +<extraparam> +<iso value="in getCoin(int nbOfCoins)" /> +<osd value="out ejectCoin(int nbOfCoins)" /> +<isd value="in getCoin(int nbOfCoins)" /> +<oso value="out putCoin(int nbOfCoins)" /> +<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> +</extraparam> +</CONNECTOR> +<CONNECTOR type="5002" id="591" > +<cdparam x="623" y="565" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Block1 to Block0" value="" /> +<TGConnectingPoint num="0" id="590" /> +<P1 x="789" y="326" id="648" /> +<P2 x="790" y="377" id="682" /> +<AutomaticDrawing data="true" /> +<extraparam> +<isd value="in pushTeaButton()" /> +<oso value="out push()" /> +<FIFOType asynchronous="false" size="1024" blocking="false" private="true" broadcast="false" lossy="false" /> +</extraparam> +</CONNECTOR> +<COMPONENT type="5000" id="616" > +<cdparam x="106" y="55" /> +<sizeparam width="200" height="218" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Block0" value="Wallet" /> +<TGConnectingPoint num="0" id="592" /> +<TGConnectingPoint num="1" id="593" /> +<TGConnectingPoint num="2" id="594" /> +<TGConnectingPoint num="3" id="595" /> +<TGConnectingPoint num="4" id="596" /> +<TGConnectingPoint num="5" id="597" /> +<TGConnectingPoint num="6" id="598" /> +<TGConnectingPoint num="7" id="599" /> +<TGConnectingPoint num="8" id="600" /> +<TGConnectingPoint num="9" id="601" /> +<TGConnectingPoint num="10" id="602" /> +<TGConnectingPoint num="11" id="603" /> +<TGConnectingPoint num="12" id="604" /> +<TGConnectingPoint num="13" id="605" /> +<TGConnectingPoint num="14" id="606" /> +<TGConnectingPoint num="15" id="607" /> +<TGConnectingPoint num="16" id="608" /> +<TGConnectingPoint num="17" id="609" /> +<TGConnectingPoint num="18" id="610" /> +<TGConnectingPoint num="19" id="611" /> +<TGConnectingPoint num="20" id="612" /> +<TGConnectingPoint num="21" id="613" /> +<TGConnectingPoint num="22" id="614" /> +<TGConnectingPoint num="23" id="615" /> +<extraparam> +<CryptoBlock value="false" /> +<Attribute access="0" id="nbOfCoins" value="2" type="8" typeOther="" /> +<Attribute access="0" id="x" value="1" type="8" typeOther="" /> +<Attribute access="0" id="minUserDelay" value="50" type="8" typeOther="" /> +<Attribute access="0" id="maxUserDelay" value="70" type="8" typeOther="" /> +<Method value="contentOfWallet(int nbOfCoins)" /> +<Signal value="in getCoin(int nbOfCoins)" /> +<Signal value="out putCoin(int nbOfCoins)" /> +</extraparam> +</COMPONENT> + +<COMPONENT type="5000" id="691" > +<cdparam x="445" y="19" /> +<sizeparam width="461" height="358" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Block0" value="CoffeeMachine" /> +<TGConnectingPoint num="0" id="667" /> +<TGConnectingPoint num="1" id="668" /> +<TGConnectingPoint num="2" id="669" /> +<TGConnectingPoint num="3" id="670" /> +<TGConnectingPoint num="4" id="671" /> +<TGConnectingPoint num="5" id="672" /> +<TGConnectingPoint num="6" id="673" /> +<TGConnectingPoint num="7" id="674" /> +<TGConnectingPoint num="8" id="675" /> +<TGConnectingPoint num="9" id="676" /> +<TGConnectingPoint num="10" id="677" /> +<TGConnectingPoint num="11" id="678" /> +<TGConnectingPoint num="12" id="679" /> +<TGConnectingPoint num="13" id="680" /> +<TGConnectingPoint num="14" id="681" /> +<TGConnectingPoint num="15" id="682" /> +<TGConnectingPoint num="16" id="683" /> +<TGConnectingPoint num="17" id="684" /> +<TGConnectingPoint num="18" id="685" /> +<TGConnectingPoint num="19" id="686" /> +<TGConnectingPoint num="20" id="687" /> +<TGConnectingPoint num="21" id="688" /> +<TGConnectingPoint num="22" id="689" /> +<TGConnectingPoint num="23" id="690" /> +<extraparam> +<CryptoBlock value="false" /> +<Attribute access="0" id="teaMinDelay" value="3" type="8" typeOther="" /> +<Attribute access="0" id="teaMaxDelay" value="8" type="8" typeOther="" /> +<Attribute access="0" id="coffeeMinDelay" value="5" type="8" typeOther="" /> +<Attribute access="0" id="coffeeMaxDelay" value="10" type="8" typeOther="" /> +<Attribute access="0" id="coinDelay" value="50" type="8" typeOther="" /> +<Attribute access="0" id="x" value="0" type="8" typeOther="" /> +<Attribute access="0" id="nbOfCoins" value="0" type="8" typeOther="" /> +<Method value="beverageReady()" /> +<Signal value="in pushCoffeeButton()" /> +<Signal value="in pushTeaButton()" /> +<Signal value="in getCoin(int nbOfCoins)" /> +<Signal value="out ejectCoin(int nbOfCoins)" /> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="5000" id="641" > +<father id="691" num="0" /> +<cdparam x="464" y="228" /> +<sizeparam width="190" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="271" minY="0" maxY="256" /> +<infoparam name="Block1" value="CoffeeButton" /> +<TGConnectingPoint num="0" id="617" /> +<TGConnectingPoint num="1" id="618" /> +<TGConnectingPoint num="2" id="619" /> +<TGConnectingPoint num="3" id="620" /> +<TGConnectingPoint num="4" id="621" /> +<TGConnectingPoint num="5" id="622" /> +<TGConnectingPoint num="6" id="623" /> +<TGConnectingPoint num="7" id="624" /> +<TGConnectingPoint num="8" id="625" /> +<TGConnectingPoint num="9" id="626" /> +<TGConnectingPoint num="10" id="627" /> +<TGConnectingPoint num="11" id="628" /> +<TGConnectingPoint num="12" id="629" /> +<TGConnectingPoint num="13" id="630" /> +<TGConnectingPoint num="14" id="631" /> +<TGConnectingPoint num="15" id="632" /> +<TGConnectingPoint num="16" id="633" /> +<TGConnectingPoint num="17" id="634" /> +<TGConnectingPoint num="18" id="635" /> +<TGConnectingPoint num="19" id="636" /> +<TGConnectingPoint num="20" id="637" /> +<TGConnectingPoint num="21" id="638" /> +<TGConnectingPoint num="22" id="639" /> +<TGConnectingPoint num="23" id="640" /> +<extraparam> +<CryptoBlock value="false" /> +<Attribute access="0" id="mechanicalDelay" value="10" type="8" typeOther="" /> +<Signal value="out push()" /> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5000" id="666" > +<father id="691" num="1" /> +<cdparam x="695" y="224" /> +<sizeparam width="189" height="102" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="272" minY="0" maxY="256" /> +<infoparam name="Block1" value="TeaButton" /> +<TGConnectingPoint num="0" id="642" /> +<TGConnectingPoint num="1" id="643" /> +<TGConnectingPoint num="2" id="644" /> +<TGConnectingPoint num="3" id="645" /> +<TGConnectingPoint num="4" id="646" /> +<TGConnectingPoint num="5" id="647" /> +<TGConnectingPoint num="6" id="648" /> +<TGConnectingPoint num="7" id="649" /> +<TGConnectingPoint num="8" id="650" /> +<TGConnectingPoint num="9" id="651" /> +<TGConnectingPoint num="10" id="652" /> +<TGConnectingPoint num="11" id="653" /> +<TGConnectingPoint num="12" id="654" /> +<TGConnectingPoint num="13" id="655" /> +<TGConnectingPoint num="14" id="656" /> +<TGConnectingPoint num="15" id="657" /> +<TGConnectingPoint num="16" id="658" /> +<TGConnectingPoint num="17" id="659" /> +<TGConnectingPoint num="18" id="660" /> +<TGConnectingPoint num="19" id="661" /> +<TGConnectingPoint num="20" id="662" /> +<TGConnectingPoint num="21" id="663" /> +<TGConnectingPoint num="22" id="664" /> +<TGConnectingPoint num="23" id="665" /> +<extraparam> +<CryptoBlock value="false" /> +<Attribute access="0" id="mechanicalDelay" value="10" type="8" typeOther="" /> +<Signal value="out push()" /> +</extraparam> +</SUBCOMPONENT> + + +</AVATARBlockDiagramPanel> + +<AVATARStateMachineDiagramPanel name="Wallet" minX="10" maxX="1400" minY="10" maxY="900" > +<CONNECTOR type="5102" id="698" > +<cdparam x="516" y="264" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="697" /> +<P1 x="485" y="219" id="739" /> +<P2 x="485" y="274" id="750" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="696" > +<father id="698" num="0" /> +<cdparam x="493" y="251" /> +<sizeparam width="161" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="692" /> +<TGConnectingPoint num="1" id="693" /> +<TGConnectingPoint num="2" id="694" /> +<TGConnectingPoint num="3" id="695" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="nbOfCoins = nbOfCoins + x" /> +<actions value="contentOfWallet(nbOfCoins)" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="705" > +<cdparam x="382" y="165" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="704" /> +<P1 x="382" y="165" id="846" /> +<P2 x="485" y="189" id="738" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="703" > +<father id="705" num="0" /> +<cdparam x="382" y="205" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="699" /> +<TGConnectingPoint num="1" id="700" /> +<TGConnectingPoint num="2" id="701" /> +<TGConnectingPoint num="3" id="702" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="712" > +<cdparam x="223" y="260" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="711" /> +<P1 x="251" y="231" id="728" /> +<P2 x="252" y="300" id="791" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="710" > +<father id="712" num="0" /> +<cdparam x="175" y="246" /> +<sizeparam width="205" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="706" /> +<TGConnectingPoint num="1" id="707" /> +<TGConnectingPoint num="2" id="708" /> +<TGConnectingPoint num="3" id="709" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="minUserDelay" /> +<afterMax value="maxUserDelay" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="nbOfCoins = nbOfCoins - x" /> +<actions value="contentOfWallet(nbOfCoins)" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="719" > +<cdparam x="357" y="165" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="718" /> +<P1 x="357" y="165" id="845" /> +<P2 x="251" y="201" id="727" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="717" > +<father id="719" num="0" /> +<cdparam x="220" y="174" /> +<sizeparam width="93" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="713" /> +<TGConnectingPoint num="1" id="714" /> +<TGConnectingPoint num="2" id="715" /> +<TGConnectingPoint num="3" id="716" /> +<extraparam> +<guard value="[nbOfCoins > 0]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="726" > +<cdparam x="369" y="115" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="725" /> +<P1 x="370" y="64" id="872" /> +<P2 x="370" y="135" id="832" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="724" > +<father id="726" num="0" /> +<cdparam x="376" y="105" /> +<sizeparam width="156" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="720" /> +<TGConnectingPoint num="1" id="721" /> +<TGConnectingPoint num="2" id="722" /> +<TGConnectingPoint num="3" id="723" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="contentOfWallet(nbOfCoins)" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5103" id="737" > +<cdparam x="217" y="206" /> +<sizeparam width="69" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Send signal" value="putCoin(x)" /> +<TGConnectingPoint num="0" id="727" /> +<TGConnectingPoint num="1" id="728" /> +<TGConnectingPoint num="2" id="729" /> +<TGConnectingPoint num="3" id="730" /> +<TGConnectingPoint num="4" id="731" /> +<TGConnectingPoint num="5" id="732" /> +<TGConnectingPoint num="6" id="733" /> +<TGConnectingPoint num="7" id="734" /> +<TGConnectingPoint num="8" id="735" /> +<TGConnectingPoint num="9" id="736" /> +</COMPONENT> + +<COMPONENT type="5104" id="748" > +<cdparam x="447" y="194" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Receive signal" value="getCoin(x)" /> +<TGConnectingPoint num="0" id="738" /> +<TGConnectingPoint num="1" id="739" /> +<TGConnectingPoint num="2" id="740" /> +<TGConnectingPoint num="3" id="741" /> +<TGConnectingPoint num="4" id="742" /> +<TGConnectingPoint num="5" id="743" /> +<TGConnectingPoint num="6" id="744" /> +<TGConnectingPoint num="7" id="745" /> +<TGConnectingPoint num="8" id="746" /> +<TGConnectingPoint num="9" id="747" /> +</COMPONENT> + +<COMPONENT type="5106" id="789" > +<cdparam x="460" y="274" /> +<sizeparam width="50" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="749" /> +<TGConnectingPoint num="1" id="750" /> +<TGConnectingPoint num="2" id="751" /> +<TGConnectingPoint num="3" id="752" /> +<TGConnectingPoint num="4" id="753" /> +<TGConnectingPoint num="5" id="754" /> +<TGConnectingPoint num="6" id="755" /> +<TGConnectingPoint num="7" id="756" /> +<TGConnectingPoint num="8" id="757" /> +<TGConnectingPoint num="9" id="758" /> +<TGConnectingPoint num="10" id="759" /> +<TGConnectingPoint num="11" id="760" /> +<TGConnectingPoint num="12" id="761" /> +<TGConnectingPoint num="13" id="762" /> +<TGConnectingPoint num="14" id="763" /> +<TGConnectingPoint num="15" id="764" /> +<TGConnectingPoint num="16" id="765" /> +<TGConnectingPoint num="17" id="766" /> +<TGConnectingPoint num="18" id="767" /> +<TGConnectingPoint num="19" id="768" /> +<TGConnectingPoint num="20" id="769" /> +<TGConnectingPoint num="21" id="770" /> +<TGConnectingPoint num="22" id="771" /> +<TGConnectingPoint num="23" id="772" /> +<TGConnectingPoint num="24" id="773" /> +<TGConnectingPoint num="25" id="774" /> +<TGConnectingPoint num="26" id="775" /> +<TGConnectingPoint num="27" id="776" /> +<TGConnectingPoint num="28" id="777" /> +<TGConnectingPoint num="29" id="778" /> +<TGConnectingPoint num="30" id="779" /> +<TGConnectingPoint num="31" id="780" /> +<TGConnectingPoint num="32" id="781" /> +<TGConnectingPoint num="33" id="782" /> +<TGConnectingPoint num="34" id="783" /> +<TGConnectingPoint num="35" id="784" /> +<TGConnectingPoint num="36" id="785" /> +<TGConnectingPoint num="37" id="786" /> +<TGConnectingPoint num="38" id="787" /> +<TGConnectingPoint num="39" id="788" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="830" > +<cdparam x="227" y="300" /> +<sizeparam width="50" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="790" /> +<TGConnectingPoint num="1" id="791" /> +<TGConnectingPoint num="2" id="792" /> +<TGConnectingPoint num="3" id="793" /> +<TGConnectingPoint num="4" id="794" /> +<TGConnectingPoint num="5" id="795" /> +<TGConnectingPoint num="6" id="796" /> +<TGConnectingPoint num="7" id="797" /> +<TGConnectingPoint num="8" id="798" /> +<TGConnectingPoint num="9" id="799" /> +<TGConnectingPoint num="10" id="800" /> +<TGConnectingPoint num="11" id="801" /> +<TGConnectingPoint num="12" id="802" /> +<TGConnectingPoint num="13" id="803" /> +<TGConnectingPoint num="14" id="804" /> +<TGConnectingPoint num="15" id="805" /> +<TGConnectingPoint num="16" id="806" /> +<TGConnectingPoint num="17" id="807" /> +<TGConnectingPoint num="18" id="808" /> +<TGConnectingPoint num="19" id="809" /> +<TGConnectingPoint num="20" id="810" /> +<TGConnectingPoint num="21" id="811" /> +<TGConnectingPoint num="22" id="812" /> +<TGConnectingPoint num="23" id="813" /> +<TGConnectingPoint num="24" id="814" /> +<TGConnectingPoint num="25" id="815" /> +<TGConnectingPoint num="26" id="816" /> +<TGConnectingPoint num="27" id="817" /> +<TGConnectingPoint num="28" id="818" /> +<TGConnectingPoint num="29" id="819" /> +<TGConnectingPoint num="30" id="820" /> +<TGConnectingPoint num="31" id="821" /> +<TGConnectingPoint num="32" id="822" /> +<TGConnectingPoint num="33" id="823" /> +<TGConnectingPoint num="34" id="824" /> +<TGConnectingPoint num="35" id="825" /> +<TGConnectingPoint num="36" id="826" /> +<TGConnectingPoint num="37" id="827" /> +<TGConnectingPoint num="38" id="828" /> +<TGConnectingPoint num="39" id="829" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="871" > +<cdparam x="345" y="135" /> +<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="831" /> +<TGConnectingPoint num="1" id="832" /> +<TGConnectingPoint num="2" id="833" /> +<TGConnectingPoint num="3" id="834" /> +<TGConnectingPoint num="4" id="835" /> +<TGConnectingPoint num="5" id="836" /> +<TGConnectingPoint num="6" id="837" /> +<TGConnectingPoint num="7" id="838" /> +<TGConnectingPoint num="8" id="839" /> +<TGConnectingPoint num="9" id="840" /> +<TGConnectingPoint num="10" id="841" /> +<TGConnectingPoint num="11" id="842" /> +<TGConnectingPoint num="12" id="843" /> +<TGConnectingPoint num="13" id="844" /> +<TGConnectingPoint num="14" id="845" /> +<TGConnectingPoint num="15" id="846" /> +<TGConnectingPoint num="16" id="847" /> +<TGConnectingPoint num="17" id="848" /> +<TGConnectingPoint num="18" id="849" /> +<TGConnectingPoint num="19" id="850" /> +<TGConnectingPoint num="20" id="851" /> +<TGConnectingPoint num="21" id="852" /> +<TGConnectingPoint num="22" id="853" /> +<TGConnectingPoint num="23" id="854" /> +<TGConnectingPoint num="24" id="855" /> +<TGConnectingPoint num="25" id="856" /> +<TGConnectingPoint num="26" id="857" /> +<TGConnectingPoint num="27" id="858" /> +<TGConnectingPoint num="28" id="859" /> +<TGConnectingPoint num="29" id="860" /> +<TGConnectingPoint num="30" id="861" /> +<TGConnectingPoint num="31" id="862" /> +<TGConnectingPoint num="32" id="863" /> +<TGConnectingPoint num="33" id="864" /> +<TGConnectingPoint num="34" id="865" /> +<TGConnectingPoint num="35" id="866" /> +<TGConnectingPoint num="36" id="867" /> +<TGConnectingPoint num="37" id="868" /> +<TGConnectingPoint num="38" id="869" /> +<TGConnectingPoint num="39" id="870" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="873" > +<cdparam x="363" y="44" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="872" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +<AVATARStateMachineDiagramPanel name="CoffeeMachine" minX="10" maxX="1400" minY="10" maxY="1400" > +<CONNECTOR type="5102" id="880" > +<cdparam x="691" y="288" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="879" /> +<P1 x="699" y="289" id="1018" /> +<P2 x="699" y="316" id="990" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="878" > +<father id="880" num="0" /> +<cdparam x="691" y="328" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="874" /> +<TGConnectingPoint num="1" id="875" /> +<TGConnectingPoint num="2" id="876" /> +<TGConnectingPoint num="3" id="877" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="887" > +<cdparam x="481" y="501" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to stop state" value="null" /> +<TGConnectingPoint num="0" id="886" /> +<P1 x="437" y="525" id="1285" /> +<P2 x="323" y="748" id="1146" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="885" > +<father id="887" num="0" /> +<cdparam x="420" y="552" /> +<sizeparam width="85" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="881" /> +<TGConnectingPoint num="1" id="882" /> +<TGConnectingPoint num="2" id="883" /> +<TGConnectingPoint num="3" id="884" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="nbOfCoins = 0" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="894" > +<cdparam x="555" y="559" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="893" /> +<P1 x="321" y="455" id="1234" /> +<P2 x="437" y="495" id="1284" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="892" > +<father id="894" num="0" /> +<cdparam x="395" y="448" /> +<sizeparam width="94" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="888" /> +<TGConnectingPoint num="1" id="889" /> +<TGConnectingPoint num="2" id="890" /> +<TGConnectingPoint num="3" id="891" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="coinDelay" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="901" > +<cdparam x="355" y="545" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to stop state" value="null" /> +<TGConnectingPoint num="0" id="900" /> +<P1 x="293" y="552" id="1220" /> +<P2 x="289" y="748" id="1138" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="899" > +<father id="901" num="0" /> +<cdparam x="284" y="594" /> +<sizeparam width="228" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="895" /> +<TGConnectingPoint num="1" id="896" /> +<TGConnectingPoint num="2" id="897" /> +<TGConnectingPoint num="3" id="898" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="teaMinDelay" /> +<computeMax value="teaMaxDelay" /> +<actions value="nbOfCoins = 0" /> +<actions value="beverageReady()" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="908" > +<cdparam x="295" y="465" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="907" /> +<P1 x="288" y="475" id="1245" /> +<P2 x="293" y="522" id="1219" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="906" > +<father id="908" num="0" /> +<cdparam x="295" y="505" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="902" /> +<TGConnectingPoint num="1" id="903" /> +<TGConnectingPoint num="2" id="904" /> +<TGConnectingPoint num="3" id="905" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="915" > +<cdparam x="148" y="549" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to stop state" value="null" /> +<TGConnectingPoint num="0" id="914" /> +<P1 x="121" y="552" id="1274" /> +<P2 x="255" y="748" id="1145" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="913" > +<father id="915" num="0" /> +<cdparam x="32" y="587" /> +<sizeparam width="262" height="45" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="909" /> +<TGConnectingPoint num="1" id="910" /> +<TGConnectingPoint num="2" id="911" /> +<TGConnectingPoint num="3" id="912" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="coffeeMinDelay" /> +<computeMax value="coffeeMaxDelay" /> +<actions value="nbOfCoins = 0" /> +<actions value="beverageReady()" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="922" > +<cdparam x="229" y="465" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="921" /> +<P1 x="222" y="475" id="1244" /> +<P2 x="121" y="522" id="1273" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="920" > +<father id="922" num="0" /> +<cdparam x="229" y="505" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="916" /> +<TGConnectingPoint num="1" id="917" /> +<TGConnectingPoint num="2" id="918" /> +<TGConnectingPoint num="3" id="919" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="929" > +<cdparam x="280" y="420" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="928" /> +<P1 x="256" y="419" id="1271" /> +<P2 x="255" y="435" id="1231" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="927" > +<father id="929" num="0" /> +<cdparam x="280" y="460" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="923" /> +<TGConnectingPoint num="1" id="924" /> +<TGConnectingPoint num="2" id="925" /> +<TGConnectingPoint num="3" id="926" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="936" > +<cdparam x="667" y="346" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="935" /> +<P1 x="699" y="346" id="991" /> +<P2 x="699" y="381" id="1179" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="934" > +<father id="936" num="0" /> +<cdparam x="707" y="368" /> +<sizeparam width="85" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="930" /> +<TGConnectingPoint num="1" id="931" /> +<TGConnectingPoint num="2" id="932" /> +<TGConnectingPoint num="3" id="933" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="nbOfCoins = 0" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="943" > +<cdparam x="348" y="228" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="942" /> +<P1 x="388" y="208" id="1057" /> +<P2 x="649" y="264" id="1015" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="941" > +<father id="943" num="0" /> +<cdparam x="411" y="206" /> +<sizeparam width="94" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="937" /> +<TGConnectingPoint num="1" id="938" /> +<TGConnectingPoint num="2" id="939" /> +<TGConnectingPoint num="3" id="940" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="coinDelay" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="950" > +<cdparam x="243" y="319" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="949" /> +<P1 x="277" y="305" id="1002" /> +<P2 x="306" y="370" id="1296" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="948" > +<father id="950" num="0" /> +<cdparam x="243" y="359" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="944" /> +<TGConnectingPoint num="1" id="945" /> +<TGConnectingPoint num="2" id="946" /> +<TGConnectingPoint num="3" id="947" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="957" > +<cdparam x="270" y="224" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="956" /> +<P1 x="270" y="228" id="1067" /> +<P2 x="277" y="275" id="1001" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="955" > +<father id="957" num="0" /> +<cdparam x="270" y="264" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="951" /> +<TGConnectingPoint num="1" id="952" /> +<TGConnectingPoint num="2" id="953" /> +<TGConnectingPoint num="3" id="954" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="964" > +<cdparam x="309" y="160" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="963" /> +<P1 x="306" y="166" id="980" /> +<P2 x="309" y="188" id="1054" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="962" > +<father id="964" num="0" /> +<cdparam x="328" y="178" /> +<sizeparam width="161" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="958" /> +<TGConnectingPoint num="1" id="959" /> +<TGConnectingPoint num="2" id="960" /> +<TGConnectingPoint num="3" id="961" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +<actions value="nbOfCoins = nbOfCoins + x" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="971" > +<cdparam x="303" y="103" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="970" /> +<P1 x="303" y="103" id="1102" /> +<P2 x="306" y="136" id="979" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="969" > +<father id="971" num="0" /> +<cdparam x="303" y="143" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="965" /> +<TGConnectingPoint num="1" id="966" /> +<TGConnectingPoint num="2" id="967" /> +<TGConnectingPoint num="3" id="968" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="978" > +<cdparam x="303" y="40" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="977" /> +<P1 x="303" y="40" id="1094" /> +<P2 x="303" y="63" id="1097" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="976" > +<father id="978" num="0" /> +<cdparam x="303" y="80" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="972" /> +<TGConnectingPoint num="1" id="973" /> +<TGConnectingPoint num="2" id="974" /> +<TGConnectingPoint num="3" id="975" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5104" id="989" > +<cdparam x="268" y="141" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="Receive signal" value="getCoin(x)" /> +<TGConnectingPoint num="0" id="979" /> +<TGConnectingPoint num="1" id="980" /> +<TGConnectingPoint num="2" id="981" /> +<TGConnectingPoint num="3" id="982" /> +<TGConnectingPoint num="4" id="983" /> +<TGConnectingPoint num="5" id="984" /> +<TGConnectingPoint num="6" id="985" /> +<TGConnectingPoint num="7" id="986" /> +<TGConnectingPoint num="8" id="987" /> +<TGConnectingPoint num="9" id="988" /> +</COMPONENT> + +<COMPONENT type="5103" id="1000" > +<cdparam x="634" y="321" /> +<sizeparam width="130" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> +<TGConnectingPoint num="0" id="990" /> +<TGConnectingPoint num="1" id="991" /> +<TGConnectingPoint num="2" id="992" /> +<TGConnectingPoint num="3" id="993" /> +<TGConnectingPoint num="4" id="994" /> +<TGConnectingPoint num="5" id="995" /> +<TGConnectingPoint num="6" id="996" /> +<TGConnectingPoint num="7" id="997" /> +<TGConnectingPoint num="8" id="998" /> +<TGConnectingPoint num="9" id="999" /> +</COMPONENT> + +<COMPONENT type="5104" id="1011" > +<cdparam x="239" y="280" /> +<sizeparam width="76" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="Receive signal" value="getCoin(x)" /> +<TGConnectingPoint num="0" id="1001" /> +<TGConnectingPoint num="1" id="1002" /> +<TGConnectingPoint num="2" id="1003" /> +<TGConnectingPoint num="3" id="1004" /> +<TGConnectingPoint num="4" id="1005" /> +<TGConnectingPoint num="5" id="1006" /> +<TGConnectingPoint num="6" id="1007" /> +<TGConnectingPoint num="7" id="1008" /> +<TGConnectingPoint num="8" id="1009" /> +<TGConnectingPoint num="9" id="1010" /> +<accessibility /> +</COMPONENT> + +<COMPONENT type="5106" id="1052" > +<cdparam x="649" y="239" /> +<sizeparam width="100" height="50" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="ejectState" /> +<TGConnectingPoint num="0" id="1012" /> +<TGConnectingPoint num="1" id="1013" /> +<TGConnectingPoint num="2" id="1014" /> +<TGConnectingPoint num="3" id="1015" /> +<TGConnectingPoint num="4" id="1016" /> +<TGConnectingPoint num="5" id="1017" /> +<TGConnectingPoint num="6" id="1018" /> +<TGConnectingPoint num="7" id="1019" /> +<TGConnectingPoint num="8" id="1020" /> +<TGConnectingPoint num="9" id="1021" /> +<TGConnectingPoint num="10" id="1022" /> +<TGConnectingPoint num="11" id="1023" /> +<TGConnectingPoint num="12" id="1024" /> +<TGConnectingPoint num="13" id="1025" /> +<TGConnectingPoint num="14" id="1026" /> +<TGConnectingPoint num="15" id="1027" /> +<TGConnectingPoint num="16" id="1028" /> +<TGConnectingPoint num="17" id="1029" /> +<TGConnectingPoint num="18" id="1030" /> +<TGConnectingPoint num="19" id="1031" /> +<TGConnectingPoint num="20" id="1032" /> +<TGConnectingPoint num="21" id="1033" /> +<TGConnectingPoint num="22" id="1034" /> +<TGConnectingPoint num="23" id="1035" /> +<TGConnectingPoint num="24" id="1036" /> +<TGConnectingPoint num="25" id="1037" /> +<TGConnectingPoint num="26" id="1038" /> +<TGConnectingPoint num="27" id="1039" /> +<TGConnectingPoint num="28" id="1040" /> +<TGConnectingPoint num="29" id="1041" /> +<TGConnectingPoint num="30" id="1042" /> +<TGConnectingPoint num="31" id="1043" /> +<TGConnectingPoint num="32" id="1044" /> +<TGConnectingPoint num="33" id="1045" /> +<TGConnectingPoint num="34" id="1046" /> +<TGConnectingPoint num="35" id="1047" /> +<TGConnectingPoint num="36" id="1048" /> +<TGConnectingPoint num="37" id="1049" /> +<TGConnectingPoint num="38" id="1050" /> +<TGConnectingPoint num="39" id="1051" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1093" > +<cdparam x="231" y="188" /> +<sizeparam width="157" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="WaitingForSecondCoin" /> +<TGConnectingPoint num="0" id="1053" /> +<TGConnectingPoint num="1" id="1054" /> +<TGConnectingPoint num="2" id="1055" /> +<TGConnectingPoint num="3" id="1056" /> +<TGConnectingPoint num="4" id="1057" /> +<TGConnectingPoint num="5" id="1058" /> +<TGConnectingPoint num="6" id="1059" /> +<TGConnectingPoint num="7" id="1060" /> +<TGConnectingPoint num="8" id="1061" /> +<TGConnectingPoint num="9" id="1062" /> +<TGConnectingPoint num="10" id="1063" /> +<TGConnectingPoint num="11" id="1064" /> +<TGConnectingPoint num="12" id="1065" /> +<TGConnectingPoint num="13" id="1066" /> +<TGConnectingPoint num="14" id="1067" /> +<TGConnectingPoint num="15" id="1068" /> +<TGConnectingPoint num="16" id="1069" /> +<TGConnectingPoint num="17" id="1070" /> +<TGConnectingPoint num="18" id="1071" /> +<TGConnectingPoint num="19" id="1072" /> +<TGConnectingPoint num="20" id="1073" /> +<TGConnectingPoint num="21" id="1074" /> +<TGConnectingPoint num="22" id="1075" /> +<TGConnectingPoint num="23" id="1076" /> +<TGConnectingPoint num="24" id="1077" /> +<TGConnectingPoint num="25" id="1078" /> +<TGConnectingPoint num="26" id="1079" /> +<TGConnectingPoint num="27" id="1080" /> +<TGConnectingPoint num="28" id="1081" /> +<TGConnectingPoint num="29" id="1082" /> +<TGConnectingPoint num="30" id="1083" /> +<TGConnectingPoint num="31" id="1084" /> +<TGConnectingPoint num="32" id="1085" /> +<TGConnectingPoint num="33" id="1086" /> +<TGConnectingPoint num="34" id="1087" /> +<TGConnectingPoint num="35" id="1088" /> +<TGConnectingPoint num="36" id="1089" /> +<TGConnectingPoint num="37" id="1090" /> +<TGConnectingPoint num="38" id="1091" /> +<TGConnectingPoint num="39" id="1092" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="1095" > +<cdparam x="296" y="20" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="1094" /> +</COMPONENT> + +<COMPONENT type="5106" id="1136" > +<cdparam x="235" y="63" /> +<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="WaitingForFirstCoin" /> +<TGConnectingPoint num="0" id="1096" /> +<TGConnectingPoint num="1" id="1097" /> +<TGConnectingPoint num="2" id="1098" /> +<TGConnectingPoint num="3" id="1099" /> +<TGConnectingPoint num="4" id="1100" /> +<TGConnectingPoint num="5" id="1101" /> +<TGConnectingPoint num="6" id="1102" /> +<TGConnectingPoint num="7" id="1103" /> +<TGConnectingPoint num="8" id="1104" /> +<TGConnectingPoint num="9" id="1105" /> +<TGConnectingPoint num="10" id="1106" /> +<TGConnectingPoint num="11" id="1107" /> +<TGConnectingPoint num="12" id="1108" /> +<TGConnectingPoint num="13" id="1109" /> +<TGConnectingPoint num="14" id="1110" /> +<TGConnectingPoint num="15" id="1111" /> +<TGConnectingPoint num="16" id="1112" /> +<TGConnectingPoint num="17" id="1113" /> +<TGConnectingPoint num="18" id="1114" /> +<TGConnectingPoint num="19" id="1115" /> +<TGConnectingPoint num="20" id="1116" /> +<TGConnectingPoint num="21" id="1117" /> +<TGConnectingPoint num="22" id="1118" /> +<TGConnectingPoint num="23" id="1119" /> +<TGConnectingPoint num="24" id="1120" /> +<TGConnectingPoint num="25" id="1121" /> +<TGConnectingPoint num="26" id="1122" /> +<TGConnectingPoint num="27" id="1123" /> +<TGConnectingPoint num="28" id="1124" /> +<TGConnectingPoint num="29" id="1125" /> +<TGConnectingPoint num="30" id="1126" /> +<TGConnectingPoint num="31" id="1127" /> +<TGConnectingPoint num="32" id="1128" /> +<TGConnectingPoint num="33" id="1129" /> +<TGConnectingPoint num="34" id="1130" /> +<TGConnectingPoint num="35" id="1131" /> +<TGConnectingPoint num="36" id="1132" /> +<TGConnectingPoint num="37" id="1133" /> +<TGConnectingPoint num="38" id="1134" /> +<TGConnectingPoint num="39" id="1135" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1177" > +<cdparam x="221" y="748" /> +<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="WaitingForFirstCoin" /> +<TGConnectingPoint num="0" id="1137" /> +<TGConnectingPoint num="1" id="1138" /> +<TGConnectingPoint num="2" id="1139" /> +<TGConnectingPoint num="3" id="1140" /> +<TGConnectingPoint num="4" id="1141" /> +<TGConnectingPoint num="5" id="1142" /> +<TGConnectingPoint num="6" id="1143" /> +<TGConnectingPoint num="7" id="1144" /> +<TGConnectingPoint num="8" id="1145" /> +<TGConnectingPoint num="9" id="1146" /> +<TGConnectingPoint num="10" id="1147" /> +<TGConnectingPoint num="11" id="1148" /> +<TGConnectingPoint num="12" id="1149" /> +<TGConnectingPoint num="13" id="1150" /> +<TGConnectingPoint num="14" id="1151" /> +<TGConnectingPoint num="15" id="1152" /> +<TGConnectingPoint num="16" id="1153" /> +<TGConnectingPoint num="17" id="1154" /> +<TGConnectingPoint num="18" id="1155" /> +<TGConnectingPoint num="19" id="1156" /> +<TGConnectingPoint num="20" id="1157" /> +<TGConnectingPoint num="21" id="1158" /> +<TGConnectingPoint num="22" id="1159" /> +<TGConnectingPoint num="23" id="1160" /> +<TGConnectingPoint num="24" id="1161" /> +<TGConnectingPoint num="25" id="1162" /> +<TGConnectingPoint num="26" id="1163" /> +<TGConnectingPoint num="27" id="1164" /> +<TGConnectingPoint num="28" id="1165" /> +<TGConnectingPoint num="29" id="1166" /> +<TGConnectingPoint num="30" id="1167" /> +<TGConnectingPoint num="31" id="1168" /> +<TGConnectingPoint num="32" id="1169" /> +<TGConnectingPoint num="33" id="1170" /> +<TGConnectingPoint num="34" id="1171" /> +<TGConnectingPoint num="35" id="1172" /> +<TGConnectingPoint num="36" id="1173" /> +<TGConnectingPoint num="37" id="1174" /> +<TGConnectingPoint num="38" id="1175" /> +<TGConnectingPoint num="39" id="1176" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1218" > +<cdparam x="631" y="381" /> +<sizeparam width="137" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="WaitingForFirstCoin" /> +<TGConnectingPoint num="0" id="1178" /> +<TGConnectingPoint num="1" id="1179" /> +<TGConnectingPoint num="2" id="1180" /> +<TGConnectingPoint num="3" id="1181" /> +<TGConnectingPoint num="4" id="1182" /> +<TGConnectingPoint num="5" id="1183" /> +<TGConnectingPoint num="6" id="1184" /> +<TGConnectingPoint num="7" id="1185" /> +<TGConnectingPoint num="8" id="1186" /> +<TGConnectingPoint num="9" id="1187" /> +<TGConnectingPoint num="10" id="1188" /> +<TGConnectingPoint num="11" id="1189" /> +<TGConnectingPoint num="12" id="1190" /> +<TGConnectingPoint num="13" id="1191" /> +<TGConnectingPoint num="14" id="1192" /> +<TGConnectingPoint num="15" id="1193" /> +<TGConnectingPoint num="16" id="1194" /> +<TGConnectingPoint num="17" id="1195" /> +<TGConnectingPoint num="18" id="1196" /> +<TGConnectingPoint num="19" id="1197" /> +<TGConnectingPoint num="20" id="1198" /> +<TGConnectingPoint num="21" id="1199" /> +<TGConnectingPoint num="22" id="1200" /> +<TGConnectingPoint num="23" id="1201" /> +<TGConnectingPoint num="24" id="1202" /> +<TGConnectingPoint num="25" id="1203" /> +<TGConnectingPoint num="26" id="1204" /> +<TGConnectingPoint num="27" id="1205" /> +<TGConnectingPoint num="28" id="1206" /> +<TGConnectingPoint num="29" id="1207" /> +<TGConnectingPoint num="30" id="1208" /> +<TGConnectingPoint num="31" id="1209" /> +<TGConnectingPoint num="32" id="1210" /> +<TGConnectingPoint num="33" id="1211" /> +<TGConnectingPoint num="34" id="1212" /> +<TGConnectingPoint num="35" id="1213" /> +<TGConnectingPoint num="36" id="1214" /> +<TGConnectingPoint num="37" id="1215" /> +<TGConnectingPoint num="38" id="1216" /> +<TGConnectingPoint num="39" id="1217" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1335" > +<cdparam x="18" y="370" /> +<sizeparam width="577" height="354" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="1400" /> +<infoparam name="state0" value="Beverage" /> +<TGConnectingPoint num="0" id="1295" /> +<TGConnectingPoint num="1" id="1296" /> +<TGConnectingPoint num="2" id="1297" /> +<TGConnectingPoint num="3" id="1298" /> +<TGConnectingPoint num="4" id="1299" /> +<TGConnectingPoint num="5" id="1300" /> +<TGConnectingPoint num="6" id="1301" /> +<TGConnectingPoint num="7" id="1302" /> +<TGConnectingPoint num="8" id="1303" /> +<TGConnectingPoint num="9" id="1304" /> +<TGConnectingPoint num="10" id="1305" /> +<TGConnectingPoint num="11" id="1306" /> +<TGConnectingPoint num="12" id="1307" /> +<TGConnectingPoint num="13" id="1308" /> +<TGConnectingPoint num="14" id="1309" /> +<TGConnectingPoint num="15" id="1310" /> +<TGConnectingPoint num="16" id="1311" /> +<TGConnectingPoint num="17" id="1312" /> +<TGConnectingPoint num="18" id="1313" /> +<TGConnectingPoint num="19" id="1314" /> +<TGConnectingPoint num="20" id="1315" /> +<TGConnectingPoint num="21" id="1316" /> +<TGConnectingPoint num="22" id="1317" /> +<TGConnectingPoint num="23" id="1318" /> +<TGConnectingPoint num="24" id="1319" /> +<TGConnectingPoint num="25" id="1320" /> +<TGConnectingPoint num="26" id="1321" /> +<TGConnectingPoint num="27" id="1322" /> +<TGConnectingPoint num="28" id="1323" /> +<TGConnectingPoint num="29" id="1324" /> +<TGConnectingPoint num="30" id="1325" /> +<TGConnectingPoint num="31" id="1326" /> +<TGConnectingPoint num="32" id="1327" /> +<TGConnectingPoint num="33" id="1328" /> +<TGConnectingPoint num="34" id="1329" /> +<TGConnectingPoint num="35" id="1330" /> +<TGConnectingPoint num="36" id="1331" /> +<TGConnectingPoint num="37" id="1332" /> +<TGConnectingPoint num="38" id="1333" /> +<TGConnectingPoint num="39" id="1334" /> +<extraparam> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="5104" id="1229" > +<father id="1335" num="0" /> +<cdparam x="237" y="527" /> +<sizeparam width="112" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="465" minY="0" maxY="334" /> +<infoparam name="Send signal" value="pushTeaButton()" /> +<TGConnectingPoint num="0" id="1219" /> +<TGConnectingPoint num="1" id="1220" /> +<TGConnectingPoint num="2" id="1221" /> +<TGConnectingPoint num="3" id="1222" /> +<TGConnectingPoint num="4" id="1223" /> +<TGConnectingPoint num="5" id="1224" /> +<TGConnectingPoint num="6" id="1225" /> +<TGConnectingPoint num="7" id="1226" /> +<TGConnectingPoint num="8" id="1227" /> +<TGConnectingPoint num="9" id="1228" /> +<accessibility /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5106" id="1270" > +<father id="1335" num="1" /> +<cdparam x="189" y="435" /> +<sizeparam width="132" height="40" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="445" minY="0" maxY="314" /> +<infoparam name="state0" value="WaitingForSelection" /> +<TGConnectingPoint num="0" id="1230" /> +<TGConnectingPoint num="1" id="1231" /> +<TGConnectingPoint num="2" id="1232" /> +<TGConnectingPoint num="3" id="1233" /> +<TGConnectingPoint num="4" id="1234" /> +<TGConnectingPoint num="5" id="1235" /> +<TGConnectingPoint num="6" id="1236" /> +<TGConnectingPoint num="7" id="1237" /> +<TGConnectingPoint num="8" id="1238" /> +<TGConnectingPoint num="9" id="1239" /> +<TGConnectingPoint num="10" id="1240" /> +<TGConnectingPoint num="11" id="1241" /> +<TGConnectingPoint num="12" id="1242" /> +<TGConnectingPoint num="13" id="1243" /> +<TGConnectingPoint num="14" id="1244" /> +<TGConnectingPoint num="15" id="1245" /> +<TGConnectingPoint num="16" id="1246" /> +<TGConnectingPoint num="17" id="1247" /> +<TGConnectingPoint num="18" id="1248" /> +<TGConnectingPoint num="19" id="1249" /> +<TGConnectingPoint num="20" id="1250" /> +<TGConnectingPoint num="21" id="1251" /> +<TGConnectingPoint num="22" id="1252" /> +<TGConnectingPoint num="23" id="1253" /> +<TGConnectingPoint num="24" id="1254" /> +<TGConnectingPoint num="25" id="1255" /> +<TGConnectingPoint num="26" id="1256" /> +<TGConnectingPoint num="27" id="1257" /> +<TGConnectingPoint num="28" id="1258" /> +<TGConnectingPoint num="29" id="1259" /> +<TGConnectingPoint num="30" id="1260" /> +<TGConnectingPoint num="31" id="1261" /> +<TGConnectingPoint num="32" id="1262" /> +<TGConnectingPoint num="33" id="1263" /> +<TGConnectingPoint num="34" id="1264" /> +<TGConnectingPoint num="35" id="1265" /> +<TGConnectingPoint num="36" id="1266" /> +<TGConnectingPoint num="37" id="1267" /> +<TGConnectingPoint num="38" id="1268" /> +<TGConnectingPoint num="39" id="1269" /> +<extraparam> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="5100" id="1272" > +<father id="1335" num="2" /> +<cdparam x="249" y="399" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="562" minY="0" maxY="339" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="1271" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5104" id="1283" > +<father id="1335" num="3" /> +<cdparam x="58" y="527" /> +<sizeparam width="127" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="450" minY="0" maxY="334" /> +<infoparam name="Send signal" value="pushCoffeeButton()" /> +<TGConnectingPoint num="0" id="1273" /> +<TGConnectingPoint num="1" id="1274" /> +<TGConnectingPoint num="2" id="1275" /> +<TGConnectingPoint num="3" id="1276" /> +<TGConnectingPoint num="4" id="1277" /> +<TGConnectingPoint num="5" id="1278" /> +<TGConnectingPoint num="6" id="1279" /> +<TGConnectingPoint num="7" id="1280" /> +<TGConnectingPoint num="8" id="1281" /> +<TGConnectingPoint num="9" id="1282" /> +<accessibility /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5103" id="1294" > +<father id="1335" num="4" /> +<cdparam x="372" y="500" /> +<sizeparam width="130" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="447" minY="0" maxY="334" /> +<infoparam name="Send signal" value="ejectCoin(nbOfCoins)" /> +<TGConnectingPoint num="0" id="1284" /> +<TGConnectingPoint num="1" id="1285" /> +<TGConnectingPoint num="2" id="1286" /> +<TGConnectingPoint num="3" id="1287" /> +<TGConnectingPoint num="4" id="1288" /> +<TGConnectingPoint num="5" id="1289" /> +<TGConnectingPoint num="6" id="1290" /> +<TGConnectingPoint num="7" id="1291" /> +<TGConnectingPoint num="8" id="1292" /> +<TGConnectingPoint num="9" id="1293" /> +<accessibility /> +</SUBCOMPONENT> + + +</AVATARStateMachineDiagramPanel> + +<AVATARStateMachineDiagramPanel name="TeaButton" minX="10" maxX="1400" minY="10" maxY="900" > +<CONNECTOR type="5102" id="1342" > +<cdparam x="363" y="193" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="1341" /> +<P1 x="363" y="204" id="1358" /> +<P2 x="362" y="257" id="1369" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1340" > +<father id="1342" num="0" /> +<cdparam x="380" y="228" /> +<sizeparam width="135" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1336" /> +<TGConnectingPoint num="1" id="1337" /> +<TGConnectingPoint num="2" id="1338" /> +<TGConnectingPoint num="3" id="1339" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="mechanicalDelay" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="1349" > +<cdparam x="363" y="150" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="1348" /> +<P1 x="363" y="150" id="1415" /> +<P2 x="363" y="174" id="1357" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1347" > +<father id="1349" num="0" /> +<cdparam x="363" y="190" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1343" /> +<TGConnectingPoint num="1" id="1344" /> +<TGConnectingPoint num="2" id="1345" /> +<TGConnectingPoint num="3" id="1346" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="1356" > +<cdparam x="362" y="101" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="1355" /> +<P1 x="362" y="101" id="1450" /> +<P2 x="363" y="120" id="1410" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1354" > +<father id="1356" num="0" /> +<cdparam x="362" y="141" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1350" /> +<TGConnectingPoint num="1" id="1351" /> +<TGConnectingPoint num="2" id="1352" /> +<TGConnectingPoint num="3" id="1353" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5103" id="1367" > +<cdparam x="340" y="179" /> +<sizeparam width="46" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="Send signal" value="push()" /> +<TGConnectingPoint num="0" id="1357" /> +<TGConnectingPoint num="1" id="1358" /> +<TGConnectingPoint num="2" id="1359" /> +<TGConnectingPoint num="3" id="1360" /> +<TGConnectingPoint num="4" id="1361" /> +<TGConnectingPoint num="5" id="1362" /> +<TGConnectingPoint num="6" id="1363" /> +<TGConnectingPoint num="7" id="1364" /> +<TGConnectingPoint num="8" id="1365" /> +<TGConnectingPoint num="9" id="1366" /> +</COMPONENT> + +<COMPONENT type="5106" id="1408" > +<cdparam x="337" y="257" /> +<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="1368" /> +<TGConnectingPoint num="1" id="1369" /> +<TGConnectingPoint num="2" id="1370" /> +<TGConnectingPoint num="3" id="1371" /> +<TGConnectingPoint num="4" id="1372" /> +<TGConnectingPoint num="5" id="1373" /> +<TGConnectingPoint num="6" id="1374" /> +<TGConnectingPoint num="7" id="1375" /> +<TGConnectingPoint num="8" id="1376" /> +<TGConnectingPoint num="9" id="1377" /> +<TGConnectingPoint num="10" id="1378" /> +<TGConnectingPoint num="11" id="1379" /> +<TGConnectingPoint num="12" id="1380" /> +<TGConnectingPoint num="13" id="1381" /> +<TGConnectingPoint num="14" id="1382" /> +<TGConnectingPoint num="15" id="1383" /> +<TGConnectingPoint num="16" id="1384" /> +<TGConnectingPoint num="17" id="1385" /> +<TGConnectingPoint num="18" id="1386" /> +<TGConnectingPoint num="19" id="1387" /> +<TGConnectingPoint num="20" id="1388" /> +<TGConnectingPoint num="21" id="1389" /> +<TGConnectingPoint num="22" id="1390" /> +<TGConnectingPoint num="23" id="1391" /> +<TGConnectingPoint num="24" id="1392" /> +<TGConnectingPoint num="25" id="1393" /> +<TGConnectingPoint num="26" id="1394" /> +<TGConnectingPoint num="27" id="1395" /> +<TGConnectingPoint num="28" id="1396" /> +<TGConnectingPoint num="29" id="1397" /> +<TGConnectingPoint num="30" id="1398" /> +<TGConnectingPoint num="31" id="1399" /> +<TGConnectingPoint num="32" id="1400" /> +<TGConnectingPoint num="33" id="1401" /> +<TGConnectingPoint num="34" id="1402" /> +<TGConnectingPoint num="35" id="1403" /> +<TGConnectingPoint num="36" id="1404" /> +<TGConnectingPoint num="37" id="1405" /> +<TGConnectingPoint num="38" id="1406" /> +<TGConnectingPoint num="39" id="1407" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1449" > +<cdparam x="338" y="120" /> +<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="1409" /> +<TGConnectingPoint num="1" id="1410" /> +<TGConnectingPoint num="2" id="1411" /> +<TGConnectingPoint num="3" id="1412" /> +<TGConnectingPoint num="4" id="1413" /> +<TGConnectingPoint num="5" id="1414" /> +<TGConnectingPoint num="6" id="1415" /> +<TGConnectingPoint num="7" id="1416" /> +<TGConnectingPoint num="8" id="1417" /> +<TGConnectingPoint num="9" id="1418" /> +<TGConnectingPoint num="10" id="1419" /> +<TGConnectingPoint num="11" id="1420" /> +<TGConnectingPoint num="12" id="1421" /> +<TGConnectingPoint num="13" id="1422" /> +<TGConnectingPoint num="14" id="1423" /> +<TGConnectingPoint num="15" id="1424" /> +<TGConnectingPoint num="16" id="1425" /> +<TGConnectingPoint num="17" id="1426" /> +<TGConnectingPoint num="18" id="1427" /> +<TGConnectingPoint num="19" id="1428" /> +<TGConnectingPoint num="20" id="1429" /> +<TGConnectingPoint num="21" id="1430" /> +<TGConnectingPoint num="22" id="1431" /> +<TGConnectingPoint num="23" id="1432" /> +<TGConnectingPoint num="24" id="1433" /> +<TGConnectingPoint num="25" id="1434" /> +<TGConnectingPoint num="26" id="1435" /> +<TGConnectingPoint num="27" id="1436" /> +<TGConnectingPoint num="28" id="1437" /> +<TGConnectingPoint num="29" id="1438" /> +<TGConnectingPoint num="30" id="1439" /> +<TGConnectingPoint num="31" id="1440" /> +<TGConnectingPoint num="32" id="1441" /> +<TGConnectingPoint num="33" id="1442" /> +<TGConnectingPoint num="34" id="1443" /> +<TGConnectingPoint num="35" id="1444" /> +<TGConnectingPoint num="36" id="1445" /> +<TGConnectingPoint num="37" id="1446" /> +<TGConnectingPoint num="38" id="1447" /> +<TGConnectingPoint num="39" id="1448" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="1451" > +<cdparam x="355" y="81" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="1450" /> +</COMPONENT> + + +</AVATARStateMachineDiagramPanel> + +<AVATARStateMachineDiagramPanel name="CoffeeButton" minX="10" maxX="1400" minY="10" maxY="900" > +<CONNECTOR type="5102" id="1458" > +<cdparam x="177" y="199" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to Send signal" value="null" /> +<TGConnectingPoint num="0" id="1457" /> +<P1 x="340" y="233" id="1575" /> +<P2 x="353" y="252" id="1564" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1456" > +<father id="1458" num="0" /> +<cdparam x="177" y="239" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1452" /> +<TGConnectingPoint num="1" id="1453" /> +<TGConnectingPoint num="2" id="1454" /> +<TGConnectingPoint num="3" id="1455" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="1465" > +<cdparam x="322" y="69" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from start state to state0" value="null" /> +<TGConnectingPoint num="0" id="1464" /> +<P1 x="322" y="69" id="1562" /> +<P2 x="323" y="88" id="1522" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1463" > +<father id="1465" num="0" /> +<cdparam x="322" y="109" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1459" /> +<TGConnectingPoint num="1" id="1460" /> +<TGConnectingPoint num="2" id="1461" /> +<TGConnectingPoint num="3" id="1462" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="1472" > +<cdparam x="377" y="144" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from state0 to Send signal" value="null" /> +<TGConnectingPoint num="0" id="1471" /> +<P1 x="323" y="118" id="1527" /> +<P2 x="356" y="174" id="1578" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1470" > +<father id="1472" num="0" /> +<cdparam x="377" y="184" /> +<sizeparam width="10" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1466" /> +<TGConnectingPoint num="1" id="1467" /> +<TGConnectingPoint num="2" id="1468" /> +<TGConnectingPoint num="3" id="1469" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<CONNECTOR type="5102" id="1479" > +<cdparam x="377" y="187" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from Send signal to state0" value="null" /> +<TGConnectingPoint num="0" id="1478" /> +<P1 x="353" y="282" id="1565" /> +<P2 x="399" y="352" id="1481" /> +<AutomaticDrawing data="true" /> +</CONNECTOR><SUBCOMPONENT type="-1" id="1477" > +<father id="1479" num="0" /> +<cdparam x="417" y="335" /> +<sizeparam width="135" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="List of all parameters of an Avatar SMD transition" value="" /> +<TGConnectingPoint num="0" id="1473" /> +<TGConnectingPoint num="1" id="1474" /> +<TGConnectingPoint num="2" id="1475" /> +<TGConnectingPoint num="3" id="1476" /> +<extraparam> +<guard value="[ ]" /> +<afterMin value="mechanicalDelay" /> +<afterMax value="" /> +<computeMin value="" /> +<computeMax value="" /> +</extraparam> +</SUBCOMPONENT> + +<COMPONENT type="5106" id="1520" > +<cdparam x="374" y="352" /> +<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="1480" /> +<TGConnectingPoint num="1" id="1481" /> +<TGConnectingPoint num="2" id="1482" /> +<TGConnectingPoint num="3" id="1483" /> +<TGConnectingPoint num="4" id="1484" /> +<TGConnectingPoint num="5" id="1485" /> +<TGConnectingPoint num="6" id="1486" /> +<TGConnectingPoint num="7" id="1487" /> +<TGConnectingPoint num="8" id="1488" /> +<TGConnectingPoint num="9" id="1489" /> +<TGConnectingPoint num="10" id="1490" /> +<TGConnectingPoint num="11" id="1491" /> +<TGConnectingPoint num="12" id="1492" /> +<TGConnectingPoint num="13" id="1493" /> +<TGConnectingPoint num="14" id="1494" /> +<TGConnectingPoint num="15" id="1495" /> +<TGConnectingPoint num="16" id="1496" /> +<TGConnectingPoint num="17" id="1497" /> +<TGConnectingPoint num="18" id="1498" /> +<TGConnectingPoint num="19" id="1499" /> +<TGConnectingPoint num="20" id="1500" /> +<TGConnectingPoint num="21" id="1501" /> +<TGConnectingPoint num="22" id="1502" /> +<TGConnectingPoint num="23" id="1503" /> +<TGConnectingPoint num="24" id="1504" /> +<TGConnectingPoint num="25" id="1505" /> +<TGConnectingPoint num="26" id="1506" /> +<TGConnectingPoint num="27" id="1507" /> +<TGConnectingPoint num="28" id="1508" /> +<TGConnectingPoint num="29" id="1509" /> +<TGConnectingPoint num="30" id="1510" /> +<TGConnectingPoint num="31" id="1511" /> +<TGConnectingPoint num="32" id="1512" /> +<TGConnectingPoint num="33" id="1513" /> +<TGConnectingPoint num="34" id="1514" /> +<TGConnectingPoint num="35" id="1515" /> +<TGConnectingPoint num="36" id="1516" /> +<TGConnectingPoint num="37" id="1517" /> +<TGConnectingPoint num="38" id="1518" /> +<TGConnectingPoint num="39" id="1519" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5106" id="1561" > +<cdparam x="298" y="88" /> +<sizeparam width="50" height="30" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="main" /> +<TGConnectingPoint num="0" id="1521" /> +<TGConnectingPoint num="1" id="1522" /> +<TGConnectingPoint num="2" id="1523" /> +<TGConnectingPoint num="3" id="1524" /> +<TGConnectingPoint num="4" id="1525" /> +<TGConnectingPoint num="5" id="1526" /> +<TGConnectingPoint num="6" id="1527" /> +<TGConnectingPoint num="7" id="1528" /> +<TGConnectingPoint num="8" id="1529" /> +<TGConnectingPoint num="9" id="1530" /> +<TGConnectingPoint num="10" id="1531" /> +<TGConnectingPoint num="11" id="1532" /> +<TGConnectingPoint num="12" id="1533" /> +<TGConnectingPoint num="13" id="1534" /> +<TGConnectingPoint num="14" id="1535" /> +<TGConnectingPoint num="15" id="1536" /> +<TGConnectingPoint num="16" id="1537" /> +<TGConnectingPoint num="17" id="1538" /> +<TGConnectingPoint num="18" id="1539" /> +<TGConnectingPoint num="19" id="1540" /> +<TGConnectingPoint num="20" id="1541" /> +<TGConnectingPoint num="21" id="1542" /> +<TGConnectingPoint num="22" id="1543" /> +<TGConnectingPoint num="23" id="1544" /> +<TGConnectingPoint num="24" id="1545" /> +<TGConnectingPoint num="25" id="1546" /> +<TGConnectingPoint num="26" id="1547" /> +<TGConnectingPoint num="27" id="1548" /> +<TGConnectingPoint num="28" id="1549" /> +<TGConnectingPoint num="29" id="1550" /> +<TGConnectingPoint num="30" id="1551" /> +<TGConnectingPoint num="31" id="1552" /> +<TGConnectingPoint num="32" id="1553" /> +<TGConnectingPoint num="33" id="1554" /> +<TGConnectingPoint num="34" id="1555" /> +<TGConnectingPoint num="35" id="1556" /> +<TGConnectingPoint num="36" id="1557" /> +<TGConnectingPoint num="37" id="1558" /> +<TGConnectingPoint num="38" id="1559" /> +<TGConnectingPoint num="39" id="1560" /> +<extraparam> +</extraparam> +</COMPONENT> + +<COMPONENT type="5100" id="1563" > +<cdparam x="315" y="49" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="1562" /> +</COMPONENT> + +<COMPONENT type="5106" id="1617" > +<cdparam x="264" y="174" /> +<sizeparam width="184" height="130" minWidth="40" minHeight="30" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> +<infoparam name="state0" value="state0" /> +<TGConnectingPoint num="0" id="1577" /> +<TGConnectingPoint num="1" id="1578" /> +<TGConnectingPoint num="2" id="1579" /> +<TGConnectingPoint num="3" id="1580" /> +<TGConnectingPoint num="4" id="1581" /> +<TGConnectingPoint num="5" id="1582" /> +<TGConnectingPoint num="6" id="1583" /> +<TGConnectingPoint num="7" id="1584" /> +<TGConnectingPoint num="8" id="1585" /> +<TGConnectingPoint num="9" id="1586" /> +<TGConnectingPoint num="10" id="1587" /> +<TGConnectingPoint num="11" id="1588" /> +<TGConnectingPoint num="12" id="1589" /> +<TGConnectingPoint num="13" id="1590" /> +<TGConnectingPoint num="14" id="1591" /> +<TGConnectingPoint num="15" id="1592" /> +<TGConnectingPoint num="16" id="1593" /> +<TGConnectingPoint num="17" id="1594" /> +<TGConnectingPoint num="18" id="1595" /> +<TGConnectingPoint num="19" id="1596" /> +<TGConnectingPoint num="20" id="1597" /> +<TGConnectingPoint num="21" id="1598" /> +<TGConnectingPoint num="22" id="1599" /> +<TGConnectingPoint num="23" id="1600" /> +<TGConnectingPoint num="24" id="1601" /> +<TGConnectingPoint num="25" id="1602" /> +<TGConnectingPoint num="26" id="1603" /> +<TGConnectingPoint num="27" id="1604" /> +<TGConnectingPoint num="28" id="1605" /> +<TGConnectingPoint num="29" id="1606" /> +<TGConnectingPoint num="30" id="1607" /> +<TGConnectingPoint num="31" id="1608" /> +<TGConnectingPoint num="32" id="1609" /> +<TGConnectingPoint num="33" id="1610" /> +<TGConnectingPoint num="34" id="1611" /> +<TGConnectingPoint num="35" id="1612" /> +<TGConnectingPoint num="36" id="1613" /> +<TGConnectingPoint num="37" id="1614" /> +<TGConnectingPoint num="38" id="1615" /> +<TGConnectingPoint num="39" id="1616" /> +<extraparam> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="5103" id="1574" > +<father id="1617" num="0" /> +<cdparam x="330" y="257" /> +<sizeparam width="46" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="138" minY="0" maxY="110" /> +<infoparam name="Send signal" value="push()" /> +<TGConnectingPoint num="0" id="1564" /> +<TGConnectingPoint num="1" id="1565" /> +<TGConnectingPoint num="2" id="1566" /> +<TGConnectingPoint num="3" id="1567" /> +<TGConnectingPoint num="4" id="1568" /> +<TGConnectingPoint num="5" id="1569" /> +<TGConnectingPoint num="6" id="1570" /> +<TGConnectingPoint num="7" id="1571" /> +<TGConnectingPoint num="8" id="1572" /> +<TGConnectingPoint num="9" id="1573" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="5100" id="1576" > +<father id="1617" num="1" /> +<cdparam x="333" y="213" /> +<sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="0" maxX="169" minY="0" maxY="115" /> +<infoparam name="start state" value="null" /> +<TGConnectingPoint num="0" id="1575" /> +</SUBCOMPONENT> + + +</AVATARStateMachineDiagramPanel> + +</Modeling> + + + + +</TURTLEGMODELING> \ No newline at end of file diff --git a/modeling/CoffeeMachine_Avatar.ttool/project_config.xml b/modeling/CoffeeMachine_Avatar.ttool/project_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a4ea4bee78d5fccbdb3490bbbadc70928abe99a --- /dev/null +++ b/modeling/CoffeeMachine_Avatar.ttool/project_config.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<PROJECTCONFIGURATION> +<LastVCD data=""/> +<LastOpenDiagram tab="1" panel="0" /> +</PROJECTCONFIGURATION> diff --git a/modeling/Blinking.ttool/.DS_Store b/modeling/MBED_Blinking.ttool/.DS_Store similarity index 99% rename from modeling/Blinking.ttool/.DS_Store rename to modeling/MBED_Blinking.ttool/.DS_Store index 3d80fdc18f9bbdda3d4204f0c2fb3cf1184ac822..a919fbab06a2a52b760c77aa7c12e4961e5ba9ff 100644 Binary files a/modeling/Blinking.ttool/.DS_Store and b/modeling/MBED_Blinking.ttool/.DS_Store differ diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/.DS_Store b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/.DS_Store similarity index 69% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/.DS_Store rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..47f4c3b5fcd113ad7025b8f9f1177026523c5c98 100644 Binary files a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/.DS_Store and b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/.DS_Store differ diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/LICENSE rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_ENG diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/LICENSE_CECILL_FR diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/Makefile rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.defs b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.defs similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/Makefile.defs rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.defs diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.forsoclib diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.soclib b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.soclib similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/Makefile.soclib rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.soclib diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/Makefile.src b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.src similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/Makefile.src rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/Makefile.src diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp similarity index 90% rename from modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp index 3f178c74f04814b3c7e6f112e7d33511d268f082..9eafaff4a6d7c33d132e1bd7a941b41909e5754b 100644 --- a/modeling/Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.c +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.cpp @@ -35,7 +35,7 @@ void MainBlock__LED1off(int x) { } -void *mainFunc__MainBlock(void *arg){ +void mainFunc__MainBlock(){ int period = 2; int x = 0; @@ -45,14 +45,12 @@ void *mainFunc__MainBlock(void *arg){ __attribute__((unused)) request __req1; __attribute__((unused))int *__params1[0]; __attribute__((unused))setOfRequests __list; - __attribute__((unused))pthread_cond_t __myCond; + __attribute__((unused))size_t __myCond; __attribute__((unused))request *__returnRequest; - char * __myname = (char *)arg; + char * __myname = "mainFunc__MainBlock"; - pthread_cond_init(&__myCond, NULL); - - fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex); + fillListOfRequests(&__list, __myname, NULL, __myCond, &__mainMutex); //printf("my name = %s\n", __myname); /* Main loop on states */ @@ -65,7 +63,7 @@ void *mainFunc__MainBlock(void *arg){ case STATE__Led1on: traceStateEntering(__myname, "Led1on"); - waitFor((period)*1000000, (period)*1000000); + wait_us((period)*1000000); x = x+1; traceVariableModification("MainBlock", "x", x,0); MainBlock__LED1off(x); @@ -104,6 +102,6 @@ void *mainFunc__MainBlock(void *arg){ } } //printf("Exiting = %s\n", __myname); - return NULL; + return ; } diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h similarity index 66% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h index 07444898d21d3af927e8f9e1b14973c95676c1fe..7ebb3d7f840f3dad81ba985ee1fe1a12c74222c5 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/MainBlock.h +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/MainBlock.h @@ -1,12 +1,12 @@ #ifndef MainBlock_H #define MainBlock_H -#include <stdio.h> -#include <pthread.h> -#include <unistd.h> -#include <stdlib.h> +#include <mbed.h> +#include <rtos.h> #include "request.h" #include "syncchannel.h" +#include "asyncchannel.h" +#include "message.h" #include "request_manager.h" #include "debug.h" #include "defs.h" @@ -15,6 +15,6 @@ #include "tracemanager.h" #include "main.h" -extern void *mainFunc__MainBlock(void *arg); +extern void mainFunc__MainBlock(); #endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.cpp similarity index 68% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.cpp index 6c2b919b3bdbb20586263514f6425a33c489dea7..f94a1c5340eef2ff7aad5d0632ca911917c5a945 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/main.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.cpp @@ -1,7 +1,12 @@ #include <mbed.h> #include <rtos.h> - +#include "request.h" +#include "syncchannel.h" +#include "request_manager.h" +#include "debug.h" +#include "random.h" +#include "tracemanager.h" /* User code */ void __user_init() { @@ -16,10 +21,8 @@ rtos::Mutex __mainMutex; rtos::Mutex __concurrencyMutex; /* Synchronous channels */ -syncchannel __MainBlock_RandVal__SecondaryBlock_RanVal; /* Asynchronous channels */ -#include "SecondaryBlock.h" #include "MainBlock.h" @@ -29,12 +32,9 @@ int main(int argc, char *argv[]) { setvbuf(stdout, (char*)NULL, _IONBF, 0); /* Synchronous channels */ - __MainBlock_RandVal__SecondaryBlock_RanVal.inname ="RandVal"; - __MainBlock_RandVal__SecondaryBlock_RanVal.outname ="RanVal"; /* Asynchronous channels */ /* Threads of tasks */ - rtos::Thread thread__SecondaryBlock; rtos::Thread thread__MainBlock; /* Activating tracing */ /* Activating randomness */ @@ -43,11 +43,9 @@ int main(int argc, char *argv[]) { __user_init(); - thread__SecondaryBlock.start(mainFunc__SecondaryBlock); thread__MainBlock.start(mainFunc__MainBlock); - thread__SecondaryBlock.join(); thread__MainBlock.join(); diff --git a/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.h new file mode 100644 index 0000000000000000000000000000000000000000..e481b812809138b756b34eb8496c4d8ca4aab207 --- /dev/null +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/generated_src/main.h @@ -0,0 +1,12 @@ +#ifndef MAIN_H +#define MAIN_H +/* Main mutex */ +extern rtos::Mutex __mainMutex; + +/* ConcurrencyMutex mutex */ +extern rtos::Mutex __concurrencyMutex; + +/* TTOOL original generator */ +/* Synchronous channels */ +/* Asynchronous channels */ +#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/.DS_Store b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/.DS_Store similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/generated_src/.DS_Store rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/.DS_Store diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp similarity index 98% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp index 40c52ac0f1d127c8ac5e1ef4b39d7d58d2400130..cf02f9d230a168b45bd8ab65d5c3562f446c5e52 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.cpp @@ -1,7 +1,8 @@ #include "message.h" #include "asyncchannel.h" #include "myerrors.h" -#include "mbed.h" +#include <mbed.h> + asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) { asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel))); diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h similarity index 99% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h index 8f812359dbd67311f37391807b883890ee163f04..0de5484f17fd8d537cfbf8aae7dc0a23b83637b0 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/asyncchannel.h @@ -7,6 +7,8 @@ struct asyncchannel; #include "request.h" + + struct asyncchannel { char *outname; char *inname; diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/debug.cpp similarity index 72% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/debug.cpp index 067d0a8c17e3861ce60191884c13041d9e88431b..98d62d71c1080e057e68ee420d51046136aa6fdb 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/debug.c +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/debug.cpp @@ -1,25 +1,28 @@ -#include <stdlib.h> -#include <stdio.h> +//#include <stdlib.h> +//#include <stdio.h> #include <time.h> -#include "debug.h" - - #define DEBUG_ON 1 #define DEBUG_OFF 2 +//Serial pc(USBTX,USBRX); + +#include <mbed.h> +#include "debug.h" -int debug = DEBUG_OFF; +int _debug = DEBUG_OFF; void activeDebug() { - debug = DEBUG_ON; + _debug = DEBUG_ON; + printf("Modo debug activado"); } void unactiveDebug() { - debug = DEBUG_OFF; + _debug = DEBUG_OFF; + printf("Modo debug desactivado"); } void debugThreeInts(char *msg, int value1, int value2, int value3) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -29,7 +32,7 @@ void debugThreeInts(char *msg, int value1, int value2, int value3) { } void debugTwoInts(char *msg, int value1, int value2) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -39,7 +42,7 @@ void debugTwoInts(char *msg, int value1, int value2) { } void debugInt(char *msg, int value) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -49,7 +52,7 @@ void debugInt(char *msg, int value) { } void debugLong(char *msg, long value) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -59,7 +62,7 @@ void debugLong(char *msg, long value) { } void debugMsg(char *msg) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -69,7 +72,7 @@ void debugMsg(char *msg) { } void debug2Msg(char *name, char *msg) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } @@ -79,7 +82,7 @@ void debug2Msg(char *name, char *msg) { } void debugTime(char *msg, struct timespec *ts) { - if (debug == DEBUG_OFF) { + if (_debug == DEBUG_OFF) { return; } printf("DT> (-------t------->) %s sec=%ld nsec=%ld\n", msg, ts->tv_sec, ts->tv_nsec); diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/debug.h similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/debug.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/debug.h diff --git a/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/defs.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/defs.h new file mode 100644 index 0000000000000000000000000000000000000000..a8d6a631b78aacef5966b5aca89ba9cb0512189d --- /dev/null +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/defs.h @@ -0,0 +1,9 @@ +#ifndef DEFS_H +#define DEFS_H + +//#define bool int +//#define true 1 +//#define false 0 + + +#endif diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/message.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/message.cpp similarity index 98% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/message.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/message.cpp index bfb14536b70611e03017303e8b31197f0c264de8..86d1ebf3c9e66ef85e788de95c3e5787d7246001 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/message.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/message.cpp @@ -8,6 +8,7 @@ #include <Mutex.h> #include <mbed.h> +#include <Thread.h> long __id_message = 0; rtos::Mutex __message_mutex; diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/message.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/message.h similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/message.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/message.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp similarity index 76% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp index dfe16a1c469f6e11382dfae037b3d4ff89cf8c7b..2a73c4b8e22791f66d7fc5e1256ce55f9f99b95b 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src/myerrors.c +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/myerrors.cpp @@ -1,9 +1,9 @@ -#include <stdlib.h> -#include <stdio.h> +//#include <stdlib.h> +//#include <stdio.h> #include "myerrors.h" - - +#include <mbed.h> +//Serial pc(USBTX,USBRX); void criticalErrorInt(char *msg, int value) { diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/myerrors.h similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/src/myerrors.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/myerrors.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp similarity index 94% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp index f24986a16ca60213cd251d498ec65656bee275ca..89c7f175da6a07d65a6f43037c4f1cae0a1720f5 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/mytimelib.cpp @@ -1,4 +1,4 @@ -//#include<time.h> +#include <time.h> #include "mytimelib.h" #include "random.h" @@ -103,7 +103,7 @@ void delayToTimeSpec(struct timespec *ts, long delay) { void waitFor(long minDelay, long maxDelay) { struct timespec tssrc; - struct timespec tsret; + //struct timespec tsret; int delay; @@ -118,11 +118,7 @@ void waitFor(long minDelay, long maxDelay) { delayToTimeSpec(&tssrc, delay); debugLong("............. waiting For", delay); - if(tssrc.tv_nsec > tsret.tv_nsec){ - wait_us(tsret.tv_nsec/1000); - }else{ - wait_us(tssrc.tv_nsec/1000); - } + wait_us(delay); debugLong("............. waiting Done for: ", delay); } diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/mytimelib.h similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/mytimelib.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/mytimelib.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/random.cpp similarity index 97% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/random.cpp index 4a5df9dd59e1b3dfa0cbf8c9fa924ca094b1e243..0022ae2f1354b854c853b664b10aa99e0c62b4da 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/random.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/random.cpp @@ -1,7 +1,7 @@ //#include <stdlib.h> //#include <unistd.h> -//#include <time.h> +#include <time.h> //#include <limits.h> #include "random.h" diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/random.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/random.h similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/src/random.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/random.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.cpp similarity index 99% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.cpp index 86e78bb3828ff7425abcd85eb1161766f8691513..3d7d900bdba1f5bf7b0257a66509ae635782a787 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.cpp @@ -4,6 +4,7 @@ #include <mbed.h> #include <Mutex.h> +#include <Thread.h> #include "request.h" #include "mytimelib.h" diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.h similarity index 97% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.h index 3d0172fcde1b431834991231a73b8352b730228c..416e392aaf69cb0b8a3345b3bd59b917f51872d7 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request.h +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request.h @@ -12,6 +12,7 @@ struct request; #include "asyncchannel.h" #include "message.h" + #define SEND_SYNC_REQUEST 0 #define RECEIVE_SYNC_REQUEST 2 #define SEND_ASYNC_REQUEST 4 @@ -87,7 +88,7 @@ void copyParameters(request *src, request *dst); setOfRequests *newListOfRequests(size_t *wakeupCondition, rtos::Mutex *mutex); void addRequestToList(setOfRequests *list, request* req); void clearListOfRequests(setOfRequests *list); -void fillListOfRequests(setOfRequests *list, char *name, rtos::Thread* thread, size_t *wakeupCondition, rtos::Mutex *mutex); +void fillListOfRequests(setOfRequests *list, char *name, rtos::Thread* thread, size_t wakeupCondition, rtos::Mutex *mutex); void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne); request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list); diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp similarity index 98% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp index 76b27cf68d513c10ba70e8b22dd420dfa9fa4537..4f0bec57ff796946b3c64473548b60c0fc05ea89 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request_manager.cpp @@ -31,7 +31,7 @@ void executeSendSyncTransaction(request *req) { currentReq = currentReq->next; } - cpt = random() % cpt; + cpt = rand() % cpt; // Head of the list? selectedReq = req->syncChannel->inWaitQueue; @@ -77,7 +77,7 @@ void executeReceiveSyncTransaction(request *req) { //debugInt("cpt", cpt); currentReq = currentReq->next; } - cpt = random() % cpt; + cpt = rand() % cpt; selectedReq = req->syncChannel->outWaitQueue; while (cpt > 0) { selectedReq = selectedReq->next; @@ -171,7 +171,7 @@ void executeSendBroadcastTransaction(request *req) { if (tmpreq != NULL) { // Must select one of the two // If =1, replace, otherwise, just do nothing - cpt = random() % 2; + cpt = rand() % 2; if (cpt == 1) { debugMsg("Replacing broadcast request"); req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest); @@ -557,11 +557,11 @@ request *executeListOfRequests(setOfRequests *list) { debug2Msg(list->ownerName, "Waiting for a request and at most for a given time"); debugTime("Min time to wait=", &(list->minTimeToWait)); //pthread_cond_timedwait(list->wakeupCondition, list->mutex, &(list->minTimeToWait)); - osEvent event = rtos::Thread::signal_wait(list->wakeupCondition, list->minTimeToWait.tv_sec*1000); + osEvent event = rtos::Thread::signal_wait(list->wakeupCondition, list->minTimeToWait.tv_sec); } else { debug2Msg(list->ownerName, "Releasing mutex"); //pthread_cond_wait(list->wakeupCondition, list->mutex); - osEvent event = rtos::Thread::signal_wait(list->wakeupCondition); + osEvent event = rtos::Thread::signal_wait(list->wakeupCondition); } debug2Msg(list->ownerName, "Waking up for requests! -> getting mutex"); } diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request_manager.h similarity index 100% rename from modeling/Blinking.ttool/AVATAR_executablecode/src/request_manager.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/request_manager.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp similarity index 89% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp index 7b81f8a91f0e7b5f02a3aeabd19d50f5d556c452..9e52a0f36b2bb32d61aadac47f9187948c522f66 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/syncchannel.cpp @@ -10,14 +10,15 @@ syncchannel *getNewSyncchannel(char *outname, char *inname) { syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel))); + //syncchannel * syncch = NULL; if (syncch == NULL) { criticalError("Allocation of request failed"); } syncch->inname = inname; syncch->outname = outname; - syncch->inWaitQueue = (request*)NULL; - syncch->outWaitQueue = (request*)NULL; + //syncch->inWaitQueue = (request*)NULL; + //syncch->outWaitQueue = (request*)NULL; syncch->isBroadcast = false; return syncch; } diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/syncchannel.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/syncchannel.h similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/syncchannel.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/syncchannel.h diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp similarity index 76% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp index acaf473b95277d952c0bedb66d9f899eecc8d9db..ffd40967f6280bb3b2933cd5ac7c6ff8e7506b3d 100644 --- a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp +++ b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/tracemanager.cpp @@ -2,10 +2,15 @@ //#include <stdio.h> //#include <time.h> +#include <mbed.h> +#include <Thread.h> +#include <Mutex.h> +#include <time.h> + #include "tracemanager.h" #include "debug.h" #include "mytimelib.h" -#include <Mutex.h> + #define TRACE_OFF 0 @@ -248,6 +253,7 @@ void traceAsynchronousReceiveRequest(request *req) { void traceRequest(char *myname, request *req) { char s[1024]; int i; + //printf("Calling tracerequest of type %s\n", req->type); debugMsg("Trace request"); @@ -261,40 +267,46 @@ void traceRequest(char *myname, request *req) { switch(req->type) { case SEND_SYNC_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname); - for(i=0; i<req->nbOfParams; i++) { - if (i>0) { - sprintf(s, "%s,", s); + debug2Msg("Sync channel", req->syncChannel->outname); + sprintf(s, "block=%s type=send_synchro channel=%s params=", myname, req->syncChannel->outname); + for(i=0; i<req->nbOfParams; i++) { + if (i>0) { + sprintf(s, "%s,", s); + } + sprintf(s, "%s%d", s, *(req->params[i])); } - sprintf(s, "%s%d", s, *(req->params[i])); - } - sprintf(s, "%s\n", s); - - break; - case RECEIVE_SYNC_REQUEST: - sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname); - break; + sprintf(s, "%s\n", s); + + break; + case RECEIVE_SYNC_REQUEST: + + sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname); + break; case SEND_ASYNC_REQUEST: - debug2Msg("Async channel", req->asyncChannel->outname); - sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname); - break; - case RECEIVE_ASYNC_REQUEST: - sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname); - break; - case SEND_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case RECEIVE_BROADCAST_REQUEST: - debug2Msg("Sync channel", req->syncChannel->outname); - sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname); - break; - case IMMEDIATE: - sprintf(s, "block=%s type=action\n", myname); - break; - default: - sprintf(s, "block=%s type=unknown\n", myname); + debug2Msg("Async channel", req->asyncChannel->outname); + sprintf(s, "block=%s type=send_async_2 channel=%s\n", myname, req->asyncChannel->outname); + break; + case RECEIVE_ASYNC_REQUEST: + + sprintf(s, "block=%s type=receive_async_2 channel=%s\n", myname, req->asyncChannel->inname); + break; + case SEND_BROADCAST_REQUEST: + + debug2Msg("Sync channel", req->syncChannel->outname); + sprintf(s, "block=%s type=send_broadcast channel=%s\n", myname, req->syncChannel->outname); + break; + case RECEIVE_BROADCAST_REQUEST: + + debug2Msg("Sync channel", req->syncChannel->outname); + sprintf(s, "block=%s type=receive_broadcast channel=%s\n", myname, req->syncChannel->outname); + break; + case IMMEDIATE: + + sprintf(s, "block=%s type=action\n", myname); + break; + default: + + sprintf(s, "block=%s type=unknown\n", myname); } debugMsg("Trace request 2"); diff --git a/modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/tracemanager.h b/modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/tracemanager.h similarity index 100% rename from modeling/BlinkingLed.ttool/AVATAR_executablecode/src_MBED/tracemanager.h rename to modeling/MBED_Blinking.ttool/AVATAR_executablecode/src_MBED/tracemanager.h diff --git a/modeling/Blinking.ttool/Blinking.xml b/modeling/MBED_Blinking.ttool/MBED_Blinking.xml similarity index 100% rename from modeling/Blinking.ttool/Blinking.xml rename to modeling/MBED_Blinking.ttool/MBED_Blinking.xml diff --git a/modeling/MBED_Blinking.ttool/project_config.xml b/modeling/MBED_Blinking.ttool/project_config.xml new file mode 100644 index 0000000000000000000000000000000000000000..45d7a5f955224b152dc57ad1e4b9b9b58ca0561c --- /dev/null +++ b/modeling/MBED_Blinking.ttool/project_config.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> + +<PROJECTCONFIGURATION> +<LastVCD data=""/> +<LastOpenDiagram tab="0" panel="0" /> +</PROJECTCONFIGURATION> diff --git a/modeling/BlinkingLed.ttool/.DS_Store b/src/.DS_Store similarity index 68% rename from modeling/BlinkingLed.ttool/.DS_Store rename to src/.DS_Store index 057b6bcfcf3b5b2773f468d6f624b76c99be538f..3824c8784dd74b77e01a7db01da3ab41c3f474e4 100644 Binary files a/modeling/BlinkingLed.ttool/.DS_Store and b/src/.DS_Store differ diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7cf37b4b2a3334aea0980c37eb52c794f4da5b9f Binary files /dev/null and b/src/main/.DS_Store differ diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b3fe45f7f90ffcfaf8990372237c15cfc1f2ab69 Binary files /dev/null and b/src/main/java/.DS_Store differ diff --git a/modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store b/src/main/java/avatartranslator/.DS_Store similarity index 63% rename from modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store rename to src/main/java/avatartranslator/.DS_Store index d815fae9a2c44ac21c8a818d607cd57d404b3dda..d1edf0109a4bd6eab476277377ecf6e2b9de6e36 100644 Binary files a/modeling/Blinking.ttool/AVATAR_executablecode/.DS_Store and b/src/main/java/avatartranslator/.DS_Store differ diff --git a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.java b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.java old mode 100644 new mode 100755 index d58c4fce8020c03f041b301a30f7f9721334be79..1d602714d1587717748292bf8f0ec2603f13a339 --- a/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.java +++ b/src/main/java/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.java @@ -37,8 +37,6 @@ */ - - package avatartranslator.toexecutable; import avatartranslator.*; @@ -50,9 +48,10 @@ import java.util.Vector; /** * Class AVATAR2CPOSIXArduino - * Creation: 05/11/2017 - * @version 2 17/11/2017 - * @author Berkay KOKSAL + * Creation: 05/11/2017 by Berkey Koksal + * + * Developed by : Dhiaeddine ALIOUI + * @version 3 15/11/2018 */ public class AVATAR2CPOSIXArduino { @@ -72,8 +71,7 @@ public class AVATAR2CPOSIXArduino { private MainFile mainFile; private MainFile_Arduino mainFile_Arduino; - - private Vector<TaskFile> taskFiles; + private String makefile_src; private String makefile_SocLib; @@ -108,23 +106,12 @@ public class AVATAR2CPOSIXArduino { TraceManager.addDev("Generating files"); if (mainFile_Arduino != null) { - TraceManager.addDev("Generating main files in " + path + mainFile_Arduino.getName() + ".h"); - FileUtils.saveFile(path + GENERATED_PATH + mainFile_Arduino.getName() + ".h", Conversion.indentString(mainFile_Arduino.getHeaderCode(), 2)); - FileUtils.saveFile(path + GENERATED_PATH + mainFile_Arduino.getName() + ".ino", Conversion.indentString(mainFile_Arduino.getMainCode(), 2)); + TraceManager.addDev("Generating main files in " + path + mainFile_Arduino.getName() + ".ino"); + FileUtils.saveFile(path + GENERATED_PATH + mainFile_Arduino.getName() + ".ino", + Conversion.indentString(mainFile_Arduino.getAllCode(), 2)); } - for(TaskFile taskFile: taskFiles) { - FileUtils.saveFile(path + GENERATED_PATH + taskFile.getName() + ".h", Conversion.indentString(taskFile.getFullHeaderCode(), 2)); - FileUtils.saveFile(path + GENERATED_PATH + taskFile.getName() + ".c", Conversion.indentString(taskFile.getMainCode(), 2)); - } - - // Standard Makefile - makeMakefileSrc(GENERATED_PATH); - FileUtils.saveFile(path + "Makefile.src", makefile_src); - // Makefile for SocLib - makeMakefileSocLib(); - FileUtils.saveFile(path + "Makefile.soclib", makefile_SocLib); } @@ -132,182 +119,125 @@ public class AVATAR2CPOSIXArduino { return warnings; } - + public void generateArduinoCode(boolean _debug, boolean _tracing) { + debug = _debug; tracing = _tracing; - - mainFile_Arduino = new MainFile_Arduino("mainArduino", plugin); - taskFiles = new Vector<TaskFile>(); + + mainFile_Arduino = new MainFile_Arduino("mainArduino"); avspec.removeCompositeStates(); - avspec.removeLibraryFunctionCalls (); + avspec.removeLibraryFunctionCalls(); avspec.removeTimers(); if (avspec.hasApplicationCode() && includeUserCode) { - mainFile_Arduino.appendToBeforeMainCode("/* User code */\n"); - mainFile_Arduino.appendToBeforeMainCode(avspec.getApplicationCode()); - mainFile_Arduino.appendToBeforeMainCode("\n/* End of User code */\n\n"); + mainFile_Arduino.appendToBeforeSetupCode("/* User code */\n"); + mainFile_Arduino.appendToBeforeSetupCode(avspec.getApplicationCode()); + mainFile_Arduino.appendToBeforeSetupCode("\n/* End of User code */\n"); } - //makeMainMutex(); - - //makeSynchronousChannels(); - - //makeAsynchronousChannels(); - - //makeTasks(); - - //makeMainHeader(); - - //makeThreadsInMain(_debug); - - makeMainFile(); - - } - - - public void makeMainMutex() { - // Create a main mutex - mainFile_Arduino.appendToHCode("/* Main mutex */" + CR); - mainFile_Arduino.appendToBeforeMainCode("/* Main mutex */" + CR); - mainFile_Arduino.appendToHCode("extern pthread_mutex_t __mainMutex;" + CR + CR); - mainFile_Arduino.appendToBeforeMainCode("pthread_mutex_t __mainMutex;" + CR + CR); + makeTasks(); - } - public void makeMainFile() { - // Create a main mutex - mainFile_Arduino.appendToBeforeMainCode("void setup() {\n// initialize a port to work with on arduino\nSerial.begin(9600);\n}" + CR); - mainFile_Arduino.appendToMainCode("void loop() {\n//Code Comes Here\nSerial.print(\"Hello world from generated code\");\n}"); - } - - public void makeSynchronousChannels() { - - // Create a synchronous channel per relation/signal - mainFile_Arduino.appendToHCode("/* Berkay Koksal implemented Arduino Code Generation */" + CR); - mainFile_Arduino.appendToHCode("/* Synchronous channels */" + CR); - mainFile_Arduino.appendToBeforeMainCode("/* Synchronous channels */" + CR); - mainFile_Arduino.appendToMainCode("/* Synchronous channels */" + CR); - for(AvatarRelation ar: avspec.getRelations()) { - if (!ar.isAsynchronous()) { - for(int i=0; i<ar.nbOfSignals(); i++) { - mainFile_Arduino.appendToHCode("extern syncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile_Arduino.appendToBeforeMainCode("syncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); - if (ar.isBroadcast()) { - mainFile_Arduino.appendToMainCode("setBroadcast(&__" + getChannelName(ar, i) + ", true);" + CR); - } - } - } - } - - //mainFile.appendToHCode("pthread_mutex_t mainMutex;" + CR); - } - public void makeAsynchronousChannels() { - - // Create a synchronous channel per relation/signal - mainFile_Arduino.appendToHCode("/* Asynchronous channels */" + CR); - mainFile_Arduino.appendToBeforeMainCode("/* Asynchronous channels */" + CR); - mainFile_Arduino.appendToMainCode("/* Asynchronous channels */" + CR); - for(AvatarRelation ar: avspec.getRelations()) { - if (ar.isAsynchronous()) { - for(int i=0; i<ar.nbOfSignals(); i++) { - mainFile_Arduino.appendToHCode("extern asyncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile_Arduino.appendToBeforeMainCode("asyncchannel __" + getChannelName(ar, i) + ";" + CR); - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".inname =\"" + ar.getInSignal(i).getName() + "\";" + CR); - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".outname =\"" + ar.getOutSignal(i).getName() + "\";" + CR); - if (ar.isBlocking()) { - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".isBlocking = 1;" + CR); - } else { - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".isBlocking = 0;" + CR); - } - mainFile_Arduino.appendToMainCode("__" + getChannelName(ar, i) + ".maxNbOfMessages = " + ar.getSizeOfFIFO() + ";" + CR); - } - } - } - - //mainFile.appendToHCode("pthread_mutex_t mainMutex;" + CR); + public void makeTasks() { - } + mainFile_Arduino.appendToSetupCode("/* Activating randomness */" + CR); + mainFile_Arduino.appendToSetupCode("initRandom(0);" + CR); + mainFile_Arduino.appendToSetupCode("char __myname[] = \"\";"+CR); - public void makeTasks() { - for(AvatarBlock block: avspec.getListOfBlocks()) { + for (AvatarBlock block : avspec.getListOfBlocks()) { makeTask(block); } } public void makeTask(AvatarBlock block) { - TaskFile taskFile = new TaskFile(block.getName()); if (includeUserCode) { String tmp = block.getGlobalCode(); if (tmp != null) { - taskFile.addToMainCode(CR + "// Header code defined in the model" + CR + tmp + CR + "// End of header code defined in the model" + CR + CR); + mainFile_Arduino.appendToBeforeSetupCode(CR + "// Header code defined in the model" + CR + tmp + CR + "// End of header code defined in the model" + CR + CR); } } - defineAllStates(block, taskFile); + defineAllMethods(block); + + defineAllStates(block); + + mainFile_Arduino.appendToSetupCode("fillListOfRequests(&"+ block.getName() +"__list, __myname, &mainConditionaVariable, &mutex);"+CR); - defineAllMethods(block, taskFile); + mainFile_Arduino.appendToBeforeSetupCode("void Task_" + block.getName() + "( void *pvParameters );" + CR); + + mainFile_Arduino.appendToSetupCode("xTaskCreate (Task_" + block.getName() + ", (const portCHAR *)\"" + block.getName() + "\", 128, NULL, 1, NULL);" + CR); + + mainFile_Arduino.appendToAfterLoopCode("void Task_" + block.getName() + "( void *pvParameters )" + CR + "{" + CR + "(void) pvParameters;" + CR); + + makeMainFunction(block); + + mainFile_Arduino.appendToAfterLoopCode("}" + CR); - makeMainFunction(block, taskFile); - taskFiles.add(taskFile); } - public void defineAllStates(AvatarBlock _block, TaskFile _taskFile) { - int id = 1; + public String makeAttributesDeclaration(AvatarBlock _block) { + String ret = ""; + for (AvatarAttribute aa : _block.getAttributes()) { + ret += getCTypeOf(aa) + " " + aa.getName() + " = " + aa.getInitialValue() + ";" + CR; + } + return ret; + } - _taskFile.addToMainCode("#define STATE__START__STATE 0" + CR); + public void defineAllStates(AvatarBlock _block) { + int id = 1; + mainFile_Arduino.appendToBeforeSetupCode(CR); + mainFile_Arduino.appendToBeforeSetupCode("#define " + _block.getName() + "_STATE__START__STATE 0" + CR); - for (AvatarStateMachineElement asme: _block.getStateMachine().getListOfElements()) { + for (AvatarStateMachineElement asme : _block.getStateMachine().getListOfElements()) { if (asme instanceof AvatarState) { - _taskFile.addToMainCode("#define STATE__" + asme.getName() + " " + id + CR); - id ++; + mainFile_Arduino.appendToBeforeSetupCode("#define " + _block.getName() + "_STATE__" + asme.getName() + " " + id + CR); + id++; } } - _taskFile.addToMainCode("#define STATE__STOP__STATE " + id + CR); - _taskFile.addToMainCode(CR); + mainFile_Arduino.appendToBeforeSetupCode("#define " + _block.getName() + "_STATE__STOP__STATE " + id + CR); + } - public void defineAllMethods(AvatarBlock _block, TaskFile _taskFile) { + public void defineAllMethods(AvatarBlock _block) { Vector<String> allNames = new Vector<String>(); - for (AvatarMethod am: _block.getMethods()) { - makeMethod(_block, am, allNames, _taskFile); + for (AvatarMethod am : _block.getMethods()) { + makeMethod(_block, am, allNames); } // Make method of father - makeFatherMethod(_block, _block, allNames, _taskFile); + makeFatherMethod(_block, _block, allNames); } - private void makeFatherMethod(AvatarBlock _originBlock, AvatarBlock _currentBlock, Vector<String> _allNames, TaskFile _taskFile) { + private void makeFatherMethod(AvatarBlock _originBlock, AvatarBlock _currentBlock, Vector<String> _allNames) { if (_currentBlock.getFather() == null) { return; } - for (AvatarMethod am: _currentBlock.getFather().getMethods()) { - makeMethod(_originBlock, am, _allNames, _taskFile); + for (AvatarMethod am : _currentBlock.getFather().getMethods()) { + makeMethod(_originBlock, am, _allNames); } - makeFatherMethod(_originBlock, _currentBlock.getFather(), _allNames, _taskFile); + makeFatherMethod(_originBlock, _currentBlock.getFather(), _allNames); } - private void makeMethod(AvatarBlock _block, AvatarMethod _am, Vector<String> _allNames, TaskFile _taskFile) { + private void makeMethod(AvatarBlock _block, AvatarMethod _am, Vector<String> _allNames) { String ret = ""; List<AvatarAttribute> list; List<AvatarAttribute> listA; - String nameMethod = _block.getName() + "__" +_am.getName(); + String nameMethod = _block.getName() + "__" + _am.getName(); - for(String s: _allNames) { + for (String s : _allNames) { if (s.compareTo(nameMethod) == 0) { return; } @@ -323,44 +253,23 @@ public class AVATAR2CPOSIXArduino { ret += " " + nameMethod + "("; list = _am.getListOfAttributes(); int cpt = 0; - for(AvatarAttribute aa: list) { + for (AvatarAttribute aa : list) { if (cpt != 0) { ret += ", "; } ret += getCTypeOf(aa) + " " + aa.getName(); - cpt ++; + cpt++; } ret += ") {" + CR; - if (tracing) { - String tr = ""; - cpt = 0; - if (list.size() > 0) { - ret += "char my__attr[CHAR_ALLOC_SIZE];" + CR; - ret += "sprintf(my__attr, \""; - for(AvatarAttribute aa: list) { - if (cpt != 0) { - tr += ","; - ret += ","; - } - tr += aa.getName(); - ret += "%d"; - cpt ++; - } - ret += "\"," + tr + ");" + CR; - ret += traceFunctionCall(_block.getName(), _am.getName(), "my__attr"); - } else { - ret += traceFunctionCall(_block.getName(), _am.getName(), null); - } - } if (debug) { - ret += "debugMsg(\"-> ....() Executing method " + _am.getName() + "\");" + CR; + ret += "debug2Msg(\"-> ....() Executing method " + _am.getName() + "\");" + CR; list = _am.getListOfAttributes(); cpt = 0; - for(AvatarAttribute aa: list) { + for (AvatarAttribute aa : list) { ret += "debugInt(\"Attribute " + aa.getName() + " = \"," + aa.getName() + ");" + CR; } } @@ -374,19 +283,19 @@ public class AVATAR2CPOSIXArduino { if (_am.isImplementationProvided()) { ret += "return __userImplemented__" + nameMethod + "("; cpt = 0; - for(AvatarAttribute aaa: listA) { + for (AvatarAttribute aaa : listA) { if (cpt != 0) { ret += ", "; } ret += aaa.getName(); - cpt ++; + cpt++; } - ret+= ");" + CR; + ret += ");" + CR; //TraceManager.addDev("Adding a call to the method"); } else { - if (listA.size() >0) { + if (listA.size() > 0) { ret += "return " + listA.get(0).getName() + ";" + CR; } else { ret += "return 0;" + CR; @@ -396,87 +305,65 @@ public class AVATAR2CPOSIXArduino { if (_am.isImplementationProvided()) { ret += "__userImplemented__" + nameMethod + "("; cpt = 0; - for(AvatarAttribute aaa: listA) { + for (AvatarAttribute aaa : listA) { if (cpt != 0) { ret += ", "; } ret += aaa.getName(); - cpt ++; + cpt++; } - ret+= ");" + CR; + ret += ");" + CR; } } ret += "}" + CR + CR; - _taskFile.addToMainCode(ret + CR); + mainFile_Arduino.appendToBeforeSetupCode(CR + ret); } - public void makeMainHeader() { - mainFile_Arduino.appendToBeforeMainCode(CR); - for(TaskFile taskFile: taskFiles) { - mainFile_Arduino.appendToBeforeMainCode("#include \"" + taskFile.getName() + ".h\"" + CR); - } - mainFile_Arduino.appendToBeforeMainCode(CR); - - } - public void makeMainFunction(AvatarBlock _block, TaskFile _taskFile) { + public void makeMainFunction(AvatarBlock _block) { int i; - String s = "void *mainFunc__" + _block.getName() + "(void *arg)"; - String sh = "extern " + s + ";" + CR; - s+= "{" + CR; + String s = ""; + String s2=""; + + s += makeAttributesDeclaration(_block); - s += makeAttributesDeclaration(_block, _taskFile); + s+=CR+"mutex.unlock();"+CR; - s+= CR + "int __currentState = STATE__START__STATE;" + CR; + s2 += CR + "int "+_block.getName()+"__currentState = " + _block.getName() + "_STATE__START__STATE;" + CR; int nbOfMaxParams = _block.getMaxNbOfParams(); //s+= "request *__req;" + CR; - for(i=0; i<_block.getMaxNbOfMultipleBranches(); i++) { - s+= UNUSED_ATTR + " request __req" + i + ";" + CR; - s+= UNUSED_ATTR + "int *__params" + i + "[" + nbOfMaxParams + "];" + CR; + for (i = 0; i < _block.getMaxNbOfMultipleBranches(); i++) { + s2 += "request " + _block.getName() + "__req" + i + ";" + CR; + s2 += "int *" + _block.getName() + "__params" + i + "[" + nbOfMaxParams + "];" + CR; } - s+= UNUSED_ATTR + "setOfRequests __list;" + CR; - - s+= UNUSED_ATTR + "pthread_cond_t __myCond;" + CR; - s+= UNUSED_ATTR + "request *__returnRequest;" + CR; - - s+= CR + "char * __myname = (char *)arg;" + CR; - - /*if (tracing) { - s+= CR + "char __value[CHAR_ALLOC_SIZE];" + CR; - }*/ - - s+= CR + "pthread_cond_init(&__myCond, NULL);" + CR; - - s+= CR + "fillListOfRequests(&__list, __myname, &__myCond, &__mainMutex);" + CR; + s2 += "setOfRequests " + _block.getName() + "__list;" + CR; + s2 += "request *" + _block.getName() + "__returnRequest;" + CR; - s+= "//printf(\"my name = %s\\n\", __myname);" + CR; + mainFile_Arduino.appendToBeforeSetupCode(s2); - s+= CR + "/* Main loop on states */" + CR; - s+= "while(__currentState != STATE__STOP__STATE) {" + CR; + s += CR + "/* Main loop on states */" + CR; + s += "while("+_block.getName()+"__currentState != " + _block.getName() + "_STATE__STOP__STATE) {" + CR; - - s += "switch(__currentState) {" + CR; + s += "switch("+_block.getName()+"__currentState) {" + CR; // Making start state AvatarStateMachine asm = _block.getStateMachine(); - s += "case STATE__START__STATE: " + CR; - s += traceStateEntering("__myname", "__StartState"); + s += "case " + _block.getName() + "_STATE__START__STATE: " + CR; s += makeBehaviourFromElement(_block, asm.getStartState(), true); s += "break;" + CR + CR; String tmp; // Making other states - for(AvatarStateMachineElement asme: asm.getListOfElements()) { + for (AvatarStateMachineElement asme : asm.getListOfElements()) { if (asme instanceof AvatarState) { - s += "case STATE__" + asme.getName() + ": " + CR; - s += traceStateEntering("__myname", asme.getName()); + s += "case " + _block.getName() + "_STATE__" + asme.getName() + ": " + CR; if (includeUserCode) { - tmp = ((AvatarState)asme).getEntryCode(); + tmp = ((AvatarState) asme).getEntryCode(); if (tmp != null) { if (tmp.trim().length() > 0) { s += "/* Entry code */\n" + tmp + "\n/* End of entry code */\n\n"; @@ -491,18 +378,16 @@ public class AVATAR2CPOSIXArduino { s += "}" + CR; - s += "}" + CR; - s+= "//printf(\"Exiting = %s\\n\", __myname);" + CR; - s+= "return NULL;" + CR; s += "}" + CR; - _taskFile.addToMainCode(s + CR); - _taskFile.addToHeaderCode(sh + CR); + + s += "while(1){};"; + + mainFile_Arduino.appendToAfterLoopCode(s + CR); } public String makeBehaviourFromElement(AvatarBlock _block, AvatarStateMachineElement _asme, boolean firstCall) { - AvatarStateMachineElement asme0; - + //AvatarStateMachineElement asme0; if (_asme == null) { return ""; @@ -516,35 +401,27 @@ public class AVATAR2CPOSIXArduino { } if (_asme instanceof AvatarTransition) { - AvatarTransition at = (AvatarTransition)_asme; + AvatarTransition at = (AvatarTransition) _asme; if (at.isGuarded()) { - String g = modifyGuard(at.getGuard().toString ()); + String g = modifyGuard(at.getGuard().toString()); ret += "if (!" + g + ") {" + CR; if (debug) { ret += "debug2Msg(__myname, \"Guard failed: " + g + "\");" + CR; } - ret += "__currentState = STATE__STOP__STATE;" + CR; + ret += ""+_block.getName()+"__currentState = " + _block.getName() + "_STATE__STOP__STATE;" + CR; ret += "break;" + CR; ret += "}" + CR; } if (at.hasDelay()) { - ret+= "waitFor(" + reworkDelay(at.getMinDelay()) + ", " + reworkDelay(at.getMaxDelay()) + ");" + CR; + ret += "waitFor(" + reworkDelay(at.getMinDelay()) + "," + reworkDelay(at.getMaxDelay()) + ");" + CR; } - String act; + + //+ ret += makeActionsOfTransaction(_block, at); - /*for(i=0; i<at.getNbOfAction(); i++) { - // Must know whether this is an action or a method call - act = at.getAction(i); - if (at.isAMethodCall(act)) { - ret += modifyMethodName(_block, act) + ";" + CR; - } else { - ret += act + ";" + CR; - } - }*/ return ret + makeBehaviourFromElement(_block, _asme.getNext(0), false); @@ -552,13 +429,11 @@ public class AVATAR2CPOSIXArduino { if (_asme instanceof AvatarState) { if (!firstCall) { - if (debug) { - ret += "debug2Msg(__myname, \"-> (=====) Entering state + " + _asme.getName() + "\");" + CR; - } - return ret + "__currentState = STATE__" + _asme.getName() + ";" + CR; + + return ret + ""+_block.getName()+"__currentState = " + _block.getName() + "_STATE__" + _asme.getName() + ";" + CR; } else { if (_asme.nbOfNexts() == 0) { - return ret + "__currentState = STATE__STOP__STATE;" + CR; + return ret + ""+_block.getName()+"__currentState = " + _block.getName() + "_STATE__STOP__STATE;" + CR; } if (_asme.nbOfNexts() == 1) { @@ -570,18 +445,18 @@ public class AVATAR2CPOSIXArduino { // 1) Only immediatly executable transitions - for(i=0; i<_asme.nbOfNexts(); i++) { + for (i = 0; i < _asme.nbOfNexts(); i++) { if (_asme.getNext(i) instanceof AvatarTransition) { - AvatarTransition at = (AvatarTransition)(_asme.getNext(i)); + AvatarTransition at = (AvatarTransition) (_asme.getNext(i)); if (at.hasActions()) { - ret += makeImmediateAction(at, i); + ret += makeImmediateAction(at, i,_block); } else { if (at.getNext(0) instanceof AvatarActionOnSignal) { - ret += makeSignalAction(at, i); + ret += makeSignalAction(at, i,_block); } else { // nothing special to do : immediate choice - ret += makeImmediateAction(at, i); + ret += makeImmediateAction(at, i,_block); } } } @@ -589,24 +464,23 @@ public class AVATAR2CPOSIXArduino { // Make all requests // Test if at least one request in the list! - ret += "if (nbOfRequests(&__list) == 0) {" + CR; - ret += "debug2Msg(__myname, \"No possible request\");" + CR; - ret += "__currentState = STATE__STOP__STATE;" + CR; + ret += "if (nbOfRequests(&" + _block.getName() + "__list) == 0) {" + CR; + ret += "debug2Msg(\"No possible request\");" + CR; + ret += ""+_block.getName()+"__currentState = " + _block.getName() + "_STATE__STOP__STATE;" + CR; ret += "break;" + CR; ret += "}" + CR; - ret += "__returnRequest = executeListOfRequests(&__list);" + CR; - ret += "clearListOfRequests(&__list);" + CR ; - ret += traceRequest(); + ret += _block.getName() + "__returnRequest = executeListOfRequests(&" + _block.getName() + "__list);" + CR; + ret += "clearListOfRequests(&" + _block.getName() + "__list);" + CR; // Resulting requests - for(i=0; i<_asme.nbOfNexts(); i++) { + for (i = 0; i < _asme.nbOfNexts(); i++) { if (i != 0) { ret += "else "; } - AvatarTransition at = (AvatarTransition)(_asme.getNext(i)); + AvatarTransition at = (AvatarTransition) (_asme.getNext(i)); if (at.hasActions()) { - ret += " if (__returnRequest == &__req" + i + ") {" + CR; + ret += " if (" + _block.getName() + "__returnRequest == &" + _block.getName() + "__req" + i + ") {" + CR; ret += makeActionsOfTransaction(_block, at); /*for(int j=0; j<at.getNbOfAction(); j++) { if (at.isAMethodCall(at.getAction(j))) { @@ -618,45 +492,46 @@ public class AVATAR2CPOSIXArduino { }*/ ret += makeBehaviourFromElement(_block, at.getNext(0), false) + CR + "}"; - } else { + } else { if (at.getNext(0) instanceof AvatarActionOnSignal) { - ret += " if (__returnRequest == &__req" + i + ") {" + CR + makeBehaviourFromElement(_block, at.getNext(0).getNext(0), false) + CR + "}"; + ret += " if (" + _block.getName() + "__returnRequest == &" + _block.getName() + "__req" + i + ") {" + CR + makeBehaviourFromElement(_block, + at.getNext(0).getNext(0), + false) + CR + "}"; } else { // nothing special to do : immediate choice - ret += " if (__returnRequest == &__req" + i + ") {" + CR + makeBehaviourFromElement(_block, at.getNext(0), false) + CR + "}"; + ret += " if (" + _block.getName() + "__returnRequest == &" + _block.getName() + "__req" + i + ") {" + CR + makeBehaviourFromElement(_block, + at.getNext(0), false) + CR + "}"; } } ret += CR; - } return ret; } } if (_asme instanceof AvatarStopState) { - return ret + "__currentState = STATE__STOP__STATE;" + CR; + return ret + ""+_block.getName()+"__currentState = " + _block.getName() + "_STATE__STOP__STATE;" + CR; } if (_asme instanceof AvatarRandom) { - AvatarRandom ar = (AvatarRandom)_asme; + AvatarRandom ar = (AvatarRandom) _asme; ret += ar.getVariable() + " = computeRandom(" + ar.getMinValue() + ", " + ar.getMaxValue() + ");" + CR; return ret + makeBehaviourFromElement(_block, _asme.getNext(0), false); } if (_asme instanceof AvatarActionOnSignal) { - AvatarActionOnSignal aaos = (AvatarActionOnSignal)_asme; - ret += makeSignalAction(aaos, 0, false, "", ""); + AvatarActionOnSignal aaos = (AvatarActionOnSignal) _asme; + ret += makeSignalAction(aaos, 0, false, "", "",_block); AvatarSignal as = aaos.getSignal(); - AvatarRelation ar = avspec.getAvatarRelationWithSignal(as); - ret += executeOneRequest("__req0"); - ret += traceRequest(); + //AvatarRelation ar = avspec.getAvatarRelationWithSignal(as); + ret += executeOneRequest(_block.getName() + "__req0",_block); } // Default return ret + makeBehaviourFromElement(_block, _asme.getNext(0), false); } - private String makeSignalAction(AvatarTransition _at, int _index) { + private String makeSignalAction(AvatarTransition _at, int _index,AvatarBlock _block) { String ret = ""; AvatarActionOnSignal aaos; @@ -664,19 +539,19 @@ public class AVATAR2CPOSIXArduino { return ""; } - aaos = (AvatarActionOnSignal)(_at.getNext(0)); + aaos = (AvatarActionOnSignal) (_at.getNext(0)); if (_at.isGuarded()) { - String g = modifyGuard(_at.getGuard().toString ()); + String g = modifyGuard(_at.getGuard().toString()); ret += "if (" + g + ") {" + CR; } if (_at.hasDelay()) { - ret += makeSignalAction(aaos, _index, true, _at.getMinDelay(), _at.getMaxDelay()); + ret += makeSignalAction(aaos, _index, true, _at.getMinDelay(), _at.getMaxDelay(),_block); } else { - ret += makeSignalAction(aaos, _index, false, "", ""); + ret += makeSignalAction(aaos, _index, false, "", "",_block); } - ret += "addRequestToList(&__list, &__req" + _index + ");" + CR; + ret += "addRequestToList(&"+_block.getName()+"__list, &"+_block.getName()+"__req" + _index + ");" + CR; if (_at.isGuarded()) { ret += "}" + CR; @@ -685,7 +560,37 @@ public class AVATAR2CPOSIXArduino { return ret; } - private String makeSignalAction(AvatarActionOnSignal _aaos, int _index, boolean hasDelay, String minDelay, String maxDelay) { + + public String makeActionsOfTransaction(AvatarBlock _block, AvatarTransition _at) { + String ret = ""; + String type; + for (int i = 0; i < _at.getNbOfAction(); i++) { + // Must know whether this is an action or a method call + + AvatarAction act = _at.getAction(i); + if (act.isAMethodCall()) { + String actModified = modifyMethodName(_block, (AvatarTermFunction) act); + ret += actModified + ";" + CR; + } else { + String actModified = modifyMethodName(_block, ((AvatarActionAssignment) act).getLeftHand()) + + " = " + modifyMethodName(_block, ((AvatarActionAssignment) act).getRightHand()); + AvatarLeftHand leftHand = ((AvatarActionAssignment) act).getLeftHand(); + ret += actModified + ";" + CR; + if (leftHand instanceof AvatarAttribute) { + if (((AvatarAttribute) leftHand).isInt()) { + type = "0"; + } else { + type = "1"; + } + } + + } + } + + return ret; + } + + private String makeSignalAction(AvatarActionOnSignal _aaos, int _index, boolean hasDelay, String minDelay, String maxDelay,AvatarBlock _block) { String ret = ""; int i; @@ -705,37 +610,38 @@ public class AVATAR2CPOSIXArduino { // Sending if (_aaos.isSending()) { // Putting params - for(i=0; i<_aaos.getNbOfValues() ;i++) { - ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; + for (i = 0; i < _aaos.getNbOfValues(); i++) { + ret += _block.getName()+"__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; } if (ar.isAsynchronous()) { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", SEND_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", SEND_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; + ret += _block.getName()+"__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { if (ar.isBroadcast()) { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", SEND_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; + ret += _block.getName()+"__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID()+ ", SEND_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", SEND_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; + ret += _block.getName()+"__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } } // Receiving } else { - for(i=0; i<_aaos.getNbOfValues() ;i++) { - ret += "__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; + for (i = 0; i < _aaos.getNbOfValues(); i++) { + ret += _block.getName()+"__params" + _index + "[" + i + "] = &" + _aaos.getValue(i) + ";" + CR; } if (ar.isAsynchronous()) { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", RECEIVE_ASYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; + ret += _block.getName()+"__req" + _index + ".asyncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { if (ar.isBroadcast()) { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", RECEIVE_BROADCAST_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } else { - ret += "makeNewRequest(&__req" + _index + ", " + _aaos.getID() + ", RECEIVE_SYNC_REQUEST, " + delay + ", " + _aaos.getNbOfValues() + ", __params" + _index + ");" + CR; - ret += "__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _aaos.getID() + ", RECEIVE_SYNC_REQUEST, " + delay + + ", " + _aaos.getNbOfValues() + ", "+_block.getName()+"__params" + _index + ");" + CR; + ret += _block.getName()+"__req" + _index + ".syncChannel = &__" + getChannelName(ar, as) + ";" + CR; } } } @@ -744,19 +650,20 @@ public class AVATAR2CPOSIXArduino { return ret; } - private String makeImmediateAction(AvatarTransition _at, int _index) { + private String makeImmediateAction(AvatarTransition _at, int _index,AvatarBlock _block) { String ret = ""; if (_at.isGuarded()) { - String g = modifyGuard(_at.getGuard().toString ()); + String g = modifyGuard(_at.getGuard().toString()); ret += "if (" + g + ") {" + CR; } if (_at.hasDelay()) { - ret += "makeNewRequest(&__req" + _index + ", " + _at.getID() + ", IMMEDIATE, 1, " + reworkDelay(_at.getMinDelay()) + ", " + reworkDelay(_at.getMaxDelay()) + ", 0, __params" + _index + ");" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _at.getID() + ", IMMEDIATE, 1, " + reworkDelay(_at.getMinDelay()) + ", " + reworkDelay(_at.getMaxDelay()) + ", 0, "+_block.getName()+"__params" + _index + ");" + CR; } else { - ret += "makeNewRequest(&__req" + _index + ", " + _at.getID() + ", IMMEDIATE, 0, 0, 0, 0, __params" + _index + ");" + CR; + ret += "makeNewRequest(&"+_block.getName()+"__req" + _index + ", " + _at.getID() + ", IMMEDIATE, 0, 0, 0, 0, "+_block.getName()+"__params" + _index + + ");" + CR; } - ret += "addRequestToList(&__list, &__req" + _index + ");" + CR; + ret += "addRequestToList(&"+_block.getName()+"__list, &"+_block.getName()+"__req" + _index + ");" + CR; if (_at.isGuarded()) { ret += "}" + CR; } @@ -765,100 +672,9 @@ public class AVATAR2CPOSIXArduino { } - private String executeOneRequest(String var) { - String ret = "__returnRequest = executeOneRequest(&__list, &" + var + ");" + CR; - ret += "clearListOfRequests(&__list);" + CR; - return ret; - } - - - public String makeAttributesDeclaration(AvatarBlock _block, TaskFile _taskFile) { - String ret = ""; - for(AvatarAttribute aa: _block.getAttributes()) { - ret += getCTypeOf(aa) + " " + aa.getName() + " = " + aa.getInitialValue() + ";" + CR; - } - return ret; - } - - public void makeThreadsInMain(boolean _debug) { - mainFile_Arduino.appendToMainCode(CR + "/* Threads of tasks */" + CR); - for(TaskFile taskFile: taskFiles) { - mainFile_Arduino.appendToMainCode("pthread_t thread__" + taskFile.getName() + ";" + CR); - } - - makeArgumentsInMain(_debug); - - if (_debug) { - mainFile_Arduino.appendToMainCode("/* Activating debug messages */" + CR); - mainFile_Arduino.appendToMainCode("activeDebug();" + CR); - } - - - - mainFile_Arduino.appendToMainCode("/* Activating randomness */" + CR); - mainFile_Arduino.appendToMainCode("initRandom();" + CR); - - mainFile_Arduino.appendToMainCode("/* Initializing the main mutex */" + CR); - mainFile_Arduino.appendToMainCode("if (pthread_mutex_init(&__mainMutex, NULL) < 0) { exit(-1);}" + CR + CR); - - mainFile_Arduino.appendToMainCode("/* Initializing mutex of messages */" + CR); - mainFile_Arduino.appendToMainCode("initMessages();" + CR); - - - if (avspec.hasApplicationCode()&& includeUserCode) { - mainFile_Arduino.appendToMainCode("/* User initialization */" + CR); - mainFile_Arduino.appendToMainCode("__user_init();" + CR); - } - - - mainFile_Arduino.appendToMainCode(CR + CR + mainDebugMsg("Starting tasks")); - for(TaskFile taskFile: taskFiles) { - mainFile_Arduino.appendToMainCode("pthread_create(&thread__" + taskFile.getName() + ", NULL, mainFunc__" + taskFile.getName() + ", (void *)\"" + taskFile.getName() + "\");" + CR); - } - - mainFile_Arduino.appendToMainCode(CR + CR + mainDebugMsg("Joining tasks")); - for(TaskFile taskFile: taskFiles) { - mainFile_Arduino.appendToMainCode("pthread_join(thread__" + taskFile.getName() + ", NULL);" + CR); - } - - mainFile_Arduino.appendToMainCode(CR + CR + mainDebugMsg("Application terminated")); - mainFile_Arduino.appendToMainCode("return 0;" + CR); - } - - public void makeArgumentsInMain(boolean _debug) { - mainFile_Arduino.appendToMainCode("/* Activating tracing */" + CR); - - if (tracing) { - mainFile_Arduino.appendToMainCode("if (argc>1){" + CR); - mainFile_Arduino.appendToMainCode("activeTracingInFile(argv[1]);" + CR + "} else {" + CR); - mainFile_Arduino.appendToMainCode("activeTracingInConsole();" + CR + "}" + CR); - } - } - - public void makeMakefileSrc(String _path) { - makefile_src = "SRCS = "; - makefile_src += _path + "main.c "; - for(TaskFile taskFile: taskFiles) { - makefile_src += _path + taskFile.getName() + ".c "; - } - - } - - public void makeMakefileSocLib() { - makefile_SocLib = "objs = "; - makefile_SocLib += "main.o "; - for(TaskFile taskFile: taskFiles) { - makefile_SocLib += taskFile.getName() + ".o "; - } - - } - - - public String getCTypeOf(AvatarAttribute _aa) { - String ret = "int"; - if (_aa.getType() == AvatarType.BOOLEAN) { - ret = "bool"; - } + private String executeOneRequest(String var,AvatarBlock _block) { + String ret = _block.getName()+"__returnRequest = executeOneRequest(&"+_block.getName()+"__list, &" + var + ");" + CR; + ret += "clearListOfRequests(&"+_block.getName()+"__list);" + CR; return ret; } @@ -871,141 +687,75 @@ public class AVATAR2CPOSIXArduino { return getChannelName(_ar, index); } - public String modifyGuard(String _g) { - String g = Conversion.replaceAllString(_g, "[", "(").trim(); - g = Conversion.replaceAllString(g, "]", ")").trim(); - g = Conversion.replaceOp(g, "and", "&&"); - g = Conversion.replaceOp(g, "or", "||"); - g = Conversion.replaceOp(g, "not", "!"); - TraceManager.addDev("Guard=" + g); - return g; - } - - public String reworkDelay(String _delay) { - switch(timeUnit) { - case USEC: - return _delay; - case MSEC: - return "(" + _delay + ")*1000"; - case SEC: - return "(" + _delay + ")*1000000"; - } - - return _delay; - } private String modifyMethodName(AvatarBlock _ab, AvatarTerm term) { if (term instanceof AvatarAttribute) - return term.getName (); + return term.getName(); if (term instanceof AvatarConstant) - return term.getName (); + return term.getName(); if (term instanceof AvatarTermRaw) - return term.getName (); + return term.getName(); if (term instanceof AvatarArithmeticOp) { AvatarArithmeticOp aop = (AvatarArithmeticOp) term; - return this.modifyMethodName (_ab, aop.getTerm1 ()) - + aop.getOperator () - + this.modifyMethodName (_ab, aop.getTerm2 ()); + return this.modifyMethodName(_ab, aop.getTerm1()) + + aop.getOperator() + + this.modifyMethodName(_ab, aop.getTerm2()); } if (term instanceof AvatarTuple) { boolean first = true; String res = "("; - for (AvatarTerm tterm: ((AvatarTuple) term).getComponents ()) { + for (AvatarTerm tterm : ((AvatarTuple) term).getComponents()) { if (first) first = false; else res += ", "; - res += this.modifyMethodName (_ab, tterm); + res += this.modifyMethodName(_ab, tterm); } return res + ")"; } if (term instanceof AvatarTermFunction) - return _ab.getName () + "__" + ((AvatarTermFunction) term).getMethod ().getName () - + this.modifyMethodName (_ab, ((AvatarTermFunction) term).getArgs ()); + return _ab.getName() + "__" + ((AvatarTermFunction) term).getMethod().getName() + + this.modifyMethodName(_ab, ((AvatarTermFunction) term).getArgs()); return ""; } - private String traceRequest() { - if (!tracing) { - return ""; - } - return "traceRequest(__myname, __returnRequest);" + CR; - } - - private String traceVariableModification(String blockName, String varName, String type) { - if (!tracing) { - return ""; + public String getCTypeOf(AvatarAttribute _aa) { + String ret = "int"; + if (_aa.getType() == AvatarType.BOOLEAN) { + ret = "bool"; } - - return "traceVariableModification(\"" + blockName + "\", \"" + varName + "\", " + varName + "," + type + ");" + CR; + return ret; } - private String traceFunctionCall(String blockName, String functionName, String params) { - if (!tracing) { - return ""; - } + public String reworkDelay(String _delay) { - if (params == null) { - params = "\"-\""; + switch (timeUnit) { + case MSEC: + return _delay; + case USEC: + return "(" + _delay + ")/1000"; + case SEC: + return "(" + _delay + ")*1000"; } - return "traceFunctionCall(\"" + blockName + "\", \"" + functionName + "\", " + params + ");" + CR; - } - private String traceStateEntering(String name, String stateName) { - if (!tracing) { - return ""; - } - return "traceStateEntering(" + name + ", \"" + stateName + "\");" + CR; + return _delay; } - private String mainDebugMsg(String s) { - if (!debug) { - return ""; - } - return "debugMsg(\"" + s + "\");" + CR; + public String modifyGuard(String _g) { + String g = Conversion.replaceAllString(_g, "[", "(").trim(); + g = Conversion.replaceAllString(g, "]", ")").trim(); + g = Conversion.replaceOp(g, "and", "&&"); + g = Conversion.replaceOp(g, "or", "||"); + g = Conversion.replaceOp(g, "not", "!"); + TraceManager.addDev("Guard=" + g); + return g; } - private String taskDebugMsg(String s) { - if (!debug) { - return ""; - } - return "debug2Msg(__myname, \"" + s + "\");" + CR; - } - public String makeActionsOfTransaction(AvatarBlock _block, AvatarTransition _at) { - String ret = ""; - String type; - for(int i=0; i<_at.getNbOfAction(); i++) { - // Must know whether this is an action or a method call - AvatarAction act = _at.getAction(i); - TraceManager.addDev("Action=" + act); - if (act.isAMethodCall()) { - TraceManager.addDev("Method call"); - String actModified = modifyMethodName (_block, (AvatarTermFunction) act); - ret += actModified + ";" + CR; - } else { - TraceManager.addDev("Else"); - String actModified = modifyMethodName (_block, ((AvatarActionAssignment) act).getLeftHand ()) - + " = " + modifyMethodName (_block, ((AvatarActionAssignment) act).getRightHand ()); - AvatarLeftHand leftHand = ((AvatarActionAssignment) act).getLeftHand (); - ret += actModified + ";" + CR; - if (leftHand instanceof AvatarAttribute) { - if (((AvatarAttribute) leftHand).isInt()) { - type = "0"; - } else { - type = "1"; - } - ret += traceVariableModification(_block.getName(), leftHand.getName (), type); - } - - } - } +} - return ret; - } -} diff --git a/src/main/java/avatartranslator/toexecutable/MainFile_Arduino.java b/src/main/java/avatartranslator/toexecutable/MainFile_Arduino.java old mode 100644 new mode 100755 index 90ef8b57a34caa2091ab4017b16b676df543b739..9136f60ff39fef2d7142491ce3452973809f698e --- a/src/main/java/avatartranslator/toexecutable/MainFile_Arduino.java +++ b/src/main/java/avatartranslator/toexecutable/MainFile_Arduino.java @@ -3,38 +3,1163 @@ package avatartranslator.toexecutable; import myutil.Plugin; import myutil.TraceManager; -public class MainFile_Arduino { - private final static String SETUP_CODE = ""; - private final static String LOOP_CODE = ""; - - private final static String H_DEF = "#ifndef MAIN_H\n#define MAIN_H\n"; - private final static String H_END_DEF = "#endif\n"; +/** + * Class MainFile_Arduino + * Creation: 05/11/2017 by Berkey Koksal + * + * Developed by : Dhiaeddine ALIOUI + * @version 3 15/11/2018 + */ + +public class MainFile_Arduino { - private final static String INCLUDE_HEADER = "#include <stdio.h>\n#include <pthread.h>\n#include <unistd.h>\n#include <stdlib.h>\n"; - private final static String LOCAL_INCLUDE_HEADER = "#include \"request.h\"\n#include \"syncchannel.h\"\n#include \"request_manager.h\"\n#include \"debug.h\"\n#include \"random.h\"\n#include \"tracemanager.h\""; + private final static String SETUP_CODE = "void setup() { \n Serial.begin(9600);\n"; + private final static String LOOP_CODE = "void loop() { \n"; - private final static String MAIN_DEC = "int main(int argc, char *argv[]) {\n"; - private final static String DISABLE_BUFFERING = "/* disable buffering on stdout */\nsetvbuf(stdout, NULL, _IONBF, 0);\n"; + private final static String INCLUDE_HEADER = "#include <Arduino_FreeRTOS.h>\n#include <frt.h>\n"; + ; + private final static String LOCAL_INCLUDE_HEADER = ""; - private final static String CR = "\n"; + private final static String CR = "\n"; private String name; - private String hCode; - private String beforeMainCode; - private String mainCode; + private String beforeSetupCode; + private String setupCode; + private String loopCode; + private String afterLoopCode; + private String functionsCode; + private String stucturesCode; - private Plugin plugin; - public MainFile_Arduino(String _name, Plugin _plugin) { + + public MainFile_Arduino(String _name) { name = _name; - plugin = _plugin; - hCode = ""; - mainCode = ""; - beforeMainCode = ""; + beforeSetupCode=""; + setupCode=""; + loopCode=""; + afterLoopCode=""; + + functionsCode="void criticalErrorInt(String msg, int Int) {\n" + + " Serial.print(\"Critical error : \") ;\n" + + " Serial.print(msg) ;\n" + + " Serial.print(\", \") ;\n" + + " Serial.println(Int) ;\n" + + "}\n" + + "\n" + + "void criticalError(String msg) {\n" + + " Serial.print(\"Critical error : \") ;\n" + + " Serial.println(msg) ;\n" + + "}\n" + + "\n" + + "int computeRandom(int min, int max) {\n" + + " return random(min, max);\n" + + "}\n" + + "\n" + + "long computeLongRandom(long min, long max) {\n" + + "\n" + + " return (long)random(min, max);\n" + + "}\n" + + "\n" + + "void initRandom(int pin) {\n" + + " randomSeed(analogRead(pin));\n" + + "}\n" + + "\n" + + "int my_clock_gettime(struct timespec *ts) {\n" + + " ts->tv_sec = millis() / 1000;\n" + + " ts->tv_nsec = micros();\n" + + " return 0;\n" + + "}\n" + + "\n" + + "\n" + + "void addTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {\n" + + " dest->tv_nsec = src1->tv_nsec + src2->tv_nsec;\n" + + " dest->tv_sec = src1->tv_sec + src2->tv_sec;\n" + + " if (dest->tv_nsec > 1000000000) {\n" + + " dest->tv_sec = dest->tv_sec + (dest->tv_nsec / 1000000000);\n" + + " dest->tv_nsec = dest->tv_nsec % 1000000000;\n" + + " }\n" + + "}\n" + + "\n" + + "void diffTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {\n" + + " int diff = 0;\n" + + " if (src1->tv_nsec > src2->tv_nsec) {\n" + + " diff ++;\n" + + " dest->tv_nsec = src2->tv_nsec - src1->tv_nsec + 1000000000;\n" + + " } else {\n" + + " dest->tv_nsec = src2->tv_nsec - src1->tv_nsec;\n" + + " }\n" + + "\n" + + " dest->tv_sec = src2->tv_sec - src1->tv_sec - diff;\n" + + "}\n" + + "\n" + + "\n" + + "\n" + + "int isBefore(struct timespec *src1, struct timespec *src2) {\n" + + " if (src1->tv_sec > src2->tv_sec) {\n" + + " return 0;\n" + + " }\n" + + "\n" + + " if (src1->tv_sec < src2->tv_sec) {\n" + + " return 1;\n" + + " }\n" + + "\n" + + " if (src1->tv_nsec < src2->tv_nsec) {\n" + + " return 1;\n" + + " }\n" + + " return 0;\n" + + "}\n" + + "\n" + + "void minTime(struct timespec *src1, struct timespec *src2, struct timespec *dest) {\n" + + "\n" + + " if (isBefore(src1, src2)) {\n" + + " dest->tv_nsec = src1->tv_nsec;\n" + + " dest->tv_sec = src1->tv_sec;\n" + + " } else {\n" + + " dest->tv_nsec = src2->tv_nsec;\n" + + " dest->tv_sec = src2->tv_sec;\n" + + " }\n" + + "\n" + + "}\n" + + "\n" + + "void delayToTimeSpec(struct timespec *ts, long delay) {\n" + + " ts->tv_nsec = (delay % 1000000) * 1000;\n" + + " ts->tv_sec = (delay / 1000000);\n" + + "}\n" + + "\n" + + "\n" + + "void waitFor(long minDelay, long maxDelay) {\n" + + " long delay;\n" + + " delay = computeLongRandom(minDelay, maxDelay);\n" + + " vTaskDelay( delay / portTICK_PERIOD_MS );\n" + + "}\n" + + "\n" + + "long getMessageID() {\n" + + " long tmp;\n" + + " __message_mutex.lock();\n" + + " tmp = __id_message;\n" + + " __id_message ++;\n" + + " __message_mutex.unlock();\n" + + " return tmp;\n" + + "}\n" + + "\n" + + "struct message *getNewMessageWithParams(int nbOfParams) {\n" + + "\n" + + " message *msg = (message *)(malloc(sizeof(struct message)));\n" + + " if (msg == NULL) {\n" + + " criticalError(\"Allocation of request failed\");\n" + + " }\n" + + " msg->nbOfParams = nbOfParams;\n" + + " msg->params = (int *)(malloc(sizeof(int) * nbOfParams));\n" + + " msg->id = getMessageID();\n" + + " return msg;\n" + + "}\n" + + "\n" + + "struct message *getNewMessage(int nbOfParams, int *params) {\n" + + "\n" + + " message *msg = (message *)(malloc(sizeof(struct message)));\n" + + " if (msg == NULL) {\n" + + " criticalError(\"Allocation of request failed\");\n" + + " }\n" + + " msg->nbOfParams = nbOfParams;\n" + + " msg->params = params;\n" + + " msg->id = getMessageID();\n" + + " return msg;\n" + + "}\n" + + "\n" + + "\n" + + "\n" + + "void destroyMessageWithParams(message *msg) {\n" + + " free(msg->params);\n" + + " free(msg);\n" + + "}\n" + + "\n" + + "void destroyMessage(message *msg) {\n" + + " free(msg);\n" + + "}\n" + + "\n" + + "struct asyncchannel *getNewAsyncchannel(char *outname, char *inname, int isBlocking, int maxNbOfMessages) {\n" + + " asyncchannel * asyncch = (asyncchannel *)(malloc(sizeof(struct asyncchannel)));\n" + + " if (asyncch == NULL) {\n" + + " criticalError(\"Allocation of asyncchannel failed\");\n" + + " }\n" + + " asyncch->inname = inname;\n" + + " asyncch->outname = outname;\n" + + " asyncch->isBlocking = isBlocking;\n" + + " asyncch->maxNbOfMessages = maxNbOfMessages;\n" + + "\n" + + " return asyncch;\n" + + "}\n" + + "\n" + + "void destroyAsyncchannel(asyncchannel *asyncch) {\n" + + " free(asyncch);\n" + + "}\n" + + "\n" + + "message* getAndRemoveOldestMessageFromAsyncChannel(asyncchannel *channel) {\n" + + " message *msg;\n" + + " message *previous;\n" + + "\n" + + " if (channel->currentNbOfMessages == 0) {\n" + + " return NULL;\n" + + " }\n" + + "\n" + + " if (channel->currentNbOfMessages == 1) {\n" + + " channel->currentNbOfMessages = 0;\n" + + " msg = channel->pendingMessages;\n" + + " channel->pendingMessages = NULL;\n" + + " return msg;\n" + + " }\n" + + "\n" + + " msg = channel->pendingMessages;\n" + + " previous = msg;\n" + + " while (msg->next != NULL) {\n" + + " previous = msg;\n" + + " msg = msg->next;\n" + + " }\n" + + "\n" + + " channel->currentNbOfMessages = channel->currentNbOfMessages - 1;\n" + + " previous->next = NULL;\n" + + " return msg;\n" + + "}\n" + + "\n" + + "void addMessageToAsyncChannel(asyncchannel *channel, message *msg) {\n" + + " msg->next = channel->pendingMessages;\n" + + " channel->pendingMessages = msg;\n" + + " channel->currentNbOfMessages = channel->currentNbOfMessages + 1;\n" + + "}\n" + + "\n" + + "struct syncchannel *getNewSyncchannel(char *outname, char *inname) {\n" + + " syncchannel * syncch = (syncchannel *)(malloc(sizeof(struct syncchannel)));\n" + + " if (syncch == NULL) {\n" + + " criticalError(\"Allocation of request failed\");\n" + + " }\n" + + " syncch->inname = inname;\n" + + " syncch->outname = outname;\n" + + " syncch->inWaitQueue = NULL;\n" + + " syncch->outWaitQueue = NULL;\n" + + " syncch->isBroadcast = false;\n" + + " return syncch;\n" + + "}\n" + + "\n" + + "void setBroadcast(syncchannel *syncch, bool b) {\n" + + " syncch->isBroadcast = b;\n" + + "}\n" + + "\n" + + "\n" + + "void destroySyncchannel(syncchannel *syncch) {\n" + + " free(syncch);\n" + + "}\n" + + "\n" + + "struct request *getNewRequest(int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {\n" + + " request *req = (request *)(malloc(sizeof(struct request)));\n" + + "\n" + + " if (req == NULL) {\n" + + " criticalError(\"Allocation of request failed\");\n" + + " }\n" + + "\n" + + " makeNewRequest(req, ID, type, hasDelay, minDelay, maxDelay, nbOfParams, params);\n" + + " return req;\n" + + "}\n" + + "\n" + + "\n" + + "// Delays are in microseconds\n" + + "void makeNewRequest(request *req, int ID, int type, int hasDelay, long minDelay, long maxDelay, int nbOfParams, int **params) {\n" + + " long delay;\n" + + " int i;\n" + + "\n" + + " req->next = NULL;\n" + + " req->listOfRequests = NULL;\n" + + " req->nextRequestInList = NULL;\n" + + "\n" + + " req->type = type;\n" + + " req->ID = ID;\n" + + " req->hasDelay = hasDelay;\n" + + "\n" + + " if (req->hasDelay > 0) {\n" + + " delay = computeLongRandom(minDelay, maxDelay);\n" + + " delayToTimeSpec(&(req->delay), delay);\n" + + " }\n" + + "\n" + + " req->selected = 0;\n" + + " req->nbOfParams = nbOfParams;\n" + + " req->params = params;\n" + + "\n" + + " req->alreadyPending = 0;\n" + + " req->delayElapsed = 0;\n" + + "\n" + + " req->relatedRequest = NULL;\n" + + "\n" + + " if (type == SEND_ASYNC_REQUEST) {\n" + + " // Must create a new message\n" + + " req->msg = getNewMessageWithParams(nbOfParams);\n" + + " for (i = 0; i < nbOfParams; i++) {\n" + + " req->msg->params[i] = *(params[i]);\n" + + " }\n" + + " }\n" + + "\n" + + "}\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "void destroyRequest(request *req) {\n" + + " free((void *)req);\n" + + "}\n" + + "\n" + + "int isRequestSelected(request *req) {\n" + + " return req->selected;\n" + + "}\n" + + "\n" + + "int nbOfRequests(struct setOfRequests *list) {\n" + + " int cpt = 0;\n" + + " request *req;\n" + + "\n" + + " req = list->head;\n" + + "\n" + + " while (req != NULL) {\n" + + " cpt ++;\n" + + " req = req->nextRequestInList;\n" + + " }\n" + + "\n" + + " return cpt;\n" + + "}\n" + + "\n" + + "struct request *getRequestAtIndex(struct setOfRequests *list, int index) {\n" + + " int cpt = 0;\n" + + " request * req = list->head;\n" + + "\n" + + " while (cpt < index) {\n" + + " req = req->nextRequestInList;\n" + + " cpt ++;\n" + + " }\n" + + "\n" + + " return req;\n" + + "\n" + + "}\n" + + "\n" + + "\n" + + "struct request * addToRequestQueue(request *list, request *requestToAdd) {\n" + + " request *origin = list;\n" + + "\n" + + " if (list == NULL) {\n" + + " return requestToAdd;\n" + + " }\n" + + "\n" + + " while (list->next != NULL) {\n" + + " list = list->next;\n" + + " }\n" + + "\n" + + " list->next = requestToAdd;\n" + + "\n" + + " requestToAdd->next = NULL;\n" + + "\n" + + " return origin;\n" + + "}\n" + + "\n" + + "struct request * removeRequestFromList(request *list, request *requestToRemove) {\n" + + " request *origin = list;\n" + + "\n" + + " if (list == requestToRemove) {\n" + + " return list->next;\n" + + " }\n" + + "\n" + + "\n" + + " while (list->next != requestToRemove) {\n" + + " list = list->next;\n" + + " }\n" + + "\n" + + " list->next = requestToRemove->next;\n" + + "\n" + + " return origin;\n" + + "}\n" + + "\n" + + "\n" + + "void copyParameters(request *src, request *dst) {\n" + + " int i;\n" + + " for (i = 0; i < dst->nbOfParams; i++) {\n" + + " *(dst->params[i]) = *(src->params[i]);\n" + + " }\n" + + "}\n" + + "\n" + + "\n" + + "void clearListOfRequests(struct setOfRequests *list) {\n" + + " list->head = NULL;\n" + + "}\n" + + "\n" + + "struct setOfRequests *newListOfRequests(int variable, frt::Mutex *mutex) {\n" + + " setOfRequests *list = (setOfRequests *)(malloc(sizeof(setOfRequests)));\n" + + " list->head = NULL;\n" + + " *(list->conditionVariable) = variable;\n" + + " list->mutex = mutex;\n" + + "\n" + + " return list;\n" + + "}\n" + + "\n" + + "void fillListOfRequests(struct setOfRequests *list, char* name, int* variable, frt::Mutex *mutex) {\n" + + " list->head = NULL;\n" + + " list->owner = name;\n" + + " list->conditionVariable = variable;\n" + + " list->mutex = mutex;\n" + + "}\n" + + "\n" + + "\n" + + "void addRequestToList(struct setOfRequests *list, request* req) {\n" + + " request *tmpreq;\n" + + "\n" + + " if (list == NULL) {\n" + + " criticalError(\"NULL List in addRequestToList\");\n" + + " }\n" + + "\n" + + " if (req == NULL) {\n" + + " criticalError(\"NULL req in addRequestToList\");\n" + + " }\n" + + "\n" + + " req->listOfRequests = list;\n" + + "\n" + + " if (list->head == NULL) {\n" + + " list->head = req;\n" + + " req->nextRequestInList = NULL;\n" + + " return;\n" + + " }\n" + + "\n" + + " tmpreq = list->head;\n" + + " while (tmpreq->nextRequestInList != NULL) {\n" + + " tmpreq = tmpreq->nextRequestInList;\n" + + " }\n" + + "\n" + + " tmpreq->nextRequestInList = req;\n" + + " req->nextRequestInList = NULL;\n" + + "}\n" + + "\n" + + "void removeAllPendingRequestsFromPendingLists(request *req, int apartThisOne) {\n" + + " setOfRequests *list = req->listOfRequests;\n" + + " request *reqtmp;\n" + + "\n" + + " if (list == NULL) {\n" + + " return;\n" + + " }\n" + + "\n" + + " reqtmp = list->head;\n" + + "\n" + + " while (reqtmp != NULL) {\n" + + "\n" + + " if (reqtmp->alreadyPending) {\n" + + " if (reqtmp->type == RECEIVE_SYNC_REQUEST) {\n" + + " debug2Msg(\"Removing send sync request from inWaitQueue\");\n" + + " reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);\n" + + "\n" + + " }\n" + + "\n" + + " if (reqtmp->type == SEND_SYNC_REQUEST) {\n" + + " debug2Msg(\"Removing receive sync request from outWaitQueue\");\n" + + " reqtmp->syncChannel->outWaitQueue = removeRequestFromList(reqtmp->syncChannel->outWaitQueue, reqtmp);\n" + + "\n" + + " }\n" + + "\n" + + " if (reqtmp->type == RECEIVE_BROADCAST_REQUEST) {\n" + + " debug2Msg(\"Removing broadcast receive request from inWaitQueue\");\n" + + " reqtmp->syncChannel->inWaitQueue = removeRequestFromList(reqtmp->syncChannel->inWaitQueue, reqtmp);\n" + + "\n" + + " }\n" + + " }\n" + + " reqtmp = reqtmp->nextRequestInList;\n" + + " }\n" + + "}\n" + + "\n" + + "\n" + + "// Identical means belonging to the same ListOfRequest\n" + + "// Returns the identical request if found, otherwise, null\n" + + "struct request *hasIdenticalRequestInListOfSelectedRequests(request *req, request *list) {\n" + + "\n" + + " while (list != NULL) {\n" + + " if (list->listOfRequests == req->listOfRequests) {\n" + + " return list;\n" + + " }\n" + + " list = list->relatedRequest;\n" + + " }\n" + + "\n" + + " return NULL;\n" + + "}\n" + + "\n" + + "struct request* replaceInListOfSelectedRequests(request *oldRequest, request *newRequest, request *list) {\n" + + " request *head = list;\n" + + "\n" + + " if (list == oldRequest) {\n" + + " newRequest->relatedRequest = oldRequest->relatedRequest;\n" + + " return newRequest;\n" + + " }\n" + + "\n" + + " //list=list->relatedRequest;\n" + + " while (list->relatedRequest != oldRequest) {\n" + + " list = list->relatedRequest;\n" + + " }\n" + + "\n" + + " list->relatedRequest = newRequest;\n" + + " newRequest->relatedRequest = oldRequest->relatedRequest;\n" + + "\n" + + " return head;\n" + + "}\n" + + "\n" + + "\n" + + "int nbOfRelatedRequests(request *list) {\n" + + " int cpt = 0;\n" + + " while (list->relatedRequest != NULL) {\n" + + " cpt ++;\n" + + " list = list->relatedRequest;\n" + + " }\n" + + "\n" + + " return cpt;\n" + + "}\n" + + "\n" + + "\n" + + "void executeSendSyncTransaction(request *req) {\n" + + " int cpt;\n" + + " request *selectedReq;\n" + + "\n" + + " // At least one transaction available -> must select one randomly\n" + + " // First: count how many of them are available\n" + + " // Then, select one\n" + + " // Broadcast the new condition!\n" + + "\n" + + " cpt = 0;\n" + + " request* currentReq = req->syncChannel->inWaitQueue;\n" + + " debug2Msg(\"Execute send sync tr\");\n" + + "\n" + + " while (currentReq != NULL) {\n" + + " cpt ++;\n" + + " currentReq = currentReq->next;\n" + + " }\n" + + "\n" + + " cpt = random() % cpt;\n" + + "\n" + + " // Head of the list?\n" + + " selectedReq = req->syncChannel->inWaitQueue;\n" + + " while (cpt > 0) {\n" + + " selectedReq = selectedReq->next;\n" + + " cpt --;\n" + + " }\n" + + "\n" + + " // Remove all related request from list requests\n" + + " //req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq);\n" + + " debug2Msg(\"Setting related request\");\n" + + " req->relatedRequest = selectedReq;\n" + + "\n" + + " // Select the selected request, and notify the information\n" + + " selectedReq->selected = 1;\n" + + " selectedReq->listOfRequests->selectedRequest = selectedReq;\n" + + "\n" + + " // Handle parameters\n" + + " copyParameters(req, selectedReq);\n" + + " debug2Msg(\"Signaling\");\n" + + "\n" + + " *(selectedReq->listOfRequests->conditionVariable) = 1 ;\n" + + "\n" + + "\n" + + "}\n" + + "\n" + + "void executeReceiveSyncTransaction(request *req) {\n" + + " int cpt;\n" + + " request *selectedReq;\n" + + "\n" + + " // At least one transaction available -> must select one randomly\n" + + " // First: count how many of them are available\n" + + " // Then, select one\n" + + " // Broadcast the new condition!\n" + + "\n" + + " request* currentReq = req->syncChannel->outWaitQueue;\n" + + " cpt = 0;\n" + + " debug2Msg(\"Execute receive sync tr\");\n" + + "\n" + + " while (currentReq != NULL) {\n" + + " cpt ++;\n" + + " //debugInt(\"cpt\", cpt);\n" + + " currentReq = currentReq->next;\n" + + " }\n" + + " cpt = random() % cpt;\n" + + " selectedReq = req->syncChannel->outWaitQueue;\n" + + " while (cpt > 0) {\n" + + " selectedReq = selectedReq->next;\n" + + " cpt --;\n" + + " }\n" + + "\n" + + " //req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq);\n" + + " debug2Msg(\"Setting related request\");\n" + + " req->relatedRequest = selectedReq;\n" + + "\n" + + " // Select the request, and notify the information in the channel\n" + + " selectedReq->selected = 1;\n" + + " selectedReq->listOfRequests->selectedRequest = selectedReq;\n" + + "\n" + + " // Handle parameters\n" + + " copyParameters(selectedReq, req);\n" + + " debug2Msg(\"Signaling\");\n" + + " *(selectedReq->listOfRequests->conditionVariable) = 1;\n" + + "\n" + + "\n" + + "}\n" + + "\n" + + "\n" + + "void executeSendAsyncTransaction(request *req) {\n" + + " request *selectedReq;\n" + + "\n" + + " // Full FIFO?\n" + + " if (req->asyncChannel->currentNbOfMessages == req->asyncChannel->maxNbOfMessages) {\n" + + " // Must remove the oldest message\n" + + " getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);\n" + + " }\n" + + "\n" + + " addMessageToAsyncChannel(req->asyncChannel, req->msg);\n" + + " debug2Msg(\"Signaling async write to all requests waiting \");\n" + + " selectedReq = req->asyncChannel->inWaitQueue;\n" + + " while (selectedReq != NULL) {\n" + + "\n" + + " *(selectedReq->listOfRequests->conditionVariable) = 1;\n" + + " selectedReq = selectedReq->next;\n" + + " }\n" + + " debug2Msg(\"Signaling done\");\n" + + "\n" + + "}\n" + + "\n" + + "void executeReceiveAsyncTransaction(request *req) {\n" + + " int i;\n" + + " request *selectedReq;\n" + + "\n" + + " req->msg = getAndRemoveOldestMessageFromAsyncChannel(req->asyncChannel);\n" + + "\n" + + " selectedReq = req->asyncChannel->outWaitQueue;\n" + + "\n" + + " // Must recopy parameters\n" + + " for (i = 0; i < req->nbOfParams; i++) {\n" + + " *(req->params[i]) = req->msg->params[i];\n" + + " }\n" + + "\n" + + "\n" + + " // unallocate message\n" + + " destroyMessageWithParams(req->msg);\n" + + " debug2Msg(\"Signaling async read to all requests waiting \");\n" + + " while (selectedReq != NULL) {\n" + + " *(selectedReq->listOfRequests->conditionVariable) = 1;\n" + + " selectedReq = selectedReq->next;\n" + + " }\n" + + " debug2Msg(\"Signaling done\");\n" + + "}\n" + + "\n" + + "\n" + + "void executeSendBroadcastTransaction(request *req) {\n" + + " int cpt;\n" + + " request *tmpreq;\n" + + "\n" + + " // At least one transaction available -> must select all of them\n" + + " // but at most one per task\n" + + " // Then, broadcast the new condition!\n" + + "\n" + + " request* currentReq = req->syncChannel->inWaitQueue;\n" + + " request* currentLastReq = req;\n" + + " debug2Msg(\"Execute broadcast sync tr\");\n" + + "\n" + + "\n" + + " while (currentReq != NULL) {\n" + + " tmpreq = hasIdenticalRequestInListOfSelectedRequests(currentReq, req->relatedRequest);\n" + + " if (tmpreq != NULL) {\n" + + " // Must select one of the two\n" + + " // If =1, replace, otherwise, just do nothing\n" + + " cpt = random() % 2;\n" + + " if (cpt == 1) {\n" + + " debug2Msg(\"Replacing broadcast request\");\n" + + " req->relatedRequest = replaceInListOfSelectedRequests(tmpreq, currentReq, req->relatedRequest);\n" + + " currentReq->listOfRequests->selectedRequest = currentReq;\n" + + " copyParameters(req, currentReq);\n" + + " currentReq->selected = 1;\n" + + " currentLastReq = req;\n" + + " while (currentLastReq->relatedRequest != NULL) {\n" + + " currentLastReq = currentLastReq->relatedRequest;\n" + + " }\n" + + " }\n" + + " } else {\n" + + " currentLastReq->relatedRequest = currentReq;\n" + + " currentReq->relatedRequest = NULL;\n" + + " currentReq->selected = 1;\n" + + " currentReq->listOfRequests->selectedRequest = currentReq;\n" + + " copyParameters(req, currentReq);\n" + + " currentLastReq = currentReq;\n" + + " }\n" + + "\n" + + " currentReq = currentReq->next;\n" + + "\n" + + "\n" + + " }\n" + + "\n" + + "\n" + + " currentReq = req->relatedRequest;\n" + + " cpt = 0;\n" + + " while (currentReq != NULL) {\n" + + " cpt ++;\n" + + " *(currentReq->listOfRequests->conditionVariable) = 1;\n" + + " currentReq = currentReq->relatedRequest;\n" + + " }\n" + + "\n" + + "\n" + + "}\n" + + "\n" + + "\n" + + "int executable(setOfRequests *list, int nb) {\n" + + " int cpt = 0;\n" + + " //int index = 0;\n" + + " request *req = list->head;\n" + + " timespec ts;\n" + + " int tsDone = 0;\n" + + " debug2Msg(\"Starting loop\");\n" + + " list->hasATimeRequest = 0;\n" + + "\n" + + " while (req != NULL) {\n" + + " if (!(req->delayElapsed)) {\n" + + " if (req->hasDelay) {\n" + + " // Is the delay elapsed???\n" + + " if (tsDone == 0) {\n" + + " my_clock_gettime(&ts);\n" + + " tsDone = 1;\n" + + " }\n" + + "\n" + + " if (isBefore(&ts, &(req->myStartTime)) == 1) {\n" + + " // Delay not elapsed\n" + + " debug2Msg(\"---------t--------> delay NOT elapsed\");\n" + + " if (list->hasATimeRequest == 0) {\n" + + " list->hasATimeRequest = 1;\n" + + " list->minTimeToWait.tv_nsec = req->myStartTime.tv_nsec;\n" + + " list->minTimeToWait.tv_sec = req->myStartTime.tv_sec;\n" + + " } else {\n" + + " minTime(&(req->myStartTime), &(list->minTimeToWait), &(list->minTimeToWait));\n" + + " }\n" + + " } else {\n" + + " // Delay elapsed\n" + + " debug2Msg(\"---------t--------> delay elapsed\");\n" + + " req->delayElapsed = 1;\n" + + " }\n" + + " } else {\n" + + " req->delayElapsed = 1;\n" + + " }\n" + + " }\n" + + " req = req->nextRequestInList;\n" + + " }\n" + + "\n" + + " req = list->head;\n" + + " while ((req != NULL) && (cpt < nb)) {\n" + + " req->executable = 0;\n" + + " if (req->delayElapsed) {\n" + + " if (req->type == SEND_SYNC_REQUEST) {\n" + + " debug2Msg(\"Send sync\");\n" + + " if (req->syncChannel->inWaitQueue != NULL) {\n" + + " debug2Msg(\"Send sync executable\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " } else {\n" + + " debug2Msg(\"Send sync not executable\");\n" + + " }\n" + + " //index ++;\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_SYNC_REQUEST) {\n" + + " debug2Msg(\"receive sync\");\n" + + " if (req->syncChannel->outWaitQueue != NULL) {\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " }\n" + + " //index ++;\n" + + " }\n" + + "\n" + + " if (req->type == SEND_ASYNC_REQUEST) {\n" + + " debug2Msg(\"Send async\");\n" + + " if (!(req->asyncChannel->isBlocking)) {\n" + + " // Can always add a message -> executable\n" + + " debug2Msg(\"Send async executable since non blocking\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + "\n" + + " //blocking case ... channel full?\n" + + " } else {\n" + + " if (req->asyncChannel->currentNbOfMessages < req->asyncChannel->maxNbOfMessages) {\n" + + " // Not full!\n" + + " debug2Msg(\"Send async executable since channel not full\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " } else {\n" + + " debug2Msg(\"Send async not executable: full, and channel is blocking\");\n" + + " }\n" + + " }\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_ASYNC_REQUEST) {\n" + + " debug2Msg(\"receive async\");\n" + + " if (req->asyncChannel->currentNbOfMessages > 0) {\n" + + " debug2Msg(\"Receive async executable: not empty\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " } else {\n" + + " debug2Msg(\"Receive async not executable: empty\");\n" + + " }\n" + + " //index ++;\n" + + " }\n" + + "\n" + + "\n" + + " if (req->type == SEND_BROADCAST_REQUEST) {\n" + + " debug2Msg(\"send broadcast\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_BROADCAST_REQUEST) {\n" + + " debug2Msg(\"receive broadcast\");\n" + + " // A receive broadcast is never executable\n" + + " req->executable = 0;\n" + + " //index ++;\n" + + " }\n" + + "\n" + + "\n" + + "\n" + + "\n" + + " if (req->type == IMMEDIATE) {\n" + + " debug2Msg(\"immediate\");\n" + + " req->executable = 1;\n" + + " cpt ++;\n" + + " }\n" + + " }\n" + + "\n" + + " req = req->nextRequestInList;\n" + + "\n" + + " }\n" + + "\n" + + " return cpt;\n" + + "}\n" + + "\n" + + "void private__makeRequestPending(setOfRequests *list) {\n" + + " request *req = list->head;\n" + + " while (req != NULL) {\n" + + " if ((req->delayElapsed) && (!(req->alreadyPending))) {\n" + + " if (req->type == SEND_SYNC_REQUEST) {\n" + + " debug2Msg(\"Adding pending request in outWaitqueue\");\n" + + " req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);\n" + + " req->alreadyPending = 1;\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_SYNC_REQUEST) {\n" + + " debug2Msg(\"Adding pending request in inWaitqueue\");\n" + + " req->alreadyPending = 1;\n" + + " req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);\n" + + " }\n" + + "\n" + + " if (req->type == SEND_ASYNC_REQUEST) {\n" + + " debug2Msg(\"Adding pending request in outWaitqueue\");\n" + + " req->asyncChannel->outWaitQueue = addToRequestQueue(req->asyncChannel->outWaitQueue, req);\n" + + " req->alreadyPending = 1;\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_ASYNC_REQUEST) {\n" + + " debug2Msg(\"Adding pending request in inWaitqueue\");\n" + + " req->alreadyPending = 1;\n" + + " req->asyncChannel->inWaitQueue = addToRequestQueue(req->asyncChannel->inWaitQueue, req);\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_BROADCAST_REQUEST) {\n" + + " debug2Msg(\"Adding pending broadcast request in inWaitqueue\");\n" + + " req->alreadyPending = 1;\n" + + " req->syncChannel->inWaitQueue = addToRequestQueue(req->syncChannel->inWaitQueue, req);\n" + + " }\n" + + "\n" + + " if (req->type == SEND_BROADCAST_REQUEST) {\n" + + " debug2Msg(\"Adding pending broadcast request in outWaitqueue\");\n" + + " req->alreadyPending = 1;\n" + + " req->syncChannel->outWaitQueue = addToRequestQueue(req->syncChannel->outWaitQueue, req);\n" + + " }\n" + + "\n" + + " }\n" + + "\n" + + " req = req->nextRequestInList;\n" + + " }\n" + + "}\n" + + "\n" + + "void private__makeRequest(request *req) {\n" + + " if (req->type == SEND_SYNC_REQUEST) {\n" + + " executeSendSyncTransaction(req);\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_SYNC_REQUEST) {\n" + + " executeReceiveSyncTransaction(req);\n" + + " }\n" + + "\n" + + " if (req->type == SEND_ASYNC_REQUEST) {\n" + + " executeSendAsyncTransaction(req);\n" + + " }\n" + + "\n" + + " if (req->type == RECEIVE_ASYNC_REQUEST) {\n" + + " executeReceiveAsyncTransaction(req);\n" + + " }\n" + + "\n" + + " if (req->type == SEND_BROADCAST_REQUEST) {\n" + + " executeSendBroadcastTransaction(req);\n" + + " }\n" + + " // IMMEDIATE: Nothing to do\n" + + "\n" + + " // In all cases: remove other requests of the same list from their pending form1\n" + + " debug2Msg(\"Removing original req\");\n" + + " removeAllPendingRequestsFromPendingLists(req, 1);\n" + + " removeAllPendingRequestsFromPendingListsRelatedRequests(req);\n" + + " if (req->relatedRequest != NULL) {\n" + + " debug2Msg(\"Removing related req\");\n" + + " removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);\n" + + " }\n" + + "\n" + + "\n" + + "}\n" + + "\n" + + "void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) {\n" + + " if (req->relatedRequest != NULL) {\n" + + " debug2Msg(\"Removing related req\");\n" + + " removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);\n" + + " // Recursive call\n" + + " removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);\n" + + " }\n" + + "}\n" + + "\n" + + "\n" + + "request *private__executeRequests0(setOfRequests *list, int nb) {\n" + + " int howMany, found;\n" + + " int selectedIndex, realIndex;\n" + + " request *selectedReq;\n" + + " request *req;\n" + + "\n" + + " // Compute which requests can be executed\n" + + " debug2Msg(\"Counting requests\");\n" + + " howMany = executable(list, nb);\n" + + "\n" + + "\n" + + "\n" + + " if (howMany == 0) {\n" + + " debug2Msg(\"No pending requests\");\n" + + " // Must make them pending\n" + + "\n" + + " private__makeRequestPending(list);\n" + + "\n" + + " return NULL;\n" + + " }\n" + + "\n" + + "\n" + + "\n" + + " // Select a request\n" + + " req = list->head;\n" + + " selectedIndex = (rand() % howMany) + 1;\n" + + "\n" + + " realIndex = 0;\n" + + " found = 0;\n" + + " while (req != NULL) {\n" + + " if (req->executable == 1) {\n" + + " found ++;\n" + + " if (found == selectedIndex) {\n" + + " break;\n" + + " }\n" + + " }\n" + + " realIndex ++;\n" + + " req = req->nextRequestInList;\n" + + " }\n" + + "\n" + + " selectedReq = getRequestAtIndex(list, realIndex);\n" + + " selectedReq->selected = 1;\n" + + " selectedReq->listOfRequests->selectedRequest = selectedReq;\n" + + "\n" + + " // Execute that request\n" + + " private__makeRequest(selectedReq);\n" + + "\n" + + " return selectedReq;\n" + + "}\n" + + "\n" + + "\n" + + "request *private__executeRequests(setOfRequests *list) {\n" + + " // Is a request already selected?\n" + + "\n" + + " if (list->selectedRequest != NULL) {\n" + + " return list->selectedRequest;\n" + + " }\n" + + " debug2Msg(\"No request selected -> looking for one!\");\n" + + " return private__executeRequests0(list, nbOfRequests(list));\n" + + "}\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "request *executeOneRequest(setOfRequests *list, request *req) {\n" + + " req->nextRequestInList = NULL;\n" + + " req->listOfRequests = list;\n" + + " list->head = req;\n" + + " return executeListOfRequests(list);\n" + + "}\n" + + "\n" + + "\n" + + "void setLocalStartTime(setOfRequests *list) {\n" + + "\n" + + " request *req = list->head;\n" + + "\n" + + " while (req != NULL) {\n" + + " if (req->hasDelay) {\n" + + " req->delayElapsed = 0;\n" + + " addTime(&(list->startTime), &(req->delay), &(req->myStartTime));\n" + + " debug2Msg(\" -----t------>: Request with delay\");\n" + + " } else {\n" + + " debug2Msg(\" -----t------>: Request without delay\");\n" + + " req->delayElapsed = 1;\n" + + " req->myStartTime.tv_nsec = list->startTime.tv_nsec;\n" + + " req->myStartTime.tv_sec = list->startTime.tv_sec;\n" + + " }\n" + + " req = req->nextRequestInList;\n" + + " list->mutex->unlock();\n" + + " list->mutex->lock();\n" + + " }\n" + + "}\n" + + "\n" + + "\n" + + "// Return the executed request\n" + + "struct request *executeListOfRequests(struct setOfRequests *list) {\n" + + " request *req;\n" + + "\n" + + " my_clock_gettime(&list->startTime);\n" + + " list->selectedRequest = NULL;\n" + + " setLocalStartTime(list);\n" + + "\n" + + " // Try to find a request that could be executed\n" + + " debug2Msg(\"Locking mutex\");\n" + + " list->mutex->unlock();\n" + + " list->mutex->lock();\n" + + " debug2Msg(\"Mutex locked\");\n" + + " debug2Msg(\"Going to execute request\");\n" + + " while ((req = private__executeRequests(list)) == NULL) {\n" + + " debug2Msg(\"Waiting for request!\");\n" + + " if (list->hasATimeRequest == 1) {\n" + + " debug2Msg(\"Waiting for a request and at most for a given time\");\n" + + " list->mutex->unlock();\n" + + " waitFor(list->minTimeToWait.tv_sec * 1000, list->minTimeToWait.tv_sec * 1000);\n" + + " *(list->conditionVariable) = 0 ;\n" + + " while (*(list->conditionVariable) != 1) {\n" + + " vTaskDelay( portTICK_PERIOD_MS );\n" + + " }\n" + + "\n" + + " list->mutex->lock();\n" + + "\n" + + " } else {\n" + + " debug2Msg(\"Releasing mutex\");\n" + + " list->mutex->unlock();\n" + + " *(list->conditionVariable) = 0 ;\n" + + " while (*(list->conditionVariable) != 1) {\n" + + " vTaskDelay( portTICK_PERIOD_MS );\n" + + " }\n" + + "\n" + + " list->mutex->lock();\n" + + " }\n" + + " debug2Msg(\"Waking up for requests! -> getting mutex\");\n" + + " }\n" + + " debug2Msg(\"Request selected!\");\n" + + " my_clock_gettime(&list->completionTime);\n" + + " list->mutex->unlock();\n" + + " debug2Msg(\"Mutex unlocked\");\n" + + " return req;\n" + + "}\n" + + "\n" + + "\n" + + "void debug2Msg(char* val ) {\n" + + " if (debug == DEBUG_ON) {\n" + + " Serial.println(val) ;\n" + + " }\n" + + "}"; + + stucturesCode="#define SEND_SYNC_REQUEST 0\n" + + "#define RECEIVE_SYNC_REQUEST 2\n" + + "#define SEND_ASYNC_REQUEST 4\n" + + "#define RECEIVE_ASYNC_REQUEST 6\n" + + "#define DELAY 8\n" + + "#define IMMEDIATE 10\n" + + "#define SEND_BROADCAST_REQUEST 12\n" + + "#define RECEIVE_BROADCAST_REQUEST 14\n" + + "\n" + + "#define DEBUG_ON 1\n" + + "#define DEBUG_OFF 2\n" + + "\n" + + "int debug = DEBUG_ON;\n" + + "\n" + + "struct timespec\n" + + "{\n" + + " int tv_sec; /* Seconds. */\n" + + " int tv_nsec; /* Nanoseconds. */\n" + + "};\n" + + "\n" + + "struct message {\n" + + " struct message *next;\n" + + " int nbOfParams;\n" + + " int *params;\n" + + " long id;\n" + + "};\n" + + "\n" + + "long __id_message = 0;\n" + + "frt::Mutex __message_mutex;\n" + + "frt::Mutex mutex ;\n" + + "int mainConditionaVariable = 0;\n" + + "struct request;\n" + + "\n" + + "struct setOfRequests {\n" + + " char* owner;\n" + + " struct request *head;\n" + + " timespec startTime;\n" + + " timespec completionTime;\n" + + " int *conditionVariable;\n" + + " frt::Mutex *mutex;\n" + + "\n" + + " int hasATimeRequest; // Means that at least on request of the list hasn't completed yet its time delay\n" + + " timespec minTimeToWait;\n" + + " struct request *selectedRequest;\n" + + "};\n" + + "\n" + + "struct request {\n" + + " struct request *next;\n" + + " struct setOfRequests* listOfRequests;\n" + + " struct request* nextRequestInList;\n" + + " struct request* relatedRequest; // For synchro and broadcast\n" + + " struct syncchannel *syncChannel;\n" + + " struct asyncchannel *asyncChannel;\n" + + "\n" + + " int type;\n" + + " int ID;\n" + + " int hasDelay;;\n" + + " timespec delay;\n" + + " int nbOfParams; // synchronous com.\n" + + " int **params; // synchronous com.\n" + + " message *msg; // Asynchronous comm.\n" + + "\n" + + "\n" + + " // Filled by the request manager\n" + + " int executable;\n" + + " int selected;\n" + + " int alreadyPending; // Whether it has been taken into account for execution or not\n" + + " int delayElapsed;\n" + + " timespec myStartTime; // Time at which the delay has expired\n" + + "};\n" + + "\n" + + "struct asyncchannel {\n" + + " char *outname;\n" + + " char *inname;\n" + + " int isBlocking; // In writing. Reading is always blocking\n" + + " int maxNbOfMessages; //\n" + + " struct request* outWaitQueue;\n" + + " struct request* inWaitQueue;\n" + + " message *pendingMessages;\n" + + " int currentNbOfMessages;\n" + + "};\n" + + "\n" + + "struct syncchannel {\n" + + " char *outname;\n" + + " char *inname;\n" + + " struct request* inWaitQueue;\n" + + " struct request* outWaitQueue;\n" + + " bool isBroadcast;\n" + + "};"; } @@ -42,47 +1167,35 @@ public class MainFile_Arduino { return name; } - public void appendToHCode(String _code) { - hCode += _code; - } - - public void appendToBeforeMainCode(String _code) { - beforeMainCode += _code; + public void appendToSetupCode(String _code) { + setupCode += _code; } - public void appendToMainCode(String _code) { - mainCode += _code; + public void appendToBeforeSetupCode(String _code) { + beforeSetupCode += _code; } - public String getHeaderCode() { - return H_DEF + hCode + H_END_DEF; + public void appendToLoopCode(String _code) { + loopCode += _code; } - public String getMainCode() { + public void appendToAfterLoopCode(String _code) {afterLoopCode += _code; } - String mainDec = MAIN_DEC; + public String getBeforeSetupCode() { return INCLUDE_HEADER+CR+LOCAL_INCLUDE_HEADER+CR+stucturesCode+CR+beforeSetupCode+CR ; } - + public String getSetupCode() { + return SETUP_CODE + setupCode + CR + "}"+CR; + } - try { - if (plugin != null) { - mainDec = plugin.executeRetStringMethod(plugin.getClassAvatarCodeGenerator(), "getMainDeclaration"); - } - - } catch (Exception e) { - TraceManager.addDev("plugin exception: " + e.getMessage()); - } + public String getLoopCode() { return LOOP_CODE + loopCode + CR + "}"+CR; } - String s = INCLUDE_HEADER + "\n" + LOCAL_INCLUDE_HEADER + CR + CR; - - s += beforeMainCode + CR; - //s += DISABLE_BUFFERING; - s += CR + mainCode + CR + CR; + public String getAfterLoopCode() { return afterLoopCode; } - return s; + public String getFunctionsCode() { return functionsCode; } + public String getStucturesCode() { + return stucturesCode; } - - + public String getAllCode() {return getBeforeSetupCode()+CR+getSetupCode()+CR+getLoopCode()+CR+getAfterLoopCode()+CR+getFunctionsCode();} } diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class index 71d9843072d50bb06a20112b7f0922e88117ca42..0003d5e9514e34d3674825584aa3cf2b318cb45e 100644 Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CMBED.class differ diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.class index 9d888bc4e6de9c6fae833f6e11594d0c9e8125a5..581fe7b2646ce8956a831f1b650bb198af9ba326 100644 Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/AVATAR2CPOSIXArduino.class differ diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class index cae71c5bfd4d524a71038272f3880fa6af4f39c5..50a6bc15a2cb6fb7fac7bb04f444d38bca35486e 100644 Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFileMbed.class differ diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFile_Arduino.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFile_Arduino.class index ee5968d72054c226503633215249830fdb9e5ee5..283bb9d49fce27bf3e34e160c4dd9aaa1d3c06a1 100644 Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFile_Arduino.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/MainFile_Arduino.class differ diff --git a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class index 94e311827c37ed2712748b874f604be6f6a3108c..3517b41183b7ef51f3c0b322785c29e3cec40127 100644 Binary files a/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class and b/ttool-cli/build/classes/java/main/avatartranslator/toexecutable/TaskFileMbed.class differ diff --git a/ttool-cli/build/classes/java/main/common/SpecConfigTTool.class b/ttool-cli/build/classes/java/main/common/SpecConfigTTool.class index c34d19b9ae2a41c093ce12587659698268cbb2d8..a7ba51fe4acf341f24cddd698b25dae68479b9fd 100644 Binary files a/ttool-cli/build/classes/java/main/common/SpecConfigTTool.class and b/ttool-cli/build/classes/java/main/common/SpecConfigTTool.class differ diff --git a/ttool-cli/build/distributions/ttool-cli.tar b/ttool-cli/build/distributions/ttool-cli.tar index 10e23d198b467f102694a7e74b42eb8450f6219a..892dc23a196f4263ee9697c65906a040116a8c27 100644 Binary files a/ttool-cli/build/distributions/ttool-cli.tar and b/ttool-cli/build/distributions/ttool-cli.tar differ diff --git a/ttool-cli/build/distributions/ttool-cli.zip b/ttool-cli/build/distributions/ttool-cli.zip index 4b219b98d93c8392ff914d47a05964cd67fd8daf..4f45015d9a22e0c6beb47712fc25c6ac228a98dd 100644 Binary files a/ttool-cli/build/distributions/ttool-cli.zip and b/ttool-cli/build/distributions/ttool-cli.zip differ