github.com/gkstretton/dark/services/goo@v0.0.0-20231114224855-2d1a2074d446/actor/executor/helpers.go (about)

     1  package executor
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/gkstretton/dark/services/goo/events"
     7  	"github.com/gkstretton/dark/services/goo/vialprofiles"
     8  )
     9  
    10  func getDispenseVolume() float32 {
    11  	sr := events.GetLatestStateReportCopy()
    12  
    13  	const fallbackVolume float32 = 15
    14  	profile := vialprofiles.GetSystemVialProfile(int(sr.PipetteState.VialHeld))
    15  
    16  	if profile == nil {
    17  		fmt.Printf("error getting dispense volume, using fallback %.1f\n", fallbackVolume)
    18  		return fallbackVolume
    19  	}
    20  
    21  	return profile.DispenseVolumeUl
    22  }