프로젝트

일반

사용자정보

개정판 c3d2e266

IDc3d2e2662a91c0ec3ad25e6ef66c508b2f7d50df
상위 2601c1ca
하위 f9e7a631

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : edit converter

Change-Id: Ib6f22a0d9b994efae4c840aab8d0d574d22a10b2

차이점 보기:

DTI_PID/BaseModel/App.config
15 15
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
16 16
    </providers>
17 17
  </entityFramework>
18
  <system.data>
18
  
19
<system.data>
19 20
    <DbProviderFactories>
20 21
      <remove invariant="System.Data.SQLite.EF6" />
21 22
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
22 23
    <remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
23
  </system.data>
24
</configuration>
24
  </system.data></configuration>
DTI_PID/BaseModel/BaseModel.csproj
60 60
    <Reference Include="System" />
61 61
    <Reference Include="System.ComponentModel.DataAnnotations" />
62 62
    <Reference Include="System.Core" />
63
    <Reference Include="System.Data.SQLite, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
64
      <HintPath>..\packages\System.Data.SQLite.Core.1.0.110.0\lib\net46\System.Data.SQLite.dll</HintPath>
63
    <Reference Include="System.Data.SQLite, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
64
      <HintPath>..\packages\System.Data.SQLite.Core.1.0.111.0\lib\net46\System.Data.SQLite.dll</HintPath>
65 65
    </Reference>
66
    <Reference Include="System.Data.SQLite.EF6, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
67
      <HintPath>..\packages\System.Data.SQLite.EF6.1.0.110.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
66
    <Reference Include="System.Data.SQLite.EF6, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
67
      <HintPath>..\packages\System.Data.SQLite.EF6.1.0.111.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
68 68
    </Reference>
69
    <Reference Include="System.Data.SQLite.Linq, Version=1.0.110.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
70
      <HintPath>..\packages\System.Data.SQLite.Linq.1.0.110.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
69
    <Reference Include="System.Data.SQLite.Linq, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
70
      <HintPath>..\packages\System.Data.SQLite.Linq.1.0.111.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
71 71
    </Reference>
72 72
    <Reference Include="System.Windows.Forms" />
73 73
    <Reference Include="System.Xml.Linq" />
......
105 105
    <None Include="packages.config" />
106 106
  </ItemGroup>
107 107
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
108
  <Import Project="..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets')" />
108
  <Import Project="..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets')" />
109 109
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
110 110
    <PropertyGroup>
111 111
      <ErrorText>이 프로젝트는 이 컴퓨터에 없는 NuGet 패키지를 참조합니다. 해당 패키지를 다운로드하려면 NuGet 패키지 복원을 사용하십시오. 자세한 내용은 http://go.microsoft.com/fwlink/?LinkID=322105를 참조하십시오. 누락된 파일은 {0}입니다.</ErrorText>
112 112
    </PropertyGroup>
113
    <Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.110.0\build\net46\System.Data.SQLite.Core.targets'))" />
113
    <Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets'))" />
114 114
  </Target>
115 115
</Project>
DTI_PID/BaseModel/Model/Document.cs
381 381
                {
382 382
                    if (element.Name == "SYMBOL")
383 383
                    {
384
                        run.RUNITEMS.Add(GetSymbolByUID(element.Element("UID").Value));
384
                        Symbol symbol = GetSymbolByUID(element.Element("UID").Value);
385
                        if (symbol == null)
386
                            throw new Exception(element.Element("UID").Value);
387
                        run.RUNITEMS.Add(symbol);
385 388
                    }
386 389
                    else if (element.Name == "LINE")
387 390
                    {
388
                        run.RUNITEMS.Add(GetLineByUID(element.Element("UID").Value));
391
                        Line line = GetLineByUID(element.Element("UID").Value);
392
                        if (line == null)
393
                            throw new Exception(element.Element("UID").Value);
394
                        run.RUNITEMS.Add(line);
389 395
                    }
390 396
                }
391 397
                lineNumberRuns.Add(run);
DTI_PID/BaseModel/packages.config
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<packages>
3 3
  <package id="EntityFramework" version="6.2.0" targetFramework="net46" />
4
  <package id="System.Data.SQLite" version="1.0.110.0" targetFramework="net46" />
5
  <package id="System.Data.SQLite.Core" version="1.0.110.0" targetFramework="net46" />
6
  <package id="System.Data.SQLite.EF6" version="1.0.110.0" targetFramework="net46" />
7
  <package id="System.Data.SQLite.Linq" version="1.0.110.0" targetFramework="net46" />
4
  <package id="System.Data.SQLite" version="1.0.111.0" targetFramework="net46" />
5
  <package id="System.Data.SQLite.Core" version="1.0.111.0" targetFramework="net46" />
6
  <package id="System.Data.SQLite.EF6" version="1.0.111.0" targetFramework="net46" />
7
  <package id="System.Data.SQLite.Linq" version="1.0.111.0" targetFramework="net46" />
8 8
</packages>
DTI_PID/SPPIDConverter/AutoModeling.cs
122 122
                    {
123 123
                        SPPIDSymbolInfo info = item.SPPID;
124 124
                        Array points = new double[] { 0, item.SPPID.ORIGINAL_X, item.SPPID.ORIGINAL_Y };
125
                        BaseModel.Attribute itemAttribute = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL");
126
                        if (itemAttribute == null)
127
                            continue;
125 128
                        string symbolUID = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "OWNERSYMBOL").VALUE;
126 129
                        object objectItem = SPPIDUtil.FindObjectByUID(document, symbolUID);
127 130
                        if (objectItem != null)
......
317 320

  
318 321
        private void SymbolModeling(Symbol symbol, Symbol targetSymbol, Symbol prevSymbol)
319 322
        {
323
            if (symbol.SPPID.MAPPINGNAME.Contains("Labels - "))
324
                return;
320 325
            if (!string.IsNullOrEmpty(symbol.SPPID.RepresentationId))
321 326
                return;
322 327

  
......
962 967
                
963 968
                if (targetLMConnector != null)
964 969
                {
970
                    //double[] point = connectorVertices[targetLMConnector][connectorVertices[targetLMConnector].Count - 1];
971
                    //Array array = new double[] { 0, point[0], point[1] };
965 972
                    Array array = new double[] { 0, endBreak.SPPID.ORIGINAL_X, endBreak.SPPID.ORIGINAL_Y };
966 973
                    _LmLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, Rotation: 0, LabeledItem: targetLMConnector.AsLMRepresentation(), IsLeaderVisible: true);
967 974
                }
......
1301 1308
                        }
1302 1309
                    }
1303 1310
                }
1311

  
1312

  
1313
            }
1314

  
1315
            if (targetConnector == null)
1316
            {
1317
                foreach (var item in connectorVertices)
1318
                {
1319
                    List<double[]> points = item.Value;
1320
                    foreach (var point in points)
1321
                    {
1322
                        double distance = SPPIDUtil.CalcPointToPointdDistance(connX, connY, point[0], point[1]);
1323
                        if (length >= distance)
1324
                        {
1325
                            targetConnector = item.Key;
1326
                            length = distance;
1327
                        }
1328
                    }
1329
                }
1330

  
1304 1331
            }
1305 1332

  
1306 1333
            return targetConnector;
......
1341 1368

  
1342 1369
                Array points = new double[] { 0, x, y };
1343 1370
                LMLabelPersist _LmLabelPresist = _placement.PIDPlaceLabel(lineNumber.SPPID.MAPPINGNAME, ref points, Rotation: lineNumber.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: false);
1344
                _LmLabelPresist.Commit();
1371
                
1345 1372

  
1346 1373
                foreach (var item in connectorVertices)
1347 1374
                    ReleaseCOMObjects(item.Key);
1348 1375
                if (_LmLabelPresist != null)
1349 1376
                {
1377
                    _LmLabelPresist.Commit();
1350 1378
                    lineNumber.SPPID.RepresentationId = _LmLabelPresist.AsLMRepresentation().Id;
1351 1379
                    ReleaseCOMObjects(_LmLabelPresist);
1352 1380
                }
1381
                else
1382
                {
1383

  
1384
                }
1353 1385
            }
1354 1386
        }
1355 1387

  
DTI_PID/SPPIDConverter/SPPIDConverter.csproj
196 196
    </EmbeddedResource>
197 197
  </ItemGroup>
198 198
  <ItemGroup>
199
    <ProjectReference Include="..\BaseModel\BaseModel.csproj">
200
      <Project>{beec4a21-bd63-40d2-b745-027b19241a70}</Project>
201
      <Name>BaseModel</Name>
202
    </ProjectReference>
203
  </ItemGroup>
204
  <ItemGroup>
205 199
    <COMReference Include="Llama">
206 200
      <Guid>{425D14E8-A0C1-4F4A-9FB8-4D7CA982F144}</Guid>
207 201
      <VersionMajor>6</VersionMajor>
......
295 289
  <ItemGroup>
296 290
    <None Include="Resources\actions_refresh.svg" />
297 291
  </ItemGroup>
292
  <ItemGroup>
293
    <ProjectReference Include="..\BaseModel\BaseModel.csproj">
294
      <Project>{beec4a21-bd63-40d2-b745-027b19241a70}</Project>
295
      <Name>BaseModel</Name>
296
    </ProjectReference>
297
  </ItemGroup>
298 298
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
299 299
</Project>
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs
107 107
            decimal tempDwgX = Convert.ToDecimal(dDwgX);
108 108
            decimal tempDwgY = Convert.ToDecimal(dDwgY);
109 109

  
110
            //calcX = (tempX * tempWidth) / tempDwgX;
111
            //calcX = Math.Truncate(calcX * 1000) / 1000;
112
            //calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
113
            //calcY = Math.Truncate(calcY * 1000) / 1000;
114
            //dX = Math.Round(Convert.ToDouble(calcX), 10);
115
            //dY = Math.Round(Convert.ToDouble(calcY), 10);
116

  
110 117
            calcX = (tempX * tempWidth) / tempDwgX;
111
            calcX = Math.Truncate(calcX * 1000) / 1000;
112 118
            calcY = tempHeight - ((tempY * tempHeight) / tempDwgY);
113
            calcY = Math.Truncate(calcY * 1000) / 1000;
114
            dX = Math.Round(Convert.ToDouble(calcX), 10);
115
            dY = Math.Round(Convert.ToDouble(calcY), 10);
119
            dX = Convert.ToDouble(calcX);
120
            dY = Convert.ToDouble(calcY);
116 121
        }
117 122

  
118 123
        public static SlopeType CalcSlope(double x1, double y1, double x2, double y2)
......
124 129
            else
125 130
            {
126 131
                double angle = Math.Atan(Math.Abs(y2 - y1) / Math.Abs(x2 - x1)) * 180 / Math.PI;
127
                if (angle <= 5)
132
                if (angle <= 2)
128 133
                    return SlopeType.HORIZONTAL;
129
                else if (angle >= 85)
134
                else if (angle >= 88)
130 135
                    return SlopeType.VERTICAL;
131 136
                else
132 137
                    return SlopeType.Slope;

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)