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

Clearer protection #3629

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

HansOlsson
Copy link
Collaborator

Closes #3622

In particular:

  • Be consistent with examples, I don't know why we have claimed that "Authorization" was in Protection.
  • Be more explicit with nested records.


record IntLicense "Internal class name, do not use"
/*literal*/ constant String libraryKey;
/*literal*/ constant String licenseFile = "" "Optional, default mapping if empty";
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to point out that this is optional:

Suggested change
/*literal*/ constant String licenseFile = "" "Optional, default mapping if empty";
/*literal*/ constant String licenseFile = "" "Default mapping if empty";

/*literal*/ constant String libraryKey;
/*literal*/ constant String licenseFile = "" "Optional, default mapping if empty";
end License;
/*literal*/ constant IntLicense License;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find the Int prefix confusing. How about ProtectionLicense or UserLicense?

end Protection;

record IntLicense "Internal class name, do not use"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it look cleaner like this,

Suggested change
record IntLicense "Internal class name, do not use"
record IntLicense "Type of Protection.License"

or without any description at all?

Suggested change
record IntLicense "Internal class name, do not use"
record IntLicense

@@ -2350,26 +2351,26 @@ \subsection{Licensing}\label{licensing}

In order that the protected class can be used either a tool specific license manager, or a license file (called \lstinline!licenseFile!) must be present.
The license file is standardized.
It is a Modelica package without classes that has a \lstinline!Protection! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:
It is a Modelica package without classes that has a \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Grammar:

Suggested change
It is a Modelica package without classes that has a \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:
It is a Modelica package without classes that has an \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:

end License;
end Protection;
record Authorization
/*literal*/ constant String licensor = "" "Optional string to show information about the licensor";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, no need to point out optionality anymore:

Suggested change
/*literal*/ constant String licensor = "" "Optional string to show information about the licensor";
/*literal*/ constant String licensor = "" "Information about the licensor";

using the following definition:
\begin{lstlisting}[language=modelica]
record License
/*literal*/ constant String licensee = "" "Optional string to show information about the licensee";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar:

Suggested change
/*literal*/ constant String licensee = "" "Optional string to show information about the licensee";
/*literal*/ constant String licensee = "" "Information about the licensee";

/*literal*/ constant String licensee = "" "Optional string to show information about the licensee";
/*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses";
/*literal*/ constant String features[:] "Activated library license features";
/*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar:

Suggested change
/*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD";
/*literal*/ constant String startDate = "" "Start date in UTCformat YYYY-MM-DD";

/*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses";
/*literal*/ constant String features[:] "Activated library license features";
/*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD";
/*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar:

Suggested change
/*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD";
/*literal*/ constant String expirationDate = "" "Expiration date in UTCformat YYYY-MM-DD";

/*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD";
/*literal*/ constant String operations[:] "Library usage conditions";
end License;
\end{lstlisting}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Somewhere below here, the default behaviors should be explained:

Suggested change
\end{lstlisting}
\end{lstlisting}
If \lstinline!startDate! or \lstinline!expirationDate! are empty (the default), the license has no start day or expiration date, respectively.

Copy link
Collaborator

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

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

The cleanup looks good to me, but since System Modeler does not implement this annotation, I am not in a good position to provide a review with approval.

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.

How to use the Protection annotation(s)
2 participants