| | |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | minValue, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | |
| | | <NumberInput |
| | | label="table.field.agvModel.headOffset" |
| | | source="headOffset" |
| | | validate={required()} |
| | | validate={[required(), minValue(1)]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={4} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.agvModel.tailOffset" |
| | | source="tailOffset" |
| | | validate={required()} |
| | | validate={[required(), minValue(1)]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={4} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.agvModel.width" |
| | | source="width" |
| | | validate={required()} |
| | | validate={[required(), minValue(1)]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={4} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.agvModel.height" |
| | | source="height" |
| | | validate={[required(), minValue(1)]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={4} display="flex" gap={1}> |
| | |
| | | label="table.field.agvModel.headOffset" |
| | | source="headOffset" |
| | | validate={required()} |
| | | min={1} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.agvModel.tailOffset" |
| | | source="tailOffset" |
| | | validate={required()} |
| | | min={1} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.agvModel.width" |
| | | source="width" |
| | | validate={required()} |
| | | min={1} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | |
| | | expand={() => <AgvModelPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'uuid', 'liftHeight', 'mqttTopic', 'password', 'protocol' |
| | | // , 'headOffset', 'tailOffset' |
| | | , 'length', 'width', 'height', 'allDirectionBool', 'diameter' |
| | | // , 'headOffset', 'tailOffset', 'width' |
| | | , 'length', 'height', 'allDirectionBool', 'diameter' |
| | | , 'statusBool', 'updateBy', 'updateTime', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | } |
| | | |
| | | public double maxExtent() { |
| | | double frontDiag = Math.hypot(head, halfWidth); |
| | | double rearDiag = Math.hypot(tail, halfWidth); |
| | | return Math.max(frontDiag, rearDiag); |
| | | // double frontDiag = Math.hypot(head, halfWidth); |
| | | // double rearDiag = Math.hypot(tail, halfWidth); |
| | | // return Math.max(frontDiag, rearDiag); |
| | | return Math.hypot(Math.max(head, tail), halfWidth); |
| | | } |
| | | } |