Ejemplo n.º 1
0
        static void decode_tp(STEPNCLib.Finder Find, StringBuilder builder, long tp_id, int depth, bool last2, ref long count)
        {
            //time, distance, speed, feed
            double time = Find.GetExecutableBaseTime(tp_id);
            double distance = Find.GetExecutableDistance(tp_id);
            double feed = Find.GetProcessFeed(tp_id);
            double speed = Find.GetProcessSpeed(tp_id);

            for (int i = 0; i < depth; i++)
                builder.Append("\t");
            builder.Append("{\"toolpath\": {");

            builder.Append("\"base_time\": ");
            builder.Append(time);
            builder.Append(", ");

            builder.Append("\"distance\": ");
            builder.Append(distance);
            builder.Append(", ");

            builder.Append("\"feed_rate\": ");
            builder.Append(feed);
            builder.Append(", ");

            builder.Append("\"speed\": ");
            builder.Append(speed);

            if (last2)
            {
                builder.Append(" }}\n");
                count = count + 1;
            }
            else
                builder.Append(" }},\n");
        }