Ejemplo n.º 1
0
    public void OnConfirm()
    {
        float         modelMaxZ     = ModelManager.GetInstance().GetModel().GetCurDataSize().z;
        List <string> endGcode_Stop = StartAndEndGcodeUtils.GetEndGcode_StopPrint(modelMaxZ);

        GcodeSenderManager.GetInstance().SetStopEndGcode(endGcode_Stop);
        GcodeSenderManager.GetInstance().StopSend();
    }
Ejemplo n.º 2
0
    /********** Archive ************/
    public void ArchiveForPrint(string path)
    {
        Debug.Log("ArchiveForPrint:-->" + path + "\n");
        Overrides overrides = bean.overrides;

        overrides.machine_start_gcode.default_value = StartAndEndGcodeUtils.GetStartGcode_Config(bean);

        float modelMaxZ = ModelManager.GetInstance().GetModel().GetCurDataSize().z;

        overrides.machine_end_gcode.default_value = StartAndEndGcodeUtils.GetEndGcode_Config(modelMaxZ);

        overrides.wall_line_count.default_value =
            Mathf.RoundToInt((float)(overrides.wall_thickness.default_value / 0.4));

        //0 if infill_sparse_density == 0
        //else (infill_line_width * 100) / infill_sparse_density * (2 if infill_pattern == 'grid' else (3 if infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'cubicsubdiv' else (2 if infill_pattern == 'tetrahedral' else 1)))

        if (overrides.infill_sparse_density.default_value < 1)
        {
            overrides.infill_line_distance.default_value = 0;
        }
        else
        {
            double infill_sparse_density = overrides.infill_sparse_density.default_value;
            double infill_line_width     = 0.4;
            //use grid
            overrides.infill_line_distance.default_value = (infill_line_width * 100) / infill_sparse_density * 2;
        }

        //string path = Application.streamingAssetsPath + "/CrossPlatform/CuraEngine/Config/" + "output.def.json";
        //string path = PathManager.dirPath_Temp () + "output.def.json";
        string       json = JsonMapper.ToJson(bean);
        FileStream   fs   = new FileStream(path, FileMode.Create);
        StreamWriter sr   = new StreamWriter(fs);

        sr.Write(json);
        sr.Close();
        fs.Close();
    }