Documentation ¶
Overview ¶
Package project implement project model used for storing simulation settings, setup and results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComputingLibrary ¶
type ComputingLibrary int
ComputingLibrary library used for computing
const ( // UnassignedLibrary unassigned UnassignedLibrary ComputingLibrary = iota // ShieldLibrary SHILD-HIT12A ShieldLibrary // FlukaLibrary FLUKA FlukaLibrary )
func (ComputingLibrary) MarshalJSON ¶
func (l ComputingLibrary) MarshalJSON() ([]byte, error)
MarshalJSON json.Marshaller implementation.
func (*ComputingLibrary) UnmarshalJSON ¶
func (l *ComputingLibrary) UnmarshalJSON(b []byte) error
UnmarshalJSON json.Unmarshaller implementation.
type List ¶
type List struct {
Projects []Project `json:"projects"`
}
List contains list of project.Project.
type Project ¶
type Project struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` AccountID bson.ObjectId `json:"accountId" bson:"account_id"` Name string `json:"name" bson:"name"` Description string `json:"description" bson:"description"` Versions []Version `json:"versions" bson:"versions"` }
Project represent named project, which may have multiple version.
type Settings ¶
type Settings struct { SimulationEngine SimulationEngine `json:"simulationEngine"` ComputingLibrary ComputingLibrary `json:"computingLibrary"` }
Settings contains simulation settings such as the used simulation engine.
type SimulationEngine ¶
type SimulationEngine int
SimulationEngine is method/location of running simulation
const ( // UnassignedEngine unassigned UnassignedEngine SimulationEngine = iota // LocalMachine simulation engine LocalMachine )
func (SimulationEngine) MarshalJSON ¶
func (s SimulationEngine) MarshalJSON() ([]byte, error)
MarshalJSON json.Marshaller implementation.
func (*SimulationEngine) UnmarshalJSON ¶
func (s *SimulationEngine) UnmarshalJSON(b []byte) error
UnmarshalJSON json.Unmarshaller implementation.
type Version ¶
type Version struct { ID VersionID `json:"id" bson:"id"` Status VersionStatus `json:"status" bson:"status"` Settings Settings `json:"settings" bson:"settings"` SetupID bson.ObjectId `json:"-" bson:"setup_id"` ResultID bson.ObjectId `json:"-" bson:"result_id"` UpdatedAt time.Time `json:"updatedAt"` }
Version is project version, which contains settting and simulation setup/results.
type VersionStatus ¶
type VersionStatus int
VersionStatus indicate current version status.
const ( // New version status. It is set during creation or copy/from operation // on newly created version. New VersionStatus = iota // Edited version status. It is set during version modifing. Edited // Running version status. It is set after simulation start. Running // Pending version status. It is set after siulation start request. Pending // Success version status. It is set after successful simulation. Success // Failure version status. It is set after unsuccessful simulation // associated with simulation engine error. Failure // Interrupted version status. It is set, when simulation processing is interrupted // due to technical difficultes like broken connection or server crash. Interrupted // Canceled version status. It is after request to cancel simulation. Canceled // Discarded version status. It is after creatine new version while old is still editable. Discarded )
func (VersionStatus) IsModifable ¶
func (v VersionStatus) IsModifable() bool
IsModifable return true, if simulation has no started yet, so Version content can be changed.
func (VersionStatus) IsRunnable ¶
func (v VersionStatus) IsRunnable() bool
IsRunnable return true, if simulation can be runned.
func (VersionStatus) MarshalJSON ¶
func (v VersionStatus) MarshalJSON() ([]byte, error)
MarshalJSON json.Marshaller implementation.
func (VersionStatus) String ¶
func (v VersionStatus) String() string
String fmt.Stringer implementation.
func (*VersionStatus) UnmarshalJSON ¶
func (v *VersionStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON json.Unmarshaller implementation.