Csharp High Level API Wrapper - #536
Open
metinyilm wants to merge 1 commit into
Open
Conversation
ianhbell
requested changes
Jun 13, 2023
ianhbell
left a comment
Contributor
There was a problem hiding this comment.
Overall I wonder whether the forms are really needed, as the point is to provide a programmer's interface, and the other wrappers don't include any graphical elements.
Contributor
There was a problem hiding this comment.
Should be removed, the top-level one suffices
| { | ||
| public class Refprop | ||
| { | ||
| int iUnits = 21; |
Contributor
There was a problem hiding this comment.
Do not hard-code, get from GETENUMdll
| double[] x = new double[20]; | ||
| double[] y = new double[20]; | ||
| double[] x3 = new double[20]; | ||
| static string hpath = "C:\\Program Files (x86)\\REFPROP"; |
Contributor
There was a problem hiding this comment.
Don't hardcode, read from RPPREFIX env variable
| /// <returns>Desired Poperty in double type, Ex : 200000 (J/kg) </returns> | ||
| public string Phase(string a_p, double a, string b_p, double b, string hFldi) | ||
| { | ||
| int hpath_Lenght = hpath.Length; |
| Refprop_DLL_base.SETPATHdll(hpath, ref hpath_Lenght); | ||
| Refprop_DLL_base.SETFLUIDSdll(hFld, ref ierr, ref hFld_length); | ||
| Refprop_DLL_base.REFPROPdll(ref hFld, ref hIn, ref hOut, ref iUnits, ref iFlag, ref iMass, ref a, ref b, z, Output, ref hUnits, ref iUCode, x, y, x3, ref q, ref ierr, ref herr, | ||
| ref hFld_length, ref hIn_length, ref hOut_lenght, ref hUnits_length, ref herr_lenght); |
Contributor
There was a problem hiding this comment.
be consistent with case and _ in naming
| public class Refprop_DLL_base | ||
| { | ||
|
|
||
| [DllImport(@"C:\Program Files (x86)\REFPROP\REFPRP64.DLL")] |
Contributor
There was a problem hiding this comment.
Don't hard-code the path, if possible
| property_1_unit.Text = "°C"; | ||
| break; | ||
| case "P": | ||
| property_1_unit.Text = "Bara"; |
| output_unit.Text = "°C"; | ||
| break; | ||
| case "P": | ||
| output_unit.Text = "Bara"; |
|
|
||
| 1. Clone the repository. | ||
| 2. Insert your project. | ||
| 3. Add references the DLL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.