initial commit
This commit is contained in:
205
cVMS.NET_CS/HMI/MainDisplay/BarGraph.cs
Normal file
205
cVMS.NET_CS/HMI/MainDisplay/BarGraph.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
public partial class BarCtrl : UserControl
|
||||
{
|
||||
CGROUP NowGrp = null;
|
||||
RectangleF BarRect = new RectangleF(0, 0, 0, 0);
|
||||
|
||||
public Boolean Show_DebugMsg { get; set; }
|
||||
|
||||
public BarCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Initialize Variables
|
||||
|
||||
// Set Optimized Double Buffer to reduce flickering
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
|
||||
// Redraw when resized
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
this.Font = SystemInformation.MenuFont;
|
||||
Show_DebugMsg = false;
|
||||
}
|
||||
|
||||
public CGROUP Group
|
||||
{
|
||||
set
|
||||
{
|
||||
NowGrp = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// Override OnPaint method
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
this.SuspendLayout();
|
||||
|
||||
// AntiAliasing
|
||||
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
|
||||
if (bMakeBarRect) MakeBarRect();
|
||||
|
||||
DrawBarGraph(e.Graphics);
|
||||
Draw_Debug(e.Graphics);
|
||||
|
||||
this.Update();
|
||||
this.ResumeLayout();
|
||||
}
|
||||
|
||||
public void Draw_Debug(Graphics g)
|
||||
{
|
||||
if (!Show_DebugMsg) return;
|
||||
|
||||
//Single newy = 50;
|
||||
//String newstr = "";
|
||||
SizeF fontsize;
|
||||
|
||||
StringBuilder DebugMsg = new StringBuilder();
|
||||
|
||||
|
||||
DebugMsg.AppendLine("GRP=" + this.NowGrp.ToString());
|
||||
|
||||
|
||||
// newstr = "CHinfo=" + chinfo.GetUpperBound(0);
|
||||
|
||||
foreach ( CITEM item in NowGrp.Items)
|
||||
{
|
||||
DebugMsg.AppendLine("item=" + item.ToString());
|
||||
}
|
||||
|
||||
fontsize = g.MeasureString(DebugMsg.ToString(), this.Font);
|
||||
g.FillRectangle(new SolidBrush(Color.FromArgb(150, Color.Black)), new Rectangle(0, 0, (int)(fontsize.Width * 1.3), (int)(fontsize.Height * 1.3)));
|
||||
g.DrawString(DebugMsg.ToString(), this.Font, Brushes.Tomato, 10, 10);
|
||||
}
|
||||
|
||||
protected override void OnSizeChanged(EventArgs e)
|
||||
{
|
||||
base.OnSizeChanged(e);
|
||||
BarRect = new RectangleF(DisplayRectangle.Left + Padding.Left, DisplayRectangle.Top + Padding.Top, DisplayRectangle.Width - Padding.Left - Padding.Right, DisplayRectangle.Height - Padding.Top - Padding.Bottom);
|
||||
}
|
||||
|
||||
public Boolean bMakeBarRect = true;
|
||||
private void MakeBarRect()
|
||||
{
|
||||
if (BarRect.Width == 0) return;
|
||||
if (!bMakeBarRect) return;
|
||||
if (NowGrp == null) return;
|
||||
if (NowGrp.Items == null) return;
|
||||
|
||||
|
||||
//각아이템의 2pixel 만큼 떨어져있다.
|
||||
int ItemWidth = (int)(Math.Floor((this.BarRect.Width - ((NowGrp.NullBalanceSeq - 1) * 1)) / NowGrp.NullBalanceSeq));
|
||||
if (ItemWidth < 2) ItemWidth = 2; //너무작은건 어절수없음
|
||||
int ItemHeight = (int)(Math.Floor((BarRect.Height - 20 - 10) / 2));
|
||||
|
||||
int totalWidth = ItemWidth * NowGrp.NullBalanceSeq + ItemWidth; //1개를 더 추가한다.
|
||||
Single CenterMarginX = (BarRect.Width - totalWidth) / 2;
|
||||
|
||||
//차트내의 아이템의 표시영역을 결정
|
||||
//UInt16 itemindex = 0;
|
||||
foreach (CITEM item in NowGrp.Items)
|
||||
{
|
||||
//Single Term = 0;//= item.idx == 0 ? 0 : item.idx * 2;
|
||||
Single X = 0;//(item.idx * ItemWidth) + Term;
|
||||
Single y = 0;//ChartRect.Top;
|
||||
|
||||
if (item.seq <= NowGrp.NullBalanceSeq)
|
||||
{
|
||||
//상위그룹
|
||||
// Term = item.seq == 1 ? 0 : (item.seq) * 2;
|
||||
X = (item.seq * ItemWidth) ;//+ Term;
|
||||
y = 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
//하위그룹
|
||||
// Term = item.seq == NowGrp.NullBalanceSeq ? 0 : (item.seq - (NowGrp.NullBalanceSeq + 1)) * 2;
|
||||
X = (item.seq - NowGrp.NullBalanceSeq -1) * ItemWidth;//+ Term;
|
||||
y = ItemHeight + 20;
|
||||
}
|
||||
item.BarRect = new RectangleF(BarRect.Left + X + CenterMarginX, BarRect.Top + y, ItemWidth, ItemHeight - 10);
|
||||
// itemindex += 1;
|
||||
}
|
||||
bMakeBarRect = false;
|
||||
}
|
||||
|
||||
private void DrawBarGraph(Graphics g)
|
||||
{
|
||||
if (BarRect.Width < 1) return;
|
||||
if (bMakeBarRect) MakeBarRect();//영역을 새로 생성해야한다면 만듬
|
||||
if (NowGrp == null) return;
|
||||
if (NowGrp.Items == null) return;
|
||||
|
||||
|
||||
int YMax = 4;
|
||||
int YMin = 0;
|
||||
|
||||
|
||||
///현재등록된 아이템을 화면에 표시한다.
|
||||
foreach (CITEM item in NowGrp.Items)
|
||||
{
|
||||
//값에따른 색상입히기
|
||||
Color BarColor = Color.Green;
|
||||
if (item.ismin) BarColor = Color.DeepSkyBlue;
|
||||
else if (item.ismax) BarColor = Color.Tomato;
|
||||
else if (item.onalamh ) BarColor = Color.Red;
|
||||
else if (item.onalaml) BarColor = Color.Blue;
|
||||
|
||||
Single Percent = (100 * item.CurValue) / (YMax - YMin);
|
||||
|
||||
//값에따른 높이값
|
||||
Single ValueHeight = item.BarRect.Height * (Percent / 100);
|
||||
if (ValueHeight > 1)
|
||||
{
|
||||
Single ValueY = item.BarRect.Top + (item.BarRect.Height - ValueHeight);
|
||||
|
||||
//색상으로 칠한다.
|
||||
g.FillRectangle(new SolidBrush(BarColor), item.BarRect.Left, ValueY, item.BarRect.Width, ValueHeight);
|
||||
|
||||
}
|
||||
|
||||
//테두리표시
|
||||
if (item.사용 )
|
||||
{
|
||||
g.DrawRectangle(Pens.Black, item.BarRect.Left, item.BarRect.Top, item.BarRect.Width, item.BarRect.Height);
|
||||
}
|
||||
//g.DrawString(item.idx.ToString("000"), new Font("Arial", 7), Brushes.Black, item.BarRect.Left, item.BarRect.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
bMakeBarRect = true;
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// DispCtrl
|
||||
//
|
||||
this.Name = "BarCtrl";
|
||||
this.Size = new System.Drawing.Size(287, 321);
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
|
||||
} //end class
|
||||
|
||||
} //end namespace
|
||||
120
cVMS.NET_CS/HMI/MainDisplay/BarGraph.resx
Normal file
120
cVMS.NET_CS/HMI/MainDisplay/BarGraph.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
34
cVMS.NET_CS/HMI/MainDisplay/CButton.cs
Normal file
34
cVMS.NET_CS/HMI/MainDisplay/CButton.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
public partial class CButton
|
||||
{
|
||||
|
||||
public RectangleF Rect { get; set; }
|
||||
public Object Tag { get; set; }
|
||||
public EBUTTONTYPE ButtonType { get; set; }
|
||||
public CButton()
|
||||
{
|
||||
Rect = new RectangleF(0, 0, 0, 0);
|
||||
Tag = null;
|
||||
ButtonType = EBUTTONTYPE.CELL;
|
||||
}
|
||||
|
||||
public CButton(RectangleF _rect, Object _obj, EBUTTONTYPE _btype)
|
||||
{
|
||||
Rect = _rect;
|
||||
Tag = _obj;
|
||||
ButtonType = _btype;
|
||||
}
|
||||
|
||||
~CButton()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
419
cVMS.NET_CS/HMI/MainDisplay/CGROUP.cs
Normal file
419
cVMS.NET_CS/HMI/MainDisplay/CGROUP.cs
Normal file
@@ -0,0 +1,419 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter)),Serializable()]
|
||||
public partial class CGROUP
|
||||
{
|
||||
private int idx;
|
||||
private int widx;
|
||||
private String title;
|
||||
private int row;
|
||||
private int column;
|
||||
private int rspan;
|
||||
private int cspan;
|
||||
private int rowcount;
|
||||
private int columncount;
|
||||
private String matrix;
|
||||
private RectangleF rect;
|
||||
private Font cellfont;
|
||||
private Color cellfontcolor;
|
||||
public String maxcellname = "#999";
|
||||
public String maxcellvalue = "00.000";
|
||||
public String maxcellalam = "↑0↓0";
|
||||
private String _alamtype;
|
||||
|
||||
|
||||
public CITEM[] itemarray;
|
||||
|
||||
private RectangleF[] cellgroup;
|
||||
private Single cellgroup_width;
|
||||
private Single cellgroup_height;
|
||||
public Single _cell_title_width;
|
||||
public Single _cell_value_width;
|
||||
public Single _cell_alam_width;
|
||||
public short _null_itemseq;
|
||||
public Single _null_valueL;
|
||||
public Single _null_valueR;
|
||||
private Single _null_offset; //옵셋
|
||||
|
||||
public RectangleF Rect_Title;
|
||||
public RectangleF Rect_Header;
|
||||
public RectangleF Rect_body;
|
||||
|
||||
private Single alamh; //상위알람
|
||||
private Single alaml; //하위알람
|
||||
private Single aalamh; //상위알람
|
||||
//private Single aalaml; //하위알람
|
||||
//public Single nbhh;
|
||||
public Single nbh;
|
||||
//public Single nbll;
|
||||
public Single nbl;
|
||||
|
||||
public Boolean _pre_nbalam_h=false;
|
||||
public Boolean _pre_nbalam_l=false;
|
||||
public Boolean _nbalam_h = false;
|
||||
public Boolean _nbalam_l = false;
|
||||
|
||||
public Single _amp; //KAVALUE
|
||||
public String _ampidx; //KAINDEX
|
||||
public String _ampunit; //KAINDEX
|
||||
public short _ampdecpos; //KAINDEX
|
||||
|
||||
public Single _maxvolt;
|
||||
public Single _avgvolt;
|
||||
public Single _minvolt;
|
||||
public Single _sumvolt; //전체합계
|
||||
public Single _sumvolt1; //분주된SUm
|
||||
public Single _sumvoltA; //전체합계(A)
|
||||
public Single _sumvoltB; //전체합계(B)
|
||||
|
||||
|
||||
public short _alamcount=0;
|
||||
public short _alamcountlb = 0;
|
||||
|
||||
public CITEM _maxitem = null;
|
||||
public CITEM _minitem = null;
|
||||
public CITEM _maxitemp = null;
|
||||
public CITEM _minitemp = null;
|
||||
|
||||
public Boolean Showinfo=false;
|
||||
|
||||
public delegate void OnChangeDataHandler();
|
||||
public event OnChangeDataHandler OnChangeData;
|
||||
|
||||
public int _unusedcount = 0; //미사용채널수
|
||||
public int _errorcount = 0; //에러난채널수
|
||||
public int _disccount = 0; //에러난채널수
|
||||
|
||||
|
||||
public CGROUP()
|
||||
{
|
||||
_sumvolt = 0;
|
||||
_sumvolt1 = 0;
|
||||
_sumvoltA = 0;
|
||||
_sumvoltB = 0;
|
||||
_maxvolt = 0;
|
||||
_minvolt = 0;
|
||||
_avgvolt = 0;
|
||||
_errorcount = 0;
|
||||
_disccount = 0;
|
||||
idx = 0;
|
||||
widx = 0;
|
||||
row = 0;
|
||||
column = 0;
|
||||
columncount = 2;
|
||||
rowcount = 15;
|
||||
rspan = 1;
|
||||
cspan = 1;
|
||||
matrix = "15x2";
|
||||
title = "TINDEVIL";
|
||||
rect = new RectangleF(0, 0, 0, 0);
|
||||
cellfont = new Font("나눔고딕", 10, FontStyle.Bold);
|
||||
cellfontcolor = Color.Black;
|
||||
cellgroup = new RectangleF[1];
|
||||
Items = new CITEM[0];
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Sumvolt
|
||||
{
|
||||
get { return _sumvolt; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Sumvolt1
|
||||
{
|
||||
get { return _sumvolt1; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single SumvoltA
|
||||
{
|
||||
get { return _sumvoltA; }
|
||||
}
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single SumvoltB
|
||||
{
|
||||
get { return _sumvoltB; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Maxvolt
|
||||
{
|
||||
get { return _maxvolt; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Minvolt
|
||||
{
|
||||
get { return _minvolt; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Avgvolt
|
||||
{
|
||||
get { return _avgvolt; }
|
||||
}
|
||||
|
||||
//[System.ComponentModel.Browsable(false)]
|
||||
//public Single AmpKA
|
||||
//{
|
||||
// get { return _ampka; }
|
||||
//}
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),Browsable(false), Category("알람"), Description("그룹에 지정된 알람형태입니다. Manual 과 Auto 가 있으며 변경을 하시려면 알람설정(alam Setup)을 이용하세요.")]
|
||||
public String AlarmType
|
||||
{
|
||||
get { return _alamtype; }
|
||||
set { _alamtype = value; }
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false), Category("알람수동"), Description("그룹에 지정되는 상위알람값입니다. 셀의 알람설정이 그룹으로 지정되었다면 이 값이 사용됩니다.")]
|
||||
public Single HIGH
|
||||
{
|
||||
get { return alamh; }
|
||||
set { alamh = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false), Category("알람수동"), Description("그룹에 지정되는 하위알람값입니다. 셀의 알람설정이 그룹으로 지정되었다면 이 값이 사용됩니다.")]
|
||||
public Single LOW
|
||||
{
|
||||
get { return alaml; }
|
||||
set { alaml = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false), Category("알람자동"), Description("그룹에 지정되는 상위알람값입니다. 셀의 알람설정이 그룹으로 지정되었다면 이 값이 사용됩니다.")]
|
||||
public Single UP
|
||||
{
|
||||
get { return aalamh; }
|
||||
set
|
||||
{
|
||||
aalamh = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false), Category("알람자동"), Description("그룹에 지정되는 하위알람값입니다. 셀의 알람설정이 그룹으로 지정되었다면 이 값이 사용됩니다.")]
|
||||
//public Single DOWN
|
||||
//{
|
||||
// get { return aalaml; }
|
||||
// set
|
||||
// {
|
||||
// aalaml = value;
|
||||
// try { OnChangeData(); }
|
||||
// catch { }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),Browsable(false), Category("일반"), Description("Null Balance 보정값입니다.")]
|
||||
public Single NullBalanceOffset
|
||||
{
|
||||
get { return this._null_offset; }
|
||||
set { this._null_offset = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(false), Category("일반"), Description("Null Balance 기준 아이템번호입니다.")]
|
||||
public short NullBalanceSeq
|
||||
{
|
||||
get { return this._null_itemseq; }
|
||||
set
|
||||
{
|
||||
this._null_itemseq = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("셀표시 글꼴의 색상입니다."),Browsable(false)]
|
||||
public Color 셀글꼴색상
|
||||
{
|
||||
get { return this.cellfontcolor; }
|
||||
set { this.cellfontcolor = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("셀표시 글꼴입니다.")]
|
||||
public Font 셀글꼴
|
||||
{
|
||||
get { return this.cellfont; }
|
||||
set { this.cellfont = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public RectangleF[] CellGroup
|
||||
{
|
||||
get { return this.cellgroup; }
|
||||
set { this.cellgroup = value; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single CellGroup_Height
|
||||
{
|
||||
get { return cellgroup_height; }
|
||||
set { cellgroup_height = value; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single CellGroup_Width
|
||||
{
|
||||
get { return cellgroup_width; }
|
||||
set { cellgroup_width = value; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Cell_Title_Width
|
||||
{
|
||||
get { return _cell_title_width; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Cell_Value_Width
|
||||
{
|
||||
get { return _cell_value_width; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public Single Cell_Alam_Width
|
||||
{
|
||||
get { return _cell_alam_width; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public int ColumnCount
|
||||
{
|
||||
get { return columncount; }
|
||||
}
|
||||
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public int RowCount
|
||||
{
|
||||
get { return rowcount; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 내부아이템
|
||||
/// </summary>
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public CITEM[] Items
|
||||
{
|
||||
get { return itemarray; }
|
||||
set { itemarray = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이그룹의 전체 영역
|
||||
/// </summary>
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public RectangleF R
|
||||
{
|
||||
get { return rect; }
|
||||
set { rect = value; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 그룹의일련번호
|
||||
/// </summary>
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public int IDX
|
||||
{
|
||||
get { return idx; }
|
||||
set { idx = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ROWSPAN
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹이 표시되는데 사용되는 줄병합 갯수입니다.(기본값:1)"), System.ComponentModel.Browsable(false)]
|
||||
public int 줄병합
|
||||
{
|
||||
get { return rspan; }
|
||||
set { rspan = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// COLUMNSPAN
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹이 표시되는데 사용되는 열병합 갯수입니다.(기본값:1)"), System.ComponentModel.Browsable(false)]
|
||||
public int 열병합
|
||||
{
|
||||
get { return cspan; }
|
||||
set { cspan = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WINDOW IDX
|
||||
/// </summary>
|
||||
[System.ComponentModel.Browsable(false)]
|
||||
public int WIDX
|
||||
{
|
||||
get { return widx; }
|
||||
set { widx = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LOCATION COLUmN
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹이 표시되는데 사용되는 열의 위치값입니다."), System.ComponentModel.Browsable(false)]
|
||||
public int 열번호
|
||||
{
|
||||
get { return this.column; }
|
||||
set { column = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LOCATION ROW
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹이 표시되는데 사용되는 줄의 위치값입니다."), System.ComponentModel.Browsable(false)]
|
||||
public int 줄번호
|
||||
{
|
||||
get { return this.row; }
|
||||
set { row = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MATRIX ARRAY
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹이 표시되는 아이템의 배열을 표시합니다. 20x2 일경우 총 40개의 셀이 배치됩니다."), System.ComponentModel.Browsable(false)]
|
||||
public String 아이템배열
|
||||
{
|
||||
get { return this.matrix; }
|
||||
set
|
||||
{
|
||||
matrix = value;
|
||||
matrix = matrix.Replace("*", "x").Replace("X", "x").Replace("/", "x").Replace("-", "x");
|
||||
rowcount = int.Parse(matrix.Split(new char[] { 'x' })[0]);
|
||||
columncount = int.Parse(matrix.Split(new char[] { 'x' })[1]);
|
||||
cellgroup = new RectangleF[columncount];
|
||||
itemarray = new CITEM[(rowcount * columncount) - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// THIS NAME
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("이 그룹의 이름입니다.")]
|
||||
public String 이름
|
||||
{
|
||||
get { return this.title; }
|
||||
set { title = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
374
cVMS.NET_CS/HMI/MainDisplay/CITEM.cs
Normal file
374
cVMS.NET_CS/HMI/MainDisplay/CITEM.cs
Normal file
@@ -0,0 +1,374 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter)), Serializable()]
|
||||
public partial class CITEM
|
||||
{
|
||||
public int column;
|
||||
public int row;
|
||||
|
||||
public RectangleF rect;
|
||||
public RectangleF BarRect;
|
||||
private String name;
|
||||
|
||||
public int seq;
|
||||
|
||||
/// <summary>
|
||||
/// 0부터시작
|
||||
/// </summary>
|
||||
public int idx_dev; //장치의 인덱스값
|
||||
|
||||
/// <summary>
|
||||
/// 0부터시작
|
||||
/// </summary>
|
||||
public int idx_unit; //서브유닛의 인덱스값
|
||||
|
||||
/// <summary>
|
||||
/// 0부터시작
|
||||
/// </summary>
|
||||
public int idx_ch; //채널의 인덱스값
|
||||
public int idx; //셀의고유인덱스값(DB는 이값이 저장되고 후에 불러오게된다)
|
||||
public Boolean ismax = false;
|
||||
public Boolean ismin = false;
|
||||
public Color c_color = Color.Black;
|
||||
//MY EVENT
|
||||
public delegate void OnAlamStatusChangeHandler();
|
||||
public event OnAlamStatusChangeHandler OnAlamStausChanged; //UPDATE USER CURSOR
|
||||
|
||||
public delegate void OnChangeDataHandler();
|
||||
public event OnChangeDataHandler OnChangeData;
|
||||
|
||||
public delegate void OnChangeValueHandler(); //값이변경되었을경우 발생한다.
|
||||
public event OnChangeValueHandler OnChangeValueData;
|
||||
|
||||
public Boolean enable = false;
|
||||
private Boolean active = false;
|
||||
public Single alamh = 0;
|
||||
public Single alaml = 0;
|
||||
public Single aalamh = 0;
|
||||
public Single aalaml = 0;
|
||||
public Single alamv = -999; //auto시 기준값
|
||||
private COMM.EALAMTYPE alamatype; //0:no 1:all 2:grp 3:cell
|
||||
private Single offset;
|
||||
public String 적용형태 = "";
|
||||
|
||||
public Boolean _onalamh = false;
|
||||
public Boolean _onalaml = false;
|
||||
public Boolean _p_onalamh = false;
|
||||
public Boolean _p_onalaml = false;
|
||||
public Boolean _onalamover = false;
|
||||
public Boolean _p_onalamover = false;
|
||||
|
||||
private String _value = "";
|
||||
public int value2 = 0; //소수자리가 들어가기전의 값
|
||||
public Single CurValue =0f;
|
||||
public Single CurValue1 = 0f;
|
||||
|
||||
public String mtime = "";
|
||||
private String _time_pre = ""; //이전값
|
||||
|
||||
public String unit; //표시단위(v,c)
|
||||
public int decpos; //10진수단위값
|
||||
// public Form detailform = null;
|
||||
|
||||
public Boolean Onset = false;
|
||||
// public Boolean firstsave = true;
|
||||
|
||||
public CITEM()
|
||||
{
|
||||
offset = 0;
|
||||
column = 0;
|
||||
row = 0;
|
||||
name = "Citem";
|
||||
rect = new RectangleF(0, 0, 0, 0);
|
||||
BarRect = new RectangleF(0, 0, 0, 0);
|
||||
_value = "";
|
||||
value2 = 0;
|
||||
mtime = "";
|
||||
idx = 0;
|
||||
// detailform = null;
|
||||
Onset = false;
|
||||
active = false;
|
||||
seq = 0;
|
||||
CurValue = 0;
|
||||
CurValue1 = 0;
|
||||
}
|
||||
|
||||
public CITEM(short pcolumn, short prow, String pname, ESTATUS pstatus, RectangleF prect)
|
||||
{
|
||||
this.column = pcolumn;
|
||||
this.row = prow;
|
||||
this.name = pname;
|
||||
BarRect = new RectangleF(0, 0, 0, 0);
|
||||
this.rect = prect;
|
||||
CurValue = 0;
|
||||
CurValue1 = 0;
|
||||
//detailform = null;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("seq=" + seq.ToString() + ",offset=" + offset.ToString() + ",curval=" + CurValue.ToString() + ",rect=" + BarRect.ToString());
|
||||
sb.AppendLine("name=" + 이름 + ",use =" + 사용.ToString() + ",활성화=" + 활성화.ToString());
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("측정값"), Category("측정값"),Browsable(false)]
|
||||
public String Value
|
||||
{
|
||||
get { return this._value; }
|
||||
set { this._value = value;
|
||||
|
||||
//값이 이전과 바뀌었을경우에 사용한다.
|
||||
if (mtime != _time_pre)
|
||||
{
|
||||
if (OnChangeValueData != null) OnChangeValueData();
|
||||
_time_pre = mtime;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("표시기호"), Category("정보"), Browsable(false)]
|
||||
public String 표시기호
|
||||
{
|
||||
get { return unit; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("소수점위치"), Category("정보"), Browsable(false)]
|
||||
public int 소수점위치
|
||||
{
|
||||
get
|
||||
{
|
||||
return decpos;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("측정값"), Category("정보"),Browsable(false)]
|
||||
public String 측정값
|
||||
{
|
||||
get {
|
||||
if (_value == null) return "";
|
||||
else return _value;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("측정된시간"), Category("정보"), Browsable(false)]
|
||||
public String 측정시간
|
||||
{
|
||||
get {
|
||||
if (mtime == null) return "";
|
||||
else return mtime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("값배열을 참조하는 Channel INDEX"), Category("테스트"), System.ComponentModel.Browsable(false)]
|
||||
public int 인덱스_번호
|
||||
{
|
||||
get { return idx; }
|
||||
}
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("값배열을 참조하는 Channel INDEX"), Category("테스트"), System.ComponentModel.Browsable(false)]
|
||||
public int 인덱스_채널
|
||||
{
|
||||
get { return idx_ch; }
|
||||
}
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("값배열을 참조하는 Device INDEX"), Category("테스트"), System.ComponentModel.Browsable(false)]
|
||||
public int 인덱스_장치
|
||||
{
|
||||
get { return idx_dev; }
|
||||
}
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("값배열을 참조하는 SubUnit INDEX"), Category("테스트"), System.ComponentModel.Browsable(false)]
|
||||
public int 인덱스_유닛
|
||||
{
|
||||
get { return idx_unit; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("HIGH 알람의 발생여부(변경불가)"), Category("알람발생상태"), System.ComponentModel.Browsable(false)]
|
||||
public Boolean 상위알람발생
|
||||
{
|
||||
get { return _onalamh; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("HIGH 알람의 발생여부(변경불가)"), Category("알람발생상태"), System.ComponentModel.Browsable(false)]
|
||||
public Boolean onalamh
|
||||
{
|
||||
get { return _onalamh; }
|
||||
set
|
||||
{
|
||||
_onalamh = value;
|
||||
if (OnAlamStausChanged != null) OnAlamStausChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("HIGH 알람의 발생여부(변경불가)"), Category("알람발생상태"), System.ComponentModel.Browsable(false)]
|
||||
public Boolean onalaml
|
||||
{
|
||||
get { return _onalaml; }
|
||||
set { _onalaml = value;
|
||||
if (OnAlamStausChanged != null) OnAlamStausChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Description("LOW 알람의 발생여부(변경불가)"), Category("알람발생상태"), System.ComponentModel.Browsable(false)]
|
||||
public Boolean 하위알람발생
|
||||
{
|
||||
get { return _onalaml; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),Browsable(true), Category("모양"), Description("(보정값) 이곳에 값을 입력하면 해당 셀값에 + 됩니다.")]
|
||||
public Single Offset
|
||||
{
|
||||
get { return offset; }
|
||||
set { offset = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람설정"), Description("셀 알람")]
|
||||
public COMM.EALAMTYPE 알람형태
|
||||
{
|
||||
get { return alamatype; }
|
||||
set {
|
||||
alamatype = value;
|
||||
alamv = -999;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람(수동)"), Description("상위 알람값입니다. 직접입력일경우에만 입력하세요.")]
|
||||
public Single HIGH
|
||||
{
|
||||
get { return alamh; }
|
||||
set
|
||||
{
|
||||
if (알람형태 == COMM.EALAMTYPE.개별알람)
|
||||
{
|
||||
alamh = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("알람값을 입력하려면 [개별알람]으로 변경 후 입력하세요");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람(수동)"), Description("하위 알람값입니다. 직접입력일경우에만 입력하세요.")]
|
||||
public Single LOW
|
||||
{
|
||||
get { return alaml; }
|
||||
set {
|
||||
if (알람형태 == COMM.EALAMTYPE.개별알람)
|
||||
{
|
||||
alaml = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("알람값을 입력하려면 [개별알람]으로 변경 후 입력하세요");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람(자동)"), Description("상위 알람값입니다. 직접입력일경우에만 입력하세요.")]
|
||||
public Single H
|
||||
{
|
||||
get { return aalamh; }
|
||||
set
|
||||
{
|
||||
if (알람형태 == COMM.EALAMTYPE.개별알람자동)
|
||||
{
|
||||
aalamh = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("알람값을 입력하려면 [개별알람자동]으로 변경 후 입력하세요");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람(자동)"), Description("하위 알람값입니다. 직접입력일경우에만 입력하세요.")]
|
||||
public Single L
|
||||
{
|
||||
get { return Math.Abs(aalaml); }
|
||||
set
|
||||
{
|
||||
if (알람형태 == COMM.EALAMTYPE.개별알람자동)
|
||||
{
|
||||
aalaml = Math.Abs(value);
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("알람값을 입력하려면 [개별알람자동]으로 변경 후 입력하세요");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람(자동)"), Description("기준값")]
|
||||
public Single 기준값
|
||||
{
|
||||
get { return alamv; }
|
||||
set { this.alamv = value; }
|
||||
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),System.ComponentModel.Browsable(false)]
|
||||
public int Column
|
||||
{
|
||||
get { return this.column; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), System.ComponentModel.Browsable(false)]
|
||||
public int Row
|
||||
{
|
||||
get { return this.row; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("모양"), Description("이 셀의 이름입니다.")]
|
||||
public string 이름
|
||||
{
|
||||
get { return this.name; }
|
||||
set { name = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("모양"), Description("이 셀의 사용여부를 설정합니다. 사용이 해제된 셀은 자료가 저장되지 않습니다.")]
|
||||
public Boolean 사용
|
||||
{
|
||||
get { return this.enable; }
|
||||
set { this.enable = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("정보"), Description("이 셀의 활성화여부를 설정합니다. 해제된 셀은 알람"), Browsable(true)]
|
||||
public Boolean 활성화
|
||||
{
|
||||
get { return this.active; }
|
||||
set
|
||||
{
|
||||
this.active = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
58
cVMS.NET_CS/HMI/MainDisplay/CMouseinfo.cs
Normal file
58
cVMS.NET_CS/HMI/MainDisplay/CMouseinfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
|
||||
public partial class CMouseinfo
|
||||
{
|
||||
private Boolean hand;
|
||||
private Boolean cross;
|
||||
private Boolean move;
|
||||
private Boolean drag;
|
||||
private EDRAGTYPE dragtype;
|
||||
|
||||
private PointF position;
|
||||
|
||||
public CMouseinfo(PointF PointF)
|
||||
{
|
||||
position = PointF;
|
||||
}
|
||||
public EDRAGTYPE DragType
|
||||
{
|
||||
get { return this.dragtype; }
|
||||
set { this.dragtype = value; }
|
||||
}
|
||||
public PointF Position
|
||||
{
|
||||
get { return this.position; }
|
||||
set { this.position = value; }
|
||||
}
|
||||
public Boolean Hand
|
||||
{
|
||||
get { return this.hand; }
|
||||
set { this.hand = value; }
|
||||
}
|
||||
public Boolean Cross
|
||||
{
|
||||
get { return this.cross; }
|
||||
set { this.cross = value; }
|
||||
}
|
||||
public Boolean Move
|
||||
{
|
||||
get { return this.move; }
|
||||
set { this.move = value; }
|
||||
}
|
||||
public Boolean Drag
|
||||
{
|
||||
get { return this.drag; }
|
||||
set { this.drag = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
149
cVMS.NET_CS/HMI/MainDisplay/CWINDOW.cs
Normal file
149
cVMS.NET_CS/HMI/MainDisplay/CWINDOW.cs
Normal file
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
namespace vmsnet.HMI
|
||||
{
|
||||
[TypeConverterAttribute(typeof(ExpandableObjectConverter)), Serializable()]
|
||||
public partial class CWINDOW
|
||||
{
|
||||
private int idx;
|
||||
private String title;
|
||||
private String matrix;
|
||||
// public RectangleF R = new RectangleF(0, 0, 0, 0);
|
||||
public Single _itemwidth;
|
||||
public Single _itemheight;
|
||||
private int rowcount;
|
||||
private int columncount;
|
||||
//private Single alamh;
|
||||
//private Single alaml;
|
||||
private Boolean _debug=false;
|
||||
|
||||
////연결종료된시간이있다.
|
||||
//public UInt16 disconnecttime = 0;
|
||||
//public UInt16 restarttime = 0;
|
||||
|
||||
|
||||
public delegate void OnChangeDataHandler();
|
||||
public event OnChangeDataHandler OnChangeData;
|
||||
|
||||
public CWINDOW()
|
||||
{
|
||||
idx = 0;
|
||||
title = "WINDOW";
|
||||
matrix = "1x1";
|
||||
_itemwidth = 0;
|
||||
_itemheight = 0;
|
||||
}
|
||||
|
||||
public CWINDOW(String ptitle, String pMatrix, Single iw, Single ih)
|
||||
{
|
||||
this.title = ptitle;
|
||||
this.matrix = pMatrix;
|
||||
this._itemheight = ih;
|
||||
this._itemwidth = iw;
|
||||
//this.R = r;
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("개발자"), Description("debug Mode")]
|
||||
public Boolean Debug
|
||||
{
|
||||
get { return _debug; }
|
||||
set { _debug = value; }
|
||||
}
|
||||
|
||||
|
||||
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람설정"), Description("상위 알람값입니다.")]
|
||||
//public Single HIGH
|
||||
//{
|
||||
// get { return alamh; }
|
||||
// set { alamh = value;
|
||||
// try { OnChangeData(); }
|
||||
// catch { }
|
||||
// }
|
||||
//}
|
||||
|
||||
//[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("알람설정"), Description("하위 알람값입니다.")]
|
||||
//public Single LOW
|
||||
//{
|
||||
// get { return alaml; }
|
||||
// set { alaml = value;
|
||||
// try { OnChangeData(); }
|
||||
// catch { }
|
||||
// }
|
||||
//}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("x"), Description("x"),Browsable(false)]
|
||||
public Single ITEMWIDTH
|
||||
{
|
||||
get { return _itemwidth; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("x"), Description("x"), Browsable(false)]
|
||||
public Single ITEMHEIGHT
|
||||
{
|
||||
get { return _itemheight; }
|
||||
}
|
||||
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance"), Description("Appearance and Style"),Browsable(true)]
|
||||
public int IDX
|
||||
{
|
||||
get { return idx; }
|
||||
set { idx = value; }
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("일반"), Description("해당 윈도우의 이름입니다.")]
|
||||
public String 이름
|
||||
{
|
||||
get { return title; }
|
||||
set { title = value;
|
||||
if (OnChangeData != null) OnChangeData();
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance"), Description("Appearance and Style"),Browsable(false)]
|
||||
public String MATRIX
|
||||
{
|
||||
get { return matrix; }
|
||||
set
|
||||
{
|
||||
matrix = value.Replace("*","x").Replace("X","x");
|
||||
this.rowcount = Int32.Parse(matrix.Split(new Char[] { 'x' })[0]);
|
||||
this.columncount = Int32.Parse(matrix.Split(new Char[] { 'x' })[1]);
|
||||
}
|
||||
}
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance"), Description("Appearance and Style"), Browsable(false)]
|
||||
public int RowCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.rowcount == 0)
|
||||
{
|
||||
this.rowcount = Int32.Parse(matrix.Split(new Char[] { 'x' })[0]);
|
||||
|
||||
}
|
||||
return this.rowcount;
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance"), Description("Appearance and Style"), Browsable(false)]
|
||||
public int CoulumnCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.columncount == 0)
|
||||
{
|
||||
this.columncount = Int32.Parse(matrix.Split(new Char[] { 'x' })[1]);
|
||||
}
|
||||
return this.columncount;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
1964
cVMS.NET_CS/HMI/MainDisplay/DispCtrl.cs
Normal file
1964
cVMS.NET_CS/HMI/MainDisplay/DispCtrl.cs
Normal file
File diff suppressed because it is too large
Load Diff
120
cVMS.NET_CS/HMI/MainDisplay/DispCtrl.resx
Normal file
120
cVMS.NET_CS/HMI/MainDisplay/DispCtrl.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user