-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModbusAddIn.cs
92 lines (84 loc) · 2.72 KB
/
ModbusAddIn.cs
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// --------------------------------------------------------------------------
// Gurux Ltd
//
//
//
// Filename: $HeadURL: svn://utopia/projects/GXDeviceEditor/Development/AddIns/Modbus/Modbus.cs $
//
// Version: $Revision: 4097 $,
// $Date: 2011-09-27 01:08:32 +0300 (Tue, 27 Sep 2011) $
// $Author: kurumi $
//
// Copyright (c) Gurux Ltd
//
//---------------------------------------------------------------------------
//
// DESCRIPTION
//
// This file is a part of Gurux Device Framework.
//
// Gurux Device Framework is Open Source software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 of the License.
// Gurux Device Framework is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// This code is licensed under the GNU General Public License v2.
// Full text may be retrieved at http://www.gnu.org/licenses/gpl-2.0.txt
//---------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Reflection;
using System.ComponentModel;
using Gurux.Device;
using Gurux.Device.Editor;
using Gurux.Communication;
namespace Gurux.Modbus.AddIn
{
/// <summary>
/// Implements modbus protocol addin component.
/// </summary>
[GXCommunicationAttribute(typeof(ModbusPacketHandler), typeof(ModBusPacketParser))]
[Serializable]
internal class GXModbus : GXProtocolAddIn
{
/// <summary>
/// Initializes a new instance of the GXModbus class.
/// </summary>
public GXModbus()
: base("Modbus", false, false, false)
{
base.WizardAvailable = VisibilityItems.Properties;
}
public override Type GetDeviceType()
{
return typeof(GXModbusDevice);
}
public override Type[] GetPropertyTypes(object parent)
{
return new Type[]{typeof(GXModbusProperty)};
}
/// <summary>
/// Returns available functionalities for the protocol.
/// </summary>
public override VisibilityItems ItemVisibility
{
get
{
return VisibilityItems.Categories;
}
}
public override void ModifyWizardPages(object source, GXPropertyPageType type, System.Collections.Generic.List<Control> pages)
{
if (type == GXPropertyPageType.Property)
{
pages.Insert(1, new ModBusWizardPage1Dlg());
}
}
}
}