Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolkit pollutant setter and getter fixes #364

Merged
merged 1 commit into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/solver/include/toolkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,20 +397,21 @@ EXPORT_TOOLKIT int swmm_getNodePollut(int index, SM_NodePollut type, double **po
EXPORT_TOOLKIT int swmm_setNodePollut(int index, int pollutant_index, double pollutant_value);

/**
@brief Sets pollutant values for a specified link.
@param index The index of a link
@brief Sets pollutant values for a specified node.
@param index The index of a node
@param pollutant_index Pollutant index to set
@param pollutant_value Pollutant value to set
@return Error code
*/

EXPORT_TOOLKIT int swmm_setLinkPollut(int index, int type, int pollutant_index, double pollutant_value);
EXPORT_TOOLKIT int swmm_setLinkPollut(int index, SM_LinkPollut type, int pollutant_index, double pollutant_value);

/**
@brief Get a result value for specified link.
@brief Sets pollutant values for a specified link.
@param index The index of a link
@param type The property type code (See @ref SM_LinkResult)
@param[out] result The result of the link's property
@param type The property type code (See @ref SM_LinkPollut)
@param pollutant_index Pollutant index to set
@param pollutant_value Pollutant value to set
@return Error code
*/
EXPORT_TOOLKIT int swmm_getLinkResult(int index, SM_LinkResult type, double *result);
Expand Down
6 changes: 3 additions & 3 deletions src/solver/toolkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1872,8 +1872,8 @@ EXPORT_TOOLKIT int swmm_getNodeResult(int index, SM_NodeResult type, double *res
+ Node[index].invertElev) * UCF(LENGTH); break;
case SM_LATINFLOW:
*result = Node[index].newLatFlow * UCF(FLOW); break;
case SM_HRT:
*result = Node[index].hrt; break;
case SM_HRT:
*result = Storage[Node[index].subIndex].hrt; break;
default: error_code_index = ERR_API_OUTBOUNDS; break;
}
}
Expand Down Expand Up @@ -2083,7 +2083,7 @@ EXPORT_TOOLKIT int swmm_getLinkPollut(int index, SM_LinkPollut type, double **po
}


EXPORT_TOOLKIT int swmm_setLinkPollut(int index, int type, int pollutant_index, double pollutant_value)
EXPORT_TOOLKIT int swmm_setLinkPollut(int index, SM_LinkPollut type, int pollutant_index, double pollutant_value)
///
/// Input: index = Index of the desired Link ID
/// type = SM_LINKQUAL - Sets link's qual and allows accounting for loss and mixing calculation
Expand Down