Namespace Hi.Licenses
Classes
- AuthorizationFailedEventArgs
Event arguments for authorization failure events.
- CloudStepHint
Internal Use Only. The account's step quota as the licence server last described it, kept in CloudStepHint by the cloud lease client (HiNc) for the machining runner (HiMech) to word a refused step from: the server's
stepQuotablock of a lease answer (the rolling week of a verified account, kindweekly, or the one-time trial of an unverified one, kindoneTime) with the answer'sverifiedand the lease's tier. Immutable: a snapshot, since the client replaces the hint at every sync while the runner reads it. A plan without a quota – a paid plan, whose answer has nostepQuota– has QuotaKind null and every count 0.
- LeaseSource
Internal Use Only. The cloud lease as the licence source of this process. The source is decided once per process: Sentinel mode, the default, is today's behaviour line for line, with hasp behind every gate; lease mode, entered by Use(), answers every gate (Login(AuthFeature), IsLoggedIn(AuthFeature), the native cache checks, the composition and feature queries) from the grants of the last VERIFIED Install(string, int, string) and never calls hasp. The native provider does no file I/O and verifies once per install: the token, its file and the server protocol belong to the cloud lease client in HiNc, which also writes StopReason and CloudStepHint and raises LeaseRestored and TierChanged. Every P/Invoke here is declared on the CoreDll constant: touching this class does not run License's static constructor, so a login host that only installs a lease never starts the licence watchdog. A process without the lease exports in its core (an older
core.dll) reads as Sentinel mode from IsActive, State and SecondsLeft, while Use() and Install(string, int, string) throw EntryPointNotFoundException as any P/Invoke would.
- LeaseTierChange
Internal Use Only. What TierChanged carries: the plan tier of the lease installed before and the one just installed, with the new lease's caps and quota and, when the old licence ended, its end – everything the
CloudLease–TierChangedmessage says. Immutable.
- License
License of this module.
- LicenseCaps
Internal Use Only. The two licence caps the native locker holds, independent of the licence source, both 0 = no cap. The resolution cap ratio N: the finest cube width a cube tree may be subdivided to is its reference size – the longest side of the bounding box of the geometry it was built from – over N, taken to the powers-of-two width ladder at its finest rung not finer than it (the coarser of the two rungs around the quotient, an exact rung kept: 65 mm at 1/128 is 1 mm, at 1/512 0.25 mm). The clamp points are the native build from a shape, which takes the licensed width when a finer one is asked, and the subtraction and addition ratchets of the cuts, which refine the tree no further than it; a
.wctis read whatever its resolution, and a stock finer than the licence runs its cuts no finer than its own width. The step cap: the number of machining steps granted since the last runner reset; at the cap ConsumeStep(int) refuses and the run stops (MachiningParallelProc.RunStep,MachiningSession.RunNcLines); an expired cloud lease refuses the same way, before the cap logic (StepGrant). Beside the caps the locker holds the cloud lease's step grant: the steps the licence server reserved for the installed lease (itssgrantclaim, drawn on the account's weekly quota or one-time trial), set by every install, counted down by every granted step and lowered by the cloud lease client to what the chain has left (TightenLeaseSteps(long)); at 0 ConsumeStep(int) refuses after the cap logic (LeaseStepsExhausted), and a runner reset does not refill it – the next install does. The Sentinel source never sets either cap nor a grant, so with both caps at 0 and the grant at -1 every result is what it was before the caps existed; the cloud lease provider sets them from the lease (native, internal); the tests tighten them through TightenForTest(int, int) and TightenLeaseStepsForTest(long), which can never loosen what the source set. The effective cap is the tightest of the source's and the test's values. The state is process-global, and every read here is a relaxed atomic load on the native side.
- MainLicenseStatus
Internal Use Only. The rule that picks, of the two main-licence logins (HiApi and HiApiSubstitute), the Sentinel status that says why neither was granted: HiApi's, except where the key lacks HiApi (HASP_FEATURE_NOT_FOUND) and the substitute, which takes its place on such a key, failed for another reason. Shared by the watchdog's refusal message (GetHiApiRefusalDetail(int?, int?)), the licence dialog (SentinelKeyInfo) and the installed HiNC's start-up message (HiNc's
SentinelRefusalNotice); a class of its own so neither read runs License's static constructor.
- SentinelKeyInfo
Internal Use Only. The Sentinel key behind the main licence, as a login of its own finds it at the moment of Read(): HiApi, else HiApiSubstitute; the key that serves it, the terms the business sets on it – the main licence's end, its seats, and the end of AdvancedPhysics – and the computer whose Sentinel service holds the key. What the licence dialog of the installed HiNC shows for a Sentinel licence.
- UsageCount
Internal Use Only. The count of one feature id in a usage report: the uses and the seconds (
{“n”:1,“s”:2}on the wire; the server takes each of 0 to MaxValue). Public with public get/set because the shipped assembly is obfuscated and System.Text.Json works on the runtime property names (theCloudJsontrap).
- UsageFeature
Internal Use Only. The fixed feature ids a usage report counts (Counts), each of the form the licence server accepts,
[a-z][a-z0-9.-]{0,31}; Count(string, TimeSpan?) ignores any other id. The list is the client's and the server's shared vocabulary: a new feature is a new constant here, added to All, and nothing else – the report has no field per feature, the counts object is the extensible slot. Each id counts one use (N) and, where the caller measures it, the seconds it took (S, rounded up).
- UsageMeter
Internal Use Only. The usage meter of a cloud-licensed process: the machining steps counted since the last flush – each a step the step pipeline took, granted by the licence and queued, not one refused before or after its grant – which the cloud lease client books onto the chain's
stepsTotal(the account's step ledger, the data the service needs), and, when the account's analytics switch is on, the usage reports (UsageReportDraft: steps, play, workpiece size, resolutions and feature counts per period) the client queues and sends with its syncs. Process-global and static like LicenseCaps; no file I/O – the files are the client's.Enabled is false by default and every producer entry point (StepGranted(), PlayReset(), NotePlay(UsagePlaySnapshot), Count(string, TimeSpan?)) reads it first and returns: a Sentinel-licensed process pays one volatile read per step and nothing else. The cloud lease client enables it at its start and disables it at its shutdown, after the last take. CollectReports is the analytics switch: off, the steps are still counted (the ledger) and nothing else is -- no report opens, no count, no snapshot.
A report opens at the first event after none is open and closes at the runner's reset (PlayReset(), when the play saw a step or an NC run), at the first event more than 60 minutes after it opened (the server refuses a longer period; the next report carries the play's ordinal and snapshot on), and at the shutdown's take. Its period runs from the event that opened it to its last event. The play ordinal (PlaySeq) is the closed plays that saw a step or an NC run, plus one, given to the open report at its first step or NC run; two resets without a play in between keep it.
Threads: StepGranted() runs on the machining thread of every session (
MachiningParallelProc.RunStep, once per step the pipeline took), NotePlay(UsagePlaySnapshot) there once per play, PlayReset() on the runner's reset, Count(string, TimeSpan?) on whichever thread finishes a feature -- a session's thread, the webservice's request thread; TakePending(bool), ReopenOnFailure(UsagePending) and ClearCollected() on the cloud lease client's threads (the holder's loop, a secondary's poll, the shutdown) under the client's gate; Snapshot() on a controller's thread. The step count is an interlocked counter outside any lock; everything about the reports is under one meter lock. The meter lock is a leaf: it holds no file I/O, reads no clock (the time is taken before it), calls nothing outside the meter and raises no event, so it never waits on another lock, and a call under any lock of the client -- the file lock included -- cannot deadlock. The lock order with the client isstickGate->gate-> the meter lock ->usage.lock-> the client's consent lock (a leaf of its own: file I/O onconsent.jsonalone, waiting on nothing): a flush takes the file lock after TakePending(bool) returned.Every time is UTC at whole seconds from UtcNow, the seam the facts move.
- UsageMeterSnapshot
Internal Use Only. The meter's state as Snapshot() copies it, for the product's usage page: nothing in it is shared with the meter.
- UsagePending
Internal Use Only. What TakePending(bool) moved out of the meter for one flush: the steps counted since the last take, and the closed reports, oldest first. A flush that fails gives it back whole through ReopenOnFailure(UsagePending).
- UsagePlaySnapshot
Internal Use Only. What the machining runner notes once per play at its first counted step (NotePlay(UsagePlaySnapshot)): the workpiece's reference box and the two resolutions, and the feature ids of the play's switches (PlayCollision, PlayPhysics, one
play.motion.*), each counted once.
- UsageReportDraft
Internal Use Only. One usage report as the cloud lease client sends it in the
reportsarray of a lease request – the wire names are the camelCase of these properties (CloudJson.Wire), a null left out, which the licence server'sUsageIntake.ReadReportreads – and as the client queues it inusage-queue.json. The report is analytics: the account's step ledger is the chain'sstepsTotal, never these counts. UsageMeter writes it under its lock and hands it out closed; a reader of the open one gets a Clone(). Public with public get/set because the shipped assembly is obfuscated and System.Text.Json works on the runtime property names; the properties are declared in the wire order.
Enums
- AuthFeature
Internal Use Only.
- BlockType
Block type.
- LeaseInstallResult
Internal Use Only. The result of Install(string, int, string): the native
locker__lease_installcodes one for one (the value of each member is the native code). Valid and Expired are installs – the token's grants and caps are in force from then on; every negative member is a refusal that left the previous lease, if any, in force.
- LeaseState
Internal Use Only. The state of the cloud lease provider: the native
locker__lease_statecodes one for one (the value of each member is the native code).
- LicenseType
Defines the types of licenses available.
- StepGrant
Internal Use Only. The answer of ConsumeStep(int): the native
locker__step_consumecodes one for one (the value of each member is the native code). Only Granted grants.