This commit is contained in:
laodaming 2023-08-28 19:00:08 +08:00
parent 312a3c0632
commit 72a26c07f2

View File

@ -29,7 +29,6 @@ type extendRenderProperty struct {
type renderImageControlChanItem struct { type renderImageControlChanItem struct {
option int // 0删除 1添加 2修改耗时属性 option int // 0删除 1添加 2修改耗时属性
taskId string //map的key(必须传) taskId string //map的key(必须传)
combineImage string //刀版图地址(增加任务时候传)
renderId string // map的val(增加任务时候传) renderId string // map的val(增加任务时候传)
renderNotifyImageUrl string //渲染回调数据(删除任务时候传) renderNotifyImageUrl string //渲染回调数据(删除任务时候传)
taskProperty renderTask //渲染任务的属性 taskProperty renderTask //渲染任务的属性
@ -37,7 +36,8 @@ type renderImageControlChanItem struct {
// 渲染任务属性 // 渲染任务属性
type renderTask struct { type renderTask struct {
renderId string //渲染id(前端传的) renderId string //渲染id(新增任务传)
combineImage string //刀版图(新增任务传)
combineTakesTime int64 //合刀版图耗时 combineTakesTime int64 //合刀版图耗时
uploadCombineImageTakesTime int64 //上传刀版图耗时 uploadCombineImageTakesTime int64 //上传刀版图耗时
unityRenderBeginTime int64 //发送给unity时间 unityRenderBeginTime int64 //发送给unity时间
@ -218,10 +218,12 @@ func (w *wsConnectItem) consumeRenderCache(data []byte) {
//########################################### //###########################################
//把需要渲染的图片任务加进去 //把需要渲染的图片任务加进去
w.createRenderTask(renderImageControlChanItem{ w.createRenderTask(renderImageControlChanItem{
option: 1, //0删除 1添加 2修改耗时属性 option: 1, //0删除 1添加 2修改耗时属性
taskId: taskId, taskId: taskId,
renderId: renderImageData.RenderId, renderId: renderImageData.RenderId,
combineImage: combineImage, taskProperty: renderTask{
combineImage: combineImage,
},
}) })
//组装数据 //组装数据
if err = w.assembleRenderData(taskId, combineImage, renderImageData, productTemplate, model3dInfo, element, productFirstSize); err != nil { if err = w.assembleRenderData(taskId, combineImage, renderImageData, productTemplate, model3dInfo, element, productFirstSize); err != nil {
@ -448,7 +450,7 @@ func (w *wsConnectItem) operationRenderTask() {
w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{ w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_RENDER_IMAGE, websocket_data.RenderImageRspMsg{
RenderId: taskData.renderId, RenderId: taskData.renderId,
Image: data.renderNotifyImageUrl, Image: data.renderNotifyImageUrl,
CombineImage: data.combineImage, CombineImage: data.taskProperty.combineImage,
RenderProcessTime: websocket_data.RenderProcessTime{ RenderProcessTime: websocket_data.RenderProcessTime{
CombineTakesTime: CombineTakesTime, CombineTakesTime: CombineTakesTime,
UnityRenderTakesTime: UnityRenderTakesTime, UnityRenderTakesTime: UnityRenderTakesTime,
@ -461,8 +463,10 @@ func (w *wsConnectItem) operationRenderTask() {
delete(w.extendRenderProperty.renderImageTask, data.taskId) delete(w.extendRenderProperty.renderImageTask, data.taskId)
case 1: //新增任务 case 1: //新增任务
w.extendRenderProperty.renderImageTask[data.taskId] = &renderTask{ w.extendRenderProperty.renderImageTask[data.taskId] = &renderTask{
renderId: data.renderId, renderId: data.renderId,
combineImage: data.taskProperty.combineImage,
} }
case 2: //修改(耗时)属性 case 2: //修改(耗时)属性
if taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]; ok { if taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]; ok {
//合图耗时 //合图耗时