Skip to content

Commit

Permalink
added a check for how many generated var and made some changes to to …
Browse files Browse the repository at this point in the history
…model genration of variables

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1391 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x02lucpo committed Jan 12, 2005
1 parent d9f9807 commit 07634fd
Show file tree
Hide file tree
Showing 3 changed files with 380 additions and 129 deletions.
25 changes: 25 additions & 0 deletions modeq/runtime/tornadoext.cpp
Expand Up @@ -17,6 +17,7 @@ extern "C"

map<string,int> output_var_number;
map<string,int> input_var_number;
map<string,int> param_var_number;



Expand Down Expand Up @@ -82,6 +83,30 @@ extern "C"
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

RML_BEGIN_LABEL(TORNADOEXT__get_5fparam_5fvar_5fnumber)
{
int nvars = RML_UNTAGFIXNUM(rmlA0);
char* str = RML_STRINGDATA(rmlA0);
string str_key = string(str);

map<string, int>::const_iterator search;
search = param_var_number.find(str_key);
int ret_val = 0;
if(search != param_var_number.end()){
ret_val = static_cast<int>(search->second);
ret_val += 1;
// cout << "\nSTATE_ALG:" << str_key << " " << ret_val << nvars << endl;

} // else {
// cout << "\nNO STATE_ALG:" << str_key << " " << ret_val << nvars << endl;
// }

param_var_number[str_key] = ret_val;
rmlA0 = (void*) mk_icon(ret_val);
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL


} // extern "C"

0 comments on commit 07634fd

Please sign in to comment.