Skip to content

Commit

Permalink
Merge pull request #90 from RapidScada/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master
  • Loading branch information
2mik authored Aug 13, 2024
2 parents c75b1d7 + 1051f2f commit e827db4
Show file tree
Hide file tree
Showing 844 changed files with 23,643 additions and 3,662 deletions.
21 changes: 21 additions & 0 deletions Projects/HelloWorld/BaseXML/Format.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,27 @@
<IsString>false</IsString>
<Frmt>X8</Frmt>
</Format>
<Format>
<FormatID>13</FormatID>
<Name>Binary</Name>
<Code>B</Code>
<IsNumber>true</IsNumber>
<IsEnum>false</IsEnum>
<IsDate>false</IsDate>
<IsString>false</IsString>
<Frmt>B</Frmt>
<Descr>Binary representation of a number</Descr>
</Format>
<Format>
<FormatID>14</FormatID>
<Name>Binary 8 digits</Name>
<Code>B8</Code>
<IsNumber>true</IsNumber>
<IsEnum>false</IsEnum>
<IsDate>false</IsDate>
<IsString>false</IsString>
<Frmt>B8</Frmt>
</Format>
<Format>
<FormatID>21</FormatID>
<Name>Off-On</Name>
Expand Down
21 changes: 21 additions & 0 deletions Projects/WirenBoardDemo/BaseXML/Format.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,27 @@
<IsString>false</IsString>
<Frmt>X8</Frmt>
</Format>
<Format>
<FormatID>13</FormatID>
<Name>Binary</Name>
<Code>B</Code>
<IsNumber>true</IsNumber>
<IsEnum>false</IsEnum>
<IsDate>false</IsDate>
<IsString>false</IsString>
<Frmt>B</Frmt>
<Descr>Binary representation of a number</Descr>
</Format>
<Format>
<FormatID>14</FormatID>
<Name>Binary 8 digits</Name>
<Code>B8</Code>
<IsNumber>true</IsNumber>
<IsEnum>false</IsEnum>
<IsDate>false</IsDate>
<IsString>false</IsString>
<Frmt>B8</Frmt>
</Format>
<Format>
<FormatID>21</FormatID>
<Name>Off-On</Name>
Expand Down
3 changes: 3 additions & 0 deletions ScadaAdmin/OpenExtensions/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

# IDE1006: Naming Styles
dotnet_diagnostic.IDE1006.severity = silent

# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = silent
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Scada.Lang;
using System;
using System.Windows.Forms;
using WinControl;
using WinControls;

namespace Scada.Admin.Extensions.ExtCommConfig.Code
{
Expand Down Expand Up @@ -94,7 +94,7 @@ public static bool GetDeviceView(IAdminContext adminContext, CommApp commApp, De
errMsg = ExtensionPhrases.DriverNotSpecified;
return false;
}
else if (!GetDriverView(adminContext, commApp, deviceConfig.Driver,
else if (!GetDriverView(adminContext, commApp, deviceConfig.Driver,
out DriverView driverView, out errMsg))
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public TreeNode CreateLineNode(CommApp commApp, LineConfig lineConfig)

return lineNode;
}

/// <summary>
/// Updates the tree node that represents a communication line and its child nodes.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void Init(IAdminContext adminContext, ScadaProject project, RecentSelecti
ScanCommSettings();
FillCommLineList();
}

/// <summary>
/// Sets the input focus.
/// </summary>
Expand All @@ -152,7 +152,7 @@ private void cbCommLine_SelectedIndexChanged(object sender, EventArgs e)
{
// filter devices by selected communication line
int commLineNum = (int)cbCommLine.SelectedValue;
IEnumerable<Device> devices = commLineNum > 0
IEnumerable<Device> devices = commLineNum > 0
? project.ConfigDatabase.DeviceTable.Select(new TableFilter("CommLineNum", commLineNum), true)
: project.ConfigDatabase.DeviceTable.Enumerate();
cbDevice.DataSource = devices.OrderBy(device => device.Name).ToList();
Expand All @@ -168,14 +168,14 @@ private void cbDevice_SelectedIndexChanged(object sender, EventArgs e)

if (cbDevice.SelectedItem is Device device)
{
if (deviceItems.TryGetValue(device.DeviceNum, out DeviceItem deviceItem) &&
if (deviceItems.TryGetValue(device.DeviceNum, out DeviceItem deviceItem) &&
deviceItem.Instance != null)
{
try
{
if (deviceItem.DeviceView == null)
{
if (ExtensionUtils.GetDeviceView(adminContext, deviceItem.Instance.CommApp,
if (ExtensionUtils.GetDeviceView(adminContext, deviceItem.Instance.CommApp,
deviceItem.DeviceConfig, out DeviceView deviceView, out string errMsg))
{
deviceItem.DeviceView = deviceView;
Expand All @@ -189,7 +189,7 @@ private void cbDevice_SelectedIndexChanged(object sender, EventArgs e)
deviceItem.CnlPrototypes = deviceItem.DeviceView.GetCnlPrototypes();
int cnlCnt = deviceItem.CnlPrototypes?.Count ?? 0;

txtInfo.Text = string.Format(ExtensionPhrases.DeviceInfo,
txtInfo.Text = string.Format(ExtensionPhrases.DeviceInfo,
deviceItem.DeviceConfig.Driver, deviceItem.Instance.Name, cnlCnt);
pbStatus.Image = cnlCnt > 0 ? Properties.Resources.success : Properties.Resources.warning;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public string DeviceName
txtDevice.Text = value ?? "";
}
}

/// <summary>
/// Gets the selected object number.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void SetFocus()
{
numStartCnlNum.Select();
}

/// <summary>
/// Sets the channel numbers by default.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
using WinControl;
using WinControls;

namespace Scada.Admin.Extensions.ExtCommConfig.Controls
{
Expand Down Expand Up @@ -404,8 +404,8 @@ private void miLineStartStop_Click(object sender, EventArgs e)
{
if (adminContext.MainForm.GetAgentClient(SelectedNode, false) is IAgentClient agentClient)
{
TeleCommand cmd = new()
{
TeleCommand cmd = new()
{
CmdVal = lineConfig.CommLineNum
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Scada.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;

namespace Scada.Admin.Extensions.ExtCommConfig.Controls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ private void FillChannelTypeList()
{
string driverCode = ScadaUtils.RemoveFileNameSuffixes(fileInfo.Name);

if (ExtensionUtils.GetDriverView(adminContext, commApp, driverCode,
if (ExtensionUtils.GetDriverView(adminContext, commApp, driverCode,
out DriverView driverView, out string message))
{
if (driverView.CanCreateChannel &&
if (driverView.CanCreateChannel &&
driverView.ChannelTypes is ICollection<ChannelTypeName> channelTypeNames)
{
foreach (ChannelTypeName channelTypeName in channelTypeNames)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Scada.Admin.Extensions.ExtCommConfig.Code;
using Scada.Admin.Project;
using Scada.Comm;
using Scada.Comm.Config;
using Scada.Data.Entities;
Expand Down
12 changes: 6 additions & 6 deletions ScadaAdmin/OpenExtensions/ExtCommConfig/ExtCommConfig.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<RootNamespace>Scada.Admin.Extensions.ExtCommConfig</RootNamespace>
<Authors>Mikhail Shiryaev</Authors>
<Company>Rapid Software LLC</Company>
<Product>Rapid SCADA</Product>
<Copyright>Copyright © 2024</Copyright>
<Version>6.0.1</Version>
<AssemblyVersion>6.0.1.2</AssemblyVersion>
<Version>6.1.0</Version>
<AssemblyVersion>6.1.0.0</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="WinControl" Version="2.1.0" />
<PackageReference Include="WinControl" Version="2.2.3" />
</ItemGroup>

<ItemGroup>
<Reference Include="ScadaAdminCommon">
<HintPath>..\..\ScadaAdmin\ScadaAdminCommon\bin\Release\net6.0-windows\ScadaAdminCommon.dll</HintPath>
<HintPath>..\..\ScadaAdmin\ScadaAdminCommon\bin\Release\net8.0-windows\ScadaAdminCommon.dll</HintPath>
</Reference>
<Reference Include="ScadaCommCommon">
<HintPath>..\..\..\ScadaComm\ScadaComm\ScadaCommCommon\bin\Release\netstandard2.0\ScadaCommCommon.dll</HintPath>
Expand All @@ -28,7 +28,7 @@
<HintPath>..\..\..\ScadaCommon\ScadaCommon\bin\Release\netstandard2.0\ScadaCommon.dll</HintPath>
</Reference>
<Reference Include="ScadaCommon.Forms">
<HintPath>..\..\..\ScadaCommon\ScadaCommon.Forms\bin\Release\net6.0-windows\ScadaCommon.Forms.dll</HintPath>
<HintPath>..\..\..\ScadaCommon\ScadaCommon.Forms\bin\Release\net8.0-windows\ScadaCommon.Forms.dll</HintPath>
</Reference>
<Reference Include="ScadaCommon.Log">
<HintPath>..\..\..\ScadaCommon\ScadaCommon.Log\bin\Release\netstandard2.0\ScadaCommon.Log.dll</HintPath>
Expand Down
6 changes: 3 additions & 3 deletions ScadaAdmin/OpenExtensions/ExtCommConfig/ExtCommConfigLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ private CtrlExtensionMenu CtrlExtensionMenu
ExtensionUtils.MenuControl = new CtrlExtensionMenu(AdminContext);
FormTranslator.Translate(ExtensionUtils.MenuControl, typeof(CtrlExtensionMenu).FullName,
new FormTranslatorOptions
{
ContextMenus = ExtensionUtils.MenuControl.AllContextMenus,
SkipUserControls = false
{
ContextMenus = ExtensionUtils.MenuControl.AllContextMenus,
SkipUserControls = false
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private List<Cnl> CreateChannels()
{
List<Cnl> cnls = new();
int cnlNum = ctrlCnlCreate3.StartCnlNum;
string namePrefix = adminContext.AppConfig.ChannelNumberingOptions.PrependDeviceName ?
string namePrefix = adminContext.AppConfig.ChannelNumberingOptions.PrependDeviceName ?
ctrlCnlCreate1.SelectedDevice.Name + " - " : "";
int? objNum = ctrlCnlCreate2.ObjNum;
int deviceNum = ctrlCnlCreate1.SelectedDevice.DeviceNum;
Expand Down
4 changes: 2 additions & 2 deletions ScadaAdmin/OpenExtensions/ExtCommConfig/Forms/FrmCommLogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Scada.Admin.Extensions.ExtCommConfig.Code;
using Scada.Admin.Forms;
using WinControl;
using WinControls;

namespace Scada.Admin.Extensions.ExtCommConfig.Forms
{
Expand All @@ -27,7 +27,7 @@ public FrmCommLogs(IAdminContext adminContext)
/// </summary>
protected override void FillFilter()
{
FilterComboBox.Items.AddRange(new FilterItem[]
FilterComboBox.Items.AddRange(new FilterItem[]
{
new FilterItem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System;
using System.IO;
using System.Windows.Forms;
using WinControl;
using WinControls;

namespace Scada.Admin.Extensions.ExtCommConfig.Forms
{
Expand Down Expand Up @@ -115,7 +115,7 @@ private void ConfigToControls()
lvDataSource.EndUpdate();
}
}

/// <summary>
/// Sets the configuration according to the controls.
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions ScadaAdmin/OpenExtensions/ExtCommConfig/Forms/FrmDeviceAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public FrmDeviceAdd(IAdminContext adminContext, ScadaProject project, RecentSele
this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext));
this.project = project ?? throw new ArgumentNullException(nameof(project));
this.recentSelection = recentSelection ?? throw new ArgumentNullException(nameof(recentSelection));

Instance = null;
DeviceConfig = null;
LineConfig = null;
Expand Down Expand Up @@ -139,7 +139,7 @@ private void FillInstanceList()
cbInstance.SelectedIndex = 0;
}
}

/// <summary>
/// Sets the device number by default.
/// </summary>
Expand Down Expand Up @@ -238,7 +238,7 @@ private void SetPollingOptions()
{
if (!string.IsNullOrEmpty(DeviceConfig.Driver))
{
if (ExtensionUtils.GetDriverView(adminContext, Instance.CommApp, DeviceConfig.Driver,
if (ExtensionUtils.GetDriverView(adminContext, Instance.CommApp, DeviceConfig.Driver,
out DriverView driverView, out string message))
{
if (driverView.CanCreateDevice)
Expand Down Expand Up @@ -300,7 +300,7 @@ private void btnOK_Click(object sender, EventArgs e)

if (instance.CommApp.Enabled && lineConfig != null)
{
DeviceConfig = CommConfigConverter.CreateDeviceConfig(deviceEntity,
DeviceConfig = CommConfigConverter.CreateDeviceConfig(deviceEntity,
project.ConfigDatabase.DevTypeTable);
DeviceConfig.Parent = lineConfig;
lineConfig.DevicePolling.Add(DeviceConfig);
Expand Down
12 changes: 2 additions & 10 deletions ScadaAdmin/OpenExtensions/ExtCommConfig/Forms/FrmDeviceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using System;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinControl;
using WinControls;

namespace Scada.Admin.Extensions.ExtCommConfig.Forms
{
Expand Down Expand Up @@ -41,7 +41,7 @@ private FrmDeviceData()
/// <summary>
/// Initializes a new instance of the class.
/// </summary>
public FrmDeviceData(IAdminContext adminContext, CommApp commApp, DeviceConfig deviceConfig) :
public FrmDeviceData(IAdminContext adminContext, CommApp commApp, DeviceConfig deviceConfig) :
this()
{
this.adminContext = adminContext ?? throw new ArgumentNullException(nameof(adminContext));
Expand Down Expand Up @@ -97,14 +97,6 @@ private void UpdateLogPath()
CommUtils.GetDeviceLogFileName(deviceConfig.DeviceNum, ".txt"));
}

/// <summary>
/// Saves the changes of the child form data.
/// </summary>
public void Save()
{
// do nothing
}


private void FrmDeviceData_Load(object sender, EventArgs e)
{
Expand Down
Loading

0 comments on commit e827db4

Please sign in to comment.