Реализован конфиг для периферии
This commit is contained in:
parent
edc4d71cbb
commit
56fab28e2d
@ -12,3 +12,26 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: b6c402b0f3ea7f84e850eca922f0544e, type: 3}
|
||||
m_Name: PeripherialConfig
|
||||
m_EditorClassIdentifier: Assembly-CSharp::PeripherialConfig
|
||||
PeripherialController:
|
||||
Enable: 1
|
||||
PortName: COM3
|
||||
BaudRate: 115200
|
||||
DataBits: 8
|
||||
Parity: 0
|
||||
StopBits: 1
|
||||
ReadTimeoutMs: 5
|
||||
WriteTimeoutMs: 10
|
||||
UseAuthorization: 0
|
||||
AES_Key: 6940c70ef2c7457072cd2858998f73a85f5fedb4c162b424acd7a3d6d80b5037
|
||||
InputStingType: 0
|
||||
ReverseInputString: 1
|
||||
VitrinaController:
|
||||
Enable: 0
|
||||
PortName: COM4
|
||||
BaudRate: 115200
|
||||
DataBits: 8
|
||||
Parity: 0
|
||||
StopBits: 1
|
||||
ReadTimeoutMs: 5
|
||||
WriteTimeoutMs: 10
|
||||
BoxesCount: 5
|
||||
|
||||
@ -4,5 +4,6 @@ using UnityEngine;
|
||||
[CreateAssetMenu(fileName = "PeripherialConfig", menuName = "SO_Configs/PeripherialConfig")]
|
||||
public class PeripherialConfig : ScriptableObject
|
||||
{
|
||||
List<>
|
||||
public ControllerDevice Controller;
|
||||
public VitrinaDevice Vitrina;
|
||||
}
|
||||
|
||||
16
Assets/Scripts/Common/Peripherial/ComDevice.cs
Normal file
16
Assets/Scripts/Common/Peripherial/ComDevice.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public abstract class AbstractComDevice
|
||||
{
|
||||
[Header("Настройка подключения")]
|
||||
public bool Enable = true;
|
||||
public string PortName = "COM3";
|
||||
public int BaudRate = 115200;
|
||||
public int DataBits = 8;
|
||||
public int Parity = 0;
|
||||
public int StopBits = 1;
|
||||
public int ReadTimeoutMs = 5;
|
||||
public int WriteTimeoutMs = 10;
|
||||
}
|
||||
2
Assets/Scripts/Common/Peripherial/ComDevice.cs.meta
Normal file
2
Assets/Scripts/Common/Peripherial/ComDevice.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d6b42d5330322f4993c6bf62a4c9c9d
|
||||
24
Assets/Scripts/Common/Peripherial/ControllerDevice.cs
Normal file
24
Assets/Scripts/Common/Peripherial/ControllerDevice.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class ControllerDevice : AbstractComDevice
|
||||
{
|
||||
[Header("Настройка периферийного контроллера")]
|
||||
public bool UseAuthorization = false;
|
||||
public byte[] AES_Key = {
|
||||
0x69, 0x40, 0xC7, 0x0E, 0xF2, 0xC7, 0x45, 0x70,
|
||||
0x72, 0xCD, 0x28, 0x58, 0x99, 0x8F, 0x73, 0xA8,
|
||||
0x5F, 0x5F, 0xED, 0xB4, 0xC1, 0x62, 0xB4, 0x24,
|
||||
0xAC, 0xD7, 0xA3, 0xD6, 0xD8, 0x0B, 0x50, 0x37
|
||||
};
|
||||
public InputStingTypes InputStingType = InputStingTypes.Decimal;
|
||||
public bool ReverseInputString = true;
|
||||
|
||||
|
||||
public enum InputStingTypes
|
||||
{
|
||||
Decimal,
|
||||
Binary
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a57aba2df3204f543a6b01831aba3457
|
||||
9
Assets/Scripts/Common/Peripherial/VitrinaDevice.cs
Normal file
9
Assets/Scripts/Common/Peripherial/VitrinaDevice.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class VitrinaDevice : AbstractComDevice
|
||||
{
|
||||
[Header("Настройки витрины")]
|
||||
public uint BoxesCount = 5;
|
||||
}
|
||||
2
Assets/Scripts/Common/Peripherial/VitrinaDevice.cs.meta
Normal file
2
Assets/Scripts/Common/Peripherial/VitrinaDevice.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ae9556987195634f9d23f06c53e0bab
|
||||
Loading…
x
Reference in New Issue
Block a user