Documentation
¶
Index ¶
- Constants
- type AfterCancelTaskHandler
- type AfterStatChangeHandler
- type AgvTask
- type BeforeActivateTaskHandler
- type BeforeCancelTaskHandler
- type BeforeStatChangeHandler
- type CmdReceiveHandler
- type CmdSendHandler
- type CncTask
- type Craft
- type ExceptionReport
- type ICmd
- type ITask
- type Ireport
- type OverHandler
- type Rep
- type Res
- type ResGroupType
- type RuntimeReport
- type Task
- func (t Task) Activate() error
- func (t Task) Cancel(b bool) error
- func (t Task) DurationDoMinutes() int64
- func (t Task) DurationPlanMinutes() int64
- func (t Task) ForIsPlan() bool
- func (t Task) ForRunTime() int64
- func (t Task) ForStat() TaskType
- func (t Task) NextStat(stat TaskType) error
- func (t Task) SetAfterCancelHandler(f AfterCancelTaskHandler) error
- func (t Task) SetAfterStatChange(f AfterStatChangeHandler) error
- func (t Task) SetBeforeActivateHandler(f BeforeActivateTaskHandler) error
- func (t Task) SetBeforeCancelHandler(f BeforeCancelTaskHandler) error
- func (t Task) SetBeforeStatChange(f BeforeStatChangeHandler) error
- func (t Task) SetOverHandler(f OverHandler) error
- func (t Task) SetPlan(startTime time.Time, endTime time.Time) error
- func (t Task) SetType(s string) error
- func (t Task) TypeOf() string
- type TaskRep
- type TaskType
- type WorkOrder
- type Workpiece
- type ZhuangpeiTask
Constants ¶
View Source
const SCHEMA_BOM = `` /* 1974-byte string literal not displayed */
BOM相关的数据结构
View Source
const SCHEMA_TEST = `` /* 559-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgvTask ¶
type AgvTask struct { Uid string `json:"uid,omitempty"` Name string `json:"task_name,omitempty"` //任务名称 Code string `json:"task_code,omitempty"` //任务编码 MaterialCode string `json:"material_code,omitempty"` //物料编码 Res Res `json:"Res,omitempty"` //执行该任务的资源 Stat TaskType `json:"stat,omitempty"` //任务状态 StatMsg string `json:"stat_msg,omitempty"` //任务改变状态的说明 EarlyTime time.Time `json:"early_time,omitempty"` //最早开始时间 LatestTime time.Time `json:"latest_time,omitempty"` //最晚结束时间 StartTime time.Time `json:"start_time,omitempty"` //实际开工时间 EndTime time.Time `json:"end_time,omitempty"` //实际完工时间 SubTask []ITask `json:"sub_task,omitempty"` //任务链中的下一个任务 FromPoint []Res `json:"from_point,omitempty"` //任务开始点资源(可以从几个点取货) ToPoint []Res `json:"to_point,omitempty"` //任务结束点资源(可以送往几个点) //PreTask *Task `json:"pre_task,omitempty"` //前置任务 //NextTask *Task `json:"sub_task,omitempty"` //后置任务 Planed bool `json:"planed,omitempty"` //已经计算过 TimePath timeNode `json:"time_node,omitempty"` //计算后占用对应资源的时间点集合 DType []string `json:"dgraph.type,omitempty"` // contains filtered or unexported fields }
转运任务
type BeforeCancelTaskHandler ¶
type BeforeCancelTaskHandler func() error
任务被取消前,执行的函数,如果返回错误则不执行取消操作
type CmdReceiveHandler ¶
type CmdReceiveHandler func() error
type CmdSendHandler ¶
type CmdSendHandler func() error
type Craft ¶
type Craft struct { Uid string `json:"uid,omitempty"` Code string `json:"c_code,omitempty"` Name string `json:"c_r|c_name,omitempty"` //工序名称 Line string `json:"c_r|c_line,omitempty"` //工序行号 ReadyTime int `json:"c_r|c_ready_time,omitempty"` //准终工时 DoTime int `json:"c_r|c_do_time,omitempty"` //单件工时 Res []Res `json:"c_r,omitempty"` //使用资源 DType []string `json:"dgraph.type,omitempty"` }
type ITask ¶
type ITask interface { //激活任务(开始执行) Activate() error //取消任务 //before bool,为true: 则不论beforeHandler 成功与否都会取消任务,为false:当beforeHandler返回错误时则不取消任务 Cancel(bool) error //改变任务状态(任务不支持回滚,值能改变为下一状态) NextStat(TaskType) error //任务取消前的处理函数 SetBeforeCancelHandler(BeforeCancelTaskHandler) error //任务取消后的处理函数 SetAfterCancelHandler(AfterCancelTaskHandler) error //任务激活前的处理函数 SetBeforeActivateHandler(BeforeActivateTaskHandler) error //任务状态改变前的处理函数 SetBeforeStatChange(BeforeStatChangeHandler) error //任务状态改变后的处理函数 SetAfterStatChange(AfterStatChangeHandler) error //任务结束后的处理函数 SetOverHandler(OverHandler) error //设置任务链 //SetSubTask(iTask ITask) error ////设置前置任务 //SetPreTask(iTask ITask) error ////设置后置任务 //SetNextTask(iTask ITask) error //设置计划结果 SetPlan(time.Time, time.Time) error //添加类型标签 SetType(s string) error //获取任务的状态 ForStat() TaskType //获取任务持续运行时间 ForRunTime() int64 //是否已经入链 0:独立、1:最后一链、2第一链、3中间链 //ForIsChain() int //是否已经计划排产 ForIsPlan() bool //与上一个任务的时间轴射影是否重叠(重叠意味着排序失败) //AxisProjectiveOverlap() bool //任务计划执行时间 DurationPlanMinutes() int64 //任务实际执行时间 DurationDoMinutes() int64 //任务类型 TypeOf() string }
任务的接口
type Res ¶
type Res struct { Uid string `json:"uid,omitempty"` MainRes bool `json:"r_main,omitempty"` //是否主任务 Name string `json:"r_name,omitempty"` Group int `json:"r_group,omitempty"` Code string `json:"r_code,omitempty"` DType []string `json:"dgraph.type,omitempty"` }
资源
type ResGroupType ¶
type ResGroupType int
资源类别
const ( ResGroup_AgvYS ResGroupType = 1 //运输小车 ResGroup_CNC ResGroupType = 2 //全自动机床 ResGroup_WmsGW ResGroupType = 3 //仓库工位 ResGroup_ZpGw ResGroupType = 4 //装配工位 )
func (ResGroupType) String ¶
func (rt ResGroupType) String() string
type Task ¶
type Task struct { Uid string `json:"uid,omitempty"` Name string `json:"t_name,omitempty"` //任务名称 Code string `json:"t_code,omitempty"` //任务编码 MaterialCode string `json:"t_m_code,omitempty"` //物料编码 Res Res `json:"t_use_r,omitempty"` //执行该任务的资源 Stat TaskType `json:"t_stat,omitempty"` //任务状态 StatMsg string `json:"t_stat|stat_msg,omitempty"` //任务改变状态的说明 EarlyTime time.Time `json:"t_p_start_time,omitempty"` //最早开始时间 LatestTime time.Time `json:"t_p_end_time,omitempty"` //最晚结束时间 StartTime time.Time `json:"t_start_time,omitempty"` //实际开工时间 EndTime time.Time `json:"t_end_time,omitempty"` //实际完工时间 Planed bool `json:"t_planed,omitempty"` //已经计算过 TimePath time.Time `json:"t_planed|t_time_point,omitempty"` //计算后占用对应资源的时间点集合 OffsetMinute int `json:"t_planed|t_offset_minute,omitempty"` TaskType string `json:"t_type,omitempty"` //任务类型 FromPoint string `json:"t_type|t_from.point,omitempty"` //如果是运输任务 起始地点 ToPoint string `json:"t_type|t_to.point,omitempty"` //如果是运输任务 终止地点 DType []string `json:"dgraph.type,omitempty"` // contains filtered or unexported fields }
任务基类
func (Task) ForRunTime ¶
func (Task) SetAfterCancelHandler ¶
func (t Task) SetAfterCancelHandler(f AfterCancelTaskHandler) error
设置 任务取消后 触发函数
func (Task) SetAfterStatChange ¶
func (t Task) SetAfterStatChange(f AfterStatChangeHandler) error
设置 任务的状态改变后的处理行数
func (Task) SetBeforeActivateHandler ¶
func (t Task) SetBeforeActivateHandler(f BeforeActivateTaskHandler) error
设置 任务激活前的 处理函数
func (Task) SetBeforeCancelHandler ¶
func (t Task) SetBeforeCancelHandler(f BeforeCancelTaskHandler) error
设置 任务取消前 触发函数
func (Task) SetBeforeStatChange ¶
func (t Task) SetBeforeStatChange(f BeforeStatChangeHandler) error
设置 任务状态修改前的 处理函数
type TaskRep ¶
type TaskRep struct { Rep // contains filtered or unexported fields }
人工报工数据
func NewTaskRep ¶
实例报工单 taskCode : 任务编码 fromPoint: 报送资源编码 repType : 报工类型 开始/完工(0/1)
func (*TaskRep) SetToPoint ¶
type WorkOrder ¶
type WorkOrder struct { Uid string `json:"uid,omitempty"` Code string `json:"wo_code,omitempty"` //编码 StartTime time.Time `json:"wo_start,omitempty"` //计划开始时间 EndTime time.Time `json:"wo_end,omitempty"` //计划完工时间 State int `json:"wo_state,omitempty"` //工单当前状态 0:执行中 1完成 -1:取消 Tasks []Task `json:"wo_t,omitempty"` //工单下的任务 Line string `json:"wo_t|wo_t_line,omitempty"` //任务的数序号 DType []string `json:"dgraph.type,omitempty"` }
工单
type Workpiece ¶
type Workpiece struct { Uid string `json:"uid,omitempty"` Code string `json:"b_code,omitempty"` //编码 Name string `json:"b_name,omitempty"` //名称 Spec string `json:"b_spec,omitempty"` //规格 Unit string `json:"b_unit,omitempty"` //计量单位 WmsType string `json:"b_wms_type,omitempty"` //仓库供应类型 Cost string `json:"b_cost,omitempty"` //成本相关 GetType string `json:"b_get_type,omitempty"` //生产类型 Remark string `json:"b_remark,omitempty"` //备注 HasCF []*Craft `json:"b_cf,omitempty"` Category int `json:"b_cf|b_cf_category,omitempty"` //工艺种类。装配2,生产1 HasWO []*WorkOrder `json:"b_wo,omitempty"` //工单 HasWP []*Workpiece `json:"b_children,omitempty"` //下级子件 Level string `json:"b_children|b_level,omitempty"` //节点层级 Line string `json:"b_children|b_line,omitempty"` //子件行号 BasicCount float64 `json:"b_children|b_basic_count,omitempty"` //基础用量 BasicUnit float64 `json:"b_basic_unit,omitempty"` //基础数量 UsedCount float64 `json:"b_children|b_used_count,omitempty"` //使用数量 DType []string `json:"dgraph.type,omitempty"` // contains filtered or unexported fields }
type ZhuangpeiTask ¶
type ZhuangpeiTask struct {
Task
}
func (ZhuangpeiTask) TypeOf ¶
func (z ZhuangpeiTask) TypeOf() string
Click to show internal directories.
Click to hide internal directories.