'功能:直方图、圆柱形
'开始时间:2006-09-23
Imports System.ComponentModel
Imports System.Drawing.Drawing2D
<Description("柱形图(圆形、方形)"), Docking(System.Windows.Forms.DockingBehavior.AutoDock)> _
Public Class ColumnViewClass ColumnView
变量#Region "变量"
Dim HasFocus As Boolean = False '控件是否得到焦点
Dim HasBorder As Boolean = False '是否显示控件边框
'直方图中用到的画刷
Dim mBrushFront As SolidBrush = Nothing '前面
Dim mBrushTop As SolidBrush = Nothing '顶面
Dim mBrushSide As SolidBrush = Nothing '侧面
Dim mRefresh As Boolean = True '用于设置视图是否自刷新
Dim mTimeOut As Integer = 5 '用于设置允许超时时间(秒)
Dim ViewRefreshOver As Boolean = False '用于判断视图是否已刷新
Dim TimerOfTimeOutRefresh As Timers.Timer '用于判断超时的定时器
Dim ViewRefreshTime As Date = Now '用于记录参数刷新的时间
'直方图中用到的点集合
Dim ColumnPoint() As PointF = New PointF() {New PointF(-30, -47), New PointF(10, -47), New PointF(10, 50), New PointF(-30, 50), _
New PointF(-10, -50), New PointF(30, -50), New PointF(30, 47), New PointF(-10, 47)}
'参数属性值有关的变量
Dim mHIHI As Single = 220, mHI As Single = 200, mLO As Single = 100, mLOLO As Single = 50
Dim mOid As String
Dim mAlarm As Alarm = Alarm.None
Dim mValue As Single = 150
Dim mUnit As String
Dim mModel As ViewMode = ViewMode.Cube
'视图菜单
Dim Menu As System.Windows.Forms.ContextMenuStrip
<Description("参数告警类型")> _
Public Enum AlarmEnum Alarm
None '正常
HIHI '极高告警
HI '高告警
LO '低告警
LOLO '极低告警
UnKnow '无法联系
End Enum
<Description("视图方式")> _
Public Enum ViewModeEnum ViewMode
Cube '圆形柱形图
Column '方形柱形图
End Enum
#End Region
参数视图的属性#Region "参数视图的属性"
<Description("HFC网络管理系统中的OID信息"), DefaultValue("1.3.6.1.4.1.17409.1")> _
Public Property OID()Property OID() As String
Get
Return mOid
End Get
Set(ByVal value As String)
If value <> mOid Then
mOid = value
End If
End Set
End Property
<Description("参数单位")> _
Public Property Unit()Property Unit() As String
Get
Return mUnit
End Get
Set(ByVal value As String)
If value <> mUnit Then
mUnit = value
PicView.Invalidate()
End If
End Set
End Property
<Description("参数信息"), DefaultValue("参数信息")> _
Public Property ParameterInfo()Property ParameterInfo() As String
Get
Return ViewName.Text.Trim
End Get
Set(ByVal value As String)
If value.Trim = "" Then value = "参数信息"
If value <> ViewName.Text.Trim Then
ViewName.Text = value
PicView.Invalidate()
End If
End Set
End Property
<Description("参数状态信息(正常、一般告警、严重告警或状态未知),只读。")> _
Public ReadOnly Property Status()Property Status() As Alarm
Get
Return mAlarm
End Get
End Property
<Description("参数严重高告警门限")> _
Public Property HIHI()Property HIHI() As Single
Get
Return mHIHI
End Get
Set(ByVal value As Single)
'If value < HI Then
' 'Throw New Exception("HIHI值不能小于HI值!")
' MsgBox("HIHI值不能小于HI值!", MsgBoxStyle.Critical, "Set HIHI")
'Else
If value <> mHIHI Then
mHIHI = value
Call SetStatus(NewValue)
PicView.Invalidate()
End If
'End If
End Set
End Property
<Description("参数一般高告警门限")> _
Public Property HI()Property HI() As Single
Get
Return mHI
End Get
Set(ByVal value As Single)
'If value < LO Then
' 'Throw New Exception("HI值不能小于LO值!")
' MsgBox("HI值不能小于LO值!", MsgBoxStyle.Critical, "Set HI")
'ElseIf value > HIHI Then
' 'Throw New Exception("HI值不能大于HIHI值!")
' MsgBox("HI值不能大于HIHI值!", MsgBoxStyle.Critical, "Set HI")
'Else
If value <> mHI Then
mHI = value
Call SetStatus(NewValue)
PicView.Invalidate()
End If
'End If
End Set
End Property
<Description("参数一般低告警门限")> _
Public Property LO()Property LO() As Single
Get
Return mLO
End Get
Set(ByVal value As Single)
'If value > HI Then
' 'Throw New Exception("LO值不能大于HI值!")
' MsgBox("LOLO值不能大于LO值!", MsgBoxStyle.Critical, "Set LO")
'ElseIf value < LOLO Then
' 'Throw New Exception("LO值不能小于LOLO值!")
' MsgBox("LOLO值不能大于LO值!", MsgBoxStyle.Critical, "Set LO")
'Else
If value <>
'开始时间:2006-09-23
Imports System.ComponentModel
Imports System.Drawing.Drawing2D
<Description("柱形图(圆形、方形)"), Docking(System.Windows.Forms.DockingBehavior.AutoDock)> _
Public Class ColumnViewClass ColumnView
变量#Region "变量"
Dim HasFocus As Boolean = False '控件是否得到焦点
Dim HasBorder As Boolean = False '是否显示控件边框
'直方图中用到的画刷
Dim mBrushFront As SolidBrush = Nothing '前面
Dim mBrushTop As SolidBrush = Nothing '顶面
Dim mBrushSide As SolidBrush = Nothing '侧面
Dim mRefresh As Boolean = True '用于设置视图是否自刷新
Dim mTimeOut As Integer = 5 '用于设置允许超时时间(秒)
Dim ViewRefreshOver As Boolean = False '用于判断视图是否已刷新
Dim TimerOfTimeOutRefresh As Timers.Timer '用于判断超时的定时器
Dim ViewRefreshTime As Date = Now '用于记录参数刷新的时间
'直方图中用到的点集合
Dim ColumnPoint() As PointF = New PointF() {New PointF(-30, -47), New PointF(10, -47), New PointF(10, 50), New PointF(-30, 50), _
New PointF(-10, -50), New PointF(30, -50), New PointF(30, 47), New PointF(-10, 47)}
'参数属性值有关的变量
Dim mHIHI As Single = 220, mHI As Single = 200, mLO As Single = 100, mLOLO As Single = 50
Dim mOid As String
Dim mAlarm As Alarm = Alarm.None
Dim mValue As Single = 150
Dim mUnit As String
Dim mModel As ViewMode = ViewMode.Cube
'视图菜单
Dim Menu As System.Windows.Forms.ContextMenuStrip
<Description("参数告警类型")> _
Public Enum AlarmEnum Alarm
None '正常
HIHI '极高告警
HI '高告警
LO '低告警
LOLO '极低告警
UnKnow '无法联系
End Enum
<Description("视图方式")> _
Public Enum ViewModeEnum ViewMode
Cube '圆形柱形图
Column '方形柱形图
End Enum
#End Region
参数视图的属性#Region "参数视图的属性"
<Description("HFC网络管理系统中的OID信息"), DefaultValue("1.3.6.1.4.1.17409.1")> _
Public Property OID()Property OID() As String
Get
Return mOid
End Get
Set(ByVal value As String)
If value <> mOid Then
mOid = value
End If
End Set
End Property
<Description("参数单位")> _
Public Property Unit()Property Unit() As String
Get
Return mUnit
End Get
Set(ByVal value As String)
If value <> mUnit Then
mUnit = value
PicView.Invalidate()
End If
End Set
End Property
<Description("参数信息"), DefaultValue("参数信息")> _
Public Property ParameterInfo()Property ParameterInfo() As String
Get
Return ViewName.Text.Trim
End Get
Set(ByVal value As String)
If value.Trim = "" Then value = "参数信息"
If value <> ViewName.Text.Trim Then
ViewName.Text = value
PicView.Invalidate()
End If
End Set
End Property
<Description("参数状态信息(正常、一般告警、严重告警或状态未知),只读。")> _
Public ReadOnly Property Status()Property Status() As Alarm
Get
Return mAlarm
End Get
End Property
<Description("参数严重高告警门限")> _
Public Property HIHI()Property HIHI() As Single
Get
Return mHIHI
End Get
Set(ByVal value As Single)
'If value < HI Then
' 'Throw New Exception("HIHI值不能小于HI值!")
' MsgBox("HIHI值不能小于HI值!", MsgBoxStyle.Critical, "Set HIHI")
'Else
If value <> mHIHI Then
mHIHI = value
Call SetStatus(NewValue)
PicView.Invalidate()
End If
'End If
End Set
End Property
<Description("参数一般高告警门限")> _
Public Property HI()Property HI() As Single
Get
Return mHI
End Get
Set(ByVal value As Single)
'If value < LO Then
' 'Throw New Exception("HI值不能小于LO值!")
' MsgBox("HI值不能小于LO值!", MsgBoxStyle.Critical, "Set HI")
'ElseIf value > HIHI Then
' 'Throw New Exception("HI值不能大于HIHI值!")
' MsgBox("HI值不能大于HIHI值!", MsgBoxStyle.Critical, "Set HI")
'Else
If value <> mHI Then
mHI = value
Call SetStatus(NewValue)
PicView.Invalidate()
End If
'End If
End Set
End Property
<Description("参数一般低告警门限")> _
Public Property LO()Property LO() As Single
Get
Return mLO
End Get
Set(ByVal value As Single)
'If value > HI Then
' 'Throw New Exception("LO值不能大于HI值!")
' MsgBox("LOLO值不能大于LO值!", MsgBoxStyle.Critical, "Set LO")
'ElseIf value < LOLO Then
' 'Throw New Exception("LO值不能小于LOLO值!")
' MsgBox("LOLO值不能大于LO值!", MsgBoxStyle.Critical, "Set LO")
'Else
If value <>