Skip to content

Commit

Permalink
Link fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitskevich committed Nov 22, 2022
1 parent c37ac02 commit 6989ada
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ should be read from the device on-line and not taken from the database of recent

There are several ways to access networks/devices/parameters and also some additional options
available for this attribute. You can find the list in the
[reference section](/Overvis/References/Visualizations.md).
[reference section](/OCP/References/Visualizations.md).

We do similar code modifications for the rest of the fridge boxes. Afterward, we update the code of
the visualization in Overvis to check the result:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Now clicking on the setpoint value opens the "Edit value" window:
`on-click` attribute can do several other things, like sending a user to another visualization,
increment the parameters, toggle the parameter between two values, etc. We will use some of these
features later in the tutorial. For a full list, please see
[the reference section.](/Overvis/References/Visualizations.md)
[the reference section.](/OCP/References/Visualizations.md)

As a final change, we have also added `cursor:pointer;` into the content of the `style` attribute.
It just changes the mouse cursor to the "finger" pointer when a user hovers over the setpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ This example has demonstrated the basic features of Overvis visualizations that
among hundreds of dashboards that we created. With this knowledge, you can create any simple
equipment state representation for yourself or your customers.
[The next examples](../../03-html-example/README.md) will introduce you to the more advanced
tricks. Or you can check the [reference document](/Overvis/References/Visualizations.md) and start
tricks. Or you can check the [reference document](/OCP/References/Visualizations.md) and start
creating your own dashboards.
98 changes: 56 additions & 42 deletions OCP/References/API/Device_Parameter_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@

## <a name='Get-parameter-identifier-by-reference'></a> `POST /org/:orgId/params/get-id-by-reference/` - Get parameter identifier by reference

This request take parameter reference string (https://docs.overvis.com/#/Overvis/References/Visualizations?id=device-parameters-can-be-referenced-in-one-of-the-following-ways) as argument ans returns ID of this parameter inside system.
This request take parameter reference string
(https://docs.overvis.com/#/OCP/References/Visualizations?id=device-parameters-can-be-referenced-in-one-of-the-following-ways)
as argument ans returns ID of this parameter inside system.

```
POST /org/:orgId/params/get-id-by-reference/
```
*Required account permissions:* `operator`

_Required account permissions:_ `operator`

### Parameters - `Params`
| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|

| Name | Type | Description |
| :------ | :------- | :-------------------------- |
| `orgId` | `Number` | System IDs of organization. |

### Parameters - `Body`
| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|

| Name | Type | Description |
| :---------- | :------- | :-------------------------- |
| `emptyName` | `String` | Parameter reference string. |

### Examples
Expand All @@ -42,27 +47,32 @@ curl -s -S -H "Content-Type: application/json" -H "Authorization: token $TOKEN"

```json
{
"errorCode": "ObjectNotFound",
"errorMessage": "Parameter not found."
"errorCode": "ObjectNotFound",
"errorMessage": "Parameter not found."
}
```


## <a name='Read-current-value-of-the-parameter-from-the-device'></a> `GET /params/read-realtime/` - Read current value of the parameter from the device

Performs reading from the device and returns values of the requested parameters.</p> <p>More than one value can be requested at a time. Results will be returned as a dictionary where key is a parameter ID. Returned values are automatically converted from Modbus registers (16 bit groups) to the actual parameter value number depending on the parameter type.</p> <p>If some parameter ID is not found, it will be ommited from the result.
Performs reading from the device and returns values of the requested parameters.</p> <p>More than
one value can be requested at a time. Results will be returned as a dictionary where key is a
parameter ID. Returned values are automatically converted from Modbus registers (16 bit groups) to
the actual parameter value number depending on the parameter type.</p> <p>If some parameter ID is
not found, it will be ommited from the result.

```
GET /params/read-realtime/
```
*Required account permissions:* `demo`

_Required account permissions:_ `demo`

### Parameters - `Querystring`
| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|
| `paramIds` | `String` | System IDs of parameters that should be read. |
| `lang` | `String` | The language of the returned message, one of: `en`, `ru`, `pl`. Needed for representations of bit values (yes/no, on/off, etc.) |
| `failbackToDb` | `Boolean` | Get value from the database if no real readings. |

| Name | Type | Description |
| :------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------ |
| `paramIds` | `String` | System IDs of parameters that should be read. |
| `lang` | `String` | The language of the returned message, one of: `en`, `ru`, `pl`. Needed for representations of bit values (yes/no, on/off, etc.) |
| `failbackToDb` | `Boolean` | Get value from the database if no real readings. |

### Examples

Expand All @@ -78,39 +88,45 @@ curl -s -S -H "Content-Type: application/json" -H "Authorization: token $TOKEN"

### Success response

| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|
| `value` | `String` | The current value of the parameter in numeric form. |
| Name | Type | Description |
| :--------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value` | `String` | The current value of the parameter in numeric form. |
| `formattedValue` | `String` | The current value of the parameter as a string ready for display to a user. For example, bit values may be formatted as "True" or "False" depending on the parameter setting. Numeric formatted values are automatically rounded depending on value type and multiplicator. |

### Success response example

```json
{
"537": { "value": "1", "formattedValue": "Yes" },
"545": { "value": "-1", "formattedValue": "-1" },
"546": { "value": "12.3400001", "formattedValue": "12.34" },
"537": { "value": "1", "formattedValue": "Yes" },
"545": { "value": "-1", "formattedValue": "-1" },
"546": { "value": "12.3400001", "formattedValue": "12.34" }
}
```


## <a name='Write-parameter-value-to-the-device'></a> `POST /param/:paramId/write/` - Write parameter value to the device

This requests takes a numeric value, converts it to the device registers values (one or more 16 bit packets) and sends it to the device. It takes network and device information by the parameter system ID.</p> <p>Before writing, system tries to read the current value of the parameter and returns it along with the new one.</p> <p>Value is truncated to a specific precision different for each parameter type, for example if you send "22.22" to a u16 parameter, only "22" will be written.
This requests takes a numeric value, converts it to the device registers values (one or more 16 bit
packets) and sends it to the device. It takes network and device information by the parameter
system ID.</p> <p>Before writing, system tries to read the current value of the parameter and
returns it along with the new one.</p> <p>Value is truncated to a specific precision different for
each parameter type, for example if you send "22.22" to a u16 parameter, only "22" will be written.

```
POST /param/:paramId/write/
```
*Required account permissions:* `operator`

_Required account permissions:_ `operator`

### Parameters - `Params`
| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|

| Name | Type | Description |
| :-------- | :------- | :----------------------- |
| `paramId` | `Number` | System IDs of parameter. |

### Parameters - `Body`
| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|

| Name | Type | Description |
| :--------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `newValue` | `String` | Value to be written as a string. Depends on the parameter type. For signed/unsigned integer types, bit groups and float types provide numeric value as a string, e.g. "-1234.56". For bit type, provide "0" or "1". |

### Examples
Expand All @@ -130,30 +146,28 @@ curl -s -S -H "Content-Type: application/json" -H "Authorization: token $TOKEN"

### Success response

| Name | Type | Description |
|:---------|:-----------|:--------------------------------------|
| `ok` | `Object` | Object containing `oldValue` and `newValue` on success. |
| `err` | `String` | Error message returned by the device communication backend. It is not request failure, so it is returned with status 200 in a response body. All request errors are returned as usual with 4xx/5xx statuses and body as described in the <a href="README.md">main section.</a> |
| `oldValue` | `String` | Old parameter value before writing. |
| `newValue` | `String` | Value that was sent by this request. |
| Name | Type | Description |
| :--------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ok` | `Object` | Object containing `oldValue` and `newValue` on success. |
| `err` | `String` | Error message returned by the device communication backend. It is not request failure, so it is returned with status 200 in a response body. All request errors are returned as usual with 4xx/5xx statuses and body as described in the <a href="README.md">main section.</a> |
| `oldValue` | `String` | Old parameter value before writing. |
| `newValue` | `String` | Value that was sent by this request. |

### Success response example

```json
{
"ok": {
"oldValue": "22",
"newValue": "1"
}
"ok": {
"oldValue": "22",
"newValue": "1"
}
}
```

### Error response example

```json
{
"err": "can't compose new value"
"err": "can't compose new value"
}
```


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Here you can find the documentation for the Overvis products and related technol

## Cloud Software

- [Overvis Cloud Documentation](Overvis/)
- [Overvis Cloud Documentation](OCP/)

## Equipment

Expand Down

0 comments on commit 6989ada

Please sign in to comment.