mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
style(studio.resource): 整理和抽象了历史记录中任务的目录结构
Signed-off-by: 李东云 <dongyun.li@luxcreo.ai>
This commit is contained in:
29
src/Studio/Resource/Workspace/Tasks/Detail/Frame.php
Normal file
29
src/Studio/Resource/Workspace/Tasks/Detail/Frame.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Frame.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail;
|
||||
|
||||
use Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderDetail;
|
||||
|
||||
/**
|
||||
* 晶格模型生成任务的 source 格式
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail\Frame@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
class Frame extends OrderDetail
|
||||
{
|
||||
|
||||
}
|
||||
29
src/Studio/Resource/Workspace/Tasks/Detail/Lattice.php
Normal file
29
src/Studio/Resource/Workspace/Tasks/Detail/Lattice.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Lattice.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail;
|
||||
|
||||
use Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderDetail;
|
||||
|
||||
/**
|
||||
* 用于历史记录详情的晶格模型生成任务格式
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail\Lattice@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
class Lattice extends OrderDetail
|
||||
{
|
||||
|
||||
}
|
||||
29
src/Studio/Resource/Workspace/Tasks/Item/Frame.php
Normal file
29
src/Studio/Resource/Workspace/Tasks/Item/Frame.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Frame.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks\Item;
|
||||
|
||||
use Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderItem;
|
||||
|
||||
/**
|
||||
* 线框模型生成任务的 source 格式
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\Item\Frame@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
class Frame extends OrderItem
|
||||
{
|
||||
|
||||
}
|
||||
31
src/Studio/Resource/Workspace/Tasks/Item/Lattice.php
Normal file
31
src/Studio/Resource/Workspace/Tasks/Item/Lattice.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Lattice.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks\Item;
|
||||
|
||||
use Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderItem;
|
||||
|
||||
/**
|
||||
* 用于历史记录列表的晶格任务
|
||||
* 使用 $this->when() 引用的字段将来确定无用后,都会移除
|
||||
*
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\Item\Lattice@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
class Lattice extends OrderItem
|
||||
{
|
||||
|
||||
}
|
||||
68
src/Studio/Resource/Workspace/Tasks/OrderDetail.php
Normal file
68
src/Studio/Resource/Workspace/Tasks/OrderDetail.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* OrderDetail.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks;
|
||||
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Singularity\HDK\Studio\Enums\TaskLatticeAction;
|
||||
use Singularity\HDK\Studio\Resource\Field;
|
||||
use Singularity\HDK\Studio\Resource\File;
|
||||
use Singularity\HDK\Studio\Resource\Lattice as LatticeResource;
|
||||
use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
|
||||
/**
|
||||
* 订单详情抽象模型
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderDetail@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @property string $fileId 要处理的模型文件 ID
|
||||
* @property string $fileUrl 要处理的模型文件完整路径
|
||||
* @property TaskLatticeAction $action 模型精度
|
||||
* @property string $latticeId 晶格
|
||||
* @property float $scalingRatio 密度比,两位小数
|
||||
* @property float $size 晶格尺寸
|
||||
* @property float $wide 杆径粗细
|
||||
* @property int $surfaceNum 面数
|
||||
* @property int $field
|
||||
* @property LatticeResource $lattice
|
||||
* @property-read File $source
|
||||
* @property-read File $output
|
||||
* @property-read File $outputSmall
|
||||
* @property int $hardness
|
||||
*
|
||||
* @version 2
|
||||
*/
|
||||
abstract class OrderDetail extends JsonResource
|
||||
{
|
||||
use ClassicResponse;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$action = $this->action ?? null;
|
||||
return [
|
||||
'modelName' => $this->modelName ?? $this?->source?->name,
|
||||
'field' => Field::make($this->field),
|
||||
'source' => File::make($this?->source),
|
||||
'action' => is_null($action) ? null : $action,
|
||||
'lattice' => LatticeResource::make($this->lattice),
|
||||
'hardness' => $this->hardness ?? null,
|
||||
'scalingRatio' => $this->scalingRatio,
|
||||
'size' => $this->size,
|
||||
'wide' => $this->wide,
|
||||
'surfaceNum' => $this->surfaceNum,
|
||||
'output' => $this->when(isset($this->output), File::make($this?->output)),
|
||||
'outputPreview' => $this->when(isset($this->outputSmall), File::make($this?->outputSmall)),
|
||||
];
|
||||
}
|
||||
}
|
||||
90
src/Studio/Resource/Workspace/Tasks/OrderItem.php
Normal file
90
src/Studio/Resource/Workspace/Tasks/OrderItem.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Order.php@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Singularity\HDK\Studio\Resource\Workspace\Tasks;
|
||||
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Singularity\HDK\Studio\Enums\TaskLatticeAction;
|
||||
use Singularity\HDK\Studio\Resource\Field;
|
||||
use Singularity\HDK\Studio\Resource\File;
|
||||
use Singularity\HDK\Studio\Resource\FileCollection;
|
||||
use Singularity\HDK\Studio\Resource\Lattice as LatticeResource;
|
||||
use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
|
||||
/**
|
||||
* 订单列表中的元素类型
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\OrderItem@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
* Powered by PhpStorm
|
||||
* Created on 2022/7/26
|
||||
*
|
||||
* @property string $fileId 要处理的模型文件 ID
|
||||
* @property string $fileUrl 要处理的模型文件完整路径
|
||||
* @property TaskLatticeAction $action 模型精度
|
||||
* @property string $latticeId 晶格
|
||||
* @property float $scalingRatio 密度比,两位小数
|
||||
* @property float $size 晶格尺寸
|
||||
* @property float $wide 杆径粗细
|
||||
* @property int $surfaceNum 面数
|
||||
* @property string|null $modelName
|
||||
* @property int $fieldId
|
||||
* @property Field $field
|
||||
* @property LatticeResource $lattice
|
||||
* @property File $source
|
||||
* @property File $output
|
||||
* @property File $outputSmall
|
||||
* @property \Hyperf\Database\Model\Collection $showPicIds
|
||||
* @property string $technology
|
||||
* @property string $material
|
||||
* @property string $completeFileId
|
||||
* @property string $completeFileUrl
|
||||
* @property string $frameFileId
|
||||
* @property string $frameFileUrl
|
||||
* @property int $hardness
|
||||
*
|
||||
* @version 2
|
||||
*/
|
||||
abstract class OrderItem extends JsonResource
|
||||
{
|
||||
use ClassicResponse;
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$action = $this->action ?? null;
|
||||
return [
|
||||
'modelName' => $this->modelName ?? $this->source?->name,
|
||||
'viewShots' => $this->when(
|
||||
isset($this->viewShotFirst),
|
||||
isset($this->viewShotFirst) ? FileCollection::make([$this->viewShotFirst]) : null
|
||||
),
|
||||
'fieldZh' => $this->when(isset($this->field?->nameZh), $this->field?->nameZh),
|
||||
'fieldEn' => $this->when(isset($this->field?->nameEn), $this->field?->nameEn),
|
||||
'action' => $this->when(isset($action), $action),
|
||||
'lattice' => $this->when(!empty($this->lattice), $this->lattice?->title),
|
||||
'hardness' => $this->when(isset($this->hardness), $this->hardness),
|
||||
'scalingRatio' => $this->when(isset($this->scalingRatio), $this->scalingRatio),
|
||||
'size' => $this->when(isset($this->size), $this->size),
|
||||
'wide' => $this->when(isset($this->wide), $this->wide),
|
||||
'surfaceNum' => $this->when(isset($this->surfaceNum), $this->surfaceNum),
|
||||
'technology' => $this->when(isset($this->technology), $this->technology),
|
||||
'material' => $this->when(isset($this->material), $this->material),
|
||||
$this->mergeWhen(!empty($this->frameFileId), [
|
||||
'frameFileId' => $this->frameFileId,
|
||||
'frameFileUrl' => $this->frameFileUrl,
|
||||
]),
|
||||
$this->mergeWhen(!empty($this->completeFileId), [
|
||||
'completeFileId' => $this->completeFileId,
|
||||
'completeFileUrl' => $this->completeFileUrl,
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,8 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
* @property float $wide 杆径粗细
|
||||
* @property int $surfaceNum 面数
|
||||
* @property string|null $modelName
|
||||
* @property int $fieldId
|
||||
* @property Field $field
|
||||
* @property int $fieldId 领域 id
|
||||
* @property Field $field 领域名称
|
||||
* @property LatticeResource $lattice
|
||||
* @property File $source
|
||||
* @property File $output
|
||||
@@ -47,6 +47,10 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
* @property string $material
|
||||
* @property string $completeFileId
|
||||
* @property string $completeFileUrl
|
||||
* @property integer|null $hardness 预计硬度
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Singularity\HDK\Studio\Resource\Workspace\Tasks\Item\Frame
|
||||
*/
|
||||
final class Frame extends JsonResource
|
||||
{
|
||||
@@ -56,26 +60,26 @@ final class Frame extends JsonResource
|
||||
{
|
||||
$action = $this->action ?? null;
|
||||
return [
|
||||
'fieldZh' => $this->field?->nameZh,
|
||||
'fieldEn' => $this->field?->nameEn,
|
||||
'modelName' => $this->modelName ?? $this->source?->name,
|
||||
'action' => is_null($action) ? null : $action,
|
||||
'lattice' => $this->when(!empty($this->lattice), $this->lattice?->title),
|
||||
'scalingRatio' => $this->scalingRatio,
|
||||
'size' => $this->size,
|
||||
'wide' => $this->wide,
|
||||
'surfaceNum' => $this->surfaceNum,
|
||||
'viewShots' => $this->when(
|
||||
isset($this->viewShotFirst),
|
||||
isset($this->viewShotFirst) ? FileCollection::make([$this->viewShotFirst]) : null
|
||||
),
|
||||
'fieldZh' => $this->when(isset($this->field?->nameZh), $this->field?->nameZh),
|
||||
'fieldEn' => $this->when(isset($this->field?->nameEn), $this->field?->nameEn),
|
||||
'action' => $this->when(isset($action), $action),
|
||||
'lattice' => $this->when(!empty($this->lattice), $this->lattice?->title),
|
||||
'hardness' => $this->when(isset($this->hardness), $this->hardness),
|
||||
'scalingRatio' => $this->when(isset($this->scalingRatio), $this->scalingRatio),
|
||||
'size' => $this->when(isset($this->size), $this->size),
|
||||
'wide' => $this->when(isset($this->wide), $this->wide),
|
||||
'surfaceNum' => $this->when(isset($this->surfaceNum), $this->surfaceNum),
|
||||
'technology' => $this->when(isset($this->technology), $this->technology),
|
||||
'material' => $this->when(isset($this->material), $this->material),
|
||||
$this->mergeWhen(!empty($this->completeFileId), [
|
||||
'completeFileId' => $this->completeFileId,
|
||||
'completeFileUrl' => $this->completeFileUrl,
|
||||
]),
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -34,8 +34,15 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
* @property float $size 晶格尺寸
|
||||
* @property float $wide 杆径粗细
|
||||
* @property int $surfaceNum 面数
|
||||
* @property int $fieldId
|
||||
* @property int $field
|
||||
* @property LatticeResource $lattice
|
||||
* @property-read File $source
|
||||
* @property-read File $output
|
||||
* @property-read File $outputSmall
|
||||
* @property int $hardness
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail\Frame
|
||||
*/
|
||||
final class FrameDetail extends JsonResource
|
||||
{
|
||||
@@ -50,6 +57,7 @@ final class FrameDetail extends JsonResource
|
||||
'source' => File::make($this?->source),
|
||||
'action' => !isset($action) ? null : $action,
|
||||
'lattice' => LatticeResource::make($this->lattice),
|
||||
'hardness' => $this->hardness,
|
||||
'scalingRatio' => $this->scalingRatio,
|
||||
'size' => $this->size,
|
||||
'wide' => $this->wide,
|
||||
|
||||
@@ -24,6 +24,8 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
|
||||
/**
|
||||
* 用于历史记录列表的晶格任务
|
||||
* 使用 $this->when() 引用的字段将来确定无用后,都会移除
|
||||
*
|
||||
* Singularity\HDK\Studio\Resource\Workspace\Tasks\Source\Lattice@HDK
|
||||
*
|
||||
* @author 李东云<dongyun.li@luxcreo.cn>
|
||||
@@ -53,6 +55,9 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
* @property string $frameFileId
|
||||
* @property string $frameFileUrl
|
||||
* @property int $hardness
|
||||
*
|
||||
* @deprecated since version 1.0, to be removed in
|
||||
* @see \Singularity\HDK\Studio\Resource\Workspace\Tasks\Item\Lattice
|
||||
*/
|
||||
final class Lattice extends JsonResource
|
||||
{
|
||||
@@ -74,20 +79,20 @@ final class Lattice extends JsonResource
|
||||
{
|
||||
$action = $this->action ?? null;
|
||||
return [
|
||||
'fieldZh' => $this->field?->nameZh,
|
||||
'fieldEn' => $this->field?->nameEn,
|
||||
'modelName' => $this->modelName ?? $this->source?->name,
|
||||
'action' => is_null($action) ? null : $action,
|
||||
'lattice' => $this->when(!empty($this->lattice), $this->lattice?->title),
|
||||
'hardness' => $this->hardness ?? null,
|
||||
'scalingRatio' => $this->scalingRatio,
|
||||
'size' => $this->size,
|
||||
'wide' => $this->wide,
|
||||
'surfaceNum' => $this->surfaceNum,
|
||||
'viewShots' => $this->when(
|
||||
isset($this->viewShotFirst),
|
||||
isset($this->viewShotFirst) ? FileCollection::make([$this->viewShotFirst]) : null
|
||||
),
|
||||
'fieldZh' => $this->when(isset($this->field?->nameZh), $this->field?->nameZh),
|
||||
'fieldEn' => $this->when(isset($this->field?->nameEn), $this->field?->nameEn),
|
||||
'action' => $this->when(isset($action), $action),
|
||||
'lattice' => $this->when(!empty($this->lattice), $this->lattice?->title),
|
||||
'hardness' => $this->when(isset($this->hardness), $this->hardness),
|
||||
'scalingRatio' => $this->when(isset($this->scalingRatio), $this->scalingRatio),
|
||||
'size' => $this->when(isset($this->size), $this->size),
|
||||
'wide' => $this->when(isset($this->wide), $this->wide),
|
||||
'surfaceNum' => $this->when(isset($this->surfaceNum), $this->surfaceNum),
|
||||
'technology' => $this->when(isset($this->technology), $this->technology),
|
||||
'material' => $this->when(isset($this->material), $this->material),
|
||||
$this->mergeWhen(!empty($this->frameFileId), [
|
||||
@@ -98,7 +103,6 @@ final class Lattice extends JsonResource
|
||||
'completeFileId' => $this->completeFileId,
|
||||
'completeFileUrl' => $this->completeFileUrl,
|
||||
]),
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,9 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
* @property-read File $output
|
||||
* @property-read File $outputSmall
|
||||
* @property int $hardness
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Singularity\HDK\Studio\Resource\Workspace\Tasks\Detail\Lattice
|
||||
*/
|
||||
final class LatticeDetail extends JsonResource
|
||||
{
|
||||
|
||||
@@ -23,6 +23,8 @@ use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
*
|
||||
* @property string $modelId 要检修的模型 id
|
||||
* @property string $modelUrl 要检修的模型 url
|
||||
*
|
||||
* @deprecated 未使用
|
||||
*/
|
||||
final class Preflight extends JsonResource
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user