Skip to content

Commit

Permalink
Maint 10.0.x issue4037 add flag (#4042)
Browse files Browse the repository at this point in the history
* added flag

* updated library

* changed file permission
  • Loading branch information
JayHuLBL authored Nov 9, 2024
1 parent 43f49a7 commit c0d637b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Buildings/Resources/C-Sources/cfdSendStopCommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void cfdSendStopCommand(void *thread) {
cosim->para->flag = 0;

/* Wait for the feedback from FFD*/
while(cosim->para->flag==0 && i<imax) {
while(cosim->started==1 && cosim->para->flag==0 && i<imax) {
if(cosim->para->ffdError==1) {
ModelicaError(cosim->ffd->msg);
}
Expand All @@ -43,7 +43,7 @@ void cfdSendStopCommand(void *thread) {
if(cosim->para->ffdError==1) {
ModelicaError(cosim->ffd->msg);
}
else {
else if (cosim->started==1) {
ModelicaMessage("Successfully stopped the FFD simulation.\n");
}
}
Expand Down
1 change: 1 addition & 0 deletions Buildings/Resources/C-Sources/cfdStartCosimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ int cfdStartCosimulation(const char *cfdFilNam, const char **name, const double
| Implicitly launch DLL module.
****************************************************************************/
ffd_dll(cosim);
cosim->started = 1;

return 0;
} /* End of cfdStartCosimulation()*/
1 change: 1 addition & 0 deletions Buildings/Resources/C-Sources/cfdcosim.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void *cfdcosim() {
cosim->modelica->shaConSig = NULL;
cosim->modelica->shaAbsRad = NULL;
cosim->ffd->TSha = NULL;
cosim->started = 0;

return (void*) cosim;
} /* End of cfdcosim()*/
Binary file modified Buildings/Resources/Library/linux64/libffd.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ typedef struct {
}ffdSharedData;

typedef struct{
int started; /* Flag to indicate if the Co-simulation has started or not. */
ParameterSharedData *para;
ffdSharedData *ffd;
ModelicaSharedData *modelica;
Expand Down

0 comments on commit c0d637b

Please sign in to comment.