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

- add power objects interface

- added algorithm methods
parent 14187956
No related branches found
No related tags found
No related merge requests found
Showing
with 72 additions and 11 deletions
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; }
}
......@@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MES_Wind", "MES_Wind\MES_Wind.csproj", "{A303A9F5-8181-46B5-876C-D1BC99C3FFFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3BFCE63D-6DC2-4DC4-AAB9-72ECF2AC2EB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......
No preview for this file type
using System;
using System.Collections.Generic;
// these interfaces using for checkPowerPoint method in frmMain.cs
public interface PowerLineObject
{
PowerPointObject fromPoint{ get; }
PowerPointObject toPoint{ get; }
bool broken { get; }
}
public interface PowerPointObject
{
List<PowerLineObject> lines { get; }
bool powerIsON { get; set; }
}
......@@ -124,6 +124,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Interface.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
......
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
......@@ -287,6 +287,32 @@ namespace MES_Wind
return rval;
}
// so, we start at source power Point
public void checkPowerPoint(PowerPointObject sourcePoint)
{
// looking for unbroken lines and switch power for this point
foreach (PowerLineObject line in sourcePoint.lines) {
if (!line.broken && !line.toPoint.powerIsON) {
// switch power and check on subpoints.
line.toPoint.powerIsON = true;
checkPowerPoint(line.toPoint);
}
// else we have broken line or already switched power point
}
}
// find all disabled power points
public List<PowerPointObject> findDisabledPoints(List<PowerPointObject> pPoints)
{
List<PowerPointObject> result = new List<PowerPointObject>();
foreach (PowerPointObject point in pPoints) {
if (!point.powerIsON) {
// if disabled, we add it
result.Add(point);
}
}
return result;
}
private void bntLoadWindX_Click(object sender, EventArgs e)
{
map1.AddLayer();
......
No preview for this file type
......@@ -197,3 +197,12 @@ C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.frmGraph.resources
C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.frmMain.resources
C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.Properties.Resources.resources
C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.csproj.GenerateResource.Cache
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.exe
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.pdb
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.csprojResolveAssemblyReference.cache
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.frmGraph.resources
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.frmMain.resources
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.Properties.Resources.resources
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\obj\Debug\MES_Wind.csproj.GenerateResource.Cache
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\bin\Debug\MES_Wind.exe
C:\Users\Geophyslab-laptop\Documents\MES_Wind2\MES_Wind\bin\Debug\MES_Wind.pdb
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
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