// Set safety-height.
// Scans for the highest position on the Y axis, and afterwards replaces all instances
// of this position with the requested height.
428640
func (vm *Machine) SetSafetyHeight(height float64) error {
	// Ensure we detected the highest point in the script - we don't want any collisions

	maxz := vm.FindSafetyHeight()
	nextz := 0.0
	for _, m := range vm.Positions {
		if m.Z < maxz && m.Z > nextz {
			nextz = m.Z
		}
	}

	if height <= nextz {
		return errors.New(fmt.Sprintf("New safety height collides with lower feed height of %g", nextz))
	}

	// Apply the changes
	var lastx, lasty float64
	for idx, m := range vm.Positions {
		if lastx == m.X && lasty == m.Y && m.Z == maxz {
			vm.Positions[idx].Z = height
		}
		lastx, lasty = m.X, m.Y
	}
	return nil
}
381608
func (a *SetDeviceMetricsOverrideArgs) SetPositionY(positionY int) *SetDeviceMetricsOverrideArgs {
	a.PositionY = &positionY
	return a
}
640910
func (s *Resolution) SetHeight(v int64) *Resolution {
	s.Height = &v
	return s
}
757595
func (b Box) Height() int {
	return util.Math.AbsInt(b.Bottom - b.Top)
}
501589
func (a *SetDeviceMetricsOverrideArgs) SetPositionX(positionX int) *SetDeviceMetricsOverrideArgs {
	a.PositionX = &positionX
	return a
}
961632
func (s *DetectedProperties) SetHeight(v int64) *DetectedProperties {
	s.Height = &v
	return s
}
674094
func (a *SetCookieArgs) SetSecure(secure bool) *SetCookieArgs {
	a.Secure = &secure
	return a
}
1329270
func (pool *BlockPool) updateMaxPeerHeight() {
	var max int64
	for _, peer := range pool.peers {
		if peer.height > max {
			max = peer.height
		}
	}
	pool.maxPeerHeight = max
}
1242657
func (context *BaseContext) SetFloat(key string, value float64) {
	context.userData[key] = value
}
275498
func (s *Rectangle) SetHeight(v int64) *Rectangle {
	s.Height = &v
	return s
}
447273
func (s *ByteMatchTuple) SetPositionalConstraint(v string) *ByteMatchTuple {
	s.PositionalConstraint = &v
	return s
}
215268
func (s *CreateJobInput) SetMaxCapacity(v float64) *CreateJobInput {
	s.MaxCapacity = &v
	return s
}
669351
func (info *ImageInfoType) Height() float64 {
	return info.h / (info.scale * info.dpi / 72)
}
914090
func (s *Status) SetHeight(height uint32) {
	s.Lock()
	defer s.Unlock()
	s.ready = height == s.dbHeight
	s.height = height
}
1074016
func (j *Jenkins) SafeRestart() error {
	_, err := j.Requester.Post("/safeRestart", strings.NewReader(""), struct{}{}, map[string]string{})
	return err
}
1131480
func (b *Bound) Height() float64 {
	return b.ne.Y() - b.sw.Y()
}
1103747
func WithDisplayHeight(val int) func(Config) {
	return func(c Config) {
		d, ok := c.(*SSD1306Driver)
		if ok {
			d.DisplayHeight = val
		} else {
			// TODO: return error for trying to set DisplayHeight for non-SSD1306Driver
			return
		}
	}
}