1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*!
# GMT DOS Actors Scope

`gmt_dos-clients_scope` is a client/server graphical display implementation for [gmt_dos-actors](https://docs.rs/gmt_dos-actors/) models.

The communication between the client and the server is secured with a signed certificate
that must be provided by the server.
The authentification certificate is generated by calling `crypto` into a terminal on the server.
`crypto` is installed with
```text
cargo install --bin crypto gmt_dos-clients_transceiver
```
The generated certificate `gmt_dos-clients_transceiver_cert.der` must be uploaded onto the client machine.

`gmt_dos-clients_scope` has 2 features: `server` and `client`.
The `server` feature need to be enabled only on the server applications:
```shell
cargo add gmt_dos-clients_scope --features=server
```
and the `client` feature only on the machine displaying the scopes:
```shell
cargo add gmt_dos-clients_scope --features=client
```
*/

mod payload;

/// Marker for scopes that display signals
pub enum PlotScope {}
/// Marker for scopes that display an image
pub enum ImageScope {}
/// Marker for scopes that display an image with a mask applied to it
pub enum GmtScope {}

/// Scopes marker trait
pub trait ScopeKind {
    fn window_size() -> (f32, f32);
}
impl ScopeKind for PlotScope {
    fn window_size() -> (f32, f32) {
        (800f32, 600f32)
    }
}
impl ScopeKind for ImageScope {
    fn window_size() -> (f32, f32) {
        (800f32, 800f32)
    }
}
impl ScopeKind for GmtScope {
    fn window_size() -> (f32, f32) {
        (800f32, 900f32)
    }
}
/// Image scopes marker trait
pub trait ImageScopeKind: ScopeKind {}
impl ImageScopeKind for ImageScope {}
impl ImageScopeKind for GmtScope {}

#[cfg(any(feature = "client", doc))]
pub mod client;

#[cfg(any(feature = "server", doc))]
pub mod server;