Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #54

Merged
merged 20 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
29cca46
Refactor shape component rendering and conditions handling
moukmessie Apr 2, 2024
ce5d6d5
Update ScadaWeb/OpenPlugins/PlgSchShapeComp/wwwroot/SchShapeComp/js/s…
moukmessie Apr 2, 2024
cc3379e
Merge pull request #50 from ApitechFR/fix/sr7-cond-conflit
LouisCorbet Apr 3, 2024
8a9eabe
feat: ignore lines not starting with %M
LouisCorbet Apr 3, 2024
ca06928
feat: consider :X separator for automate lines
LouisCorbet Apr 3, 2024
be042e6
refact: Refactor BasicShape class and shapecomp.css***
moukmessie Apr 4, 2024
835a328
Merge pull request #51 from ApitechFR/fix/shapecomp-line
moukmessie Apr 4, 2024
5c87670
Update properties in BarGraphConditions, PictureConditions, DynamicTe…
moukmessie Apr 4, 2024
73fc2a5
Refactor shape component rendering and condition merging
moukmessie Apr 4, 2024
571bf81
Refactor shape component rendering and condition merging
moukmessie Apr 7, 2024
c62773a
feat: datablock unicity in import
LouisCorbet Apr 8, 2024
038b420
feat: datablock unicity in import
LouisCorbet Apr 8, 2024
ac72c56
Merge pull request #52 from ApitechFR/fix/sr7-cond-conflit
LouisCorbet Apr 8, 2024
7467fa0
feat: consider differet types of separators
LouisCorbet Apr 9, 2024
556fe46
feat: datablock unicity
LouisCorbet Apr 10, 2024
e601c84
feat: datablock unicity
LouisCorbet Apr 11, 2024
f0834a5
refactor: remove comments
LouisCorbet Apr 11, 2024
a077259
Update ScadaAdmin/OpenExtensions/ExtImport/Forms/FrmImportFile.cs
LouisCorbet Apr 11, 2024
fb2cdff
Update ScadaAdmin/OpenExtensions/ExtImport/Forms/FrmImportFile.cs
LouisCorbet Apr 11, 2024
22672d5
Merge pull request #53 from ApitechFR/sr3-pl7
LouisCorbet Apr 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 143 additions & 49 deletions ScadaAdmin/OpenExtensions/ExtImport/Forms/FrmImportFile.cs

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions ScadaWeb/OpenPlugins/PlgSchShapeComp/Code/BasicShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public BasicShape()
CtrlCnlNum = 0;
InCnlNumCustom = "NA (0)";
CtrlCnlNumCustom = "NA (0)";
Width = 100;
Height = 130;
}

[DisplayName("Conditions"), Category(Categories.Behavior)]
Expand All @@ -34,20 +32,11 @@ public BasicShape()
[Description("The type of SVG shape.")]
public string ShapeType { get; set; }

[DisplayName("Width"), Category(Categories.Appearance)]
[Description("The Width of SVG shape.")]
public int Width { get; set; }

[DisplayName("Rotation"), Category(Categories.Appearance)]
[Description("The rotation angle of the SVG shape in degrees.")]
[DefaultValue(0)]
public int Rotation { get; set; }

[DisplayName("Height"), Category(Categories.Appearance)]
[Description("The Height of SVG shape.")]
[DefaultValue(130)]
public int Height { get; set; }

/// <summary>
/// Get or set the input channel number
/// </summary>
Expand All @@ -73,16 +62,13 @@ public BasicShape()
[DefaultValue(0)]
public int CtrlCnlNum { get; set; }



/// <summary>
/// Get or set the control channel number custom
/// </summary>
[DisplayName("Output channel"), Category(Categories.Data)]
[Description("The output channel number associated with the component.")]
public string CtrlCnlNumCustom { get; set; }


/// <summary>
/// Get or set the action
/// </summary>
Expand All @@ -98,8 +84,6 @@ public override void LoadFromXml(XmlNode xmlNode)
Rotation = xmlNode.GetChildAsInt("Rotation");
InCnlNum = xmlNode.GetChildAsInt("InCnlNum");
CtrlCnlNum = xmlNode.GetChildAsInt("CtrlCnlNum");
Width = xmlNode.GetChildAsInt("Width");
Height = xmlNode.GetChildAsInt("Height");
InCnlNumCustom = xmlNode.GetChildAsString("InCnlNumCustom");
CtrlCnlNumCustom = xmlNode.GetChildAsString("CtrlCnlNumCustom");
XmlNode conditionsNode = xmlNode.SelectSingleNode("Conditions");
Expand Down Expand Up @@ -131,14 +115,11 @@ public override void SaveToXml(XmlElement xmlElem)
xmlElem.AppendElem("ShapeType", ShapeType);
xmlElem.AppendElem("InCnlNum", InCnlNum);
xmlElem.AppendElem("CtrlCnlNum", CtrlCnlNum);
xmlElem.AppendElem("Width", Width);
xmlElem.AppendElem("Height", Height);
xmlElem.AppendElem("InCnlNumCustom", InCnlNumCustom);
xmlElem.AppendElem("CtrlCnlNumCustom", CtrlCnlNumCustom);
xmlElem.AppendElem("Action", Action.ToString());
}


public override ComponentBase Clone()
{
BasicShape clonedComponent = (BasicShape)base.Clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ public enum BlinkingSpeed
public AdvancedConditions()
: base()
{
BackgroundColor = "";
BackgroundColor = "None";
IsVisible = true;
Blinking = BlinkingSpeed.None;
Rotation = null;
}

[DisplayName("Background Color"), Category(Categories.Appearance)]
Expand All @@ -41,17 +42,24 @@ public override void LoadFromXml(XmlNode xmlNode)
base.LoadFromXml(xmlNode);
BackgroundColor = xmlNode.GetChildAsString("BackgroundColor");
IsVisible = xmlNode.GetChildAsBool("IsVisible");
Rotation = xmlNode.GetChildAsInt("Rotation");
Blinking = xmlNode.GetChildAsEnum<BlinkingSpeed>("Blinking");

// If the rotation node is not null, parse the value and assign it to the Rotation property
XmlNode rotationNode = xmlNode.SelectSingleNode("Rotation");
Rotation = rotationNode != null ? (int?)int.Parse(rotationNode.InnerText) : null;
}

public override void SaveToXml(XmlElement xmlElem)
{
base.SaveToXml(xmlElem);
xmlElem.AppendElem("BackgroundColor", BackgroundColor);
xmlElem.AppendElem("Rotation", Rotation);
xmlElem.AppendElem("BackgroundColor", string.IsNullOrEmpty(BackgroundColor) ? "None" : BackgroundColor);
xmlElem.AppendElem("IsVisible", IsVisible);
xmlElem.AppendElem("Blinking", Blinking);

if (Rotation.HasValue)
{
xmlElem.AppendElem("Rotation", Rotation.Value);
}
}

public override object Clone()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BarGraphConditions : AdvancedConditions

public BarGraphConditions() : base()
{
FillColor = "";
FillColor = "None";
}

[DisplayName("Fill Color"), Category(Categories.Appearance)]
Expand All @@ -26,7 +26,7 @@ public override void LoadFromXml(XmlNode xmlNode)
public override void SaveToXml(XmlElement xmlElem)
{
base.SaveToXml(xmlElem);
xmlElem.AppendElem("FillColor", FillColor);
xmlElem.AppendElem("FillColor", string.IsNullOrEmpty(FillColor) ? "None" : FillColor);
}

public override object Clone()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,40 @@ public class BasicShapeConditions : AdvancedConditions
public BasicShapeConditions()
: base()
{
IsVisible = true;
Blinking = BlinkingSpeed.None;
BackgroundColor = "";
Height = "";
Width = "";

Height = null;
Width = null;
}

[DisplayName("Height"), Category(Categories.Appearance)]
public string Height { get; set; }
public int? Height { get; set; }

[DisplayName("Width"), Category(Categories.Appearance)]
public string Width { get; set; }
public int? Width { get; set; }



public override void LoadFromXml(XmlNode xmlNode)
{
base.LoadFromXml(xmlNode);
Height = xmlNode.GetChildAsString("Height");
Width = xmlNode.GetChildAsString("Width");
XmlNode heightNode = xmlNode.SelectSingleNode("Height");
Height = heightNode != null ? (int?)int.Parse(heightNode.InnerText) : null;

XmlNode widthNode = xmlNode.SelectSingleNode("Width");
Width = widthNode != null ? (int?)int.Parse(widthNode.InnerText) : null;
}

public override void SaveToXml(XmlElement xmlElem)
{
base.SaveToXml(xmlElem);
xmlElem.AppendElem("Height", Height);
xmlElem.AppendElem("Width", Width);
if (Width.HasValue)
{
xmlElem.AppendElem("Width", Width.Value);
}
if (Height.HasValue)
{
xmlElem.AppendElem("Height", Height.Value);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ public class DynamicTextConditions : AdvancedConditions
public DynamicTextConditions()
: base()
{
IsVisible = true;
Blinking = BlinkingSpeed.None;
TextContent = "";
FontSize = "";

TextContent = "None";
FontSize = null;
}

[DisplayName("FontSize"), Category(Categories.Appearance)]
public string FontSize { get; set; }
public int? FontSize { get; set; }

[DisplayName("Text Content"), Category(Categories.Appearance)]
public string TextContent { get; set; }
Expand All @@ -26,14 +25,19 @@ public override void LoadFromXml(XmlNode xmlNode)
{
base.LoadFromXml(xmlNode);
TextContent = xmlNode.GetChildAsString("TextContent");
FontSize = xmlNode.GetChildAsString("FontSize");

XmlNode fontSizeNode = xmlNode.SelectSingleNode("FontSize");
FontSize = fontSizeNode != null ? (int?)int.Parse(fontSizeNode.InnerText) : null;
}

public override void SaveToXml(XmlElement xmlElem)
{
base.SaveToXml(xmlElem);
xmlElem.AppendElem("TextContent", TextContent);
xmlElem.AppendElem("FontSize", FontSize);
xmlElem.AppendElem("TextContent", string.IsNullOrEmpty(TextContent) ? "None" : TextContent);
if (FontSize.HasValue)
{
xmlElem.AppendElem("FontSize", FontSize.Value);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ public PictureConditions()
{
IsVisible = true;
Blinking = BlinkingSpeed.None;
Rotation = null;
}

[DisplayName("Rotation"), Category(Categories.Appearance)]
[Description("The rotation angle of the shape in degrees.")]
public string Rotation { get; set; }
public int? Rotation { get; set; }



Expand All @@ -33,14 +34,19 @@ public override void LoadFromXml(XmlNode xmlNode)
{
base.LoadFromXml(xmlNode);
IsVisible = xmlNode.GetChildAsBool("IsVisible");
Rotation = xmlNode.GetChildAsString("Rotation");
Blinking = xmlNode.GetChildAsEnum<BlinkingSpeed>("Blinking");

XmlNode rotationNode = xmlNode.SelectSingleNode("Rotation");
Rotation = rotationNode != null ? (int?)int.Parse(rotationNode.InnerText) : null;
}

public override void SaveToXml(XmlElement xmlElem)
{
base.SaveToXml(xmlElem);
xmlElem.AppendElem("Rotation", Rotation);
if (Rotation.HasValue)
{
xmlElem.AppendElem("Rotation", Rotation.Value);
}
xmlElem.AppendElem("IsVisible", IsVisible);
xmlElem.AppendElem("Blinking", Blinking);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.line {
width: 100%;
height: 1%;
height: 100%;
border-top: 2px solid red;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.line {
width: 100%;
height: 1%;
height: 100%;
border-top: 2px solid red;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.line {
width: 100%;
height: 1%;
height: 100%;
border-top: 2px solid red;
}

Expand Down
Loading
Loading