SchematicDrawing: Editing completed, TODO: Display

This commit is contained in:
Milan Hanajik 2020-05-26 10:28:40 +02:00
parent 2c100c7150
commit 070a76aade
337 changed files with 6267 additions and 663 deletions

2
.gitignore vendored
View File

@ -30,6 +30,8 @@ Results/bin/
Results/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
SchematicDrawing/bin
SchematicDrawing/obj
Statistics/bin/
Statistics/obj/
TBF/bin/

View File

@ -94,6 +94,10 @@
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
<Name>Config</Name>
</ProjectReference>
<ProjectReference Include="..\SchematicDrawing\SchematicDrawing.csproj">
<Project>{0f79ca69-9dbc-41f3-a6fc-5a2937365343}</Project>
<Name>SchematicDrawing</Name>
</ProjectReference>
<ProjectReference Include="..\TBF\TBF.csproj">
<Project>{8648FD92-CDA1-4C3A-B5F9-FE547CE1FA48}</Project>
<Name>TBF</Name>

View File

@ -0,0 +1,355 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchematicDrawing
{
public class DrawingShape
{
public readonly Shape Shape; /// see enum SchematicDrawing.Shape
public readonly Sz Sz; /// see enum SchematicDrawing.Sz
public readonly int SzX; /// Size X in SchematicDrawing.Const.Step pixels
public readonly int SzY; /// Size Y in SchematicDrawing.Const.Step pixels
public readonly bool HasImg; /// True when there is an image of this item to be displayed
public readonly Image ImgRight; /// Bitmap to be drawn (in the open state in case there are two states: open/closed)
public readonly Image ImgUp;
public readonly Image ImgLeft;
public readonly Image ImgDown;
public readonly Image ImgRightFlipped;
public readonly Image ImgUpFlipped;
public readonly Image ImgLeftFlipped;
public readonly Image ImgDownFlipped;
public readonly int OffsX; /// Offset of left/top coordinate of the bitmap when rendering
public readonly int OffsY; /// Offset of left/top coordinate of the bitmap when rendering
public readonly int Wid; /// Width of the bitmap when rendering, original bitmap is resized to this size
public readonly int Hgh; /// Height of the bitmap when rendering, original bitmap is resized to this size
public readonly bool HasValue; /// true when there is a measured or setpoint value to be displayed (in any form)
public readonly Node[] Nodes; /// Nodes of this shape
public readonly Edge[] Edges; /// Edges (in the open state in case there are two states: open/closed)
public readonly bool CanBeClosed; /// true = This shape hase two states: open and closed
public readonly Edge[] EdgesClosed; /// Optional edges in the closed state
public readonly Image ImgRightClosed; /// Optional bitmap in the closed state, size should be the same as the size of Bmp
public readonly Image ImgUpClosed;
public readonly Image ImgLeftClosed;
public readonly Image ImgDownClosed;
public readonly Image ImgRightFlippedClosed;
public readonly Image ImgUpFlippedClosed;
public readonly Image ImgLeftFlippedClosed;
public readonly Image ImgDownFlippedClosed;
DrawingShape(Shape shape, Sz sz, int szX, int szY, bool hasValue, Bitmap bmp = null, int offsX = 0, int offsY = 0, int wid = 0, int hgh = 0, Node[] nodes = null, Edge[] edges = null, Bitmap bmpClosed = null, Edge[] edgesClosed = null)
{
Shape = shape;
Sz = sz;
SzX = szX;
SzY = szY;
HasValue = hasValue;
HasImg = (bmp != null);
if (HasImg)
{
ImgRight = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgDown = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgLeft = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgUp = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
ImgRightFlipped = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgDownFlipped = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgLeftFlipped = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgUpFlipped = bmp.Clone() as Image;
bmp.RotateFlip(RotateFlipType.Rotate90FlipNone);
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
}
OffsX = offsX;
OffsY = offsY;
Wid = wid;
Hgh = hgh;
Nodes = (nodes != null) ? nodes : new Node[0];
Edges = (edges != null) ? edges : new Edge[0];
CanBeClosed = (bmpClosed != null);
EdgesClosed = CanBeClosed ? edgesClosed : Edges;
if (HasImg && CanBeClosed)
{
ImgRightClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgDownClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgLeftClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgUpClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
bmpClosed.RotateFlip(RotateFlipType.RotateNoneFlipY);
ImgRightFlippedClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgDownFlippedClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgLeftFlippedClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
ImgUpFlippedClosed = bmpClosed.Clone() as Image;
bmpClosed.RotateFlip(RotateFlipType.Rotate90FlipNone);
bmpClosed.RotateFlip(RotateFlipType.RotateNoneFlipY);
}
}
public Rectangle GetRotatedFlippedImageRectangle(Orient itemOrient, bool itemFlip)
{
if (itemFlip)
{
/// Flipped (mirror) image
switch (itemOrient)
{
default:
case Orient.R: return new Rectangle(OffsX, SchematicDrawing.Const.Step * SzY - Hgh - OffsY, Wid, Hgh);
case Orient.Up: return new Rectangle(OffsY, OffsX, Hgh, Wid);
case Orient.L: return new Rectangle(SchematicDrawing.Const.Step * SzX - Wid - OffsX, OffsY, Wid, Hgh);
case Orient.Dn: return new Rectangle(SchematicDrawing.Const.Step * SzY - Hgh - OffsY, SchematicDrawing.Const.Step * SzX - Wid - OffsX, Hgh, Wid);
}
}
else
{
/// Normal image
switch (itemOrient)
{
default:
case Orient.R: return new Rectangle(OffsX, OffsY, Wid, Hgh);
case Orient.Up: return new Rectangle(OffsY, SchematicDrawing.Const.Step * SzX - Wid - OffsX, Hgh, Wid);
case Orient.L: return new Rectangle(SchematicDrawing.Const.Step * SzX - Wid - OffsX, SchematicDrawing.Const.Step * SzY - Hgh - OffsY, Wid, Hgh);
case Orient.Dn: return new Rectangle(SchematicDrawing.Const.Step * SzY - Hgh - OffsY, OffsX, Hgh, Wid);
}
}
}
/// <summary>
/// Get coordinates and orientation of the rotated/flipped node
/// </summary>
/// <param name="nid">Node id</param>
/// <param name="itemOrient">Component orientation</param>
/// <param name="itemFlip">Component flip</param>
/// <returns>Rotated/flipped node</returns>
public Node GetRotatedFlippedNode(int nid, Orient itemOrient, bool itemFlip)
{
if (Nodes == null || nid < 0 || nid >= Nodes.Length) return new Node(0, 0, Orient.R);
Node node = Nodes[nid];
int ori = (int)itemOrient + (int)node.Orient;
///
if (itemFlip)
{
/// Flipped
if (ori % 2 == 1) ori += 2;
switch (itemOrient)
{
default:
case Orient.R: return new Node(node.X, SzY - node.Y, (Orient)(ori % 4));
case Orient.Up: return new Node(node.Y, node.X, (Orient)(ori % 4));
case Orient.L: return new Node(SzX - node.X, node.Y, (Orient)(ori % 4));
case Orient.Dn: return new Node(SzY - node.Y, SzX - node.X, (Orient)(ori % 4));
}
}
else
{
/// Normal
switch (itemOrient)
{
default:
case Orient.R: return new Node(node.X, node.Y, (Orient)(ori % 4));
case Orient.Up: return new Node(node.Y, SzX - node.X, (Orient)(ori % 4));
case Orient.L: return new Node(SzX - node.X, SzY - node.Y, (Orient)(ori % 4));
case Orient.Dn: return new Node(SzY - node.Y, node.X, (Orient)(ori % 4));
}
}
}
public static DrawingShape[] Shapes;
///
public static int DrShIx(Shape shape, Sz sz) { return (int)shape * (int)Sz.Count + (int)sz; }
///
public static DrawingShape GetDrawingShape(Shape shape, Sz sz) { return Shapes[DrShIx(shape, sz)]; }
///
public static DrawingShape GetDrawingShape(IDrawingItemCfg item) { return Shapes[DrShIx(item.Shape, item.Sz)]; }
/// <summary>
/// Static constructor that initializes Shapes[] array
/// </summary>
static DrawingShape()
{
Shapes = new DrawingShape[(int)Shape.Count * (int)Sz.Count];
/// Temperature meter
Shapes[DrShIx(Shape.TempM, Sz.S)] = new DrawingShape(Shape.TempM, Sz.S, 0, 0, true);
Shapes[DrShIx(Shape.TempM, Sz.M)] = new DrawingShape(Shape.TempM, Sz.M, 0, 0, true);
Shapes[DrShIx(Shape.TempM, Sz.L)] = new DrawingShape(Shape.TempM, Sz.L, 0, 0, true);
Shapes[DrShIx(Shape.TempM, Sz.XL)] = new DrawingShape(Shape.TempM, Sz.XL, 0, 0, true);
/// Pressure meter
Shapes[DrShIx(Shape.PressM, Sz.S)] = new DrawingShape(Shape.PressM, Sz.S, 0, 0, true);
Shapes[DrShIx(Shape.PressM, Sz.M)] = new DrawingShape(Shape.PressM, Sz.M, 0, 0, true);
Shapes[DrShIx(Shape.PressM, Sz.L)] = new DrawingShape(Shape.PressM, Sz.L, 0, 0, true);
Shapes[DrShIx(Shape.PressM, Sz.XL)] = new DrawingShape(Shape.PressM, Sz.XL, 0, 0, true);
/// Valve
Shapes[DrShIx(Shape.Valve, Sz.S)] = new DrawingShape(Shape.Valve, Sz.S, 2, 2, false, Properties.Resources.Valve_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Valve_S_closed, new Edge[] { });
Shapes[DrShIx(Shape.Valve, Sz.M)] = new DrawingShape(Shape.Valve, Sz.M, 3, 4, false, Properties.Resources.Valve_M_open, 0, 5, 30, 30,
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Valve_M_closed, new Edge[] { });
Shapes[DrShIx(Shape.Valve, Sz.L)] = new DrawingShape(Shape.Valve, Sz.L, 4, 4, false, Properties.Resources.Valve_L_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Valve_L_closed, new Edge[] { });
Shapes[DrShIx(Shape.Valve, Sz.XL)] = new DrawingShape(Shape.Valve, Sz.XL, 5, 6, false, Properties.Resources.Valve_XL_open, 0, 5, 50, 50,
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Valve_XL_closed, new Edge[] { });
/// Regulation valve
Shapes[DrShIx(Shape.RegV, Sz.S)] = new DrawingShape(Shape.RegV, Sz.S, 2, 2, true, Properties.Resources.RegV_S, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.RegV, Sz.M)] = new DrawingShape(Shape.RegV, Sz.M, 3, 4, true, Properties.Resources.RegV_M, 0, 5, 30, 30,
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.RegV, Sz.L)] = new DrawingShape(Shape.RegV, Sz.L, 4, 4, true, Properties.Resources.RegV_L, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.RegV, Sz.XL)] = new DrawingShape(Shape.RegV, Sz.XL, 5, 6, true, Properties.Resources.RegV_XL, 0, 5, 50, 50,
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
/// Pump
Shapes[DrShIx(Shape.Pump, Sz.S)] = new DrawingShape(Shape.Pump, Sz.S, 2, 2, false, Properties.Resources.Pump_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_S_closed, new Edge[] { });
Shapes[DrShIx(Shape.Pump, Sz.M)] = new DrawingShape(Shape.Pump, Sz.M, 3, 4, false, Properties.Resources.Pump_M_open, 0, 5, 30, 30,
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_M_closed, new Edge[] { });
Shapes[DrShIx(Shape.Pump, Sz.L)] = new DrawingShape(Shape.Pump, Sz.L, 4, 4, false, Properties.Resources.Pump_L_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_L_closed, new Edge[] { });
Shapes[DrShIx(Shape.Pump, Sz.XL)] = new DrawingShape(Shape.Pump, Sz.XL, 5, 6, false, Properties.Resources.Pump_XL_open, 0, 5, 50, 50,
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_XL_closed, new Edge[] { });
/// Pump with frequency inverter
Shapes[DrShIx(Shape.PumpFM, Sz.S)] = new DrawingShape(Shape.PumpFM, Sz.S, 2, 2, true, Properties.Resources.Pump_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_S_closed, new Edge[] { });
Shapes[DrShIx(Shape.PumpFM, Sz.M)] = new DrawingShape(Shape.PumpFM, Sz.M, 3, 4, true, Properties.Resources.Pump_M_open, 0, 5, 30, 30,
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_M_closed, new Edge[] { });
Shapes[DrShIx(Shape.PumpFM, Sz.L)] = new DrawingShape(Shape.PumpFM, Sz.L, 4, 4, true, Properties.Resources.Pump_L_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_L_closed, new Edge[] { });
Shapes[DrShIx(Shape.PumpFM, Sz.XL)] = new DrawingShape(Shape.PumpFM, Sz.XL, 5, 6, true, Properties.Resources.Pump_XL_open, 0, 5, 50, 50,
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1) },
Properties.Resources.Pump_XL_closed, new Edge[] { });
/// Flow meter
Shapes[DrShIx(Shape.FlowM, Sz.S)] = new DrawingShape(Shape.FlowM, Sz.S, 2, 2, true, Properties.Resources.FlowM_S, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1) });
Shapes[DrShIx(Shape.FlowM, Sz.M)] = new DrawingShape(Shape.FlowM, Sz.M, 3, 4, true, Properties.Resources.FlowM_M, 0, 5, 30, 30,
new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) },
new Edge[] { new Edge(0, 1) });
Shapes[DrShIx(Shape.FlowM, Sz.L)] = new DrawingShape(Shape.FlowM, Sz.L, 4, 4, true, Properties.Resources.FlowM_L, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
new Edge[] { new Edge(0, 1) });
Shapes[DrShIx(Shape.FlowM, Sz.XL)] = new DrawingShape(Shape.FlowM, Sz.XL, 5, 6, true, Properties.Resources.FlowM_XL, 0, 5, 50, 50,
new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) },
new Edge[] { new Edge(0, 1) });
/// Water meter
Shapes[DrShIx(Shape.WaterM, Sz.L)] = new DrawingShape(Shape.WaterM, Sz.L, 4, 4, false, Properties.Resources.WaterM_L, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) },
new Edge[] { new Edge(0, 1) });
Shapes[DrShIx(Shape.WaterM, Sz.S)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
Shapes[DrShIx(Shape.WaterM, Sz.M)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
Shapes[DrShIx(Shape.WaterM, Sz.XL)] = Shapes[DrShIx(Shape.WaterM, Sz.L)];
/// Junction
Shapes[DrShIx(Shape.Junction, Sz.S)] = new DrawingShape(Shape.Junction, Sz.S, 0, 0, false, null, 0, 0, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
Shapes[DrShIx(Shape.Junction, Sz.M)] = new DrawingShape(Shape.Junction, Sz.M, 0, 0, false, null, 0, 0, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
Shapes[DrShIx(Shape.Junction, Sz.L)] = new DrawingShape(Shape.Junction, Sz.L, 0, 0, false, null, 0, 0, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
Shapes[DrShIx(Shape.Junction, Sz.XL)] = new DrawingShape(Shape.Junction, Sz.XL, 0, 0, false, null, 0, 0, 0, 0, new Node[] { new Node(0, 0, Orient.R) });
/// Knee
Shapes[DrShIx(Shape.Knee, Sz.K1)] = new DrawingShape(Shape.Knee, Sz.K1, 2, 2, false, Properties.Resources.Knee_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee_S_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K2)] = new DrawingShape(Shape.Knee, Sz.K2, 2, 2, false, Properties.Resources.Knee_M_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee_M_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K3)] = new DrawingShape(Shape.Knee, Sz.K3, 2, 2, false, Properties.Resources.Knee_L_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee_L_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K4)] = new DrawingShape(Shape.Knee, Sz.K4, 4, 4, false, Properties.Resources.Knee_XL_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee_XL_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K5)] = new DrawingShape(Shape.Knee, Sz.K5, 2, 2, false, Properties.Resources.Knee2_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee2_S_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K6)] = new DrawingShape(Shape.Knee, Sz.K6, 2, 2, false, Properties.Resources.Knee2_M_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee2_M_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K7)] = new DrawingShape(Shape.Knee, Sz.K7, 3, 2, false, Properties.Resources.Knee2_L_open, 0, 0, 30, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee2_L_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
Shapes[DrShIx(Shape.Knee, Sz.K8)] = new DrawingShape(Shape.Knee, Sz.K8, 4, 4, false, Properties.Resources.Knee2_XL_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up) }, new Edge[] { new Edge(0, 1), new Edge(1, 0) },
Properties.Resources.Knee2_XL_closed, new Edge[] { new Edge(0, 1), new Edge(1, 0) });
/// Tee
Shapes[DrShIx(Shape.Tee, Sz.K1)] = new DrawingShape(Shape.Tee, Sz.K1, 2, 2, false, Properties.Resources.Tee_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee_S_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K2)] = new DrawingShape(Shape.Tee, Sz.K2, 2, 2, false, Properties.Resources.Tee_M_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee_M_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K3)] = new DrawingShape(Shape.Tee, Sz.K3, 2, 2, false, Properties.Resources.Tee_L_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee_L_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K4)] = new DrawingShape(Shape.Tee, Sz.K4, 4, 4, false, Properties.Resources.Tee_XL_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up), new Node(4, 2, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee_XL_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K5)] = new DrawingShape(Shape.Tee, Sz.K5, 2, 2, false, Properties.Resources.Tee2_S_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee2_S_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K6)] = new DrawingShape(Shape.Tee, Sz.K6, 2, 2, false, Properties.Resources.Tee2_M_open, 0, 0, 20, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up), new Node(2, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee2_M_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K7)] = new DrawingShape(Shape.Tee, Sz.K7, 3, 2, false, Properties.Resources.Tee2_L_open, 0, 0, 30, 20,
new Node[] { new Node(0, 1, Orient.L), new Node(2, 0, Orient.Up), new Node(3, 1, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee2_L_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
Shapes[DrShIx(Shape.Tee, Sz.K8)] = new DrawingShape(Shape.Tee, Sz.K8, 4, 4, false, Properties.Resources.Tee2_XL_open, 0, 0, 40, 40,
new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up), new Node(4, 2, Orient.R) },
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) },
Properties.Resources.Tee2_XL_closed,
new Edge[] { new Edge(0, 1), new Edge(1, 0), new Edge(0, 2), new Edge(2, 0), new Edge(2, 1), new Edge(1, 2) });
}
}
}

21
SchematicDrawing/Edge.cs Normal file
View File

@ -0,0 +1,21 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace SchematicDrawing
{
public class Edge
{
public int NodeId1;
public int NodeId2;
public int Distance;
public Edge(int nodeId1, int nodeId2, int distance = 1)
{
NodeId1 = nodeId1;
NodeId2 = nodeId2;
Distance = distance;
}
}
}

120
SchematicDrawing/Enums.cs Normal file
View File

@ -0,0 +1,120 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace SchematicDrawing
{
public static class Const
{
public const int Step = 10;
public static readonly Matrix MatrixRight = new Matrix(1, 0, 0, 1, 0, 0);
public static readonly Matrix MatrixUp = new Matrix(0, -1, 1, 0, 0, 0);
public static readonly Matrix MatrixLeft = new Matrix(-1, 0, 0, -1, 0, 0);
public static readonly Matrix MatrixDown = new Matrix(0, 1, -1, 0, 0, 0);
}
public enum Shape
{
Ambient,
Bypass,
Cross,
Div,
Edges, /// Dummy shape, has no image and always coordinates (0,0)
FlowM,
Junction,
Knee,
PressM,
Pump,
PumpFM,
RegV,
Sink,
Tank,
Tee,
TempM,
Valve,
WaterM,
Count
}
public enum Sz
{
S,
M,
L,
XL,
K1,
K2,
K3,
K4,
K5,
K6,
K7,
K8,
Count,
}
public enum Orient
{
R,
Dn,
L,
Up,
Count,
}
public enum Selection
{
Object,
Label,
Value,
EdgeS,
EdgeM,
EdgeL,
EdgeXL,
Count
}
public static class Utils
{
/// <summary>
/// Return coordinates of the vector in direction Orient
/// </summary>
/// <param name="orient">Orient</param>
/// <returns>Vector</returns>
public static Point GetVect(Orient orient)
{
switch (orient)
{
default:
case Orient.R: return new Point(1, 0);
case Orient.Up: return new Point(0, -1);
case Orient.L: return new Point(-1, 0);
case Orient.Dn: return new Point(0, 1);
}
}
/// <summary>
/// Return coordinates of the vector perpendicular to Orient
/// </summary>
/// <param name="orient">Orient</param>
/// <returns>Perpendicular vector</returns>
public static Point GetNormalVect(Orient orient)
{
switch (orient)
{
default:
case Orient.R: return new Point(0, 1);
case Orient.Up: return new Point(1, 0);
case Orient.L: return new Point(0, -1);
case Orient.Dn: return new Point(-1, 0);
}
}
}
}

View File

@ -0,0 +1,33 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace SchematicDrawing
{
public interface IDrawingItemCfg
{
///
/// Schematic drawing parameters
///
string Name { get; } /// Unique name
string ClassName { get; }
Shape Shape { get; set; }
int X { get; set; }
int Y { get; set; }
Sz Sz { get; set; }
Orient Orient { get; set; }
bool Flip { get; set; }
int LblX { get; set; }
int LblY { get; set; }
Orient LblOrient { get; set; }
int ValX { get; set; }
int ValY { get; set; }
double ValFact { get; set; }
string ValFmt { get; set; }
Orient ValOrient { get; set; }
bool IsHidden();
}
}

View File

@ -0,0 +1,10 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace SchematicDrawing
{
public interface IDrawingItemCmpnt
{
IDrawingItemCfg DrawingItemCfg { get; }
}
}

21
SchematicDrawing/Node.cs Normal file
View File

@ -0,0 +1,21 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
namespace SchematicDrawing
{
public class Node
{
public int X;
public int Y;
public Orient Orient;
public Node(int x, int y, Orient orient)
{
X = x;
Y = y;
Orient = orient;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SchematicDrawing")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SchematicDrawing")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ebe01d13-1510-46ae-9457-473e83584394")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,633 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SchematicDrawing.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SchematicDrawing.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FlowM_L {
get {
object obj = ResourceManager.GetObject("FlowM_L", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FlowM_M {
get {
object obj = ResourceManager.GetObject("FlowM_M", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FlowM_S {
get {
object obj = ResourceManager.GetObject("FlowM_S", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FlowM_XL {
get {
object obj = ResourceManager.GetObject("FlowM_XL", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_L_closed {
get {
object obj = ResourceManager.GetObject("Knee_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_L_open {
get {
object obj = ResourceManager.GetObject("Knee_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_M_closed {
get {
object obj = ResourceManager.GetObject("Knee_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_M_open {
get {
object obj = ResourceManager.GetObject("Knee_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_S_closed {
get {
object obj = ResourceManager.GetObject("Knee_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_S_open {
get {
object obj = ResourceManager.GetObject("Knee_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_XL_closed {
get {
object obj = ResourceManager.GetObject("Knee_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee_XL_open {
get {
object obj = ResourceManager.GetObject("Knee_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_L_closed {
get {
object obj = ResourceManager.GetObject("Knee2_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_L_open {
get {
object obj = ResourceManager.GetObject("Knee2_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_M_closed {
get {
object obj = ResourceManager.GetObject("Knee2_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_M_open {
get {
object obj = ResourceManager.GetObject("Knee2_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_S_closed {
get {
object obj = ResourceManager.GetObject("Knee2_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_S_open {
get {
object obj = ResourceManager.GetObject("Knee2_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_XL_closed {
get {
object obj = ResourceManager.GetObject("Knee2_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Knee2_XL_open {
get {
object obj = ResourceManager.GetObject("Knee2_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_L_closed {
get {
object obj = ResourceManager.GetObject("Pump_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_L_open {
get {
object obj = ResourceManager.GetObject("Pump_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_M_closed {
get {
object obj = ResourceManager.GetObject("Pump_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_M_open {
get {
object obj = ResourceManager.GetObject("Pump_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_S_closed {
get {
object obj = ResourceManager.GetObject("Pump_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_S_open {
get {
object obj = ResourceManager.GetObject("Pump_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_XL_closed {
get {
object obj = ResourceManager.GetObject("Pump_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Pump_XL_open {
get {
object obj = ResourceManager.GetObject("Pump_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RegV_L {
get {
object obj = ResourceManager.GetObject("RegV_L", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RegV_M {
get {
object obj = ResourceManager.GetObject("RegV_M", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RegV_S {
get {
object obj = ResourceManager.GetObject("RegV_S", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap RegV_XL {
get {
object obj = ResourceManager.GetObject("RegV_XL", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_L_closed {
get {
object obj = ResourceManager.GetObject("Tee_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_L_open {
get {
object obj = ResourceManager.GetObject("Tee_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_M_closed {
get {
object obj = ResourceManager.GetObject("Tee_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_M_open {
get {
object obj = ResourceManager.GetObject("Tee_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_S_closed {
get {
object obj = ResourceManager.GetObject("Tee_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_S_open {
get {
object obj = ResourceManager.GetObject("Tee_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_XL_closed {
get {
object obj = ResourceManager.GetObject("Tee_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee_XL_open {
get {
object obj = ResourceManager.GetObject("Tee_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_L_closed {
get {
object obj = ResourceManager.GetObject("Tee2_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_L_open {
get {
object obj = ResourceManager.GetObject("Tee2_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_M_closed {
get {
object obj = ResourceManager.GetObject("Tee2_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_M_open {
get {
object obj = ResourceManager.GetObject("Tee2_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_S_closed {
get {
object obj = ResourceManager.GetObject("Tee2_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_S_open {
get {
object obj = ResourceManager.GetObject("Tee2_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_XL_closed {
get {
object obj = ResourceManager.GetObject("Tee2_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Tee2_XL_open {
get {
object obj = ResourceManager.GetObject("Tee2_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_L_closed {
get {
object obj = ResourceManager.GetObject("Valve_L_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_L_open {
get {
object obj = ResourceManager.GetObject("Valve_L_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_M_closed {
get {
object obj = ResourceManager.GetObject("Valve_M_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_M_open {
get {
object obj = ResourceManager.GetObject("Valve_M_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_S_closed {
get {
object obj = ResourceManager.GetObject("Valve_S_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_S_open {
get {
object obj = ResourceManager.GetObject("Valve_S_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_XL_closed {
get {
object obj = ResourceManager.GetObject("Valve_XL_closed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Valve_XL_open {
get {
object obj = ResourceManager.GetObject("Valve_XL_open", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap WaterM_L {
get {
object obj = ResourceManager.GetObject("WaterM_L", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,292 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="FlowM_L" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\FlowM-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FlowM_M" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\FlowM-M.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FlowM_S" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\FlowM-S.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FlowM_XL" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\FlowM-XL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee2_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee2-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Knee_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Knee-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pump_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Pump-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RegV_L" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\RegV-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RegV_M" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\RegV-M.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RegV_S" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\RegV-S.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RegV_XL" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\RegV-XL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee2_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee2-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Tee_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Tee-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_L_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-L-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_L_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-L-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_M_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-M-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_M_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-M-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_S_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-S-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_S_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-S-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_XL_closed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-XL-closed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Valve_XL_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\Valve-XL-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WaterM_L" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Pictures\WaterM-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0F79CA69-9DBC-41F3-A6FC-5A2937365343}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SchematicDrawing</RootNamespace>
<AssemblyName>SchematicDrawing</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DrawingShape.cs" />
<Compile Include="Edge.cs" />
<Compile Include="Enums.cs" />
<Compile Include="IDrawingItemCmpnt.cs" />
<Compile Include="IDrawingItemCfg.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SchematicDrawingCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SchematicDrawingCtrl.Designer.cs">
<DependentUpon>SchematicDrawingCtrl.cs</DependentUpon>
</Compile>
<Compile Include="Node.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="SchematicDrawingCtrl.resx">
<DependentUpon>SchematicDrawingCtrl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="Pictures\FlowM-L.png" />
<None Include="Pictures\FlowM-M.png" />
<None Include="Pictures\FlowM-S.png" />
<Content Include="Pictures\FlowM-XL.png" />
<None Include="Pictures\Knee2-L-closed.png" />
<None Include="Pictures\Knee2-L-open.png" />
<None Include="Pictures\Knee2-M-closed.png" />
<None Include="Pictures\Knee2-M-open.png" />
<None Include="Pictures\Knee2-S-closed.png" />
<None Include="Pictures\Knee2-S-open.png" />
<None Include="Pictures\Knee2-XL-closed.png" />
<None Include="Pictures\Knee2-XL-open.png" />
<None Include="Pictures\Knee-L-closed.png" />
<None Include="Pictures\Knee-L-open.png" />
<None Include="Pictures\Knee-M-closed.png" />
<None Include="Pictures\Knee-M-open.png" />
<None Include="Pictures\Knee-S-closed.png" />
<None Include="Pictures\Knee-S-open.png" />
<None Include="Pictures\Knee-XL-closed.png" />
<None Include="Pictures\Knee-XL-open.png" />
<None Include="Pictures\Pump-L-closed.png" />
<None Include="Pictures\Pump-L-open.png" />
<None Include="Pictures\Pump-M-closed.png" />
<None Include="Pictures\Pump-M-open.png" />
<None Include="Pictures\Pump-S-closed.png" />
<None Include="Pictures\Pump-S-open.png" />
<Content Include="Pictures\Pump-XL-closed.png" />
<Content Include="Pictures\Pump-XL-open.png" />
<None Include="Pictures\RegV-L.png" />
<None Include="Pictures\RegV-M.png" />
<None Include="Pictures\RegV-S.png" />
<Content Include="Pictures\RegV-XL.png" />
<None Include="Pictures\Tee2-L-closed.png" />
<None Include="Pictures\Tee2-L-open.png" />
<None Include="Pictures\Tee2-M-closed.png" />
<None Include="Pictures\Tee2-M-open.png" />
<None Include="Pictures\Tee2-S-closed.png" />
<None Include="Pictures\Tee2-S-open.png" />
<None Include="Pictures\Tee2-XL-closed.png" />
<None Include="Pictures\Tee2-XL-open.png" />
<None Include="Pictures\Tee-L-closed.png" />
<None Include="Pictures\Tee-L-open.png" />
<None Include="Pictures\Tee-M-closed.png" />
<None Include="Pictures\Tee-M-open.png" />
<None Include="Pictures\Tee-S-closed.png" />
<None Include="Pictures\Tee-S-open.png" />
<None Include="Pictures\Tee-XL-closed.png" />
<None Include="Pictures\Tee-XL-open.png" />
<None Include="Pictures\Valve-L-closed.png" />
<None Include="Pictures\Valve-L-open.png" />
<None Include="Pictures\Valve-M-closed.png" />
<None Include="Pictures\Valve-M-open.png" />
<None Include="Pictures\Valve-S-closed.png" />
<None Include="Pictures\Valve-S-open.png" />
<Content Include="Pictures\Valve-XL-closed.png" />
<Content Include="Pictures\Valve-XL-open.png" />
<None Include="Pictures\WaterM-L.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,43 @@
namespace SchematicDrawing
{
partial class SchematicDrawingCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// SchematicDrawingCtrl
//
this.Name = "SchematicDrawingCtrl";
this.Size = new System.Drawing.Size(400, 300);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -0,0 +1,327 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace SchematicDrawing
{
public partial class SchematicDrawingCtrl : UserControl
{
public bool EditMode;
///
/// Edges
///
Pen[] pensClosed;
Pen[] pensWaterOpen;
public string[] EdgesS { get { return edgesS; } set { edgesS = value; Redraw(); } }
public string[] EdgesM { get { return edgesM; } set { edgesM = value; Redraw(); } }
public string[] EdgesL { get { return edgesL; } set { edgesL = value; Redraw(); } }
public string[] EdgesXL { get { return edgesXL; } set { edgesXL = value; Redraw(); } }
string[] edgesS;
string[] edgesM;
string[] edgesL;
string[] edgesXL;
/// Support for adding edges
string startNodeItem;
int startNodeId;
string tempEdgeStr;
Sz tempEdgeSize;
/// <summary>
/// Dictionary that speeds up drawing edges between nodes
/// </summary>
Dictionary<string, IDrawingItemCfg> name2Item;
///
/// Components: Added by AddItem()
/// Cleared by ClearItems()
///
IList<IDrawingItemCfg> items;
public string SelectedItemName
{
set
{
selectedItemName = value;
Redraw();
}
get
{
return selectedItemName;
}
}
string selectedItemName;
///
/// Labels and values
///
Font labelFont;
Brush labelBrush;
Font valueFont;
Brush valueBrush;
public SchematicDrawingCtrl()
{
InitializeComponent();
this.AutoScaleMode = AutoScaleMode.None;
this.DoubleBuffered = true;
/// Font for drawing labels
labelFont = new Font("Arial", 10, FontStyle.Regular);
labelBrush = Brushes.Black;
/// Font for drawing values
valueFont = new Font("Arial", 10, FontStyle.Regular);
valueBrush = Brushes.Blue;
/// Pens for drawing edges/pipes
Brush brushClosed = new SolidBrush(Color.FromArgb(255, 127, 127, 127));
Brush brushWaterOpen = new SolidBrush(Color.FromArgb(255, 0, 162, 232));
///
pensClosed = new Pen[(int)Sz.XL + 1];
pensWaterOpen = new Pen[(int)Sz.XL + 1];
///
for (Sz sz = 0; sz <= Sz.XL; sz++)
{
pensClosed[(int)sz] = new Pen(brushClosed);
pensWaterOpen[(int)sz] = new Pen(brushWaterOpen);
float width;
switch (sz)
{
default:
case Sz.S: width = 8.0f; break;
case Sz.M: width = 10.0f; break;
case Sz.L: width = 14.0f; break;
case Sz.XL: width = 20.0f; break;
}
pensClosed[(int)sz].Width = width;
pensClosed[(int)sz].LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
pensWaterOpen[(int)sz].Width = width;
pensWaterOpen[(int)sz].LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
}
name2Item = new Dictionary<string, IDrawingItemCfg>();
items = new List<IDrawingItemCfg>();
SelectedItemName = string.Empty;
this.Paint += new System.Windows.Forms.PaintEventHandler(this.SchematicDrawingCtrl_Paint);
}
public void AddItem(IDrawingItemCfg item)
{
items.Add(item);
name2Item.Add(item.Name, item);
Redraw();
}
public void ClearItems()
{
items.Clear();
name2Item.Clear();
Redraw();
}
public IList<IDrawingItemCfg> GetItems()
{
/// Return a list of items, never return null
return (items != null) ? items : new List<IDrawingItemCfg>();
}
public void Redraw()
{
Invalidate();
}
///
/// Support functions for adding new edges
///
public void ShowStartNode(string itemName, int nodeId)
{
startNodeItem = itemName;
startNodeId = nodeId;
Redraw();
}
public void ClearStartNode()
{
startNodeItem = null;
Redraw();
}
public void ShowTempEdge(string edgeStr, Sz edgeSize)
{
tempEdgeStr = edgeStr;
tempEdgeSize = edgeSize;
Redraw();
}
public void ClearTempEdge()
{
tempEdgeStr = null;
Redraw();
}
Point GetOffset(int x, int y, Orient orientation, bool flip)
{
switch (orientation)
{
default:
case Orient.R: return flip ? new Point(x, -y) : new Point(x, y);
case Orient.Up: return flip ? new Point(y, -x) : new Point(y, -x);
case Orient.L: return flip ? new Point(-x, -y) : new Point(-x, -y);
case Orient.Dn: return flip ? new Point(-y, x) : new Point(-y, x);
}
}
/// <summary>
/// Draw a complete hydraulical scheme
/// </summary>
/// <param name="e">PaintEventArgs</param>
void SchematicDrawingCtrl_Paint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(Color.White);
e.Graphics.DrawString("Hydraulical schematic drawing", labelFont, Brushes.White, 200, 1);
if (items == null) return;
///
/// Draw edges
///
if (edgesS != null) foreach (var edge in edgesS) DrawEdge(e, edge, Sz.S, true);
if (edgesM != null) foreach (var edge in edgesM) DrawEdge(e, edge, Sz.M, true);
if (edgesL != null) foreach (var edge in edgesL) DrawEdge(e, edge, Sz.L, true);
if (edgesXL != null) foreach (var edge in edgesXL) DrawEdge(e, edge, Sz.XL, true);
///
/// Draw pictures of items
///
foreach (var item in items)
{
DrawingShape dshape;
if (item != null && (dshape = DrawingShape.GetDrawingShape(item.Shape, item.Sz)) != null)
{
if (!item.IsHidden() || (EditMode && (item.Name == selectedItemName)))
{
if (dshape.HasImg)
{
/// Draw the component image
Rectangle rect = dshape.GetRotatedFlippedImageRectangle(item.Orient, item.Flip);
if (item.Flip)
{
switch (item.Orient)
{
default:
case Orient.R: e.Graphics.DrawImage(dshape.ImgRightFlipped, item.X + rect.X, item.Y + rect.Y); break;
case Orient.Up: e.Graphics.DrawImage(dshape.ImgUpFlipped, item.X + rect.X, item.Y + rect.Y); break;
case Orient.L: e.Graphics.DrawImage(dshape.ImgLeftFlipped, item.X + rect.X, item.Y + rect.Y); break;
case Orient.Dn: e.Graphics.DrawImage(dshape.ImgDownFlipped, item.X + rect.X, item.Y + rect.Y); break;
}
}
else
{
switch (item.Orient)
{
default:
case Orient.R: e.Graphics.DrawImage(dshape.ImgRight, item.X + rect.X, item.Y + rect.Y); break;
case Orient.Up: e.Graphics.DrawImage(dshape.ImgUp, item.X + rect.X, item.Y + rect.Y); break;
case Orient.L: e.Graphics.DrawImage(dshape.ImgLeft, item.X + rect.X, item.Y + rect.Y); break;
case Orient.Dn: e.Graphics.DrawImage(dshape.ImgDown, item.X + rect.X, item.Y + rect.Y); break;
}
}
if (EditMode && (item.Name == selectedItemName))
{
/// Draw rectangle around the selected component image
e.Graphics.DrawRectangle(Pens.Red, item.X + rect.X - 1, item.Y + rect.Y - 1, rect.Width + 1, rect.Height + 1);
}
}
}
}
}
///
/// Draw nodes and a temporary edge (edit mode only)
///
if (EditMode)
{
if (tempEdgeStr != null)
{
DrawEdge(e, tempEdgeStr, tempEdgeSize, true);
}
foreach (var item in items)
{
DrawingShape dshape;
if (item != null && !item.IsHidden() && (null != (dshape = DrawingShape.GetDrawingShape(item.Shape, item.Sz))))
{
///
/// Draw nodes and node ID-s
///
for (int nid = 0; nid < dshape.Nodes.Length; nid++)
{
bool isStartNode = !string.IsNullOrEmpty(startNodeItem) && (item.Name == startNodeItem) && (nid == startNodeId);
Node rfNode = dshape.GetRotatedFlippedNode(nid, item.Orient, item.Flip);
Point dir = Utils.GetVect(rfNode.Orient);
Point norm = Utils.GetNormalVect(rfNode.Orient);
Point[] triangle = new Point[] { new Point(item.X + SchematicDrawing.Const.Step * rfNode.X + dir.X, item.Y + SchematicDrawing.Const.Step * rfNode.Y + dir.Y),
new Point(item.X + SchematicDrawing.Const.Step * rfNode.X + 6*dir.X + 3*norm.X, item.Y + SchematicDrawing.Const.Step * rfNode.Y + 6*dir.Y + 3*norm.Y),
new Point(item.X + SchematicDrawing.Const.Step * rfNode.X + 6*dir.X - 3*norm.X, item.Y + SchematicDrawing.Const.Step * rfNode.Y + 6*dir.Y - 3*norm.Y) };
e.Graphics.DrawPolygon(isStartNode ? Pens.Yellow : Pens.Red, triangle);
e.Graphics.DrawString(nid.ToString(), labelFont, isStartNode ? Brushes.Yellow : Brushes.Red,
item.X + SchematicDrawing.Const.Step * rfNode.X + 14 * dir.X - 5,
item.Y + SchematicDrawing.Const.Step * rfNode.Y + 14 * dir.Y - 7);
}
}
}
}
///
/// Draw labels, Various.Drawing... component labels are drawn in edit mode only
///
foreach (var item in items)
{
if ((!item.IsHidden() && !item.ClassName.StartsWith("Various.Drawing.")) || (EditMode && (item.Name == selectedItemName)))
{
e.Graphics.DrawString(item.Name, labelFont, labelBrush, item.X + item.LblX, item.Y + item.LblY);
}
}
}
/// <summary>
/// Draw an edge
/// </summary>
/// <param name="e">PaintEventArgs</param>
/// <param name="edgeStr">Edge string</param>
/// <param name="edgeSize">Edge size</param>
/// <param name="isWaterOpen">true = filled, false = empty</param>
void DrawEdge(PaintEventArgs e, string edgeStr, Sz edgeSize, bool isWaterOpen)
{
IDrawingItemCfg from;
IDrawingItemCfg to;
DrawingShape dshapeFrom;
DrawingShape dshapeTo;
int nidFrom;
int nidTo;
string[] fields = edgeStr.Split(new char[] { '~' });
if (fields.Length == 4 && name2Item.TryGetValue(fields[0], out from)
&& (null != (dshapeFrom = DrawingShape.Shapes[DrawingShape.DrShIx(from.Shape, from.Sz)]))
&& int.TryParse(fields[1], out nidFrom) && (nidFrom >= 0) && (nidFrom < dshapeFrom.Nodes.Length)
&& name2Item.TryGetValue(fields[2], out to)
&& (null != (dshapeTo = DrawingShape.Shapes[DrawingShape.DrShIx(to.Shape, to.Sz)]))
&& int.TryParse(fields[3], out nidTo) && (nidTo >= 0) && (nidTo < dshapeTo.Nodes.Length)
&& (edgeSize >= Sz.S) && (edgeSize <= Sz.XL))
{
Node nodeFrom = dshapeFrom.GetRotatedFlippedNode(nidFrom, from.Orient, from.Flip);
Node nodeTo = dshapeTo.GetRotatedFlippedNode(nidTo, to.Orient, to.Flip);
e.Graphics.DrawLine(isWaterOpen ? pensWaterOpen[(int)edgeSize] : pensClosed[(int)edgeSize],
from.X + nodeFrom.X * Const.Step, from.Y + nodeFrom.Y * Const.Step,
to.X + nodeTo.X * Const.Step, to.Y + nodeTo.Y * Const.Step);
}
}
}
}

View 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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

12
TBF.sln
View File

@ -69,6 +69,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStreamInterface", "DataStreamInterface\DataStreamInterface.csproj", "{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicDrawing", "SchematicDrawing\SchematicDrawing.csproj", "{0F79CA69-9DBC-41F3-A6FC-5A2937365343}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -303,6 +305,16 @@ Global
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7EBEEA14-91C4-48D7-AF0A-7A4BC3FF9A28}.Release|x86.ActiveCfg = Release|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Debug|x86.ActiveCfg = Debug|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Release|Any CPU.Build.0 = Release|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0F79CA69-9DBC-41F3-A6FC-5A2937365343}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -15,12 +15,13 @@ namespace TBF.BenchControl.Ambient.Comet
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 9600 Bd 8-bits No-parity 2-stop-bits Flow control: none.
/// </summary>
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(Ambient));
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(1)); }
private readonly AmbientCfg ambientCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return ambientCfg as SchematicDrawing.IDrawingItemCfg; } }
/// Private fields
SerialPort serialPort;

View File

@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Ambient.Comet
{
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@ -27,6 +27,22 @@ namespace TBF.BenchControl.Ambient.Comet
public Handshake Handshake;
public bool SetDtrToOne;
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
AmbientCfg()
{
@ -39,6 +55,7 @@ namespace TBF.BenchControl.Ambient.Comet
StopBits = System.IO.Ports.StopBits.Two;
Handshake = System.IO.Ports.Handshake.None;
SetDtrToOne = false;
Shape = SchematicDrawing.Shape.Ambient;
}
public AmbientCfg(IComponentFactory factory)
@ -47,7 +64,9 @@ namespace TBF.BenchControl.Ambient.Comet
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("Name={0}, Com{1}, {2}Bd, {3}-bits, parity={4}, stopBits={5}, {6}",
Name, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.Ambient.Comet
public class Factory : IComponentFactory
{
public string ClassName { get { return "Comet-Ambient"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.Ambient.Greco
public class Factory : IComponentFactory
{
public string ClassName { get { return "Greco Ambient"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Ambient.ResetStaticProperties(); }

View File

@ -9,12 +9,13 @@ using TBF.BenchControl.ControlBoard;
namespace TBF.BenchControl.BuiltIn.Pump
{
public class Pump : ComponentBase, GenericDevices.IPump, GenericDevices.IValve
public class Pump : ComponentBase, GenericDevices.IPump, GenericDevices.IValve, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
public override string ToString() { return string.Format("Pump({0})", Cfg.ToString(1)); }
readonly PumpCfg pumpCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return pumpCfg as SchematicDrawing.IDrawingItemCfg; } }
public int Delay { get { return pumpCfg.Delay; } }

View File

@ -8,7 +8,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BuiltIn.Pump
{
public class PumpCfg : ComponentCfgBase, IChildComponentCfg
public class PumpCfg : ComponentCfgBase, IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@ -21,10 +21,27 @@ namespace TBF.BenchControl.BuiltIn.Pump
public int BitPosition;
public int Delay;
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
PumpCfg()
{
Name = "P";
Shape = SchematicDrawing.Shape.Pump;
ParentName = "CB";
BitPosition = 0;
Delay = 1;
@ -36,6 +53,8 @@ namespace TBF.BenchControl.BuiltIn.Pump
this.Factory = factory;
}
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("Name={0}, Parent={1}, Bit={2}, Delay={3}",

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.BuiltIn.Pump
public class PumpFactory : IComponentFactory
{
public string ClassName { get { return "Pump"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.BuiltIn.PumpTandem
public class PumpFactory : IComponentFactory
{
public string ClassName { get { return "PumpTandem"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }

View File

@ -9,12 +9,13 @@ using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.BuiltIn.Valve
{
public class Valve : ValveBase, IValve
public class Valve : ValveBase, IValve, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(Valve));
public override string ToString() { return string.Format("Valve({0})", Cfg.ToString(1)); }
readonly ValveCfg valveCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return valveCfg as SchematicDrawing.IDrawingItemCfg; } }
readonly TBF.BenchControl.ControlBoard.IControlBoard controlBoard;

View File

@ -8,7 +8,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.BuiltIn.Valve
{
public class ValveCfg : ComponentCfgBase, IChildComponentCfg
public class ValveCfg : ComponentCfgBase, IChildComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ValveCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@ -29,10 +29,27 @@ namespace TBF.BenchControl.BuiltIn.Valve
public int LagClosing; /// Delay (referred to the master valve) when closing this valve in [s]
/// Negative values of delays mean an earlier function of the coupled valve.
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
ValveCfg()
{
Name = "V";
Shape = SchematicDrawing.Shape.Valve;
ParentName = "CB";
BitPosition = 0;
Category = ValveCategory.None;
@ -49,8 +66,10 @@ namespace TBF.BenchControl.BuiltIn.Valve
{
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("Name={0} ({1}), Bit={2}, Cat.={5}, Inv.={3}, Delay={4}s, CoupledTo={6}, Inv.Couple={7}, LagOpen={8}s, LagClose={9}s",
Name,

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.BuiltIn.Valve
public class ValveFactory : IComponentFactory
{
public string ClassName { get { return "Valve"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Valve.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.BuiltIn.ValveEx
public class ValveFactory : IComponentFactory
{
public string ClassName { get { return "ValveEx"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Valve.ResetStaticProperties(); }

View File

@ -28,6 +28,12 @@ namespace TBF.BenchControl
}
Generic.IComponentFactory factory;
[XmlIgnore]
public string ClassName
{
get { return Factory.ToString(); }
}
[XmlIgnore]
public string ParentName
{

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy
public class ControlBoardFactory : IComponentFactory
{
public string ClassName { get { return "ControlBoard"; } }
public override string ToString() { return ClassName; }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.ControlBoard.New
public class CBoardFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
/// <summary>Max. number of components of this class in the system</summary>
public int MaxCount { get { return 1; } }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.ControlBoard.Papouch
public class CBoardFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { CBoard.ResetStaticProperties(); }

View File

@ -67,12 +67,13 @@ namespace TBF.BenchControl.Danfoss.VLT2800
}
public class Pump : ComponentBase, IDevice, IOperation, GenericDevices.IPumpFM, GenericDevices.IValve
public class Pump : ComponentBase, IDevice, IOperation, GenericDevices.IPumpFM, GenericDevices.IValve, SchematicDrawing.IDrawingItemCmpnt
{
private static readonly ILog log = LogManager.GetLogger(typeof(Pump));
public override string ToString() { return string.Format("Pump-Danfoss-VLT2800({0})", Cfg.ToString(1)); }
private readonly PumpCfg pumpCfg;
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return pumpCfg as SchematicDrawing.IDrawingItemCfg; } }
public int Delay { get { return pumpCfg.Delay; } }
public ValveCategory Category { get { return ValveCategory.Feeding; } } /// Pump category is Feeding

View File

@ -9,7 +9,7 @@ using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Danfoss.VLT2800
{
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg, SchematicDrawing.IDrawingItemCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
@ -28,6 +28,22 @@ namespace TBF.BenchControl.Danfoss.VLT2800
public Parity Parity;
public int DataBits;
public StopBits StopBits;
/// Schematic drawing info
public SchematicDrawing.Shape Shape { get; set; }
public int X { get; set; }
public int Y { get; set; }
public SchematicDrawing.Sz Sz { get; set; }
public SchematicDrawing.Orient Orient { get; set; }
public bool Flip { get; set; }
public int LblX { get; set; }
public int LblY { get; set; }
public SchematicDrawing.Orient LblOrient { get; set; }
public int ValX { get; set; }
public int ValY { get; set; }
public double ValFact { get; set; }
public string ValFmt { get; set; }
public SchematicDrawing.Orient ValOrient { get; set; }
/// Private parameterless constructor invoked by all other (public) constructors
PumpCfg()
@ -44,6 +60,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
DataBits = 8;
Parity = System.IO.Ports.Parity.Even; /// 'Parity.None' is the default value for Protocol = PumpProtocol.Modbus
StopBits = System.IO.Ports.StopBits.One;
Shape = SchematicDrawing.Shape.PumpFM;
}
public PumpCfg(IComponentFactory factory)
@ -52,7 +69,9 @@ namespace TBF.BenchControl.Danfoss.VLT2800
this.Factory = factory;
}
public string ToString(int i)
public bool IsHidden() { return (X == 0) && (Y == 0); }
public string ToString(int i)
{
return string.Format("Name={0}, Delay={1}s, Protocol={2}, BusAddress={3}, Com{4}, {5}Bd, {6}-bits, parity={7}, stopBits={8}",
Name, Delay, Protocol, BusAddress, ComPortNr, BaudRate, DataBits, Parity, StopBits);

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
public class PumpFactory : IComponentFactory
{
public string ClassName { get { return "Pump-Danfoss-VLT2800"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Pump.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.Extended
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return "BenchInfoEx"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.BenchInfo.iPerl
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return "BenchInfo.iPerl"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.Buoyancy
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.Density
public class ComponentFactory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { Component.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataContainers.Evaporation
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataEntry.Combined
public class EntryFormFactory : IComponentFactory
{
public string ClassName { get { return "DataEntry-Combined"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { EntryForm.ResetStaticProperties(); }

View File

@ -9,6 +9,7 @@ namespace TBF.BenchControl.DataEntry.Fewa
public class Factory : IComponentFactory
{
public string ClassName { get { return "DataEntry.Fewa"; } }
public override string ToString() { return ClassName; }
public void ResetStaticProperties() { EntryFormNoStartEnd.ResetStaticProperties(); }

Some files were not shown because too many files have changed in this diff Show More