| | | 1 | | using System; |
| | | 2 | | |
| | | 3 | | namespace ReFlex.Core.Tuio.Util |
| | | 4 | | { |
| | | 5 | | /// <summary> |
| | | 6 | | /// Storage class for all "static" values needed to establish TUIO communication. |
| | | 7 | | /// Includes Meta data about Sensor, Connection and Message Encoding. |
| | | 8 | | /// </summary> |
| | | 9 | | public class TuioConfiguration |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Horizontal Pixel Resolution of the Sensor for computation of Dimension |
| | | 13 | | /// </summary> |
| | 49 | 14 | | public int SensorWidth { get; set; } |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Vertical Pixel Resolution of the Sensor for computation of Dimension |
| | | 18 | | /// </summary> |
| | 49 | 19 | | public int SensorHeight { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Name of the Sensor for Specifying the Source. |
| | | 23 | | /// </summary> |
| | 49 | 24 | | public string SensorDescription { get; set; } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Session Id for Alive Messages. |
| | | 28 | | /// </summary> |
| | 49 | 29 | | public int SessionId { get; set; } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// IP of the TUIO Server. Default: "127.0.0.1". |
| | | 33 | | /// </summary> |
| | 110 | 34 | | public string ServerAddress { get; set; } = "127.0.0.1"; |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Port number for the TUIO Server. Default: 3333 |
| | | 38 | | /// </summary> |
| | 107 | 39 | | public int ServerPort { get; set; } = 3333; |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Specify which Message Format will be used. Default: <see cref="ProtocolVersion.TUIO_VERSION_2_0"/> |
| | | 43 | | /// </summary> |
| | 73 | 44 | | public ProtocolVersion Protocol { get; set; } = ProtocolVersion.TUIO_VERSION_2_0; |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Specify which Transport Protocol to be used for communication with the TUIO Server. Default: <see cref="Tran |
| | | 48 | | /// </summary> |
| | 104 | 49 | | public TransportProtocol Transport { get; set; } = TransportProtocol.Udp; |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Specify which TUIO Type is used to encode the ReFelx interactions. Default: <see cref="TuioInterpretation.To |
| | | 53 | | /// </summary> |
| | 161 | 54 | | public TuioInterpretation Interpretation { get; set; } = TuioInterpretation.TouchPoint2DwithPressure; |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// For logging purposes, this returns a well-formed extended string representation of the instance, containing |
| | | 58 | | /// </summary> |
| | | 59 | | public string GetTuioConfigurationString() |
| | 14 | 60 | | { |
| | 14 | 61 | | var result = $"===== {nameof(TuioConfiguration)} ====={Environment.NewLine}"; |
| | 14 | 62 | | result += $" {nameof(SessionId)}: {SessionId}{Environment.NewLine}"; |
| | 14 | 63 | | result += |
| | 14 | 64 | | $" {nameof(SensorDescription)}: {SensorDescription ?? "NONE"} ({nameof(SensorWidth)}: {SensorWidth}, {n |
| | 14 | 65 | | result += |
| | 14 | 66 | | $" {nameof(ServerAddress)}: {ServerAddress ?? "NONE"} | {nameof(ServerPort)}: {ServerPort}{Environment. |
| | 14 | 67 | | result += $" {nameof(ProtocolVersion)}: {Enum.GetName(typeof(ProtocolVersion), Protocol)}{Environment.NewLi |
| | 14 | 68 | | result += |
| | 14 | 69 | | $" {nameof(TransportProtocol)}: {Enum.GetName(typeof(TransportProtocol), Transport)}{Environment.NewLin |
| | 14 | 70 | | result += |
| | 14 | 71 | | $" {nameof(TuioInterpretation)}: {Enum.GetName(typeof(TuioInterpretation), Interpretation)}{Environment |
| | | 72 | | |
| | 14 | 73 | | return result; |
| | 14 | 74 | | } |
| | | 75 | | } |
| | | 76 | | } |