-
Notifications
You must be signed in to change notification settings - Fork 2
/
modLog.vb
62 lines (40 loc) · 2.04 KB
/
modLog.vb
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
Option Strict Off
Option Explicit On
Module modLog
Public Function encAdd(ByVal id As Integer, ByVal ch As Integer, ByVal att As modMain.OBJ_ATT, ByVal measure As Integer, ByVal pos As Integer, ByRef value As String) As String
encAdd = modInput.strFromNum(modMain.CMD_LOG.OBJ_ADD) & encAddDel(id, ch, att, measure, pos, value)
End Function
Public Function encDel(ByVal id As Integer, ByVal ch As Integer, ByVal att As modMain.OBJ_ATT, ByVal measure As Integer, ByVal pos As Integer, ByRef value As String) As String
encDel = modInput.strFromNum(modMain.CMD_LOG.OBJ_DEL) & encAddDel(id, ch, att, measure, pos, value)
End Function
Public Function encAddDel(ByVal id As Integer, ByVal ch As Integer, ByVal att As modMain.OBJ_ATT, ByVal measure As Integer, ByVal pos As Integer, ByRef value As String) As String
encAddDel = modInput.strFromNum(id, 4) & modInput.strFromNum(ch, 2) & att & modInput.strFromNum(measure) & modInput.strFromNum(pos, 3) & value
End Function
Public Function decAdd(ByRef code As String, ByVal num As Integer) As g_udtObj
With decAdd
.lngID = modInput.strToNum(Mid(code, 3, 4))
g_lngObjID(.lngID) = num
.intCh = modInput.strToNum(Mid(code, 7, 2))
.intAtt = CShort(Mid(code, 9, 1))
.intMeasure = modInput.strToNum(Mid(code, 10, 2))
.lngPosition = modInput.strToNum(Mid(code, 12, 3))
.sngValue = CSng(Mid(code, 15))
'.intSelect = Selected
End With
End Function
Public Sub decDel(ByRef code As String)
Call modDraw.RemoveObj(g_lngObjID(modInput.strToNum(Mid(code, 3, 4))))
End Sub
Public Sub decMove(ByRef code As String, ByRef obj As g_udtObj)
With obj
.intCh = Val("&H" & Mid(code, 14, 2))
.intMeasure = modInput.strToNum(Mid(code, 16, 2))
.lngPosition = modInput.strToNum(Mid(code, 18, 3))
.intSelect = modMain.OBJ_SELECT.Selected
End With
End Sub
'セパレータ文字列を返却する
Public Function getSeparator() As String
getSeparator = vbNullChar
End Function
End Module