diff --git a/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml b/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml index d59ec0f5f..39ff829e4 100644 --- a/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml +++ b/swagger/sdrangel/api/swagger/include/GLSpectrum.yaml @@ -578,6 +578,112 @@ SpectrumActions: type: integer minimum: 0 +GLSpectrumHistory: + description: > + Statistics over the rows of spectrum history the GUI keeps for scrolling, reduced to a number + of bins. Powers are in dB whatever the display shows. The floor is the median of the per bin + means, and a bin counts as occupied in a row when it is above the floor by the threshold. + Rows taken with another centre frequency or sample rate are skipped and counted. + properties: + centerFrequency: + type: integer + format: int64 + bandwidth: + type: integer + description: "Width of the whole spectrum in Hz." + startFrequency: + type: integer + format: int64 + description: "Centre frequency of the first returned bin in Hz." + stopFrequency: + type: integer + format: int64 + description: "Centre frequency of the last returned bin in Hz." + binBandwidth: + type: integer + description: "Width of each returned bin in Hz." + bins: + type: integer + rows: + type: integer + description: "Rows of history used." + skippedRows: + type: integer + description: "Rows in the period that were taken with the device tuned or sampling differently, and left out." + firstTime: + type: string + description: "Time of the oldest row used, ISO 8601." + lastTime: + type: string + description: "Time of the newest row used, ISO 8601." + seconds: + type: number + format: float + description: "Span between the oldest and newest rows used." + floorDb: + type: number + format: float + description: "The measured noise floor." + thresholdDb: + type: number + format: float + description: "The level above which a bin counts as occupied." + maxDb: + type: array + items: + type: number + format: float + description: "Per bin maximum over the rows." + meanDb: + type: array + items: + type: number + format: float + description: "Per bin mean over the rows." + occupancy: + type: array + items: + type: number + format: float + description: "Per bin fraction of rows in which the bin was above the threshold, 0 to 1." + signalCount: + type: integer + signals: + type: array + items: + $ref: "#/SpectrumHistorySignal" + description: "Runs of adjacent bins whose maximum rose above the threshold." +SpectrumHistorySignal: + description: A signal found in the spectrum history + properties: + frequency: + type: integer + format: int64 + description: "Frequency of the strongest bin in Hz." + startFrequency: + type: integer + format: int64 + description: "Lower edge in Hz." + stopFrequency: + type: integer + format: int64 + description: "Upper edge in Hz." + bandwidth: + type: integer + description: "Width in Hz, to the bin." + peakDb: + type: number + format: float + dutyCycle: + type: number + format: float + description: "Fraction of rows in which any bin of the signal was above the threshold, 0 to 1: 1 for a continuous carrier, small for a burst." + firstSeen: + type: string + description: "Time of the first row it was up in, ISO 8601." + lastSeen: + type: string + description: "Time of the last row it was up in, ISO 8601." GLSpectrumData: description: > A copy of the current power spectrum, reduced to the number of bins asked for so that the diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index f3c485357..0f34c7d80 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -1097,6 +1097,24 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/windows: + x-swagger-router-controller: instance + get: + description: List the windows of the GUI with their workspace and whether each is hidden (GUI) + operationId: instanceWindowsGet + tags: + - Instance + responses: + "200": + description: On success return the window list + schema: + $ref: "#/definitions/WindowList" + "500": + description: Error + schema: + $ref: "#/definitions/ErrorResponse" + "501": + description: Function not implemented /sdrangel/workspace/{workspaceIndex}/actions: x-swagger-router-controller: instance post: @@ -1408,6 +1426,127 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/deviceset/{deviceSetIndex}/spectrum/history: + x-swagger-router-controller: deviceset + get: + description: > + Statistics over the spectrum history the GUI keeps for scrolling: per bin maximum, mean and + occupancy over a period, and the signals found. Only rows taken with the device tuned and + sampling as it is now are used. Needs scrolling enabled in the spectrum settings (scrollBar, + scrollLength); the server keeps no history + operationId: devicesetSpectrumHistoryGet + tags: + - DeviceSet + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - name: seconds + in: query + description: How far back to look, in seconds (default 60) + required: false + type: number + format: float + - name: bins + in: query + description: Number of bins to reduce the spectrum to, 1 to 4096 (default 128) + required: false + type: integer + - name: startFrequency + in: query + description: Lowest frequency to include in Hz. Default is the start of the spectrum + required: false + type: integer + format: int64 + - name: stopFrequency + in: query + description: Highest frequency to include in Hz. Default is the end of the spectrum + required: false + type: integer + format: int64 + - name: threshold + in: query + description: How far above the measured floor a bin must rise to count as occupied, in dB (default 6) + required: false + type: number + format: float + responses: + "200": + description: On success return the statistics + schema: + $ref: "http://swgserver:8081/api/swagger/include/GLSpectrum.yaml#/GLSpectrumHistory" + "400": + description: Invalid parameters + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Invalid index, or no history + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + /sdrangel/deviceset/{deviceSetIndex}/spectrum/history/image: + x-swagger-router-controller: deviceset + get: + description: > + The spectrum history as a greyscale PNG waterfall, one pixel per bin across and one per row + down with the newest row at the bottom, black a little below the noise floor and white at + the strongest bin. The frequency and time extents come back in X-Spectrum-History headers + and in the JSON form of the same call + operationId: devicesetSpectrumHistoryImageGet + tags: + - DeviceSet + produces: + - image/png + parameters: + - in: path + name: deviceSetIndex + type: integer + required: true + description: Index of device set in the device set list + - name: seconds + in: query + description: How far back to look, in seconds (default 60) + required: false + type: number + format: float + - name: bins + in: query + description: Width in pixels, 1 to 4096 (default 512) + required: false + type: integer + - name: rows + in: query + description: At most this many rows, the most recent (default 512, up to 4000) + required: false + type: integer + - name: startFrequency + in: query + description: Lowest frequency to include in Hz. Default is the start of the spectrum + required: false + type: integer + format: int64 + - name: stopFrequency + in: query + description: Highest frequency to include in Hz. Default is the end of the spectrum + required: false + type: integer + format: int64 + responses: + "200": + description: The PNG image + "400": + description: Invalid parameters + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Invalid index, or no history + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" /sdrangel/deviceset/{deviceSetIndex}/spectrum/server: x-swagger-router-controller: deviceset get: @@ -3262,13 +3401,42 @@ definitions: $ref: "#/definitions/Channel" WorkspaceInfo: - description: "Workspace information" - required: - - index + description: "Where a window is and whether it is shown (GUI). On a PUT either field may be given alone: index moves the window, hidden hides or shows it" properties: index: description: index of workspace in the list of workspaces type: integer + hidden: + description: "1 when the window is hidden, 0 when it is shown. Showing a window also raises it and shows the workspace holding it" + type: integer + WindowList: + description: "Every device, spectrum, channel and feature window of the GUI" + properties: + windowCount: + type: integer + windows: + type: array + items: + $ref: "#/definitions/WindowInfo" + WindowInfo: + description: "One window of the GUI" + properties: + kind: + description: "device, spectrum, channel or feature" + type: string + deviceSetIndex: + description: "Index of the device set, for a device, spectrum or channel window" + type: integer + index: + description: "Channel index within the device set, or feature index; absent for a device or spectrum window" + type: integer + title: + type: string + workspaceIndex: + type: integer + hidden: + description: "1 when the window is hidden, 0 when it is shown" + type: integer WorkspaceActions: description: "Actions on a workspace"