Révision 6d81a22a

Voir les différences:

TestBLE/TestBLE/Models/ReponsePesee.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4

  
5
namespace TestBLE.Models
6
{
7
    public class ReponsePesee
8
    {
9
        private int numPlateau;
10

  
11
        public int NumPlateau
12
        {
13
            get { return numPlateau; }
14
            set { numPlateau = value; }
15
        }
16

  
17
        private int typePlateau;
18

  
19
        public int TypePlateau
20
        {
21
            get { return typePlateau; }
22
            set { typePlateau = value; }
23
        }
24

  
25
        private int poidsMesure;
26

  
27
        public int PoidsMesure
28
        {
29
            get { return poidsMesure; }
30
            set { poidsMesure = value; }
31
        }
32

  
33
        private bool isNegative;
34

  
35
        public bool IsNegative
36
        {
37
            get { return isNegative; }
38
            set { isNegative = value; }
39
        }
40

  
41
        public ReponsePesee(string data)
42
        {
43
            NumPlateau = data[0];
44
            TypePlateau = data[1];
45
            IsNegative = data[3] == '-';
46
        }
47
    }
48
}
TestBLE/TestBLE/Models/WeightingResponse.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4

  
5
namespace TestBLE.Models
6
{
7
    public class WeightingResponse
8
    {
9
        private int trayNumber;
10

  
11
        public int TrayNumber
12
        {
13
            get { return trayNumber; }
14
            set { trayNumber = value; }
15
        }
16

  
17
        private int trayType;
18

  
19
        public int TraytType
20
        {
21
            get { return trayType; }
22
            set { trayType = value; }
23
        }
24

  
25
        private int measuredWeight;
26

  
27
        public int MeasuredWeight
28
        {
29
            get { return measuredWeight; }
30
            set { measuredWeight = value; }
31
        }
32

  
33
        private bool isNegative;
34

  
35
        public bool IsNegative
36
        {
37
            get { return isNegative; }
38
            set { isNegative = value; }
39
        }
40

  
41
        public WeightingResponse(string data)
42
        {
43

  
44
        }
45
    }
46
}
TestBLE/TestBLE/ViewModels/DeviceViewModel.cs
80 80
        private void DataReceived(string recData)
81 81
        {
82 82
            IsVisibleData = true;
83
            ReponsePesee resp = new ReponsePesee(recData);
83 84
            string cleanData = recData.Trim();
84 85
            Data += cleanData + "\n";
85 86
        }

Formats disponibles : Unified diff