def loadSettings(self): self.form.WarningSuppressAllSpeeds.setChecked( PathPreferences.suppressAllSpeedsWarning()) self.form.WarningSuppressRapidSpeeds.setChecked( PathPreferences.suppressRapidSpeedsWarning(False)) self.form.WarningSuppressSelectionMode.setChecked( PathPreferences.suppressSelectionModeWarning()) self.form.EnableAdvancedOCLFeatures.setChecked( PathPreferences.advancedOCLFeaturesEnabled()) self.form.WarningSuppressOpenCamLib.setChecked( PathPreferences.suppressOpenCamLibWarning()) self.updateSelection()
def getCycleTimeEstimate(self, obj): tc = obj.ToolController if tc is None or tc.ToolNumber == 0: PathLog.error(translate("Path", "No Tool Controller selected.")) return translate("Path", "Tool Error") hFeedrate = tc.HorizFeed.Value vFeedrate = tc.VertFeed.Value hRapidrate = tc.HorizRapid.Value vRapidrate = tc.VertRapid.Value if ( hFeedrate == 0 or vFeedrate == 0 ) and not PathPreferences.suppressAllSpeedsWarning(): PathLog.warning( translate( "Path", "Tool Controller feedrates required to calculate the cycle time.", ) ) return translate("Path", "Feedrate Error") if ( hRapidrate == 0 or vRapidrate == 0 ) and not PathPreferences.suppressRapidSpeedsWarning(): PathLog.warning( translate( "Path", "Add Tool Controller Rapid Speeds on the SetupSheet for more accurate cycle times.", ) ) # Get the cycle time in seconds seconds = obj.Path.getCycleTime(hFeedrate, vFeedrate, hRapidrate, vRapidrate) if not seconds: return translate("Path", "Cycletime Error") # Convert the cycle time to a HH:MM:SS format cycleTime = time.strftime("%H:%M:%S", time.gmtime(seconds)) return cycleTime