Skip to content
Snippets Groups Projects
Commit 8e43b46f authored by Антон Кудряшов's avatar Антон Кудряшов
Browse files

added console application

parent b8081a73
No related branches found
No related tags found
No related merge requests found
......@@ -3,3 +3,5 @@ MES_Wind/bin/
*.suo
WindStressPRM/bin/
WindStressPRM/obj/
Mes_Wind_console/obj/
Mes_Wind_console/bin/
using System;
using System.Collections.Generic;
public interface PowerLineObject
{
PowerPointObject fromPoint;
PowerPointObject toPoint;
bool broken;
}
public interface PowerPointObject
{
List<PowerLineObject> lines { get; }
bool powerIsON { get; set; }
}

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mes_Wind_console", "Mes_Wind_console\Mes_Wind_console.csproj", "{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindStressPRM", "WindStressPRM\WindStressPRM.csproj", "{599B5E9B-293A-4866-A50F-6BB7DC36A81C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Debug|Any CPU.ActiveCfg = Debug|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Debug|Mixed Platforms.Build.0 = Debug|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Debug|x86.ActiveCfg = Debug|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Debug|x86.Build.0 = Debug|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Release|Any CPU.ActiveCfg = Release|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Release|Mixed Platforms.ActiveCfg = Release|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Release|Mixed Platforms.Build.0 = Release|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Release|x86.ActiveCfg = Release|x86
{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}.Release|x86.Build.0 = Release|x86
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Debug|x86.ActiveCfg = Debug|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Release|Any CPU.Build.0 = Release|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{599B5E9B-293A-4866-A50F-6BB7DC36A81C}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C3ABE3EA-A92D-4C36-83F7-D81F6A30B24C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mes_Wind_console</RootNamespace>
<AssemblyName>Mes_Wind_console</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WindStressPRM\WindStressPRM.csproj">
<Project>{599B5E9B-293A-4866-A50F-6BB7DC36A81C}</Project>
<Name>WindStressPRM</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mes_Wind_console
{
class Program
{
static void Main(string[] args)
{
const int rowCountPrognostic = 3;
const int colCountPrognostic = 3;
WindStressPRM.Matrix<WindStressPRM.PrognosticCell> prognosticMatrix = new WindStressPRM.Matrix<WindStressPRM.PrognosticCell>();
prognosticMatrix.Cells = new WindStressPRM.PrognosticCell[rowCountPrognostic, colCountPrognostic];
prognosticMatrix.Size = new WindStressPRM.CellSize(500, 500);
prognosticMatrix.Origin = new WindStressPRM.Coordinate(3555223.71, 5828444.07);
// fill cells of prognostic matrix
for (int i = 0; i < rowCountPrognostic; i++)
{
for (int j = 0; j < colCountPrognostic; j++)
{
// Also you can use Double.NaN;
double uValue = 100*( i + j * 10);
double vValue = -(i + j * 10);
prognosticMatrix.Cells[i, j] = new WindStressPRM.PrognosticCell(uValue, vValue);
}
}
//Now we create climate raster class
const int rowCountClim = 3;
const int columnCountClim = 3;
WindStressPRM.Matrix<WindStressPRM.ClimateCell> climateMatrix = new WindStressPRM.Matrix<WindStressPRM.ClimateCell>();
climateMatrix.Cells = new WindStressPRM.ClimateCell[rowCountClim, columnCountClim];
climateMatrix.Size = new WindStressPRM.CellSize(500, 500);
climateMatrix.Origin = new WindStressPRM.Coordinate(3555223.71, 5828444.07);
// fill cells of climate matrix
for (int i = 0; i < rowCountClim; i++)
{
for (int j = 0; j < columnCountClim; j++)
{
//add or substruct in range 0 - 27 to change what lines will be broken
double clim5 = 5;
double clim10 = 10;
double clim15 = 15;
double clim25 = 20;
climateMatrix.Cells[i, j] = new WindStressPRM.ClimateCell(clim5, clim10, clim15, clim25);
}
}
// create powerlines layer
List<WindStressPRM.Powerline> powerlines = new List<WindStressPRM.Powerline>();
WindStressPRM.Coordinate first = climateMatrix.Origin;
const int numbStations = 5;
const double step = 100;
for (int i = 0; i < numbStations - 1; i++)
{
WindStressPRM.Powerline dummyline = new WindStressPRM.Powerline();
dummyline.Identifier = 100 + i;
dummyline.Year = 2000;
dummyline.Height = 10;
dummyline.Voltage = 330;
dummyline.PointFromID = i;
dummyline.PointToID = i + 1;
dummyline.Coordinates = new List<WindStressPRM.Coordinate>();
dummyline.Coordinates.Add(first);
WindStressPRM.Coordinate second = new WindStressPRM.Coordinate(first.X + step, first.Y - step);
dummyline.Coordinates.Add(second);
first = second;
powerlines.Add(dummyline);
}
//create PRM_station list to pass to PRM_wind from loaded point layer
List<WindStressPRM.PowerStation> powerpoints = new List<WindStressPRM.PowerStation>();
for (int i = 0; i < numbStations; i++)
{
WindStressPRM.PowerStation dummystation = new WindStressPRM.PowerStation();
dummystation.Identifier = i;
dummystation.Name = "dummy name";
dummystation.Power = 330;
dummystation.IsSource = i == 0;
//casting stationtype
dummystation.Stationtype = WindStressPRM.PowerStation.StationType.Pole;
if (i == numbStations - 1)
{
dummystation.Stationtype = WindStressPRM.PowerStation.StationType.Endstat;
}
dummystation.Coordinate = new WindStressPRM.Coordinate(climateMatrix.Origin.X + step * i, climateMatrix.Origin.X - step * i);
powerpoints.Add(dummystation);
}
//Create a PRM_wind class and add all the properties from above
WindStressPRM.StressPowerChecker prmwind = new WindStressPRM.StressPowerChecker();
WindStressPRM.Input input = new WindStressPRM.Input();
input.PowerLines = powerlines;
input.PowerStations = powerpoints;
input.PrognosticCells = prognosticMatrix;
input.ClimateCells = climateMatrix;
WindStressPRM.Output output = prmwind.CheckPower(input);
foreach (WindStressPRM.Powerline line in output.DisabledLines) {
Console.WriteLine("disabled line identifier is " + line.Identifier.ToString());
}
foreach (WindStressPRM.PowerStation station in output.DisabledStations) {
Console.WriteLine("disabled station identifier is " + station.Identifier.ToString());
}
foreach (WindStressPRM.Coordinate coordinate in output.SpectificCoordinates) {
Console.WriteLine("in coordinate " + coordinate.X.ToString() + "; " + coordinate.Y.ToString() + " 35kV and less could be broken");
}
Console.WriteLine("end");
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
// связанные со сборкой.
[assembly: AssemblyTitle("Mes_Wind_console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mes_Wind_console")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("07572703-5b51-496f-bf8b-378927185bab")]
// Сведения о версии сборки состоят из следующих четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер построения
// Редакция
//
// Можно задать все значения или принять номер построения и номер редакции по умолчанию,
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Mes_Wind_console.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="MES_Wind">
</Property><Property Name="Файл решения" Value="C:\Users\Geophyslab-laptop\Documents\Mes_wind\MES_Wind.sln">
</Property><Property Name="Date" Value="25 августа 2016 г.">
</Property><Property Name="Time" Value="1:08">
</Property></Properties><Event ErrorLevel="0" Project="" Source="MES_Wind.sln" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind.sln">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\MES_Wind.csproj" Description="Успешно создана резервная копия файла проекта: C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\MES_Wind.csproj">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmGraph.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmGraph.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmGraph.Designer.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmGraph.Designer.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmMain.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmMain.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmMain.Designer.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmMain.Designer.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Program.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Program.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Properties\AssemblyInfo.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Properties\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Properties\Resources.Designer.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Properties\Resources.Designer.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Properties\Settings.Designer.cs" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Properties\Settings.Designer.cs">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Properties\Settings.settings" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Properties\Settings.settings">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmGraph.resx" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmGraph.resx">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\frmMain.resx" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\frmMain.resx">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\Properties\Resources.resx" Description="Успешно создана резервная копия файла C:\Users\Geophyslab-laptop\Documents\Mes_wind\Backup\MES_Wind\Properties\Resources.resx">
</Event><Event ErrorLevel="0" Project="MES_Wind" Source="MES_Wind\MES_Wind.csproj" Description="Файл проекта не нуждается в преобразовании.">
</Event><Event ErrorLevel="3" Project="MES_Wind" Source="MES_Wind\MES_Wind.csproj" Description="Преобразование не требуется">
</Event><Event ErrorLevel="0" Project="" Source="MES_Wind.sln" Description="Преобразование решения успешно завершено">
</Event><Event ErrorLevel="3" Project="" Source="MES_Wind.sln" Description="Converted">
</Event></UpgradeLog>
\ No newline at end of file
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:key name="ProjectKey" match="Event" use="@Project"/>
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">Решение</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">Проект</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">Имя файла</td>
<td nowrap="1" class="header" _locID="Status">Состояние</td>
<td nowrap="1" class="header" _locID="Errors">Ошибки</td>
<td nowrap="1" class="header" _locID="Warnings">Предупреждения</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="развернуть/свернуть секцию" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9"><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A> <xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">Преобразован</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">Преобразован</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">Отчет о преобразовании - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> файл(а, ов)</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 файл</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">Преобразован</a>: <xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR/>
<a _locID="NotConverted">Не преобразован</a>: <xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css"/>
<title _locID="ConversionReport0">Отчет о преобразовании
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">Отчет о преобразовании - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">Время преобразования:</b> <xsl:value-of select="Properties/Property[@Name='Date']/@Value"/> <xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">Параметры преобразования</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
_UpgradeReport_Files/UpgradeReport_Minus.gif

69 B

_UpgradeReport_Files/UpgradeReport_Plus.gif

71 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment