Skip to content

Csharp High Level API Wrapper - #536

Open
metinyilm wants to merge 1 commit into
usnistgov:masterfrom
metinyilm:master
Open

Csharp High Level API Wrapper#536
metinyilm wants to merge 1 commit into
usnistgov:masterfrom
metinyilm:master

Conversation

@metinyilm

Copy link
Copy Markdown

No description provided.

@metinyilm metinyilm changed the title Charp High API Wrapper Csharp High API Wrapper Jun 12, 2023

@ianhbell ianhbell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed, the top-level one suffices

{
public class Refprop
{
int iUnits = 21;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length (typo)

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be consistent with case and _ in naming

public class Refprop_DLL_base
{

[DllImport(@"C:\Program Files (x86)\REFPROP\REFPRP64.DLL")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't hard-code the path, if possible

property_1_unit.Text = "°C";
break;
case "P":
property_1_unit.Text = "Bara";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bar, not Bar

output_unit.Text = "°C";
break;
case "P":
output_unit.Text = "Bara";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bar not Bar


1. Clone the repository.
2. Insert your project.
3. Add references the DLL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to the DLL

@ianhbell ianhbell changed the title Csharp High API Wrapper Csharp High Level API Wrapper Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants