Skip to content

Commit

Permalink
Merge pull request #113 from RapidScada/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master
  • Loading branch information
2mik authored May 17, 2021
2 parents 996cbf8 + 6b32eeb commit a3e0571
Show file tree
Hide file tree
Showing 194 changed files with 5,506 additions and 578 deletions.
6 changes: 6 additions & 0 deletions Config/DemoProject.en-GB/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Interacting with controllers using OPC UA specification</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Implements Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
6 changes: 6 additions & 0 deletions Config/DemoProject.ru-RU/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Взаимодействие с контроллерами по спецификации OPC UA</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Реализует Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
6 changes: 6 additions & 0 deletions Config/EmptyProject.en-GB/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Interacting with controllers using OPC UA specification</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Implements Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
6 changes: 6 additions & 0 deletions Config/EmptyProject.ru-RU/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Взаимодействие с контроллерами по спецификации OPC UA</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Реализует Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
6 changes: 6 additions & 0 deletions Config/HelloWorld/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Interacting with controllers using OPC UA specification</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Implements Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
6 changes: 6 additions & 0 deletions Config/HelloWorld_Linux/BaseXML/KPType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@
<DllFileName>KpOpcUa.dll</DllFileName>
<Descr>Interacting with controllers using OPC UA specification</Descr>
</KPType>
<KPType>
<KPTypeID>233</KPTypeID>
<Name>Enron Modbus</Name>
<DllFileName>KpEnronModbus.dll</DllFileName>
<Descr>Implements Enron Modbus https://www.simplymodbus.ca/Enron.htm</Descr>
</KPType>
</ArrayOfKPType>
30 changes: 15 additions & 15 deletions ScadaAdmin/ScadaAdmin5/ScadaAdmin/Forms/Tables/FrmFind.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Mikhail Shiryaev
* Copyright 2020 Mikhail Shiryaev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,11 +20,10 @@
*
* Author : Mikhail Shiryaev
* Created : 2010
* Modified : 2019
* Modified : 2020
*/

using System;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Scada.Admin.App.Code;
Expand Down Expand Up @@ -214,7 +213,7 @@ private bool IsMatched(DataGridViewCell cell, object value)
/// <summary>
/// Finds the next match.
/// </summary>
private bool FindNext(ColumnInfo columnInfo, bool showMsg)
private void FindNext(ColumnInfo columnInfo, bool showMsg, out bool found, out bool endReached)
{
bool isText = columnInfo.IsText;
string findStr = isText ? txtFind.Text : "";
Expand All @@ -223,7 +222,6 @@ private bool FindNext(ColumnInfo columnInfo, bool showMsg)
bool wholeCellOnly = chkWholeCellOnly.Checked;

DataGridViewCell curCell = dataGridView.CurrentCell;
bool found;
int colInd = columnInfo.Column.Index;
int rowInd = curCell == null ? 0 : curCell.RowIndex;
int rowCnt = dataGridView.RowCount;
Expand Down Expand Up @@ -251,17 +249,17 @@ private bool FindNext(ColumnInfo columnInfo, bool showMsg)
if (++rowInd >= rowCnt)
rowInd = 0;

} while (!found && rowInd != startRowIndex);
endReached = rowInd == startRowIndex;

if (!found || rowInd == startRowIndex)
} while (!found && !endReached);

if (!found || endReached)
{
if (showMsg)
ScadaUiUtils.ShowInfo(foundSomething ? AppPhrases.SearchComplete : AppPhrases.ValueNotFound);

ResetSearch();
}

return found;
}

/// <summary>
Expand Down Expand Up @@ -352,11 +350,11 @@ private void ReplaceAll(ColumnInfo columnInfo)

// replace other cells
startRowIndex = dataGridView.CurrentCell == null ? 0 : dataGridView.CurrentCell.RowIndex;
bool found;
bool found, endReached;

do
{
found = FindNext(columnInfo, false);
FindNext(columnInfo, false, out found, out endReached);

if (found)
{
Expand All @@ -366,7 +364,7 @@ private void ReplaceAll(ColumnInfo columnInfo)
replacedCnt++;
}

} while (found);
} while (found && !endReached);

if (replacedCnt > 0)
ScadaUiUtils.ShowInfo(string.Format(AppPhrases.ReplaceCount, replacedCnt));
Expand Down Expand Up @@ -396,6 +394,7 @@ private void cbColumn_SelectedIndexChanged(object sender, EventArgs e)
private void txtFind_TextChanged(object sender, EventArgs e)
{
ResetSearch();

if (txtFind.Visible)
btnFindNext.Enabled = btnReplace.Enabled = btnReplaceAll.Enabled = txtFind.Text != "";
}
Expand All @@ -413,16 +412,17 @@ private void cbReplaceWith_SelectedIndexChanged(object sender, EventArgs e)
private void btnFindNext_Click(object sender, EventArgs e)
{
if (cbColumn.SelectedItem is ColumnInfo columnInfo)
FindNext(columnInfo, true);
FindNext(columnInfo, true, out _, out _);
}

private void btnReplace_Click(object sender, EventArgs e)
{
if (cbColumn.SelectedItem is ColumnInfo columnInfo)
{
ReplaceCell(columnInfo, true, out bool replaced, out bool noError);
ReplaceCell(columnInfo, true, out bool _, out bool noError);

if (noError)
FindNext(columnInfo, true);
FindNext(columnInfo, true, out _, out _);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ScadaAdmin/ScadaAdmin5/ScadaAdminCommon/AdminUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class AdminUtils
/// <summary>
/// Version of Administrator.
/// </summary>
public const string AppVersion = "5.5.2.1";
public const string AppVersion = "5.5.2.2";
/// <summary>
/// Extension of a project file.
/// </summary>
Expand Down
18 changes: 9 additions & 9 deletions ScadaAdmin/ScadaAdmin5/ScadaAdminCommon/ImportExport.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Mikhail Shiryaev
* Copyright 2021 Mikhail Shiryaev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
*
* Author : Mikhail Shiryaev
* Created : 2018
* Modified : 2019
* Modified : 2021
*/

using Scada.Admin.Deployment;
Expand Down Expand Up @@ -513,21 +513,21 @@ public void ImportBaseTable(string srcFileName, BaseTableFormat format, IBaseTab
int itemID = srcTable.GetPkValue(item);
if (srcStartID <= itemID && itemID <= srcEndID)
{
if (shiftID > 0)
if (shiftID == 0)
{
baseTable.AddObject(item);
affectedRows++;
}
else
{
int newItemID = itemID + shiftID;
if (newItemID <= AdminUtils.MaxCnlNum)
if (1 <= newItemID && newItemID <= AdminUtils.MaxCnlNum)
{
srcTable.SetPkValue(item, newItemID);
baseTable.AddObject(item);
affectedRows++;
}
}
else
{
baseTable.AddObject(item);
affectedRows++;
}
}
else if (itemID > srcEndID)
{
Expand Down
36 changes: 31 additions & 5 deletions ScadaComm/OpenKPs/KpDbImport/KpDbImport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Scada.Comm.Devices</RootNamespace>
<AssemblyName>KpDbImport</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,16 +31,17 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Log">
<HintPath>..\..\..\Log\Log\bin\Release\Log.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
<HintPath>..\..\..\..\dll\MySql.Data.dll</HintPath>
<Reference Include="MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Npgsql">
<HintPath>..\..\..\..\dll\PostgreSQL\Npgsql.dll</HintPath>
<Reference Include="Npgsql, Version=4.0.11.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<HintPath>..\packages\Npgsql.4.0.11\lib\net451\Npgsql.dll</HintPath>
</Reference>
<Reference Include="ScadaCommCommon">
<HintPath>..\..\ScadaComm\ScadaCommCommon\bin\Release\ScadaCommCommon.dll</HintPath>
Expand All @@ -47,9 +50,28 @@
<HintPath>..\..\..\ScadaData\ScadaData\bin\Release\ScadaData.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
Expand Down Expand Up @@ -87,5 +109,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
9 changes: 9 additions & 0 deletions ScadaComm/OpenKPs/KpDbImport/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
11 changes: 11 additions & 0 deletions ScadaComm/OpenKPs/KpDbImport/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MySql.Data" version="6.9.12" targetFramework="net472" />
<package id="Npgsql" version="4.0.11" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
</packages>
Loading

0 comments on commit a3e0571

Please sign in to comment.