-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
263 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ export const BackgroundGrid: React.FC<{ size: number }> = ({ size }) => ( | |
/> | ||
))} | ||
</> | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ export const Labels: React.FC<{ size: number }> = ({ size }) => ( | |
Exclusion Edge | ||
</text> | ||
</> | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ export const ShiftInputs: React.FC<{ | |
onChange={onChange} | ||
/> | ||
</div> | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ export const SingleInput: React.FC<{ | |
className={className} | ||
/> | ||
</div> | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,66 @@ | ||
import { DieCalculationParameters } from "@/types" | ||
import { createDies } from "../lib/createDies" | ||
import type { DieCalculationParameters } from "@/types" | ||
import { createDies } from "@/lib/createDies" | ||
import { BackgroundGrid } from "@/blocks/BackgroundGrid" | ||
import { WaferOutline } from "@/blocks/WaferOutline" | ||
import { Labels } from "@/blocks/Labels" | ||
|
||
export const WaferMap = ({parameters}: {parameters: DieCalculationParameters}) => { | ||
const size = 900 | ||
const centerX = size / 2 | ||
const centerY = size / 2 | ||
const radius = size / 2 - 10 | ||
const exclusionRadius = radius * (1 - parameters.edgeLoss / parameters.waferDiameter) | ||
export const WaferMap = ({ | ||
parameters, | ||
}: { | ||
parameters: DieCalculationParameters | ||
}) => { | ||
const size = 900 | ||
const centerX = size / 2 | ||
const centerY = size / 2 | ||
const radius = size / 2 | ||
const exclusionRadius = | ||
radius * (1 - parameters.edgeLoss / parameters.waferDiameter) | ||
|
||
const reticle = { | ||
horizontal: parameters.dieSize.horizontal + parameters.dieSpacing.horizontal, | ||
vertical: parameters.dieSize.vertical + parameters.dieSpacing.vertical, | ||
} | ||
const reticle = { | ||
horizontal: | ||
parameters.dieSize.horizontal + parameters.dieSpacing.horizontal, | ||
vertical: parameters.dieSize.vertical + parameters.dieSpacing.vertical, | ||
} | ||
|
||
const dieCountHorizontal = Math.round(parameters.waferDiameter / reticle.horizontal) | ||
const dieCountVertical = Math.round(parameters.waferDiameter / reticle.vertical) | ||
const scale = size / parameters.waferDiameter | ||
const dieCountHorizontal = Math.round( | ||
parameters.waferDiameter / reticle.horizontal | ||
) | ||
const dieCountVertical = Math.round( | ||
parameters.waferDiameter / reticle.vertical | ||
) | ||
const scale = size / parameters.waferDiameter | ||
|
||
const dies = createDies( | ||
dieCountHorizontal, | ||
dieCountVertical, | ||
reticle, | ||
scale, | ||
centerX, | ||
centerY, | ||
radius, | ||
parameters | ||
) | ||
const dies = createDies( | ||
dieCountHorizontal, | ||
dieCountVertical, | ||
reticle, | ||
scale, | ||
centerX, | ||
centerY, | ||
radius, | ||
parameters | ||
) | ||
|
||
return ( | ||
<svg width={size} height={size} className="aspect-square w-full"> | ||
<BackgroundGrid size={size} /> | ||
<WaferOutline | ||
centerX={centerX} | ||
centerY={centerY} | ||
radius={radius} | ||
exclusionRadius={exclusionRadius} | ||
return ( | ||
<svg width={size} height={size} className="aspect-square w-full"> | ||
<BackgroundGrid size={size} /> | ||
<WaferOutline | ||
centerX={centerX} | ||
centerY={centerY} | ||
radius={radius} | ||
exclusionRadius={exclusionRadius} | ||
/> | ||
{dies.map((die) => ( | ||
<rect | ||
key={die.key} | ||
x={die.x} | ||
y={die.y} | ||
width={die.width} | ||
height={die.height} | ||
fill={die.fill} | ||
/> | ||
{dies.map((die) => ( | ||
<rect | ||
key={die.key} | ||
x={die.x} | ||
y={die.y} | ||
width={die.width} | ||
height={die.height} | ||
fill={die.fill} | ||
/> | ||
))} | ||
<Labels size={size} /> | ||
</svg> | ||
) | ||
} | ||
))} | ||
<Labels size={size} /> | ||
</svg> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ export const WaferOutline: React.FC<{ | |
fill="none" | ||
/> | ||
</> | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Button } from "@/components/ui/button" | ||
import { SingleInput } from "@/blocks/SingleInput" | ||
import { ShiftInputs } from "@/blocks/ShiftInputs" | ||
import { ParameterInputs } from "@/blocks/ParameterInputs" | ||
import { WaferDiameterSelect } from "@/blocks/WaferDiameterSelect" | ||
import { useDieYield } from "@/contexts/useDieYield" | ||
|
||
const YieldControls: React.FC = () => { | ||
const { parameters, setParameters, resetParameters } = useDieYield() | ||
|
||
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
const { name, value } = event.target | ||
setParameters((prev) => { | ||
const newParameters: any = { ...prev } | ||
if (name.includes(".")) { | ||
const [parent, child] = name.split(".") | ||
newParameters[parent] = { | ||
...newParameters[parent], | ||
[child]: parseFloat(value), | ||
} | ||
} else { | ||
newParameters[name] = parseFloat(value) | ||
} | ||
return newParameters | ||
}) | ||
} | ||
|
||
return ( | ||
<> | ||
<WaferDiameterSelect | ||
value={parameters.waferDiameter} | ||
onChange={(value) => | ||
setParameters((prev) => ({ | ||
...prev, | ||
waferDiameter: parseInt(value), | ||
})) | ||
} | ||
/> | ||
<ParameterInputs parameters={parameters} onChange={handleInputChange} /> | ||
|
||
<SingleInput | ||
label="Edge Loss (mm)" | ||
name="edgeLoss" | ||
value={parameters.edgeLoss} | ||
onChange={handleInputChange} | ||
className="border-green-500" | ||
/> | ||
<SingleInput | ||
label="Defect Density (#/sq.cm)" | ||
name="defectDensity" | ||
value={parameters.defectDensity} | ||
onChange={handleInputChange} | ||
className="border-green-500" | ||
/> | ||
<ShiftInputs parameters={parameters} onChange={handleInputChange} /> | ||
<Button | ||
onClick={resetParameters} | ||
className="bg-red-500 text-white hover:bg-red-600" | ||
> | ||
Reset | ||
</Button> | ||
</> | ||
) | ||
} | ||
|
||
export { YieldControls} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.