private void onClick_export() { if (StageManager.GetStageList().Contains(StageManager.Stage_Enum.Gcode_Render) && GcodeRenderManager.GetInstance().GetInfo().isRendered&& StageManager.GetCurStage() != StageManager.Stage_Enum.Gcode_Send) { if (GcodeRenderManager.GetInstance().IsInBounds()) { string path = ModelManager.GetInstance().GetInfo().modelPath; string defaultName = System.IO.Path.GetFileNameWithoutExtension(path); string exportPath = FileDialogManager.GetInstance().ShowFileSaveDialog_Gcode(defaultName); if (string.IsNullOrEmpty(exportPath) || exportPath.Trim().Length == 0) { Debug.LogWarning("Gcode export is empty"); } else { string originPath = GcodeCreateManager.GetInstance().curGcodeBean.gcodePath; startSubThreadToExportGcode(originPath, exportPath); } } else { AlertMananger.GetInstance().ShowAlertMsg("Unable to print. The model goes beyond the work area."); } } }
/***************** button listener *****************/ private void onClick_open() { string defaultDir = ""; //open Snapmaker3DExampleDir int launchTimes_curVersion = PlayerPrefsManager.GetInstance().GetLaunchTimes_CurVersion(); if (++_clickTimes_openBtn == 1 && launchTimes_curVersion <= 1) { Debug.Log("times_curVersionLaunched :" + launchTimes_curVersion + "\n"); } string modelPath = FileDialogManager.GetInstance().ShowFileSelectDialog_STL_OBJ(defaultDir); if (string.IsNullOrEmpty(modelPath) || modelPath.Length == 0) { Debug.LogWarning("Model path is empty"); } else { GcodeRenderManager.GetInstance().Destroy(); ModelManager.GetInstance().StartSubThread_parseModel(modelPath); } }