Commit de8826297410f361f2d0e66e6ae4523739d76e24
1 parent
867826ac50
Exists in
master
RM2077: Edit source
Showing 11 changed files with 138 additions and 30 deletions Inline Diff
- sources/RoboforkApp.AWS/App.config
- sources/RoboforkApp.AWS/DynamoDb/DynamoService.cs
- sources/RoboforkApp.sln
- sources/RoboforkApp.v12.suo
- sources/RoboforkApp/Controls/DesignerCanvas.cs
- sources/RoboforkApp/Entities/Robofork15Demo.cs
- sources/RoboforkApp/RoboforkApp.csproj
- sources/RoboforkApp/RoboforkApp.csproj.user
- sources/RoboforkApp/RoboforkMenuView.xaml
- sources/RoboforkApp/RoboforkMenuView.xaml.cs
- sources/RoboforkApp/bin/Release/RboforkApp.vshost.exe
sources/RoboforkApp.AWS/App.config
| 1 | <?xml version="1.0"?> | 1 | <?xml version="1.0"?> |
| 2 | <configuration> | 2 | <configuration> |
| 3 | <appSettings> | 3 | <appSettings> |
| 4 | <add key="AWSProfileName" value="Development"/> | 4 | <add key="AWSProfileName" value="Development"/> |
| 5 | <add key="AWSRegion" value="ap-northeast-1" /> | 5 | <add key="AWSRegion" value="ap-northeast-1" /> |
| 6 | <add key="AWSAccessKey" value="AKIAI3CHRBBEA5I4WOMA"/> | ||
| 7 | <add key="AWSSecretKey" value="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"/> | ||
| 6 | </appSettings> | 8 | </appSettings> |
| 7 | <startup> | 9 | <startup> |
| 8 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | 10 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
| 9 | </startup> | 11 | </startup> |
| 10 | </configuration> | 12 | </configuration> |
| 11 | 13 |
sources/RoboforkApp.AWS/DynamoDb/DynamoService.cs
| 1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
| 2 | using Amazon.DynamoDBv2; | 2 | using Amazon.DynamoDBv2; |
| 3 | using Amazon.DynamoDBv2.DataModel; | 3 | using Amazon.DynamoDBv2.DataModel; |
| 4 | using RoboforkApp.AWS.Contracts; | 4 | using RoboforkApp.AWS.Contracts; |
| 5 | using Amazon; | ||
| 5 | 6 | ||
| 6 | namespace RoboforkApp.AWS.DynamoDb | 7 | namespace RoboforkApp.AWS.DynamoDb |
| 7 | { | 8 | { |
| 8 | public class DynamoService : ITableDataService | 9 | public class DynamoService : ITableDataService |
| 9 | { | 10 | { |
| 11 | const string AWS_ACCESS_KEY = "AKIAI3CHRBBEA5I4WOMA"; | ||
| 12 | const string AWS_SECRET_KEY = "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"; | ||
| 13 | |||
| 10 | public readonly DynamoDBContext DbContext; | 14 | public readonly DynamoDBContext DbContext; |
| 11 | public AmazonDynamoDBClient DynamoClient; | 15 | public AmazonDynamoDBClient DynamoClient; |
| 12 | 16 | ||
| 13 | public DynamoService() | 17 | public DynamoService() |
| 14 | { | 18 | { |
| 15 | DynamoClient = new AmazonDynamoDBClient(); | 19 | DynamoClient = new AmazonDynamoDBClient(AWS_ACCESS_KEY, AWS_SECRET_KEY, RegionEndpoint.APNortheast1); |
| 16 | 20 | ||
| 17 | DbContext = new DynamoDBContext(DynamoClient, new DynamoDBContextConfig | 21 | DbContext = new DynamoDBContext(DynamoClient, new DynamoDBContextConfig |
| 18 | { | 22 | { |
| 19 | //Setting the Consistent property to true ensures that you'll always get the latest | 23 | //Setting the Consistent property to true ensures that you'll always get the latest |
| 20 | ConsistentRead = true, | 24 | ConsistentRead = true, |
| 21 | SkipVersionCheck = true | 25 | SkipVersionCheck = true |
| 22 | }); | 26 | }); |
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | /// <summary> | 29 | /// <summary> |
| 26 | /// The Store method allows you to save a POCO to DynamoDb | 30 | /// The Store method allows you to save a POCO to DynamoDb |
| 27 | /// </summary> | 31 | /// </summary> |
| 28 | /// <typeparam name="T"></typeparam> | 32 | /// <typeparam name="T"></typeparam> |
| 29 | /// <param name="item"></param> | 33 | /// <param name="item"></param> |
| 30 | public void Store<T>(T item) where T : new() | 34 | public void Store<T>(T item) where T : new() |
| 31 | { | 35 | { |
| 32 | DbContext.Save(item); | 36 | DbContext.Save(item); |
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | /// <summary> | 39 | /// <summary> |
| 36 | /// The BatchStore Method allows you to store a list of items of type T to dynamoDb | 40 | /// The BatchStore Method allows you to store a list of items of type T to dynamoDb |
| 37 | /// </summary> | 41 | /// </summary> |
| 38 | /// <typeparam name="T"></typeparam> | 42 | /// <typeparam name="T"></typeparam> |
| 39 | /// <param name="items"></param> | 43 | /// <param name="items"></param> |
| 40 | public void BatchStore<T>(IEnumerable<T> items) where T : class | 44 | public void BatchStore<T>(IEnumerable<T> items) where T : class |
| 41 | { | 45 | { |
| 42 | var itemBatch = DbContext.CreateBatchWrite<T>(); | 46 | var itemBatch = DbContext.CreateBatchWrite<T>(); |
| 43 | 47 | ||
| 44 | foreach (var item in items) | 48 | foreach (var item in items) |
| 45 | { | 49 | { |
| 46 | itemBatch.AddPutItem(item); | 50 | itemBatch.AddPutItem(item); |
| 47 | } | 51 | } |
| 48 | 52 | ||
| 49 | itemBatch.Execute(); | 53 | itemBatch.Execute(); |
| 50 | } | 54 | } |
| 51 | /// <summary> | 55 | /// <summary> |
| 52 | /// Uses the scan operator to retrieve all items in a table | 56 | /// Uses the scan operator to retrieve all items in a table |
| 53 | /// <remarks>[CAUTION] This operation can be very expensive if your table is large</remarks> | 57 | /// <remarks>[CAUTION] This operation can be very expensive if your table is large</remarks> |
| 54 | /// </summary> | 58 | /// </summary> |
| 55 | /// <typeparam name="T"></typeparam> | 59 | /// <typeparam name="T"></typeparam> |
| 56 | /// <returns></returns> | 60 | /// <returns></returns> |
| 57 | public IEnumerable<T> GetAll<T>() where T : class | 61 | public IEnumerable<T> GetAll<T>() where T : class |
| 58 | { | 62 | { |
| 59 | IEnumerable<T> items = DbContext.Scan<T>(); | 63 | IEnumerable<T> items = DbContext.Scan<T>(); |
| 60 | return items; | 64 | return items; |
| 61 | } | 65 | } |
| 62 | 66 | ||
| 63 | /// <summary> | 67 | /// <summary> |
| 64 | /// Retrieves an item based on a search key | 68 | /// Retrieves an item based on a search key |
| 65 | /// </summary> | 69 | /// </summary> |
| 66 | /// <typeparam name="T"></typeparam> | 70 | /// <typeparam name="T"></typeparam> |
| 67 | /// <param name="key"></param> | 71 | /// <param name="key"></param> |
| 68 | /// <returns></returns> | 72 | /// <returns></returns> |
| 69 | public T GetItem<T>(string key) where T : class | 73 | public T GetItem<T>(string key) where T : class |
| 70 | { | 74 | { |
| 71 | return DbContext.Load<T>(key); | 75 | return DbContext.Load<T>(key); |
| 72 | } | 76 | } |
| 73 | 77 | ||
| 74 | /// <summary> | 78 | /// <summary> |
| 75 | /// Method Updates and existing item in the table | 79 | /// Method Updates and existing item in the table |
| 76 | /// </summary> | 80 | /// </summary> |
| 77 | /// <typeparam name="T"></typeparam> | 81 | /// <typeparam name="T"></typeparam> |
| 78 | /// <param name="item"></param> | 82 | /// <param name="item"></param> |
| 79 | public void UpdateItem<T>(T item) where T : class | 83 | public void UpdateItem<T>(T item) where T : class |
| 80 | { | 84 | { |
| 81 | T savedItem = DbContext.Load(item); | 85 | T savedItem = DbContext.Load(item); |
| 82 | 86 | ||
| 83 | if (savedItem == null) | 87 | if (savedItem == null) |
| 84 | { | 88 | { |
| 85 | throw new AmazonDynamoDBException("The item does not exist in the Table"); | 89 | throw new AmazonDynamoDBException("The item does not exist in the Table"); |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | DbContext.Save(item); | 92 | DbContext.Save(item); |
| 89 | } | 93 | } |
| 90 | 94 | ||
| 91 | /// <summary> | 95 | /// <summary> |
| 92 | /// Deletes an Item from the table. | 96 | /// Deletes an Item from the table. |
| 93 | /// </summary> | 97 | /// </summary> |
| 94 | /// <typeparam name="T"></typeparam> | 98 | /// <typeparam name="T"></typeparam> |
| 95 | /// <param name="item"></param> | 99 | /// <param name="item"></param> |
| 96 | public void DeleteItem<T>(T item) | 100 | public void DeleteItem<T>(T item) |
| 97 | { | 101 | { |
| 98 | var savedItem = DbContext.Load(item); | 102 | var savedItem = DbContext.Load(item); |
| 99 | 103 | ||
| 100 | if (savedItem == null) | 104 | if (savedItem == null) |
| 101 | { | 105 | { |
| 102 | throw new AmazonDynamoDBException("The item does not exist in the Table"); | 106 | throw new AmazonDynamoDBException("The item does not exist in the Table"); |
| 103 | } | 107 | } |
| 104 | 108 | ||
| 105 | DbContext.Delete(item); | 109 | DbContext.Delete(item); |
| 106 | } | 110 | } |
| 107 | 111 | ||
| 108 | } | 112 | } |
| 109 | } | 113 | } |
| 110 | 114 |
sources/RoboforkApp.sln
| 1 | | 1 | |
| 2 | Microsoft Visual Studio Solution File, Format Version 12.00 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 |
| 3 | # Visual Studio 2013 | 3 | # Visual Studio 2013 |
| 4 | VisualStudioVersion = 12.0.21005.1 | 4 | VisualStudioVersion = 12.0.21005.1 |
| 5 | MinimumVisualStudioVersion = 10.0.40219.1 | 5 | MinimumVisualStudioVersion = 10.0.40219.1 |
| 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboforkApp", "RoboforkApp\RoboforkApp.csproj", "{4946722F-CFFF-4FC6-B1C1-A6107316A58C}" | 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboforkApp", "RoboforkApp\RoboforkApp.csproj", "{4946722F-CFFF-4FC6-B1C1-A6107316A58C}" |
| 7 | EndProject | 7 | EndProject |
| 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboforkApp.AWS", "RoboforkApp.AWS\RoboforkApp.AWS.csproj", "{A4DB3A6A-7959-4517-844B-4D00AE09436C}" | ||
| 9 | EndProject | ||
| 8 | Global | 10 | Global |
| 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| 10 | Debug|Any CPU = Debug|Any CPU | 12 | Debug|Any CPU = Debug|Any CPU |
| 11 | Release|Any CPU = Release|Any CPU | 13 | Release|Any CPU = Release|Any CPU |
| 12 | EndGlobalSection | 14 | EndGlobalSection |
| 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
| 14 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 16 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| 15 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Debug|Any CPU.Build.0 = Debug|Any CPU | 17 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| 16 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Release|Any CPU.ActiveCfg = Release|Any CPU | 18 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| 17 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Release|Any CPU.Build.0 = Release|Any CPU | 19 | {4946722F-CFFF-4FC6-B1C1-A6107316A58C}.Release|Any CPU.Build.0 = Release|Any CPU |
| 20 | {A4DB3A6A-7959-4517-844B-4D00AE09436C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| 21 | {A4DB3A6A-7959-4517-844B-4D00AE09436C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| 22 | {A4DB3A6A-7959-4517-844B-4D00AE09436C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| 23 | {A4DB3A6A-7959-4517-844B-4D00AE09436C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| 18 | EndGlobalSection | 24 | EndGlobalSection |
| 19 | GlobalSection(SolutionProperties) = preSolution | 25 | GlobalSection(SolutionProperties) = preSolution |
| 20 | HideSolutionNode = FALSE | 26 | HideSolutionNode = FALSE |
| 21 | EndGlobalSection | 27 | EndGlobalSection |
| 22 | EndGlobal | 28 | EndGlobal |
| 23 | 29 |
sources/RoboforkApp.v12.suo
No preview for this file type
sources/RoboforkApp/Controls/DesignerCanvas.cs
| 1 | using RoboforkApp.DataModel; | 1 | using RoboforkApp.DataModel; |
| 2 | using RoboforkApp.Entities; | ||
| 3 | using RoboforkApp.Services; | ||
| 2 | using System; | 4 | using System; |
| 3 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
| 4 | using System.Linq; | 6 | using System.Linq; |
| 5 | using System.Windows; | 7 | using System.Windows; |
| 6 | using System.Windows.Controls; | 8 | using System.Windows.Controls; |
| 7 | using System.Windows.Documents; | 9 | using System.Windows.Documents; |
| 8 | using System.Windows.Input; | 10 | using System.Windows.Input; |
| 9 | using System.Windows.Markup; | 11 | using System.Windows.Markup; |
| 10 | using System.Windows.Media; | 12 | using System.Windows.Media; |
| 11 | using System.Windows.Shapes; | 13 | using System.Windows.Shapes; |
| 12 | using System.Xml; | 14 | using System.Xml; |
| 13 | 15 | ||
| 14 | namespace RoboforkApp | 16 | namespace RoboforkApp |
| 15 | { | 17 | { |
| 16 | public class DesignerCanvas : Canvas | 18 | public class DesignerCanvas : Canvas |
| 17 | { | 19 | { |
| 18 | const double RADIUS_NODE = 25d; //8d; | 20 | const double RADIUS_NODE = 25d; //8d; |
| 19 | const double RADIUS_CURVER_LINE = 130d; | 21 | const double RADIUS_CURVER_LINE = 130d; |
| 20 | const double DISTANCE_AUTO_NODES = 100d; | 22 | const double DISTANCE_AUTO_NODES = 100d; |
| 21 | const double DISTANCE_START_NODES = 30d; | 23 | const double DISTANCE_START_NODES = 30d; |
| 22 | const double DISTANCE_END_NODES = 30d; | 24 | const double DISTANCE_END_NODES = 30d; |
| 23 | const double DISTANCE_FREE_NODES = 40d; | 25 | const double DISTANCE_FREE_NODES = 40d; |
| 24 | const double STROKE_ROOT_LINE = 6d; | 26 | const double STROKE_ROOT_LINE = 6d; |
| 25 | const double STROKE_LINE = 4d; | 27 | const double STROKE_LINE = 4d; |
| 26 | const double STROKE_NODE = 1d; | 28 | const double STROKE_NODE = 1d; |
| 27 | const double DISTANCE_RATIO = 100; | 29 | const double DISTANCE_RATIO = 100; |
| 28 | 30 | ||
| 29 | const double UCNODE_SETLEFT = 17; | 31 | const double UCNODE_SETLEFT = 17; |
| 30 | const double UCNODE_SETTOP = 17; | 32 | const double UCNODE_SETTOP = 17; |
| 31 | const double UCNODE_WIDTH = 34; | 33 | const double UCNODE_WIDTH = 34; |
| 32 | const double UCNODE_HEIGHT = 34; | 34 | const double UCNODE_HEIGHT = 34; |
| 33 | 35 | ||
| 34 | private List<Rectangle> shapeList = new List<Rectangle>(); | 36 | private List<Rectangle> shapeList = new List<Rectangle>(); |
| 35 | private TextBlock shapePosIndicator; | 37 | private TextBlock shapePosIndicator; |
| 36 | private TextBlock shapeSizeIndicator; | 38 | private TextBlock shapeSizeIndicator; |
| 37 | private int currentLine; | 39 | private int currentLine; |
| 38 | private ucStartEndButton _startPoint; | 40 | private ucStartEndButton _startPoint; |
| 39 | private ucNode _ucNodeFree; | 41 | private ucNode _ucNodeFree; |
| 40 | private ucStartEndButton _goalPoint; | 42 | private ucStartEndButton _goalPoint; |
| 41 | private ucDisplayCoordinate _displayAxiPosition; | 43 | private ucDisplayCoordinate _displayAxiPosition; |
| 42 | 44 | ||
| 43 | // Add variable for draw route | 45 | // Add variable for draw route |
| 44 | public Path pLine = new Path(); | 46 | public Path pLine = new Path(); |
| 45 | public Path pRootLine = new Path(); | 47 | public Path pRootLine = new Path(); |
| 46 | public Path pCurverLine = new Path(); | 48 | public Path pCurverLine = new Path(); |
| 47 | public Path pRedNode = new Path(); | 49 | public Path pRedNode = new Path(); |
| 48 | public Path pYellowNode = new Path(); | 50 | public Path pYellowNode = new Path(); |
| 49 | public GeometryGroup gGrpLine = new GeometryGroup(); | 51 | public GeometryGroup gGrpLine = new GeometryGroup(); |
| 50 | public GeometryGroup gGrpRootLine = new GeometryGroup(); | 52 | public GeometryGroup gGrpRootLine = new GeometryGroup(); |
| 51 | public GeometryGroup gGrpCurverLine = new GeometryGroup(); | 53 | public GeometryGroup gGrpCurverLine = new GeometryGroup(); |
| 52 | public GeometryGroup gGrpRedNode = new GeometryGroup(); | 54 | public GeometryGroup gGrpRedNode = new GeometryGroup(); |
| 53 | public GeometryGroup gGrpYellowNode = new GeometryGroup(); | 55 | public GeometryGroup gGrpYellowNode = new GeometryGroup(); |
| 54 | public int currentShape; | 56 | public int currentShape; |
| 55 | public static bool isStartDrawRoute = false; | 57 | public static bool isStartDrawRoute = false; |
| 56 | public static bool isGoalDrawRoute = false; | 58 | public static bool isGoalDrawRoute = false; |
| 57 | 59 | ||
| 58 | public struct NodeInfo | 60 | public struct NodeInfo |
| 59 | { | 61 | { |
| 60 | public double X; | 62 | public double X; |
| 61 | public double Y; | 63 | public double Y; |
| 62 | public String Mode1; | 64 | public String Mode1; |
| 63 | public String Mode2; | 65 | public String Mode2; |
| 64 | public String Mode3; | 66 | public String Mode3; |
| 65 | } | 67 | } |
| 66 | List<NodeInfo> NodeInfo_List = new List<NodeInfo>(); | 68 | List<NodeInfo> NodeInfo_List = new List<NodeInfo>(); |
| 67 | 69 | ||
| 68 | // Add variable for Set Schedule | 70 | // Add variable for Set Schedule |
| 69 | public Path pScheduleNode = new Path(); | 71 | public Path pScheduleNode = new Path(); |
| 70 | public Path pScheduleLine = new Path(); | 72 | public Path pScheduleLine = new Path(); |
| 71 | public GeometryGroup gGrpScheduleNode = new GeometryGroup(); | 73 | public GeometryGroup gGrpScheduleNode = new GeometryGroup(); |
| 72 | public GeometryGroup gGrpScheduleLine = new GeometryGroup(); | 74 | public GeometryGroup gGrpScheduleLine = new GeometryGroup(); |
| 73 | 75 | ||
| 74 | public static bool EditNodeFlag = false; | 76 | public static bool EditNodeFlag = false; |
| 75 | public static bool DragDeltaFlag = false; | 77 | public static bool DragDeltaFlag = false; |
| 76 | 78 | ||
| 77 | //Add variable for Vehicle Item click | 79 | //Add variable for Vehicle Item click |
| 78 | public string VehicleItem = "FK_15"; | 80 | public string VehicleItem = "FK_15"; |
| 79 | public VehicleModel VehicleModel = new VehicleModel(); | 81 | public VehicleModel VehicleModel = new VehicleModel(); |
| 80 | public int VehicleIndex = 0; | 82 | public int VehicleIndex = 0; |
| 81 | public string ColorNode_Add = "Blue"; | 83 | public string ColorNode_Add = "Blue"; |
| 82 | public string ColorNode_Insert = "Brown"; | 84 | public string ColorNode_Insert = "Brown"; |
| 83 | 85 | ||
| 84 | //2017/03/04 NAM ADD START | 86 | //2017/03/04 NAM ADD START |
| 85 | public static bool isDrawingNode = false; | 87 | public static bool isDrawingNode = false; |
| 86 | public static bool isDragNode = false; | 88 | public static bool isDragNode = false; |
| 87 | public Path pNewLine = new Path(); | 89 | public Path pNewLine = new Path(); |
| 88 | public GeometryGroup gGrpNewLine = new GeometryGroup(); | 90 | public GeometryGroup gGrpNewLine = new GeometryGroup(); |
| 89 | 91 | ||
| 90 | public struct NewNodeInfo | 92 | public struct NewNodeInfo |
| 91 | { | 93 | { |
| 92 | public double X; | 94 | public double X; |
| 93 | public double Y; | 95 | public double Y; |
| 94 | public String Mode; | 96 | public String Mode; |
| 95 | } | 97 | } |
| 96 | List<NewNodeInfo> NewNodeInfo_List = new List<NewNodeInfo>(); | 98 | List<NewNodeInfo> NewNodeInfo_List = new List<NewNodeInfo>(); |
| 97 | 99 | ||
| 98 | //List Node's Info | 100 | //List Node's Info |
| 99 | List<Node_tmp> Lst_Node_tmp = new List<Node_tmp>(); | 101 | List<Node_tmp> Lst_Node_tmp = new List<Node_tmp>(); |
| 100 | 102 | ||
| 101 | 103 | ||
| 102 | 104 | ||
| 103 | 105 | ||
| 104 | List<TextBlock> NodeNo = new List<TextBlock>(); | 106 | List<TextBlock> NodeNo = new List<TextBlock>(); |
| 105 | List<ucNode> ucNode_Lst = new List<ucNode>(); | 107 | List<ucNode> ucNode_Lst = new List<ucNode>(); |
| 106 | public List<ucNode> ucScheduleNode_Lst = new List<ucNode>(); | 108 | public List<ucNode> ucScheduleNode_Lst = new List<ucNode>(); |
| 107 | int stt = 1; | 109 | int stt = 1; |
| 108 | //2017/03/04 NAM ADD END | 110 | //2017/03/04 NAM ADD END |
| 109 | public struct ListIndexNodeInsert | 111 | public struct ListIndexNodeInsert |
| 110 | { | 112 | { |
| 111 | public double X; | 113 | public double X; |
| 112 | public double Y; | 114 | public double Y; |
| 113 | } | 115 | } |
| 114 | List<ListIndexNodeInsert> IndexNodeInsert_List = new List<ListIndexNodeInsert>(); | 116 | List<ListIndexNodeInsert> IndexNodeInsert_List = new List<ListIndexNodeInsert>(); |
| 115 | 117 | ||
| 116 | 118 | ||
| 117 | public ScheduleCanvas scheduleCanvas = new ScheduleCanvas(); | 119 | public ScheduleCanvas scheduleCanvas = new ScheduleCanvas(); |
| 118 | 120 | ||
| 119 | // Add variable for Set Auto Nodes | 121 | // Add variable for Set Auto Nodes |
| 120 | public Path pBlueNode = new Path(); | 122 | public Path pBlueNode = new Path(); |
| 121 | private GeometryGroup gGrpBlueNode = new GeometryGroup(); | 123 | private GeometryGroup gGrpBlueNode = new GeometryGroup(); |
| 122 | 124 | ||
| 123 | // Add variable for Set Free Nodes | 125 | // Add variable for Set Free Nodes |
| 124 | public Path pFreeNode = new Path(); | 126 | public Path pFreeNode = new Path(); |
| 125 | //private GeometryGroup gGrpFreeNode = new GeometryGroup(); | 127 | //private GeometryGroup gGrpFreeNode = new GeometryGroup(); |
| 126 | 128 | ||
| 127 | // The part of the rectangle the mouse is over. | 129 | // The part of the rectangle the mouse is over. |
| 128 | private enum HitType | 130 | private enum HitType |
| 129 | { | 131 | { |
| 130 | None, Body, UL, UR, LR, LL, L, R, T, B | 132 | None, Body, UL, UR, LR, LL, L, R, T, B |
| 131 | }; | 133 | }; |
| 132 | public enum OperationState | 134 | public enum OperationState |
| 133 | { | 135 | { |
| 134 | None, DrawObstract, DrawRoute, DrawSetFreeNode, EditNode, NewDrawSetFreeNode | 136 | None, DrawObstract, DrawRoute, DrawSetFreeNode, EditNode, NewDrawSetFreeNode |
| 135 | }; | 137 | }; |
| 136 | public enum MouseState | 138 | public enum MouseState |
| 137 | { | 139 | { |
| 138 | None, Draw, Drag, | 140 | None, Draw, Drag, |
| 139 | } | 141 | } |
| 140 | public OperationState Operation = OperationState.None; | 142 | public OperationState Operation = OperationState.None; |
| 141 | public MouseState mouseState = MouseState.None; | 143 | public MouseState mouseState = MouseState.None; |
| 142 | 144 | ||
| 143 | // The draw start point. | 145 | // The draw start point. |
| 144 | private Point StartDrawPoint; | 146 | private Point StartDrawPoint; |
| 145 | 147 | ||
| 146 | // The drag's last point. | 148 | // The drag's last point. |
| 147 | private Point LastPoint; | 149 | private Point LastPoint; |
| 148 | 150 | ||
| 149 | // The part of the rectangle under the mouse. | 151 | // The part of the rectangle under the mouse. |
| 150 | HitType MouseHitType = HitType.None; | 152 | HitType MouseHitType = HitType.None; |
| 151 | 153 | ||
| 152 | public void Init() | 154 | public void Init() |
| 153 | { | 155 | { |
| 154 | if (shapePosIndicator == null) | 156 | if (shapePosIndicator == null) |
| 155 | { | 157 | { |
| 156 | shapePosIndicator = new TextBlock() | 158 | shapePosIndicator = new TextBlock() |
| 157 | { | 159 | { |
| 158 | Foreground = Brushes.Black, | 160 | Foreground = Brushes.Black, |
| 159 | Background = Brushes.Transparent, | 161 | Background = Brushes.Transparent, |
| 160 | FontSize = 20, | 162 | FontSize = 20, |
| 161 | }; | 163 | }; |
| 162 | } | 164 | } |
| 163 | if (shapeSizeIndicator == null) | 165 | if (shapeSizeIndicator == null) |
| 164 | { | 166 | { |
| 165 | shapeSizeIndicator = new TextBlock() | 167 | shapeSizeIndicator = new TextBlock() |
| 166 | { | 168 | { |
| 167 | Foreground = Brushes.Black, | 169 | Foreground = Brushes.Black, |
| 168 | Background = Brushes.Transparent, | 170 | Background = Brushes.Transparent, |
| 169 | FontSize = 20, | 171 | FontSize = 20, |
| 170 | }; | 172 | }; |
| 171 | } | 173 | } |
| 172 | } | 174 | } |
| 173 | 175 | ||
| 174 | // Return a HitType value to indicate what is at the point. | 176 | // Return a HitType value to indicate what is at the point. |
| 175 | private HitType SetHitType(Point point) | 177 | private HitType SetHitType(Point point) |
| 176 | { | 178 | { |
| 177 | if (shapeList.Count == 0) | 179 | if (shapeList.Count == 0) |
| 178 | { | 180 | { |
| 179 | currentShape = 0; | 181 | currentShape = 0; |
| 180 | return HitType.None; | 182 | return HitType.None; |
| 181 | } | 183 | } |
| 182 | for (int i = 0; i < shapeList.Count; i++) | 184 | for (int i = 0; i < shapeList.Count; i++) |
| 183 | { | 185 | { |
| 184 | Rectangle rect = shapeList[i]; | 186 | Rectangle rect = shapeList[i]; |
| 185 | double left = Canvas.GetLeft(rect); | 187 | double left = Canvas.GetLeft(rect); |
| 186 | double top = Canvas.GetTop(rect); | 188 | double top = Canvas.GetTop(rect); |
| 187 | double right = left + rect.Width; | 189 | double right = left + rect.Width; |
| 188 | double bottom = top + rect.Height; | 190 | double bottom = top + rect.Height; |
| 189 | if (point.X < left) continue; | 191 | if (point.X < left) continue; |
| 190 | if (point.X > right) continue; | 192 | if (point.X > right) continue; |
| 191 | if (point.Y < top) continue; | 193 | if (point.Y < top) continue; |
| 192 | if (point.Y > bottom) continue; | 194 | if (point.Y > bottom) continue; |
| 193 | currentShape = i; | 195 | currentShape = i; |
| 194 | 196 | ||
| 195 | const double GAP = 10; | 197 | const double GAP = 10; |
| 196 | if (point.X - left < GAP) | 198 | if (point.X - left < GAP) |
| 197 | { | 199 | { |
| 198 | // Left edge. | 200 | // Left edge. |
| 199 | if (point.Y - top < GAP) return HitType.UL; | 201 | if (point.Y - top < GAP) return HitType.UL; |
| 200 | if (bottom - point.Y < GAP) return HitType.LL; | 202 | if (bottom - point.Y < GAP) return HitType.LL; |
| 201 | return HitType.L; | 203 | return HitType.L; |
| 202 | } | 204 | } |
| 203 | if (right - point.X < GAP) | 205 | if (right - point.X < GAP) |
| 204 | { | 206 | { |
| 205 | // Right edge. | 207 | // Right edge. |
| 206 | if (point.Y - top < GAP) return HitType.UR; | 208 | if (point.Y - top < GAP) return HitType.UR; |
| 207 | if (bottom - point.Y < GAP) return HitType.LR; | 209 | if (bottom - point.Y < GAP) return HitType.LR; |
| 208 | return HitType.R; | 210 | return HitType.R; |
| 209 | } | 211 | } |
| 210 | if (point.Y - top < GAP) return HitType.T; | 212 | if (point.Y - top < GAP) return HitType.T; |
| 211 | if (bottom - point.Y < GAP) return HitType.B; | 213 | if (bottom - point.Y < GAP) return HitType.B; |
| 212 | return HitType.Body; | 214 | return HitType.Body; |
| 213 | } | 215 | } |
| 214 | currentShape = 0; | 216 | currentShape = 0; |
| 215 | return HitType.None; | 217 | return HitType.None; |
| 216 | } | 218 | } |
| 217 | 219 | ||
| 218 | // Set a mouse cursor appropriate for the current hit type. | 220 | // Set a mouse cursor appropriate for the current hit type. |
| 219 | private void SetMouseCursor() | 221 | private void SetMouseCursor() |
| 220 | { | 222 | { |
| 221 | // See what cursor we should display. | 223 | // See what cursor we should display. |
| 222 | Cursor desired_cursor = Cursors.Arrow; | 224 | Cursor desired_cursor = Cursors.Arrow; |
| 223 | switch (MouseHitType) | 225 | switch (MouseHitType) |
| 224 | { | 226 | { |
| 225 | case HitType.None: | 227 | case HitType.None: |
| 226 | desired_cursor = Cursors.Arrow; | 228 | desired_cursor = Cursors.Arrow; |
| 227 | break; | 229 | break; |
| 228 | case HitType.Body: | 230 | case HitType.Body: |
| 229 | desired_cursor = Cursors.ScrollAll; | 231 | desired_cursor = Cursors.ScrollAll; |
| 230 | break; | 232 | break; |
| 231 | case HitType.UL: | 233 | case HitType.UL: |
| 232 | case HitType.LR: | 234 | case HitType.LR: |
| 233 | desired_cursor = Cursors.SizeNWSE; | 235 | desired_cursor = Cursors.SizeNWSE; |
| 234 | break; | 236 | break; |
| 235 | case HitType.LL: | 237 | case HitType.LL: |
| 236 | case HitType.UR: | 238 | case HitType.UR: |
| 237 | desired_cursor = Cursors.SizeNESW; | 239 | desired_cursor = Cursors.SizeNESW; |
| 238 | break; | 240 | break; |
| 239 | case HitType.T: | 241 | case HitType.T: |
| 240 | case HitType.B: | 242 | case HitType.B: |
| 241 | desired_cursor = Cursors.SizeNS; | 243 | desired_cursor = Cursors.SizeNS; |
| 242 | break; | 244 | break; |
| 243 | case HitType.L: | 245 | case HitType.L: |
| 244 | case HitType.R: | 246 | case HitType.R: |
| 245 | desired_cursor = Cursors.SizeWE; | 247 | desired_cursor = Cursors.SizeWE; |
| 246 | break; | 248 | break; |
| 247 | } | 249 | } |
| 248 | 250 | ||
| 249 | // Display the desired cursor. | 251 | // Display the desired cursor. |
| 250 | if (Cursor != desired_cursor) Cursor = desired_cursor; | 252 | if (Cursor != desired_cursor) Cursor = desired_cursor; |
| 251 | } | 253 | } |
| 252 | 254 | ||
| 253 | // constance | 255 | // constance |
| 254 | int indicatorAligment = 2; | 256 | int indicatorAligment = 2; |
| 255 | 257 | ||
| 256 | /* | 258 | /* |
| 257 | private Point? dragStartPoint = null; | 259 | private Point? dragStartPoint = null; |
| 258 | 260 | ||
| 259 | */ | 261 | */ |
| 260 | public IEnumerable<DesignerItem> SelectedItems | 262 | public IEnumerable<DesignerItem> SelectedItems |
| 261 | { | 263 | { |
| 262 | get | 264 | get |
| 263 | { | 265 | { |
| 264 | var selectedItems = from item in this.Children.OfType<DesignerItem>() | 266 | var selectedItems = from item in this.Children.OfType<DesignerItem>() |
| 265 | where item.IsSelected == true | 267 | where item.IsSelected == true |
| 266 | select item; | 268 | select item; |
| 267 | 269 | ||
| 268 | return selectedItems; | 270 | return selectedItems; |
| 269 | } | 271 | } |
| 270 | } | 272 | } |
| 271 | 273 | ||
| 272 | public void DeselectAll() | 274 | public void DeselectAll() |
| 273 | { | 275 | { |
| 274 | /* | 276 | /* |
| 275 | foreach (DesignerItem item in this.SelectedItems) | 277 | foreach (DesignerItem item in this.SelectedItems) |
| 276 | { | 278 | { |
| 277 | item.IsSelected = false; | 279 | item.IsSelected = false; |
| 278 | }*/ | 280 | }*/ |
| 279 | } | 281 | } |
| 280 | 282 | ||
| 281 | protected override void OnMouseDown(MouseButtonEventArgs e) | 283 | protected override void OnMouseDown(MouseButtonEventArgs e) |
| 282 | { | 284 | { |
| 283 | base.OnMouseDown(e); | 285 | base.OnMouseDown(e); |
| 284 | 286 | ||
| 285 | MouseHitType = SetHitType(Mouse.GetPosition(this)); | 287 | MouseHitType = SetHitType(Mouse.GetPosition(this)); |
| 286 | SetMouseCursor(); | 288 | SetMouseCursor(); |
| 287 | 289 | ||
| 288 | if (Operation == OperationState.DrawRoute && isStartDrawRoute) | 290 | if (Operation == OperationState.DrawRoute && isStartDrawRoute) |
| 289 | { | 291 | { |
| 290 | if (isGoalDrawRoute) | 292 | if (isGoalDrawRoute) |
| 291 | { | 293 | { |
| 292 | return; | 294 | return; |
| 293 | } | 295 | } |
| 294 | 296 | ||
| 295 | // Check state draw | 297 | // Check state draw |
| 296 | if (MouseHitType == HitType.None) | 298 | if (MouseHitType == HitType.None) |
| 297 | { | 299 | { |
| 298 | if (gGrpLine.Children.Count == 1) | 300 | if (gGrpLine.Children.Count == 1) |
| 299 | { | 301 | { |
| 300 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[0]; | 302 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[0]; |
| 301 | lineGeometry.EndPoint = LastPoint; | 303 | lineGeometry.EndPoint = LastPoint; |
| 302 | 304 | ||
| 303 | // Check end route | 305 | // Check end route |
| 304 | if (IsEndRoute(_goalPoint, lineGeometry)) | 306 | if (IsEndRoute(_goalPoint, lineGeometry)) |
| 305 | { | 307 | { |
| 306 | isGoalDrawRoute = true; | 308 | isGoalDrawRoute = true; |
| 307 | ProcessEndRoute(); | 309 | ProcessEndRoute(); |
| 308 | return; | 310 | return; |
| 309 | } | 311 | } |
| 310 | } | 312 | } |
| 311 | else if (IsCurverNode((LineGeometry)gGrpLine.Children[currentLine - 1] | 313 | else if (IsCurverNode((LineGeometry)gGrpLine.Children[currentLine - 1] |
| 312 | , (LineGeometry)gGrpLine.Children[currentLine])) | 314 | , (LineGeometry)gGrpLine.Children[currentLine])) |
| 313 | { | 315 | { |
| 314 | // Set end point to finish draw line | 316 | // Set end point to finish draw line |
| 315 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine]; | 317 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine]; |
| 316 | lineGeometry.EndPoint = LastPoint; | 318 | lineGeometry.EndPoint = LastPoint; |
| 317 | 319 | ||
| 318 | // Add node to curver postion | 320 | // Add node to curver postion |
| 319 | AddNode(lineGeometry.StartPoint, gGrpRedNode); | 321 | AddNode(lineGeometry.StartPoint, gGrpRedNode); |
| 320 | 322 | ||
| 321 | // Check end route | 323 | // Check end route |
| 322 | if (IsEndRoute(_goalPoint, lineGeometry)) | 324 | if (IsEndRoute(_goalPoint, lineGeometry)) |
| 323 | { | 325 | { |
| 324 | isGoalDrawRoute = true; | 326 | isGoalDrawRoute = true; |
| 325 | ProcessEndRoute(); | 327 | ProcessEndRoute(); |
| 326 | return; | 328 | return; |
| 327 | } | 329 | } |
| 328 | } | 330 | } |
| 329 | else | 331 | else |
| 330 | { | 332 | { |
| 331 | // Remove current line | 333 | // Remove current line |
| 332 | gGrpLine.Children.RemoveAt(currentLine); | 334 | gGrpLine.Children.RemoveAt(currentLine); |
| 333 | 335 | ||
| 334 | // Set end point to finish draw line | 336 | // Set end point to finish draw line |
| 335 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine - 1]; | 337 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine - 1]; |
| 336 | lineGeometry.EndPoint = LastPoint; | 338 | lineGeometry.EndPoint = LastPoint; |
| 337 | 339 | ||
| 338 | // Check end route | 340 | // Check end route |
| 339 | if (IsEndRoute(_goalPoint, lineGeometry)) | 341 | if (IsEndRoute(_goalPoint, lineGeometry)) |
| 340 | { | 342 | { |
| 341 | isGoalDrawRoute = true; | 343 | isGoalDrawRoute = true; |
| 342 | ProcessEndRoute(); | 344 | ProcessEndRoute(); |
| 343 | return; | 345 | return; |
| 344 | } | 346 | } |
| 345 | } | 347 | } |
| 346 | 348 | ||
| 347 | // Draw new line | 349 | // Draw new line |
| 348 | DrawLine(LastPoint, LastPoint, gGrpLine); | 350 | DrawLine(LastPoint, LastPoint, gGrpLine); |
| 349 | // Setting start point for new line | 351 | // Setting start point for new line |
| 350 | StartDrawPoint = LastPoint; | 352 | StartDrawPoint = LastPoint; |
| 351 | 353 | ||
| 352 | mouseState = MouseState.Draw; | 354 | mouseState = MouseState.Draw; |
| 353 | currentLine = gGrpLine.Children.Count - 1; | 355 | currentLine = gGrpLine.Children.Count - 1; |
| 354 | return; | 356 | return; |
| 355 | } | 357 | } |
| 356 | } | 358 | } |
| 357 | else if (Operation == OperationState.DrawSetFreeNode) | 359 | else if (Operation == OperationState.DrawSetFreeNode) |
| 358 | { | 360 | { |
| 359 | bool RightClick = false; | 361 | bool RightClick = false; |
| 360 | if (IsStopDrawRoute(e)) | 362 | if (IsStopDrawRoute(e)) |
| 361 | RightClick = true; | 363 | RightClick = true; |
| 362 | 364 | ||
| 363 | StartDrawPoint = e.MouseDevice.GetPosition(this); | 365 | StartDrawPoint = e.MouseDevice.GetPosition(this); |
| 364 | 366 | ||
| 365 | SetFreeNodes(StartDrawPoint, RightClick); | 367 | SetFreeNodes(StartDrawPoint, RightClick); |
| 366 | } | 368 | } |
| 367 | 369 | ||
| 368 | else if (Operation == OperationState.EditNode) | 370 | else if (Operation == OperationState.EditNode) |
| 369 | { | 371 | { |
| 370 | Point node_edited = e.MouseDevice.GetPosition(this); | 372 | Point node_edited = e.MouseDevice.GetPosition(this); |
| 371 | 373 | ||
| 372 | // start Edit Node Infor | 374 | // start Edit Node Infor |
| 373 | EditNode(node_edited); | 375 | EditNode(node_edited); |
| 374 | 376 | ||
| 375 | } | 377 | } |
| 376 | else if (Operation == OperationState.DrawObstract) | 378 | else if (Operation == OperationState.DrawObstract) |
| 377 | { | 379 | { |
| 378 | if (MouseHitType == HitType.None) | 380 | if (MouseHitType == HitType.None) |
| 379 | { | 381 | { |
| 380 | Rectangle shape = new Rectangle(); | 382 | Rectangle shape = new Rectangle(); |
| 381 | shape.Width = 1; | 383 | shape.Width = 1; |
| 382 | shape.Height = 1; | 384 | shape.Height = 1; |
| 383 | // Create a SolidColorBrush and use it to | 385 | // Create a SolidColorBrush and use it to |
| 384 | // paint the rectangle. | 386 | // paint the rectangle. |
| 385 | shape.Stroke = Brushes.Blue; | 387 | shape.Stroke = Brushes.Blue; |
| 386 | shape.StrokeThickness = 1; | 388 | shape.StrokeThickness = 1; |
| 387 | shape.Fill = new SolidColorBrush(Colors.LightCyan); | 389 | shape.Fill = new SolidColorBrush(Colors.LightCyan); |
| 388 | StartDrawPoint = e.MouseDevice.GetPosition(this); | 390 | StartDrawPoint = e.MouseDevice.GetPosition(this); |
| 389 | shape.SetValue(Canvas.LeftProperty, StartDrawPoint.X); | 391 | shape.SetValue(Canvas.LeftProperty, StartDrawPoint.X); |
| 390 | shape.SetValue(Canvas.TopProperty, StartDrawPoint.Y); | 392 | shape.SetValue(Canvas.TopProperty, StartDrawPoint.Y); |
| 391 | this.Children.Add(shape); | 393 | this.Children.Add(shape); |
| 392 | shapeList.Add(shape); | 394 | shapeList.Add(shape); |
| 393 | 395 | ||
| 394 | mouseState = MouseState.Draw; | 396 | mouseState = MouseState.Draw; |
| 395 | currentShape = shapeList.Count() - 1; | 397 | currentShape = shapeList.Count() - 1; |
| 396 | 398 | ||
| 397 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); | 399 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); |
| 398 | double shapeY = Canvas.GetTop(shapeList[currentShape]); | 400 | double shapeY = Canvas.GetTop(shapeList[currentShape]); |
| 399 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; | 401 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; |
| 400 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); | 402 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); |
| 401 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); | 403 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); |
| 402 | 404 | ||
| 403 | double width = (int)shapeList[currentShape].Width; | 405 | double width = (int)shapeList[currentShape].Width; |
| 404 | double height = (int)shapeList[currentShape].Height; | 406 | double height = (int)shapeList[currentShape].Height; |
| 405 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; | 407 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; |
| 406 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); | 408 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); |
| 407 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); | 409 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); |
| 408 | 410 | ||
| 409 | this.Children.Add(shapePosIndicator); | 411 | this.Children.Add(shapePosIndicator); |
| 410 | this.Children.Add(shapeSizeIndicator); | 412 | this.Children.Add(shapeSizeIndicator); |
| 411 | 413 | ||
| 412 | 414 | ||
| 413 | return; | 415 | return; |
| 414 | } | 416 | } |
| 415 | else | 417 | else |
| 416 | { | 418 | { |
| 417 | if (shapeList.Count() != 0) | 419 | if (shapeList.Count() != 0) |
| 418 | shapeList[currentShape].Fill = new SolidColorBrush(Colors.LightCyan); | 420 | shapeList[currentShape].Fill = new SolidColorBrush(Colors.LightCyan); |
| 419 | 421 | ||
| 420 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); | 422 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); |
| 421 | double shapeY = Canvas.GetTop(shapeList[currentShape]); | 423 | double shapeY = Canvas.GetTop(shapeList[currentShape]); |
| 422 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; | 424 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; |
| 423 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); | 425 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); |
| 424 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); | 426 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); |
| 425 | 427 | ||
| 426 | double width = (int)shapeList[currentShape].Width; | 428 | double width = (int)shapeList[currentShape].Width; |
| 427 | double height = (int)shapeList[currentShape].Height; | 429 | double height = (int)shapeList[currentShape].Height; |
| 428 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; | 430 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; |
| 429 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); | 431 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); |
| 430 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); | 432 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); |
| 431 | 433 | ||
| 432 | this.Children.Add(shapePosIndicator); | 434 | this.Children.Add(shapePosIndicator); |
| 433 | this.Children.Add(shapeSizeIndicator); | 435 | this.Children.Add(shapeSizeIndicator); |
| 434 | } | 436 | } |
| 435 | 437 | ||
| 436 | LastPoint = Mouse.GetPosition(this); | 438 | LastPoint = Mouse.GetPosition(this); |
| 437 | mouseState = MouseState.Drag; | 439 | mouseState = MouseState.Drag; |
| 438 | } | 440 | } |
| 439 | e.Handled = true; | 441 | e.Handled = true; |
| 440 | } | 442 | } |
| 441 | 443 | ||
| 442 | protected override void OnMouseMove(MouseEventArgs e) | 444 | protected override void OnMouseMove(MouseEventArgs e) |
| 443 | { | 445 | { |
| 444 | base.OnMouseMove(e); | 446 | base.OnMouseMove(e); |
| 445 | 447 | ||
| 446 | if (mouseState == MouseState.None) | 448 | if (mouseState == MouseState.None) |
| 447 | { | 449 | { |
| 448 | MouseHitType = SetHitType(Mouse.GetPosition(this)); | 450 | MouseHitType = SetHitType(Mouse.GetPosition(this)); |
| 449 | SetMouseCursor(); | 451 | SetMouseCursor(); |
| 450 | } | 452 | } |
| 451 | else if (Operation == OperationState.DrawRoute && isStartDrawRoute) | 453 | else if (Operation == OperationState.DrawRoute && isStartDrawRoute) |
| 452 | { | 454 | { |
| 453 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine]; | 455 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[currentLine]; |
| 454 | 456 | ||
| 455 | // See how much the mouse has moved. | 457 | // See how much the mouse has moved. |
| 456 | Point point = Mouse.GetPosition(this); | 458 | Point point = Mouse.GetPosition(this); |
| 457 | double offset_x = point.X - StartDrawPoint.X; | 459 | double offset_x = point.X - StartDrawPoint.X; |
| 458 | double offset_y = point.Y - StartDrawPoint.Y; | 460 | double offset_y = point.Y - StartDrawPoint.Y; |
| 459 | 461 | ||
| 460 | // Get the line's current position. | 462 | // Get the line's current position. |
| 461 | double new_x = lineGeometry.StartPoint.X; | 463 | double new_x = lineGeometry.StartPoint.X; |
| 462 | double new_y = lineGeometry.StartPoint.Y; | 464 | double new_y = lineGeometry.StartPoint.Y; |
| 463 | 465 | ||
| 464 | if (offset_x != 0 || offset_y != 0) | 466 | if (offset_x != 0 || offset_y != 0) |
| 465 | { | 467 | { |
| 466 | if (Math.Abs(offset_x) >= Math.Abs(offset_y)) | 468 | if (Math.Abs(offset_x) >= Math.Abs(offset_y)) |
| 467 | { | 469 | { |
| 468 | new_x = point.X; | 470 | new_x = point.X; |
| 469 | } | 471 | } |
| 470 | else | 472 | else |
| 471 | { | 473 | { |
| 472 | new_y = point.Y; | 474 | new_y = point.Y; |
| 473 | } | 475 | } |
| 474 | } | 476 | } |
| 475 | 477 | ||
| 476 | // Set end point of current line | 478 | // Set end point of current line |
| 477 | LastPoint = new Point(new_x, new_y); | 479 | LastPoint = new Point(new_x, new_y); |
| 478 | lineGeometry.EndPoint = LastPoint; | 480 | lineGeometry.EndPoint = LastPoint; |
| 479 | DisplayCoordinate(LastPoint); | 481 | DisplayCoordinate(LastPoint); |
| 480 | } | 482 | } |
| 481 | else if (Operation == OperationState.DrawObstract) | 483 | else if (Operation == OperationState.DrawObstract) |
| 482 | { | 484 | { |
| 483 | if (mouseState == MouseState.Drag) | 485 | if (mouseState == MouseState.Drag) |
| 484 | { | 486 | { |
| 485 | // See how much the mouse has moved. | 487 | // See how much the mouse has moved. |
| 486 | Point point = Mouse.GetPosition(this); | 488 | Point point = Mouse.GetPosition(this); |
| 487 | double offset_x = point.X - LastPoint.X; | 489 | double offset_x = point.X - LastPoint.X; |
| 488 | double offset_y = point.Y - LastPoint.Y; | 490 | double offset_y = point.Y - LastPoint.Y; |
| 489 | 491 | ||
| 490 | // Get the rectangle's current position. | 492 | // Get the rectangle's current position. |
| 491 | double new_x = Canvas.GetLeft(shapeList[currentShape]); | 493 | double new_x = Canvas.GetLeft(shapeList[currentShape]); |
| 492 | double new_y = Canvas.GetTop(shapeList[currentShape]); | 494 | double new_y = Canvas.GetTop(shapeList[currentShape]); |
| 493 | double new_width = shapeList[currentShape].Width; | 495 | double new_width = shapeList[currentShape].Width; |
| 494 | double new_height = shapeList[currentShape].Height; | 496 | double new_height = shapeList[currentShape].Height; |
| 495 | 497 | ||
| 496 | // Update the rectangle. | 498 | // Update the rectangle. |
| 497 | switch (MouseHitType) | 499 | switch (MouseHitType) |
| 498 | { | 500 | { |
| 499 | case HitType.Body: | 501 | case HitType.Body: |
| 500 | new_x += offset_x; | 502 | new_x += offset_x; |
| 501 | new_y += offset_y; | 503 | new_y += offset_y; |
| 502 | break; | 504 | break; |
| 503 | case HitType.UL: | 505 | case HitType.UL: |
| 504 | new_x += offset_x; | 506 | new_x += offset_x; |
| 505 | new_y += offset_y; | 507 | new_y += offset_y; |
| 506 | new_width -= offset_x; | 508 | new_width -= offset_x; |
| 507 | new_height -= offset_y; | 509 | new_height -= offset_y; |
| 508 | break; | 510 | break; |
| 509 | case HitType.UR: | 511 | case HitType.UR: |
| 510 | new_y += offset_y; | 512 | new_y += offset_y; |
| 511 | new_width += offset_x; | 513 | new_width += offset_x; |
| 512 | new_height -= offset_y; | 514 | new_height -= offset_y; |
| 513 | break; | 515 | break; |
| 514 | case HitType.LR: | 516 | case HitType.LR: |
| 515 | new_width += offset_x; | 517 | new_width += offset_x; |
| 516 | new_height += offset_y; | 518 | new_height += offset_y; |
| 517 | break; | 519 | break; |
| 518 | case HitType.LL: | 520 | case HitType.LL: |
| 519 | new_x += offset_x; | 521 | new_x += offset_x; |
| 520 | new_width -= offset_x; | 522 | new_width -= offset_x; |
| 521 | new_height += offset_y; | 523 | new_height += offset_y; |
| 522 | break; | 524 | break; |
| 523 | case HitType.L: | 525 | case HitType.L: |
| 524 | new_x += offset_x; | 526 | new_x += offset_x; |
| 525 | new_width -= offset_x; | 527 | new_width -= offset_x; |
| 526 | break; | 528 | break; |
| 527 | case HitType.R: | 529 | case HitType.R: |
| 528 | new_width += offset_x; | 530 | new_width += offset_x; |
| 529 | break; | 531 | break; |
| 530 | case HitType.B: | 532 | case HitType.B: |
| 531 | new_height += offset_y; | 533 | new_height += offset_y; |
| 532 | break; | 534 | break; |
| 533 | case HitType.T: | 535 | case HitType.T: |
| 534 | new_y += offset_y; | 536 | new_y += offset_y; |
| 535 | new_height -= offset_y; | 537 | new_height -= offset_y; |
| 536 | break; | 538 | break; |
| 537 | } | 539 | } |
| 538 | // Don't use negative width or height. | 540 | // Don't use negative width or height. |
| 539 | if ((new_width > 0) && (new_height > 0)) | 541 | if ((new_width > 0) && (new_height > 0)) |
| 540 | { | 542 | { |
| 541 | // Update the rectangle. | 543 | // Update the rectangle. |
| 542 | Canvas.SetLeft(shapeList[currentShape], new_x); | 544 | Canvas.SetLeft(shapeList[currentShape], new_x); |
| 543 | Canvas.SetTop(shapeList[currentShape], new_y); | 545 | Canvas.SetTop(shapeList[currentShape], new_y); |
| 544 | shapeList[currentShape].Width = new_width; | 546 | shapeList[currentShape].Width = new_width; |
| 545 | shapeList[currentShape].Height = new_height; | 547 | shapeList[currentShape].Height = new_height; |
| 546 | 548 | ||
| 547 | // Save the mouse's new location. | 549 | // Save the mouse's new location. |
| 548 | LastPoint = point; | 550 | LastPoint = point; |
| 549 | 551 | ||
| 550 | } | 552 | } |
| 551 | } | 553 | } |
| 552 | else if (mouseState == MouseState.Draw) | 554 | else if (mouseState == MouseState.Draw) |
| 553 | { | 555 | { |
| 554 | 556 | ||
| 555 | // See how much the mouse has moved. | 557 | // See how much the mouse has moved. |
| 556 | Point point = Mouse.GetPosition(this); | 558 | Point point = Mouse.GetPosition(this); |
| 557 | 559 | ||
| 558 | 560 | ||
| 559 | double offset_x = point.X - StartDrawPoint.X; | 561 | double offset_x = point.X - StartDrawPoint.X; |
| 560 | double offset_y = point.Y - StartDrawPoint.Y; | 562 | double offset_y = point.Y - StartDrawPoint.Y; |
| 561 | 563 | ||
| 562 | // Get the rectangle's current position. | 564 | // Get the rectangle's current position. |
| 563 | double start_x = Canvas.GetLeft(shapeList[currentShape]); | 565 | double start_x = Canvas.GetLeft(shapeList[currentShape]); |
| 564 | double start_y = Canvas.GetTop(shapeList[currentShape]); | 566 | double start_y = Canvas.GetTop(shapeList[currentShape]); |
| 565 | double new_x = Canvas.GetLeft(shapeList[currentShape]); | 567 | double new_x = Canvas.GetLeft(shapeList[currentShape]); |
| 566 | double new_y = Canvas.GetTop(shapeList[currentShape]); | 568 | double new_y = Canvas.GetTop(shapeList[currentShape]); |
| 567 | double new_width = offset_x; | 569 | double new_width = offset_x; |
| 568 | double new_height = offset_y; | 570 | double new_height = offset_y; |
| 569 | if (offset_x < 0) | 571 | if (offset_x < 0) |
| 570 | { | 572 | { |
| 571 | new_x = point.X; | 573 | new_x = point.X; |
| 572 | new_width = -offset_x; | 574 | new_width = -offset_x; |
| 573 | } | 575 | } |
| 574 | if (offset_y < 0) | 576 | if (offset_y < 0) |
| 575 | { | 577 | { |
| 576 | new_y = point.Y; | 578 | new_y = point.Y; |
| 577 | new_height = -offset_y; | 579 | new_height = -offset_y; |
| 578 | } | 580 | } |
| 579 | Canvas.SetLeft(shapeList[currentShape], new_x); | 581 | Canvas.SetLeft(shapeList[currentShape], new_x); |
| 580 | Canvas.SetTop(shapeList[currentShape], new_y); | 582 | Canvas.SetTop(shapeList[currentShape], new_y); |
| 581 | shapeList[currentShape].Width = new_width; | 583 | shapeList[currentShape].Width = new_width; |
| 582 | shapeList[currentShape].Height = new_height; | 584 | shapeList[currentShape].Height = new_height; |
| 583 | 585 | ||
| 584 | } | 586 | } |
| 585 | 587 | ||
| 586 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); | 588 | double shapeX = Canvas.GetLeft(shapeList[currentShape]); |
| 587 | double shapeY = Canvas.GetTop(shapeList[currentShape]); | 589 | double shapeY = Canvas.GetTop(shapeList[currentShape]); |
| 588 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; | 590 | shapePosIndicator.Text = "(" + Math.Round(shapeX, 0) + "," + Math.Round(shapeY, 0) + ")"; |
| 589 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); | 591 | shapePosIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment); |
| 590 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); | 592 | shapePosIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment); |
| 591 | 593 | ||
| 592 | double width = (int)shapeList[currentShape].Width; | 594 | double width = (int)shapeList[currentShape].Width; |
| 593 | double height = (int)shapeList[currentShape].Height; | 595 | double height = (int)shapeList[currentShape].Height; |
| 594 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; | 596 | shapeSizeIndicator.Text = "(" + Math.Round(width, 0) + "," + Math.Round(height, 0) + ")"; |
| 595 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); | 597 | shapeSizeIndicator.SetValue(Canvas.LeftProperty, shapeX + indicatorAligment + width); |
| 596 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); | 598 | shapeSizeIndicator.SetValue(Canvas.TopProperty, shapeY + indicatorAligment + height); |
| 597 | } | 599 | } |
| 598 | e.Handled = true; | 600 | e.Handled = true; |
| 599 | } | 601 | } |
| 600 | 602 | ||
| 601 | protected override void OnMouseUp(MouseButtonEventArgs e) | 603 | protected override void OnMouseUp(MouseButtonEventArgs e) |
| 602 | { | 604 | { |
| 603 | base.OnMouseUp(e); | 605 | base.OnMouseUp(e); |
| 604 | if (Operation == OperationState.DrawObstract) | 606 | if (Operation == OperationState.DrawObstract) |
| 605 | { | 607 | { |
| 606 | if (shapeList.Count() != 0) | 608 | if (shapeList.Count() != 0) |
| 607 | shapeList[currentShape].Fill = new SolidColorBrush(Colors.Blue); | 609 | shapeList[currentShape].Fill = new SolidColorBrush(Colors.Blue); |
| 608 | shapePosIndicator.Text = ""; | 610 | shapePosIndicator.Text = ""; |
| 609 | shapeSizeIndicator.Text = ""; | 611 | shapeSizeIndicator.Text = ""; |
| 610 | this.Children.Remove(shapePosIndicator); | 612 | this.Children.Remove(shapePosIndicator); |
| 611 | this.Children.Remove(shapeSizeIndicator); | 613 | this.Children.Remove(shapeSizeIndicator); |
| 612 | 614 | ||
| 613 | mouseState = MouseState.None; | 615 | mouseState = MouseState.None; |
| 614 | currentShape = 0; | 616 | currentShape = 0; |
| 615 | } | 617 | } |
| 616 | e.Handled = true; | 618 | e.Handled = true; |
| 617 | } | 619 | } |
| 618 | 620 | ||
| 619 | protected override void OnPreviewMouseUp(MouseButtonEventArgs e) | 621 | protected override void OnPreviewMouseUp(MouseButtonEventArgs e) |
| 620 | { | 622 | { |
| 621 | base.OnPreviewMouseUp(e); | 623 | base.OnPreviewMouseUp(e); |
| 622 | 624 | ||
| 623 | EllipseGeometry ellipseGeometry; | 625 | EllipseGeometry ellipseGeometry; |
| 624 | bool flag = false; | 626 | bool flag = false; |
| 625 | 627 | ||
| 626 | StartDrawPoint = e.MouseDevice.GetPosition(this); | 628 | StartDrawPoint = e.MouseDevice.GetPosition(this); |
| 627 | 629 | ||
| 628 | if (EditNodeFlag == true) | 630 | if (EditNodeFlag == true) |
| 629 | { | 631 | { |
| 630 | execEditNode(StartDrawPoint); | 632 | execEditNode(StartDrawPoint); |
| 631 | EditNodeFlag = false; | 633 | EditNodeFlag = false; |
| 632 | return; | 634 | return; |
| 633 | } | 635 | } |
| 634 | 636 | ||
| 635 | if (DragDeltaFlag == true) | 637 | if (DragDeltaFlag == true) |
| 636 | { | 638 | { |
| 637 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 639 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 638 | { | 640 | { |
| 639 | 641 | ||
| 640 | for (int j = 0; j < ucNode_Lst.Count; j++) | 642 | for (int j = 0; j < ucNode_Lst.Count; j++) |
| 641 | { | 643 | { |
| 642 | if (j == i) | 644 | if (j == i) |
| 643 | { | 645 | { |
| 644 | _ucNodeFree = ucNode_Lst[j]; | 646 | _ucNodeFree = ucNode_Lst[j]; |
| 645 | flag = true; | 647 | flag = true; |
| 646 | } | 648 | } |
| 647 | } | 649 | } |
| 648 | if (flag) | 650 | if (flag) |
| 649 | { | 651 | { |
| 650 | if (gGrpNewLine.Children.Count > 0) | 652 | if (gGrpNewLine.Children.Count > 0) |
| 651 | { | 653 | { |
| 652 | for (int k = 0; k < gGrpNewLine.Children.Count; k++) | 654 | for (int k = 0; k < gGrpNewLine.Children.Count; k++) |
| 653 | { | 655 | { |
| 654 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[k]; | 656 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[k]; |
| 655 | Point p1 = lineGeometry.StartPoint; | 657 | Point p1 = lineGeometry.StartPoint; |
| 656 | Point p2 = lineGeometry.EndPoint; | 658 | Point p2 = lineGeometry.EndPoint; |
| 657 | 659 | ||
| 658 | //bool pInL = PointInLine(StartDrawPoint, p1, p2, 25); | 660 | //bool pInL = PointInLine(StartDrawPoint, p1, p2, 25); |
| 659 | 661 | ||
| 660 | //if (pInL) | 662 | //if (pInL) |
| 661 | //{ | 663 | //{ |
| 662 | 664 | ||
| 663 | // //this.Children.Remove(_ucNodeFree); | 665 | // //this.Children.Remove(_ucNodeFree); |
| 664 | // //this.Children.Add(_ucNodeFree); | 666 | // //this.Children.Add(_ucNodeFree); |
| 665 | // return; | 667 | // return; |
| 666 | //} | 668 | //} |
| 667 | } | 669 | } |
| 668 | } | 670 | } |
| 669 | 671 | ||
| 670 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 672 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 671 | 673 | ||
| 672 | ellipseGeometry.Center = new Point(StartDrawPoint.X, StartDrawPoint.Y); | 674 | ellipseGeometry.Center = new Point(StartDrawPoint.X, StartDrawPoint.Y); |
| 673 | 675 | ||
| 674 | double centerY = Canvas.GetTop(_ucNodeFree); | 676 | double centerY = Canvas.GetTop(_ucNodeFree); |
| 675 | double centerX = Canvas.GetLeft(_ucNodeFree); | 677 | double centerX = Canvas.GetLeft(_ucNodeFree); |
| 676 | 678 | ||
| 677 | mouseState = MouseState.Draw; | 679 | mouseState = MouseState.Draw; |
| 678 | 680 | ||
| 679 | 681 | ||
| 680 | StartDrawPoint = new Point(centerX + UCNODE_SETLEFT, centerY + UCNODE_SETTOP); | 682 | StartDrawPoint = new Point(centerX + UCNODE_SETLEFT, centerY + UCNODE_SETTOP); |
| 681 | ellipseGeometry.Center = new Point(centerX + UCNODE_SETLEFT, centerY + UCNODE_SETTOP); | 683 | ellipseGeometry.Center = new Point(centerX + UCNODE_SETLEFT, centerY + UCNODE_SETTOP); |
| 682 | 684 | ||
| 683 | this.Children.Remove(_ucNodeFree); | 685 | this.Children.Remove(_ucNodeFree); |
| 684 | this.Children.Add(_ucNodeFree); | 686 | this.Children.Add(_ucNodeFree); |
| 685 | } | 687 | } |
| 686 | } | 688 | } |
| 687 | 689 | ||
| 688 | ReDrawAllNode(); | 690 | ReDrawAllNode(); |
| 689 | 691 | ||
| 690 | SetScheduleRoute(); | 692 | SetScheduleRoute(); |
| 691 | DragDeltaFlag = false; | 693 | DragDeltaFlag = false; |
| 692 | } | 694 | } |
| 693 | 695 | ||
| 694 | 696 | ||
| 695 | 697 | ||
| 696 | return; | 698 | return; |
| 697 | } | 699 | } |
| 698 | 700 | ||
| 699 | /// <summary> | 701 | /// <summary> |
| 700 | /// On Preview Mouse Down | 702 | /// On Preview Mouse Down |
| 701 | /// </summary> | 703 | /// </summary> |
| 702 | /// <param name="e"></param> | 704 | /// <param name="e"></param> |
| 703 | protected override void OnPreviewMouseDown(MouseButtonEventArgs e) | 705 | protected override void OnPreviewMouseDown(MouseButtonEventArgs e) |
| 704 | { | 706 | { |
| 705 | base.OnPreviewMouseDown(e); | 707 | base.OnPreviewMouseDown(e); |
| 706 | if (Operation != OperationState.NewDrawSetFreeNode) | 708 | if (Operation != OperationState.NewDrawSetFreeNode) |
| 707 | { | 709 | { |
| 708 | return; | 710 | return; |
| 709 | } | 711 | } |
| 710 | 712 | ||
| 711 | Point currentPoint = e.MouseDevice.GetPosition(this); | 713 | Point currentPoint = e.MouseDevice.GetPosition(this); |
| 712 | 714 | ||
| 713 | if (isDrawingNode == false) | 715 | if (isDrawingNode == false) |
| 714 | { | 716 | { |
| 715 | 717 | ||
| 716 | isDrawingNode = true; | 718 | isDrawingNode = true; |
| 717 | //InitDrawRoute(); | 719 | //InitDrawRoute(); |
| 718 | mouseState = MouseState.Draw; | 720 | mouseState = MouseState.Draw; |
| 719 | 721 | ||
| 720 | StartDrawPoint = e.MouseDevice.GetPosition(this); | 722 | StartDrawPoint = e.MouseDevice.GetPosition(this); |
| 721 | 723 | ||
| 722 | 724 | ||
| 723 | execCreateNode(StartDrawPoint); | 725 | execCreateNode(StartDrawPoint); |
| 724 | 726 | ||
| 725 | //backup DB | 727 | //backup DB |
| 726 | CreateVehicleNode(); | 728 | CreateVehicleNode(); |
| 727 | 729 | ||
| 728 | return; | 730 | return; |
| 729 | } | 731 | } |
| 730 | else | 732 | else |
| 731 | { | 733 | { |
| 732 | 734 | ||
| 733 | bool RightClick = false; | 735 | bool RightClick = false; |
| 734 | bool LeftClick = false; | 736 | bool LeftClick = false; |
| 735 | 737 | ||
| 736 | 738 | ||
| 737 | if (IsMouseLeftClick(e)) | 739 | if (IsMouseLeftClick(e)) |
| 738 | LeftClick = true; | 740 | LeftClick = true; |
| 739 | if (IsStopDrawRoute(e)) | 741 | if (IsStopDrawRoute(e)) |
| 740 | RightClick = true; | 742 | RightClick = true; |
| 741 | 743 | ||
| 742 | StartDrawPoint = e.MouseDevice.GetPosition(this); | 744 | StartDrawPoint = e.MouseDevice.GetPosition(this); |
| 743 | 745 | ||
| 744 | if (RightClick) | 746 | if (RightClick) |
| 745 | { | 747 | { |
| 746 | execDeleteNode(StartDrawPoint); | 748 | execDeleteNode(StartDrawPoint); |
| 747 | 749 | ||
| 748 | //backup DB | 750 | //backup DB |
| 749 | CreateVehicleNode(); | 751 | CreateVehicleNode(); |
| 750 | } | 752 | } |
| 751 | else if (LeftClick) | 753 | else if (LeftClick) |
| 752 | { | 754 | { |
| 753 | //check click to exist node | 755 | //check click to exist node |
| 754 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 756 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 755 | { | 757 | { |
| 756 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 758 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 757 | Point node = ellipseGeometry.Center; | 759 | Point node = ellipseGeometry.Center; |
| 758 | bool isEditNode = CheckIsNode(StartDrawPoint, node, RADIUS_NODE); | 760 | bool isEditNode = CheckIsNode(StartDrawPoint, node, RADIUS_NODE); |
| 759 | 761 | ||
| 760 | if (isEditNode) | 762 | if (isEditNode) |
| 761 | { | 763 | { |
| 762 | return; | 764 | return; |
| 763 | } | 765 | } |
| 764 | } | 766 | } |
| 765 | 767 | ||
| 766 | execCreateNode(StartDrawPoint); | 768 | execCreateNode(StartDrawPoint); |
| 767 | 769 | ||
| 768 | //backup DB | 770 | //backup DB |
| 769 | CreateVehicleNode(); | 771 | CreateVehicleNode(); |
| 770 | } | 772 | } |
| 771 | 773 | ||
| 772 | } | 774 | } |
| 773 | } | 775 | } |
| 774 | 776 | ||
| 775 | #region Functions for draw route | 777 | #region Functions for draw route |
| 776 | 778 | ||
| 777 | /// <summary> | 779 | /// <summary> |
| 778 | /// Check start or end draw route | 780 | /// Check start or end draw route |
| 779 | /// </summary> | 781 | /// </summary> |
| 780 | /// <param name="_ucStartEndButton">Button start</param> | 782 | /// <param name="_ucStartEndButton">Button start</param> |
| 781 | /// <param name="currentPoint">Position for check</param> | 783 | /// <param name="currentPoint">Position for check</param> |
| 782 | /// <returns>true: start, false: not start</returns> | 784 | /// <returns>true: start, false: not start</returns> |
| 783 | private bool IsStartEndRoute(ucStartEndButton _ucStartEndButton, Point currentPoint) | 785 | private bool IsStartEndRoute(ucStartEndButton _ucStartEndButton, Point currentPoint) |
| 784 | { | 786 | { |
| 785 | if (_ucStartEndButton == null) | 787 | if (_ucStartEndButton == null) |
| 786 | { | 788 | { |
| 787 | return false; | 789 | return false; |
| 788 | } | 790 | } |
| 789 | 791 | ||
| 790 | double centerX = Canvas.GetLeft(_ucStartEndButton); | 792 | double centerX = Canvas.GetLeft(_ucStartEndButton); |
| 791 | double centerY = Canvas.GetTop(_ucStartEndButton); | 793 | double centerY = Canvas.GetTop(_ucStartEndButton); |
| 792 | 794 | ||
| 793 | if (currentPoint.X < centerX + 50 && currentPoint.X > centerX | 795 | if (currentPoint.X < centerX + 50 && currentPoint.X > centerX |
| 794 | && currentPoint.Y < centerY + 50 && currentPoint.Y > centerY) | 796 | && currentPoint.Y < centerY + 50 && currentPoint.Y > centerY) |
| 795 | { | 797 | { |
| 796 | return true; | 798 | return true; |
| 797 | } | 799 | } |
| 798 | return false; | 800 | return false; |
| 799 | } | 801 | } |
| 800 | 802 | ||
| 801 | /// <summary> | 803 | /// <summary> |
| 802 | /// Process when end draw route | 804 | /// Process when end draw route |
| 803 | /// </summary> | 805 | /// </summary> |
| 804 | private void ProcessEndRoute() | 806 | private void ProcessEndRoute() |
| 805 | { | 807 | { |
| 806 | Operation = OperationState.None; | 808 | Operation = OperationState.None; |
| 807 | AutoEditLine(); | 809 | AutoEditLine(); |
| 808 | this.Children.Remove(_displayAxiPosition); | 810 | this.Children.Remove(_displayAxiPosition); |
| 809 | this.Children.Remove(_goalPoint); | 811 | this.Children.Remove(_goalPoint); |
| 810 | this.Children.Add(_goalPoint); | 812 | this.Children.Add(_goalPoint); |
| 811 | } | 813 | } |
| 812 | 814 | ||
| 813 | /// <summary> | 815 | /// <summary> |
| 814 | /// Check end draw route | 816 | /// Check end draw route |
| 815 | /// </summary> | 817 | /// </summary> |
| 816 | /// <param name="_ucStartEndButton">Button end</param> | 818 | /// <param name="_ucStartEndButton">Button end</param> |
| 817 | /// <param name="currentPoint">Position for check</param> | 819 | /// <param name="currentPoint">Position for check</param> |
| 818 | /// <returns>true: end, false: not end</returns> | 820 | /// <returns>true: end, false: not end</returns> |
| 819 | private bool IsEndRoute(ucStartEndButton _ucStartEndButton, LineGeometry lineGeometry) | 821 | private bool IsEndRoute(ucStartEndButton _ucStartEndButton, LineGeometry lineGeometry) |
| 820 | { | 822 | { |
| 821 | if (_ucStartEndButton == null) | 823 | if (_ucStartEndButton == null) |
| 822 | { | 824 | { |
| 823 | return false; | 825 | return false; |
| 824 | } | 826 | } |
| 825 | 827 | ||
| 826 | double centerX = Canvas.GetLeft(_ucStartEndButton); | 828 | double centerX = Canvas.GetLeft(_ucStartEndButton); |
| 827 | double centerY = Canvas.GetTop(_ucStartEndButton); | 829 | double centerY = Canvas.GetTop(_ucStartEndButton); |
| 828 | Point startPoint = lineGeometry.StartPoint; | 830 | Point startPoint = lineGeometry.StartPoint; |
| 829 | Point endPoint = lineGeometry.EndPoint; | 831 | Point endPoint = lineGeometry.EndPoint; |
| 830 | 832 | ||
| 831 | if (IsVerticalLine(lineGeometry)) | 833 | if (IsVerticalLine(lineGeometry)) |
| 832 | { | 834 | { |
| 833 | if (endPoint.X < centerX || endPoint.X > centerX + 50) | 835 | if (endPoint.X < centerX || endPoint.X > centerX + 50) |
| 834 | return false; | 836 | return false; |
| 835 | 837 | ||
| 836 | if (startPoint.Y > centerY + 50 && endPoint.Y > centerY + 50) | 838 | if (startPoint.Y > centerY + 50 && endPoint.Y > centerY + 50) |
| 837 | return false; | 839 | return false; |
| 838 | 840 | ||
| 839 | if (startPoint.Y < centerY && endPoint.Y < centerY) | 841 | if (startPoint.Y < centerY && endPoint.Y < centerY) |
| 840 | return false; | 842 | return false; |
| 841 | } | 843 | } |
| 842 | else | 844 | else |
| 843 | { | 845 | { |
| 844 | if (endPoint.Y < centerY || endPoint.Y > centerY + 50) | 846 | if (endPoint.Y < centerY || endPoint.Y > centerY + 50) |
| 845 | return false; | 847 | return false; |
| 846 | 848 | ||
| 847 | if (startPoint.X > centerX + 50 && endPoint.X > centerX + 50) | 849 | if (startPoint.X > centerX + 50 && endPoint.X > centerX + 50) |
| 848 | return false; | 850 | return false; |
| 849 | 851 | ||
| 850 | if (startPoint.X < centerX && endPoint.X < centerX) | 852 | if (startPoint.X < centerX && endPoint.X < centerX) |
| 851 | return false; | 853 | return false; |
| 852 | } | 854 | } |
| 853 | 855 | ||
| 854 | return true; | 856 | return true; |
| 855 | } | 857 | } |
| 856 | 858 | ||
| 857 | /// <summary> | 859 | /// <summary> |
| 858 | /// Make root | 860 | /// Make root |
| 859 | /// </summary> | 861 | /// </summary> |
| 860 | public void MakeRoot() | 862 | public void MakeRoot() |
| 861 | { | 863 | { |
| 862 | // If still not route | 864 | // If still not route |
| 863 | if (gGrpLine.Children.Count == 0) | 865 | if (gGrpLine.Children.Count == 0) |
| 864 | return; | 866 | return; |
| 865 | 867 | ||
| 866 | pLine.Stroke = new SolidColorBrush(Colors.Red); | 868 | pLine.Stroke = new SolidColorBrush(Colors.Red); |
| 867 | pLine.StrokeThickness = STROKE_ROOT_LINE; | 869 | pLine.StrokeThickness = STROKE_ROOT_LINE; |
| 868 | 870 | ||
| 869 | } | 871 | } |
| 870 | 872 | ||
| 871 | /// <summary> | 873 | /// <summary> |
| 872 | /// Auto edit leght of line | 874 | /// Auto edit leght of line |
| 873 | /// </summary> | 875 | /// </summary> |
| 874 | private void AutoEditLine() | 876 | private void AutoEditLine() |
| 875 | { | 877 | { |
| 876 | double temp; | 878 | double temp; |
| 877 | int index = gGrpLine.Children.Count - 1; | 879 | int index = gGrpLine.Children.Count - 1; |
| 878 | double centerY = Canvas.GetTop(_goalPoint) + 25; | 880 | double centerY = Canvas.GetTop(_goalPoint) + 25; |
| 879 | double centerX = Canvas.GetLeft(_goalPoint) + 25; | 881 | double centerX = Canvas.GetLeft(_goalPoint) + 25; |
| 880 | LineGeometry lastLine = (LineGeometry)gGrpLine.Children[index]; | 882 | LineGeometry lastLine = (LineGeometry)gGrpLine.Children[index]; |
| 881 | LineGeometry beforeLastLine = (LineGeometry)gGrpLine.Children[index]; | 883 | LineGeometry beforeLastLine = (LineGeometry)gGrpLine.Children[index]; |
| 882 | 884 | ||
| 883 | if (gGrpLine.Children.Count > 1) | 885 | if (gGrpLine.Children.Count > 1) |
| 884 | { | 886 | { |
| 885 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; | 887 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; |
| 886 | 888 | ||
| 887 | if (!IsCurverNode(beforeLastLine, lastLine)) | 889 | if (!IsCurverNode(beforeLastLine, lastLine)) |
| 888 | { | 890 | { |
| 889 | beforeLastLine.EndPoint = lastLine.EndPoint; | 891 | beforeLastLine.EndPoint = lastLine.EndPoint; |
| 890 | gGrpLine.Children.RemoveAt(index); | 892 | gGrpLine.Children.RemoveAt(index); |
| 891 | index = index - 1; | 893 | index = index - 1; |
| 892 | lastLine = (LineGeometry)gGrpLine.Children[index]; | 894 | lastLine = (LineGeometry)gGrpLine.Children[index]; |
| 893 | } | 895 | } |
| 894 | } | 896 | } |
| 895 | 897 | ||
| 896 | if (index == gGrpRedNode.Children.Count + 1) | 898 | if (index == gGrpRedNode.Children.Count + 1) |
| 897 | { | 899 | { |
| 898 | AddNode(lastLine.StartPoint, gGrpRedNode); | 900 | AddNode(lastLine.StartPoint, gGrpRedNode); |
| 899 | } | 901 | } |
| 900 | 902 | ||
| 901 | if (lastLine.EndPoint.X == centerX && lastLine.EndPoint.Y == centerY) | 903 | if (lastLine.EndPoint.X == centerX && lastLine.EndPoint.Y == centerY) |
| 902 | return; | 904 | return; |
| 903 | 905 | ||
| 904 | if (IsVerticalLine(lastLine)) | 906 | if (IsVerticalLine(lastLine)) |
| 905 | { | 907 | { |
| 906 | temp = lastLine.StartPoint.Y; | 908 | temp = lastLine.StartPoint.Y; |
| 907 | lastLine.StartPoint = new Point(centerX, temp); | 909 | lastLine.StartPoint = new Point(centerX, temp); |
| 908 | lastLine.EndPoint = new Point(centerX, centerY); | 910 | lastLine.EndPoint = new Point(centerX, centerY); |
| 909 | 911 | ||
| 910 | if (gGrpLine.Children.Count > 1) | 912 | if (gGrpLine.Children.Count > 1) |
| 911 | { | 913 | { |
| 912 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; | 914 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; |
| 913 | temp = beforeLastLine.EndPoint.Y; | 915 | temp = beforeLastLine.EndPoint.Y; |
| 914 | beforeLastLine.EndPoint = new Point(centerX, temp); | 916 | beforeLastLine.EndPoint = new Point(centerX, temp); |
| 915 | } | 917 | } |
| 916 | } | 918 | } |
| 917 | else | 919 | else |
| 918 | { | 920 | { |
| 919 | temp = lastLine.StartPoint.X; | 921 | temp = lastLine.StartPoint.X; |
| 920 | lastLine.StartPoint = new Point(temp, centerY); | 922 | lastLine.StartPoint = new Point(temp, centerY); |
| 921 | lastLine.EndPoint = new Point(centerX, centerY); | 923 | lastLine.EndPoint = new Point(centerX, centerY); |
| 922 | if (gGrpLine.Children.Count > 1) | 924 | if (gGrpLine.Children.Count > 1) |
| 923 | { | 925 | { |
| 924 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; | 926 | beforeLastLine = (LineGeometry)gGrpLine.Children[index - 1]; |
| 925 | temp = beforeLastLine.EndPoint.X; | 927 | temp = beforeLastLine.EndPoint.X; |
| 926 | beforeLastLine.EndPoint = new Point(temp, centerY); | 928 | beforeLastLine.EndPoint = new Point(temp, centerY); |
| 927 | } | 929 | } |
| 928 | } | 930 | } |
| 929 | 931 | ||
| 930 | // Draw curver line | 932 | // Draw curver line |
| 931 | if (IsCurverNode(beforeLastLine, lastLine)) | 933 | if (IsCurverNode(beforeLastLine, lastLine)) |
| 932 | { | 934 | { |
| 933 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpRedNode.Children[gGrpRedNode.Children.Count - 1]; | 935 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpRedNode.Children[gGrpRedNode.Children.Count - 1]; |
| 934 | ellipseGeometry.Center = lastLine.StartPoint; | 936 | ellipseGeometry.Center = lastLine.StartPoint; |
| 935 | } | 937 | } |
| 936 | } | 938 | } |
| 937 | 939 | ||
| 938 | /// <summary> | 940 | /// <summary> |
| 939 | /// Check draw curver node | 941 | /// Check draw curver node |
| 940 | /// </summary> | 942 | /// </summary> |
| 941 | /// <param name="oldLine">Old line</param> | 943 | /// <param name="oldLine">Old line</param> |
| 942 | /// <param name="newLine">New line</param> | 944 | /// <param name="newLine">New line</param> |
| 943 | /// <returns>true:is curver, fasle: not curver</returns> | 945 | /// <returns>true:is curver, fasle: not curver</returns> |
| 944 | private bool IsCurverNode(LineGeometry oldLine, LineGeometry newLine) | 946 | private bool IsCurverNode(LineGeometry oldLine, LineGeometry newLine) |
| 945 | { | 947 | { |
| 946 | if (oldLine.StartPoint.Y == oldLine.EndPoint.Y && oldLine.StartPoint.Y == newLine.EndPoint.Y) | 948 | if (oldLine.StartPoint.Y == oldLine.EndPoint.Y && oldLine.StartPoint.Y == newLine.EndPoint.Y) |
| 947 | { | 949 | { |
| 948 | return false; | 950 | return false; |
| 949 | } | 951 | } |
| 950 | 952 | ||
| 951 | if (oldLine.StartPoint.X == oldLine.EndPoint.X && oldLine.StartPoint.X == newLine.EndPoint.X) | 953 | if (oldLine.StartPoint.X == oldLine.EndPoint.X && oldLine.StartPoint.X == newLine.EndPoint.X) |
| 952 | { | 954 | { |
| 953 | return false; | 955 | return false; |
| 954 | } | 956 | } |
| 955 | 957 | ||
| 956 | return true; | 958 | return true; |
| 957 | } | 959 | } |
| 958 | 960 | ||
| 959 | /// <summary> | 961 | /// <summary> |
| 960 | /// Check timming to stop draw route | 962 | /// Check timming to stop draw route |
| 961 | /// </summary> | 963 | /// </summary> |
| 962 | /// <param name="e"></param> | 964 | /// <param name="e"></param> |
| 963 | /// <returns>true:stop; false:continue</returns> | 965 | /// <returns>true:stop; false:continue</returns> |
| 964 | private bool IsStopDrawRoute(MouseEventArgs e) | 966 | private bool IsStopDrawRoute(MouseEventArgs e) |
| 965 | { | 967 | { |
| 966 | if (e.RightButton == MouseButtonState.Pressed) | 968 | if (e.RightButton == MouseButtonState.Pressed) |
| 967 | { | 969 | { |
| 968 | return true; | 970 | return true; |
| 969 | } | 971 | } |
| 970 | 972 | ||
| 971 | return false; | 973 | return false; |
| 972 | } | 974 | } |
| 973 | 975 | ||
| 974 | //2017/03/05 NAM ADD START | 976 | //2017/03/05 NAM ADD START |
| 975 | private bool IsMouseLeftClick(MouseEventArgs e) | 977 | private bool IsMouseLeftClick(MouseEventArgs e) |
| 976 | { | 978 | { |
| 977 | if (e.LeftButton == MouseButtonState.Pressed) | 979 | if (e.LeftButton == MouseButtonState.Pressed) |
| 978 | { | 980 | { |
| 979 | return true; | 981 | return true; |
| 980 | } | 982 | } |
| 981 | 983 | ||
| 982 | return false; | 984 | return false; |
| 983 | } | 985 | } |
| 984 | //2017/03/05 NAM ADD END | 986 | //2017/03/05 NAM ADD END |
| 985 | 987 | ||
| 986 | /// <summary> | 988 | /// <summary> |
| 987 | /// Draw curver line and yellow node | 989 | /// Draw curver line and yellow node |
| 988 | /// </summary> | 990 | /// </summary> |
| 989 | /// <param name="oldLine">Old line</param> | 991 | /// <param name="oldLine">Old line</param> |
| 990 | /// <param name="newLine">New line</param> | 992 | /// <param name="newLine">New line</param> |
| 991 | private void DrawCurver(LineGeometry oldLine, LineGeometry newLine) | 993 | private void DrawCurver(LineGeometry oldLine, LineGeometry newLine) |
| 992 | { | 994 | { |
| 993 | double radius = RADIUS_CURVER_LINE; | 995 | double radius = RADIUS_CURVER_LINE; |
| 994 | 996 | ||
| 995 | Point startPoint; | 997 | Point startPoint; |
| 996 | Point endPoint; | 998 | Point endPoint; |
| 997 | 999 | ||
| 998 | // Get postion of yellow node on old line | 1000 | // Get postion of yellow node on old line |
| 999 | if (IsVerticalLine(oldLine)) | 1001 | if (IsVerticalLine(oldLine)) |
| 1000 | { | 1002 | { |
| 1001 | if (oldLine.StartPoint.Y > oldLine.EndPoint.Y) | 1003 | if (oldLine.StartPoint.Y > oldLine.EndPoint.Y) |
| 1002 | startPoint = new Point(oldLine.EndPoint.X, oldLine.EndPoint.Y + radius); | 1004 | startPoint = new Point(oldLine.EndPoint.X, oldLine.EndPoint.Y + radius); |
| 1003 | else | 1005 | else |
| 1004 | startPoint = new Point(oldLine.EndPoint.X, oldLine.EndPoint.Y - radius); | 1006 | startPoint = new Point(oldLine.EndPoint.X, oldLine.EndPoint.Y - radius); |
| 1005 | } | 1007 | } |
| 1006 | else | 1008 | else |
| 1007 | { | 1009 | { |
| 1008 | if (oldLine.StartPoint.X > oldLine.EndPoint.X) | 1010 | if (oldLine.StartPoint.X > oldLine.EndPoint.X) |
| 1009 | startPoint = new Point(oldLine.EndPoint.X + radius, oldLine.EndPoint.Y); | 1011 | startPoint = new Point(oldLine.EndPoint.X + radius, oldLine.EndPoint.Y); |
| 1010 | else | 1012 | else |
| 1011 | startPoint = new Point(oldLine.EndPoint.X - radius, oldLine.EndPoint.Y); | 1013 | startPoint = new Point(oldLine.EndPoint.X - radius, oldLine.EndPoint.Y); |
| 1012 | } | 1014 | } |
| 1013 | 1015 | ||
| 1014 | // Get postion of yellow node on new line | 1016 | // Get postion of yellow node on new line |
| 1015 | if (IsVerticalLine(newLine)) | 1017 | if (IsVerticalLine(newLine)) |
| 1016 | { | 1018 | { |
| 1017 | if (newLine.StartPoint.Y > newLine.EndPoint.Y) | 1019 | if (newLine.StartPoint.Y > newLine.EndPoint.Y) |
| 1018 | endPoint = new Point(newLine.StartPoint.X, newLine.StartPoint.Y - radius); | 1020 | endPoint = new Point(newLine.StartPoint.X, newLine.StartPoint.Y - radius); |
| 1019 | else | 1021 | else |
| 1020 | endPoint = new Point(newLine.StartPoint.X, newLine.StartPoint.Y + radius); | 1022 | endPoint = new Point(newLine.StartPoint.X, newLine.StartPoint.Y + radius); |
| 1021 | } | 1023 | } |
| 1022 | else | 1024 | else |
| 1023 | { | 1025 | { |
| 1024 | if (newLine.StartPoint.X > newLine.EndPoint.X) | 1026 | if (newLine.StartPoint.X > newLine.EndPoint.X) |
| 1025 | endPoint = new Point(newLine.StartPoint.X - radius, newLine.StartPoint.Y); | 1027 | endPoint = new Point(newLine.StartPoint.X - radius, newLine.StartPoint.Y); |
| 1026 | else | 1028 | else |
| 1027 | endPoint = new Point(newLine.StartPoint.X + radius, newLine.StartPoint.Y); | 1029 | endPoint = new Point(newLine.StartPoint.X + radius, newLine.StartPoint.Y); |
| 1028 | } | 1030 | } |
| 1029 | 1031 | ||
| 1030 | // Add node to postion distance 1300mm | 1032 | // Add node to postion distance 1300mm |
| 1031 | if (GetDistance(oldLine.StartPoint, oldLine.EndPoint) > RADIUS_CURVER_LINE) | 1033 | if (GetDistance(oldLine.StartPoint, oldLine.EndPoint) > RADIUS_CURVER_LINE) |
| 1032 | { | 1034 | { |
| 1033 | AddNode(startPoint, gGrpYellowNode); | 1035 | AddNode(startPoint, gGrpYellowNode); |
| 1034 | } | 1036 | } |
| 1035 | 1037 | ||
| 1036 | if (GetDistance(newLine.StartPoint, newLine.EndPoint) > RADIUS_CURVER_LINE) | 1038 | if (GetDistance(newLine.StartPoint, newLine.EndPoint) > RADIUS_CURVER_LINE) |
| 1037 | { | 1039 | { |
| 1038 | AddNode(endPoint, gGrpYellowNode); | 1040 | AddNode(endPoint, gGrpYellowNode); |
| 1039 | } | 1041 | } |
| 1040 | } | 1042 | } |
| 1041 | 1043 | ||
| 1042 | /// <summary> | 1044 | /// <summary> |
| 1043 | /// Init data for draw route | 1045 | /// Init data for draw route |
| 1044 | /// </summary> | 1046 | /// </summary> |
| 1045 | public void InitDrawRoute() | 1047 | public void InitDrawRoute() |
| 1046 | { | 1048 | { |
| 1047 | //2017/03/04 NAM ADD START | 1049 | //2017/03/04 NAM ADD START |
| 1048 | pNewLine.Stroke = new SolidColorBrush(Colors.Red); | 1050 | pNewLine.Stroke = new SolidColorBrush(Colors.Red); |
| 1049 | pNewLine.StrokeThickness = STROKE_LINE; | 1051 | pNewLine.StrokeThickness = STROKE_LINE; |
| 1050 | pNewLine.Data = gGrpNewLine; | 1052 | pNewLine.Data = gGrpNewLine; |
| 1051 | //2017/03/04 NAM ADD END | 1053 | //2017/03/04 NAM ADD END |
| 1052 | 1054 | ||
| 1053 | pScheduleLine.Stroke = new SolidColorBrush(Colors.Red); | 1055 | pScheduleLine.Stroke = new SolidColorBrush(Colors.Red); |
| 1054 | pScheduleLine.StrokeThickness = STROKE_LINE; | 1056 | pScheduleLine.StrokeThickness = STROKE_LINE; |
| 1055 | pScheduleLine.Data = gGrpScheduleLine; | 1057 | pScheduleLine.Data = gGrpScheduleLine; |
| 1056 | 1058 | ||
| 1057 | // Setting for path line | 1059 | // Setting for path line |
| 1058 | pLine.Stroke = new SolidColorBrush(Colors.Blue); | 1060 | pLine.Stroke = new SolidColorBrush(Colors.Blue); |
| 1059 | pLine.StrokeThickness = STROKE_LINE; | 1061 | pLine.StrokeThickness = STROKE_LINE; |
| 1060 | pLine.Data = gGrpLine; | 1062 | pLine.Data = gGrpLine; |
| 1061 | 1063 | ||
| 1062 | // Setting for path of curver line | 1064 | // Setting for path of curver line |
| 1063 | pCurverLine.Stroke = Brushes.Red; | 1065 | pCurverLine.Stroke = Brushes.Red; |
| 1064 | pCurverLine.StrokeThickness = STROKE_LINE; | 1066 | pCurverLine.StrokeThickness = STROKE_LINE; |
| 1065 | pCurverLine.Data = gGrpCurverLine; | 1067 | pCurverLine.Data = gGrpCurverLine; |
| 1066 | 1068 | ||
| 1067 | // Setting for path of red node | 1069 | // Setting for path of red node |
| 1068 | pRedNode.Stroke = new SolidColorBrush(Colors.Blue); | 1070 | pRedNode.Stroke = new SolidColorBrush(Colors.Blue); |
| 1069 | pRedNode.Fill = new SolidColorBrush(Colors.Red); | 1071 | pRedNode.Fill = new SolidColorBrush(Colors.Red); |
| 1070 | pRedNode.StrokeThickness = STROKE_NODE; | 1072 | pRedNode.StrokeThickness = STROKE_NODE; |
| 1071 | pRedNode.Data = gGrpRedNode; | 1073 | pRedNode.Data = gGrpRedNode; |
| 1072 | 1074 | ||
| 1073 | // Setting for path of yellow node | 1075 | // Setting for path of yellow node |
| 1074 | pYellowNode.Stroke = new SolidColorBrush(Colors.Blue); | 1076 | pYellowNode.Stroke = new SolidColorBrush(Colors.Blue); |
| 1075 | pYellowNode.Fill = new SolidColorBrush(Colors.Yellow); | 1077 | pYellowNode.Fill = new SolidColorBrush(Colors.Yellow); |
| 1076 | pYellowNode.StrokeThickness = STROKE_NODE; | 1078 | pYellowNode.StrokeThickness = STROKE_NODE; |
| 1077 | pYellowNode.Data = gGrpYellowNode; | 1079 | pYellowNode.Data = gGrpYellowNode; |
| 1078 | 1080 | ||
| 1079 | // Setting for path of Blue node | 1081 | // Setting for path of Blue node |
| 1080 | pBlueNode.Stroke = new SolidColorBrush(Colors.Blue); | 1082 | pBlueNode.Stroke = new SolidColorBrush(Colors.Blue); |
| 1081 | pBlueNode.Fill = new SolidColorBrush(Colors.LightBlue); | 1083 | pBlueNode.Fill = new SolidColorBrush(Colors.LightBlue); |
| 1082 | pBlueNode.StrokeThickness = STROKE_NODE; | 1084 | pBlueNode.StrokeThickness = STROKE_NODE; |
| 1083 | pBlueNode.Data = gGrpBlueNode; | 1085 | pBlueNode.Data = gGrpBlueNode; |
| 1084 | 1086 | ||
| 1085 | // Add paths to canvas | 1087 | // Add paths to canvas |
| 1086 | this.Children.Add(pLine); | 1088 | this.Children.Add(pLine); |
| 1087 | this.Children.Add(pCurverLine); | 1089 | this.Children.Add(pCurverLine); |
| 1088 | this.Children.Add(pRedNode); | 1090 | this.Children.Add(pRedNode); |
| 1089 | this.Children.Add(pYellowNode); | 1091 | this.Children.Add(pYellowNode); |
| 1090 | 1092 | ||
| 1091 | //this.Children.Add(pNewLine); | 1093 | //this.Children.Add(pNewLine); |
| 1092 | scheduleCanvas.Children.Add(pScheduleLine); | 1094 | scheduleCanvas.Children.Add(pScheduleLine); |
| 1093 | } | 1095 | } |
| 1094 | 1096 | ||
| 1095 | /// <summary> | 1097 | /// <summary> |
| 1096 | /// Clear all route | 1098 | /// Clear all route |
| 1097 | /// </summary> | 1099 | /// </summary> |
| 1098 | public void ClearRoute() | 1100 | public void ClearRoute() |
| 1099 | { | 1101 | { |
| 1100 | isStartDrawRoute = false; | 1102 | isStartDrawRoute = false; |
| 1101 | isGoalDrawRoute = false; | 1103 | isGoalDrawRoute = false; |
| 1102 | 1104 | ||
| 1103 | gGrpLine.Children.Clear(); | 1105 | gGrpLine.Children.Clear(); |
| 1104 | gGrpRootLine.Children.Clear(); | 1106 | gGrpRootLine.Children.Clear(); |
| 1105 | gGrpCurverLine.Children.Clear(); | 1107 | gGrpCurverLine.Children.Clear(); |
| 1106 | gGrpRedNode.Children.Clear(); | 1108 | gGrpRedNode.Children.Clear(); |
| 1107 | gGrpYellowNode.Children.Clear(); | 1109 | gGrpYellowNode.Children.Clear(); |
| 1108 | gGrpBlueNode.Children.Clear(); | 1110 | gGrpBlueNode.Children.Clear(); |
| 1109 | 1111 | ||
| 1110 | this.Children.Remove(pLine); | 1112 | this.Children.Remove(pLine); |
| 1111 | this.Children.Remove(pRootLine); | 1113 | this.Children.Remove(pRootLine); |
| 1112 | this.Children.Remove(pCurverLine); | 1114 | this.Children.Remove(pCurverLine); |
| 1113 | this.Children.Remove(pRedNode); | 1115 | this.Children.Remove(pRedNode); |
| 1114 | this.Children.Remove(pYellowNode); | 1116 | this.Children.Remove(pYellowNode); |
| 1115 | this.Children.Remove(pBlueNode); | 1117 | this.Children.Remove(pBlueNode); |
| 1116 | } | 1118 | } |
| 1117 | 1119 | ||
| 1118 | /// <summary> | 1120 | /// <summary> |
| 1119 | /// Draw line for route | 1121 | /// Draw line for route |
| 1120 | /// </summary> | 1122 | /// </summary> |
| 1121 | /// <param name="startPoint">Start point</param> | 1123 | /// <param name="startPoint">Start point</param> |
| 1122 | /// <param name="endPoint">End point</param> | 1124 | /// <param name="endPoint">End point</param> |
| 1123 | /// <param name="geometryGroup">Geometry Group</param> | 1125 | /// <param name="geometryGroup">Geometry Group</param> |
| 1124 | private void DrawLine(Point startPoint, Point endPoint, GeometryGroup geometryGroup) | 1126 | private void DrawLine(Point startPoint, Point endPoint, GeometryGroup geometryGroup) |
| 1125 | { | 1127 | { |
| 1126 | LineGeometry lineGeometry = new LineGeometry(); | 1128 | LineGeometry lineGeometry = new LineGeometry(); |
| 1127 | lineGeometry.StartPoint = startPoint; | 1129 | lineGeometry.StartPoint = startPoint; |
| 1128 | lineGeometry.EndPoint = endPoint; | 1130 | lineGeometry.EndPoint = endPoint; |
| 1129 | geometryGroup.Children.Add(lineGeometry); | 1131 | geometryGroup.Children.Add(lineGeometry); |
| 1130 | } | 1132 | } |
| 1131 | 1133 | ||
| 1132 | /// <summary> | 1134 | /// <summary> |
| 1133 | /// Draw curver line | 1135 | /// Draw curver line |
| 1134 | /// </summary> | 1136 | /// </summary> |
| 1135 | /// <param name="startPoint">Point start curver line</param> | 1137 | /// <param name="startPoint">Point start curver line</param> |
| 1136 | /// <param name="endPoint">Point end curver line</param> | 1138 | /// <param name="endPoint">Point end curver line</param> |
| 1137 | /// <param name="radius">Radius</param> | 1139 | /// <param name="radius">Radius</param> |
| 1138 | /// <param name="geometryGroup">Geometry Group</param> | 1140 | /// <param name="geometryGroup">Geometry Group</param> |
| 1139 | private void DrawCurverLine(Point startPoint, Point endPoint, SweepDirection sweepDirection, GeometryGroup geometryGroup) | 1141 | private void DrawCurverLine(Point startPoint, Point endPoint, SweepDirection sweepDirection, GeometryGroup geometryGroup) |
| 1140 | { | 1142 | { |
| 1141 | PathGeometry pathGeometry = new PathGeometry(); | 1143 | PathGeometry pathGeometry = new PathGeometry(); |
| 1142 | PathFigure figure = new PathFigure(); | 1144 | PathFigure figure = new PathFigure(); |
| 1143 | figure.StartPoint = startPoint; | 1145 | figure.StartPoint = startPoint; |
| 1144 | figure.Segments.Add(new ArcSegment(endPoint, new Size(RADIUS_CURVER_LINE, RADIUS_CURVER_LINE), 90, false, sweepDirection, true)); | 1146 | figure.Segments.Add(new ArcSegment(endPoint, new Size(RADIUS_CURVER_LINE, RADIUS_CURVER_LINE), 90, false, sweepDirection, true)); |
| 1145 | pathGeometry.Figures.Add(figure); | 1147 | pathGeometry.Figures.Add(figure); |
| 1146 | geometryGroup.Children.Add(pathGeometry); | 1148 | geometryGroup.Children.Add(pathGeometry); |
| 1147 | } | 1149 | } |
| 1148 | 1150 | ||
| 1149 | /// <summary> | 1151 | /// <summary> |
| 1150 | /// Setting node | 1152 | /// Setting node |
| 1151 | /// </summary> | 1153 | /// </summary> |
| 1152 | /// <param name="centerPoit">Position of center node</param> | 1154 | /// <param name="centerPoit">Position of center node</param> |
| 1153 | /// <param name="geometryGroup">Geometry Group</param> | 1155 | /// <param name="geometryGroup">Geometry Group</param> |
| 1154 | private void AddNode(Point centerPoit, GeometryGroup geometryGroup) | 1156 | private void AddNode(Point centerPoit, GeometryGroup geometryGroup) |
| 1155 | { | 1157 | { |
| 1156 | double radius = RADIUS_NODE; | 1158 | double radius = RADIUS_NODE; |
| 1157 | geometryGroup.Children.Add(new EllipseGeometry(centerPoit, radius, radius)); | 1159 | geometryGroup.Children.Add(new EllipseGeometry(centerPoit, radius, radius)); |
| 1158 | } | 1160 | } |
| 1159 | 1161 | ||
| 1160 | /// <summary> | 1162 | /// <summary> |
| 1161 | /// Check line is vertical or horizontal | 1163 | /// Check line is vertical or horizontal |
| 1162 | /// </summary> | 1164 | /// </summary> |
| 1163 | /// <param name="line"></param> | 1165 | /// <param name="line"></param> |
| 1164 | /// <returns>true:Vertical, false:Horizontal</returns> | 1166 | /// <returns>true:Vertical, false:Horizontal</returns> |
| 1165 | private bool IsVerticalLine(LineGeometry line) | 1167 | private bool IsVerticalLine(LineGeometry line) |
| 1166 | { | 1168 | { |
| 1167 | if (line.StartPoint.X == line.EndPoint.X) | 1169 | if (line.StartPoint.X == line.EndPoint.X) |
| 1168 | { | 1170 | { |
| 1169 | // Vertical line | 1171 | // Vertical line |
| 1170 | return true; | 1172 | return true; |
| 1171 | } | 1173 | } |
| 1172 | 1174 | ||
| 1173 | // Horizontal line | 1175 | // Horizontal line |
| 1174 | return false; | 1176 | return false; |
| 1175 | } | 1177 | } |
| 1176 | 1178 | ||
| 1177 | /// <summary> | 1179 | /// <summary> |
| 1178 | /// Get distance between two point | 1180 | /// Get distance between two point |
| 1179 | /// </summary> | 1181 | /// </summary> |
| 1180 | /// <param name="point1">Point 1</param> | 1182 | /// <param name="point1">Point 1</param> |
| 1181 | /// <param name="point2">Point 2</param> | 1183 | /// <param name="point2">Point 2</param> |
| 1182 | /// <returns>Distance between two point</returns> | 1184 | /// <returns>Distance between two point</returns> |
| 1183 | private double GetDistance(Point point1, Point point2) | 1185 | private double GetDistance(Point point1, Point point2) |
| 1184 | { | 1186 | { |
| 1185 | //pythagorean theorem c^2 = a^2 + b^2 | 1187 | //pythagorean theorem c^2 = a^2 + b^2 |
| 1186 | //thus c = square root(a^2 + b^2) | 1188 | //thus c = square root(a^2 + b^2) |
| 1187 | double a = (double)(point2.X - point1.X); | 1189 | double a = (double)(point2.X - point1.X); |
| 1188 | double b = (double)(point2.Y - point1.Y); | 1190 | double b = (double)(point2.Y - point1.Y); |
| 1189 | 1191 | ||
| 1190 | return Math.Sqrt(a * a + b * b); | 1192 | return Math.Sqrt(a * a + b * b); |
| 1191 | } | 1193 | } |
| 1192 | 1194 | ||
| 1193 | /// <summary> | 1195 | /// <summary> |
| 1194 | /// Check point is valid for draw | 1196 | /// Check point is valid for draw |
| 1195 | /// </summary> | 1197 | /// </summary> |
| 1196 | /// <param name="point">Poit need check</param> | 1198 | /// <param name="point">Poit need check</param> |
| 1197 | /// <returns>true:Valid, false:Invalid</returns> | 1199 | /// <returns>true:Valid, false:Invalid</returns> |
| 1198 | private bool IsValidPoint(Point point) | 1200 | private bool IsValidPoint(Point point) |
| 1199 | { | 1201 | { |
| 1200 | return true; | 1202 | return true; |
| 1201 | } | 1203 | } |
| 1202 | 1204 | ||
| 1203 | /// <summary> | 1205 | /// <summary> |
| 1204 | /// Display coordinate position | 1206 | /// Display coordinate position |
| 1205 | /// </summary> | 1207 | /// </summary> |
| 1206 | /// <param name="point">Position to display</param> | 1208 | /// <param name="point">Position to display</param> |
| 1207 | private void DisplayCoordinate(Point point) | 1209 | private void DisplayCoordinate(Point point) |
| 1208 | { | 1210 | { |
| 1209 | if (_displayAxiPosition == null) | 1211 | if (_displayAxiPosition == null) |
| 1210 | { | 1212 | { |
| 1211 | _displayAxiPosition = new ucDisplayCoordinate(); | 1213 | _displayAxiPosition = new ucDisplayCoordinate(); |
| 1212 | this.Children.Add(_displayAxiPosition); | 1214 | this.Children.Add(_displayAxiPosition); |
| 1213 | } | 1215 | } |
| 1214 | _displayAxiPosition.Display(point); | 1216 | _displayAxiPosition.Display(point); |
| 1215 | } | 1217 | } |
| 1216 | 1218 | ||
| 1217 | #endregion | 1219 | #endregion |
| 1218 | 1220 | ||
| 1219 | #region Functions for Set Auto Nodes | 1221 | #region Functions for Set Auto Nodes |
| 1220 | 1222 | ||
| 1221 | /// <summary> | 1223 | /// <summary> |
| 1222 | /// SetAutoNodes | 1224 | /// SetAutoNodes |
| 1223 | /// </summary> | 1225 | /// </summary> |
| 1224 | public void SetAutoNodes() | 1226 | public void SetAutoNodes() |
| 1225 | { | 1227 | { |
| 1226 | double radiusStart = DISTANCE_START_NODES; | 1228 | double radiusStart = DISTANCE_START_NODES; |
| 1227 | double radiusEnd = DISTANCE_END_NODES; | 1229 | double radiusEnd = DISTANCE_END_NODES; |
| 1228 | double radiusCurver = RADIUS_CURVER_LINE; | 1230 | double radiusCurver = RADIUS_CURVER_LINE; |
| 1229 | 1231 | ||
| 1230 | Point startNode; | 1232 | Point startNode; |
| 1231 | Point endNode; | 1233 | Point endNode; |
| 1232 | 1234 | ||
| 1233 | gGrpBlueNode.Children.Clear(); | 1235 | gGrpBlueNode.Children.Clear(); |
| 1234 | 1236 | ||
| 1235 | if (gGrpLine.Children.Count == 1) | 1237 | if (gGrpLine.Children.Count == 1) |
| 1236 | radiusCurver = radiusEnd; | 1238 | radiusCurver = radiusEnd; |
| 1237 | 1239 | ||
| 1238 | if (gGrpLine.Children.Count > 0) | 1240 | if (gGrpLine.Children.Count > 0) |
| 1239 | { | 1241 | { |
| 1240 | for (int i = 0; i < gGrpLine.Children.Count; i++) | 1242 | for (int i = 0; i < gGrpLine.Children.Count; i++) |
| 1241 | { | 1243 | { |
| 1242 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[i]; | 1244 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[i]; |
| 1243 | if (i == 0) | 1245 | if (i == 0) |
| 1244 | { | 1246 | { |
| 1245 | startNode = lineGeometry.EndPoint; | 1247 | startNode = lineGeometry.EndPoint; |
| 1246 | endNode = lineGeometry.StartPoint; | 1248 | endNode = lineGeometry.StartPoint; |
| 1247 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusStart); | 1249 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusStart); |
| 1248 | } | 1250 | } |
| 1249 | else if (i == gGrpLine.Children.Count - 1 && i > 0) | 1251 | else if (i == gGrpLine.Children.Count - 1 && i > 0) |
| 1250 | { | 1252 | { |
| 1251 | startNode = lineGeometry.StartPoint; | 1253 | startNode = lineGeometry.StartPoint; |
| 1252 | endNode = lineGeometry.EndPoint; | 1254 | endNode = lineGeometry.EndPoint; |
| 1253 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusEnd); | 1255 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusEnd); |
| 1254 | } | 1256 | } |
| 1255 | else | 1257 | else |
| 1256 | { | 1258 | { |
| 1257 | startNode = lineGeometry.StartPoint; | 1259 | startNode = lineGeometry.StartPoint; |
| 1258 | endNode = lineGeometry.EndPoint; | 1260 | endNode = lineGeometry.EndPoint; |
| 1259 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusCurver); | 1261 | DrawAutoNodes(startNode, endNode, radiusCurver, radiusCurver); |
| 1260 | } | 1262 | } |
| 1261 | } | 1263 | } |
| 1262 | } | 1264 | } |
| 1263 | } | 1265 | } |
| 1264 | 1266 | ||
| 1265 | 1267 | ||
| 1266 | /// <summary> | 1268 | /// <summary> |
| 1267 | /// DrawAutoNodes | 1269 | /// DrawAutoNodes |
| 1268 | /// </summary> | 1270 | /// </summary> |
| 1269 | /// <param name="startNode"></param> | 1271 | /// <param name="startNode"></param> |
| 1270 | /// <param name="endNode"></param> | 1272 | /// <param name="endNode"></param> |
| 1271 | /// <param name="radiusStart"></param> | 1273 | /// <param name="radiusStart"></param> |
| 1272 | /// <param name="radiusEnd"></param> | 1274 | /// <param name="radiusEnd"></param> |
| 1273 | private void DrawAutoNodes(Point startNode, Point endNode, double radiusStart, double radiusEnd) | 1275 | private void DrawAutoNodes(Point startNode, Point endNode, double radiusStart, double radiusEnd) |
| 1274 | { | 1276 | { |
| 1275 | double distance = DISTANCE_AUTO_NODES; | 1277 | double distance = DISTANCE_AUTO_NODES; |
| 1276 | double i; | 1278 | double i; |
| 1277 | 1279 | ||
| 1278 | Point node; | 1280 | Point node; |
| 1279 | 1281 | ||
| 1280 | // Get postion of blue node on line | 1282 | // Get postion of blue node on line |
| 1281 | if (startNode.X == endNode.X) | 1283 | if (startNode.X == endNode.X) |
| 1282 | { | 1284 | { |
| 1283 | if (startNode.Y > endNode.Y) | 1285 | if (startNode.Y > endNode.Y) |
| 1284 | { | 1286 | { |
| 1285 | i = startNode.Y - radiusStart; | 1287 | i = startNode.Y - radiusStart; |
| 1286 | if (i - distance > endNode.Y + radiusEnd) | 1288 | if (i - distance > endNode.Y + radiusEnd) |
| 1287 | { | 1289 | { |
| 1288 | do | 1290 | do |
| 1289 | { | 1291 | { |
| 1290 | i = i - distance; | 1292 | i = i - distance; |
| 1291 | node = new Point(endNode.X, i); | 1293 | node = new Point(endNode.X, i); |
| 1292 | // Add node to postion distance 1000mm | 1294 | // Add node to postion distance 1000mm |
| 1293 | AddNode(node, gGrpBlueNode); | 1295 | AddNode(node, gGrpBlueNode); |
| 1294 | 1296 | ||
| 1295 | } while (i > endNode.Y + radiusEnd + distance); | 1297 | } while (i > endNode.Y + radiusEnd + distance); |
| 1296 | } | 1298 | } |
| 1297 | } | 1299 | } |
| 1298 | else | 1300 | else |
| 1299 | { | 1301 | { |
| 1300 | i = startNode.Y + radiusStart; | 1302 | i = startNode.Y + radiusStart; |
| 1301 | if (i + distance < endNode.Y - radiusEnd) | 1303 | if (i + distance < endNode.Y - radiusEnd) |
| 1302 | { | 1304 | { |
| 1303 | do | 1305 | do |
| 1304 | { | 1306 | { |
| 1305 | i = i + distance; | 1307 | i = i + distance; |
| 1306 | node = new Point(endNode.X, i); | 1308 | node = new Point(endNode.X, i); |
| 1307 | // Add node to postion distance 1000mm | 1309 | // Add node to postion distance 1000mm |
| 1308 | AddNode(node, gGrpBlueNode); | 1310 | AddNode(node, gGrpBlueNode); |
| 1309 | } while (i < endNode.Y - radiusEnd - distance); | 1311 | } while (i < endNode.Y - radiusEnd - distance); |
| 1310 | } | 1312 | } |
| 1311 | } | 1313 | } |
| 1312 | } | 1314 | } |
| 1313 | else | 1315 | else |
| 1314 | { | 1316 | { |
| 1315 | if (startNode.X > endNode.X) | 1317 | if (startNode.X > endNode.X) |
| 1316 | { | 1318 | { |
| 1317 | i = startNode.X - radiusStart; | 1319 | i = startNode.X - radiusStart; |
| 1318 | if (i - distance > endNode.X + radiusEnd) | 1320 | if (i - distance > endNode.X + radiusEnd) |
| 1319 | { | 1321 | { |
| 1320 | do | 1322 | do |
| 1321 | { | 1323 | { |
| 1322 | i = i - distance; | 1324 | i = i - distance; |
| 1323 | node = new Point(i, endNode.Y); | 1325 | node = new Point(i, endNode.Y); |
| 1324 | // Add node to postion distance 1000mm | 1326 | // Add node to postion distance 1000mm |
| 1325 | AddNode(node, gGrpBlueNode); | 1327 | AddNode(node, gGrpBlueNode); |
| 1326 | } while (i > endNode.X + radiusEnd + distance); | 1328 | } while (i > endNode.X + radiusEnd + distance); |
| 1327 | } | 1329 | } |
| 1328 | } | 1330 | } |
| 1329 | else | 1331 | else |
| 1330 | { | 1332 | { |
| 1331 | i = startNode.X + radiusStart; | 1333 | i = startNode.X + radiusStart; |
| 1332 | if (i + distance < endNode.X - radiusEnd) | 1334 | if (i + distance < endNode.X - radiusEnd) |
| 1333 | { | 1335 | { |
| 1334 | do | 1336 | do |
| 1335 | { | 1337 | { |
| 1336 | i = i + distance; | 1338 | i = i + distance; |
| 1337 | node = new Point(i, endNode.Y); | 1339 | node = new Point(i, endNode.Y); |
| 1338 | // Add node to postion distance 1000mm | 1340 | // Add node to postion distance 1000mm |
| 1339 | AddNode(node, gGrpBlueNode); | 1341 | AddNode(node, gGrpBlueNode); |
| 1340 | } while (i < endNode.X - radiusEnd - distance); | 1342 | } while (i < endNode.X - radiusEnd - distance); |
| 1341 | } | 1343 | } |
| 1342 | } | 1344 | } |
| 1343 | } | 1345 | } |
| 1344 | 1346 | ||
| 1345 | } | 1347 | } |
| 1346 | 1348 | ||
| 1347 | #endregion | 1349 | #endregion |
| 1348 | 1350 | ||
| 1349 | #region Functions for Set Free Nodes | 1351 | #region Functions for Set Free Nodes |
| 1350 | /// <summary> | 1352 | /// <summary> |
| 1351 | /// Draw Auto Blue node | 1353 | /// Draw Auto Blue node |
| 1352 | /// </summary> | 1354 | /// </summary> |
| 1353 | 1355 | ||
| 1354 | public void SetFreeNodes(Point FreeNode, bool RightClick) | 1356 | public void SetFreeNodes(Point FreeNode, bool RightClick) |
| 1355 | { | 1357 | { |
| 1356 | double radiusStart = DISTANCE_START_NODES; | 1358 | double radiusStart = DISTANCE_START_NODES; |
| 1357 | double radiusEnd = DISTANCE_END_NODES; | 1359 | double radiusEnd = DISTANCE_END_NODES; |
| 1358 | double radiusNode = RADIUS_NODE; | 1360 | double radiusNode = RADIUS_NODE; |
| 1359 | double radiusCurver = RADIUS_CURVER_LINE + RADIUS_NODE; | 1361 | double radiusCurver = RADIUS_CURVER_LINE + RADIUS_NODE; |
| 1360 | 1362 | ||
| 1361 | EllipseGeometry ellipseGeometry; | 1363 | EllipseGeometry ellipseGeometry; |
| 1362 | Point node; | 1364 | Point node; |
| 1363 | bool deleteFlag = false; | 1365 | bool deleteFlag = false; |
| 1364 | 1366 | ||
| 1365 | 1367 | ||
| 1366 | if (RightClick) | 1368 | if (RightClick) |
| 1367 | { | 1369 | { |
| 1368 | if (gGrpBlueNode.Children.Count > 0) | 1370 | if (gGrpBlueNode.Children.Count > 0) |
| 1369 | { | 1371 | { |
| 1370 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 1372 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 1371 | { | 1373 | { |
| 1372 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 1374 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 1373 | node = ellipseGeometry.Center; | 1375 | node = ellipseGeometry.Center; |
| 1374 | if (FreeNode.X == node.X) | 1376 | if (FreeNode.X == node.X) |
| 1375 | { | 1377 | { |
| 1376 | if (CheckIsNode(FreeNode, node, radiusNode)) | 1378 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 1377 | { | 1379 | { |
| 1378 | deleteFlag = true; | 1380 | deleteFlag = true; |
| 1379 | } | 1381 | } |
| 1380 | } | 1382 | } |
| 1381 | else | 1383 | else |
| 1382 | { | 1384 | { |
| 1383 | if (CheckIsNode(FreeNode, node, radiusNode)) | 1385 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 1384 | { | 1386 | { |
| 1385 | deleteFlag = true; | 1387 | deleteFlag = true; |
| 1386 | } | 1388 | } |
| 1387 | } | 1389 | } |
| 1388 | if (deleteFlag) | 1390 | if (deleteFlag) |
| 1389 | { | 1391 | { |
| 1390 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); | 1392 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); |
| 1391 | if (result == MessageBoxResult.OK) | 1393 | if (result == MessageBoxResult.OK) |
| 1392 | { | 1394 | { |
| 1393 | gGrpBlueNode.Children.RemoveAt(i); | 1395 | gGrpBlueNode.Children.RemoveAt(i); |
| 1394 | 1396 | ||
| 1395 | this.Children.Remove(NodeNo[i]); | 1397 | this.Children.Remove(NodeNo[i]); |
| 1396 | return; | 1398 | return; |
| 1397 | } | 1399 | } |
| 1398 | else | 1400 | else |
| 1399 | { | 1401 | { |
| 1400 | return; | 1402 | return; |
| 1401 | } | 1403 | } |
| 1402 | } | 1404 | } |
| 1403 | } | 1405 | } |
| 1404 | } | 1406 | } |
| 1405 | } | 1407 | } |
| 1406 | else | 1408 | else |
| 1407 | { | 1409 | { |
| 1408 | 1410 | ||
| 1409 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 1411 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 1410 | { | 1412 | { |
| 1411 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 1413 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 1412 | node = ellipseGeometry.Center; | 1414 | node = ellipseGeometry.Center; |
| 1413 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); | 1415 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); |
| 1414 | 1416 | ||
| 1415 | if (isEditNode) | 1417 | if (isEditNode) |
| 1416 | { | 1418 | { |
| 1417 | EditNode(node); | 1419 | EditNode(node); |
| 1418 | return; | 1420 | return; |
| 1419 | } | 1421 | } |
| 1420 | } | 1422 | } |
| 1421 | 1423 | ||
| 1422 | 1424 | ||
| 1423 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); | 1425 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); |
| 1424 | if (result == MessageBoxResult.OK) | 1426 | if (result == MessageBoxResult.OK) |
| 1425 | { | 1427 | { |
| 1426 | AddNode(FreeNode, gGrpBlueNode); | 1428 | AddNode(FreeNode, gGrpBlueNode); |
| 1427 | 1429 | ||
| 1428 | TextBlock textBlock = new TextBlock(); | 1430 | TextBlock textBlock = new TextBlock(); |
| 1429 | textBlock.Text = stt.ToString(); | 1431 | textBlock.Text = stt.ToString(); |
| 1430 | textBlock.FontSize = 17; | 1432 | textBlock.FontSize = 17; |
| 1431 | textBlock.Foreground = new SolidColorBrush(Colors.Red); | 1433 | textBlock.Foreground = new SolidColorBrush(Colors.Red); |
| 1432 | Canvas.SetLeft(textBlock, FreeNode.X - RADIUS_NODE / 2); | 1434 | Canvas.SetLeft(textBlock, FreeNode.X - RADIUS_NODE / 2); |
| 1433 | Canvas.SetTop(textBlock, FreeNode.Y - 1.5 * RADIUS_NODE); | 1435 | Canvas.SetTop(textBlock, FreeNode.Y - 1.5 * RADIUS_NODE); |
| 1434 | 1436 | ||
| 1435 | this.Children.Add(textBlock); | 1437 | this.Children.Add(textBlock); |
| 1436 | NodeNo.Add(textBlock); | 1438 | NodeNo.Add(textBlock); |
| 1437 | 1439 | ||
| 1438 | if (stt > 1) | 1440 | if (stt > 1) |
| 1439 | { | 1441 | { |
| 1440 | int tmp = gGrpBlueNode.Children.Count; | 1442 | int tmp = gGrpBlueNode.Children.Count; |
| 1441 | 1443 | ||
| 1442 | EllipseGeometry elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 2]; | 1444 | EllipseGeometry elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 2]; |
| 1443 | Point node1 = elip.Center; | 1445 | Point node1 = elip.Center; |
| 1444 | elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 1]; | 1446 | elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 1]; |
| 1445 | Point node2 = elip.Center; | 1447 | Point node2 = elip.Center; |
| 1446 | DrawLine(node1, node2, gGrpCurverLine); | 1448 | DrawLine(node1, node2, gGrpCurverLine); |
| 1447 | } | 1449 | } |
| 1448 | 1450 | ||
| 1449 | 1451 | ||
| 1450 | stt++; | 1452 | stt++; |
| 1451 | } | 1453 | } |
| 1452 | } | 1454 | } |
| 1453 | 1455 | ||
| 1454 | if (gGrpLine.Children.Count > 0) | 1456 | if (gGrpLine.Children.Count > 0) |
| 1455 | { | 1457 | { |
| 1456 | for (int i = 0; i < gGrpLine.Children.Count; i++) | 1458 | for (int i = 0; i < gGrpLine.Children.Count; i++) |
| 1457 | { | 1459 | { |
| 1458 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[i]; | 1460 | LineGeometry lineGeometry = (LineGeometry)gGrpLine.Children[i]; |
| 1459 | 1461 | ||
| 1460 | // Get postion of node on line | 1462 | // Get postion of node on line |
| 1461 | if (IsVerticalLine(lineGeometry)) | 1463 | if (IsVerticalLine(lineGeometry)) |
| 1462 | { | 1464 | { |
| 1463 | if (FreeNode.X < lineGeometry.EndPoint.X + radiusNode && FreeNode.X > lineGeometry.EndPoint.X - radiusNode) | 1465 | if (FreeNode.X < lineGeometry.EndPoint.X + radiusNode && FreeNode.X > lineGeometry.EndPoint.X - radiusNode) |
| 1464 | { | 1466 | { |
| 1465 | FreeNode.X = lineGeometry.EndPoint.X; | 1467 | FreeNode.X = lineGeometry.EndPoint.X; |
| 1466 | 1468 | ||
| 1467 | if (i == 0) | 1469 | if (i == 0) |
| 1468 | { | 1470 | { |
| 1469 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusStart, radiusCurver)) | 1471 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusStart, radiusCurver)) |
| 1470 | { | 1472 | { |
| 1471 | 1473 | ||
| 1472 | AddNode(FreeNode, gGrpBlueNode); | 1474 | AddNode(FreeNode, gGrpBlueNode); |
| 1473 | } | 1475 | } |
| 1474 | } | 1476 | } |
| 1475 | else if (i == gGrpLine.Children.Count - 1 && i > 0) | 1477 | else if (i == gGrpLine.Children.Count - 1 && i > 0) |
| 1476 | { | 1478 | { |
| 1477 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusEnd)) | 1479 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusEnd)) |
| 1478 | { | 1480 | { |
| 1479 | 1481 | ||
| 1480 | AddNode(FreeNode, gGrpBlueNode); | 1482 | AddNode(FreeNode, gGrpBlueNode); |
| 1481 | } | 1483 | } |
| 1482 | } | 1484 | } |
| 1483 | else | 1485 | else |
| 1484 | { | 1486 | { |
| 1485 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusCurver)) | 1487 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusCurver)) |
| 1486 | { | 1488 | { |
| 1487 | 1489 | ||
| 1488 | AddNode(FreeNode, gGrpBlueNode); | 1490 | AddNode(FreeNode, gGrpBlueNode); |
| 1489 | } | 1491 | } |
| 1490 | } | 1492 | } |
| 1491 | 1493 | ||
| 1492 | } | 1494 | } |
| 1493 | } | 1495 | } |
| 1494 | else | 1496 | else |
| 1495 | { | 1497 | { |
| 1496 | if (FreeNode.Y < lineGeometry.EndPoint.Y + radiusNode && FreeNode.Y > lineGeometry.EndPoint.Y - radiusNode) | 1498 | if (FreeNode.Y < lineGeometry.EndPoint.Y + radiusNode && FreeNode.Y > lineGeometry.EndPoint.Y - radiusNode) |
| 1497 | { | 1499 | { |
| 1498 | FreeNode.Y = lineGeometry.EndPoint.Y; | 1500 | FreeNode.Y = lineGeometry.EndPoint.Y; |
| 1499 | if (i == 0) | 1501 | if (i == 0) |
| 1500 | { | 1502 | { |
| 1501 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusStart, radiusCurver)) | 1503 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusStart, radiusCurver)) |
| 1502 | { | 1504 | { |
| 1503 | 1505 | ||
| 1504 | AddNode(FreeNode, gGrpBlueNode); | 1506 | AddNode(FreeNode, gGrpBlueNode); |
| 1505 | } | 1507 | } |
| 1506 | } | 1508 | } |
| 1507 | else if (i == gGrpLine.Children.Count - 1 && i > 0) | 1509 | else if (i == gGrpLine.Children.Count - 1 && i > 0) |
| 1508 | { | 1510 | { |
| 1509 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusEnd)) | 1511 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusEnd)) |
| 1510 | { | 1512 | { |
| 1511 | 1513 | ||
| 1512 | AddNode(FreeNode, gGrpBlueNode); | 1514 | AddNode(FreeNode, gGrpBlueNode); |
| 1513 | } | 1515 | } |
| 1514 | } | 1516 | } |
| 1515 | else | 1517 | else |
| 1516 | { | 1518 | { |
| 1517 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusCurver)) | 1519 | if (CheckFreeNodes(lineGeometry, FreeNode, radiusCurver, radiusCurver)) |
| 1518 | { | 1520 | { |
| 1519 | 1521 | ||
| 1520 | AddNode(FreeNode, gGrpBlueNode); | 1522 | AddNode(FreeNode, gGrpBlueNode); |
| 1521 | } | 1523 | } |
| 1522 | } | 1524 | } |
| 1523 | 1525 | ||
| 1524 | } | 1526 | } |
| 1525 | } | 1527 | } |
| 1526 | } | 1528 | } |
| 1527 | } | 1529 | } |
| 1528 | } | 1530 | } |
| 1529 | 1531 | ||
| 1530 | 1532 | ||
| 1531 | public bool CheckFreeNodes(LineGeometry lineNode, Point Freenode, double radiusStart, double radiusEnd) | 1533 | public bool CheckFreeNodes(LineGeometry lineNode, Point Freenode, double radiusStart, double radiusEnd) |
| 1532 | { | 1534 | { |
| 1533 | 1535 | ||
| 1534 | double distanceFreeNode = DISTANCE_FREE_NODES; | 1536 | double distanceFreeNode = DISTANCE_FREE_NODES; |
| 1535 | double radiusNode = RADIUS_NODE; | 1537 | double radiusNode = RADIUS_NODE; |
| 1536 | EllipseGeometry ellipseGeometry; | 1538 | EllipseGeometry ellipseGeometry; |
| 1537 | Point node; | 1539 | Point node; |
| 1538 | 1540 | ||
| 1539 | if (IsVerticalLine(lineNode)) | 1541 | if (IsVerticalLine(lineNode)) |
| 1540 | { | 1542 | { |
| 1541 | if (lineNode.StartPoint.Y < lineNode.EndPoint.Y) | 1543 | if (lineNode.StartPoint.Y < lineNode.EndPoint.Y) |
| 1542 | { | 1544 | { |
| 1543 | if (Freenode.Y < lineNode.StartPoint.Y + radiusStart || Freenode.Y > lineNode.EndPoint.Y - radiusEnd) | 1545 | if (Freenode.Y < lineNode.StartPoint.Y + radiusStart || Freenode.Y > lineNode.EndPoint.Y - radiusEnd) |
| 1544 | { | 1546 | { |
| 1545 | return false; | 1547 | return false; |
| 1546 | } | 1548 | } |
| 1547 | } | 1549 | } |
| 1548 | else | 1550 | else |
| 1549 | { | 1551 | { |
| 1550 | if (Freenode.Y > lineNode.StartPoint.Y - radiusStart || Freenode.Y < lineNode.EndPoint.Y + radiusEnd) | 1552 | if (Freenode.Y > lineNode.StartPoint.Y - radiusStart || Freenode.Y < lineNode.EndPoint.Y + radiusEnd) |
| 1551 | { | 1553 | { |
| 1552 | return false; | 1554 | return false; |
| 1553 | } | 1555 | } |
| 1554 | } | 1556 | } |
| 1555 | } | 1557 | } |
| 1556 | else | 1558 | else |
| 1557 | { | 1559 | { |
| 1558 | if (lineNode.StartPoint.X < lineNode.EndPoint.X) | 1560 | if (lineNode.StartPoint.X < lineNode.EndPoint.X) |
| 1559 | { | 1561 | { |
| 1560 | if (Freenode.X < lineNode.StartPoint.X + radiusStart || Freenode.X > lineNode.EndPoint.X - radiusEnd) | 1562 | if (Freenode.X < lineNode.StartPoint.X + radiusStart || Freenode.X > lineNode.EndPoint.X - radiusEnd) |
| 1561 | { | 1563 | { |
| 1562 | return false; | 1564 | return false; |
| 1563 | } | 1565 | } |
| 1564 | } | 1566 | } |
| 1565 | else | 1567 | else |
| 1566 | { | 1568 | { |
| 1567 | if (Freenode.X > lineNode.StartPoint.X - radiusStart || Freenode.X < lineNode.EndPoint.X + radiusEnd) | 1569 | if (Freenode.X > lineNode.StartPoint.X - radiusStart || Freenode.X < lineNode.EndPoint.X + radiusEnd) |
| 1568 | { | 1570 | { |
| 1569 | return false; | 1571 | return false; |
| 1570 | } | 1572 | } |
| 1571 | } | 1573 | } |
| 1572 | } | 1574 | } |
| 1573 | 1575 | ||
| 1574 | if (gGrpBlueNode.Children.Count > 0) | 1576 | if (gGrpBlueNode.Children.Count > 0) |
| 1575 | { | 1577 | { |
| 1576 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 1578 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 1577 | { | 1579 | { |
| 1578 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 1580 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 1579 | node = ellipseGeometry.Center; | 1581 | node = ellipseGeometry.Center; |
| 1580 | if (Freenode.X == node.X) | 1582 | if (Freenode.X == node.X) |
| 1581 | { | 1583 | { |
| 1582 | if (CheckIsNode(Freenode, node, radiusNode)) | 1584 | if (CheckIsNode(Freenode, node, radiusNode)) |
| 1583 | { | 1585 | { |
| 1584 | return false; | 1586 | return false; |
| 1585 | } | 1587 | } |
| 1586 | else if (Freenode.Y < node.Y + distanceFreeNode && Freenode.Y > node.Y - distanceFreeNode) | 1588 | else if (Freenode.Y < node.Y + distanceFreeNode && Freenode.Y > node.Y - distanceFreeNode) |
| 1587 | { | 1589 | { |
| 1588 | return false; | 1590 | return false; |
| 1589 | } | 1591 | } |
| 1590 | } | 1592 | } |
| 1591 | else if (Freenode.Y == node.Y) | 1593 | else if (Freenode.Y == node.Y) |
| 1592 | { | 1594 | { |
| 1593 | if (CheckIsNode(Freenode, node, radiusNode)) | 1595 | if (CheckIsNode(Freenode, node, radiusNode)) |
| 1594 | { | 1596 | { |
| 1595 | return false; | 1597 | return false; |
| 1596 | } | 1598 | } |
| 1597 | else if (Freenode.X < node.X + distanceFreeNode && Freenode.X > node.X - distanceFreeNode) | 1599 | else if (Freenode.X < node.X + distanceFreeNode && Freenode.X > node.X - distanceFreeNode) |
| 1598 | { | 1600 | { |
| 1599 | return false; | 1601 | return false; |
| 1600 | } | 1602 | } |
| 1601 | } | 1603 | } |
| 1602 | } | 1604 | } |
| 1603 | } | 1605 | } |
| 1604 | 1606 | ||
| 1605 | return true; | 1607 | return true; |
| 1606 | } | 1608 | } |
| 1607 | 1609 | ||
| 1608 | public bool CheckIsNode(Point FreeNode, Point Node, double radiusNode) | 1610 | public bool CheckIsNode(Point FreeNode, Point Node, double radiusNode) |
| 1609 | { | 1611 | { |
| 1610 | if (FreeNode.X < Node.X + radiusNode && FreeNode.X > Node.X - radiusNode && FreeNode.Y < Node.Y + radiusNode && FreeNode.Y > Node.Y - radiusNode) | 1612 | if (FreeNode.X < Node.X + radiusNode && FreeNode.X > Node.X - radiusNode && FreeNode.Y < Node.Y + radiusNode && FreeNode.Y > Node.Y - radiusNode) |
| 1611 | { | 1613 | { |
| 1612 | return true; | 1614 | return true; |
| 1613 | } | 1615 | } |
| 1614 | return false; | 1616 | return false; |
| 1615 | } | 1617 | } |
| 1616 | 1618 | ||
| 1617 | #endregion | 1619 | #endregion |
| 1618 | 1620 | ||
| 1619 | #region Edit Node | 1621 | #region Edit Node |
| 1620 | public void InitNodeInfo_List() | 1622 | public void InitNodeInfo_List() |
| 1621 | { | 1623 | { |
| 1622 | //Reset List | 1624 | //Reset List |
| 1623 | NodeInfo_List = new List<NodeInfo>(); | 1625 | NodeInfo_List = new List<NodeInfo>(); |
| 1624 | 1626 | ||
| 1625 | if (gGrpBlueNode.Children.Count > 0) | 1627 | if (gGrpBlueNode.Children.Count > 0) |
| 1626 | { | 1628 | { |
| 1627 | // Get start point | 1629 | // Get start point |
| 1628 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[0]; | 1630 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[0]; |
| 1629 | Point startPoint = lineGeometry.StartPoint; | 1631 | Point startPoint = lineGeometry.StartPoint; |
| 1630 | 1632 | ||
| 1631 | NodeInfo n1 = new NodeInfo(); | 1633 | NodeInfo n1 = new NodeInfo(); |
| 1632 | n1.X = startPoint.X; | 1634 | n1.X = startPoint.X; |
| 1633 | n1.Y = startPoint.Y; | 1635 | n1.Y = startPoint.Y; |
| 1634 | n1.Mode1 = ""; | 1636 | n1.Mode1 = ""; |
| 1635 | n1.Mode2 = ""; | 1637 | n1.Mode2 = ""; |
| 1636 | n1.Mode3 = ""; | 1638 | n1.Mode3 = ""; |
| 1637 | NodeInfo_List.Add(n1); | 1639 | NodeInfo_List.Add(n1); |
| 1638 | 1640 | ||
| 1639 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 1641 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 1640 | { | 1642 | { |
| 1641 | Point point; | 1643 | Point point; |
| 1642 | EllipseGeometry eGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 1644 | EllipseGeometry eGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 1643 | point = eGeometry.Center; | 1645 | point = eGeometry.Center; |
| 1644 | 1646 | ||
| 1645 | NodeInfo Ninfo = new NodeInfo(); | 1647 | NodeInfo Ninfo = new NodeInfo(); |
| 1646 | Ninfo.X = point.X; | 1648 | Ninfo.X = point.X; |
| 1647 | Ninfo.Y = point.Y; | 1649 | Ninfo.Y = point.Y; |
| 1648 | 1650 | ||
| 1649 | Ninfo.Mode1 = ""; | 1651 | Ninfo.Mode1 = ""; |
| 1650 | Ninfo.Mode2 = ""; | 1652 | Ninfo.Mode2 = ""; |
| 1651 | Ninfo.Mode3 = ""; | 1653 | Ninfo.Mode3 = ""; |
| 1652 | 1654 | ||
| 1653 | NodeInfo_List.Add(Ninfo); | 1655 | NodeInfo_List.Add(Ninfo); |
| 1654 | } | 1656 | } |
| 1655 | 1657 | ||
| 1656 | // Get end point | 1658 | // Get end point |
| 1657 | lineGeometry = (LineGeometry)gGrpLine.Children[gGrpLine.Children.Count - 1]; | 1659 | lineGeometry = (LineGeometry)gGrpLine.Children[gGrpLine.Children.Count - 1]; |
| 1658 | Point endPoint = lineGeometry.EndPoint; | 1660 | Point endPoint = lineGeometry.EndPoint; |
| 1659 | 1661 | ||
| 1660 | NodeInfo n2 = new NodeInfo(); | 1662 | NodeInfo n2 = new NodeInfo(); |
| 1661 | n2.X = startPoint.X; | 1663 | n2.X = startPoint.X; |
| 1662 | n2.Y = startPoint.Y; | 1664 | n2.Y = startPoint.Y; |
| 1663 | n2.Mode1 = ""; | 1665 | n2.Mode1 = ""; |
| 1664 | n2.Mode2 = ""; | 1666 | n2.Mode2 = ""; |
| 1665 | n2.Mode3 = ""; | 1667 | n2.Mode3 = ""; |
| 1666 | NodeInfo_List.Add(n2); | 1668 | NodeInfo_List.Add(n2); |
| 1667 | 1669 | ||
| 1668 | //Resort NodeInfo_List From Start to Goal | 1670 | //Resort NodeInfo_List From Start to Goal |
| 1669 | LineGeometry firstLine = (LineGeometry)gGrpLine.Children[0]; | 1671 | LineGeometry firstLine = (LineGeometry)gGrpLine.Children[0]; |
| 1670 | Point startNode = firstLine.StartPoint; | 1672 | Point startNode = firstLine.StartPoint; |
| 1671 | Point endNode = firstLine.EndPoint; | 1673 | Point endNode = firstLine.EndPoint; |
| 1672 | 1674 | ||
| 1673 | 1675 | ||
| 1674 | List<NodeInfo> tmpLst = new List<NodeInfo>(); | 1676 | List<NodeInfo> tmpLst = new List<NodeInfo>(); |
| 1675 | 1677 | ||
| 1676 | // Create temp List | 1678 | // Create temp List |
| 1677 | if (startNode.X == endNode.X) | 1679 | if (startNode.X == endNode.X) |
| 1678 | { | 1680 | { |
| 1679 | for (int i = 1; i < NodeInfo_List.Count; i++) | 1681 | for (int i = 1; i < NodeInfo_List.Count; i++) |
| 1680 | { | 1682 | { |
| 1681 | if (NodeInfo_List[i].X != endNode.X) | 1683 | if (NodeInfo_List[i].X != endNode.X) |
| 1682 | { | 1684 | { |
| 1683 | break; | 1685 | break; |
| 1684 | } | 1686 | } |
| 1685 | else | 1687 | else |
| 1686 | { | 1688 | { |
| 1687 | tmpLst.Add(NodeInfo_List[i]); | 1689 | tmpLst.Add(NodeInfo_List[i]); |
| 1688 | } | 1690 | } |
| 1689 | } | 1691 | } |
| 1690 | } | 1692 | } |
| 1691 | 1693 | ||
| 1692 | if (startNode.Y == endNode.Y) | 1694 | if (startNode.Y == endNode.Y) |
| 1693 | { | 1695 | { |
| 1694 | for (int i = 1; i < NodeInfo_List.Count; i++) | 1696 | for (int i = 1; i < NodeInfo_List.Count; i++) |
| 1695 | { | 1697 | { |
| 1696 | if (NodeInfo_List[i].Y != endNode.Y) | 1698 | if (NodeInfo_List[i].Y != endNode.Y) |
| 1697 | { | 1699 | { |
| 1698 | break; | 1700 | break; |
| 1699 | } | 1701 | } |
| 1700 | else | 1702 | else |
| 1701 | { | 1703 | { |
| 1702 | tmpLst.Add(NodeInfo_List[i]); | 1704 | tmpLst.Add(NodeInfo_List[i]); |
| 1703 | } | 1705 | } |
| 1704 | } | 1706 | } |
| 1705 | } | 1707 | } |
| 1706 | 1708 | ||
| 1707 | // Sort NodeInfo_List | 1709 | // Sort NodeInfo_List |
| 1708 | for (int i = 0; i < tmpLst.Count; i++) | 1710 | for (int i = 0; i < tmpLst.Count; i++) |
| 1709 | { | 1711 | { |
| 1710 | NodeInfo_List[i + 1] = tmpLst[tmpLst.Count - 1 - i]; | 1712 | NodeInfo_List[i + 1] = tmpLst[tmpLst.Count - 1 - i]; |
| 1711 | } | 1713 | } |
| 1712 | 1714 | ||
| 1713 | } | 1715 | } |
| 1714 | } | 1716 | } |
| 1715 | 1717 | ||
| 1716 | 1718 | ||
| 1717 | public void EditNode(Point node_edited) | 1719 | public void EditNode(Point node_edited) |
| 1718 | { | 1720 | { |
| 1719 | EllipseGeometry ellipseGeometry; | 1721 | EllipseGeometry ellipseGeometry; |
| 1720 | Point node; | 1722 | Point node; |
| 1721 | double radiusNode = RADIUS_NODE; | 1723 | double radiusNode = RADIUS_NODE; |
| 1722 | 1724 | ||
| 1723 | bool flag = false; | 1725 | bool flag = false; |
| 1724 | 1726 | ||
| 1725 | if (gGrpBlueNode.Children.Count > 0) | 1727 | if (gGrpBlueNode.Children.Count > 0) |
| 1726 | { | 1728 | { |
| 1727 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 1729 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 1728 | { | 1730 | { |
| 1729 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 1731 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 1730 | node = ellipseGeometry.Center; | 1732 | node = ellipseGeometry.Center; |
| 1731 | 1733 | ||
| 1732 | if (CheckIsNode(node_edited, node, radiusNode)) | 1734 | if (CheckIsNode(node_edited, node, radiusNode)) |
| 1733 | { | 1735 | { |
| 1734 | flag = true; | 1736 | flag = true; |
| 1735 | } | 1737 | } |
| 1736 | 1738 | ||
| 1737 | if (flag) | 1739 | if (flag) |
| 1738 | { | 1740 | { |
| 1739 | node_edited.X = node.X; | 1741 | node_edited.X = node.X; |
| 1740 | node_edited.Y = node.Y; | 1742 | node_edited.Y = node.Y; |
| 1741 | 1743 | ||
| 1742 | // show form edit node | 1744 | // show form edit node |
| 1743 | EditNodeWindow edtNodeWindow = new EditNodeWindow(); | 1745 | EditNodeWindow edtNodeWindow = new EditNodeWindow(); |
| 1744 | edtNodeWindow.ShowDialog(); | 1746 | edtNodeWindow.ShowDialog(); |
| 1745 | 1747 | ||
| 1746 | string result1 = edtNodeWindow._txtMode1; | 1748 | string result1 = edtNodeWindow._txtMode1; |
| 1747 | string result2 = edtNodeWindow._txtMode2; | 1749 | string result2 = edtNodeWindow._txtMode2; |
| 1748 | string result3 = edtNodeWindow._txtMode3; | 1750 | string result3 = edtNodeWindow._txtMode3; |
| 1749 | bool exit = edtNodeWindow._ExitFlg; | 1751 | bool exit = edtNodeWindow._ExitFlg; |
| 1750 | 1752 | ||
| 1751 | if (!exit) | 1753 | if (!exit) |
| 1752 | { | 1754 | { |
| 1753 | SaveChanged(node_edited.X, node_edited.Y, result1, result2, result3); | 1755 | SaveChanged(node_edited.X, node_edited.Y, result1, result2, result3); |
| 1754 | } | 1756 | } |
| 1755 | 1757 | ||
| 1756 | return; | 1758 | return; |
| 1757 | } | 1759 | } |
| 1758 | } | 1760 | } |
| 1759 | } | 1761 | } |
| 1760 | } | 1762 | } |
| 1761 | 1763 | ||
| 1762 | public void SaveChanged(double x, double y, string st1, string st2, string st3) | 1764 | public void SaveChanged(double x, double y, string st1, string st2, string st3) |
| 1763 | { | 1765 | { |
| 1764 | for (int i = 0; i < NodeInfo_List.Count; i++) | 1766 | for (int i = 0; i < NodeInfo_List.Count; i++) |
| 1765 | { | 1767 | { |
| 1766 | NodeInfo ni = new NodeInfo(); | 1768 | NodeInfo ni = new NodeInfo(); |
| 1767 | ni = NodeInfo_List[i]; | 1769 | ni = NodeInfo_List[i]; |
| 1768 | 1770 | ||
| 1769 | if (ni.X == x && ni.Y == y) | 1771 | if (ni.X == x && ni.Y == y) |
| 1770 | { | 1772 | { |
| 1771 | 1773 | ||
| 1772 | ni.Mode1 = st1; | 1774 | ni.Mode1 = st1; |
| 1773 | ni.Mode2 = st2; | 1775 | ni.Mode2 = st2; |
| 1774 | ni.Mode3 = st3; | 1776 | ni.Mode3 = st3; |
| 1775 | 1777 | ||
| 1776 | NodeInfo_List[i] = ni; | 1778 | NodeInfo_List[i] = ni; |
| 1777 | return; | 1779 | return; |
| 1778 | } | 1780 | } |
| 1779 | } | 1781 | } |
| 1780 | } | 1782 | } |
| 1781 | 1783 | ||
| 1782 | 1784 | ||
| 1783 | #endregion | 1785 | #endregion |
| 1784 | 1786 | ||
| 1785 | #region Display RouteInfo | 1787 | #region Display RouteInfo |
| 1786 | 1788 | ||
| 1787 | public void DspRouteInfo() | 1789 | public void DspRouteInfo() |
| 1788 | { | 1790 | { |
| 1789 | //Clear Route Info Table | 1791 | //Clear Route Info Table |
| 1790 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); | 1792 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); |
| 1791 | 1793 | ||
| 1792 | if (NodeInfo_List.Count != 0) | 1794 | if (NodeInfo_List.Count != 0) |
| 1793 | { | 1795 | { |
| 1794 | int _RowIdx = 0; | 1796 | int _RowIdx = 0; |
| 1795 | string _Content = ""; | 1797 | string _Content = ""; |
| 1796 | 1798 | ||
| 1797 | for (int i = 0; i < NodeInfo_List.Count; i++) | 1799 | for (int i = 0; i < NodeInfo_List.Count; i++) |
| 1798 | { | 1800 | { |
| 1799 | 1801 | ||
| 1800 | NodeInfo ni = new NodeInfo(); | 1802 | NodeInfo ni = new NodeInfo(); |
| 1801 | ni = NodeInfo_List[i]; | 1803 | ni = NodeInfo_List[i]; |
| 1802 | 1804 | ||
| 1803 | //column 1 | 1805 | //column 1 |
| 1804 | if (i == 0) | 1806 | if (i == 0) |
| 1805 | { | 1807 | { |
| 1806 | _Content = "S"; | 1808 | _Content = "S"; |
| 1807 | } | 1809 | } |
| 1808 | else if (i == NodeInfo_List.Count - 1) | 1810 | else if (i == NodeInfo_List.Count - 1) |
| 1809 | { | 1811 | { |
| 1810 | _Content = "G"; | 1812 | _Content = "G"; |
| 1811 | } | 1813 | } |
| 1812 | else | 1814 | else |
| 1813 | { | 1815 | { |
| 1814 | _Content = i.ToString(); | 1816 | _Content = i.ToString(); |
| 1815 | } | 1817 | } |
| 1816 | AddLabeltoGrid(_RowIdx, 0, _Content); | 1818 | AddLabeltoGrid(_RowIdx, 0, _Content); |
| 1817 | 1819 | ||
| 1818 | //column 2 | 1820 | //column 2 |
| 1819 | // Display Node's Position | 1821 | // Display Node's Position |
| 1820 | _Content = ni.X + ", " + ni.Y; | 1822 | _Content = ni.X + ", " + ni.Y; |
| 1821 | AddLabeltoGrid(_RowIdx, 1, _Content); | 1823 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 1822 | 1824 | ||
| 1823 | // Display Node's Field | 1825 | // Display Node's Field |
| 1824 | if (ni.Mode1 != "" && ni.Mode1 != null) | 1826 | if (ni.Mode1 != "" && ni.Mode1 != null) |
| 1825 | { | 1827 | { |
| 1826 | char delimiterChars = '_'; | 1828 | char delimiterChars = '_'; |
| 1827 | string[] tmp = ni.Mode1.Split(delimiterChars); | 1829 | string[] tmp = ni.Mode1.Split(delimiterChars); |
| 1828 | foreach (string s in tmp) | 1830 | foreach (string s in tmp) |
| 1829 | { | 1831 | { |
| 1830 | _RowIdx++; | 1832 | _RowIdx++; |
| 1831 | delimiterChars = ':'; | 1833 | delimiterChars = ':'; |
| 1832 | 1834 | ||
| 1833 | if (s.Split(delimiterChars)[0] == "Mode") | 1835 | if (s.Split(delimiterChars)[0] == "Mode") |
| 1834 | { | 1836 | { |
| 1835 | double distance = 0; | 1837 | double distance = 0; |
| 1836 | if (i == NodeInfo_List.Count - 1) | 1838 | if (i == NodeInfo_List.Count - 1) |
| 1837 | { | 1839 | { |
| 1838 | distance = 0; | 1840 | distance = 0; |
| 1839 | } | 1841 | } |
| 1840 | else | 1842 | else |
| 1841 | { | 1843 | { |
| 1842 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); | 1844 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); |
| 1843 | } | 1845 | } |
| 1844 | _Content = "MOVE " + distance.ToString() + "mm"; | 1846 | _Content = "MOVE " + distance.ToString() + "mm"; |
| 1845 | } | 1847 | } |
| 1846 | else | 1848 | else |
| 1847 | { | 1849 | { |
| 1848 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; | 1850 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; |
| 1849 | } | 1851 | } |
| 1850 | 1852 | ||
| 1851 | AddLabeltoGrid(_RowIdx, 1, _Content); | 1853 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 1852 | } | 1854 | } |
| 1853 | } | 1855 | } |
| 1854 | 1856 | ||
| 1855 | if (ni.Mode2 != "" && ni.Mode2 != null) | 1857 | if (ni.Mode2 != "" && ni.Mode2 != null) |
| 1856 | { | 1858 | { |
| 1857 | char delimiterChars = '_'; | 1859 | char delimiterChars = '_'; |
| 1858 | string[] tmp = ni.Mode2.Split(delimiterChars); | 1860 | string[] tmp = ni.Mode2.Split(delimiterChars); |
| 1859 | foreach (string s in tmp) | 1861 | foreach (string s in tmp) |
| 1860 | { | 1862 | { |
| 1861 | _RowIdx++; | 1863 | _RowIdx++; |
| 1862 | delimiterChars = ':'; | 1864 | delimiterChars = ':'; |
| 1863 | 1865 | ||
| 1864 | if (s.Split(delimiterChars)[0] == "Mode") | 1866 | if (s.Split(delimiterChars)[0] == "Mode") |
| 1865 | { | 1867 | { |
| 1866 | double distance = 0; | 1868 | double distance = 0; |
| 1867 | if (i == NodeInfo_List.Count - 1) | 1869 | if (i == NodeInfo_List.Count - 1) |
| 1868 | { | 1870 | { |
| 1869 | distance = 0; | 1871 | distance = 0; |
| 1870 | } | 1872 | } |
| 1871 | else | 1873 | else |
| 1872 | { | 1874 | { |
| 1873 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); | 1875 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); |
| 1874 | } | 1876 | } |
| 1875 | _Content = "MOVE " + distance.ToString() + "mm"; | 1877 | _Content = "MOVE " + distance.ToString() + "mm"; |
| 1876 | } | 1878 | } |
| 1877 | else | 1879 | else |
| 1878 | { | 1880 | { |
| 1879 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; | 1881 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; |
| 1880 | } | 1882 | } |
| 1881 | 1883 | ||
| 1882 | AddLabeltoGrid(_RowIdx, 1, _Content); | 1884 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 1883 | } | 1885 | } |
| 1884 | } | 1886 | } |
| 1885 | 1887 | ||
| 1886 | if (ni.Mode3 != "" && ni.Mode3 != null) | 1888 | if (ni.Mode3 != "" && ni.Mode3 != null) |
| 1887 | { | 1889 | { |
| 1888 | char delimiterChars = '_'; | 1890 | char delimiterChars = '_'; |
| 1889 | string[] tmp = ni.Mode3.Split(delimiterChars); | 1891 | string[] tmp = ni.Mode3.Split(delimiterChars); |
| 1890 | foreach (string s in tmp) | 1892 | foreach (string s in tmp) |
| 1891 | { | 1893 | { |
| 1892 | _RowIdx++; | 1894 | _RowIdx++; |
| 1893 | delimiterChars = ':'; | 1895 | delimiterChars = ':'; |
| 1894 | 1896 | ||
| 1895 | if (s.Split(delimiterChars)[0] == "Mode") | 1897 | if (s.Split(delimiterChars)[0] == "Mode") |
| 1896 | { | 1898 | { |
| 1897 | double distance = 0; | 1899 | double distance = 0; |
| 1898 | if (i == NodeInfo_List.Count - 1) | 1900 | if (i == NodeInfo_List.Count - 1) |
| 1899 | { | 1901 | { |
| 1900 | distance = 0; | 1902 | distance = 0; |
| 1901 | } | 1903 | } |
| 1902 | else | 1904 | else |
| 1903 | { | 1905 | { |
| 1904 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); | 1906 | distance = DistanceCalculate(NodeInfo_List[i].X, NodeInfo_List[i].Y, NodeInfo_List[i + 1].X, NodeInfo_List[i + 1].Y); |
| 1905 | } | 1907 | } |
| 1906 | _Content = "MOVE " + distance.ToString() + "mm"; | 1908 | _Content = "MOVE " + distance.ToString() + "mm"; |
| 1907 | } | 1909 | } |
| 1908 | else | 1910 | else |
| 1909 | { | 1911 | { |
| 1910 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; | 1912 | _Content = s.Split(delimiterChars)[0] + " " + s.Split(delimiterChars)[1]; |
| 1911 | } | 1913 | } |
| 1912 | 1914 | ||
| 1913 | AddLabeltoGrid(_RowIdx, 1, _Content); | 1915 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 1914 | } | 1916 | } |
| 1915 | } | 1917 | } |
| 1916 | _RowIdx++; | 1918 | _RowIdx++; |
| 1917 | } | 1919 | } |
| 1918 | } | 1920 | } |
| 1919 | } | 1921 | } |
| 1920 | 1922 | ||
| 1921 | public double DistanceCalculate(double _X1, double _Y1, double _X2, double _Y2) | 1923 | public double DistanceCalculate(double _X1, double _Y1, double _X2, double _Y2) |
| 1922 | { | 1924 | { |
| 1923 | double dist = 0; | 1925 | double dist = 0; |
| 1924 | 1926 | ||
| 1925 | if (_X1 == _X2) | 1927 | if (_X1 == _X2) |
| 1926 | { | 1928 | { |
| 1927 | dist = System.Math.Abs(_Y1 - _Y2) * DISTANCE_RATIO; | 1929 | dist = System.Math.Abs(_Y1 - _Y2) * DISTANCE_RATIO; |
| 1928 | } | 1930 | } |
| 1929 | else if (_Y1 == _Y2) | 1931 | else if (_Y1 == _Y2) |
| 1930 | { | 1932 | { |
| 1931 | dist = System.Math.Abs(_X1 - _X2) * DISTANCE_RATIO; | 1933 | dist = System.Math.Abs(_X1 - _X2) * DISTANCE_RATIO; |
| 1932 | } | 1934 | } |
| 1933 | return dist; | 1935 | return dist; |
| 1934 | } | 1936 | } |
| 1935 | 1937 | ||
| 1936 | public void AddLabeltoGrid(int RowIdx, int ColIdx, string Content) | 1938 | public void AddLabeltoGrid(int RowIdx, int ColIdx, string Content) |
| 1937 | { | 1939 | { |
| 1938 | //Add Row to Grid | 1940 | //Add Row to Grid |
| 1939 | RowDefinition _rd = new RowDefinition(); | 1941 | RowDefinition _rd = new RowDefinition(); |
| 1940 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.RowDefinitions.Add(_rd); | 1942 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.RowDefinitions.Add(_rd); |
| 1941 | 1943 | ||
| 1942 | // Add data to Grid | 1944 | // Add data to Grid |
| 1943 | Label dynamicLabel = new Label(); | 1945 | Label dynamicLabel = new Label(); |
| 1944 | 1946 | ||
| 1945 | dynamicLabel.Content = Content; | 1947 | dynamicLabel.Content = Content; |
| 1946 | dynamicLabel.Margin = new Thickness(0, 0, 0, 0); | 1948 | dynamicLabel.Margin = new Thickness(0, 0, 0, 0); |
| 1947 | dynamicLabel.Foreground = new SolidColorBrush(Colors.Black); | 1949 | dynamicLabel.Foreground = new SolidColorBrush(Colors.Black); |
| 1948 | dynamicLabel.Background = new SolidColorBrush(Colors.White); | 1950 | dynamicLabel.Background = new SolidColorBrush(Colors.White); |
| 1949 | dynamicLabel.BorderBrush = new SolidColorBrush(Colors.LightGray); | 1951 | dynamicLabel.BorderBrush = new SolidColorBrush(Colors.LightGray); |
| 1950 | dynamicLabel.BorderThickness = new Thickness(1); | 1952 | dynamicLabel.BorderThickness = new Thickness(1); |
| 1951 | 1953 | ||
| 1952 | Grid.SetRow(dynamicLabel, RowIdx); | 1954 | Grid.SetRow(dynamicLabel, RowIdx); |
| 1953 | Grid.SetColumn(dynamicLabel, ColIdx); | 1955 | Grid.SetColumn(dynamicLabel, ColIdx); |
| 1954 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Add(dynamicLabel); | 1956 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Add(dynamicLabel); |
| 1955 | } | 1957 | } |
| 1956 | #endregion | 1958 | #endregion |
| 1957 | 1959 | ||
| 1958 | 1960 | ||
| 1959 | public void CreateGoalPoint() | 1961 | public void CreateGoalPoint() |
| 1960 | { | 1962 | { |
| 1961 | if (isGoalDrawRoute) | 1963 | if (isGoalDrawRoute) |
| 1962 | { | 1964 | { |
| 1963 | return; | 1965 | return; |
| 1964 | } | 1966 | } |
| 1965 | 1967 | ||
| 1966 | isStartDrawRoute = false; | 1968 | isStartDrawRoute = false; |
| 1967 | if (_goalPoint == null) | 1969 | if (_goalPoint == null) |
| 1968 | { | 1970 | { |
| 1969 | _goalPoint = new ucStartEndButton(); | 1971 | _goalPoint = new ucStartEndButton(); |
| 1970 | _goalPoint.btnWidth = 50.0; | 1972 | _goalPoint.btnWidth = 50.0; |
| 1971 | _goalPoint.btnHeight = 50.0; | 1973 | _goalPoint.btnHeight = 50.0; |
| 1972 | _goalPoint.buttText = "G"; | 1974 | _goalPoint.buttText = "G"; |
| 1973 | Canvas.SetLeft(_goalPoint, 675); | 1975 | Canvas.SetLeft(_goalPoint, 675); |
| 1974 | Canvas.SetTop(_goalPoint, 75); | 1976 | Canvas.SetTop(_goalPoint, 75); |
| 1975 | this.Children.Add(_goalPoint); | 1977 | this.Children.Add(_goalPoint); |
| 1976 | } | 1978 | } |
| 1977 | } | 1979 | } |
| 1978 | 1980 | ||
| 1979 | public void CreateStartPoint() | 1981 | public void CreateStartPoint() |
| 1980 | { | 1982 | { |
| 1981 | if (isGoalDrawRoute) | 1983 | if (isGoalDrawRoute) |
| 1982 | { | 1984 | { |
| 1983 | return; | 1985 | return; |
| 1984 | } | 1986 | } |
| 1985 | 1987 | ||
| 1986 | isStartDrawRoute = false; | 1988 | isStartDrawRoute = false; |
| 1987 | if (_startPoint == null) | 1989 | if (_startPoint == null) |
| 1988 | { | 1990 | { |
| 1989 | _startPoint = new ucStartEndButton(); | 1991 | _startPoint = new ucStartEndButton(); |
| 1990 | _startPoint.btnWidth = 50.0; | 1992 | _startPoint.btnWidth = 50.0; |
| 1991 | _startPoint.btnHeight = 50.0; | 1993 | _startPoint.btnHeight = 50.0; |
| 1992 | _startPoint.buttText = "S"; | 1994 | _startPoint.buttText = "S"; |
| 1993 | Canvas.SetLeft(_startPoint, 75); | 1995 | Canvas.SetLeft(_startPoint, 75); |
| 1994 | Canvas.SetTop(_startPoint, 675); | 1996 | Canvas.SetTop(_startPoint, 675); |
| 1995 | this.Children.Add(_startPoint); | 1997 | this.Children.Add(_startPoint); |
| 1996 | } | 1998 | } |
| 1997 | } | 1999 | } |
| 1998 | 2000 | ||
| 1999 | 2001 | ||
| 2000 | #region Draw New FreeNode | 2002 | #region Draw New FreeNode |
| 2001 | 2003 | ||
| 2002 | /// <summary> | 2004 | /// <summary> |
| 2003 | /// Draw Auto Blue node | 2005 | /// Draw Auto Blue node |
| 2004 | /// </summary> | 2006 | /// </summary> |
| 2005 | 2007 | ||
| 2006 | 2008 | ||
| 2007 | public void NewSetFreeNodes(Point FreeNode, bool RightClick) | 2009 | public void NewSetFreeNodes(Point FreeNode, bool RightClick) |
| 2008 | { | 2010 | { |
| 2009 | double radiusNode = RADIUS_NODE; | 2011 | double radiusNode = RADIUS_NODE; |
| 2010 | 2012 | ||
| 2011 | EllipseGeometry ellipseGeometry; | 2013 | EllipseGeometry ellipseGeometry; |
| 2012 | Point node; | 2014 | Point node; |
| 2013 | bool deleteFlag = false; | 2015 | bool deleteFlag = false; |
| 2014 | 2016 | ||
| 2015 | 2017 | ||
| 2016 | if (RightClick) | 2018 | if (RightClick) |
| 2017 | { | 2019 | { |
| 2018 | if (gGrpBlueNode.Children.Count > 0) | 2020 | if (gGrpBlueNode.Children.Count > 0) |
| 2019 | { | 2021 | { |
| 2020 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2022 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2021 | { | 2023 | { |
| 2022 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2024 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2023 | node = ellipseGeometry.Center; | 2025 | node = ellipseGeometry.Center; |
| 2024 | if (FreeNode.X == node.X) | 2026 | if (FreeNode.X == node.X) |
| 2025 | { | 2027 | { |
| 2026 | if (CheckIsNode(FreeNode, node, radiusNode)) | 2028 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 2027 | { | 2029 | { |
| 2028 | deleteFlag = true; | 2030 | deleteFlag = true; |
| 2029 | } | 2031 | } |
| 2030 | } | 2032 | } |
| 2031 | else | 2033 | else |
| 2032 | { | 2034 | { |
| 2033 | if (CheckIsNode(FreeNode, node, radiusNode)) | 2035 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 2034 | { | 2036 | { |
| 2035 | deleteFlag = true; | 2037 | deleteFlag = true; |
| 2036 | } | 2038 | } |
| 2037 | } | 2039 | } |
| 2038 | if (deleteFlag) | 2040 | if (deleteFlag) |
| 2039 | { | 2041 | { |
| 2040 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); | 2042 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); |
| 2041 | if (result == MessageBoxResult.OK) | 2043 | if (result == MessageBoxResult.OK) |
| 2042 | { | 2044 | { |
| 2043 | //Call Function Delete Node | 2045 | //Call Function Delete Node |
| 2044 | DeleteNode(i); | 2046 | DeleteNode(i); |
| 2045 | 2047 | ||
| 2046 | return; | 2048 | return; |
| 2047 | } | 2049 | } |
| 2048 | else | 2050 | else |
| 2049 | { | 2051 | { |
| 2050 | return; | 2052 | return; |
| 2051 | } | 2053 | } |
| 2052 | } | 2054 | } |
| 2053 | } | 2055 | } |
| 2054 | } | 2056 | } |
| 2055 | } | 2057 | } |
| 2056 | else | 2058 | else |
| 2057 | { | 2059 | { |
| 2058 | //Check EditNode State | 2060 | //Check EditNode State |
| 2059 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2061 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2060 | { | 2062 | { |
| 2061 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2063 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2062 | node = ellipseGeometry.Center; | 2064 | node = ellipseGeometry.Center; |
| 2063 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); | 2065 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); |
| 2064 | 2066 | ||
| 2065 | if (isEditNode) | 2067 | if (isEditNode) |
| 2066 | { | 2068 | { |
| 2067 | NewEditNode(node); | 2069 | NewEditNode(node); |
| 2068 | NewDspRouteInfo(); | 2070 | NewDspRouteInfo(); |
| 2069 | return; | 2071 | return; |
| 2070 | } | 2072 | } |
| 2071 | } | 2073 | } |
| 2072 | 2074 | ||
| 2073 | 2075 | ||
| 2074 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); | 2076 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); |
| 2075 | if (result == MessageBoxResult.OK) | 2077 | if (result == MessageBoxResult.OK) |
| 2076 | { | 2078 | { |
| 2077 | AddNode(FreeNode, gGrpBlueNode); | 2079 | AddNode(FreeNode, gGrpBlueNode); |
| 2078 | 2080 | ||
| 2079 | TextBlock textBlock = new TextBlock(); | 2081 | TextBlock textBlock = new TextBlock(); |
| 2080 | textBlock.Text = stt.ToString(); | 2082 | textBlock.Text = stt.ToString(); |
| 2081 | textBlock.FontSize = 35; | 2083 | textBlock.FontSize = 35; |
| 2082 | textBlock.VerticalAlignment = VerticalAlignment.Center; | 2084 | textBlock.VerticalAlignment = VerticalAlignment.Center; |
| 2083 | textBlock.HorizontalAlignment = HorizontalAlignment.Center; | 2085 | textBlock.HorizontalAlignment = HorizontalAlignment.Center; |
| 2084 | textBlock.Foreground = new SolidColorBrush(Colors.Red); | 2086 | textBlock.Foreground = new SolidColorBrush(Colors.Red); |
| 2085 | 2087 | ||
| 2086 | Canvas.SetLeft(textBlock, FreeNode.X - RADIUS_NODE / 2); | 2088 | Canvas.SetLeft(textBlock, FreeNode.X - RADIUS_NODE / 2); |
| 2087 | Canvas.SetTop(textBlock, FreeNode.Y - 1.5 * RADIUS_NODE); | 2089 | Canvas.SetTop(textBlock, FreeNode.Y - 1.5 * RADIUS_NODE); |
| 2088 | 2090 | ||
| 2089 | 2091 | ||
| 2090 | this.Children.Add(textBlock); | 2092 | this.Children.Add(textBlock); |
| 2091 | NodeNo.Add(textBlock); | 2093 | NodeNo.Add(textBlock); |
| 2092 | 2094 | ||
| 2093 | if (stt > 1) | 2095 | if (stt > 1) |
| 2094 | { | 2096 | { |
| 2095 | int tmp = gGrpBlueNode.Children.Count; | 2097 | int tmp = gGrpBlueNode.Children.Count; |
| 2096 | 2098 | ||
| 2097 | EllipseGeometry elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 2]; | 2099 | EllipseGeometry elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 2]; |
| 2098 | Point node1 = elip.Center; | 2100 | Point node1 = elip.Center; |
| 2099 | elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 1]; | 2101 | elip = (EllipseGeometry)gGrpBlueNode.Children[tmp - 1]; |
| 2100 | Point node2 = elip.Center; | 2102 | Point node2 = elip.Center; |
| 2101 | DrawLine(node1, node2, gGrpNewLine); | 2103 | DrawLine(node1, node2, gGrpNewLine); |
| 2102 | 2104 | ||
| 2103 | 2105 | ||
| 2104 | this.Children.Remove(pBlueNode); | 2106 | this.Children.Remove(pBlueNode); |
| 2105 | for (int i = 0; i < tmp; i++) | 2107 | for (int i = 0; i < tmp; i++) |
| 2106 | { | 2108 | { |
| 2107 | this.Children.Remove(NodeNo[i]); | 2109 | this.Children.Remove(NodeNo[i]); |
| 2108 | } | 2110 | } |
| 2109 | 2111 | ||
| 2110 | this.Children.Add(pBlueNode); | 2112 | this.Children.Add(pBlueNode); |
| 2111 | for (int i = 0; i < tmp; i++) | 2113 | for (int i = 0; i < tmp; i++) |
| 2112 | { | 2114 | { |
| 2113 | this.Children.Add(NodeNo[i]); | 2115 | this.Children.Add(NodeNo[i]); |
| 2114 | } | 2116 | } |
| 2115 | } | 2117 | } |
| 2116 | 2118 | ||
| 2117 | stt++; | 2119 | stt++; |
| 2118 | NewInitNodeInfo_List(); | 2120 | NewInitNodeInfo_List(); |
| 2119 | NewDspRouteInfo(); | 2121 | NewDspRouteInfo(); |
| 2120 | } | 2122 | } |
| 2121 | } | 2123 | } |
| 2122 | } | 2124 | } |
| 2123 | 2125 | ||
| 2124 | public void DeleteNode(int i) | 2126 | public void DeleteNode(int i) |
| 2125 | { | 2127 | { |
| 2126 | //DrawLine(Point startPoint, Point endPoint, GeometryGroup geometryGroup) | 2128 | //DrawLine(Point startPoint, Point endPoint, GeometryGroup geometryGroup) |
| 2127 | 2129 | ||
| 2128 | LineGeometry lineGeometry = new LineGeometry(); | 2130 | LineGeometry lineGeometry = new LineGeometry(); |
| 2129 | EllipseGeometry ellip; | 2131 | EllipseGeometry ellip; |
| 2130 | 2132 | ||
| 2131 | //check delete last node | 2133 | //check delete last node |
| 2132 | if (i == gGrpBlueNode.Children.Count - 1) | 2134 | if (i == gGrpBlueNode.Children.Count - 1) |
| 2133 | { | 2135 | { |
| 2134 | // delete line | 2136 | // delete line |
| 2135 | if (gGrpNewLine.Children.Count > 0) | 2137 | if (gGrpNewLine.Children.Count > 0) |
| 2136 | { | 2138 | { |
| 2137 | gGrpNewLine.Children.RemoveAt(i - 1); | 2139 | gGrpNewLine.Children.RemoveAt(i - 1); |
| 2138 | } | 2140 | } |
| 2139 | 2141 | ||
| 2140 | // delete ucNode | 2142 | // delete ucNode |
| 2141 | ucNode _ucNode = new ucNode(); | 2143 | ucNode _ucNode = new ucNode(); |
| 2142 | _ucNode = ucNode_Lst[i]; | 2144 | _ucNode = ucNode_Lst[i]; |
| 2143 | this.Children.Remove(_ucNode); | 2145 | this.Children.Remove(_ucNode); |
| 2144 | ucNode_Lst.RemoveAt(i); | 2146 | ucNode_Lst.RemoveAt(i); |
| 2145 | 2147 | ||
| 2146 | // delete node | 2148 | // delete node |
| 2147 | gGrpBlueNode.Children.RemoveAt(i); | 2149 | gGrpBlueNode.Children.RemoveAt(i); |
| 2148 | NewNodeInfo_List.RemoveAt(i); | 2150 | NewNodeInfo_List.RemoveAt(i); |
| 2149 | 2151 | ||
| 2150 | } | 2152 | } |
| 2151 | else | 2153 | else |
| 2152 | { | 2154 | { |
| 2153 | //delete all line and remove Point at 'i' | 2155 | //delete all line and remove Point at 'i' |
| 2154 | gGrpNewLine.Children.Clear(); | 2156 | gGrpNewLine.Children.Clear(); |
| 2155 | this.Children.Remove(pNewLine); | 2157 | this.Children.Remove(pNewLine); |
| 2156 | gGrpBlueNode.Children.RemoveAt(i); | 2158 | gGrpBlueNode.Children.RemoveAt(i); |
| 2157 | 2159 | ||
| 2158 | //redraw line | 2160 | //redraw line |
| 2159 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) | 2161 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) |
| 2160 | { | 2162 | { |
| 2161 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; | 2163 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; |
| 2162 | Point node1 = ellip.Center; | 2164 | Point node1 = ellip.Center; |
| 2163 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; | 2165 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; |
| 2164 | Point node2 = ellip.Center; | 2166 | Point node2 = ellip.Center; |
| 2165 | DrawLine(node1, node2, gGrpNewLine); | 2167 | DrawLine(node1, node2, gGrpNewLine); |
| 2166 | } | 2168 | } |
| 2167 | 2169 | ||
| 2168 | this.Children.Add(pNewLine); | 2170 | this.Children.Add(pNewLine); |
| 2169 | 2171 | ||
| 2170 | //remove ucNode | 2172 | //remove ucNode |
| 2171 | for (int j = ucNode_Lst.Count - 1; j > i; j--) | 2173 | for (int j = ucNode_Lst.Count - 1; j > i; j--) |
| 2172 | { | 2174 | { |
| 2173 | ucNode_Lst[j].txtNode = ucNode_Lst[j - 1].txtNode; | 2175 | ucNode_Lst[j].txtNode = ucNode_Lst[j - 1].txtNode; |
| 2174 | } | 2176 | } |
| 2175 | this.Children.Remove(ucNode_Lst[i]); | 2177 | this.Children.Remove(ucNode_Lst[i]); |
| 2176 | ucNode_Lst.RemoveAt(i); | 2178 | ucNode_Lst.RemoveAt(i); |
| 2177 | 2179 | ||
| 2178 | //redraw ucNode | 2180 | //redraw ucNode |
| 2179 | for (int k = 0; k < ucNode_Lst.Count; k++) | 2181 | for (int k = 0; k < ucNode_Lst.Count; k++) |
| 2180 | { | 2182 | { |
| 2181 | this.Children.Remove(ucNode_Lst[k]); | 2183 | this.Children.Remove(ucNode_Lst[k]); |
| 2182 | this.Children.Add(ucNode_Lst[k]); | 2184 | this.Children.Add(ucNode_Lst[k]); |
| 2183 | } | 2185 | } |
| 2184 | } | 2186 | } |
| 2185 | 2187 | ||
| 2186 | //NewInitNodeInfo_List(); | 2188 | //NewInitNodeInfo_List(); |
| 2187 | 2189 | ||
| 2188 | Lst_Node_tmp.RemoveAt(i); | 2190 | Lst_Node_tmp.RemoveAt(i); |
| 2189 | NewDspRouteInfo(); | 2191 | NewDspRouteInfo(); |
| 2190 | stt--; | 2192 | stt--; |
| 2191 | 2193 | ||
| 2192 | } | 2194 | } |
| 2193 | 2195 | ||
| 2194 | public void ReDrawAllNode() | 2196 | public void ReDrawAllNode() |
| 2195 | { | 2197 | { |
| 2196 | LineGeometry lineGeometry = new LineGeometry(); | 2198 | LineGeometry lineGeometry = new LineGeometry(); |
| 2197 | EllipseGeometry ellip; | 2199 | EllipseGeometry ellip; |
| 2198 | //delete all line | 2200 | //delete all line |
| 2199 | gGrpNewLine.Children.Clear(); | 2201 | gGrpNewLine.Children.Clear(); |
| 2200 | this.Children.Remove(pNewLine); | 2202 | this.Children.Remove(pNewLine); |
| 2201 | 2203 | ||
| 2202 | //redraw line | 2204 | //redraw line |
| 2203 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) | 2205 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) |
| 2204 | { | 2206 | { |
| 2205 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; | 2207 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; |
| 2206 | Point node1 = ellip.Center; | 2208 | Point node1 = ellip.Center; |
| 2207 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; | 2209 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; |
| 2208 | Point node2 = ellip.Center; | 2210 | Point node2 = ellip.Center; |
| 2209 | DrawLine(node1, node2, gGrpNewLine); | 2211 | DrawLine(node1, node2, gGrpNewLine); |
| 2210 | } | 2212 | } |
| 2211 | 2213 | ||
| 2212 | this.Children.Add(pNewLine); | 2214 | this.Children.Add(pNewLine); |
| 2213 | 2215 | ||
| 2214 | 2216 | ||
| 2215 | //redraw ucNode | 2217 | //redraw ucNode |
| 2216 | for (int k = 0; k < ucNode_Lst.Count; k++) | 2218 | for (int k = 0; k < ucNode_Lst.Count; k++) |
| 2217 | { | 2219 | { |
| 2218 | this.Children.Remove(ucNode_Lst[k]); | 2220 | this.Children.Remove(ucNode_Lst[k]); |
| 2219 | this.Children.Add(ucNode_Lst[k]); | 2221 | this.Children.Add(ucNode_Lst[k]); |
| 2220 | } | 2222 | } |
| 2221 | 2223 | ||
| 2222 | //backup DB | 2224 | //backup DB |
| 2223 | CreateVehicleNode(); | 2225 | CreateVehicleNode(); |
| 2224 | } | 2226 | } |
| 2225 | 2227 | ||
| 2226 | 2228 | ||
| 2227 | public void NewInitNodeInfo_List() | 2229 | public void NewInitNodeInfo_List() |
| 2228 | { | 2230 | { |
| 2229 | //Reset List | 2231 | //Reset List |
| 2230 | //NewNodeInfo_List = new List<NewNodeInfo>(); | 2232 | //NewNodeInfo_List = new List<NewNodeInfo>(); |
| 2231 | 2233 | ||
| 2232 | if (gGrpBlueNode.Children.Count > 0) | 2234 | if (gGrpBlueNode.Children.Count > 0) |
| 2233 | { | 2235 | { |
| 2234 | //for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2236 | //for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2235 | //{ | 2237 | //{ |
| 2236 | int i = gGrpBlueNode.Children.Count - 1; | 2238 | int i = gGrpBlueNode.Children.Count - 1; |
| 2237 | Point point; | 2239 | Point point; |
| 2238 | EllipseGeometry eGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2240 | EllipseGeometry eGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2239 | point = eGeometry.Center; | 2241 | point = eGeometry.Center; |
| 2240 | 2242 | ||
| 2241 | NewNodeInfo Ninfo = new NewNodeInfo(); | 2243 | NewNodeInfo Ninfo = new NewNodeInfo(); |
| 2242 | Ninfo.X = point.X; | 2244 | Ninfo.X = point.X; |
| 2243 | Ninfo.Y = point.Y; | 2245 | Ninfo.Y = point.Y; |
| 2244 | 2246 | ||
| 2245 | Ninfo.Mode = ""; | 2247 | Ninfo.Mode = ""; |
| 2246 | 2248 | ||
| 2247 | NewNodeInfo_List.Add(Ninfo); | 2249 | NewNodeInfo_List.Add(Ninfo); |
| 2248 | //} | 2250 | //} |
| 2249 | 2251 | ||
| 2250 | } | 2252 | } |
| 2251 | } | 2253 | } |
| 2252 | 2254 | ||
| 2253 | public void NewEditNode(Point node_edited) | 2255 | public void NewEditNode(Point node_edited) |
| 2254 | { | 2256 | { |
| 2255 | EllipseGeometry ellipseGeometry; | 2257 | EllipseGeometry ellipseGeometry; |
| 2256 | Point node; | 2258 | Point node; |
| 2257 | double radiusNode = RADIUS_NODE; | 2259 | double radiusNode = RADIUS_NODE; |
| 2258 | 2260 | ||
| 2259 | bool flag = false; | 2261 | bool flag = false; |
| 2260 | 2262 | ||
| 2261 | if (gGrpBlueNode.Children.Count > 0) | 2263 | if (gGrpBlueNode.Children.Count > 0) |
| 2262 | { | 2264 | { |
| 2263 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2265 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2264 | { | 2266 | { |
| 2265 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2267 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2266 | node = ellipseGeometry.Center; | 2268 | node = ellipseGeometry.Center; |
| 2267 | 2269 | ||
| 2268 | if (CheckIsNode(node_edited, node, radiusNode)) | 2270 | if (CheckIsNode(node_edited, node, radiusNode)) |
| 2269 | { | 2271 | { |
| 2270 | flag = true; | 2272 | flag = true; |
| 2271 | } | 2273 | } |
| 2272 | 2274 | ||
| 2273 | if (flag) | 2275 | if (flag) |
| 2274 | { | 2276 | { |
| 2275 | node_edited.X = node.X; | 2277 | node_edited.X = node.X; |
| 2276 | node_edited.Y = node.Y; | 2278 | node_edited.Y = node.Y; |
| 2277 | 2279 | ||
| 2278 | // show form edit node | 2280 | // show form edit node |
| 2279 | EditNodeWindow edtNodeWindow = new EditNodeWindow(); | 2281 | EditNodeWindow edtNodeWindow = new EditNodeWindow(); |
| 2280 | edtNodeWindow.ShowDialog(); | 2282 | edtNodeWindow.ShowDialog(); |
| 2281 | 2283 | ||
| 2282 | string result = edtNodeWindow._txtMode; | 2284 | string result = edtNodeWindow._txtMode; |
| 2283 | 2285 | ||
| 2284 | 2286 | ||
| 2285 | List<EditNodeWindow.NodeInf> tmp = edtNodeWindow.NodeInf_List; | 2287 | List<EditNodeWindow.NodeInf> tmp = edtNodeWindow.NodeInf_List; |
| 2286 | 2288 | ||
| 2287 | for (int j = 0; j < tmp.Count; j++) | 2289 | for (int j = 0; j < tmp.Count; j++) |
| 2288 | { | 2290 | { |
| 2289 | EditNodeWindow.NodeInf ni = new EditNodeWindow.NodeInf(); | 2291 | EditNodeWindow.NodeInf ni = new EditNodeWindow.NodeInf(); |
| 2290 | ni.Mode = tmp[j].Mode; | 2292 | ni.Mode = tmp[j].Mode; |
| 2291 | ni.Speed = tmp[j].Speed; | 2293 | ni.Speed = tmp[j].Speed; |
| 2292 | ni.Angle = tmp[j].Angle; | 2294 | ni.Angle = tmp[j].Angle; |
| 2293 | ni.Height = tmp[j].Height; | 2295 | ni.Height = tmp[j].Height; |
| 2294 | 2296 | ||
| 2295 | 2297 | ||
| 2296 | ListNodeInfo NodeInfo_tmp = new ListNodeInfo(); | 2298 | ListNodeInfo NodeInfo_tmp = new ListNodeInfo(); |
| 2297 | 2299 | ||
| 2298 | NodeInfo_tmp.Mode = ni.Mode; | 2300 | NodeInfo_tmp.Mode = ni.Mode; |
| 2299 | NodeInfo_tmp.Speed = ni.Speed; | 2301 | NodeInfo_tmp.Speed = ni.Speed; |
| 2300 | NodeInfo_tmp.Angle = ni.Angle; | 2302 | NodeInfo_tmp.Angle = ni.Angle; |
| 2301 | NodeInfo_tmp.Height = ni.Height; | 2303 | NodeInfo_tmp.Height = ni.Height; |
| 2302 | 2304 | ||
| 2303 | Lst_Node_tmp[i].NodeInfo_tmp.Add(NodeInfo_tmp); | 2305 | Lst_Node_tmp[i].NodeInfo_tmp.Add(NodeInfo_tmp); |
| 2304 | } | 2306 | } |
| 2305 | 2307 | ||
| 2306 | 2308 | ||
| 2307 | //backup DB | 2309 | //backup DB |
| 2308 | CreateVehicleNode(); | 2310 | CreateVehicleNode(); |
| 2309 | 2311 | ||
| 2310 | 2312 | ||
| 2311 | 2313 | ||
| 2312 | 2314 | ||
| 2313 | bool exit = edtNodeWindow._ExitFlg; | 2315 | bool exit = edtNodeWindow._ExitFlg; |
| 2314 | 2316 | ||
| 2315 | if (!exit) | 2317 | if (!exit) |
| 2316 | { | 2318 | { |
| 2317 | NewSaveChanged(node_edited.X, node_edited.Y, result); | 2319 | NewSaveChanged(node_edited.X, node_edited.Y, result); |
| 2318 | } | 2320 | } |
| 2319 | 2321 | ||
| 2320 | return; | 2322 | return; |
| 2321 | } | 2323 | } |
| 2322 | } | 2324 | } |
| 2323 | } | 2325 | } |
| 2324 | } | 2326 | } |
| 2325 | 2327 | ||
| 2326 | //Save Node's Data Edited | 2328 | //Save Node's Data Edited |
| 2327 | public void NewSaveChanged(double x, double y, string st) | 2329 | public void NewSaveChanged(double x, double y, string st) |
| 2328 | { | 2330 | { |
| 2329 | for (int i = 0; i < NewNodeInfo_List.Count; i++) | 2331 | for (int i = 0; i < NewNodeInfo_List.Count; i++) |
| 2330 | { | 2332 | { |
| 2331 | NewNodeInfo ni = new NewNodeInfo(); | 2333 | NewNodeInfo ni = new NewNodeInfo(); |
| 2332 | ni = NewNodeInfo_List[i]; | 2334 | ni = NewNodeInfo_List[i]; |
| 2333 | 2335 | ||
| 2334 | if (ni.X == x && ni.Y == y) | 2336 | if (ni.X == x && ni.Y == y) |
| 2335 | { | 2337 | { |
| 2336 | ni.Mode = st; | 2338 | ni.Mode = st; |
| 2337 | 2339 | ||
| 2338 | NewNodeInfo_List[i] = ni; | 2340 | NewNodeInfo_List[i] = ni; |
| 2339 | return; | 2341 | return; |
| 2340 | } | 2342 | } |
| 2341 | } | 2343 | } |
| 2342 | } | 2344 | } |
| 2343 | 2345 | ||
| 2344 | public void NewDspRouteInfo() | 2346 | public void NewDspRouteInfo() |
| 2345 | { | 2347 | { |
| 2346 | //Clear Route Info Table | 2348 | //Clear Route Info Table |
| 2347 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); | 2349 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); |
| 2348 | int _RowIdx = 0; | 2350 | int _RowIdx = 0; |
| 2349 | string _Content = ""; | 2351 | string _Content = ""; |
| 2350 | 2352 | ||
| 2351 | if (Lst_Node_tmp.Count != 0) | 2353 | if (Lst_Node_tmp.Count != 0) |
| 2352 | { | 2354 | { |
| 2353 | for (int i = 0; i < Lst_Node_tmp.Count; i++) | 2355 | for (int i = 0; i < Lst_Node_tmp.Count; i++) |
| 2354 | { | 2356 | { |
| 2355 | //column 1 : node index | 2357 | //column 1 : node index |
| 2356 | _Content = (i + 1).ToString(); | 2358 | _Content = (i + 1).ToString(); |
| 2357 | AddLabeltoGrid(_RowIdx, 0, _Content); | 2359 | AddLabeltoGrid(_RowIdx, 0, _Content); |
| 2358 | 2360 | ||
| 2359 | //column 2 | 2361 | //column 2 |
| 2360 | // Display Node's Position | 2362 | // Display Node's Position |
| 2361 | _Content = "LAT " + Lst_Node_tmp[i].pointMap_X; | 2363 | _Content = "LAT " + Lst_Node_tmp[i].pointMap_X; |
| 2362 | AddLabeltoGrid(_RowIdx, 1, _Content); | 2364 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 2363 | _RowIdx++; | 2365 | _RowIdx++; |
| 2364 | 2366 | ||
| 2365 | _Content = "LOC " + Lst_Node_tmp[i].pointMap_Y; | 2367 | _Content = "LOC " + Lst_Node_tmp[i].pointMap_Y; |
| 2366 | AddLabeltoGrid(_RowIdx, 1, _Content); | 2368 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 2367 | 2369 | ||
| 2368 | // Display Node's Field | 2370 | // Display Node's Field |
| 2369 | if (Lst_Node_tmp[i].NodeInfo_tmp.Count != 0) | 2371 | if (Lst_Node_tmp[i].NodeInfo_tmp.Count != 0) |
| 2370 | { | 2372 | { |
| 2371 | foreach (ListNodeInfo ni in Lst_Node_tmp[i].NodeInfo_tmp) | 2373 | foreach (ListNodeInfo ni in Lst_Node_tmp[i].NodeInfo_tmp) |
| 2372 | { | 2374 | { |
| 2373 | if (ni.Speed != 0) | 2375 | if (ni.Speed != 0) |
| 2374 | { | 2376 | { |
| 2375 | _RowIdx++; | 2377 | _RowIdx++; |
| 2376 | _Content = "SPD " + ni.Speed.ToString() + " Km/h"; | 2378 | _Content = "SPD " + ni.Speed.ToString() + " Km/h"; |
| 2377 | AddLabeltoGrid(_RowIdx, 1, _Content); | 2379 | AddLabeltoGrid(_RowIdx, 1, _Content); |
| 2378 | } | 2380 | } |
| 2379 | } | 2381 | } |
| 2380 | 2382 | ||
| 2381 | } | 2383 | } |
| 2382 | _RowIdx++; | 2384 | _RowIdx++; |
| 2383 | } | 2385 | } |
| 2384 | 2386 | ||
| 2385 | } | 2387 | } |
| 2386 | 2388 | ||
| 2387 | } | 2389 | } |
| 2388 | 2390 | ||
| 2389 | 2391 | ||
| 2390 | //2017/03/07 tach rieng CreateNode start | 2392 | //2017/03/07 tach rieng CreateNode start |
| 2391 | private void execDeleteNode(Point FreeNode) | 2393 | private void execDeleteNode(Point FreeNode) |
| 2392 | { | 2394 | { |
| 2393 | 2395 | ||
| 2394 | double radiusNode = RADIUS_NODE; | 2396 | double radiusNode = RADIUS_NODE; |
| 2395 | 2397 | ||
| 2396 | EllipseGeometry ellipseGeometry; | 2398 | EllipseGeometry ellipseGeometry; |
| 2397 | Point node; | 2399 | Point node; |
| 2398 | bool deleteFlag = false; | 2400 | bool deleteFlag = false; |
| 2399 | 2401 | ||
| 2400 | if (gGrpBlueNode.Children.Count > 0) | 2402 | if (gGrpBlueNode.Children.Count > 0) |
| 2401 | { | 2403 | { |
| 2402 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2404 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2403 | { | 2405 | { |
| 2404 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2406 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2405 | node = ellipseGeometry.Center; | 2407 | node = ellipseGeometry.Center; |
| 2406 | if (FreeNode.X == node.X) | 2408 | if (FreeNode.X == node.X) |
| 2407 | { | 2409 | { |
| 2408 | if (CheckIsNode(FreeNode, node, radiusNode)) | 2410 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 2409 | { | 2411 | { |
| 2410 | deleteFlag = true; | 2412 | deleteFlag = true; |
| 2411 | } | 2413 | } |
| 2412 | } | 2414 | } |
| 2413 | else | 2415 | else |
| 2414 | { | 2416 | { |
| 2415 | if (CheckIsNode(FreeNode, node, radiusNode)) | 2417 | if (CheckIsNode(FreeNode, node, radiusNode)) |
| 2416 | { | 2418 | { |
| 2417 | deleteFlag = true; | 2419 | deleteFlag = true; |
| 2418 | } | 2420 | } |
| 2419 | } | 2421 | } |
| 2420 | if (deleteFlag) | 2422 | if (deleteFlag) |
| 2421 | { | 2423 | { |
| 2422 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); | 2424 | MessageBoxResult result = MessageBox.Show("Do You Delete This Node?", "Delete Node", MessageBoxButton.OKCancel); |
| 2423 | if (result == MessageBoxResult.OK) | 2425 | if (result == MessageBoxResult.OK) |
| 2424 | { | 2426 | { |
| 2425 | DeleteNode(i); | 2427 | DeleteNode(i); |
| 2426 | SetScheduleRoute(); | 2428 | SetScheduleRoute(); |
| 2427 | 2429 | ||
| 2428 | return; | 2430 | return; |
| 2429 | } | 2431 | } |
| 2430 | else | 2432 | else |
| 2431 | { | 2433 | { |
| 2432 | return; | 2434 | return; |
| 2433 | } | 2435 | } |
| 2434 | } | 2436 | } |
| 2435 | } | 2437 | } |
| 2436 | } | 2438 | } |
| 2437 | } | 2439 | } |
| 2438 | 2440 | ||
| 2439 | 2441 | ||
| 2440 | private void execEditNode(Point FreeNode) | 2442 | private void execEditNode(Point FreeNode) |
| 2441 | { | 2443 | { |
| 2442 | EllipseGeometry ellipseGeometry; | 2444 | EllipseGeometry ellipseGeometry; |
| 2443 | Point node; | 2445 | Point node; |
| 2444 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2446 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2445 | { | 2447 | { |
| 2446 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2448 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2447 | node = ellipseGeometry.Center; | 2449 | node = ellipseGeometry.Center; |
| 2448 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); | 2450 | bool isEditNode = CheckIsNode(FreeNode, node, RADIUS_NODE); |
| 2449 | 2451 | ||
| 2450 | if (isEditNode) | 2452 | if (isEditNode) |
| 2451 | { | 2453 | { |
| 2452 | NewEditNode(node); | 2454 | NewEditNode(node); |
| 2453 | NewDspRouteInfo(); | 2455 | NewDspRouteInfo(); |
| 2454 | return; | 2456 | return; |
| 2455 | } | 2457 | } |
| 2456 | } | 2458 | } |
| 2457 | } | 2459 | } |
| 2458 | 2460 | ||
| 2459 | 2461 | ||
| 2460 | private void execCreateNode(Point FreeNode) | 2462 | private void execCreateNode(Point FreeNode) |
| 2461 | { | 2463 | { |
| 2462 | //check new node in exist line | 2464 | //check new node in exist line |
| 2463 | if (gGrpNewLine.Children.Count > 0) | 2465 | if (gGrpNewLine.Children.Count > 0) |
| 2464 | { | 2466 | { |
| 2465 | for (int i = 0; i < gGrpNewLine.Children.Count; i++) | 2467 | for (int i = 0; i < gGrpNewLine.Children.Count; i++) |
| 2466 | { | 2468 | { |
| 2467 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[i]; | 2469 | LineGeometry lineGeometry = (LineGeometry)gGrpNewLine.Children[i]; |
| 2468 | Point p1 = lineGeometry.StartPoint; | 2470 | Point p1 = lineGeometry.StartPoint; |
| 2469 | Point p2 = lineGeometry.EndPoint; | 2471 | Point p2 = lineGeometry.EndPoint; |
| 2470 | 2472 | ||
| 2471 | bool pInL = PointInLine(FreeNode, p1, p2, UCNODE_SETLEFT); | 2473 | bool pInL = PointInLine(FreeNode, p1, p2, UCNODE_SETLEFT); |
| 2472 | 2474 | ||
| 2473 | if (pInL) | 2475 | if (pInL) |
| 2474 | { | 2476 | { |
| 2475 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); | 2477 | MessageBoxResult result = MessageBox.Show("Do You Want To Add This Node?", "Add Node", MessageBoxButton.OKCancel); |
| 2476 | if (result == MessageBoxResult.OK) | 2478 | if (result == MessageBoxResult.OK) |
| 2477 | { | 2479 | { |
| 2478 | Point tmpPoint = ConvertNodeinLine(FreeNode, p1, p2); | 2480 | Point tmpPoint = ConvertNodeinLine(FreeNode, p1, p2); |
| 2479 | FreeNode = tmpPoint; | 2481 | FreeNode = tmpPoint; |
| 2480 | 2482 | ||
| 2481 | CreateMapNode(FreeNode, i + 1, ColorNode_Insert); | 2483 | CreateMapNode(FreeNode, i + 1, ColorNode_Insert); |
| 2482 | gGrpBlueNode.Children.Insert(i + 1, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); | 2484 | gGrpBlueNode.Children.Insert(i + 1, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); |
| 2483 | //set location infor to table info | 2485 | //set location infor to table info |
| 2484 | SetLoc_NodeInfoList(FreeNode, i + 1); | 2486 | SetLoc_NodeInfoList(FreeNode, i + 1); |
| 2485 | 2487 | ||
| 2486 | SetScheduleRoute(); | 2488 | SetScheduleRoute(); |
| 2487 | 2489 | ||
| 2488 | ListIndexNodeInsert ListIndex = new ListIndexNodeInsert(); | 2490 | ListIndexNodeInsert ListIndex = new ListIndexNodeInsert(); |
| 2489 | ListIndex.X = FreeNode.X; | 2491 | ListIndex.X = FreeNode.X; |
| 2490 | ListIndex.Y = FreeNode.Y; | 2492 | ListIndex.Y = FreeNode.Y; |
| 2491 | IndexNodeInsert_List.Add(ListIndex); | 2493 | IndexNodeInsert_List.Add(ListIndex); |
| 2492 | 2494 | ||
| 2493 | //rename Point textName | 2495 | //rename Point textName |
| 2494 | for (int j = 0; j < ucNode_Lst.Count; j++) | 2496 | for (int j = 0; j < ucNode_Lst.Count; j++) |
| 2495 | { | 2497 | { |
| 2496 | ucNode_Lst[j].txtNode = (j + 1).ToString(); | 2498 | ucNode_Lst[j].txtNode = (j + 1).ToString(); |
| 2497 | this.Children.Remove(ucNode_Lst[j]); | 2499 | this.Children.Remove(ucNode_Lst[j]); |
| 2498 | this.Children.Add(ucNode_Lst[j]); | 2500 | this.Children.Add(ucNode_Lst[j]); |
| 2499 | } | 2501 | } |
| 2500 | 2502 | ||
| 2501 | ReDrawAllNode(); | 2503 | ReDrawAllNode(); |
| 2502 | 2504 | ||
| 2503 | stt++; | 2505 | stt++; |
| 2504 | NewInitNodeInfo_List(); | 2506 | NewInitNodeInfo_List(); |
| 2505 | NewDspRouteInfo(); | 2507 | NewDspRouteInfo(); |
| 2506 | return; | 2508 | return; |
| 2507 | } | 2509 | } |
| 2508 | else | 2510 | else |
| 2509 | { | 2511 | { |
| 2510 | return; | 2512 | return; |
| 2511 | } | 2513 | } |
| 2512 | } | 2514 | } |
| 2513 | } | 2515 | } |
| 2514 | } | 2516 | } |
| 2515 | 2517 | ||
| 2516 | 2518 | ||
| 2517 | CreateMapNode(FreeNode, gGrpBlueNode.Children.Count, ColorNode_Add); | 2519 | CreateMapNode(FreeNode, gGrpBlueNode.Children.Count, ColorNode_Add); |
| 2518 | gGrpBlueNode.Children.Insert(gGrpBlueNode.Children.Count, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); | 2520 | gGrpBlueNode.Children.Insert(gGrpBlueNode.Children.Count, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); |
| 2519 | //set location infor to table info | 2521 | //set location infor to table info |
| 2520 | SetLoc_NodeInfoList(FreeNode, gGrpBlueNode.Children.Count - 1); | 2522 | SetLoc_NodeInfoList(FreeNode, gGrpBlueNode.Children.Count - 1); |
| 2521 | 2523 | ||
| 2522 | SetScheduleRoute(); | 2524 | SetScheduleRoute(); |
| 2523 | 2525 | ||
| 2524 | //draw line | 2526 | //draw line |
| 2525 | if (stt > 1) | 2527 | if (stt > 1) |
| 2526 | { | 2528 | { |
| 2527 | //delete all line | 2529 | //delete all line |
| 2528 | gGrpNewLine.Children.Clear(); | 2530 | gGrpNewLine.Children.Clear(); |
| 2529 | this.Children.Remove(pNewLine); | 2531 | this.Children.Remove(pNewLine); |
| 2530 | //redraw line | 2532 | //redraw line |
| 2531 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) | 2533 | for (int j = 0; j < gGrpBlueNode.Children.Count - 1; j++) |
| 2532 | { | 2534 | { |
| 2533 | EllipseGeometry ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; | 2535 | EllipseGeometry ellip = (EllipseGeometry)gGrpBlueNode.Children[j]; |
| 2534 | Point node1 = ellip.Center; | 2536 | Point node1 = ellip.Center; |
| 2535 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; | 2537 | ellip = (EllipseGeometry)gGrpBlueNode.Children[j + 1]; |
| 2536 | Point node2 = ellip.Center; | 2538 | Point node2 = ellip.Center; |
| 2537 | DrawLine(node1, node2, gGrpNewLine); | 2539 | DrawLine(node1, node2, gGrpNewLine); |
| 2538 | } | 2540 | } |
| 2539 | 2541 | ||
| 2540 | this.Children.Add(pNewLine); | 2542 | this.Children.Add(pNewLine); |
| 2541 | 2543 | ||
| 2542 | //rename Point textName | 2544 | //rename Point textName |
| 2543 | for (int j = 0; j < ucNode_Lst.Count; j++) | 2545 | for (int j = 0; j < ucNode_Lst.Count; j++) |
| 2544 | { | 2546 | { |
| 2545 | ucNode_Lst[j].txtNode = (j + 1).ToString(); | 2547 | ucNode_Lst[j].txtNode = (j + 1).ToString(); |
| 2546 | this.Children.Remove(ucNode_Lst[j]); | 2548 | this.Children.Remove(ucNode_Lst[j]); |
| 2547 | this.Children.Add(ucNode_Lst[j]); | 2549 | this.Children.Add(ucNode_Lst[j]); |
| 2548 | } | 2550 | } |
| 2549 | } | 2551 | } |
| 2550 | 2552 | ||
| 2551 | stt++; | 2553 | stt++; |
| 2552 | NewInitNodeInfo_List(); | 2554 | NewInitNodeInfo_List(); |
| 2553 | NewDspRouteInfo(); | 2555 | NewDspRouteInfo(); |
| 2554 | } | 2556 | } |
| 2555 | 2557 | ||
| 2556 | public void CreateMapNode(Point FreeNode, int stt, String Color) | 2558 | public void CreateMapNode(Point FreeNode, int stt, String Color) |
| 2557 | { | 2559 | { |
| 2558 | ucNode _ucNode = new ucNode(); | 2560 | ucNode _ucNode = new ucNode(); |
| 2559 | _ucNode.btnWidth = UCNODE_WIDTH; | 2561 | _ucNode.btnWidth = UCNODE_WIDTH; |
| 2560 | _ucNode.btnHeight = UCNODE_HEIGHT; | 2562 | _ucNode.btnHeight = UCNODE_HEIGHT; |
| 2561 | 2563 | ||
| 2562 | _ucNode.txtNode = (stt + 1).ToString(); | 2564 | _ucNode.txtNode = (stt + 1).ToString(); |
| 2563 | 2565 | ||
| 2564 | _ucNode.fillColor = Color; | 2566 | _ucNode.fillColor = Color; |
| 2565 | _ucNode.IsDragDelta = true; | 2567 | _ucNode.IsDragDelta = true; |
| 2566 | Canvas.SetLeft(_ucNode, FreeNode.X - UCNODE_SETLEFT); | 2568 | Canvas.SetLeft(_ucNode, FreeNode.X - UCNODE_SETLEFT); |
| 2567 | Canvas.SetTop(_ucNode, FreeNode.Y - UCNODE_SETTOP); | 2569 | Canvas.SetTop(_ucNode, FreeNode.Y - UCNODE_SETTOP); |
| 2568 | this.Children.Add(_ucNode); | 2570 | this.Children.Add(_ucNode); |
| 2569 | //ucNode_Lst.Add(_ucNode); | 2571 | //ucNode_Lst.Add(_ucNode); |
| 2570 | ucNode_Lst.Insert(stt, _ucNode); | 2572 | ucNode_Lst.Insert(stt, _ucNode); |
| 2571 | 2573 | ||
| 2572 | 2574 | ||
| 2573 | 2575 | ||
| 2574 | 2576 | ||
| 2575 | 2577 | ||
| 2576 | //AddNode(FreeNode, gGrpBlueNode); | 2578 | //AddNode(FreeNode, gGrpBlueNode); |
| 2577 | //gGrpBlueNode.Children.Insert(stt, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); | 2579 | //gGrpBlueNode.Children.Insert(stt, new EllipseGeometry(FreeNode, RADIUS_NODE, RADIUS_NODE)); |
| 2578 | 2580 | ||
| 2579 | } | 2581 | } |
| 2580 | 2582 | ||
| 2581 | public void SetLoc_NodeInfoList(Point FreeNode, int stt) | 2583 | public void SetLoc_NodeInfoList(Point FreeNode, int stt) |
| 2582 | { | 2584 | { |
| 2583 | //add location for NodeInfoList | 2585 | //add location for NodeInfoList |
| 2584 | Node_tmp nodetmp = new Node_tmp(); | 2586 | Node_tmp nodetmp = new Node_tmp(); |
| 2585 | nodetmp.pointMap_X = FreeNode.X; | 2587 | nodetmp.pointMap_X = FreeNode.X; |
| 2586 | nodetmp.pointMap_Y = FreeNode.Y; | 2588 | nodetmp.pointMap_Y = FreeNode.Y; |
| 2587 | 2589 | ||
| 2588 | Lst_Node_tmp.Insert(stt, nodetmp); | 2590 | Lst_Node_tmp.Insert(stt, nodetmp); |
| 2589 | 2591 | ||
| 2590 | } | 2592 | } |
| 2591 | 2593 | ||
| 2592 | public void BindBlueNode2ucNode() | 2594 | public void BindBlueNode2ucNode() |
| 2593 | { | 2595 | { |
| 2594 | bool NodeIsInsert = false; | 2596 | bool NodeIsInsert = false; |
| 2595 | if (gGrpBlueNode.Children.Count > 0) | 2597 | if (gGrpBlueNode.Children.Count > 0) |
| 2596 | { | 2598 | { |
| 2597 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2599 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2598 | { | 2600 | { |
| 2599 | NodeIsInsert = false; | 2601 | NodeIsInsert = false; |
| 2600 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2602 | EllipseGeometry ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2601 | Point node = ellipseGeometry.Center; | 2603 | Point node = ellipseGeometry.Center; |
| 2602 | 2604 | ||
| 2603 | //Draw Node Insert Color is Brown | 2605 | //Draw Node Insert Color is Brown |
| 2604 | if (IndexNodeInsert_List.Count > 0) | 2606 | if (IndexNodeInsert_List.Count > 0) |
| 2605 | { | 2607 | { |
| 2606 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) | 2608 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) |
| 2607 | { | 2609 | { |
| 2608 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) | 2610 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) |
| 2609 | { | 2611 | { |
| 2610 | NodeIsInsert = true; | 2612 | NodeIsInsert = true; |
| 2611 | } | 2613 | } |
| 2612 | } | 2614 | } |
| 2613 | } | 2615 | } |
| 2614 | if (NodeIsInsert) | 2616 | if (NodeIsInsert) |
| 2615 | { | 2617 | { |
| 2616 | CreateMapNode(node, i, ColorNode_Insert); | 2618 | CreateMapNode(node, i, ColorNode_Insert); |
| 2617 | } | 2619 | } |
| 2618 | else | 2620 | else |
| 2619 | { | 2621 | { |
| 2620 | CreateMapNode(node, i, ColorNode_Add); | 2622 | CreateMapNode(node, i, ColorNode_Add); |
| 2621 | } | 2623 | } |
| 2622 | } | 2624 | } |
| 2623 | } | 2625 | } |
| 2624 | } | 2626 | } |
| 2625 | 2627 | ||
| 2626 | //2017/03/07 tach CreateNode End | 2628 | //2017/03/07 tach CreateNode End |
| 2627 | 2629 | ||
| 2628 | 2630 | ||
| 2629 | public Point ConvertNodeinLine(Point point, Point l1, Point l2) | 2631 | public Point ConvertNodeinLine(Point point, Point l1, Point l2) |
| 2630 | { | 2632 | { |
| 2631 | Point pointResult = new Point(); | 2633 | Point pointResult = new Point(); |
| 2632 | double X = 0; | 2634 | double X = 0; |
| 2633 | double Y = 0; | 2635 | double Y = 0; |
| 2634 | 2636 | ||
| 2635 | double distance_Line = 0; | 2637 | double distance_Line = 0; |
| 2636 | double distance_l1ToPoint = 0; | 2638 | double distance_l1ToPoint = 0; |
| 2637 | 2639 | ||
| 2638 | distance_Line = DistanceTo(l1, l2); | 2640 | distance_Line = DistanceTo(l1, l2); |
| 2639 | distance_l1ToPoint = DistanceTo(l1, point); | 2641 | distance_l1ToPoint = DistanceTo(l1, point); |
| 2640 | 2642 | ||
| 2641 | 2643 | ||
| 2642 | if (l1.X == l2.X) | 2644 | if (l1.X == l2.X) |
| 2643 | { | 2645 | { |
| 2644 | X = l1.X; | 2646 | X = l1.X; |
| 2645 | Y = point.Y; | 2647 | Y = point.Y; |
| 2646 | } | 2648 | } |
| 2647 | else if (l1.Y == l2.Y) | 2649 | else if (l1.Y == l2.Y) |
| 2648 | { | 2650 | { |
| 2649 | X = point.X; | 2651 | X = point.X; |
| 2650 | Y = l1.Y; | 2652 | Y = l1.Y; |
| 2651 | } | 2653 | } |
| 2652 | else | 2654 | else |
| 2653 | { | 2655 | { |
| 2654 | if (l1.X < l2.X) | 2656 | if (l1.X < l2.X) |
| 2655 | { | 2657 | { |
| 2656 | if (l1.Y < l2.Y) | 2658 | if (l1.Y < l2.Y) |
| 2657 | { | 2659 | { |
| 2658 | Y = l1.Y + (distance_l1ToPoint * (l2.Y - l1.Y) / distance_Line); | 2660 | Y = l1.Y + (distance_l1ToPoint * (l2.Y - l1.Y) / distance_Line); |
| 2659 | X = l1.X + (distance_l1ToPoint * (l2.X - l1.X) / distance_Line); | 2661 | X = l1.X + (distance_l1ToPoint * (l2.X - l1.X) / distance_Line); |
| 2660 | } | 2662 | } |
| 2661 | else | 2663 | else |
| 2662 | { | 2664 | { |
| 2663 | Y = l1.Y - (distance_l1ToPoint * (l1.Y - l2.Y) / distance_Line); | 2665 | Y = l1.Y - (distance_l1ToPoint * (l1.Y - l2.Y) / distance_Line); |
| 2664 | X = l1.X + (distance_l1ToPoint * (l2.X - l1.X) / distance_Line); | 2666 | X = l1.X + (distance_l1ToPoint * (l2.X - l1.X) / distance_Line); |
| 2665 | } | 2667 | } |
| 2666 | } | 2668 | } |
| 2667 | else | 2669 | else |
| 2668 | { | 2670 | { |
| 2669 | if (l1.Y < l2.Y) | 2671 | if (l1.Y < l2.Y) |
| 2670 | { | 2672 | { |
| 2671 | Y = l1.Y + (distance_l1ToPoint * (l2.Y - l1.Y) / distance_Line); | 2673 | Y = l1.Y + (distance_l1ToPoint * (l2.Y - l1.Y) / distance_Line); |
| 2672 | X = l1.X - (distance_l1ToPoint * (l1.X - l2.X) / distance_Line); | 2674 | X = l1.X - (distance_l1ToPoint * (l1.X - l2.X) / distance_Line); |
| 2673 | } | 2675 | } |
| 2674 | else | 2676 | else |
| 2675 | { | 2677 | { |
| 2676 | Y = l1.Y - (distance_l1ToPoint * (l1.Y - l2.Y) / distance_Line); | 2678 | Y = l1.Y - (distance_l1ToPoint * (l1.Y - l2.Y) / distance_Line); |
| 2677 | X = l1.X - (distance_l1ToPoint * (l1.X - l2.X) / distance_Line); | 2679 | X = l1.X - (distance_l1ToPoint * (l1.X - l2.X) / distance_Line); |
| 2678 | } | 2680 | } |
| 2679 | } | 2681 | } |
| 2680 | 2682 | ||
| 2681 | 2683 | ||
| 2682 | } | 2684 | } |
| 2683 | 2685 | ||
| 2684 | pointResult.X = X; | 2686 | pointResult.X = X; |
| 2685 | pointResult.Y = Y; | 2687 | pointResult.Y = Y; |
| 2686 | return pointResult; | 2688 | return pointResult; |
| 2687 | } | 2689 | } |
| 2688 | 2690 | ||
| 2689 | public static double DistanceTo(Point point1, Point point2) | 2691 | public static double DistanceTo(Point point1, Point point2) |
| 2690 | { | 2692 | { |
| 2691 | var a = (double)(point2.X - point1.X); | 2693 | var a = (double)(point2.X - point1.X); |
| 2692 | var b = (double)(point2.Y - point1.Y); | 2694 | var b = (double)(point2.Y - point1.Y); |
| 2693 | 2695 | ||
| 2694 | return Math.Sqrt(a * a + b * b); | 2696 | return Math.Sqrt(a * a + b * b); |
| 2695 | } | 2697 | } |
| 2696 | 2698 | ||
| 2697 | public bool PointInLine(Point point, Point l1, Point l2, double radius) | 2699 | public bool PointInLine(Point point, Point l1, Point l2, double radius) |
| 2698 | { | 2700 | { |
| 2699 | double distance = 0; | 2701 | double distance = 0; |
| 2700 | bool falg = false; | 2702 | bool falg = false; |
| 2701 | 2703 | ||
| 2702 | if (l1.X < l2.X) | 2704 | if (l1.X < l2.X) |
| 2703 | { | 2705 | { |
| 2704 | if (l1.Y < l2.Y) | 2706 | if (l1.Y < l2.Y) |
| 2705 | { | 2707 | { |
| 2706 | if (point.X > l1.X - radius && point.X < l2.X + radius && point.Y > l1.Y - radius && point.Y < l2.Y + radius) | 2708 | if (point.X > l1.X - radius && point.X < l2.X + radius && point.Y > l1.Y - radius && point.Y < l2.Y + radius) |
| 2707 | { | 2709 | { |
| 2708 | falg = true; | 2710 | falg = true; |
| 2709 | } | 2711 | } |
| 2710 | } | 2712 | } |
| 2711 | else | 2713 | else |
| 2712 | { | 2714 | { |
| 2713 | if (point.X > l1.X - radius && point.X < l2.X + radius && point.Y < l1.Y + radius && point.Y > l2.Y - radius) | 2715 | if (point.X > l1.X - radius && point.X < l2.X + radius && point.Y < l1.Y + radius && point.Y > l2.Y - radius) |
| 2714 | { | 2716 | { |
| 2715 | falg = true; | 2717 | falg = true; |
| 2716 | } | 2718 | } |
| 2717 | } | 2719 | } |
| 2718 | } | 2720 | } |
| 2719 | else | 2721 | else |
| 2720 | { | 2722 | { |
| 2721 | if (l1.Y < l2.Y) | 2723 | if (l1.Y < l2.Y) |
| 2722 | { | 2724 | { |
| 2723 | if (point.X < l1.X + radius && point.X > l2.X - radius && point.Y > l1.Y - radius && point.Y < l2.Y + radius) | 2725 | if (point.X < l1.X + radius && point.X > l2.X - radius && point.Y > l1.Y - radius && point.Y < l2.Y + radius) |
| 2724 | { | 2726 | { |
| 2725 | falg = true; | 2727 | falg = true; |
| 2726 | } | 2728 | } |
| 2727 | } | 2729 | } |
| 2728 | else | 2730 | else |
| 2729 | { | 2731 | { |
| 2730 | if (point.X < l1.X + radius && point.X > l2.X - radius && point.Y < l1.Y + radius && point.Y > l2.Y - radius) | 2732 | if (point.X < l1.X + radius && point.X > l2.X - radius && point.Y < l1.Y + radius && point.Y > l2.Y - radius) |
| 2731 | { | 2733 | { |
| 2732 | falg = true; | 2734 | falg = true; |
| 2733 | } | 2735 | } |
| 2734 | } | 2736 | } |
| 2735 | } | 2737 | } |
| 2736 | if (falg == false) | 2738 | if (falg == false) |
| 2737 | { | 2739 | { |
| 2738 | return false; | 2740 | return false; |
| 2739 | } | 2741 | } |
| 2740 | 2742 | ||
| 2741 | distance = DistanceFromPointToLine(point, l1, l2); | 2743 | distance = DistanceFromPointToLine(point, l1, l2); |
| 2742 | 2744 | ||
| 2743 | if (distance > radius) | 2745 | if (distance > radius) |
| 2744 | { | 2746 | { |
| 2745 | return false; | 2747 | return false; |
| 2746 | } | 2748 | } |
| 2747 | return true; | 2749 | return true; |
| 2748 | } | 2750 | } |
| 2749 | 2751 | ||
| 2750 | public static double DistanceFromPointToLine(Point point, Point l1, Point l2) | 2752 | public static double DistanceFromPointToLine(Point point, Point l1, Point l2) |
| 2751 | { | 2753 | { |
| 2752 | 2754 | ||
| 2753 | return Math.Abs((l2.X - l1.X) * (l1.Y - point.Y) - (l1.X - point.X) * (l2.Y - l1.Y)) / | 2755 | return Math.Abs((l2.X - l1.X) * (l1.Y - point.Y) - (l1.X - point.X) * (l2.Y - l1.Y)) / |
| 2754 | Math.Sqrt(Math.Pow(l2.X - l1.X, 2) + Math.Pow(l2.Y - l1.Y, 2)); | 2756 | Math.Sqrt(Math.Pow(l2.X - l1.X, 2) + Math.Pow(l2.Y - l1.Y, 2)); |
| 2755 | } | 2757 | } |
| 2756 | 2758 | ||
| 2757 | #endregion | 2759 | #endregion |
| 2758 | 2760 | ||
| 2759 | #region Schedule | 2761 | #region Schedule |
| 2760 | 2762 | ||
| 2761 | public void SetScheduleRoute() | 2763 | public void SetScheduleRoute() |
| 2762 | { | 2764 | { |
| 2763 | 2765 | ||
| 2764 | EllipseGeometry ellipseGeometry_1; | 2766 | EllipseGeometry ellipseGeometry_1; |
| 2765 | EllipseGeometry ellipseGeometry_2; | 2767 | EllipseGeometry ellipseGeometry_2; |
| 2766 | Point node_1; | 2768 | Point node_1; |
| 2767 | Point node_2; | 2769 | Point node_2; |
| 2768 | Point node_Schedule = new Point(); | 2770 | Point node_Schedule = new Point(); |
| 2769 | double x_1 = 50; | 2771 | double x_1 = 50; |
| 2770 | double y_1 = 80; | 2772 | double y_1 = 80; |
| 2771 | double Totaldistance = 1270; | 2773 | double Totaldistance = 1270; |
| 2772 | 2774 | ||
| 2773 | 2775 | ||
| 2774 | if (ucScheduleNode_Lst.Count > 0) | 2776 | if (ucScheduleNode_Lst.Count > 0) |
| 2775 | { | 2777 | { |
| 2776 | for (int i = 0; i < ucScheduleNode_Lst.Count; i++) | 2778 | for (int i = 0; i < ucScheduleNode_Lst.Count; i++) |
| 2777 | { | 2779 | { |
| 2778 | ucNode _ucScheduleNode = new ucNode(); | 2780 | ucNode _ucScheduleNode = new ucNode(); |
| 2779 | _ucScheduleNode = ucScheduleNode_Lst[i]; | 2781 | _ucScheduleNode = ucScheduleNode_Lst[i]; |
| 2780 | scheduleCanvas.Children.Remove(_ucScheduleNode); | 2782 | scheduleCanvas.Children.Remove(_ucScheduleNode); |
| 2781 | 2783 | ||
| 2782 | } | 2784 | } |
| 2783 | ucScheduleNode_Lst.Clear(); | 2785 | ucScheduleNode_Lst.Clear(); |
| 2784 | } | 2786 | } |
| 2785 | 2787 | ||
| 2786 | gGrpScheduleNode.Children.Clear(); | 2788 | gGrpScheduleNode.Children.Clear(); |
| 2787 | gGrpScheduleLine.Children.Clear(); | 2789 | gGrpScheduleLine.Children.Clear(); |
| 2788 | 2790 | ||
| 2789 | //Remove existed simulation | 2791 | //Remove existed simulation |
| 2790 | if(scheduleCanvas.simulation !=null) | 2792 | if(scheduleCanvas.simulation !=null) |
| 2791 | { | 2793 | { |
| 2792 | scheduleCanvas.Children.Remove(scheduleCanvas.simulation); | 2794 | scheduleCanvas.Children.Remove(scheduleCanvas.simulation); |
| 2793 | } | 2795 | } |
| 2794 | 2796 | ||
| 2795 | 2797 | ||
| 2796 | List<double> distance = new List<double>(); | 2798 | List<double> distance = new List<double>(); |
| 2797 | double addDistance; | 2799 | double addDistance; |
| 2798 | 2800 | ||
| 2799 | if (gGrpBlueNode.Children.Count > 0) | 2801 | if (gGrpBlueNode.Children.Count > 0) |
| 2800 | { | 2802 | { |
| 2801 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 2803 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 2802 | { | 2804 | { |
| 2803 | ellipseGeometry_2 = (EllipseGeometry)gGrpBlueNode.Children[i]; | 2805 | ellipseGeometry_2 = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 2804 | node_2 = ellipseGeometry_2.Center; | 2806 | node_2 = ellipseGeometry_2.Center; |
| 2805 | 2807 | ||
| 2806 | if (i >= 1) | 2808 | if (i >= 1) |
| 2807 | { | 2809 | { |
| 2808 | ellipseGeometry_1 = (EllipseGeometry)gGrpBlueNode.Children[i - 1]; | 2810 | ellipseGeometry_1 = (EllipseGeometry)gGrpBlueNode.Children[i - 1]; |
| 2809 | node_1 = ellipseGeometry_1.Center; | 2811 | node_1 = ellipseGeometry_1.Center; |
| 2810 | if (node_1.X == node_2.X) | 2812 | if (node_1.X == node_2.X) |
| 2811 | { | 2813 | { |
| 2812 | addDistance = Math.Abs(node_1.Y - node_2.Y); | 2814 | addDistance = Math.Abs(node_1.Y - node_2.Y); |
| 2813 | distance.Add(addDistance); | 2815 | distance.Add(addDistance); |
| 2814 | } | 2816 | } |
| 2815 | else if (node_1.Y == node_2.Y) | 2817 | else if (node_1.Y == node_2.Y) |
| 2816 | { | 2818 | { |
| 2817 | addDistance = Math.Abs(node_1.X - node_2.X); | 2819 | addDistance = Math.Abs(node_1.X - node_2.X); |
| 2818 | distance.Add(addDistance); | 2820 | distance.Add(addDistance); |
| 2819 | } | 2821 | } |
| 2820 | else | 2822 | else |
| 2821 | { | 2823 | { |
| 2822 | var a = (double)(node_2.X - node_1.X); | 2824 | var a = (double)(node_2.X - node_1.X); |
| 2823 | var b = (double)(node_2.Y - node_1.Y); | 2825 | var b = (double)(node_2.Y - node_1.Y); |
| 2824 | addDistance = Math.Sqrt(a * a + b * b); | 2826 | addDistance = Math.Sqrt(a * a + b * b); |
| 2825 | distance.Add(addDistance); | 2827 | distance.Add(addDistance); |
| 2826 | } | 2828 | } |
| 2827 | } | 2829 | } |
| 2828 | } | 2830 | } |
| 2829 | } | 2831 | } |
| 2830 | if (distance.Count > 0) | 2832 | if (distance.Count > 0) |
| 2831 | { | 2833 | { |
| 2832 | double total = 0; | 2834 | double total = 0; |
| 2833 | double distance_i; | 2835 | double distance_i; |
| 2834 | 2836 | ||
| 2835 | for (int i = 0; i < distance.Count; i++) | 2837 | for (int i = 0; i < distance.Count; i++) |
| 2836 | { | 2838 | { |
| 2837 | total = total + distance[i]; | 2839 | total = total + distance[i]; |
| 2838 | } | 2840 | } |
| 2839 | 2841 | ||
| 2840 | for (int i = 0; i < distance.Count; i++) | 2842 | for (int i = 0; i < distance.Count; i++) |
| 2841 | { | 2843 | { |
| 2842 | distance_i = distance[i] * (Totaldistance / total); | 2844 | distance_i = distance[i] * (Totaldistance / total); |
| 2843 | distance[i] = distance_i; | 2845 | distance[i] = distance_i; |
| 2844 | } | 2846 | } |
| 2845 | } | 2847 | } |
| 2846 | 2848 | ||
| 2847 | if (gGrpBlueNode.Children.Count > 0) | 2849 | if (gGrpBlueNode.Children.Count > 0) |
| 2848 | { | 2850 | { |
| 2849 | node_Schedule.X = x_1; | 2851 | node_Schedule.X = x_1; |
| 2850 | node_Schedule.Y = y_1; | 2852 | node_Schedule.Y = y_1; |
| 2851 | AddNode(node_Schedule, gGrpScheduleNode); | 2853 | AddNode(node_Schedule, gGrpScheduleNode); |
| 2852 | } | 2854 | } |
| 2853 | 2855 | ||
| 2854 | addDistance = 0; | 2856 | addDistance = 0; |
| 2855 | for (int i = 0; i < distance.Count; i++) | 2857 | for (int i = 0; i < distance.Count; i++) |
| 2856 | { | 2858 | { |
| 2857 | 2859 | ||
| 2858 | node_Schedule.Y = y_1; | 2860 | node_Schedule.Y = y_1; |
| 2859 | addDistance = addDistance + distance[i]; | 2861 | addDistance = addDistance + distance[i]; |
| 2860 | node_Schedule.X = addDistance; | 2862 | node_Schedule.X = addDistance; |
| 2861 | AddNode(node_Schedule, gGrpScheduleNode); | 2863 | AddNode(node_Schedule, gGrpScheduleNode); |
| 2862 | } | 2864 | } |
| 2863 | 2865 | ||
| 2864 | if (gGrpScheduleNode.Children.Count > 0) | 2866 | if (gGrpScheduleNode.Children.Count > 0) |
| 2865 | { | 2867 | { |
| 2866 | for (int i = 0; i < gGrpScheduleNode.Children.Count; i++) | 2868 | for (int i = 0; i < gGrpScheduleNode.Children.Count; i++) |
| 2867 | { | 2869 | { |
| 2868 | ellipseGeometry_1 = (EllipseGeometry)gGrpScheduleNode.Children[i]; | 2870 | ellipseGeometry_1 = (EllipseGeometry)gGrpScheduleNode.Children[i]; |
| 2869 | node_1 = ellipseGeometry_1.Center; | 2871 | node_1 = ellipseGeometry_1.Center; |
| 2870 | if (i > 0) | 2872 | if (i > 0) |
| 2871 | { | 2873 | { |
| 2872 | ellipseGeometry_2 = (EllipseGeometry)gGrpScheduleNode.Children[i - 1]; | 2874 | ellipseGeometry_2 = (EllipseGeometry)gGrpScheduleNode.Children[i - 1]; |
| 2873 | node_2 = ellipseGeometry_2.Center; | 2875 | node_2 = ellipseGeometry_2.Center; |
| 2874 | DrawLine(node_1, node_2, gGrpScheduleLine); | 2876 | DrawLine(node_1, node_2, gGrpScheduleLine); |
| 2875 | } | 2877 | } |
| 2876 | CreateScheduleNode(node_1, i + 1); | 2878 | CreateScheduleNode(node_1, i + 1); |
| 2877 | } | 2879 | } |
| 2878 | } | 2880 | } |
| 2879 | } | 2881 | } |
| 2880 | 2882 | ||
| 2881 | private void CreateScheduleNode(Point point, int indexNode) | 2883 | private void CreateScheduleNode(Point point, int indexNode) |
| 2882 | { | 2884 | { |
| 2883 | ucNode _ucNode = new ucNode(); | 2885 | ucNode _ucNode = new ucNode(); |
| 2884 | _ucNode.btnWidth = UCNODE_WIDTH; | 2886 | _ucNode.btnWidth = UCNODE_WIDTH; |
| 2885 | _ucNode.btnHeight = UCNODE_HEIGHT; | 2887 | _ucNode.btnHeight = UCNODE_HEIGHT; |
| 2886 | _ucNode.txtNode = indexNode.ToString(); | 2888 | _ucNode.txtNode = indexNode.ToString(); |
| 2887 | _ucNode.IsDragDelta = false; | 2889 | _ucNode.IsDragDelta = false; |
| 2888 | Canvas.SetLeft(_ucNode, point.X - UCNODE_SETLEFT); | 2890 | Canvas.SetLeft(_ucNode, point.X - UCNODE_SETLEFT); |
| 2889 | Canvas.SetTop(_ucNode, point.Y - UCNODE_SETTOP); | 2891 | Canvas.SetTop(_ucNode, point.Y - UCNODE_SETTOP); |
| 2890 | scheduleCanvas.Children.Add(_ucNode); | 2892 | scheduleCanvas.Children.Add(_ucNode); |
| 2891 | ucScheduleNode_Lst.Add(_ucNode); | 2893 | ucScheduleNode_Lst.Add(_ucNode); |
| 2892 | } | 2894 | } |
| 2893 | 2895 | ||
| 2894 | #endregion | 2896 | #endregion |
| 2895 | 2897 | ||
| 2896 | #region Add Vehicle | 2898 | #region Add Vehicle |
| 2897 | public void GetIndexVehicle() | 2899 | public void GetIndexVehicle() |
| 2898 | { | 2900 | { |
| 2899 | bool flag = false; | 2901 | bool flag = false; |
| 2900 | if (VehicleModel.VehicleModelList.Count > 0) | 2902 | if (VehicleModel.VehicleModelList.Count > 0) |
| 2901 | { | 2903 | { |
| 2902 | for (int i = 0; i < VehicleModel.VehicleModelList.Count; i++) | 2904 | for (int i = 0; i < VehicleModel.VehicleModelList.Count; i++) |
| 2903 | { | 2905 | { |
| 2904 | if (VehicleItem == VehicleModel.VehicleModelList[i].VehicleName) | 2906 | if (VehicleItem == VehicleModel.VehicleModelList[i].VehicleName) |
| 2905 | { | 2907 | { |
| 2906 | VehicleIndex = i; | 2908 | VehicleIndex = i; |
| 2907 | flag = true; | 2909 | flag = true; |
| 2908 | } | 2910 | } |
| 2909 | } | 2911 | } |
| 2910 | if (!flag) | 2912 | if (!flag) |
| 2911 | { | 2913 | { |
| 2912 | VehicleIndex = VehicleModel.VehicleModelList.Count; | 2914 | VehicleIndex = VehicleModel.VehicleModelList.Count; |
| 2913 | } | 2915 | } |
| 2914 | } | 2916 | } |
| 2915 | else | 2917 | else |
| 2916 | { | 2918 | { |
| 2917 | VehicleIndex = 0; | 2919 | VehicleIndex = 0; |
| 2918 | } | 2920 | } |
| 2919 | } | 2921 | } |
| 2920 | 2922 | ||
| 2921 | public void GetdataVehicle() | 2923 | public void GetdataVehicle() |
| 2922 | { | 2924 | { |
| 2923 | 2925 | ||
| 2924 | GetIndexVehicle(); | 2926 | GetIndexVehicle(); |
| 2925 | 2927 | ||
| 2926 | if (VehicleModel.VehicleModelList.Count > 0) | 2928 | if (VehicleModel.VehicleModelList.Count > 0) |
| 2927 | { | 2929 | { |
| 2928 | 2930 | ||
| 2929 | 2931 | ||
| 2930 | for (int i = 0; i < ucNode_Lst.Count; i++) | 2932 | for (int i = 0; i < ucNode_Lst.Count; i++) |
| 2931 | { | 2933 | { |
| 2932 | this.Children.Remove(ucNode_Lst[i]); | 2934 | this.Children.Remove(ucNode_Lst[i]); |
| 2933 | } | 2935 | } |
| 2934 | 2936 | ||
| 2935 | gGrpNewLine.Children.Clear(); | 2937 | gGrpNewLine.Children.Clear(); |
| 2936 | this.Children.Remove(pNewLine); | 2938 | this.Children.Remove(pNewLine); |
| 2937 | ucNode_Lst.Clear(); | 2939 | ucNode_Lst.Clear(); |
| 2938 | Lst_Node_tmp.Clear(); | 2940 | Lst_Node_tmp.Clear(); |
| 2939 | 2941 | ||
| 2940 | 2942 | ||
| 2941 | gGrpBlueNode.Children.Clear(); | 2943 | gGrpBlueNode.Children.Clear(); |
| 2942 | gGrpScheduleNode.Children.Clear(); | 2944 | gGrpScheduleNode.Children.Clear(); |
| 2943 | IndexNodeInsert_List.Clear(); | 2945 | IndexNodeInsert_List.Clear(); |
| 2944 | 2946 | ||
| 2945 | if (VehicleIndex < VehicleModel.VehicleModelList.Count) | 2947 | if (VehicleIndex < VehicleModel.VehicleModelList.Count) |
| 2946 | { | 2948 | { |
| 2947 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count > 0) | 2949 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count > 0) |
| 2948 | { | 2950 | { |
| 2949 | for (int k = 0; k < VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count; k++) | 2951 | for (int k = 0; k < VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count; k++) |
| 2950 | { | 2952 | { |
| 2951 | double X = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointMap_X; | 2953 | double X = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointMap_X; |
| 2952 | double Y = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointMap_Y; | 2954 | double Y = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointMap_Y; |
| 2953 | 2955 | ||
| 2954 | Point node = new Point(X, Y); | 2956 | Point node = new Point(X, Y); |
| 2955 | AddNode(node, gGrpBlueNode); | 2957 | AddNode(node, gGrpBlueNode); |
| 2956 | 2958 | ||
| 2957 | //Get list Node Insert | 2959 | //Get list Node Insert |
| 2958 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].color == ColorNode_Insert) | 2960 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].color == ColorNode_Insert) |
| 2959 | { | 2961 | { |
| 2960 | ListIndexNodeInsert ListIndex = new ListIndexNodeInsert(); | 2962 | ListIndexNodeInsert ListIndex = new ListIndexNodeInsert(); |
| 2961 | ListIndex.X = X; | 2963 | ListIndex.X = X; |
| 2962 | ListIndex.Y = Y; | 2964 | ListIndex.Y = Y; |
| 2963 | IndexNodeInsert_List.Add(ListIndex); | 2965 | IndexNodeInsert_List.Add(ListIndex); |
| 2964 | } | 2966 | } |
| 2965 | 2967 | ||
| 2966 | //Bind VehicleModel's NodeInfo to List Node Info temp | 2968 | //Bind VehicleModel's NodeInfo to List Node Info temp |
| 2967 | Node_tmp node_tmp = new Node_tmp(); | 2969 | Node_tmp node_tmp = new Node_tmp(); |
| 2968 | node_tmp.pointMap_X = X; | 2970 | node_tmp.pointMap_X = X; |
| 2969 | node_tmp.pointMap_Y = Y; | 2971 | node_tmp.pointMap_Y = Y; |
| 2970 | 2972 | ||
| 2971 | foreach (ListNodeInfo tmp in VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].ListNodeInfo) | 2973 | foreach (ListNodeInfo tmp in VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].ListNodeInfo) |
| 2972 | { | 2974 | { |
| 2973 | node_tmp.NodeInfo_tmp.Add(tmp); | 2975 | node_tmp.NodeInfo_tmp.Add(tmp); |
| 2974 | } | 2976 | } |
| 2975 | Lst_Node_tmp.Add(node_tmp); | 2977 | Lst_Node_tmp.Add(node_tmp); |
| 2976 | 2978 | ||
| 2977 | 2979 | ||
| 2978 | 2980 | ||
| 2979 | X = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointSchedule_X; | 2981 | X = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointSchedule_X; |
| 2980 | Y = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointSchedule_Y; | 2982 | Y = VehicleModel.VehicleModelList[VehicleIndex].pointMapList[k].pointSchedule_Y; |
| 2981 | node = new Point(X, Y); | 2983 | node = new Point(X, Y); |
| 2982 | AddNode(node, gGrpScheduleNode); | 2984 | AddNode(node, gGrpScheduleNode); |
| 2983 | 2985 | ||
| 2984 | } | 2986 | } |
| 2985 | } | 2987 | } |
| 2986 | } | 2988 | } |
| 2987 | } | 2989 | } |
| 2988 | 2990 | ||
| 2989 | BindBlueNode2ucNode(); | 2991 | BindBlueNode2ucNode(); |
| 2990 | 2992 | ||
| 2991 | ReDrawAllNode(); | 2993 | ReDrawAllNode(); |
| 2992 | 2994 | ||
| 2993 | SetScheduleRoute(); | 2995 | SetScheduleRoute(); |
| 2994 | 2996 | ||
| 2995 | NewDspRouteInfo(); | 2997 | NewDspRouteInfo(); |
| 2996 | 2998 | ||
| 2997 | //Clear Route Info Table | 2999 | //Clear Route Info Table |
| 2998 | //((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); | 3000 | //((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); |
| 2999 | 3001 | ||
| 3000 | 3002 | ||
| 3001 | } | 3003 | } |
| 3002 | 3004 | ||
| 3003 | public void CreateVehicleNode() | 3005 | public void CreateVehicleNode() |
| 3004 | { | 3006 | { |
| 3005 | EllipseGeometry ellipseGeometry; | 3007 | EllipseGeometry ellipseGeometry; |
| 3006 | Point node; | 3008 | Point node; |
| 3007 | ListNodeInfo ListNodeInfo = new ListNodeInfo(); | 3009 | ListNodeInfo ListNodeInfo = new ListNodeInfo(); |
| 3008 | VehicleModelList VehicleModelList = new VehicleModelList(); | 3010 | VehicleModelList VehicleModelList = new VehicleModelList(); |
| 3009 | bool NodeISInsert = false; | 3011 | bool NodeISInsert = false; |
| 3010 | 3012 | ||
| 3011 | if (VehicleModel.VehicleModelList.Count > 0 && VehicleIndex < VehicleModel.VehicleModelList.Count) | 3013 | if (VehicleModel.VehicleModelList.Count > 0 && VehicleIndex < VehicleModel.VehicleModelList.Count) |
| 3012 | { | 3014 | { |
| 3013 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count > 0) | 3015 | if (VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Count > 0) |
| 3014 | { | 3016 | { |
| 3015 | VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Clear(); | 3017 | VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Clear(); |
| 3016 | } | 3018 | } |
| 3017 | 3019 | ||
| 3018 | //back up | 3020 | //back up |
| 3019 | if (gGrpBlueNode.Children.Count > 0) | 3021 | if (gGrpBlueNode.Children.Count > 0) |
| 3020 | { | 3022 | { |
| 3021 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 3023 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 3022 | { | 3024 | { |
| 3023 | NodeISInsert = false; | 3025 | NodeISInsert = false; |
| 3024 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 3026 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 3025 | node = ellipseGeometry.Center; | 3027 | node = ellipseGeometry.Center; |
| 3026 | 3028 | ||
| 3027 | PointMap pMap = new PointMap(); | 3029 | PointMap pMap = new PointMap(); |
| 3028 | pMap.pointMap_X = node.X; | 3030 | pMap.pointMap_X = node.X; |
| 3029 | pMap.pointMap_Y = node.Y; | 3031 | pMap.pointMap_Y = node.Y; |
| 3030 | pMap.speed_Map = 1; | 3032 | pMap.speed_Map = 1; |
| 3031 | 3033 | ||
| 3032 | //Backup List Node Insert of fork | 3034 | //Backup List Node Insert of fork |
| 3033 | if (IndexNodeInsert_List.Count> 0) | 3035 | if (IndexNodeInsert_List.Count> 0) |
| 3034 | { | 3036 | { |
| 3035 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) | 3037 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) |
| 3036 | { | 3038 | { |
| 3037 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) NodeISInsert = true; | 3039 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) NodeISInsert = true; |
| 3038 | } | 3040 | } |
| 3039 | } | 3041 | } |
| 3040 | if (NodeISInsert) | 3042 | if (NodeISInsert) |
| 3041 | { | 3043 | { |
| 3042 | pMap.color = ColorNode_Insert; | 3044 | pMap.color = ColorNode_Insert; |
| 3043 | } | 3045 | } |
| 3044 | else | 3046 | else |
| 3045 | { | 3047 | { |
| 3046 | pMap.color = ColorNode_Add; | 3048 | pMap.color = ColorNode_Add; |
| 3047 | } | 3049 | } |
| 3048 | 3050 | ||
| 3049 | ellipseGeometry = (EllipseGeometry)gGrpScheduleNode.Children[i]; | 3051 | ellipseGeometry = (EllipseGeometry)gGrpScheduleNode.Children[i]; |
| 3050 | node = ellipseGeometry.Center; | 3052 | node = ellipseGeometry.Center; |
| 3051 | pMap.pointSchedule_X = node.X; | 3053 | pMap.pointSchedule_X = node.X; |
| 3052 | pMap.pointSchedule_Y = node.Y; | 3054 | pMap.pointSchedule_Y = node.Y; |
| 3053 | pMap.speed_Schedule = 0.2; //Hard code | 3055 | pMap.speed_Schedule = 0.2; //Hard code |
| 3054 | 3056 | ||
| 3055 | //Node info | 3057 | //Node info |
| 3056 | foreach (ListNodeInfo temp in Lst_Node_tmp[i].NodeInfo_tmp) | 3058 | foreach (ListNodeInfo temp in Lst_Node_tmp[i].NodeInfo_tmp) |
| 3057 | { | 3059 | { |
| 3058 | pMap.ListNodeInfo.Add(temp); | 3060 | pMap.ListNodeInfo.Add(temp); |
| 3059 | 3061 | ||
| 3060 | //set tam | 3062 | //set tam |
| 3061 | pMap.speed_Map = Lst_Node_tmp[i].NodeInfo_tmp[0].Speed; | 3063 | pMap.speed_Map = Lst_Node_tmp[i].NodeInfo_tmp[0].Speed; |
| 3062 | } | 3064 | } |
| 3063 | 3065 | ||
| 3064 | VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Add(pMap); | 3066 | VehicleModel.VehicleModelList[VehicleIndex].pointMapList.Add(pMap); |
| 3065 | 3067 | ||
| 3066 | } | 3068 | } |
| 3067 | } | 3069 | } |
| 3068 | 3070 | ||
| 3069 | } | 3071 | } |
| 3070 | // create new | 3072 | // create new |
| 3071 | else | 3073 | else |
| 3072 | { | 3074 | { |
| 3073 | VehicleModelList.VehicleName = VehicleItem; | 3075 | VehicleModelList.VehicleName = VehicleItem; |
| 3074 | 3076 | ||
| 3075 | if (gGrpBlueNode.Children.Count > 0) | 3077 | if (gGrpBlueNode.Children.Count > 0) |
| 3076 | { | 3078 | { |
| 3077 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) | 3079 | for (int i = 0; i < gGrpBlueNode.Children.Count; i++) |
| 3078 | { | 3080 | { |
| 3079 | NodeISInsert = false; | 3081 | NodeISInsert = false; |
| 3080 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; | 3082 | ellipseGeometry = (EllipseGeometry)gGrpBlueNode.Children[i]; |
| 3081 | node = ellipseGeometry.Center; | 3083 | node = ellipseGeometry.Center; |
| 3082 | 3084 | ||
| 3083 | PointMap pMap = new PointMap(); | 3085 | PointMap pMap = new PointMap(); |
| 3084 | pMap.pointMap_X = node.X; | 3086 | pMap.pointMap_X = node.X; |
| 3085 | pMap.pointMap_Y = node.Y; | 3087 | pMap.pointMap_Y = node.Y; |
| 3086 | pMap.speed_Map = 1; | 3088 | pMap.speed_Map = 1; |
| 3087 | 3089 | ||
| 3088 | if (IndexNodeInsert_List.Count > 0) | 3090 | if (IndexNodeInsert_List.Count > 0) |
| 3089 | { | 3091 | { |
| 3090 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) | 3092 | for (int j = 0; j < IndexNodeInsert_List.Count; j++) |
| 3091 | { | 3093 | { |
| 3092 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) NodeISInsert = true; | 3094 | if (node.X == IndexNodeInsert_List[j].X && node.Y == IndexNodeInsert_List[j].Y) NodeISInsert = true; |
| 3093 | } | 3095 | } |
| 3094 | } | 3096 | } |
| 3095 | if (NodeISInsert) | 3097 | if (NodeISInsert) |
| 3096 | { | 3098 | { |
| 3097 | pMap.color = ColorNode_Insert; | 3099 | pMap.color = ColorNode_Insert; |
| 3098 | } | 3100 | } |
| 3099 | else | 3101 | else |
| 3100 | { | 3102 | { |
| 3101 | pMap.color = ColorNode_Add; | 3103 | pMap.color = ColorNode_Add; |
| 3102 | } | 3104 | } |
| 3103 | 3105 | ||
| 3104 | //Node info | 3106 | //Node info |
| 3105 | foreach (ListNodeInfo temp in Lst_Node_tmp[i].NodeInfo_tmp) | 3107 | foreach (ListNodeInfo temp in Lst_Node_tmp[i].NodeInfo_tmp) |
| 3106 | { | 3108 | { |
| 3107 | pMap.ListNodeInfo.Add(temp); | 3109 | pMap.ListNodeInfo.Add(temp); |
| 3108 | } | 3110 | } |
| 3109 | 3111 | ||
| 3110 | ellipseGeometry = (EllipseGeometry)gGrpScheduleNode.Children[i]; | 3112 | ellipseGeometry = (EllipseGeometry)gGrpScheduleNode.Children[i]; |
| 3111 | node = ellipseGeometry.Center; | 3113 | node = ellipseGeometry.Center; |
| 3112 | pMap.pointSchedule_X = node.X; | 3114 | pMap.pointSchedule_X = node.X; |
| 3113 | pMap.pointSchedule_Y = node.Y; | 3115 | pMap.pointSchedule_Y = node.Y; |
| 3114 | pMap.speed_Schedule = 0.2; //Hard code | 3116 | pMap.speed_Schedule = 0.2; //Hard code |
| 3115 | 3117 | ||
| 3116 | VehicleModelList.pointMapList.Add(pMap); | 3118 | VehicleModelList.pointMapList.Add(pMap); |
| 3117 | } | 3119 | } |
| 3118 | } | 3120 | } |
| 3119 | VehicleModel.VehicleModelList.Add(VehicleModelList); | 3121 | VehicleModel.VehicleModelList.Add(VehicleModelList); |
| 3120 | } | 3122 | } |
| 3121 | } | 3123 | } |
| 3122 | #endregion | 3124 | #endregion |
| 3123 | 3125 | ||
| 3124 | #region Read file Mapfan | 3126 | #region Read file Mapfan |
| 3125 | 3127 | ||
| 3126 | public void ReadFile() | 3128 | public void ReadFile() |
| 3127 | { | 3129 | { |
| 3128 | Point node; | 3130 | Point node; |
| 3129 | string[] lines = System.IO.File.ReadAllLines(@"Mapfan\MapFan.index"); | 3131 | string[] lines = System.IO.File.ReadAllLines(@"Mapfan\MapFan.index"); |
| 3130 | 3132 | ||
| 3131 | foreach (string line in lines) | 3133 | foreach (string line in lines) |
| 3132 | { | 3134 | { |
| 3133 | // Use a tab to indent each line of the file. | 3135 | // Use a tab to indent each line of the file. |
| 3134 | string[] tmp = line.Split('\t'); | 3136 | string[] tmp = line.Split('\t'); |
| 3135 | 3137 | ||
| 3136 | double lat = Double.Parse(tmp[1]); | 3138 | double lat = Double.Parse(tmp[1]); |
| 3137 | double log = Double.Parse(tmp[3]); | 3139 | double log = Double.Parse(tmp[3]); |
| 3138 | 3140 | ||
| 3139 | node = new Point(lat, log); | 3141 | node = new Point(lat, log); |
| 3140 | 3142 | ||
| 3141 | 3143 | ||
| 3142 | execCreateNode(node); | 3144 | execCreateNode(node); |
| 3143 | //AddNode(node, gGrpBlueNode); | 3145 | //AddNode(node, gGrpBlueNode); |
| 3144 | 3146 | ||
| 3145 | 3147 | ||
| 3146 | } | 3148 | } |
| 3147 | //BindBlueNode2ucNode(); | 3149 | //BindBlueNode2ucNode(); |
| 3148 | 3150 | ||
| 3149 | 3151 | ||
| 3150 | SetScheduleRoute(); | 3152 | SetScheduleRoute(); |
| 3151 | 3153 | ||
| 3152 | } | 3154 | } |
| 3153 | #endregion | 3155 | #endregion |
| 3154 | 3156 | ||
| 3157 | #region Get data from AWS | ||
| 3158 | // Get info fork | ||
| 3159 | public void GetInfoFork() | ||
| 3160 | { | ||
| 3161 | var service = new Fork2PCTableService(); | ||
| 3162 | /*Read*/ | ||
| 3163 | IEnumerable<Fork2PC> fork2PCs = service.GetAllFork2PCs().Where(x => x.ForkID == 1); | ||
| 3164 | if (fork2PCs.Count() == 0) | ||
| 3165 | return; | ||
| 3166 | var fork2PC = fork2PCs.ElementAt(0); | ||
| 3167 | |||
| 3168 | //Clear Route Info Table | ||
| 3169 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); | ||
| 3170 | |||
| 3171 | int _RowIdx = 0; | ||
| 3172 | AddLabeltoGrid(_RowIdx, 0, "ID"); | ||
| 3173 | AddLabeltoGrid(_RowIdx, 1, fork2PC.ForkID.ToString()); | ||
| 3174 | _RowIdx++; | ||
| 3175 | AddLabeltoGrid(_RowIdx, 0, "LAT"); | ||
| 3176 | AddLabeltoGrid(_RowIdx, 1, fork2PC.ForkPos_x.ToString()); | ||
| 3177 | _RowIdx++; | ||
| 3178 | AddLabeltoGrid(_RowIdx, 0, "LOC"); | ||
| 3179 | AddLabeltoGrid(_RowIdx, 1, fork2PC.ForkPos_y.ToString()); | ||
| 3180 | _RowIdx++; | ||
| 3181 | AddLabeltoGrid(_RowIdx, 0, "SPD"); | ||
| 3182 | AddLabeltoGrid(_RowIdx, 1, fork2PC.spd_veh.ToString() + "Km/h"); | ||
| 3183 | _RowIdx++; | ||
| 3184 | AddLabeltoGrid(_RowIdx, 0, "GPS"); | ||
| 3185 | AddLabeltoGrid(_RowIdx, 1, fork2PC.GPS_data); | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | /// <summary> | ||
| 3189 | /// Get infor node | ||
| 3190 | /// </summary> | ||
| 3191 | public void GetInfoNode() | ||
| 3192 | { | ||
| 3193 | var service = new Robofork15DemoService(); | ||
| 3194 | /*Read*/ | ||
| 3195 | IEnumerable<Robofork15Demo> fork2PCs = service.GetAllRobofork15Demos().Where(x => x.ForkNo == 1).OrderBy(x => x.NodeID); | ||
| 3196 | |||
| 3197 | //Clear Route Info Table | ||
| 3198 | ((RoboforkMenu)System.Windows.Application.Current.MainWindow).grdRouteInfo.Children.Clear(); | ||
| 3199 | |||
| 3200 | int _RowIdx = 0; | ||
| 3201 | foreach (var fork2PC in fork2PCs) | ||
| 3202 | { | ||
| 3203 | //Column 1 : node index | ||
| 3204 | AddLabeltoGrid(_RowIdx, 0, fork2PC.NodeID.ToString()); | ||
| 3205 | |||
| 3206 | //Column 2 : Pos_X, Pos_Y, Speed | ||
| 3207 | AddLabeltoGrid(_RowIdx, 1, "LAT: " + fork2PC.NodePos_x.ToString()); | ||
| 3208 | _RowIdx++; | ||
| 3209 | AddLabeltoGrid(_RowIdx, 1, "LOC: " + fork2PC.NodePos_y.ToString()); | ||
| 3210 | _RowIdx++; | ||
| 3211 | AddLabeltoGrid(_RowIdx, 1, "SPD: " + fork2PC.NodeVehSpd.ToString() + "Km/h" ); | ||
| 3212 | _RowIdx++; | ||
| 3213 | } | ||
| 3214 | } | ||
| 3215 | #endregion | ||
| 3155 | } | 3216 | } |
| 3156 | } | 3217 | } |
| 3157 | 3218 |
sources/RoboforkApp/Entities/Robofork15Demo.cs
| 1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
| 2 | using Amazon.DynamoDBv2.DataModel; | 2 | using Amazon.DynamoDBv2.DataModel; |
| 3 | 3 | ||
| 4 | namespace RoboforkApp.Entities | 4 | namespace RoboforkApp.Entities |
| 5 | { | 5 | { |
| 6 | [DynamoDBTable("Robofork15Demo")] | 6 | [DynamoDBTable("Robofork15Demo")] |
| 7 | public class Robofork15Demo | 7 | public class Robofork15Demo |
| 8 | { | 8 | { |
| 9 | // フォークリフト毎の ID(No.)今回は"1"固定 | 9 | // フォークリフト毎の ID(No.)今回は"1"固定 |
| 10 | [DynamoDBHashKey] | 10 | public int ForkNo { get; set; } |
| 11 | public int ForkID { get; set; } | ||
| 12 | // ラストノードフラグ 最後のノードでは”1” | 11 | // ラストノードフラグ 最後のノードでは”1” |
| 13 | public byte LastNodeFlag { get; set; } | 12 | public byte LastNodeFlag { get; set; } |
| 14 | // スタート位置からのノードの ID | 13 | // スタート位置からのノードの ID |
| 14 | [DynamoDBHashKey] | ||
| 15 | public int NodeID { get; set; } | 15 | public int NodeID { get; set; } |
| 16 | // ノードの目標リフト高さ ※10 進数 LSB 0.001 m | 16 | // ノードの目標リフト高さ ※10 進数 LSB 0.001 m |
| 17 | public double NodeLftHeight { get; set; } | 17 | public double NodeLftHeight { get; set; } |
| 18 | // スタート位置からの x 差分 ※10 進数 LSB 0.001 m | 18 | // スタート位置からの x 差分 ※10 進数 LSB 0.001 m |
| 19 | public double NodePos_x { get; set; } | 19 | public double NodePos_x { get; set; } |
| 20 | // スタート位置からの y 差分 ※10 進数 LSB 0.001 m | 20 | // スタート位置からの y 差分 ※10 進数 LSB 0.001 m |
| 21 | public double NodePos_y { get; set; } | 21 | public double NodePos_y { get; set; } |
| 22 | // ノードの目標速度 ※10 進数 LSB 0.001m | 22 | // ノードの目標速度 ※10 進数 LSB 0.001m |
| 23 | public double NodeVehSpd { get; set; } | 23 | public double NodeVehSpd { get; set; } |
| 24 | // ノードの車両角度(前ノードとの差分) | 24 | // ノードの車両角度(前ノードとの差分) |
| 25 | public double NodeVehAng { get; set; } | 25 | public double NodeVehAng { get; set; } |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
sources/RoboforkApp/RoboforkApp.csproj
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | <PropertyGroup> | 3 | <PropertyGroup> |
| 4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | 4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | 5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 6 | <ProductVersion>9.0.30729</ProductVersion> | 6 | <ProductVersion>9.0.30729</ProductVersion> |
| 7 | <SchemaVersion>2.0</SchemaVersion> | 7 | <SchemaVersion>2.0</SchemaVersion> |
| 8 | <ProjectGuid>{4946722F-CFFF-4FC6-B1C1-A6107316A58C}</ProjectGuid> | 8 | <ProjectGuid>{4946722F-CFFF-4FC6-B1C1-A6107316A58C}</ProjectGuid> |
| 9 | <OutputType>WinExe</OutputType> | 9 | <OutputType>WinExe</OutputType> |
| 10 | <AppDesignerFolder>Properties</AppDesignerFolder> | 10 | <AppDesignerFolder>Properties</AppDesignerFolder> |
| 11 | <RootNamespace>RoboforkApp</RootNamespace> | 11 | <RootNamespace>RoboforkApp</RootNamespace> |
| 12 | <AssemblyName>RboforkApp</AssemblyName> | 12 | <AssemblyName>RboforkApp</AssemblyName> |
| 13 | <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | 13 | <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
| 14 | <FileAlignment>512</FileAlignment> | 14 | <FileAlignment>512</FileAlignment> |
| 15 | <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | 15 | <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
| 16 | <WarningLevel>4</WarningLevel> | 16 | <WarningLevel>4</WarningLevel> |
| 17 | <FileUpgradeFlags> | 17 | <FileUpgradeFlags> |
| 18 | </FileUpgradeFlags> | 18 | </FileUpgradeFlags> |
| 19 | <UpgradeBackupLocation> | 19 | <UpgradeBackupLocation> |
| 20 | </UpgradeBackupLocation> | 20 | </UpgradeBackupLocation> |
| 21 | <OldToolsVersion>3.5</OldToolsVersion> | 21 | <OldToolsVersion>3.5</OldToolsVersion> |
| 22 | <SccProjectName>SAK</SccProjectName> | 22 | <SccProjectName>SAK</SccProjectName> |
| 23 | <SccLocalPath>SAK</SccLocalPath> | 23 | <SccLocalPath>SAK</SccLocalPath> |
| 24 | <SccAuxPath>SAK</SccAuxPath> | 24 | <SccAuxPath>SAK</SccAuxPath> |
| 25 | <SccProvider>SAK</SccProvider> | 25 | <SccProvider>SAK</SccProvider> |
| 26 | <IsWebBootstrapper>false</IsWebBootstrapper> | 26 | <IsWebBootstrapper>false</IsWebBootstrapper> |
| 27 | <TargetFrameworkProfile /> | 27 | <TargetFrameworkProfile /> |
| 28 | <PublishUrl>publish\</PublishUrl> | 28 | <PublishUrl>publish\</PublishUrl> |
| 29 | <Install>true</Install> | 29 | <Install>true</Install> |
| 30 | <InstallFrom>Disk</InstallFrom> | 30 | <InstallFrom>Disk</InstallFrom> |
| 31 | <UpdateEnabled>false</UpdateEnabled> | 31 | <UpdateEnabled>false</UpdateEnabled> |
| 32 | <UpdateMode>Foreground</UpdateMode> | 32 | <UpdateMode>Foreground</UpdateMode> |
| 33 | <UpdateInterval>7</UpdateInterval> | 33 | <UpdateInterval>7</UpdateInterval> |
| 34 | <UpdateIntervalUnits>Days</UpdateIntervalUnits> | 34 | <UpdateIntervalUnits>Days</UpdateIntervalUnits> |
| 35 | <UpdatePeriodically>false</UpdatePeriodically> | 35 | <UpdatePeriodically>false</UpdatePeriodically> |
| 36 | <UpdateRequired>false</UpdateRequired> | 36 | <UpdateRequired>false</UpdateRequired> |
| 37 | <MapFileExtensions>true</MapFileExtensions> | 37 | <MapFileExtensions>true</MapFileExtensions> |
| 38 | <ApplicationRevision>0</ApplicationRevision> | 38 | <ApplicationRevision>0</ApplicationRevision> |
| 39 | <ApplicationVersion>1.0.0.%2a</ApplicationVersion> | 39 | <ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
| 40 | <UseApplicationTrust>false</UseApplicationTrust> | 40 | <UseApplicationTrust>false</UseApplicationTrust> |
| 41 | <BootstrapperEnabled>true</BootstrapperEnabled> | 41 | <BootstrapperEnabled>true</BootstrapperEnabled> |
| 42 | </PropertyGroup> | 42 | </PropertyGroup> |
| 43 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | 43 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
| 44 | <DebugSymbols>true</DebugSymbols> | 44 | <DebugSymbols>true</DebugSymbols> |
| 45 | <DebugType>full</DebugType> | 45 | <DebugType>full</DebugType> |
| 46 | <Optimize>false</Optimize> | 46 | <Optimize>false</Optimize> |
| 47 | <OutputPath>bin\Debug\</OutputPath> | 47 | <OutputPath>bin\Debug\</OutputPath> |
| 48 | <DefineConstants>DEBUG;TRACE</DefineConstants> | 48 | <DefineConstants>DEBUG;TRACE</DefineConstants> |
| 49 | <ErrorReport>prompt</ErrorReport> | 49 | <ErrorReport>prompt</ErrorReport> |
| 50 | <WarningLevel>4</WarningLevel> | 50 | <WarningLevel>4</WarningLevel> |
| 51 | <Prefer32Bit>false</Prefer32Bit> | 51 | <Prefer32Bit>false</Prefer32Bit> |
| 52 | </PropertyGroup> | 52 | </PropertyGroup> |
| 53 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | 53 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
| 54 | <DebugType>pdbonly</DebugType> | 54 | <DebugType>pdbonly</DebugType> |
| 55 | <Optimize>true</Optimize> | 55 | <Optimize>true</Optimize> |
| 56 | <OutputPath>bin\Release\</OutputPath> | 56 | <OutputPath>bin\Release\</OutputPath> |
| 57 | <DefineConstants>TRACE</DefineConstants> | 57 | <DefineConstants>TRACE</DefineConstants> |
| 58 | <ErrorReport>prompt</ErrorReport> | 58 | <ErrorReport>prompt</ErrorReport> |
| 59 | <WarningLevel>4</WarningLevel> | 59 | <WarningLevel>4</WarningLevel> |
| 60 | <Prefer32Bit>false</Prefer32Bit> | 60 | <Prefer32Bit>false</Prefer32Bit> |
| 61 | </PropertyGroup> | 61 | </PropertyGroup> |
| 62 | <PropertyGroup> | 62 | <PropertyGroup> |
| 63 | <StartupObject>RoboforkApp.App</StartupObject> | 63 | <StartupObject>RoboforkApp.App</StartupObject> |
| 64 | </PropertyGroup> | 64 | </PropertyGroup> |
| 65 | <ItemGroup> | 65 | <ItemGroup> |
| 66 | <Reference Include="AWSSDK, Version=2.3.55.2, Culture=neutral, PublicKeyToken=9f476d3089b52be3, processorArchitecture=MSIL"> | ||
| 67 | <SpecificVersion>False</SpecificVersion> | ||
| 68 | <HintPath>C:\Program Files (x86)\AWS SDK for .NET\past-releases\Version-2\Net45\AWSSDK.dll</HintPath> | ||
| 69 | </Reference> | ||
| 66 | <Reference Include="System" /> | 70 | <Reference Include="System" /> |
| 67 | <Reference Include="System.Core"> | 71 | <Reference Include="System.Core"> |
| 68 | <RequiredTargetFramework>3.5</RequiredTargetFramework> | 72 | <RequiredTargetFramework>3.5</RequiredTargetFramework> |
| 69 | </Reference> | 73 | </Reference> |
| 70 | <Reference Include="System.Windows.Forms" /> | 74 | <Reference Include="System.Windows.Forms" /> |
| 71 | <Reference Include="System.Xaml" /> | 75 | <Reference Include="System.Xaml" /> |
| 72 | <Reference Include="System.Xml.Linq"> | 76 | <Reference Include="System.Xml.Linq"> |
| 73 | <RequiredTargetFramework>3.5</RequiredTargetFramework> | 77 | <RequiredTargetFramework>3.5</RequiredTargetFramework> |
| 74 | </Reference> | 78 | </Reference> |
| 75 | <Reference Include="System.Data.DataSetExtensions"> | 79 | <Reference Include="System.Data.DataSetExtensions"> |
| 76 | <RequiredTargetFramework>3.5</RequiredTargetFramework> | 80 | <RequiredTargetFramework>3.5</RequiredTargetFramework> |
| 77 | </Reference> | 81 | </Reference> |
| 78 | <Reference Include="System.Data" /> | 82 | <Reference Include="System.Data" /> |
| 79 | <Reference Include="System.Xml" /> | 83 | <Reference Include="System.Xml" /> |
| 80 | <Reference Include="UIAutomationProvider"> | 84 | <Reference Include="UIAutomationProvider"> |
| 81 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 85 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
| 82 | </Reference> | 86 | </Reference> |
| 83 | <Reference Include="WindowsBase"> | 87 | <Reference Include="WindowsBase"> |
| 84 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 88 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
| 85 | </Reference> | 89 | </Reference> |
| 86 | <Reference Include="PresentationCore"> | 90 | <Reference Include="PresentationCore"> |
| 87 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 91 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
| 88 | </Reference> | 92 | </Reference> |
| 89 | <Reference Include="PresentationFramework"> | 93 | <Reference Include="PresentationFramework"> |
| 90 | <RequiredTargetFramework>3.0</RequiredTargetFramework> | 94 | <RequiredTargetFramework>3.0</RequiredTargetFramework> |
| 91 | </Reference> | 95 | </Reference> |
| 92 | </ItemGroup> | 96 | </ItemGroup> |
| 93 | <ItemGroup> | 97 | <ItemGroup> |
| 94 | <ApplicationDefinition Include="App.xaml"> | 98 | <ApplicationDefinition Include="App.xaml"> |
| 95 | <Generator>MSBuild:Compile</Generator> | 99 | <Generator>MSBuild:Compile</Generator> |
| 96 | <SubType>Designer</SubType> | 100 | <SubType>Designer</SubType> |
| 97 | <Generator>MSBuild:Compile</Generator> | 101 | <Generator>MSBuild:Compile</Generator> |
| 98 | <SubType>Designer</SubType> | 102 | <SubType>Designer</SubType> |
| 99 | </ApplicationDefinition> | 103 | </ApplicationDefinition> |
| 100 | <Compile Include="App.xaml.cs"> | 104 | <Compile Include="App.xaml.cs"> |
| 101 | <DependentUpon>App.xaml</DependentUpon> | 105 | <DependentUpon>App.xaml</DependentUpon> |
| 102 | <SubType>Code</SubType> | 106 | <SubType>Code</SubType> |
| 103 | </Compile> | 107 | </Compile> |
| 104 | </ItemGroup> | 108 | </ItemGroup> |
| 105 | <ItemGroup> | 109 | <ItemGroup> |
| 106 | <Compile Include="Adorners\ResizeAdorner.cs" /> | 110 | <Compile Include="Adorners\ResizeAdorner.cs" /> |
| 107 | <Compile Include="Adorners\ResizeChrome.cs" /> | 111 | <Compile Include="Adorners\ResizeChrome.cs" /> |
| 108 | <Compile Include="Adorners\RubberbandAdorner.cs" /> | 112 | <Compile Include="Adorners\RubberbandAdorner.cs" /> |
| 109 | <Compile Include="Controls\DesignerCanvas.cs" /> | 113 | <Compile Include="Controls\DesignerCanvas.cs" /> |
| 110 | <Compile Include="Controls\DesignerItem.cs" /> | 114 | <Compile Include="Controls\DesignerItem.cs" /> |
| 111 | <Compile Include="DataModel\ListNodeInfo.cs" /> | 115 | <Compile Include="DataModel\ListNodeInfo.cs" /> |
| 112 | <Compile Include="DataModel\NodeInfo_tmp.cs" /> | 116 | <Compile Include="DataModel\NodeInfo_tmp.cs" /> |
| 113 | <Compile Include="DataModel\PointMap.cs" /> | 117 | <Compile Include="DataModel\PointMap.cs" /> |
| 114 | <Compile Include="DataModel\Node_tmp.cs" /> | 118 | <Compile Include="DataModel\Node_tmp.cs" /> |
| 115 | <Compile Include="DataModel\VehicleModel.cs" /> | 119 | <Compile Include="DataModel\VehicleModel.cs" /> |
| 116 | <Compile Include="DataModel\VehicleModelList.cs" /> | 120 | <Compile Include="DataModel\VehicleModelList.cs" /> |
| 121 | <Compile Include="Entities\Fork2PC.cs" /> | ||
| 122 | <Compile Include="Entities\Robofork15Demo.cs" /> | ||
| 123 | <Compile Include="Services\Fork2PCTableService.cs" /> | ||
| 124 | <Compile Include="Services\Robofork15DemoService.cs" /> | ||
| 117 | <Compile Include="UserControls\simulationRobo.xaml.cs"> | 125 | <Compile Include="UserControls\simulationRobo.xaml.cs"> |
| 118 | <DependentUpon>simulationRobo.xaml</DependentUpon> | 126 | <DependentUpon>simulationRobo.xaml</DependentUpon> |
| 119 | </Compile> | 127 | </Compile> |
| 120 | <Compile Include="View\EditNodeView.xaml.cs"> | 128 | <Compile Include="View\EditNodeView.xaml.cs"> |
| 121 | <DependentUpon>EditNodeView.xaml</DependentUpon> | 129 | <DependentUpon>EditNodeView.xaml</DependentUpon> |
| 122 | </Compile> | 130 | </Compile> |
| 123 | <Compile Include="Controls\MoveThumb.cs" /> | 131 | <Compile Include="Controls\MoveThumb.cs" /> |
| 124 | <Compile Include="Properties\AssemblyInfo.cs"> | 132 | <Compile Include="Properties\AssemblyInfo.cs"> |
| 125 | <SubType>Code</SubType> | 133 | <SubType>Code</SubType> |
| 126 | </Compile> | 134 | </Compile> |
| 127 | <Compile Include="Properties\Settings.Designer.cs"> | 135 | <Compile Include="Properties\Settings.Designer.cs"> |
| 128 | <AutoGen>True</AutoGen> | 136 | <AutoGen>True</AutoGen> |
| 129 | <DependentUpon>Settings.settings</DependentUpon> | 137 | <DependentUpon>Settings.settings</DependentUpon> |
| 130 | <DesignTimeSharedInput>True</DesignTimeSharedInput> | 138 | <DesignTimeSharedInput>True</DesignTimeSharedInput> |
| 131 | </Compile> | 139 | </Compile> |
| 132 | <Compile Include="Controls\ResizeDecorator.cs" /> | 140 | <Compile Include="Controls\ResizeDecorator.cs" /> |
| 133 | <Compile Include="Controls\ResizeThumb.cs" /> | 141 | <Compile Include="Controls\ResizeThumb.cs" /> |
| 134 | <Compile Include="RoboforkMenuView.xaml.cs"> | 142 | <Compile Include="RoboforkMenuView.xaml.cs"> |
| 135 | <DependentUpon>RoboforkMenuView.xaml</DependentUpon> | 143 | <DependentUpon>RoboforkMenuView.xaml</DependentUpon> |
| 136 | </Compile> | 144 | </Compile> |
| 137 | <Compile Include="Controls\ScheduleCanvas.cs" /> | 145 | <Compile Include="Controls\ScheduleCanvas.cs" /> |
| 138 | <Compile Include="UserControls\ucDisplayCoordinate.xaml.cs"> | 146 | <Compile Include="UserControls\ucDisplayCoordinate.xaml.cs"> |
| 139 | <DependentUpon>ucDisplayCoordinate.xaml</DependentUpon> | 147 | <DependentUpon>ucDisplayCoordinate.xaml</DependentUpon> |
| 140 | </Compile> | 148 | </Compile> |
| 141 | <Compile Include="UserControls\ucNode.xaml.cs"> | 149 | <Compile Include="UserControls\ucNode.xaml.cs"> |
| 142 | <DependentUpon>ucNode.xaml</DependentUpon> | 150 | <DependentUpon>ucNode.xaml</DependentUpon> |
| 143 | </Compile> | 151 | </Compile> |
| 144 | <Compile Include="UserControls\ucStartEndButton.xaml.cs"> | 152 | <Compile Include="UserControls\ucStartEndButton.xaml.cs"> |
| 145 | <DependentUpon>ucStartEndButton.xaml</DependentUpon> | 153 | <DependentUpon>ucStartEndButton.xaml</DependentUpon> |
| 146 | </Compile> | 154 | </Compile> |
| 147 | <Compile Include="Controls\Toolbox.cs" /> | 155 | <Compile Include="Controls\Toolbox.cs" /> |
| 148 | <Compile Include="Controls\ToolboxItem.cs" /> | 156 | <Compile Include="Controls\ToolboxItem.cs" /> |
| 149 | <Compile Include="Controls\ZoomBox.cs" /> | 157 | <Compile Include="Controls\ZoomBox.cs" /> |
| 150 | <None Include="app.config" /> | 158 | <None Include="app.config" /> |
| 151 | <None Include="Mapfan\MapFan.index"> | 159 | <None Include="Mapfan\MapFan.index"> |
| 152 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> | 160 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
| 153 | </None> | 161 | </None> |
| 154 | <None Include="Properties\Settings.settings"> | 162 | <None Include="Properties\Settings.settings"> |
| 155 | <Generator>SettingsSingleFileGenerator</Generator> | 163 | <Generator>SettingsSingleFileGenerator</Generator> |
| 156 | <LastGenOutput>Settings.Designer.cs</LastGenOutput> | 164 | <LastGenOutput>Settings.Designer.cs</LastGenOutput> |
| 157 | </None> | 165 | </None> |
| 158 | <AppDesigner Include="Properties\" /> | 166 | <AppDesigner Include="Properties\" /> |
| 159 | </ItemGroup> | 167 | </ItemGroup> |
| 160 | <ItemGroup> | 168 | <ItemGroup> |
| 161 | <Page Include="UserControls\simulationRobo.xaml"> | 169 | <Page Include="UserControls\simulationRobo.xaml"> |
| 162 | <Generator>MSBuild:Compile</Generator> | 170 | <Generator>MSBuild:Compile</Generator> |
| 163 | <SubType>Designer</SubType> | 171 | <SubType>Designer</SubType> |
| 164 | </Page> | 172 | </Page> |
| 165 | <Page Include="View\EditNodeView.xaml"> | 173 | <Page Include="View\EditNodeView.xaml"> |
| 166 | <SubType>Designer</SubType> | 174 | <SubType>Designer</SubType> |
| 167 | <Generator>MSBuild:Compile</Generator> | 175 | <Generator>MSBuild:Compile</Generator> |
| 168 | </Page> | 176 | </Page> |
| 169 | <Page Include="Resources\Brushes.xaml"> | 177 | <Page Include="Resources\Brushes.xaml"> |
| 170 | <Generator>MSBuild:Compile</Generator> | 178 | <Generator>MSBuild:Compile</Generator> |
| 171 | <SubType>Designer</SubType> | 179 | <SubType>Designer</SubType> |
| 172 | <Generator>MSBuild:Compile</Generator> | 180 | <Generator>MSBuild:Compile</Generator> |
| 173 | <SubType>Designer</SubType> | 181 | <SubType>Designer</SubType> |
| 174 | </Page> | 182 | </Page> |
| 175 | <Page Include="Resources\DesignerItem.xaml"> | 183 | <Page Include="Resources\DesignerItem.xaml"> |
| 176 | <Generator>MSBuild:Compile</Generator> | 184 | <Generator>MSBuild:Compile</Generator> |
| 177 | <SubType>Designer</SubType> | 185 | <SubType>Designer</SubType> |
| 178 | <Generator>MSBuild:Compile</Generator> | 186 | <Generator>MSBuild:Compile</Generator> |
| 179 | <SubType>Designer</SubType> | 187 | <SubType>Designer</SubType> |
| 180 | </Page> | 188 | </Page> |
| 181 | <Page Include="Resources\Expander.xaml"> | 189 | <Page Include="Resources\Expander.xaml"> |
| 182 | <Generator>MSBuild:Compile</Generator> | 190 | <Generator>MSBuild:Compile</Generator> |
| 183 | <SubType>Designer</SubType> | 191 | <SubType>Designer</SubType> |
| 184 | <Generator>MSBuild:Compile</Generator> | 192 | <Generator>MSBuild:Compile</Generator> |
| 185 | <SubType>Designer</SubType> | 193 | <SubType>Designer</SubType> |
| 186 | </Page> | 194 | </Page> |
| 187 | <Page Include="Resources\LangResources.xaml"> | 195 | <Page Include="Resources\LangResources.xaml"> |
| 188 | <SubType>Designer</SubType> | 196 | <SubType>Designer</SubType> |
| 189 | <Generator>MSBuild:Compile</Generator> | 197 | <Generator>MSBuild:Compile</Generator> |
| 190 | </Page> | 198 | </Page> |
| 191 | <Page Include="Resources\ResizeChrome.xaml"> | 199 | <Page Include="Resources\ResizeChrome.xaml"> |
| 192 | <Generator>MSBuild:Compile</Generator> | 200 | <Generator>MSBuild:Compile</Generator> |
| 193 | <SubType>Designer</SubType> | 201 | <SubType>Designer</SubType> |
| 194 | <Generator>MSBuild:Compile</Generator> | 202 | <Generator>MSBuild:Compile</Generator> |
| 195 | <SubType>Designer</SubType> | 203 | <SubType>Designer</SubType> |
| 196 | </Page> | 204 | </Page> |
| 197 | <Page Include="Resources\ScrollBar.xaml"> | 205 | <Page Include="Resources\ScrollBar.xaml"> |
| 198 | <Generator>MSBuild:Compile</Generator> | 206 | <Generator>MSBuild:Compile</Generator> |
| 199 | <SubType>Designer</SubType> | 207 | <SubType>Designer</SubType> |
| 200 | <Generator>MSBuild:Compile</Generator> | 208 | <Generator>MSBuild:Compile</Generator> |
| 201 | <SubType>Designer</SubType> | 209 | <SubType>Designer</SubType> |
| 202 | </Page> | 210 | </Page> |
| 203 | <Page Include="Resources\ScrollViewer.xaml"> | 211 | <Page Include="Resources\ScrollViewer.xaml"> |
| 204 | <Generator>MSBuild:Compile</Generator> | 212 | <Generator>MSBuild:Compile</Generator> |
| 205 | <SubType>Designer</SubType> | 213 | <SubType>Designer</SubType> |
| 206 | <Generator>MSBuild:Compile</Generator> | 214 | <Generator>MSBuild:Compile</Generator> |
| 207 | <SubType>Designer</SubType> | 215 | <SubType>Designer</SubType> |
| 208 | </Page> | 216 | </Page> |
| 209 | <Page Include="Resources\Slider.xaml"> | 217 | <Page Include="Resources\Slider.xaml"> |
| 210 | <Generator>MSBuild:Compile</Generator> | 218 | <Generator>MSBuild:Compile</Generator> |
| 211 | <SubType>Designer</SubType> | 219 | <SubType>Designer</SubType> |
| 212 | <Generator>MSBuild:Compile</Generator> | 220 | <Generator>MSBuild:Compile</Generator> |
| 213 | <SubType>Designer</SubType> | 221 | <SubType>Designer</SubType> |
| 214 | </Page> | 222 | </Page> |
| 215 | <Page Include="Resources\StatusBar.xaml"> | 223 | <Page Include="Resources\StatusBar.xaml"> |
| 216 | <Generator>MSBuild:Compile</Generator> | 224 | <Generator>MSBuild:Compile</Generator> |
| 217 | <SubType>Designer</SubType> | 225 | <SubType>Designer</SubType> |
| 218 | <Generator>MSBuild:Compile</Generator> | 226 | <Generator>MSBuild:Compile</Generator> |
| 219 | <SubType>Designer</SubType> | 227 | <SubType>Designer</SubType> |
| 220 | </Page> | 228 | </Page> |
| 221 | <Page Include="Resources\Styles.xaml"> | 229 | <Page Include="Resources\Styles.xaml"> |
| 222 | <SubType>Designer</SubType> | 230 | <SubType>Designer</SubType> |
| 223 | <Generator>MSBuild:Compile</Generator> | 231 | <Generator>MSBuild:Compile</Generator> |
| 224 | </Page> | 232 | </Page> |
| 225 | <Page Include="Resources\ToolBar.xaml"> | 233 | <Page Include="Resources\ToolBar.xaml"> |
| 226 | <Generator>MSBuild:Compile</Generator> | 234 | <Generator>MSBuild:Compile</Generator> |
| 227 | <SubType>Designer</SubType> | 235 | <SubType>Designer</SubType> |
| 228 | <Generator>MSBuild:Compile</Generator> | 236 | <Generator>MSBuild:Compile</Generator> |
| 229 | <SubType>Designer</SubType> | 237 | <SubType>Designer</SubType> |
| 230 | </Page> | 238 | </Page> |
| 231 | <Page Include="Resources\Toolbox.xaml"> | 239 | <Page Include="Resources\Toolbox.xaml"> |
| 232 | <Generator>MSBuild:Compile</Generator> | 240 | <Generator>MSBuild:Compile</Generator> |
| 233 | <SubType>Designer</SubType> | 241 | <SubType>Designer</SubType> |
| 234 | <Generator>MSBuild:Compile</Generator> | 242 | <Generator>MSBuild:Compile</Generator> |
| 235 | <SubType>Designer</SubType> | 243 | <SubType>Designer</SubType> |
| 236 | </Page> | 244 | </Page> |
| 237 | <Page Include="Resources\Tooltip.xaml"> | 245 | <Page Include="Resources\Tooltip.xaml"> |
| 238 | <Generator>MSBuild:Compile</Generator> | 246 | <Generator>MSBuild:Compile</Generator> |
| 239 | <SubType>Designer</SubType> | 247 | <SubType>Designer</SubType> |
| 240 | <Generator>MSBuild:Compile</Generator> | 248 | <Generator>MSBuild:Compile</Generator> |
| 241 | <SubType>Designer</SubType> | 249 | <SubType>Designer</SubType> |
| 242 | </Page> | 250 | </Page> |
| 243 | <Page Include="Resources\ZoomBox.xaml"> | 251 | <Page Include="Resources\ZoomBox.xaml"> |
| 244 | <Generator>MSBuild:Compile</Generator> | 252 | <Generator>MSBuild:Compile</Generator> |
| 245 | <SubType>Designer</SubType> | 253 | <SubType>Designer</SubType> |
| 246 | <Generator>MSBuild:Compile</Generator> | 254 | <Generator>MSBuild:Compile</Generator> |
| 247 | <SubType>Designer</SubType> | 255 | <SubType>Designer</SubType> |
| 248 | </Page> | 256 | </Page> |
| 249 | <Page Include="RoboforkMenuView.xaml"> | 257 | <Page Include="RoboforkMenuView.xaml"> |
| 250 | <SubType>Designer</SubType> | 258 | <SubType>Designer</SubType> |
| 251 | <Generator>MSBuild:Compile</Generator> | 259 | <Generator>MSBuild:Compile</Generator> |
| 252 | </Page> | 260 | </Page> |
| 253 | <Page Include="UserControls\ucDisplayCoordinate.xaml"> | 261 | <Page Include="UserControls\ucDisplayCoordinate.xaml"> |
| 254 | <Generator>MSBuild:Compile</Generator> | 262 | <Generator>MSBuild:Compile</Generator> |
| 255 | <SubType>Designer</SubType> | 263 | <SubType>Designer</SubType> |
| 256 | </Page> | 264 | </Page> |
| 257 | <Page Include="UserControls\ucNode.xaml"> | 265 | <Page Include="UserControls\ucNode.xaml"> |
| 258 | <SubType>Designer</SubType> | 266 | <SubType>Designer</SubType> |
| 259 | <Generator>MSBuild:Compile</Generator> | 267 | <Generator>MSBuild:Compile</Generator> |
| 260 | </Page> | 268 | </Page> |
| 261 | <Page Include="UserControls\ucStartEndButton.xaml"> | 269 | <Page Include="UserControls\ucStartEndButton.xaml"> |
| 262 | <SubType>Designer</SubType> | 270 | <SubType>Designer</SubType> |
| 263 | <Generator>MSBuild:Compile</Generator> | 271 | <Generator>MSBuild:Compile</Generator> |
| 264 | </Page> | 272 | </Page> |
| 265 | <Page Include="Stencils\BasicShapes.xaml"> | 273 | <Page Include="Stencils\BasicShapes.xaml"> |
| 266 | <Generator>MSBuild:Compile</Generator> | 274 | <Generator>MSBuild:Compile</Generator> |
| 267 | <SubType>Designer</SubType> | 275 | <SubType>Designer</SubType> |
| 268 | <Generator>MSBuild:Compile</Generator> | 276 | <Generator>MSBuild:Compile</Generator> |
| 269 | <SubType>Designer</SubType> | 277 | <SubType>Designer</SubType> |
| 270 | </Page> | 278 | </Page> |
| 271 | <Page Include="Stencils\FlowChartSymbols.xaml"> | 279 | <Page Include="Stencils\FlowChartSymbols.xaml"> |
| 272 | <SubType>Designer</SubType> | 280 | <SubType>Designer</SubType> |
| 273 | <Generator>MSBuild:Compile</Generator> | 281 | <Generator>MSBuild:Compile</Generator> |
| 274 | <Generator>MSBuild:Compile</Generator> | 282 | <Generator>MSBuild:Compile</Generator> |
| 275 | <SubType>Designer</SubType> | 283 | <SubType>Designer</SubType> |
| 276 | </Page> | 284 | </Page> |
| 277 | <Page Include="Stencils\RegelungstechnikSymbole.xaml"> | 285 | <Page Include="Stencils\RegelungstechnikSymbole.xaml"> |
| 278 | <SubType>Designer</SubType> | 286 | <SubType>Designer</SubType> |
| 279 | <Generator>MSBuild:Compile</Generator> | 287 | <Generator>MSBuild:Compile</Generator> |
| 280 | <Generator>MSBuild:Compile</Generator> | 288 | <Generator>MSBuild:Compile</Generator> |
| 281 | <SubType>Designer</SubType> | 289 | <SubType>Designer</SubType> |
| 282 | </Page> | 290 | </Page> |
| 283 | <Page Include="Stencils\SymbolStencils.xaml"> | 291 | <Page Include="Stencils\SymbolStencils.xaml"> |
| 284 | <Generator>MSBuild:Compile</Generator> | 292 | <Generator>MSBuild:Compile</Generator> |
| 285 | <SubType>Designer</SubType> | 293 | <SubType>Designer</SubType> |
| 286 | <Generator>MSBuild:Compile</Generator> | 294 | <Generator>MSBuild:Compile</Generator> |
| 287 | <SubType>Designer</SubType> | 295 | <SubType>Designer</SubType> |
| 288 | </Page> | 296 | </Page> |
| 289 | </ItemGroup> | 297 | </ItemGroup> |
| 290 | <ItemGroup> | 298 | <ItemGroup> |
| 291 | <Resource Include="Images\rt2.png" /> | 299 | <Resource Include="Images\rt2.png" /> |
| 292 | <Resource Include="Images\rt1.png" /> | 300 | <Resource Include="Images\rt1.png" /> |
| 293 | <Resource Include="Images\rt3.png" /> | 301 | <Resource Include="Images\rt3.png" /> |
| 294 | <Resource Include="Images\rt4.png" /> | 302 | <Resource Include="Images\rt4.png" /> |
| 295 | <Resource Include="Images\rt5.png" /> | 303 | <Resource Include="Images\rt5.png" /> |
| 296 | <Resource Include="Images\rt6.png" /> | 304 | <Resource Include="Images\rt6.png" /> |
| 297 | </ItemGroup> | 305 | </ItemGroup> |
| 298 | <ItemGroup> | 306 | <ItemGroup> |
| 299 | <Resource Include="Images\attention.png" /> | 307 | <Resource Include="Images\attention.png" /> |
| 300 | <Resource Include="Images\chart1.png" /> | 308 | <Resource Include="Images\chart1.png" /> |
| 301 | <Resource Include="Images\chart2.png" /> | 309 | <Resource Include="Images\chart2.png" /> |
| 302 | <Resource Include="Images\chart3.png" /> | 310 | <Resource Include="Images\chart3.png" /> |
| 303 | <Resource Include="Images\cross.png" /> | 311 | <Resource Include="Images\cross.png" /> |
| 304 | <Resource Include="Images\mail.png" /> | 312 | <Resource Include="Images\mail.png" /> |
| 305 | <Resource Include="Images\nuclear.png" /> | 313 | <Resource Include="Images\nuclear.png" /> |
| 306 | <Resource Include="Images\plus.png" /> | 314 | <Resource Include="Images\plus.png" /> |
| 307 | <Resource Include="Images\ring.png" /> | 315 | <Resource Include="Images\ring.png" /> |
| 308 | <Resource Include="Images\software.png" /> | 316 | <Resource Include="Images\software.png" /> |
| 309 | <Resource Include="Images\walk.png" /> | 317 | <Resource Include="Images\walk.png" /> |
| 310 | <Resource Include="Images\world.png" /> | 318 | <Resource Include="Images\world.png" /> |
| 311 | </ItemGroup> | 319 | </ItemGroup> |
| 312 | <ItemGroup> | 320 | <ItemGroup> |
| 313 | <Resource Include="Images\rotateRight.png" /> | 321 | <Resource Include="Images\rotateRight.png" /> |
| 314 | <Resource Include="Images\rotateLeft.png" /> | 322 | <Resource Include="Images\rotateLeft.png" /> |
| 315 | </ItemGroup> | 323 | </ItemGroup> |
| 316 | <ItemGroup> | 324 | <ItemGroup> |
| 317 | <Resource Include="Images\new.png" /> | 325 | <Resource Include="Images\new.png" /> |
| 318 | </ItemGroup> | 326 | </ItemGroup> |
| 319 | <ItemGroup> | 327 | <ItemGroup> |
| 320 | <Resource Include="Images\newBold.png" /> | 328 | <Resource Include="Images\newBold.png" /> |
| 321 | </ItemGroup> | 329 | </ItemGroup> |
| 322 | <ItemGroup> | 330 | <ItemGroup> |
| 323 | <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> | 331 | <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> |
| 324 | <Visible>False</Visible> | 332 | <Visible>False</Visible> |
| 325 | <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> | 333 | <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> |
| 326 | <Install>false</Install> | 334 | <Install>false</Install> |
| 327 | </BootstrapperPackage> | 335 | </BootstrapperPackage> |
| 328 | <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | 336 | <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> |
| 329 | <Visible>False</Visible> | 337 | <Visible>False</Visible> |
| 330 | <ProductName>.NET Framework 3.5 SP1</ProductName> | 338 | <ProductName>.NET Framework 3.5 SP1</ProductName> |
| 331 | <Install>true</Install> | 339 | <Install>true</Install> |
| 332 | </BootstrapperPackage> | 340 | </BootstrapperPackage> |
| 333 | </ItemGroup> | 341 | </ItemGroup> |
| 334 | <ItemGroup> | 342 | <ItemGroup> |
| 335 | <Resource Include="Images\quitApp.png" /> | 343 | <Resource Include="Images\quitApp.png" /> |
| 336 | </ItemGroup> | 344 | </ItemGroup> |
| 337 | <ItemGroup> | 345 | <ItemGroup> |
| 338 | <Resource Include="Images\map.png" /> | 346 | <Resource Include="Images\map.png" /> |
| 339 | </ItemGroup> | 347 | </ItemGroup> |
| 340 | <ItemGroup> | 348 | <ItemGroup> |
| 341 | <Folder Include="bin\Debug\" /> | 349 | <Folder Include="bin\Debug\" /> |
| 342 | <Folder Include="bin\Release\" /> | 350 | <Folder Include="bin\Release\" /> |
| 343 | <Folder Include="Style\" /> | 351 | <Folder Include="Style\" /> |
| 352 | </ItemGroup> | ||
| 353 | <ItemGroup> | ||
| 354 | <ProjectReference Include="..\RoboforkApp.AWS\RoboforkApp.AWS.csproj"> | ||
| 355 | <Project>{a4db3a6a-7959-4517-844b-4d00ae09436c}</Project> | ||
| 356 | <Name>RoboforkApp.AWS</Name> | ||
| 357 | </ProjectReference> | ||
| 344 | </ItemGroup> | 358 | </ItemGroup> |
| 345 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | 359 | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
| 346 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | 360 | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
| 347 | Other similar extension points exist, see Microsoft.Common.targets. | 361 | Other similar extension points exist, see Microsoft.Common.targets. |
| 348 | <Target Name="BeforeBuild"> | 362 | <Target Name="BeforeBuild"> |
| 349 | </Target> | 363 | </Target> |
| 350 | <Target Name="AfterBuild"> | 364 | <Target Name="AfterBuild"> |
| 351 | </Target> | 365 | </Target> |
| 352 | --> | 366 | --> |
| 353 | </Project> | 367 | </Project> |
sources/RoboforkApp/RoboforkApp.csproj.user
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | <PropertyGroup> | 3 | <PropertyGroup> |
| 4 | <PublishUrlHistory>publish\</PublishUrlHistory> | 4 | <PublishUrlHistory>publish\</PublishUrlHistory> |
| 5 | <InstallUrlHistory /> | 5 | <InstallUrlHistory /> |
| 6 | <SupportUrlHistory /> | 6 | <SupportUrlHistory /> |
| 7 | <UpdateUrlHistory /> | 7 | <UpdateUrlHistory /> |
| 8 | <BootstrapperUrlHistory /> | 8 | <BootstrapperUrlHistory /> |
| 9 | <ErrorReportUrlHistory /> | 9 | <ErrorReportUrlHistory /> |
| 10 | <FallbackCulture>en-US</FallbackCulture> | 10 | <FallbackCulture>en-US</FallbackCulture> |
| 11 | <VerifyUploadedFiles>false</VerifyUploadedFiles> | 11 | <VerifyUploadedFiles>false</VerifyUploadedFiles> |
| 12 | <ProjectView>ShowAllFiles</ProjectView> | 12 | <ProjectView>ProjectFiles</ProjectView> |
| 13 | </PropertyGroup> | 13 | </PropertyGroup> |
| 14 | </Project> | 14 | </Project> |
sources/RoboforkApp/RoboforkMenuView.xaml
| 1 | <Window x:Class="RoboforkApp.RoboforkMenu" | 1 | <Window x:Class="RoboforkApp.RoboforkMenu" |
| 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | xmlns:s="clr-namespace:RoboforkApp" | 4 | xmlns:s="clr-namespace:RoboforkApp" |
| 5 | Title="Robofork App" | 5 | Title="Robofork App" |
| 6 | ResizeMode="NoResize" | 6 | ResizeMode="NoResize" |
| 7 | WindowStartupLocation="CenterScreen" | 7 | WindowStartupLocation="CenterScreen" |
| 8 | Height="1000" Width="1300"> | 8 | Height="1000" Width="1300"> |
| 9 | <Grid ShowGridLines="False" Margin="20,20,20,20"> | 9 | <Grid ShowGridLines="False" Margin="20,20,20,20"> |
| 10 | 10 | ||
| 11 | <Grid.RowDefinitions> | 11 | <Grid.RowDefinitions> |
| 12 | <RowDefinition Height="0.8*"/> | 12 | <RowDefinition Height="0.8*"/> |
| 13 | <RowDefinition Height="10*"/> | 13 | <RowDefinition Height="10*"/> |
| 14 | </Grid.RowDefinitions> | 14 | </Grid.RowDefinitions> |
| 15 | <Border Grid.Row="0" BorderThickness="1" BorderBrush="Gray" Margin="0,0,0,5"> | 15 | <Border Grid.Row="0" BorderThickness="1" BorderBrush="Gray" Margin="0,0,0,5"> |
| 16 | <Grid ShowGridLines="False"> | 16 | <Grid ShowGridLines="False"> |
| 17 | <Grid.RowDefinitions> | 17 | <Grid.RowDefinitions> |
| 18 | <RowDefinition Height="*"/> | 18 | <RowDefinition Height="*"/> |
| 19 | <RowDefinition Height="*"/> | 19 | <RowDefinition Height="*"/> |
| 20 | </Grid.RowDefinitions> | 20 | </Grid.RowDefinitions> |
| 21 | <Label Grid.Row="0" Content="Autonomous Planning Tool" Margin="10,0,0,0" | 21 | <Label Grid.Row="0" Content="Autonomous Planning Tool" Margin="10,0,0,0" |
| 22 | FontSize="16"/> | 22 | FontSize="16"/> |
| 23 | </Grid> | 23 | </Grid> |
| 24 | </Border> | 24 | </Border> |
| 25 | 25 | ||
| 26 | <Grid ShowGridLines="False" Grid.Row="1"> | 26 | <Grid ShowGridLines="False" Grid.Row="1"> |
| 27 | 27 | ||
| 28 | <Grid.ColumnDefinitions> | 28 | <Grid.ColumnDefinitions> |
| 29 | <ColumnDefinition Width="1.2*"/> | 29 | <ColumnDefinition Width="1.2*"/> |
| 30 | <ColumnDefinition Width="20"/> | 30 | <ColumnDefinition Width="20"/> |
| 31 | <ColumnDefinition Width="3*"/> | 31 | <ColumnDefinition Width="3*"/> |
| 32 | </Grid.ColumnDefinitions> | 32 | </Grid.ColumnDefinitions> |
| 33 | 33 | ||
| 34 | <Grid ShowGridLines="False" Grid.Column="0"> | 34 | <Grid ShowGridLines="False" Grid.Column="0"> |
| 35 | <Grid.RowDefinitions> | 35 | <Grid.RowDefinitions> |
| 36 | <RowDefinition Height="3*"/> | 36 | <RowDefinition Height="3*"/> |
| 37 | <RowDefinition Height="1*"/> | 37 | <RowDefinition Height="1*"/> |
| 38 | </Grid.RowDefinitions> | 38 | </Grid.RowDefinitions> |
| 39 | <Border Grid.Row="0" BorderThickness="1" BorderBrush="White" Margin="0,0,0,5"> | 39 | <Border Grid.Row="0" BorderThickness="1" BorderBrush="White" Margin="0,0,0,5"> |
| 40 | <TreeView Name="ProjectTreeView"> | 40 | <TreeView Name="ProjectTreeView"> |
| 41 | <TreeViewItem Name="ProjectAAA" IsExpanded="True" Header="Project [AAA工場]" FontSize="17" > | 41 | <TreeViewItem Name="ProjectAAA" IsExpanded="True" Header="Project [AAA工場]" FontSize="17" > |
| 42 | <TreeViewItem Name="Map" IsExpanded="True" Header="MAP" FontSize="17"> | 42 | <TreeViewItem Name="Map" IsExpanded="True" Header="MAP" FontSize="17"> |
| 43 | <TreeViewItem Header="Setup Restriction" FontSize="17" Name="SetupRestriction" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetupRestriction"> | 43 | <TreeViewItem Header="Setup Restriction" FontSize="17" Name="SetupRestriction" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetupRestriction"> |
| 44 | <!--<TreeViewItem Header="Set Start" FontSize="17" Name="btnSetStart" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetStart"></TreeViewItem> | 44 | <!--<TreeViewItem Header="Set Start" FontSize="17" Name="btnSetStart" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetStart"></TreeViewItem> |
| 45 | <TreeViewItem Header="Set Goal" FontSize="17" Name="btnSetGoal" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetGoal"></TreeViewItem> | 45 | <TreeViewItem Header="Set Goal" FontSize="17" Name="btnSetGoal" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetGoal"></TreeViewItem> |
| 46 | <TreeViewItem Header="Set Route" FontSize="17" Name="btnSetRoute" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetupRoute"></TreeViewItem> | 46 | <TreeViewItem Header="Set Route" FontSize="17" Name="btnSetRoute" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="SetupRoute"></TreeViewItem> |
| 47 | <TreeViewItem Header="Make Root" FontSize="17" Name="btnMakeRoot" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="MakeRoot"></TreeViewItem> | 47 | <TreeViewItem Header="Make Root" FontSize="17" Name="btnMakeRoot" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="MakeRoot"></TreeViewItem> |
| 48 | <TreeViewItem Header="Delete Route" FontSize="17" Name="btnDeleteRoute" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="DeleteRoute"></TreeViewItem>--> | 48 | <TreeViewItem Header="Delete Route" FontSize="17" Name="btnDeleteRoute" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="DeleteRoute"></TreeViewItem>--> |
| 49 | </TreeViewItem> | 49 | </TreeViewItem> |
| 50 | <TreeViewItem IsExpanded="True" Header="Node" FontSize="17" Name="NodeTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="NodeTree"> | 50 | <TreeViewItem IsExpanded="True" Header="Node" FontSize="17" Name="NodeTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="NodeTree"> |
| 51 | </TreeViewItem> | 51 | </TreeViewItem> |
| 52 | <TreeViewItem Header="--------------------" FontSize="17"> | 52 | <TreeViewItem Header="--------------------" FontSize="17"> |
| 53 | </TreeViewItem> | 53 | </TreeViewItem> |
| 54 | </TreeViewItem> | 54 | </TreeViewItem> |
| 55 | 55 | ||
| 56 | <TreeViewItem Name="LoadDB" Header="Load DB" FontSize="17"> | ||
| 57 | <TreeViewItem Name="FORK_FK15" Header="FORK_FK15" FontSize="17" Selected="btnMenu_Selected" Tag="InfoFork" ></TreeViewItem> | ||
| 58 | <TreeViewItem Name="NODE_FK15" Header="NODE_FK15" FontSize="17" Selected="btnMenu_Selected" Tag="InfoNode"></TreeViewItem> | ||
| 59 | </TreeViewItem> | ||
| 60 | |||
| 56 | <TreeViewItem Name="Vehicle" Header="Vehicle" FontSize="17"> | 61 | <TreeViewItem Name="Vehicle" Header="Vehicle" FontSize="17"> |
| 57 | <TreeViewItem Name="FK_15" Header="FK15_#1" FontSize="17" Selected="btnVehicleItem_Selected" Tag="VehicleItem" ></TreeViewItem> | 62 | <TreeViewItem Name="FK_15" Header="FK15_#1" FontSize="17" Selected="btnVehicleItem_Selected" Tag="VehicleItem" ></TreeViewItem> |
| 58 | <TreeViewItem Name="VehicleAdd" Header="[+]" FontSize="17" Selected="btnVehicleItem_Selected" Tag="VehicleAddTree"></TreeViewItem> | 63 | <TreeViewItem Name="VehicleAdd" Header="[+]" FontSize="17" Selected="btnVehicleItem_Selected" Tag="VehicleAddTree"></TreeViewItem> |
| 59 | <TreeViewItem Name="UnderLine" Header="--------------------"></TreeViewItem> | 64 | <TreeViewItem Name="UnderLine" Header="--------------------"></TreeViewItem> |
| 60 | </TreeViewItem> | 65 | </TreeViewItem> |
| 61 | 66 | ||
| 62 | <TreeViewItem Header="Work" FontSize="17"> | 67 | <TreeViewItem Header="Work" FontSize="17"> |
| 63 | <TreeViewItem Header="Task patterm [FK15_#1]" FontSize="17" Name="TaskpattermTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="TaskpattermTree"> | 68 | <TreeViewItem Header="Task patterm [FK15_#1]" FontSize="17" Name="TaskpattermTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="TaskpattermTree"> |
| 64 | </TreeViewItem> | 69 | </TreeViewItem> |
| 65 | <TreeViewItem Header="[+]" | 70 | <TreeViewItem Header="[+]" |
| 66 | FontSize="17" | 71 | FontSize="17" |
| 67 | Name="WorkAddTree" | 72 | Name="WorkAddTree" |
| 68 | Selected="GetWorkAddTree" | 73 | Selected="GetWorkAddTree" |
| 69 | Unselected="SetWorkAddTree"> | 74 | Unselected="SetWorkAddTree"> |
| 70 | </TreeViewItem> | 75 | </TreeViewItem> |
| 71 | <TreeViewItem Header="--------------------" | 76 | <TreeViewItem Header="--------------------" |
| 72 | FontSize="17"> | 77 | FontSize="17"> |
| 73 | </TreeViewItem> | 78 | </TreeViewItem> |
| 74 | </TreeViewItem> | 79 | </TreeViewItem> |
| 75 | 80 | ||
| 76 | <TreeViewItem Header="Setting" | 81 | <TreeViewItem Header="Setting" |
| 77 | FontSize="17"> | 82 | FontSize="17"> |
| 78 | <TreeViewItem Header="Connect [Wi-Fi]" | 83 | <TreeViewItem Header="Connect [Wi-Fi]" |
| 79 | FontSize="17" | 84 | FontSize="17" |
| 80 | Name="ConnectTree" | 85 | Name="ConnectTree" |
| 81 | Selected="GetConnectTree" | 86 | Selected="GetConnectTree" |
| 82 | Unselected="SetConnectTree"> | 87 | Unselected="SetConnectTree"> |
| 83 | </TreeViewItem> | 88 | </TreeViewItem> |
| 84 | <TreeViewItem Header="Parameter" | 89 | <TreeViewItem Header="Parameter" |
| 85 | FontSize="17" | 90 | FontSize="17" |
| 86 | Name="ParameterTree" | 91 | Name="ParameterTree" |
| 87 | Selected="GetParameterTree" | 92 | Selected="GetParameterTree" |
| 88 | Unselected="SetParameterTree"> | 93 | Unselected="SetParameterTree"> |
| 89 | </TreeViewItem> | 94 | </TreeViewItem> |
| 90 | <TreeViewItem Header="--------------------" | 95 | <TreeViewItem Header="--------------------" |
| 91 | FontSize="17"> | 96 | FontSize="17"> |
| 92 | </TreeViewItem> | 97 | </TreeViewItem> |
| 93 | </TreeViewItem> | 98 | </TreeViewItem> |
| 94 | <!--<TreeViewItem Header="Schedule" FontSize="17" Name="ScheduleTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="ScheduleRoute"></TreeViewItem>--> | 99 | <!--<TreeViewItem Header="Schedule" FontSize="17" Name="ScheduleTree" Selected="btnMenu_Selected" Unselected="btnMenu_UnselectedSet" Tag="ScheduleRoute"></TreeViewItem>--> |
| 95 | <TreeViewItem Header="Logging" | 100 | <TreeViewItem Header="Logging" |
| 96 | FontSize="17" | 101 | FontSize="17" |
| 97 | Name="LoggingTree" | 102 | Name="LoggingTree" |
| 98 | Selected="GetLoggingTree" | 103 | Selected="GetLoggingTree" |
| 99 | Unselected="SetLoggingTree"> | 104 | Unselected="SetLoggingTree"> |
| 100 | </TreeViewItem> | 105 | </TreeViewItem> |
| 101 | <TreeViewItem Header=" --------------------"> | 106 | <TreeViewItem Header=" --------------------"> |
| 102 | </TreeViewItem> | 107 | </TreeViewItem> |
| 103 | </TreeViewItem> | 108 | </TreeViewItem> |
| 104 | <TreeViewItem Header="Alert" | 109 | <TreeViewItem Header="Alert" |
| 105 | FontSize="17" | 110 | FontSize="17" |
| 106 | Name="AlertTree" | 111 | Name="AlertTree" |
| 107 | Selected="GetAlertTree" | 112 | Selected="GetAlertTree" |
| 108 | Unselected="SetAlertTree"> | 113 | Unselected="SetAlertTree"> |
| 109 | </TreeViewItem> | 114 | </TreeViewItem> |
| 110 | <TreeViewItem Header="Help" | 115 | <TreeViewItem Header="Help" |
| 111 | FontSize="17" | 116 | FontSize="17" |
| 112 | Name="HelpTree" | 117 | Name="HelpTree" |
| 113 | Selected="GetHelpTree" | 118 | Selected="GetHelpTree" |
| 114 | Unselected="SetHelpTree"> | 119 | Unselected="SetHelpTree"> |
| 115 | </TreeViewItem> | 120 | </TreeViewItem> |
| 116 | <TreeViewItem Header="[+New Project]" | 121 | <TreeViewItem Header="[+New Project]" |
| 117 | FontSize="17" | 122 | FontSize="17" |
| 118 | Name="NewProjectTree" | 123 | Name="NewProjectTree" |
| 119 | Selected="GetNewProjectTree" | 124 | Selected="GetNewProjectTree" |
| 120 | Unselected="SetNewProjectTree"> | 125 | Unselected="SetNewProjectTree"> |
| 121 | </TreeViewItem> | 126 | </TreeViewItem> |
| 122 | </TreeView> | 127 | </TreeView> |
| 123 | </Border> | 128 | </Border> |
| 124 | <Border Grid.Row="1" BorderThickness="1" BorderBrush="Gray" Margin="0,5,0,0"> | 129 | <Border Grid.Row="1" BorderThickness="1" BorderBrush="Gray" Margin="0,5,0,0"> |
| 125 | 130 | ||
| 126 | <Grid ShowGridLines="False"> | 131 | <Grid ShowGridLines="False"> |
| 127 | <Grid.RowDefinitions> | 132 | <Grid.RowDefinitions> |
| 128 | <RowDefinition Height="1*"/> | 133 | <RowDefinition Height="1*"/> |
| 129 | <RowDefinition Height="5*"/> | 134 | <RowDefinition Height="5*"/> |
| 130 | </Grid.RowDefinitions> | 135 | </Grid.RowDefinitions> |
| 131 | <Label Grid.Row="0" Content="Viewer" Margin="10,0,0,0" | 136 | <Label Grid.Row="0" Content="Viewer" Margin="10,0,0,0" |
| 132 | FontSize="17"/> | 137 | FontSize="17"/> |
| 133 | </Grid> | 138 | </Grid> |
| 134 | </Border> | 139 | </Border> |
| 135 | </Grid> | 140 | </Grid> |
| 136 | <TabControl x:Name="MainTab" | 141 | <TabControl x:Name="MainTab" |
| 137 | Margin="0,0,0,0" | 142 | Margin="0,0,0,0" |
| 138 | Grid.Column="2" > | 143 | Grid.Column="2" > |
| 139 | <TabItem x:Name="TabMap" > | 144 | <TabItem x:Name="TabMap" > |
| 140 | <TabItem.Header> | 145 | <TabItem.Header> |
| 141 | <StackPanel Orientation="Horizontal"> | 146 | <StackPanel Orientation="Horizontal"> |
| 142 | <TextBlock Text="MAP " VerticalAlignment="Center" FontSize="17"></TextBlock> | 147 | <TextBlock Text="MAP " VerticalAlignment="Center" FontSize="17"></TextBlock> |
| 143 | </StackPanel> | 148 | </StackPanel> |
| 144 | </TabItem.Header> | 149 | </TabItem.Header> |
| 145 | <Grid ShowGridLines="False"> | 150 | <Grid ShowGridLines="False"> |
| 146 | <Grid.RowDefinitions> | 151 | <Grid.RowDefinitions> |
| 147 | <RowDefinition Height="5*"/> | 152 | <RowDefinition Height="5*"/> |
| 148 | <RowDefinition Height="1*"/> | 153 | <RowDefinition Height="1*"/> |
| 149 | <RowDefinition Height="1*"/> | 154 | <RowDefinition Height="1*"/> |
| 150 | </Grid.RowDefinitions> | 155 | </Grid.RowDefinitions> |
| 151 | 156 | ||
| 152 | <Grid ShowGridLines="False" Grid.Row="0" Name="GridMap"> | 157 | <Grid ShowGridLines="False" Grid.Row="0" Name="GridMap"> |
| 153 | 158 | ||
| 154 | <Grid > | 159 | <Grid > |
| 155 | <Grid.ColumnDefinitions> | 160 | <Grid.ColumnDefinitions> |
| 156 | <ColumnDefinition Width="{Binding ActualHeight, ElementName=GridMap}"/> | 161 | <ColumnDefinition Width="{Binding ActualHeight, ElementName=GridMap}"/> |
| 157 | <ColumnDefinition Width="*"/> | 162 | <ColumnDefinition Width="*"/> |
| 158 | </Grid.ColumnDefinitions> | 163 | </Grid.ColumnDefinitions> |
| 159 | <Border Grid.Column="0" BorderThickness="1" BorderBrush="Red" Margin="5,5,5,5"> | 164 | <Border Grid.Column="0" BorderThickness="1" BorderBrush="Red" Margin="5,5,5,5"> |
| 160 | 165 | ||
| 161 | <Grid> | 166 | <Grid> |
| 162 | <!--<Image x:Name="Image_Map" Source="E:\02_Project\Du an Anh Dai\Robofork2\sources\RoboforkApp\Images/map.png" Stretch="Fill" />--> | 167 | <!--<Image x:Name="Image_Map" Source="E:\02_Project\Du an Anh Dai\Robofork2\sources\RoboforkApp\Images/map.png" Stretch="Fill" />--> |
| 163 | 168 | ||
| 164 | <s:DesignerCanvas x:Name="MyDesignerCanvas" | 169 | <s:DesignerCanvas x:Name="MyDesignerCanvas" |
| 165 | AllowDrop="True" | 170 | AllowDrop="True" |
| 166 | Background="White" HorizontalAlignment="Stretch"> | 171 | Background="White" HorizontalAlignment="Stretch"> |
| 167 | <Canvas.LayoutTransform> | 172 | <Canvas.LayoutTransform> |
| 168 | <!--Adjust ScaleX and ScaleY in lock-step to zoom--> | 173 | <!--Adjust ScaleX and ScaleY in lock-step to zoom--> |
| 169 | <ScaleTransform ScaleX=".57" ScaleY=".57" CenterX=".57" CenterY=".57" /> | 174 | <ScaleTransform ScaleX=".57" ScaleY=".57" CenterX=".57" CenterY=".57" /> |
| 170 | </Canvas.LayoutTransform> | 175 | </Canvas.LayoutTransform> |
| 171 | <Grid Name="MCGrid" ShowGridLines="True" | 176 | <Grid Name="MCGrid" ShowGridLines="True" |
| 172 | Width="{Binding ActualWidth, ElementName=MyDesignerCanvas}" | 177 | Width="{Binding ActualWidth, ElementName=MyDesignerCanvas}" |
| 173 | Height="{Binding ActualHeight, ElementName=MyDesignerCanvas}"> | 178 | Height="{Binding ActualHeight, ElementName=MyDesignerCanvas}"> |
| 174 | 179 | ||
| 175 | <Grid.Background> | 180 | <Grid.Background> |
| 176 | <ImageBrush ImageSource="Images/map.png"/> | 181 | <ImageBrush ImageSource="Images/map.png"/> |
| 177 | </Grid.Background> | 182 | </Grid.Background> |
| 178 | 183 | ||
| 179 | <!--<Grid.RowDefinitions> | 184 | <!--<Grid.RowDefinitions> |
| 180 | <RowDefinition Height="1*"/> | 185 | <RowDefinition Height="1*"/> |
| 181 | <RowDefinition Height="1*"/> | 186 | <RowDefinition Height="1*"/> |
| 182 | <RowDefinition Height="1*"/> | 187 | <RowDefinition Height="1*"/> |
| 183 | <RowDefinition Height="1*"/> | 188 | <RowDefinition Height="1*"/> |
| 184 | <RowDefinition Height="1*"/> | 189 | <RowDefinition Height="1*"/> |
| 185 | <RowDefinition Height="1*"/> | 190 | <RowDefinition Height="1*"/> |
| 186 | <RowDefinition Height="1*"/> | 191 | <RowDefinition Height="1*"/> |
| 187 | <RowDefinition Height="1*"/> | 192 | <RowDefinition Height="1*"/> |
| 188 | <RowDefinition Height="1*"/> | 193 | <RowDefinition Height="1*"/> |
| 189 | <RowDefinition Height="1*"/> | 194 | <RowDefinition Height="1*"/> |
| 190 | </Grid.RowDefinitions> | 195 | </Grid.RowDefinitions> |
| 191 | <Grid.ColumnDefinitions> | 196 | <Grid.ColumnDefinitions> |
| 192 | <ColumnDefinition Width="*"/> | 197 | <ColumnDefinition Width="*"/> |
| 193 | <ColumnDefinition Width="*"/> | 198 | <ColumnDefinition Width="*"/> |
| 194 | <ColumnDefinition Width="*"/> | 199 | <ColumnDefinition Width="*"/> |
| 195 | <ColumnDefinition Width="*"/> | 200 | <ColumnDefinition Width="*"/> |
| 196 | <ColumnDefinition Width="*"/> | 201 | <ColumnDefinition Width="*"/> |
| 197 | <ColumnDefinition Width="*"/> | 202 | <ColumnDefinition Width="*"/> |
| 198 | <ColumnDefinition Width="*"/> | 203 | <ColumnDefinition Width="*"/> |
| 199 | <ColumnDefinition Width="*"/> | 204 | <ColumnDefinition Width="*"/> |
| 200 | <ColumnDefinition Width="*"/> | 205 | <ColumnDefinition Width="*"/> |
| 201 | <ColumnDefinition Width="*"/> | 206 | <ColumnDefinition Width="*"/> |
| 202 | </Grid.ColumnDefinitions> | 207 | </Grid.ColumnDefinitions> |
| 203 | <TextBlock Grid.Row="0" Grid.Column="1" Foreground="SkyBlue">100</TextBlock> | 208 | <TextBlock Grid.Row="0" Grid.Column="1" Foreground="SkyBlue">100</TextBlock> |
| 204 | <TextBlock Grid.Row="0" Grid.Column="2" Foreground="SkyBlue">200</TextBlock> | 209 | <TextBlock Grid.Row="0" Grid.Column="2" Foreground="SkyBlue">200</TextBlock> |
| 205 | <TextBlock Grid.Row="0" Grid.Column="3" Foreground="SkyBlue">300</TextBlock> | 210 | <TextBlock Grid.Row="0" Grid.Column="3" Foreground="SkyBlue">300</TextBlock> |
| 206 | <TextBlock Grid.Row="0" Grid.Column="4" Foreground="SkyBlue">400</TextBlock> | 211 | <TextBlock Grid.Row="0" Grid.Column="4" Foreground="SkyBlue">400</TextBlock> |
| 207 | <TextBlock Grid.Row="0" Grid.Column="5" Foreground="SkyBlue">500</TextBlock> | 212 | <TextBlock Grid.Row="0" Grid.Column="5" Foreground="SkyBlue">500</TextBlock> |
| 208 | <TextBlock Grid.Row="0" Grid.Column="6" Foreground="SkyBlue">600</TextBlock> | 213 | <TextBlock Grid.Row="0" Grid.Column="6" Foreground="SkyBlue">600</TextBlock> |
| 209 | <TextBlock Grid.Row="0" Grid.Column="7" Foreground="SkyBlue">700</TextBlock> | 214 | <TextBlock Grid.Row="0" Grid.Column="7" Foreground="SkyBlue">700</TextBlock> |
| 210 | <TextBlock Grid.Row="0" Grid.Column="8" Foreground="SkyBlue">800</TextBlock> | 215 | <TextBlock Grid.Row="0" Grid.Column="8" Foreground="SkyBlue">800</TextBlock> |
| 211 | <TextBlock Grid.Row="0" Grid.Column="9" Foreground="SkyBlue">900</TextBlock> | 216 | <TextBlock Grid.Row="0" Grid.Column="9" Foreground="SkyBlue">900</TextBlock> |
| 212 | 217 | ||
| 213 | <TextBlock Grid.Row="1" Grid.Column="0" Foreground="SkyBlue">100</TextBlock> | 218 | <TextBlock Grid.Row="1" Grid.Column="0" Foreground="SkyBlue">100</TextBlock> |
| 214 | <TextBlock Grid.Row="2" Grid.Column="0" Foreground="SkyBlue">200</TextBlock> | 219 | <TextBlock Grid.Row="2" Grid.Column="0" Foreground="SkyBlue">200</TextBlock> |
| 215 | <TextBlock Grid.Row="3" Grid.Column="0" Foreground="SkyBlue">300</TextBlock> | 220 | <TextBlock Grid.Row="3" Grid.Column="0" Foreground="SkyBlue">300</TextBlock> |
| 216 | <TextBlock Grid.Row="4" Grid.Column="0" Foreground="SkyBlue">400</TextBlock> | 221 | <TextBlock Grid.Row="4" Grid.Column="0" Foreground="SkyBlue">400</TextBlock> |
| 217 | <TextBlock Grid.Row="5" Grid.Column="0" Foreground="SkyBlue">500</TextBlock> | 222 | <TextBlock Grid.Row="5" Grid.Column="0" Foreground="SkyBlue">500</TextBlock> |
| 218 | <TextBlock Grid.Row="6" Grid.Column="0" Foreground="SkyBlue">600</TextBlock> | 223 | <TextBlock Grid.Row="6" Grid.Column="0" Foreground="SkyBlue">600</TextBlock> |
| 219 | <TextBlock Grid.Row="7" Grid.Column="0" Foreground="SkyBlue">700</TextBlock> | 224 | <TextBlock Grid.Row="7" Grid.Column="0" Foreground="SkyBlue">700</TextBlock> |
| 220 | <TextBlock Grid.Row="8" Grid.Column="0" Foreground="SkyBlue">800</TextBlock> | 225 | <TextBlock Grid.Row="8" Grid.Column="0" Foreground="SkyBlue">800</TextBlock> |
| 221 | <TextBlock Grid.Row="9" Grid.Column="0" Foreground="SkyBlue">900</TextBlock>--> | 226 | <TextBlock Grid.Row="9" Grid.Column="0" Foreground="SkyBlue">900</TextBlock>--> |
| 222 | </Grid> | 227 | </Grid> |
| 223 | 228 | ||
| 224 | </s:DesignerCanvas> | 229 | </s:DesignerCanvas> |
| 225 | </Grid> | 230 | </Grid> |
| 226 | 231 | ||
| 227 | </Border> | 232 | </Border> |
| 228 | 233 | ||
| 229 | <Border Grid.Column="1" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> | 234 | <Border Grid.Column="1" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> |
| 230 | 235 | ||
| 231 | <DockPanel > | 236 | <DockPanel > |
| 232 | <ScrollViewer> | 237 | <ScrollViewer> |
| 233 | <Grid Name="grdRouteInfo"> | 238 | <Grid Name="grdRouteInfo"> |
| 234 | <Grid.RowDefinitions> | 239 | <Grid.RowDefinitions> |
| 235 | <RowDefinition Height="1*"/> | 240 | <RowDefinition Height="1*"/> |
| 236 | <RowDefinition Height="1*"/> | 241 | <RowDefinition Height="1*"/> |
| 237 | <RowDefinition Height="1*"/> | 242 | <RowDefinition Height="1*"/> |
| 238 | <RowDefinition Height="1*"/> | 243 | <RowDefinition Height="1*"/> |
| 239 | <RowDefinition Height="1*"/> | 244 | <RowDefinition Height="1*"/> |
| 240 | <RowDefinition Height="1*"/> | 245 | <RowDefinition Height="1*"/> |
| 241 | <RowDefinition Height="1*"/> | 246 | <RowDefinition Height="1*"/> |
| 242 | <RowDefinition Height="1*"/> | 247 | <RowDefinition Height="1*"/> |
| 243 | <RowDefinition Height="1*"/> | 248 | <RowDefinition Height="1*"/> |
| 244 | <RowDefinition Height="1*"/> | 249 | <RowDefinition Height="1*"/> |
| 245 | <RowDefinition Height="1*"/> | 250 | <RowDefinition Height="1*"/> |
| 246 | <RowDefinition Height="1*"/> | 251 | <RowDefinition Height="1*"/> |
| 247 | <RowDefinition Height="1*"/> | 252 | <RowDefinition Height="1*"/> |
| 248 | <RowDefinition Height="1*"/> | 253 | <RowDefinition Height="1*"/> |
| 249 | <RowDefinition Height="1*"/> | 254 | <RowDefinition Height="1*"/> |
| 250 | 255 | ||
| 251 | </Grid.RowDefinitions> | 256 | </Grid.RowDefinitions> |
| 252 | <Grid.ColumnDefinitions> | 257 | <Grid.ColumnDefinitions> |
| 253 | <ColumnDefinition Width="1*"/> | 258 | <ColumnDefinition Width="1*"/> |
| 254 | <ColumnDefinition Width="6*"/> | 259 | <ColumnDefinition Width="6*"/> |
| 255 | </Grid.ColumnDefinitions> | 260 | </Grid.ColumnDefinitions> |
| 256 | <Border Grid.Row="0" Grid.Column="0" BorderThickness="1" /> | 261 | <Border Grid.Row="0" Grid.Column="0" BorderThickness="1" /> |
| 257 | <Border Grid.Row="1" Grid.Column="0" BorderThickness="1" /> | 262 | <Border Grid.Row="1" Grid.Column="0" BorderThickness="1" /> |
| 258 | <Border Grid.Row="2" Grid.Column="0" BorderThickness="1" /> | 263 | <Border Grid.Row="2" Grid.Column="0" BorderThickness="1" /> |
| 259 | <Border Grid.Row="3" Grid.Column="0" BorderThickness="1" /> | 264 | <Border Grid.Row="3" Grid.Column="0" BorderThickness="1" /> |
| 260 | <Border Grid.Row="4" Grid.Column="0" BorderThickness="1" /> | 265 | <Border Grid.Row="4" Grid.Column="0" BorderThickness="1" /> |
| 261 | <Border Grid.Row="5" Grid.Column="0" BorderThickness="1" /> | 266 | <Border Grid.Row="5" Grid.Column="0" BorderThickness="1" /> |
| 262 | <Border Grid.Row="6" Grid.Column="0" BorderThickness="1" /> | 267 | <Border Grid.Row="6" Grid.Column="0" BorderThickness="1" /> |
| 263 | <Border Grid.Row="7" Grid.Column="0" BorderThickness="1" /> | 268 | <Border Grid.Row="7" Grid.Column="0" BorderThickness="1" /> |
| 264 | <Border Grid.Row="8" Grid.Column="0" BorderThickness="1" /> | 269 | <Border Grid.Row="8" Grid.Column="0" BorderThickness="1" /> |
| 265 | <Border Grid.Row="9" Grid.Column="0" BorderThickness="1" /> | 270 | <Border Grid.Row="9" Grid.Column="0" BorderThickness="1" /> |
| 266 | <Border Grid.Row="10" Grid.Column="0" BorderThickness="1" /> | 271 | <Border Grid.Row="10" Grid.Column="0" BorderThickness="1" /> |
| 267 | <Border Grid.Row="11" Grid.Column="0" BorderThickness="1" /> | 272 | <Border Grid.Row="11" Grid.Column="0" BorderThickness="1" /> |
| 268 | <Border Grid.Row="12" Grid.Column="0" BorderThickness="1" /> | 273 | <Border Grid.Row="12" Grid.Column="0" BorderThickness="1" /> |
| 269 | <Border Grid.Row="13" Grid.Column="0" BorderThickness="1" /> | 274 | <Border Grid.Row="13" Grid.Column="0" BorderThickness="1" /> |
| 270 | <Border Grid.Row="14" Grid.Column="0" BorderThickness="1" /> | 275 | <Border Grid.Row="14" Grid.Column="0" BorderThickness="1" /> |
| 271 | <Border Grid.Row="15" Grid.Column="0" BorderThickness="1" /> | 276 | <Border Grid.Row="15" Grid.Column="0" BorderThickness="1" /> |
| 272 | 277 | ||
| 273 | 278 | ||
| 274 | 279 | ||
| 275 | <Label Grid.Row="0" Grid.Column="1" Content="Monitor" FontSize="17"/> | 280 | <Label Grid.Row="0" Grid.Column="1" Content="Monitor" FontSize="17"/> |
| 276 | <Label Grid.Row="1" Grid.Column="1" Content="AOR 28249 [kg/h]" FontSize="17"/> | 281 | <Label Grid.Row="1" Grid.Column="1" Content="AOR 28249 [kg/h]" FontSize="17"/> |
| 277 | <Label Grid.Row="2" Grid.Column="1" Content="ABC 4738 [trq]" FontSize="17"/> | 282 | <Label Grid.Row="2" Grid.Column="1" Content="ABC 4738 [trq]" FontSize="17"/> |
| 278 | <Label Grid.Row="3" Grid.Column="1" Content="ATR 49593 [%]" FontSize="17"/> | 283 | <Label Grid.Row="3" Grid.Column="1" Content="ATR 49593 [%]" FontSize="17"/> |
| 279 | <Label Grid.Row="4" Grid.Column="1" Content="DEK 50403 [G]" FontSize="17"/> | 284 | <Label Grid.Row="4" Grid.Column="1" Content="DEK 50403 [G]" FontSize="17"/> |
| 280 | <Label Grid.Row="5" Grid.Column="1" Content="SKG 2739 [kg]" FontSize="17"/> | 285 | <Label Grid.Row="5" Grid.Column="1" Content="SKG 2739 [kg]" FontSize="17"/> |
| 281 | <Label Grid.Row="6" Grid.Column="1" Content="SOC 86 [%]" FontSize="17"/> | 286 | <Label Grid.Row="6" Grid.Column="1" Content="SOC 86 [%]" FontSize="17"/> |
| 282 | <Label Grid.Row="7" Grid.Column="1" Content=" :" FontSize="17"/> | 287 | <Label Grid.Row="7" Grid.Column="1" Content=" :" FontSize="17"/> |
| 283 | <Label Grid.Row="8" Grid.Column="1" Content=" :" FontSize="17"/> | 288 | <Label Grid.Row="8" Grid.Column="1" Content=" :" FontSize="17"/> |
| 284 | <Label Grid.Row="9" Grid.Column="1" Content=" :" FontSize="17"/> | 289 | <Label Grid.Row="9" Grid.Column="1" Content=" :" FontSize="17"/> |
| 285 | <Label Grid.Row="10" Grid.Column="1" Content=" :" FontSize="17"/> | 290 | <Label Grid.Row="10" Grid.Column="1" Content=" :" FontSize="17"/> |
| 286 | <Label Grid.Row="11" Grid.Column="1" Content=" :" FontSize="17"/> | 291 | <Label Grid.Row="11" Grid.Column="1" Content=" :" FontSize="17"/> |
| 287 | </Grid> | 292 | </Grid> |
| 288 | </ScrollViewer> | 293 | </ScrollViewer> |
| 289 | </DockPanel > | 294 | </DockPanel > |
| 290 | </Border> | 295 | </Border> |
| 291 | </Grid> | 296 | </Grid> |
| 292 | 297 | ||
| 293 | </Grid> | 298 | </Grid> |
| 294 | <Border Grid.Row="1" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> | 299 | <Border Grid.Row="1" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> |
| 295 | <Grid ShowGridLines="False"> | 300 | <Grid ShowGridLines="False"> |
| 296 | <Grid.ColumnDefinitions> | 301 | <Grid.ColumnDefinitions> |
| 297 | <ColumnDefinition Width="1*"/> | 302 | <ColumnDefinition Width="1*"/> |
| 298 | <ColumnDefinition Width="8*"/> | 303 | <ColumnDefinition Width="8*"/> |
| 299 | </Grid.ColumnDefinitions> | 304 | </Grid.ColumnDefinitions> |
| 300 | <Grid ShowGridLines="False" Grid.Column="0"> | 305 | <Grid ShowGridLines="False" Grid.Column="0"> |
| 301 | <Grid.RowDefinitions> | 306 | <Grid.RowDefinitions> |
| 302 | <RowDefinition Height="1*"/> | 307 | <RowDefinition Height="1*"/> |
| 303 | <RowDefinition Height="1*"/> | 308 | <RowDefinition Height="1*"/> |
| 304 | <RowDefinition Height="1*"/> | 309 | <RowDefinition Height="1*"/> |
| 305 | </Grid.RowDefinitions> | 310 | </Grid.RowDefinitions> |
| 306 | <Label Grid.Row="0" Content="Schedule" Margin="10,0,0,0" FontSize="17"/> | 311 | <Label Grid.Row="0" Content="Schedule" Margin="10,0,0,0" FontSize="17"/> |
| 307 | <Label Name="LabelSchedule" Grid.Row="1" Content="FK15_#1" Margin="10,0,0,0" FontSize="17"/> | 312 | <Label Name="LabelSchedule" Grid.Row="1" Content="FK15_#1" Margin="10,0,0,0" FontSize="17"/> |
| 308 | </Grid> | 313 | </Grid> |
| 309 | <Border Grid.Column="1" BorderThickness="1" BorderBrush="Red" Margin="5,5,5,5"> | 314 | <Border Grid.Column="1" BorderThickness="1" BorderBrush="Red" Margin="5,5,5,5"> |
| 310 | 315 | ||
| 311 | <s:ScheduleCanvas x:Name="MyScheduleCanvas" | 316 | <s:ScheduleCanvas x:Name="MyScheduleCanvas" |
| 312 | AllowDrop="True" | 317 | AllowDrop="True" |
| 313 | Background="White" HorizontalAlignment="Stretch"> | 318 | Background="White" HorizontalAlignment="Stretch"> |
| 314 | <Canvas.LayoutTransform> | 319 | <Canvas.LayoutTransform> |
| 315 | <!--Adjust ScaleX and ScaleY in lock-step to zoom--> | 320 | <!--Adjust ScaleX and ScaleY in lock-step to zoom--> |
| 316 | <ScaleTransform ScaleX=".57" ScaleY=".57" CenterX=".57" CenterY=".57" /> | 321 | <ScaleTransform ScaleX=".57" ScaleY=".57" CenterX=".57" CenterY=".57" /> |
| 317 | </Canvas.LayoutTransform> | 322 | </Canvas.LayoutTransform> |
| 318 | 323 | ||
| 319 | <Grid Name="MCGridShedule" Background="White" ShowGridLines="True" | 324 | <Grid Name="MCGridShedule" Background="White" ShowGridLines="True" |
| 320 | Width="{Binding ActualWidth, ElementName=MyScheduleCanvas}" | 325 | Width="{Binding ActualWidth, ElementName=MyScheduleCanvas}" |
| 321 | Height="{Binding ActualHeight, ElementName=MyScheduleCanvas}"> | 326 | Height="{Binding ActualHeight, ElementName=MyScheduleCanvas}"> |
| 322 | 327 | ||
| 323 | <Grid.RowDefinitions> | 328 | <Grid.RowDefinitions> |
| 324 | <RowDefinition Height="1*"/> | 329 | <RowDefinition Height="1*"/> |
| 325 | <RowDefinition Height="1*"/> | 330 | <RowDefinition Height="1*"/> |
| 326 | </Grid.RowDefinitions> | 331 | </Grid.RowDefinitions> |
| 327 | <Grid.ColumnDefinitions> | 332 | <Grid.ColumnDefinitions> |
| 328 | <ColumnDefinition Width="*"/> | 333 | <ColumnDefinition Width="*"/> |
| 329 | </Grid.ColumnDefinitions> | 334 | </Grid.ColumnDefinitions> |
| 330 | 335 | ||
| 331 | <TextBlock Grid.Row="1" Grid.Column="0" Foreground="SkyBlue">100</TextBlock> | 336 | <TextBlock Grid.Row="1" Grid.Column="0" Foreground="SkyBlue">100</TextBlock> |
| 332 | <!--<TextBlock Grid.Row="2" Grid.Column="0" Foreground="SkyBlue">200</TextBlock>--> | 337 | <!--<TextBlock Grid.Row="2" Grid.Column="0" Foreground="SkyBlue">200</TextBlock>--> |
| 333 | </Grid> | 338 | </Grid> |
| 334 | </s:ScheduleCanvas> | 339 | </s:ScheduleCanvas> |
| 335 | 340 | ||
| 336 | </Border> | 341 | </Border> |
| 337 | </Grid> | 342 | </Grid> |
| 338 | </Border> | 343 | </Border> |
| 339 | <Border Grid.Row="2" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> | 344 | <Border Grid.Row="2" BorderThickness="1" BorderBrush="Gray" Margin="5,5,5,5"> |
| 340 | <Grid ShowGridLines="False"> | 345 | <Grid ShowGridLines="False"> |
| 341 | <Grid.RowDefinitions> | 346 | <Grid.RowDefinitions> |
| 342 | <RowDefinition Height="1*"/> | 347 | <RowDefinition Height="1*"/> |
| 343 | <RowDefinition Height="2*"/> | 348 | <RowDefinition Height="2*"/> |
| 344 | </Grid.RowDefinitions> | 349 | </Grid.RowDefinitions> |
| 345 | <Label Name="WorkVehicle" Grid.Row="0" Content="Work [FK15_#1]" Margin="10,0,0,0" FontSize="17"/> | 350 | <Label Name="WorkVehicle" Grid.Row="0" Content="Work [FK15_#1]" Margin="10,0,0,0" FontSize="17"/> |
| 346 | </Grid> | 351 | </Grid> |
| 347 | </Border> | 352 | </Border> |
| 348 | </Grid> | 353 | </Grid> |
| 349 | </TabItem> | 354 | </TabItem> |
| 350 | <TabItem x:Name="TabWork" > | 355 | <TabItem x:Name="TabWork" > |
| 351 | <TabItem.Header> | 356 | <TabItem.Header> |
| 352 | <StackPanel Orientation="Horizontal"> | 357 | <StackPanel Orientation="Horizontal"> |
| 353 | <TextBlock Text=" Work " VerticalAlignment="Center" FontSize="17"></TextBlock> | 358 | <TextBlock Text=" Work " VerticalAlignment="Center" FontSize="17"></TextBlock> |
| 354 | </StackPanel> | 359 | </StackPanel> |
| 355 | </TabItem.Header> | 360 | </TabItem.Header> |
| 356 | </TabItem> | 361 | </TabItem> |
| 357 | <TabItem x:Name="TabSchedule" > | 362 | <TabItem x:Name="TabSchedule" > |
| 358 | <TabItem.Header> | 363 | <TabItem.Header> |
| 359 | <StackPanel Orientation="Horizontal"> | 364 | <StackPanel Orientation="Horizontal"> |
| 360 | <TextBlock Text=" Schedule " VerticalAlignment="Center" FontSize="17"></TextBlock> | 365 | <TextBlock Text=" Schedule " VerticalAlignment="Center" FontSize="17"></TextBlock> |
| 361 | </StackPanel> | 366 | </StackPanel> |
| 362 | </TabItem.Header> | 367 | </TabItem.Header> |
| 363 | </TabItem> | 368 | </TabItem> |
| 364 | </TabControl> | 369 | </TabControl> |
| 365 | </Grid> | 370 | </Grid> |
| 366 | </Grid> | 371 | </Grid> |
| 367 | </Window> | 372 | </Window> |
| 368 | 373 |
sources/RoboforkApp/RoboforkMenuView.xaml.cs
| 1 | using System; | 1 | using System; |
| 2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
| 3 | using System.Linq; | 3 | using System.Linq; |
| 4 | using System.Text; | 4 | using System.Text; |
| 5 | using System.Threading.Tasks; | 5 | using System.Threading.Tasks; |
| 6 | using System.Windows; | 6 | using System.Windows; |
| 7 | using System.Windows.Controls; | 7 | using System.Windows.Controls; |
| 8 | using System.Windows.Data; | 8 | using System.Windows.Data; |
| 9 | using System.Windows.Documents; | 9 | using System.Windows.Documents; |
| 10 | using System.Windows.Input; | 10 | using System.Windows.Input; |
| 11 | using System.Windows.Media; | 11 | using System.Windows.Media; |
| 12 | using System.Windows.Media.Imaging; | 12 | using System.Windows.Media.Imaging; |
| 13 | using System.Windows.Shapes; | 13 | using System.Windows.Shapes; |
| 14 | 14 | ||
| 15 | namespace RoboforkApp | 15 | namespace RoboforkApp |
| 16 | { | 16 | { |
| 17 | /// <summary> | 17 | /// <summary> |
| 18 | /// Interaction logic for RoboforkMenu.xaml | 18 | /// Interaction logic for RoboforkMenu.xaml |
| 19 | /// </summary> | 19 | /// </summary> |
| 20 | public partial class RoboforkMenu : Window | 20 | public partial class RoboforkMenu : Window |
| 21 | { | 21 | { |
| 22 | public int IndexVehicle = 15; | 22 | public int IndexVehicle = 15; |
| 23 | public RoboforkMenu() | 23 | public RoboforkMenu() |
| 24 | { | 24 | { |
| 25 | InitializeComponent(); | 25 | InitializeComponent(); |
| 26 | Load_Form(); | 26 | Load_Form(); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | private void Load_Form() | 29 | private void Load_Form() |
| 30 | { | 30 | { |
| 31 | //PassplanTree.IsEnabled = false; | 31 | //PassplanTree.IsEnabled = false; |
| 32 | //NodeTree.IsEnabled = false; | 32 | //NodeTree.IsEnabled = false; |
| 33 | 33 | ||
| 34 | MyDesignerCanvas.InitDrawRoute(); | 34 | MyDesignerCanvas.InitDrawRoute(); |
| 35 | 35 | ||
| 36 | MyDesignerCanvas.ReadFile(); | 36 | MyDesignerCanvas.ReadFile(); |
| 37 | 37 | ||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | private void btnMenu_Selected(object sender, RoutedEventArgs e) | 40 | private void btnMenu_Selected(object sender, RoutedEventArgs e) |
| 41 | { | 41 | { |
| 42 | if (((TreeViewItem)sender) == null) | 42 | if (((TreeViewItem)sender) == null) |
| 43 | { | 43 | { |
| 44 | return; | 44 | return; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | string tag = ((TreeViewItem)sender).Tag.ToString(); | 47 | string tag = ((TreeViewItem)sender).Tag.ToString(); |
| 48 | switch (tag) | 48 | switch (tag) |
| 49 | { | 49 | { |
| 50 | //2017/03/04 NAM ADD START1 | 50 | //2017/03/04 NAM ADD START1 |
| 51 | case "NodeTree": | 51 | case "NodeTree": |
| 52 | NewDoBeginSetFreeNotes(); | 52 | NewDoBeginSetFreeNotes(); |
| 53 | break; | 53 | break; |
| 54 | //2017/03/04 NAM ADD END | 54 | //2017/03/04 NAM ADD END |
| 55 | 55 | ||
| 56 | case "SetupRestriction": | 56 | case "SetupRestriction": |
| 57 | DoBeginSetupRestriction(); | 57 | DoBeginSetupRestriction(); |
| 58 | break; | 58 | break; |
| 59 | 59 | ||
| 60 | case "SetStart": | 60 | case "SetStart": |
| 61 | DoBeginSetStart(); | 61 | DoBeginSetStart(); |
| 62 | break; | 62 | break; |
| 63 | 63 | ||
| 64 | case "SetGoal": | 64 | case "SetGoal": |
| 65 | DoBeginSetGoal(); | 65 | DoBeginSetGoal(); |
| 66 | break; | 66 | break; |
| 67 | 67 | ||
| 68 | case "SetupRoute": | 68 | case "SetupRoute": |
| 69 | DoBeginSetupRoute(); | 69 | DoBeginSetupRoute(); |
| 70 | break; | 70 | break; |
| 71 | 71 | ||
| 72 | case "MakeRoot": | 72 | case "MakeRoot": |
| 73 | DoBeginMakeRoot(); | 73 | DoBeginMakeRoot(); |
| 74 | break; | 74 | break; |
| 75 | 75 | ||
| 76 | case "DeleteRoute": | 76 | case "DeleteRoute": |
| 77 | DoBeginDeleteRoute(); | 77 | DoBeginDeleteRoute(); |
| 78 | break; | 78 | break; |
| 79 | 79 | ||
| 80 | case "SetAutoNodes": | 80 | case "SetAutoNodes": |
| 81 | DoBeginSetAutoNotes(); | 81 | DoBeginSetAutoNotes(); |
| 82 | break; | 82 | break; |
| 83 | 83 | ||
| 84 | case "SetFreeNodes": | 84 | case "SetFreeNodes": |
| 85 | DoBeginSetFreeNotes(); | 85 | DoBeginSetFreeNotes(); |
| 86 | break; | 86 | break; |
| 87 | 87 | ||
| 88 | case "ScheduleRoute": | 88 | case "ScheduleRoute": |
| 89 | 89 | ||
| 90 | DoBeginSetSchedule(); | 90 | DoBeginSetSchedule(); |
| 91 | break; | 91 | break; |
| 92 | case "TaskpattermTree": | 92 | case "TaskpattermTree": |
| 93 | DoBeginTask(); | 93 | DoBeginTask(); |
| 94 | break; | 94 | break; |
| 95 | case "InfoFork": | ||
| 96 | LoadInfoFork(); | ||
| 97 | break; | ||
| 98 | case "InfoNode": | ||
| 99 | LoadInfoNode(); | ||
| 100 | break; | ||
| 101 | |||
| 95 | default: | 102 | default: |
| 96 | break; | 103 | break; |
| 97 | } | 104 | } |
| 98 | } | 105 | } |
| 99 | 106 | ||
| 100 | private void DoBeginSetSchedule() | 107 | private void DoBeginSetSchedule() |
| 101 | { | 108 | { |
| 102 | 109 | ||
| 103 | MyDesignerCanvas.SetScheduleRoute(); | 110 | MyDesignerCanvas.SetScheduleRoute(); |
| 104 | } | 111 | } |
| 105 | 112 | ||
| 106 | private void NewDoBeginSetFreeNotes() | 113 | private void NewDoBeginSetFreeNotes() |
| 107 | { | 114 | { |
| 108 | MyDesignerCanvas.Init(); | 115 | MyDesignerCanvas.Init(); |
| 109 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.NewDrawSetFreeNode; | 116 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.NewDrawSetFreeNode; |
| 110 | MyDesignerCanvas.scheduleCanvas = MyScheduleCanvas; | 117 | MyDesignerCanvas.scheduleCanvas = MyScheduleCanvas; |
| 118 | } | ||
| 111 | 119 | ||
| 120 | private void LoadInfoFork() | ||
| 121 | { | ||
| 122 | MyDesignerCanvas.GetInfoFork(); | ||
| 123 | } | ||
| 124 | |||
| 125 | private void LoadInfoNode() | ||
| 126 | { | ||
| 127 | MyDesignerCanvas.GetInfoNode(); | ||
| 112 | } | 128 | } |
| 113 | 129 | ||
| 114 | private void btnMenu_UnselectedSet(object sender, RoutedEventArgs e) | 130 | private void btnMenu_UnselectedSet(object sender, RoutedEventArgs e) |
| 115 | { | 131 | { |
| 116 | if (((TreeViewItem)sender) == null) | 132 | if (((TreeViewItem)sender) == null) |
| 117 | { | 133 | { |
| 118 | return; | 134 | return; |
| 119 | } | 135 | } |
| 120 | 136 | ||
| 121 | string tag = ((TreeViewItem)sender).Tag.ToString(); | 137 | string tag = ((TreeViewItem)sender).Tag.ToString(); |
| 122 | switch (tag) | 138 | switch (tag) |
| 123 | { | 139 | { |
| 124 | case "SetupRestriction": | 140 | case "SetupRestriction": |
| 125 | //DoBeginSetStart(); | 141 | //DoBeginSetStart(); |
| 126 | break; | 142 | break; |
| 127 | 143 | ||
| 128 | case "SetStart": | 144 | case "SetStart": |
| 129 | //DoBeginSetStart(); | 145 | //DoBeginSetStart(); |
| 130 | break; | 146 | break; |
| 131 | 147 | ||
| 132 | case "SetGoal": | 148 | case "SetGoal": |
| 133 | //DoBeginSetGoal(); | 149 | //DoBeginSetGoal(); |
| 134 | break; | 150 | break; |
| 135 | 151 | ||
| 136 | case "DeleteRoute": | 152 | case "DeleteRoute": |
| 137 | //DoBeginDeleteRoute(); | 153 | //DoBeginDeleteRoute(); |
| 138 | break; | 154 | break; |
| 139 | 155 | ||
| 140 | case "SetupRoute": | 156 | case "SetupRoute": |
| 141 | //DoBeginSetupRoute(); | 157 | //DoBeginSetupRoute(); |
| 142 | break; | 158 | break; |
| 143 | 159 | ||
| 144 | case "MakeRoot": | 160 | case "MakeRoot": |
| 145 | //DoBeginMakeRoot(); | 161 | //DoBeginMakeRoot(); |
| 146 | break; | 162 | break; |
| 147 | 163 | ||
| 148 | default: | 164 | default: |
| 149 | break; | 165 | break; |
| 150 | } | 166 | } |
| 151 | } | 167 | } |
| 152 | 168 | ||
| 153 | private void DoBeginTask() | 169 | private void DoBeginTask() |
| 154 | { | 170 | { |
| 155 | MyScheduleCanvas.CreateSimulation(MyDesignerCanvas.ucScheduleNode_Lst, MyDesignerCanvas.VehicleModel, MyDesignerCanvas.VehicleIndex); | 171 | MyScheduleCanvas.CreateSimulation(MyDesignerCanvas.ucScheduleNode_Lst, MyDesignerCanvas.VehicleModel, MyDesignerCanvas.VehicleIndex); |
| 156 | } | 172 | } |
| 157 | 173 | ||
| 158 | private void DoBeginSetAutoNotes() | 174 | private void DoBeginSetAutoNotes() |
| 159 | { | 175 | { |
| 160 | MyDesignerCanvas.SetAutoNodes(); | 176 | MyDesignerCanvas.SetAutoNodes(); |
| 161 | } | 177 | } |
| 162 | 178 | ||
| 163 | private void DoBeginSetFreeNotes() | 179 | private void DoBeginSetFreeNotes() |
| 164 | { | 180 | { |
| 165 | MyDesignerCanvas.Init(); | 181 | MyDesignerCanvas.Init(); |
| 166 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawSetFreeNode; | 182 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawSetFreeNode; |
| 167 | } | 183 | } |
| 168 | 184 | ||
| 169 | private void DoBeginSetupRestriction() | 185 | private void DoBeginSetupRestriction() |
| 170 | { | 186 | { |
| 171 | MyDesignerCanvas.Init(); | 187 | MyDesignerCanvas.Init(); |
| 172 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawObstract; | 188 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawObstract; |
| 173 | MyDesignerCanvas.mouseState = DesignerCanvas.MouseState.None; | 189 | MyDesignerCanvas.mouseState = DesignerCanvas.MouseState.None; |
| 174 | } | 190 | } |
| 175 | 191 | ||
| 176 | private void DoBeginSetStart() | 192 | private void DoBeginSetStart() |
| 177 | { | 193 | { |
| 178 | MyDesignerCanvas.CreateStartPoint(); | 194 | MyDesignerCanvas.CreateStartPoint(); |
| 179 | } | 195 | } |
| 180 | 196 | ||
| 181 | private void DoBeginSetGoal() | 197 | private void DoBeginSetGoal() |
| 182 | { | 198 | { |
| 183 | MyDesignerCanvas.CreateGoalPoint(); | 199 | MyDesignerCanvas.CreateGoalPoint(); |
| 184 | } | 200 | } |
| 185 | 201 | ||
| 186 | private void DoBeginSetupRoute() | 202 | private void DoBeginSetupRoute() |
| 187 | { | 203 | { |
| 188 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawRoute; | 204 | MyDesignerCanvas.Operation = DesignerCanvas.OperationState.DrawRoute; |
| 189 | } | 205 | } |
| 190 | 206 | ||
| 191 | private void DoBeginMakeRoot() | 207 | private void DoBeginMakeRoot() |
| 192 | { | 208 | { |
| 193 | MyDesignerCanvas.Children.Remove(MyDesignerCanvas.pRootLine); | 209 | MyDesignerCanvas.Children.Remove(MyDesignerCanvas.pRootLine); |
| 194 | MyDesignerCanvas.MakeRoot(); | 210 | MyDesignerCanvas.MakeRoot(); |
| 195 | } | 211 | } |
| 196 | 212 | ||
| 197 | private void DoBeginDeleteRoute() | 213 | private void DoBeginDeleteRoute() |
| 198 | { | 214 | { |
| 199 | MessageBoxResult result = MessageBox.Show("Do you want delete route?", "Delete route", MessageBoxButton.OKCancel); | 215 | MessageBoxResult result = MessageBox.Show("Do you want delete route?", "Delete route", MessageBoxButton.OKCancel); |
| 200 | if (result == MessageBoxResult.OK) | 216 | if (result == MessageBoxResult.OK) |
| 201 | { | 217 | { |
| 202 | MyDesignerCanvas.ClearRoute(); | 218 | MyDesignerCanvas.ClearRoute(); |
| 203 | } | 219 | } |
| 204 | } | 220 | } |
| 205 | 221 | ||
| 206 | private void GetPassplanTree(object sender, RoutedEventArgs e) | 222 | private void GetPassplanTree(object sender, RoutedEventArgs e) |
| 207 | { | 223 | { |
| 208 | MessageBoxResult result = MessageBox.Show("Selected PassplanTree", "", MessageBoxButton.OKCancel); | 224 | MessageBoxResult result = MessageBox.Show("Selected PassplanTree", "", MessageBoxButton.OKCancel); |
| 209 | } | 225 | } |
| 210 | 226 | ||
| 211 | private void SetPassplanTree(object sender, RoutedEventArgs e) | 227 | private void SetPassplanTree(object sender, RoutedEventArgs e) |
| 212 | { | 228 | { |
| 213 | 229 | ||
| 214 | } | 230 | } |
| 215 | 231 | ||
| 216 | private void GetNodeTree(object sender, RoutedEventArgs e) | 232 | private void GetNodeTree(object sender, RoutedEventArgs e) |
| 217 | { | 233 | { |
| 218 | MessageBoxResult result = MessageBox.Show("Selected NodeTree", "", MessageBoxButton.OKCancel); | 234 | MessageBoxResult result = MessageBox.Show("Selected NodeTree", "", MessageBoxButton.OKCancel); |
| 219 | } | 235 | } |
| 220 | 236 | ||
| 221 | private void SetNodeTree(object sender, RoutedEventArgs e) | 237 | private void SetNodeTree(object sender, RoutedEventArgs e) |
| 222 | { | 238 | { |
| 223 | 239 | ||
| 224 | } | 240 | } |
| 225 | 241 | ||
| 226 | private void GetFK15Tree(object sender, RoutedEventArgs e) | 242 | private void GetFK15Tree(object sender, RoutedEventArgs e) |
| 227 | { | 243 | { |
| 228 | MessageBoxResult result = MessageBox.Show("Selected FK15Tree", "", MessageBoxButton.OKCancel); | 244 | MessageBoxResult result = MessageBox.Show("Selected FK15Tree", "", MessageBoxButton.OKCancel); |
| 229 | } | 245 | } |
| 230 | 246 | ||
| 231 | private void SetFK15Tree(object sender, RoutedEventArgs e) | 247 | private void SetFK15Tree(object sender, RoutedEventArgs e) |
| 232 | { | 248 | { |
| 233 | 249 | ||
| 234 | } | 250 | } |
| 235 | 251 | ||
| 236 | private void GetVehicleAddTree(object sender, RoutedEventArgs e) | 252 | private void GetVehicleAddTree(object sender, RoutedEventArgs e) |
| 237 | { | 253 | { |
| 238 | MessageBoxResult result = MessageBox.Show("Selected VehicleAddTree", "", MessageBoxButton.OKCancel); | 254 | MessageBoxResult result = MessageBox.Show("Selected VehicleAddTree", "", MessageBoxButton.OKCancel); |
| 239 | } | 255 | } |
| 240 | 256 | ||
| 241 | #region Add new Vehicle Item | 257 | #region Add new Vehicle Item |
| 242 | 258 | ||
| 243 | private void btnVehicleItem_Selected(object sender, RoutedEventArgs e) | 259 | private void btnVehicleItem_Selected(object sender, RoutedEventArgs e) |
| 244 | { | 260 | { |
| 245 | if (((TreeViewItem)sender) == null) | 261 | if (((TreeViewItem)sender) == null) |
| 246 | { | 262 | { |
| 247 | return; | 263 | return; |
| 248 | } | 264 | } |
| 249 | string name = ((TreeViewItem)sender).Name.ToString(); | 265 | string name = ((TreeViewItem)sender).Name.ToString(); |
| 250 | string tag = ((TreeViewItem)sender).Tag.ToString(); | 266 | string tag = ((TreeViewItem)sender).Tag.ToString(); |
| 251 | string header = ((TreeViewItem)sender).Header.ToString(); | 267 | string header = ((TreeViewItem)sender).Header.ToString(); |
| 252 | switch (tag) | 268 | switch (tag) |
| 253 | { | 269 | { |
| 254 | case "VehicleAddTree": | 270 | case "VehicleAddTree": |
| 255 | AddNewVehicleItem(); | 271 | AddNewVehicleItem(); |
| 256 | break; | 272 | break; |
| 257 | 273 | ||
| 258 | case "VehicleItem": | 274 | case "VehicleItem": |
| 259 | GetDataVehicle(name, header); | 275 | GetDataVehicle(name, header); |
| 260 | break; | 276 | break; |
| 261 | 277 | ||
| 262 | default: | 278 | default: |
| 263 | break; | 279 | break; |
| 264 | } | 280 | } |
| 265 | } | 281 | } |
| 266 | 282 | ||
| 267 | 283 | ||
| 268 | private void AddNewVehicleItem() | 284 | private void AddNewVehicleItem() |
| 269 | { | 285 | { |
| 270 | IndexVehicle += 1; | 286 | IndexVehicle += 1; |
| 271 | 287 | ||
| 272 | Vehicle.Items.RemoveAt(Vehicle.Items.Count - 1); | 288 | Vehicle.Items.RemoveAt(Vehicle.Items.Count - 1); |
| 273 | Vehicle.Items.RemoveAt(Vehicle.Items.Count - 1); | 289 | Vehicle.Items.RemoveAt(Vehicle.Items.Count - 1); |
| 274 | 290 | ||
| 275 | TreeViewItem item = new TreeViewItem(); | 291 | TreeViewItem item = new TreeViewItem(); |
| 276 | item.Header = "FK"+ IndexVehicle.ToString()+"_#1"; | 292 | item.Header = "FK"+ IndexVehicle.ToString()+"_#1"; |
| 277 | item.Tag = "VehicleItem"; | 293 | item.Tag = "VehicleItem"; |
| 278 | item.FontSize = 17; | 294 | item.FontSize = 17; |
| 279 | item.Selected += new RoutedEventHandler(btnVehicleItem_Selected); | 295 | item.Selected += new RoutedEventHandler(btnVehicleItem_Selected); |
| 280 | //item.IsSelected = true; | 296 | //item.IsSelected = true; |
| 281 | item.IsExpanded = true; | 297 | item.IsExpanded = true; |
| 282 | item.Name = "FK_" + IndexVehicle.ToString(); | 298 | item.Name = "FK_" + IndexVehicle.ToString(); |
| 283 | Vehicle.Items.Add(item); | 299 | Vehicle.Items.Add(item); |
| 284 | 300 | ||
| 285 | TreeViewItem item2 = new TreeViewItem(); | 301 | TreeViewItem item2 = new TreeViewItem(); |
| 286 | item2.Header = "[+]"; | 302 | item2.Header = "[+]"; |
| 287 | item2.Tag = "VehicleAddTree"; | 303 | item2.Tag = "VehicleAddTree"; |
| 288 | item2.FontSize = 17; | 304 | item2.FontSize = 17; |
| 289 | item2.Selected += new RoutedEventHandler(btnVehicleItem_Selected); | 305 | item2.Selected += new RoutedEventHandler(btnVehicleItem_Selected); |
| 290 | item2.Name = "VehicleAdd"; | 306 | item2.Name = "VehicleAdd"; |
| 291 | Vehicle.Items.Add(item2); | 307 | Vehicle.Items.Add(item2); |
| 292 | 308 | ||
| 293 | TreeViewItem item3 = new TreeViewItem(); | 309 | TreeViewItem item3 = new TreeViewItem(); |
| 294 | item3.Header = "--------------------"; | 310 | item3.Header = "--------------------"; |
| 295 | item3.FontSize = 17; | 311 | item3.FontSize = 17; |
| 296 | item3.Name = "UnderLine"; | 312 | item3.Name = "UnderLine"; |
| 297 | Vehicle.Items.Add(item3); | 313 | Vehicle.Items.Add(item3); |
| 298 | 314 | ||
| 299 | } | 315 | } |
| 300 | 316 | ||
| 301 | 317 | ||
| 302 | private void GetDataVehicle(string nameItem, String header) | 318 | private void GetDataVehicle(string nameItem, String header) |
| 303 | { | 319 | { |
| 304 | MyDesignerCanvas.VehicleItem = nameItem; | 320 | MyDesignerCanvas.VehicleItem = nameItem; |
| 305 | MyDesignerCanvas.GetdataVehicle(); | 321 | MyDesignerCanvas.GetdataVehicle(); |
| 306 | LabelSchedule.Content = header; | 322 | LabelSchedule.Content = header; |
| 307 | WorkVehicle.Content = "Work [" + header + "]"; | 323 | WorkVehicle.Content = "Work [" + header + "]"; |
| 308 | TaskpattermTree.Header = "Task patterm [" + header + "]"; | 324 | TaskpattermTree.Header = "Task patterm [" + header + "]"; |
| 309 | } | 325 | } |
| 310 | 326 | ||
| 311 | #endregion | 327 | #endregion |
| 312 | 328 | ||
| 313 | 329 | ||
| 314 | 330 | ||
| 315 | 331 | ||
| 316 | private void SetVehicleAddTree(object sender, RoutedEventArgs e) | 332 | private void SetVehicleAddTree(object sender, RoutedEventArgs e) |
| 317 | { | 333 | { |
| 318 | 334 | ||
| 319 | } | 335 | } |
| 320 | 336 | ||
| 321 | private void GetTaskpattermTree(object sender, RoutedEventArgs e) | 337 | private void GetTaskpattermTree(object sender, RoutedEventArgs e) |
| 322 | { | 338 | { |
| 323 | 339 | ||
| 324 | } | 340 | } |
| 325 | 341 | ||
| 326 | private void SetTaskpattermTree(object sender, RoutedEventArgs e) | 342 | private void SetTaskpattermTree(object sender, RoutedEventArgs e) |
| 327 | { | 343 | { |
| 328 | 344 | ||
| 329 | } | 345 | } |
| 330 | 346 | ||
| 331 | private void GetWorkAddTree(object sender, RoutedEventArgs e) | 347 | private void GetWorkAddTree(object sender, RoutedEventArgs e) |
| 332 | { | 348 | { |
| 333 | 349 | ||
| 334 | } | 350 | } |
| 335 | 351 | ||
| 336 | private void SetWorkAddTree(object sender, RoutedEventArgs e) | 352 | private void SetWorkAddTree(object sender, RoutedEventArgs e) |
| 337 | { | 353 | { |
| 338 | 354 | ||
| 339 | } | 355 | } |
| 340 | 356 | ||
| 341 | private void GetConnectTree(object sender, RoutedEventArgs e) | 357 | private void GetConnectTree(object sender, RoutedEventArgs e) |
| 342 | { | 358 | { |
| 343 | 359 | ||
| 344 | } | 360 | } |
| 345 | 361 | ||
| 346 | private void SetConnectTree(object sender, RoutedEventArgs e) | 362 | private void SetConnectTree(object sender, RoutedEventArgs e) |
| 347 | { | 363 | { |
| 348 | 364 | ||
| 349 | } | 365 | } |
| 350 | 366 | ||
| 351 | private void GetParameterTree(object sender, RoutedEventArgs e) | 367 | private void GetParameterTree(object sender, RoutedEventArgs e) |
| 352 | { | 368 | { |
| 353 | 369 | ||
| 354 | } | 370 | } |
| 355 | 371 | ||
| 356 | private void SetParameterTree(object sender, RoutedEventArgs e) | 372 | private void SetParameterTree(object sender, RoutedEventArgs e) |
| 357 | { | 373 | { |
| 358 | 374 | ||
| 359 | } | 375 | } |
| 360 | 376 | ||
| 361 | private void GetScheduleTree(object sender, RoutedEventArgs e) | 377 | private void GetScheduleTree(object sender, RoutedEventArgs e) |
| 362 | { | 378 | { |
| 363 | 379 | ||
| 364 | } | 380 | } |
| 365 | 381 | ||
| 366 | private void SetScheduleTree(object sender, RoutedEventArgs e) | 382 | private void SetScheduleTree(object sender, RoutedEventArgs e) |
| 367 | { | 383 | { |
| 368 | 384 | ||
| 369 | } | 385 | } |
| 370 | 386 | ||
| 371 | private void GetLoggingTree(object sender, RoutedEventArgs e) | 387 | private void GetLoggingTree(object sender, RoutedEventArgs e) |
| 372 | { | 388 | { |
| 373 | 389 | ||
| 374 | } | 390 | } |
| 375 | 391 | ||
| 376 | private void SetLoggingTree(object sender, RoutedEventArgs e) | 392 | private void SetLoggingTree(object sender, RoutedEventArgs e) |
| 377 | { | 393 | { |
| 378 | 394 | ||
| 379 | } | 395 | } |
| 380 | 396 | ||
| 381 | private void GetAlertTree(object sender, RoutedEventArgs e) | 397 | private void GetAlertTree(object sender, RoutedEventArgs e) |
| 382 | { | 398 | { |
| 383 | 399 | ||
| 384 | } | 400 | } |
| 385 | 401 | ||
| 386 | private void SetAlertTree(object sender, RoutedEventArgs e) | 402 | private void SetAlertTree(object sender, RoutedEventArgs e) |
| 387 | { | 403 | { |
| 388 | 404 | ||
| 389 | } | 405 | } |
| 390 | 406 | ||
| 391 | private void GetHelpTree(object sender, RoutedEventArgs e) | 407 | private void GetHelpTree(object sender, RoutedEventArgs e) |
| 392 | { | 408 | { |
| 393 | 409 | ||
| 394 | } | 410 | } |
| 395 | 411 | ||
| 396 | private void SetHelpTree(object sender, RoutedEventArgs e) | 412 | private void SetHelpTree(object sender, RoutedEventArgs e) |
| 397 | { | 413 | { |
| 398 | 414 | ||
| 399 | } | 415 | } |
| 400 | 416 | ||
| 401 | private void GetNewProjectTree(object sender, RoutedEventArgs e) | 417 | private void GetNewProjectTree(object sender, RoutedEventArgs e) |
| 402 | { | 418 | { |
| 403 | 419 | ||
| 404 | } | 420 | } |
| 405 | 421 | ||
| 406 | private void SetNewProjectTree(object sender, RoutedEventArgs e) | 422 | private void SetNewProjectTree(object sender, RoutedEventArgs e) |
| 407 | { | 423 | { |
| 408 | 424 | ||
| 409 | } | 425 | } |
| 410 | 426 | ||
| 411 | 427 | ||
| 412 | } | 428 | } |
| 413 | } | 429 | } |
| 414 | 430 |
sources/RoboforkApp/bin/Release/RboforkApp.vshost.exe
No preview for this file type