@@ -12,12 +12,13 @@ namespace HMIControl.VisualStudio.Design
12
12
public partial class TagList : Form
13
13
{
14
14
static List < string > list ;
15
- static List < TagMetaData > metaList ;
15
+ static List < TagMetaData > metaList = new List < TagMetaData > ( ) ;
16
+ AutoCompleteStringCollection scAutoComplete = new AutoCompleteStringCollection ( ) ;
16
17
17
18
public static readonly List < DataTypeSource > DataDict = new List < DataTypeSource >
18
19
{
19
20
new DataTypeSource ( DataType . BOOL , "数字量" ) , new DataTypeSource ( DataType . BYTE , "字节" ) , new DataTypeSource ( DataType . SHORT , "短整型" ) ,
20
- new DataTypeSource ( DataType . WORD , "单字型" ) , new DataTypeSource ( DataType . TIME , "时间型 ") , new DataTypeSource ( DataType . INT , "双字型 " ) ,
21
+ new DataTypeSource ( DataType . WORD , "单字型" ) , new DataTypeSource ( DataType . DWORD , "双字型 ") , new DataTypeSource ( DataType . INT , "长整型 " ) ,
21
22
new DataTypeSource ( DataType . FLOAT , "模拟量" ) , new DataTypeSource ( DataType . SYS , "系统型" ) , new DataTypeSource ( DataType . STR , "ASCII字符串" ) ,
22
23
new DataTypeSource ( DataType . NONE , "UNICODE字符串" )
23
24
} ;
@@ -33,6 +34,8 @@ public TagList(string txt = null)
33
34
int index = bindingSource1 . Find ( "Name" , txt ) ;
34
35
bindingSource1 . Position = index ;
35
36
}
37
+ scAutoComplete . AddRange ( list . ToArray ( ) ) ;
38
+ tspText . AutoCompleteCustomSource = scAutoComplete ;
36
39
}
37
40
38
41
string currenText ;
@@ -46,7 +49,7 @@ public static List<string> GetTagNameList()
46
49
if ( list == null )
47
50
{
48
51
list = new List < string > { "@Time" , "@Date" , "@DateTime" , "@User" , "@AppName" , "@LocName" , "@Region" , "@Path" } ;
49
- metaList = new List < TagMetaData > ( ) ;
52
+ metaList . Clear ( ) ;
50
53
using ( var reader = DataHelper . Instance . ExecuteReader ( "SELECT ISNULL(TagName,''),ISNULL(ADDRESS,''),ISNULL(DESCRIPTION,''),DATATYPE,DATASIZE,TAGID,GROUPID,ISACTIVE,ARCHIVE,DEFAULTVALUE FROM Meta_Tag" ) )
51
54
{
52
55
if ( reader == null ) return list ;
@@ -259,7 +262,7 @@ public enum DataType : byte
259
262
BYTE = 3 ,
260
263
SHORT = 4 ,
261
264
WORD = 5 ,
262
- TIME = 6 ,
265
+ DWORD = 6 ,
263
266
INT = 7 ,
264
267
FLOAT = 8 ,
265
268
SYS = 9 ,
0 commit comments