예제 #1
0
        private async Task OpenFile(string filename)
        {
            if ((filename.Split('.').Last() == "frw") || (filename.Split('.').Last() == "cdw"))
            {
                if (KmpsAppl.KompasAPI == null)
                {
                    Process.Start(filename);
                }
                else
                {
                    this.kmpsAppl.OpenFile(filename);
                }
            }
            else
            {
                GCCollection _actualFrames = await ToGC.Get(filename, MonchaHub.ProjectionSetting.PointStep.MX);

                if (_actualFrames == null)
                {
                    return;
                }
                else
                {
                    AppSt.Default.stg_last_file_path = filename;
                    AppSt.Default.Save();
                }
                ContourScrollPanel.Add(false, _actualFrames, filename);
            }
        }
예제 #2
0
        private void kmpsSelectBtn_Click(object sender, RoutedEventArgs e)
        {
            if (KmpsAppl.KompasAPI != null)
            {
                GCCollection gCElements = new GCCollection();
                gCElements.AddRange(
                    ContourCalc.GetGeometry(this.kmpsAppl.Doc, MonchaHub.ProjectionSetting.PointStep.MX, false, true));

                ContourScrollPanel.Add(false, gCElements, this.kmpsAppl.Doc.D7.Name);
            }
        }
예제 #3
0
 private void kmpsAddBtn_Click(object sender, RoutedEventArgs e)
 {
     if (KmpsAppl.KompasAPI != null)
     {
         ContourScrollPanel.Add(
             false,
             new GCCollection()
         {
             new GeometryElement(ContourCalc.GetGeometry(this.kmpsAppl.Doc, MonchaHub.ProjectionSetting.PointStep.MX, true, true)),
         },
             this.kmpsAppl.Doc.D7.Name);
     }
 }
예제 #4
0
        private void UdpLaserListener_IncomingData(object sender, byte[] e)
        {
            int position = 0;

            if (e != null)
            {
                GCCollection gCElements = new GCCollection();
                FileParser   fileParser = new FileParser(e);

                string hdr = fileParser.parseString(4);
                if (hdr.Equals("2CUT") == false)
                {
                    return;
                }

                //Bytes 4-6: Reserved
                fileParser.Skip(3);

                int PathCount = fileParser.parseShort();

                for (int p = 0; p < PathCount; p++)
                {
                    PointsElement points = new PointsElement();
                    points.IsClosed = fileParser.parseByte() == 0 ? false : true;

                    int pointsCount = fileParser.parseShort();

                    for (int i = 0; i < pointsCount; i++)
                    {
                        points.Add(new GCPoint3D(fileParser.parseShort(), -fileParser.parseShort(), 0));
                    }
                    if (points.Points.Count > 0)
                    {
                        gCElements.Add(points);
                    }
                }

                ContourScrollPanel.Add(false, gCElements, "Ethernet");
            }
        }
예제 #5
0
 private async void ReloadBtn_ClickAsync(object sender, RoutedEventArgs e)
 {
     ContourScrollPanel.Refresh();
 }