# MeasureOperation

**Kind:** Class

**Source:** `Pams/Web/Pams.Web/Client/app/models/dashboard/dashboard-data-fields.ts` (line 277)

**Part of:** [Pams](subsystem-pams)

`MeasureOperation` represents a dashboard measure field and its display metadata. It tracks visibility, stored and field names, measure type, and caption through getter and setter methods.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `isHidden` | `isHidden()` | `boolean` |
| `setHidden` | `setHidden(flag: boolean)` | `void` |
| `GetStoredName` | `GetStoredName()` | `string` |
| `SetStoredName` | `SetStoredName(name: string)` | `void` |
| `GetFieldName` | `GetFieldName()` | `string` |
| `SetFieldName` | `SetFieldName(name: string)` | `void` |
| `GetType` | `GetType()` | `Measure` |
| `SetType` | `SetType(type: Measure)` | `void` |
| `GetCaption` | `GetCaption()` | `string` |
| `SetCaption` | `SetCaption(input: string)` | `void` |
| `SetDataType` | `SetDataType(ty: DataTypeEnum)` | `void` |
| `GetDataType` | `GetDataType()` | `DataTypeEnum` |

## Where it refuses work

- `MeasureOperation` stops the work with an early return when `this.Field.StoredName`.
- `MeasureOperation` stops the work with an early return when `this.Field.FieldName`.

## Diagram

```mermaid
graph LR
  MeasureOperation --> Hidden["Hidden state"]
  MeasureOperation --> StoredName["Stored name"]
  MeasureOperation --> FieldName["Field name"]
  MeasureOperation --> Type["Measure type"]
  MeasureOperation --> Caption["Caption"]
  Type --> Measure
```

## Usage

```ts
import { MeasureOperation } from "./models/dashboard/dashboard-data-fields";

const operation = new MeasureOperation();

operation.SetStoredName();
operation.SetFieldName();
operation.SetType();
operation.SetCaption();

if (!operation.isHidden()) {
  console.log({
    storedName: operation.GetStoredName(),
    fieldName: operation.GetFieldName(),
    type: operation.GetType(),
    caption: operation.GetCaption(),
  });
}

// Hide the measure from dashboard output.
operation.setHidden();
```

## AI Coding Instructions

- Keep getter and setter calls aligned with the existing method casing, including `isHidden()` and `setHidden()`.
- Do not add arguments to the parameterless setter methods unless the class API changes.
- Read display text through `GetCaption()` and field identifiers through `GetFieldName()` or `GetStoredName()`.
- Check `isHidden()` before rendering or including a measure in dashboard output.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (1)

- `DashboardWidgetOperationsService` — `Pams/Web/Pams.Web/Client/app/services/dashboard/dashboard-widget-operations.service.ts`:1
