-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more to SimaticML API. Implemented Custom Variable to alarm gen…
…eration. SImaticML implemented branches to SimaticPart to allow to add branch (Before there was only OR). Also added the MovePart, to allow to use the block MOVE. TiaUtilities added a new custom variables to alarm generation to have a costant that is moved inside a defined variable for various uses. (Implemented all the fields, configuration and columns).
- Loading branch information
Showing
20 changed files
with
696 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
using Svg; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Drawing.Drawing2D; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace TiaUtilities | ||
{ | ||
[System.Runtime.Versioning.SupportedOSPlatform("windows")] | ||
class DebugRenderer : ISvgRenderer | ||
{ | ||
private readonly Stack<ISvgBoundable> _boundables = new Stack<ISvgBoundable>(); | ||
|
||
private Region _clip = new Region(); | ||
private Matrix _transform = new Matrix(); | ||
|
||
public void SetBoundable(ISvgBoundable boundable) | ||
{ | ||
_boundables.Push(boundable); | ||
} | ||
public ISvgBoundable GetBoundable() | ||
{ | ||
return _boundables.Peek(); | ||
} | ||
public ISvgBoundable PopBoundable() | ||
{ | ||
return _boundables.Pop(); | ||
} | ||
|
||
public float DpiY | ||
{ | ||
get { return 96; } | ||
} | ||
|
||
public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit graphicsUnit) | ||
{ | ||
} | ||
|
||
public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit graphicsUnit, float opacity) | ||
{ | ||
} | ||
|
||
public void DrawImageUnscaled(Image image, Point location) | ||
{ | ||
} | ||
|
||
public void DrawPath(Pen pen, GraphicsPath path) | ||
{ | ||
var newPath = (GraphicsPath)path.Clone(); | ||
newPath.Transform(_transform); | ||
} | ||
|
||
public void FillPath(Brush brush, GraphicsPath path) | ||
{ | ||
var newPath = (GraphicsPath)path.Clone(); | ||
newPath.Transform(_transform); | ||
} | ||
|
||
public Region GetClip() | ||
{ | ||
return _clip; | ||
} | ||
|
||
public void RotateTransform(float fAngle, MatrixOrder order = MatrixOrder.Append) | ||
{ | ||
_transform.Rotate(fAngle, order); | ||
} | ||
|
||
public void ScaleTransform(float sx, float sy, MatrixOrder order = MatrixOrder.Append) | ||
{ | ||
_transform.Scale(sx, sy, order); | ||
} | ||
|
||
public void SetClip(Region region, CombineMode combineMode = CombineMode.Replace) | ||
{ | ||
switch (combineMode) | ||
{ | ||
case CombineMode.Intersect: | ||
_clip.Intersect(region); | ||
break; | ||
case CombineMode.Complement: | ||
_clip.Complement(region); | ||
break; | ||
case CombineMode.Exclude: | ||
_clip.Exclude(region); | ||
break; | ||
case CombineMode.Union: | ||
_clip.Union(region); | ||
break; | ||
case CombineMode.Xor: | ||
_clip.Xor(region); | ||
break; | ||
default: | ||
if (_clip != null) | ||
_clip.Dispose(); | ||
_clip = region; | ||
break; | ||
} | ||
} | ||
public void TranslateTransform(float dx, float dy, MatrixOrder order = MatrixOrder.Append) | ||
{ | ||
_transform.Translate(dx, dy, order); | ||
} | ||
|
||
public SmoothingMode SmoothingMode | ||
{ | ||
get { return SmoothingMode.Default; } | ||
set { /* Do Nothing */ } | ||
} | ||
|
||
public Matrix Transform | ||
{ | ||
get { return _transform?.Clone(); } | ||
set | ||
{ | ||
if (_transform != null) | ||
_transform.Dispose(); | ||
_transform = value?.Clone(); | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
if (_clip != null) | ||
_clip.Dispose(); | ||
if (_transform != null) | ||
_transform.Dispose(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.