Skip to content

Commit 29d789d

Browse files
committed
update taglist.cs
1 parent 18f9d0c commit 29d789d

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed

SCADA/Program/LinkableControlDesignTime/TagList.Designer.cs

Lines changed: 36 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SCADA/Program/LinkableControlDesignTime/TagList.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ namespace HMIControl.VisualStudio.Design
1212
public partial class TagList : Form
1313
{
1414
static List<string> list;
15-
static List<TagMetaData> metaList;
15+
static List<TagMetaData> metaList = new List<TagMetaData>();
16+
AutoCompleteStringCollection scAutoComplete = new AutoCompleteStringCollection();
1617

1718
public static readonly List<DataTypeSource> DataDict = new List<DataTypeSource>
1819
{
1920
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,"长整型"),
2122
new DataTypeSource (DataType.FLOAT,"模拟量"),new DataTypeSource (DataType.SYS,"系统型"),new DataTypeSource (DataType.STR,"ASCII字符串"),
2223
new DataTypeSource (DataType.NONE,"UNICODE字符串")
2324
};
@@ -33,6 +34,8 @@ public TagList(string txt = null)
3334
int index = bindingSource1.Find("Name", txt);
3435
bindingSource1.Position = index;
3536
}
37+
scAutoComplete.AddRange(list.ToArray());
38+
tspText.AutoCompleteCustomSource = scAutoComplete;
3639
}
3740

3841
string currenText;
@@ -46,7 +49,7 @@ public static List<string> GetTagNameList()
4649
if (list == null)
4750
{
4851
list = new List<string> { "@Time", "@Date", "@DateTime", "@User", "@AppName", "@LocName", "@Region", "@Path" };
49-
metaList = new List<TagMetaData>();
52+
metaList.Clear();
5053
using (var reader = DataHelper.Instance.ExecuteReader("SELECT ISNULL(TagName,''),ISNULL(ADDRESS,''),ISNULL(DESCRIPTION,''),DATATYPE,DATASIZE,TAGID,GROUPID,ISACTIVE,ARCHIVE,DEFAULTVALUE FROM Meta_Tag"))
5154
{
5255
if (reader == null) return list;
@@ -259,7 +262,7 @@ public enum DataType : byte
259262
BYTE = 3,
260263
SHORT = 4,
261264
WORD = 5,
262-
TIME = 6,
265+
DWORD = 6,
263266
INT = 7,
264267
FLOAT = 8,
265268
SYS = 9,

0 commit comments

Comments
 (0)