Browse Source

update tagconfig

pull/15/head
Gavin 9 years ago
parent
commit
246bddb12d
  1. BIN
      SCADA/Example/TagConfig.exe
  2. 5
      SCADA/Program/ModbusDriver/ModbusTCPDriver.cs
  3. 30
      SCADA/Program/TagConfig/TagConfig/Form1.Designer.cs
  4. 37
      SCADA/Program/TagConfig/TagConfig/Form1.cs
  5. 2
      SCADA/Program/TagConfig/TagConfig/Form1.resx
  6. BIN
      SCADA/dll/ModbusDriver.dll

BIN
SCADA/Example/TagConfig.exe

Binary file not shown.

5
SCADA/Program/ModbusDriver/ModbusTCPDriver.cs

@ -464,8 +464,7 @@ namespace ModbusDriver
return new ItemData<float>(0.0f, 0, QUALITIES.QUALITY_BAD); return new ItemData<float>(0.0f, 0, QUALITIES.QUALITY_BAD);
else else
{ {
int value = IPAddress.HostToNetworkOrder(BitConverter.ToInt32(data, 0)); return new ItemData<float>(IPAddress.HostToNetworkOrder(BitConverter.ToInt32(data, 0)), 0, QUALITIES.QUALITY_GOOD);
return new ItemData<float>(*(((float*)&value)), 0, QUALITIES.QUALITY_GOOD);
} }
} }
@ -541,7 +540,7 @@ namespace ModbusDriver
public int WriteFloat(DeviceAddress address, float value) public int WriteFloat(DeviceAddress address, float value)
{ {
var data = WriteMultipleRegister(address.Area, address.Start, BitConverter.GetBytes(value)); var data = WriteMultipleRegister(address.Area, address.Start, BitConverter.GetBytes((int)value));
return data == null ? -1 : 0; return data == null ? -1 : 0;
} }

30
SCADA/Program/TagConfig/TagConfig/Form1.Designer.cs

@ -68,6 +68,7 @@
this.tsppaste = new System.Windows.Forms.ToolStripMenuItem(); this.tsppaste = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CSVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.toolStrip2 = new System.Windows.Forms.ToolStrip(); this.toolStrip2 = new System.Windows.Forms.ToolStrip();
this.tspImp = new System.Windows.Forms.ToolStripButton(); this.tspImp = new System.Windows.Forms.ToolStripButton();
@ -113,7 +114,6 @@
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.CSVToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -174,31 +174,31 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(125, 92); this.contextMenuStrip1.Size = new System.Drawing.Size(153, 114);
this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked); this.contextMenuStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip1_ItemClicked);
// //
// 增加ToolStripMenuItem // 增加ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "增加ToolStripMenuItem"; this.ToolStripMenuItem.Name = "增加ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.ToolStripMenuItem.Text = "增加"; this.ToolStripMenuItem.Text = "增加";
// //
// 删除ToolStripMenuItem // 删除ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "删除ToolStripMenuItem"; this.ToolStripMenuItem.Name = "删除ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.ToolStripMenuItem.Text = "删除"; this.ToolStripMenuItem.Text = "删除";
// //
// 修改ToolStripMenuItem // 修改ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "修改ToolStripMenuItem"; this.ToolStripMenuItem.Name = "修改ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.ToolStripMenuItem.Text = "修改"; this.ToolStripMenuItem.Text = "重命名";
// //
// 参数设置ToolStripMenuItem // 参数设置ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "参数设置ToolStripMenuItem"; this.ToolStripMenuItem.Name = "参数设置ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.ToolStripMenuItem.Text = "参数设置"; this.ToolStripMenuItem.Text = "参数设置";
// //
// imageList1 // imageList1
@ -398,7 +398,7 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.CSVToolStripMenuItem}); this.CSVToolStripMenuItem});
this.contextMenuStrip2.Name = "contextMenuStrip2"; this.contextMenuStrip2.Name = "contextMenuStrip2";
this.contextMenuStrip2.Size = new System.Drawing.Size(195, 224); this.contextMenuStrip2.Size = new System.Drawing.Size(195, 202);
this.contextMenuStrip2.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip2_Opening); this.contextMenuStrip2.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip2_Opening);
this.contextMenuStrip2.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip2_ItemClicked); this.contextMenuStrip2.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip2_ItemClicked);
// //
@ -460,6 +460,13 @@
this.ToolStripMenuItem.Text = "事件归档"; this.ToolStripMenuItem.Text = "事件归档";
this.ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.ToolStripMenuItem_CheckedChanged); this.ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.ToolStripMenuItem_CheckedChanged);
// //
// 粘贴CSVToolStripMenuItem
//
this.CSVToolStripMenuItem.Name = "粘贴CSVToolStripMenuItem";
this.CSVToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.CSVToolStripMenuItem.Size = new System.Drawing.Size(194, 22);
this.CSVToolStripMenuItem.Text = "粘贴CSV";
//
// toolStrip2 // toolStrip2
// //
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -775,13 +782,6 @@
this.tspCount.Name = "tspCount"; this.tspCount.Name = "tspCount";
this.tspCount.Size = new System.Drawing.Size(0, 17); this.tspCount.Size = new System.Drawing.Size(0, 17);
// //
// 粘贴CSVToolStripMenuItem
//
this.CSVToolStripMenuItem.Name = "粘贴CSVToolStripMenuItem";
this.CSVToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.CSVToolStripMenuItem.Size = new System.Drawing.Size(194, 22);
this.CSVToolStripMenuItem.Text = "粘贴CSV";
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

37
SCADA/Program/TagConfig/TagConfig/Form1.cs

@ -788,14 +788,21 @@ namespace TagConfig
} }
else else
{ {
foreach (Group grp in groups) if (!groups.Exists(x => x.Name == e.Label))
{ {
if (grp.ID.ToString() == e.Node.Name) foreach (Group grp in groups)
{ {
grp.Name = e.Label; if (grp.ID.ToString() == e.Node.Name)
break; {
grp.Name = e.Label;
break;
}
} }
} }
else
{
MessageBox.Show("组名不能重复!");
}
} }
} }
} }
@ -932,26 +939,6 @@ namespace TagConfig
{ {
switch (e.ClickedItem.Text) switch (e.ClickedItem.Text)
{ {
case "配方":
{
}
break;
case "设备":
{
}
break;
case "仓容":
{
}
break;
case "路径":
{
}
break;
case "导入变量": case "导入变量":
openFileDialog1.Filter = "xml文件 (*.xml)|*.xml|excel文件 (*.xlsx)|*.xlsx|kepserver文件 (*.csv)|*.csv|All files (*.*)|*.*"; openFileDialog1.Filter = "xml文件 (*.xml)|*.xml|excel文件 (*.xlsx)|*.xlsx|kepserver文件 (*.csv)|*.csv|All files (*.*)|*.*";
openFileDialog1.DefaultExt = "xml"; openFileDialog1.DefaultExt = "xml";
@ -1095,7 +1082,7 @@ namespace TagConfig
case "删除": case "删除":
RemoveNode(); RemoveNode();
break; break;
case "修改": case "重命名":
UpdateNode(); UpdateNode();
break; break;
case "参数设置": case "参数设置":

2
SCADA/Program/TagConfig/TagConfig/Form1.resx

@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTd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