/// /// 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 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 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 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 bool HasClosed; /// true = This shape can be displayed in a 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; public readonly bool HasVacuum; /// true = This shape can display vacuum public readonly Image ImgRightVacuum; /// Optional bitmap in the closed state, size should be the same as the size of Bmp public readonly Image ImgUpVacuum; public readonly Image ImgLeftVacuum; public readonly Image ImgDownVacuum; public readonly Image ImgRightFlippedVacuum; public readonly Image ImgUpFlippedVacuum; public readonly Image ImgLeftFlippedVacuum; public readonly Image ImgDownFlippedVacuum; public readonly bool HasOpenDry; /// true = this shape can be displayed as dry in an open state public readonly Image ImgRightOpenDry; /// Optional bitmap in the closed state, size should be the same as the size of Bmp public readonly Image ImgUpOpenDry; public readonly Image ImgLeftOpenDry; public readonly Image ImgDownOpenDry; public readonly Image ImgRightFlippedOpenDry; public readonly Image ImgUpFlippedOpenDry; public readonly Image ImgLeftFlippedOpenDry; public readonly Image ImgDownFlippedOpenDry; DrawingShape(Shape shape, Sz sz, int szX, int szY, Node[] nodes = null, Edge[] edges = null, int offsX = -10, int offsY = -10, int wid = 20, int hgh = 20, Bitmap bmp = null, Bitmap bmpClosed = null, Bitmap bmpVacuum = null, Bitmap bmpOpenDry = null) { Shape = shape; Sz = sz; SzX = szX; SzY = szY; OffsX = offsX; OffsY = offsY; Wid = wid; Hgh = hgh; Nodes = (nodes != null) ? nodes : new Node[0]; Edges = (edges != null) ? edges : new Edge[0]; 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); } HasClosed = (bmpClosed != null); if (HasClosed) { 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); } HasVacuum = (bmpVacuum != null); if (HasVacuum) { ImgRightVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgDownVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgLeftVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgUpVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); bmpVacuum.RotateFlip(RotateFlipType.RotateNoneFlipY); ImgRightFlippedVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgDownFlippedVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgLeftFlippedVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgUpFlippedVacuum = bmpVacuum.Clone() as Image; bmpVacuum.RotateFlip(RotateFlipType.Rotate90FlipNone); bmpVacuum.RotateFlip(RotateFlipType.RotateNoneFlipY); } HasOpenDry = (bmpOpenDry != null); if (HasOpenDry) { ImgRightOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgDownOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgLeftOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgUpOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); bmpOpenDry.RotateFlip(RotateFlipType.RotateNoneFlipY); ImgRightFlippedOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgDownFlippedOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgLeftFlippedOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); ImgUpFlippedOpenDry = bmpOpenDry.Clone() as Image; bmpOpenDry.RotateFlip(RotateFlipType.Rotate90FlipNone); bmpOpenDry.RotateFlip(RotateFlipType.RotateNoneFlipY); } } public Rectangle GetRotatedFlippedImageRectangle(IDrawingItem item) { const int G = SchematicDrawing.Const.GridSize; if (item.Flip) { /// Flipped (mirror) image switch (item.Orient) { default: case Orient.R: return new Rectangle(item.X + OffsX, item.Y + G * SzY - Hgh - OffsY, Wid, Hgh); case Orient.Up: return new Rectangle(item.X + OffsY, item.Y + OffsX, Hgh, Wid); case Orient.L: return new Rectangle(item.X + G * SzX - Wid - OffsX, item.Y + OffsY, Wid, Hgh); case Orient.Dn: return new Rectangle(item.X + G * SzY - Hgh - OffsY, item.Y + G * SzX - Wid - OffsX, Hgh, Wid); } } else { /// Normal image switch (item.Orient) { default: case Orient.R: return new Rectangle(item.X + OffsX, item.Y + OffsY, Wid, Hgh); case Orient.Up: return new Rectangle(item.X + OffsY, item.Y + G * SzX - Wid - OffsX, Hgh, Wid); case Orient.L: return new Rectangle(item.X + G * SzX - Wid - OffsX, item.Y + G * SzY - Hgh - OffsY, Wid, Hgh); case Orient.Dn: return new Rectangle(item.X + G * SzY - Hgh - OffsY, item.Y + OffsX, Hgh, Wid); } } } /// /// Get coordinates and orientation of the rotated/flipped node /// /// Item /// Node id /// Rotated/flipped node public Node GetRotatedFlippedNode(IDrawingItem item, int nodeId) { if (Nodes == null || nodeId < 0 || nodeId >= Nodes.Length) return new Node(0, 0, Orient.R); Node node = Nodes[nodeId]; if (item.Flip) { /// Flipped int ori = (int)node.Orient; if (ori % 2 == 1) ori += 2; ori += (int)item.Orient; switch (item.Orient) { default: case Orient.R: return new Node(node.X, SzY - node.Y, (Orient)(ori % 4)); case Orient.Up: return new Node(SzY - node.Y, SzX - 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(node.Y, node.X, (Orient)(ori % 4)); } } else { /// Normal int ori = (int)item.Orient + (int)node.Orient; switch (item.Orient) { 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(IDrawingItem item) { return (item != null) ? Shapes[DrShIx(item.Shape, item.Sz)] : null; } /// /// Static constructor that initializes Shapes[] array /// static DrawingShape() { Shapes = new DrawingShape[(int)Shape.Count * (int)Sz.Count]; /// Ambient Shapes[DrShIx(Shape.Ambient, Sz.S)] = new DrawingShape(Shape.Ambient, Sz.S, 0, 0); Shapes[DrShIx(Shape.Ambient, Sz.M)] = new DrawingShape(Shape.Ambient, Sz.M, 0, 0); Shapes[DrShIx(Shape.Ambient, Sz.L)] = new DrawingShape(Shape.Ambient, Sz.L, 0, 0); Shapes[DrShIx(Shape.Ambient, Sz.XL)] = new DrawingShape(Shape.Ambient, Sz.XL, 0, 0); /// Temperature meter Shapes[DrShIx(Shape.TempM, Sz.S)] = new DrawingShape(Shape.TempM, Sz.S, 0, 0); Shapes[DrShIx(Shape.TempM, Sz.M)] = new DrawingShape(Shape.TempM, Sz.M, 0, 0); Shapes[DrShIx(Shape.TempM, Sz.L)] = new DrawingShape(Shape.TempM, Sz.L, 0, 0); Shapes[DrShIx(Shape.TempM, Sz.XL)] = new DrawingShape(Shape.TempM, Sz.XL, 0, 0); /// Pressure meter Shapes[DrShIx(Shape.PressM, Sz.S)] = new DrawingShape(Shape.PressM, Sz.S, 0, 0); Shapes[DrShIx(Shape.PressM, Sz.M)] = new DrawingShape(Shape.PressM, Sz.M, 0, 0); Shapes[DrShIx(Shape.PressM, Sz.L)] = new DrawingShape(Shape.PressM, Sz.L, 0, 0); Shapes[DrShIx(Shape.PressM, Sz.XL)] = new DrawingShape(Shape.PressM, Sz.XL, 0, 0); /// Valve Shapes[DrShIx(Shape.Valve, Sz.S)] = new DrawingShape(Shape.Valve, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1), new Edge(1, 0, 20, RouteCouple.OpenWhen1) }, 0, 0, 20, 20, Properties.Resources.Valve_S_open, Properties.Resources.Valve_S_closed, Properties.Resources.Valve_S_vacuum, Properties.Resources.Valve_S_open_dry); Shapes[DrShIx(Shape.Valve, Sz.M)] = new DrawingShape(Shape.Valve, Sz.M, 3, 4, new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1), new Edge(1, 0, 30, RouteCouple.OpenWhen1) }, 0, 5, 30, 30, Properties.Resources.Valve_M_open, Properties.Resources.Valve_M_closed, Properties.Resources.Valve_M_vacuum, Properties.Resources.Valve_M_open_dry); Shapes[DrShIx(Shape.Valve, Sz.L)] = new DrawingShape(Shape.Valve, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1), new Edge(1, 0, 40, RouteCouple.OpenWhen1) }, 0, 0, 40, 40, Properties.Resources.Valve_L_open, Properties.Resources.Valve_L_closed, Properties.Resources.Valve_L_vacuum, Properties.Resources.Valve_L_open_dry); Shapes[DrShIx(Shape.Valve, Sz.XL)] = new DrawingShape(Shape.Valve, Sz.XL, 5, 6, new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1), new Edge(1, 0, 50, RouteCouple.OpenWhen1) }, 0, 5, 50, 50, Properties.Resources.Valve_XL_open, Properties.Resources.Valve_XL_closed, Properties.Resources.Valve_XL_vacuum, Properties.Resources.Valve_XL_open_dry); /// Regulation valve Shapes[DrShIx(Shape.RegV, Sz.S)] = new DrawingShape(Shape.RegV, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1, 20), new Edge(1, 0, 20) }, 0, 0, 20, 20, Properties.Resources.RegV_S); Shapes[DrShIx(Shape.RegV, Sz.M)] = new DrawingShape(Shape.RegV, Sz.M, 3, 4, new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 30), new Edge(1, 0, 30) }, 0, 5, 30, 30, Properties.Resources.RegV_M); Shapes[DrShIx(Shape.RegV, Sz.L)] = new DrawingShape(Shape.RegV, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40), new Edge(1, 0, 40) }, 0, 0, 40, 40, Properties.Resources.RegV_L); Shapes[DrShIx(Shape.RegV, Sz.XL)] = new DrawingShape(Shape.RegV, Sz.XL, 5, 6, new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1, 50), new Edge(1, 0, 50) }, 0, 5, 50, 50, Properties.Resources.RegV_XL); /// Pump Shapes[DrShIx(Shape.Pump, Sz.S)] = new DrawingShape(Shape.Pump, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1) }, 0, 0, 20, 20, Properties.Resources.Pump_S_open, Properties.Resources.Pump_S_closed); Shapes[DrShIx(Shape.Pump, Sz.M)] = new DrawingShape(Shape.Pump, Sz.M, 3, 4, new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1) }, 0, 5, 30, 30, Properties.Resources.Pump_M_open, Properties.Resources.Pump_M_closed); Shapes[DrShIx(Shape.Pump, Sz.L)] = new DrawingShape(Shape.Pump, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1) }, 0, 0, 40, 40, Properties.Resources.Pump_L_open, Properties.Resources.Pump_L_closed); Shapes[DrShIx(Shape.Pump, Sz.XL)] = new DrawingShape(Shape.Pump, Sz.XL, 5, 6, new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1) }, 0, 5, 50, 50, Properties.Resources.Pump_XL_open, Properties.Resources.Pump_XL_closed); /// Pump with frequency inverter Shapes[DrShIx(Shape.PumpFM, Sz.S)] = new DrawingShape(Shape.PumpFM, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1, 20, RouteCouple.OpenWhen1) }, 0, 0, 20, 20, Properties.Resources.Pump_S_open, Properties.Resources.Pump_S_closed); Shapes[DrShIx(Shape.PumpFM, Sz.M)] = new DrawingShape(Shape.PumpFM, Sz.M, 3, 4, new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 30, RouteCouple.OpenWhen1) }, 0, 5, 30, 30, Properties.Resources.Pump_M_open, Properties.Resources.Pump_M_closed); Shapes[DrShIx(Shape.PumpFM, Sz.L)] = new DrawingShape(Shape.PumpFM, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40, RouteCouple.OpenWhen1) }, 0, 0, 40, 40, Properties.Resources.Pump_L_open, Properties.Resources.Pump_L_closed); Shapes[DrShIx(Shape.PumpFM, Sz.XL)] = new DrawingShape(Shape.PumpFM, Sz.XL, 5, 6, new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1, 50, RouteCouple.OpenWhen1) }, 0, 5, 50, 50, Properties.Resources.Pump_XL_open, Properties.Resources.Pump_XL_closed); /// Flow meter Shapes[DrShIx(Shape.FlowM, Sz.S)] = new DrawingShape(Shape.FlowM, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(2, 1, Orient.R) }, new Edge[] { new Edge(0, 1, 20) }, 0, 0, 20, 20, Properties.Resources.FlowM_S); Shapes[DrShIx(Shape.FlowM, Sz.M)] = new DrawingShape(Shape.FlowM, Sz.M, 3, 4, new Node[] { new Node(0, 2, Orient.L), new Node(3, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 30) }, 0, 5, 30, 30, Properties.Resources.FlowM_M); Shapes[DrShIx(Shape.FlowM, Sz.L)] = new DrawingShape(Shape.FlowM, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40) }, 0, 0, 40, 40, Properties.Resources.FlowM_L); Shapes[DrShIx(Shape.FlowM, Sz.XL)] = new DrawingShape(Shape.FlowM, Sz.XL, 5, 6, new Node[] { new Node(0, 3, Orient.L), new Node(5, 3, Orient.R) }, new Edge[] { new Edge(0, 1, 50) }, 0, 5, 50, 50, Properties.Resources.FlowM_XL); /// Water meter Shapes[DrShIx(Shape.WaterM, Sz.L)] = new DrawingShape(Shape.WaterM, Sz.L, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(4, 2, Orient.R) }, new Edge[] { new Edge(0, 1, 40), new Edge(1, 0, 40) }, 0, 0, 40, 40, Properties.Resources.WaterM_L); 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)]; /// Scale Shapes[DrShIx(Shape.Scale, Sz.S)] = new DrawingShape(Shape.Scale, Sz.S, 6, 8, new Node[] { new Node(3, 8, Orient.Dn) }, null, 0, 0, 60, 80, Properties.Resources.Scale_S); Shapes[DrShIx(Shape.Scale, Sz.M)] = new DrawingShape(Shape.Scale, Sz.M, 8, 9, new Node[] { new Node(4, 9, Orient.Dn) }, null, 0, 0, 80, 90, Properties.Resources.Scale_M); Shapes[DrShIx(Shape.Scale, Sz.L)] = new DrawingShape(Shape.Scale, Sz.L, 12, 11, new Node[] { new Node(6, 11, Orient.Dn) }, null, 0, 0, 120, 110, Properties.Resources.Scale_L); Shapes[DrShIx(Shape.Scale, Sz.XL)] = new DrawingShape(Shape.Scale, Sz.XL, 16, 13, new Node[] { new Node(8, 13, Orient.Dn) }, null, 0, 0, 160, 130, Properties.Resources.Scale_XL); /// Tank Shapes[DrShIx(Shape.Tank, Sz.S)] = new DrawingShape(Shape.Tank, Sz.S, 10, 8, new Node[] { new Node(0, 6, Orient.L) }, null, 0, 0, 100, 80, Properties.Resources.Tank_S); Shapes[DrShIx(Shape.Tank, Sz.M)] = new DrawingShape(Shape.Tank, Sz.M, 12, 9, new Node[] { new Node(0, 7, Orient.L) }, null, 0, 0, 120, 90, Properties.Resources.Tank_M); Shapes[DrShIx(Shape.Tank, Sz.L)] = new DrawingShape(Shape.Tank, Sz.L, 15, 11, new Node[] { new Node(0, 9, Orient.L) }, null, 0, 0, 150, 110, Properties.Resources.Tank_L); Shapes[DrShIx(Shape.Tank, Sz.XL)] = new DrawingShape(Shape.Tank, Sz.XL, 20, 13, new Node[] { new Node(0, 11, Orient.L) }, null, 0, 0, 200, 130, Properties.Resources.Tank_XL); /// Junction Shapes[DrShIx(Shape.Junction, Sz.None)] = new DrawingShape(Shape.Junction, Sz.None, 0, 0, new Node[] { new Node(0, 0, Orient.R) }); Shapes[DrShIx(Shape.Junction, Sz.S)] = new DrawingShape(Shape.Junction, Sz.S, 2, 2, new Node[] { new Node(1, 1, Orient.R) }, null, 0, 0, 20, 20, Properties.Resources.Junction_S, null, Properties.Resources.Junction_S_vacuum, Properties.Resources.Junction_S_closed); Shapes[DrShIx(Shape.Junction, Sz.M)] = new DrawingShape(Shape.Junction, Sz.M, 2, 2, new Node[] { new Node(1, 1, Orient.R) }, null, 0, 0, 20, 20, Properties.Resources.Junction_M, null, Properties.Resources.Junction_M_vacuum, Properties.Resources.Junction_M_closed); Shapes[DrShIx(Shape.Junction, Sz.L)] = new DrawingShape(Shape.Junction, Sz.L, 2, 2, new Node[] { new Node(1, 1, Orient.R) }, null, 0, 0, 20, 20, Properties.Resources.Junction_L, null, Properties.Resources.Junction_L_vacuum, Properties.Resources.Junction_L_closed); Shapes[DrShIx(Shape.Junction, Sz.XL)] = new DrawingShape(Shape.Junction, Sz.XL, 2, 2, new Node[] { new Node(1, 1, Orient.R) }, null, 0, 0, 20, 20, Properties.Resources.Junction_XL, null, Properties.Resources.Junction_XL_vacuum, Properties.Resources.Junction_XL_closed); /// Knee Shapes[DrShIx(Shape.Knee, Sz.S)] = new DrawingShape(Shape.Knee, Sz.S, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1, 18), new Edge(1, 0, 18) }, 0, 0, 20, 20, Properties.Resources.Knee_S_open, null, Properties.Resources.Knee_S_vacuum, Properties.Resources.Knee_S_closed); Shapes[DrShIx(Shape.Knee, Sz.M)] = new DrawingShape(Shape.Knee, Sz.M, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1, 18), new Edge(1, 0, 18) }, 0, 0, 20, 20, Properties.Resources.Knee_M_open, null, Properties.Resources.Knee_M_vacuum, Properties.Resources.Knee_M_closed); Shapes[DrShIx(Shape.Knee, Sz.L)] = new DrawingShape(Shape.Knee, Sz.L, 2, 2, new Node[] { new Node(0, 1, Orient.L), new Node(1, 0, Orient.Up) }, new Edge[] { new Edge(0, 1, 17), new Edge(1, 0, 17) }, 0, 0, 20, 20, Properties.Resources.Knee_L_open, null, Properties.Resources.Knee_L_vacuum, Properties.Resources.Knee_L_closed); Shapes[DrShIx(Shape.Knee, Sz.XL)] = new DrawingShape(Shape.Knee, Sz.XL, 4, 4, new Node[] { new Node(0, 2, Orient.L), new Node(2, 0, Orient.Up) }, new Edge[] { new Edge(0, 1, 36), new Edge(1, 0, 36) }, 0, 0, 40, 40, Properties.Resources.Knee_XL_open, null, Properties.Resources.Knee_XL_vacuum, Properties.Resources.Knee_XL_closed); /// Vacuum Shapes[DrShIx(Shape.Vacuum, Sz.L)] = new DrawingShape(Shape.Vacuum, Sz.L, 6, 2, new Node[] { new Node(0, 1, Orient.L), new Node(6, 1, Orient.R), new Node(4, 0, Orient.Up) }, new Edge[] { new Edge(0, 1, 60), new Edge(1, 0, 60), new Edge(0, 2, Const.Vacuum) }, 0, 0, 60, 20, Properties.Resources.Vacuum_L_wet, null, null, Properties.Resources.Vacuum_L_dry); Shapes[DrShIx(Shape.Vacuum, Sz.S)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)]; Shapes[DrShIx(Shape.Vacuum, Sz.M)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)]; Shapes[DrShIx(Shape.Vacuum, Sz.XL)] = Shapes[DrShIx(Shape.Vacuum, Sz.L)]; /// Control board UNI Shapes[DrShIx(Shape.UniCB, Sz.L)] = new DrawingShape(Shape.UniCB, Sz.L, 2, 2, new Node[] { }, null, 0, 0, 20, 20, Properties.Resources.UniCB_M_on, Properties.Resources.UniCB_M_off, Properties.Resources.UniCB_M_error, Properties.Resources.UniCB_M_error); Shapes[DrShIx(Shape.UniCB, Sz.S)] = Shapes[DrShIx(Shape.UniCB, Sz.L)]; Shapes[DrShIx(Shape.UniCB, Sz.M)] = Shapes[DrShIx(Shape.UniCB, Sz.L)]; Shapes[DrShIx(Shape.UniCB, Sz.XL)] = Shapes[DrShIx(Shape.UniCB, Sz.L)]; } } }