Skip to content

Commit a8efe22

Browse files
authored
Merge pull request #36 from RapidScada/develop
Merge Develop to Master
2 parents 06b3278 + 3c89678 commit a8efe22

File tree

267 files changed

+24981
-1089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+24981
-1089
lines changed

Base/data/ScadaBase_4.2_en.sdf

0 Bytes
Binary file not shown.

Base/data/ScadaBase_4.2_ru.sdf

0 Bytes
Binary file not shown.

Log/ILog.cs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright 2017 Mikhail Shiryaev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*
17+
* Product : Rapid SCADA
18+
* Module : Log
19+
* Summary : Log interface
20+
*
21+
* Author : Mikhail Shiryaev
22+
* Created : 2017
23+
* Modified : 2017
24+
*/
25+
26+
using System;
27+
28+
namespace Utils
29+
{
30+
/// <summary>
31+
/// Log interface
32+
/// <para>Интерфейс журнала</para>
33+
/// </summary>
34+
public interface ILog
35+
{
36+
/// <summary>
37+
/// Записать действие определённого типа в журнал
38+
/// </summary>
39+
void WriteAction(string text, Log.ActTypes actType);
40+
41+
/// <summary>
42+
/// Записать информационное действие в журнал
43+
/// </summary>
44+
void WriteInfo(string text);
45+
46+
/// <summary>
47+
/// Записать обычное действие в журнал
48+
/// </summary>
49+
void WriteAction(string text);
50+
51+
/// <summary>
52+
/// Записать ошибку в журнал
53+
/// </summary>
54+
void WriteError(string text);
55+
56+
/// <summary>
57+
/// Записать исключение в журнал
58+
/// </summary>
59+
void WriteException(Exception ex, string errMsg = "", params object[] args);
60+
61+
/// <summary>
62+
/// Записать строку в журнал
63+
/// </summary>
64+
void WriteLine(string text = "");
65+
66+
/// <summary>
67+
/// Записать разделитель в журнал
68+
/// </summary>
69+
void WriteBreak();
70+
}
71+
}

Log/Log.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Mikhail Shiryaev
2+
* Copyright 2017 Mikhail Shiryaev
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
*
2121
* Author : Mikhail Shiryaev
2222
* Created : 2005
23-
* Modified : 2016
23+
* Modified : 2017
2424
*/
2525

2626
using System;
@@ -35,7 +35,7 @@ namespace Utils
3535
/// Log file implementation
3636
/// <para>Реализация файла журнала</para>
3737
/// </summary>
38-
public class Log
38+
public class Log : ILog
3939
{
4040
/// <summary>
4141
/// Типы действий, записываемые в журнал

Log/Log.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ProjectGuid>{A05EA084-E509-4025-9241-6A5BE5C2B328}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>Log</RootNamespace>
11+
<RootNamespace>Utils</RootNamespace>
1212
<AssemblyName>Log</AssemblyName>
1313
<FileUpgradeFlags>
1414
</FileUpgradeFlags>
@@ -42,7 +42,9 @@
4242
<Reference Include="System.Xml" />
4343
</ItemGroup>
4444
<ItemGroup>
45+
<Compile Include="ILog.cs" />
4546
<Compile Include="Log.cs" />
47+
<Compile Include="LogStub.cs" />
4648
<Compile Include="Properties\AssemblyInfo.cs" />
4749
</ItemGroup>
4850
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

Log/LogStub.cs

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2017 Mikhail Shiryaev
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*
17+
* Product : Rapid SCADA
18+
* Module : Log
19+
* Summary : Log stub
20+
*
21+
* Author : Mikhail Shiryaev
22+
* Created : 2017
23+
* Modified : 2017
24+
*/
25+
26+
using System;
27+
28+
namespace Utils
29+
{
30+
/// <summary>
31+
/// Log stub
32+
/// <para>Заглушка журнала</para>
33+
/// </summary>
34+
public class LogStub : ILog
35+
{
36+
/// <summary>
37+
/// Записать действие определённого типа в журнал
38+
/// </summary>
39+
public void WriteAction(string text, Log.ActTypes actType)
40+
{
41+
}
42+
43+
/// <summary>
44+
/// Записать информационное действие в журнал
45+
/// </summary>
46+
public void WriteInfo(string text)
47+
{
48+
}
49+
50+
/// <summary>
51+
/// Записать обычное действие в журнал
52+
/// </summary>
53+
public void WriteAction(string text)
54+
{
55+
}
56+
57+
/// <summary>
58+
/// Записать ошибку в журнал
59+
/// </summary>
60+
public void WriteError(string text)
61+
{
62+
}
63+
64+
/// <summary>
65+
/// Записать исключение в журнал
66+
/// </summary>
67+
public void WriteException(Exception ex, string errMsg = "", params object[] args)
68+
{
69+
}
70+
71+
/// <summary>
72+
/// Записать строку в журнал
73+
/// </summary>
74+
public void WriteLine(string text = "")
75+
{
76+
}
77+
78+
/// <summary>
79+
/// Записать разделитель в журнал
80+
/// </summary>
81+
public void WriteBreak()
82+
{
83+
}
84+
}
85+
}

Report/RepBuilder/RepBuilder.cs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 Mikhail Shiryaev
2+
* Copyright 2017 Mikhail Shiryaev
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,10 +20,12 @@
2020
*
2121
* Author : Mikhail Shiryaev
2222
* Created : 2006
23-
* Modified : 2016
23+
* Modified : 2017
2424
*/
2525

26+
using System;
2627
using System.IO;
28+
using System.Web;
2729
using System.Windows.Forms;
2830

2931
namespace Utils.Report
@@ -142,5 +144,34 @@ public virtual void Make(string outFileName, string templateDir)
142144
outStream.Close();
143145
}
144146
}
147+
148+
/// <summary>
149+
/// Генерировать отчёт для загрузки через браузер
150+
/// </summary>
151+
public virtual void Generate(object[] repParams, string templateDir, string fileName, HttpResponse response)
152+
{
153+
if (response == null)
154+
throw new ArgumentNullException("response");
155+
156+
try
157+
{
158+
response.ClearHeaders();
159+
response.ClearContent();
160+
161+
response.ContentType = "application/octet-stream";
162+
if (!string.IsNullOrEmpty(fileName))
163+
response.AppendHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
164+
165+
SetParams(repParams);
166+
Make(response.OutputStream, templateDir);
167+
}
168+
catch
169+
{
170+
response.ClearHeaders();
171+
response.ClearContent();
172+
response.ContentType = "text/html";
173+
throw;
174+
}
175+
}
145176
}
146177
}

Report/RepBuilder/RepBuilder.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<Reference Include="System.Data">
8383
<Name>System.Data</Name>
8484
</Reference>
85+
<Reference Include="System.Web" />
8586
<Reference Include="System.Windows.Forms" />
8687
<Reference Include="System.Xml">
8788
<Name>System.XML</Name>

ScadaAdmin/ScadaAdmin/AppCode/Settings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
namespace ScadaAdmin
3333
{
3434
/// <summary>
35-
/// Настройки приложения
35+
/// Application settings
36+
/// <para>Настройки приложения</para>
3637
/// </summary>
3738
public class Settings
3839
{
3940
/// <summary>
40-
/// Application settings
41-
/// <para>Настройки приложения</para>
41+
/// Настройки приложения
4242
/// </summary>
4343
public class AppSettings
4444
{

ScadaAdmin/ScadaAdmin/ScadaAdmin.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@
254254
<Link>Lang\ScadaData.en-GB.xml</Link>
255255
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
256256
</Content>
257+
<Content Include="..\..\ScadaData\ScadaData\Lang\ScadaData.ru-RU.xml">
258+
<Link>Lang\ScadaData.ru-RU.xml</Link>
259+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
260+
</Content>
257261
<Content Include="database.ico" />
258262
<Content Include="Lang\ScadaAdmin.en-GB.xml">
259263
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

0 commit comments

Comments
 (0)