Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        private void aDD(object obj)
        {
            //add the current vars to an object list
            clsWeaponCSV tb = new clsWeaponCSV();

            tb.Update(weapon_name,
                      upgrade_name,
                      hint,
                      cost,
                      weaponVO,
                      weaponVOresp,
                      ammo_cost,
                      create_vox,
                      obsolete_false,
                      in_box,
                      upgrade_in_box,
                      is_limited,
                      limit,
                      upgrade_limit,
                      obsolete2_false,
                      wallbuy_autospawn,
                      classs,
                      is_aat_exempt,
                      is_wonder_weapon,
                      force_attachments);

            AllLines.Add(tb);
            //mspreadsheet.Add(tb);
            //WeaponNames.Add(tb.weapon_name);
            WeaponNames = clsWeaponCSV.UpdateWeaponNames(AllLines);
            NewLine     = false;
            CommentOut  = true;
            duplicating = false;
        }
Exemplo n.º 2
0
        public void GenerateGCODE()
        {
            //calcMovementSideToSide();
            calcMovementUpDown();
            AllLines.Clear();
            GeneratedGCODE.Clear();

            double xMinVal = BlackLines[0].X0;
            double xMaxVal = BlackLines[0].X1;
            double yMinVal = BlackLines[0].Y0;
            double yMaxVal = BlackLines[0].Y1;

            for (int i = 0; i < BlackLines.Count - 1; i++)
            {
                AllLines.Add(new TraceLine(BlackLines[i].X0, BlackLines[i].Y0, BlackLines[i].X1, BlackLines[i].Y1, true));          //stores the current line to be drawn
                AllLines.Add(new TraceLine(BlackLines[i].X1, BlackLines[i].Y1, BlackLines[i + 1].X0, BlackLines[i + 1].Y0, false)); //moves draw head to position for next line

                //finding the minimum and maximum values for both X and Y positions. used to draw the bounding box in GUI
                if (BlackLines[i].X0 < xMinVal || BlackLines[i].X1 < xMinVal)
                {
                    xMinVal = Math.Min(BlackLines[i].X0, BlackLines[i].X1);
                }
                if (BlackLines[i].X0 > xMaxVal || BlackLines[i].X1 > xMaxVal)
                {
                    xMaxVal = Math.Max(BlackLines[i].X0, BlackLines[i].X1);
                }
                if (BlackLines[i].Y0 < yMinVal || BlackLines[i].Y1 < yMinVal)
                {
                    yMinVal = Math.Min(BlackLines[i].Y0, BlackLines[i].Y1);
                }
                if (BlackLines[i].Y0 > yMaxVal || BlackLines[i].Y1 > yMaxVal)
                {
                    yMaxVal = Math.Max(BlackLines[i].Y0, BlackLines[i].Y1);
                }
            }

            BoundingCoordinates = new TraceLine(xMinVal, yMinVal, xMaxVal, yMaxVal);        //saves X and Y positions to draw bounding box later

            GeneratedGCODE.Add(StartGCODE + "\n");
            GeneratedGCODE.Add(string.Format("G1 X{0} Y{1}\n", AllLines[0].X0, AllLines[0].Y0));    //goes from home position to start of first line to draw
            foreach (TraceLine line in AllLines)
            {
                GeneratedGCODE.Add("G1 Z" + Convert.ToInt32(!line.Draw) + "\n");
                GeneratedGCODE.Add(string.Format("G1 X{0} Y{1}\nL{2}", line.X1, line.Y1, AllLines.IndexOf(line)));      //added L to save the line number, makes gui stuff easier in main window
            }
            GeneratedGCODE.Add(EndGCODE + "\n");
        }
Exemplo n.º 3
0
 private void Lines_LineAdded(object sender, LineChangedEventArgs e)
 {
     this.Page.AddLine(e.Line);
     AllLines.Add(e.Line);
 }