Skip to content
Snippets Groups Projects
Commit 7693acfc authored by Debolskiy Andrey's avatar Debolskiy Andrey :bicyclist_tone5:
Browse files

Merge branch 'anton' of http://tesla.parallel.ru/debol/MES_Wind

parents 14187956 ab97a53d
No related branches found
No related tags found
No related merge requests found
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 ...@@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MES_Wind", "MES_Wind\MES_Wind.csproj", "{A303A9F5-8181-46B5-876C-D1BC99C3FFFD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MES_Wind", "MES_Wind\MES_Wind.csproj", "{A303A9F5-8181-46B5-876C-D1BC99C3FFFD}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3BFCE63D-6DC2-4DC4-AAB9-72ECF2AC2EB5}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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 @@ ...@@ -124,6 +124,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<Compile Include="Interface.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
......
No preview for this file type
No preview for this file type
...@@ -287,6 +287,37 @@ namespace MES_Wind ...@@ -287,6 +287,37 @@ namespace MES_Wind
return rval; return rval;
} }
// so, we start at source power Point; actually call this foreach source point
public void checkPowerPoint(PowerPointObject sourcePoint)
{
if (!sourcePoint.powerIsON) {
// so we have source without power
MessageBox.Show("checkPowerPoint called with disabled source point");
return;
}
// 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) private void bntLoadWindX_Click(object sender, EventArgs e)
{ {
map1.AddLayer(); map1.AddLayer();
......
No preview for this file type
...@@ -197,3 +197,12 @@ C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.frmGraph.resources ...@@ -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.frmMain.resources
C:\MES_Wind\MES_Wind\obj\Debug\MES_Wind.Properties.Resources.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:\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