Skip to content

Commit

Permalink
Merge pull request #59 from RapidScada/develop
Browse files Browse the repository at this point in the history
Merge Develop to Master
  • Loading branch information
2mik authored May 23, 2018
2 parents 96d59bc + 4dc92d4 commit fa4616d
Show file tree
Hide file tree
Showing 257 changed files with 13,358 additions and 1,679 deletions.
7 changes: 4 additions & 3 deletions HowToBuild.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
How to Build Rapid SCADA
------------------------
Microsoft Visual Studio 2010 Professional or higher is needed.
Visual Studio Community 2013 is also acceptable.
Microsoft Visual Studio 2015 or higher is needed. Visual Studio Community is OK.

1. Download the source code from SCADA and DLL repositories:
https://github.com/RapidScada/scada
Expand All @@ -18,4 +17,6 @@ Visual Studio Community 2013 is also acceptable.
ScadaWeb,
ScadaScheme.

3. Enjoy the binaries builded by yourself.
Use the Release configuration so that the links are correct.

3. Enjoy the binaries built by yourself.
16 changes: 15 additions & 1 deletion LangPack/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@ Language Installation
2. Copy the language files from the folder SCADA of the language pack to the installation directory of Rapid SCADA maintaining the hierarchy of the directories.
3. Run SCADA-Administrator application.
4. Go to Settings -> Language and type the culture name, e.g. es-LA, and click OK button.
5. Restart Rapid SCADA applications to apply changes.
5. Restart Rapid SCADA applications to apply changes.


How to Localize UI to Any Language
----------------------------------
Most of Rapid SCADA applications contain special localization files. Usually they are located in a Lang folder:
C:\SCADA\ScadaAdmin\Lang
C:\SCADA\ScadaComm\Lang
C:\SCADA\ScadaSchemeEditor\Lang
C:\SCADA\ScadaServer\Lang
C:\SCADA\ScadaTableEditor\Lang
C:\SCADA\ScadaWeb\lang

To add a new language support, create copies of *.en-GB.xml files and give the file names according to your culture. In this example en means English language and GB is Great Britain.
Using your favorite text editor (Notepad++ is OK) translate the phrases in the created xml files. Then open the Administrator application, go to Settings > Language menu and enter your localization name, for example, es-LA
4 changes: 2 additions & 2 deletions LangPack/v5.x/Spanish/ScadaAdmin/Lang/ScadaAdmin.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaAdminDictionaries>
<Dictionary key="ScadaAdmin">
<Phrase key="BaseSDFFileNotFound">El archivo de base de datos de la configuración en el formato de SDF {0} no encontrado.</Phrase>
Expand All @@ -12,7 +12,7 @@
<Phrase key="ImportFileUndefied">El archivo de la importación es indefinido.</Phrase>
<Phrase key="ImportFileNotExist">El archivo de la importación no existe.</Phrase>
<Phrase key="ImportTitle">Importar configuracion de Base de Datos</Phrase>
<Phrase key="ImportTableTitle">Importar tabla de configuracion Base de Datos; &quot;{0}&quot;</Phrase
<Phrase key="ImportTableTitle">Importar tabla de configuracion Base de Datos; &quot;{0}&quot;</Phrase>
<Phrase key="ImportSource">Archivo de Origen: </Phrase>
<Phrase key="LoadTableError">Error al Importar carga de tabla</Phrase>
<Phrase key="SrcTableColumns">Columnas de la tabla de la Origen</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaAdmin/Lang/ScadaData.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaDataDictionaries>
<Dictionary key="Common">
<Phrase key="InfoCaption">Información</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/AddressBook.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<AddressBookDictionaries>
<Dictionary key="Scada.Comm.Devices.AB">
<Phrase key="LoadAddressBookError">Error al cargar agenda de direcciones</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/KpEmail.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<KpEmailDictionaries>
<Dictionary key="Scada.Comm.Devices.KpEmail.FrmConfig">
<Phrase key="this">Email - Dispositivo {0} Configuracion</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/KpModbus.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<KpModbusDictionaries>
<Dictionary key="Scada.Comm.Devices.KpModbus.FrmDevTemplate">
<Phrase key="this">MODBUS. Editor de la plantilla del dispositivo</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/KpOpc.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<KpOpcDictionaries>
<Dictionary key="Scada.Comm.Devices.KpOpc.FrmConfig">
<Phrase key="this">0} configuraciones del dispositivo {</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/KpSnmp.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<KpSmmpDictionaries>
<Dictionary key="Scada.Comm.Devices.KpSnmp.FrmConfig">
<Phrase key="this">SNMP - {0} configuraciones del dispositivo</Phrase>
Expand Down
6 changes: 3 additions & 3 deletions LangPack/v5.x/Spanish/ScadaComm/Lang/ScadaComm.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaCommDictionaries>
<Dictionary key="Scada.Comm.Ctrl.FrmImport">
<Phrase key="this">Importación de líneas y dispositivos de comunicación</Phrase>
Expand Down Expand Up @@ -234,8 +234,8 @@
<Phrase key="lblBehavior">Comportamiento</Phrase>
<Phrase key="pbBehaviorHint.ToolTip">Master - SCADA-Communicator envía solicitud a un dispositivo y recibe respuesta.&#13;&#10;Slave - SCADA-Communicator espera pasivamente los datos de un dispositivo.</Phrase>
<Phrase key="lblDevSelMode">Selección del dispositivo</Phrase>
<Phrase key="cbDevSelMode.Items[0]">Por dirección IP</Phrase
<Phrase key="cbDevSelMode.Items[1]">DLL determinado</Phrase>
<Phrase key="cbDevSelMode.Items[0]">Por dirección IP</Phrase>
<Phrase key="cbDevSelMode.Items[1]">DLL determinado</Phrase>
<Phrase key="pbDevSelModeHint.ToolTip">El método de enlazar los datos recibidos a un dispositivo en modo esclavo:&#13;&#10;Por dirección IP: la dirección IP remota equivale a un número de llamada del dispositivo.&#13;&#10;DLL Determined - algoritmo se implementa en la biblioteca de dispositivos.</Phrase>
<Phrase key="lblLocalUdpPort">Puerto local de UDP</Phrase>
<Phrase key="pbLocalUdpPortHint.ToolTip">Puerto UDP local para conexiones entrantes.&#13;&#10;Las conexiones entrantes deben ser permitidas por un firewall.</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaComm/Lang/ScadaData.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaDataDictionaries>
<Dictionary key="Common">
<Phrase key="InfoCaption">Información</Phrase>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaDataDictionaries>
<Dictionary key="Common">
<Phrase key="InfoCaption">Información</Phrase>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ScadaSchemeEditorDictionaries>
<Dictionary key="Scada.Scheme.Editor.FrmMain">
<Phrase key="this">SCADA-Scheme Editor</Phrase>
Expand Down Expand Up @@ -36,7 +36,7 @@
<Phrase key="lblNoSelObj">Seleccionar elemento para editar sus propiedades</Phrase>
<Phrase key="FileFilter">Esquemas (*.sch)|*.sch|Todos los Archivos (*.*)|*.*</Phrase>
<Phrase key="SaveConfirm">El esquema a sido modificado. Guardar los cambios?</Phrase>
<Phrase key="UseArrows">Utilice las llaves de flecha para mover el elemento seleccionado.</Phrase>
<Phrase key="UseArrows">Utilice las llaves de flecha para mover el elemento seleccionado.</Phrase>
</Dictionary>
<Dictionary key="Scada.Scheme.EditorData">
<Phrase key="LoadSchemeError">Error al cargar el esquema de archivo</Phrase>
Expand Down
2 changes: 1 addition & 1 deletion LangPack/v5.x/Spanish/ScadaServer/Lang/ScadaData.es-LA.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<ScadaDataDictionaries>
<Dictionary key="Common">
<Phrase key="InfoCaption">Información</Phrase>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<ScadaDataDictionaries>
<Dictionary key="Common">
<Phrase key="InfoCaption">Información</Phrase>
Expand Down
13 changes: 13 additions & 0 deletions Log/Log.Std/Log.Std.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Log\ILog.cs" Link="ILog.cs" />
<Compile Include="..\Log\Log.cs" Link="Log.cs" />
<Compile Include="..\Log\LogStub.cs" Link="LogStub.cs" />
</ItemGroup>

</Project>
15 changes: 12 additions & 3 deletions Log/Log.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Log", "Log.csproj", "{A05EA084-E509-4025-9241-6A5BE5C2B328}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Log", "Log\Log.csproj", "{A05EA084-E509-4025-9241-6A5BE5C2B328}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Log.Std", "Log.Std\Log.Std.csproj", "{8D5B84EB-11D8-4B4E-80A0-E51966863149}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,8 +17,15 @@ Global
{A05EA084-E509-4025-9241-6A5BE5C2B328}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A05EA084-E509-4025-9241-6A5BE5C2B328}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A05EA084-E509-4025-9241-6A5BE5C2B328}.Release|Any CPU.Build.0 = Release|Any CPU
{8D5B84EB-11D8-4B4E-80A0-E51966863149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D5B84EB-11D8-4B4E-80A0-E51966863149}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D5B84EB-11D8-4B4E-80A0-E51966863149}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D5B84EB-11D8-4B4E-80A0-E51966863149}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA8D43F9-5D59-4AEA-A084-86003618EEA5}
EndGlobalSection
EndGlobal
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added ScadaAdmin/Res/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ScadaAdmin/Res/folder_closed2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ScadaAdmin/Res/folder_open2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ScadaAdmin/Res/key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 22 additions & 9 deletions ScadaAdmin/ScadaAdmin/AppCode/AppData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014 Mikhail Shiryaev
* Copyright 2018 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 : 2010
* Modified : 2014
* Modified : 2018
*/

using System.Data;
Expand Down Expand Up @@ -50,25 +50,36 @@ internal static class AppData
/// </summary>
static AppData()
{
ExeDir = ScadaUtils.NormalDir(Path.GetDirectoryName(Application.ExecutablePath));
ErrLog = new Log(Log.Formats.Full);
ErrLog.FileName = ExeDir + ErrFileName;
ErrLog.Encoding = Encoding.UTF8;
AppDirs = new AppDirs();
AppDirs.Init(Path.GetDirectoryName(Application.ExecutablePath));

ErrLog = new Log(Log.Formats.Full)
{
FileName = AppDirs.LogDir + ErrFileName,
Encoding = Encoding.UTF8
};

Settings = new Settings();
Conn = new SqlCeConnection();
}


/// <summary>
/// Получить директорию исполняемого файла приложения
/// Получить директории приложения
/// </summary>
public static string ExeDir { get; private set; }
public static AppDirs AppDirs { get; private set; }

/// <summary>
/// Получить журнал ошибок приложения
/// </summary>
public static Log ErrLog { get; private set; }


/// <summary>
/// Получить настройки приложения
/// </summary>
public static Settings Settings { get; private set; }

/// <summary>
/// Получить соединение с БД
/// </summary>
Expand All @@ -89,11 +100,13 @@ public static bool Connected
/// <summary>
/// Соединиться с БД, используя заданную в файле Web.Config строку связи
/// </summary>
public static void Connect(string baseSdfFileName)
public static void Connect()
{
if (Conn.State != ConnectionState.Closed)
Disconnect();

string baseSdfFileName = Settings.AppSett.BaseSDFFile;

if (!File.Exists(baseSdfFileName))
throw new FileNotFoundException(string.Format(AppPhrases.BaseSDFFileNotFound, baseSdfFileName));

Expand Down
81 changes: 81 additions & 0 deletions ScadaAdmin/ScadaAdmin/AppCode/AppDirs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Copyright 2018 Mikhail Shiryaev
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* Product : Rapid SCADA
* Module : SCADA-Administrator
* Summary : Application directories
*
* Author : Mikhail Shiryaev
* Created : 2018
* Modified : 2018
*/

using Scada;
using System.IO;

namespace ScadaAdmin
{
/// <summary>
/// Application directories
/// <para>Директории приложения</para>
/// </summary>
public class AppDirs
{
/// <summary>
/// Конструктор
/// </summary>
public AppDirs()
{
ExeDir = "";
ConfigDir = "";
LangDir = "";
LogDir = "";
}


/// <summary>
/// Получить директорию исполняемого файла
/// </summary>
public string ExeDir { get; protected set; }

/// <summary>
/// Получить директорию конфигурации
/// </summary>
public string ConfigDir { get; protected set; }

/// <summary>
/// Получить директорию языковых файлов
/// </summary>
public string LangDir { get; protected set; }

/// <summary>
/// Получить директорию журналов
/// </summary>
public string LogDir { get; protected set; }


/// <summary>
/// Инициализировать директории на основе директории исполняемого файла приложения
/// </summary>
public void Init(string exeDir)
{
ExeDir = ScadaUtils.NormalDir(exeDir);
ConfigDir = ExeDir + "Config" + Path.DirectorySeparatorChar;
LangDir = ExeDir + "Lang" + Path.DirectorySeparatorChar;
LogDir = ExeDir + "Log" + Path.DirectorySeparatorChar;
}
}
}
Loading

0 comments on commit fa4616d

Please sign in to comment.