Skip to content

Commit

Permalink
- add error message for #2614
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19557 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Mar 12, 2014
1 parent 47163a7 commit ae0d26c
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -849,6 +849,16 @@ static int importStartValues(DATA *data, const char *pInitFile, double initTime)

infoStreamPrint(LOG_INIT, 0, "import start values\nfile: %s\ntime: %g", pInitFile, initTime);

char* resultFile = (char*)malloc((strlen(data->modelData.modelFilePrefix)+12) * sizeof(char));
sprintf(resultFile, "%s_res.mat", data->modelData.modelFilePrefix);
if(!strcmp(resultFile, pInitFile))
{
errorStreamPrint(LOG_INIT, 0, "It is not possible to import the current result file <%s> for the initialization.", pInitFile);
return 1;
}
free(resultFile);
resultFile = 0;

pError = omc_new_matlab4_reader(pInitFile, &reader);
if(pError)
{
Expand Down Expand Up @@ -981,7 +991,8 @@ int initialization(DATA *data, const char* pInitMethod, const char* pOptiMethod,

/* import start values from extern mat-file */
if(pInitFile && strcmp(pInitFile, "")) {
importStartValues(data, pInitFile, initTime);
if(importStartValues(data, pInitFile, initTime))
return 1;
}

/* set up all variables and parameters with their start-values */
Expand Down

0 comments on commit ae0d26c

Please sign in to comment.