mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
df7d434284
- (Improvement) CXDLP: Better parse of machine model from PrusaSlicer profile (#351) - (Fix) OSF: Printer freezes at first layer (#657) - (Upgrade) AvaloniaUI from 0.10.18 to 0.10.19
191 lines
7.8 KiB
Plaintext
191 lines
7.8 KiB
Plaintext
//------------------------------------------------
|
||
//--- 010 Editor v8.0.1 Binary Template
|
||
//
|
||
// File: osf (vlare)
|
||
// Authors: Tiago Conceição
|
||
//------------------------------------------------
|
||
|
||
BigEndian();
|
||
|
||
enum <ubyte> BOOL { False, True };
|
||
|
||
struct PREVIEW {
|
||
BitfieldDisablePadding();
|
||
uint PreviewLength:24 <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte PreviewData[PreviewLength] <fgcolor=cBlack, bgcolor=cGreen>;
|
||
};
|
||
|
||
struct HEADER {
|
||
uint HeaderLength <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort Version <fgcolor=cBlack, bgcolor=cRed>; // 1
|
||
ubyte ImageLog <fgcolor=cBlack, bgcolor=cRed>; // log 2
|
||
|
||
|
||
PREVIEW preview;
|
||
PREVIEW preview;
|
||
PREVIEW preview;
|
||
PREVIEW preview;
|
||
|
||
ushort ResolutionX <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort ResolutionY <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort PixelUmMagnified100Times <fgcolor=cBlack, bgcolor=cRed>; // (um, magnification 100 times: such as 100um write 10000, the same below)
|
||
//ubyte Mirror <fgcolor=cBlack, bgcolor=cRed>; // (0x00 not mirrored, 0x01 X-axis mirroring, 0x02 Y-axis mirroring, 0x03 XY-axis mirroring)
|
||
enum <ubyte> { None, Horizontally, Vertically, Both } Mirror <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte BottomLightPWM <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte LightPWM <fgcolor=cBlack, bgcolor=cRed>;
|
||
BOOL AntiAliasEnabled <fgcolor=cBlack, bgcolor=cRed>;
|
||
BOOL DistortionEnabled <fgcolor=cBlack, bgcolor=cRed>;
|
||
BOOL DelayedExposureActivationEnabled <fgcolor=cBlack, bgcolor=cRed>;
|
||
uint LayerCount <fgcolor=cBlack, bgcolor=cYellow>;
|
||
ushort NumberParameterSets <fgcolor=cBlack, bgcolor=cRed>; // 1
|
||
uint LastLayerIndex <fgcolor=cBlack, bgcolor=cYellow>;
|
||
uint LayerHeightUmMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (um magnification 100 times)
|
||
ubyte BottomLayersCount <fgcolor=cBlack, bgcolor=cRed>;
|
||
|
||
uint ExposureTimeMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint BottomExposureTimeMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint SupportDelayTimeMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint BottomSupportDelayTimeMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
ubyte TransitionLayers <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte TransitionType <fgcolor=cBlack, bgcolor=cRed>; // (0x00 linear transition)
|
||
uint TransitionLayerIntervalTimeDifferenceMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint WaitTimeAfterCureMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint WaitTimeAfterLiftMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
uint WaitTimeBeforeCureMagnified100Times:24 <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
|
||
uint BottomLiftHeightSlowMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint BottomLiftHeightTotalMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint LiftHeightSlowMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint LiftHeightTotalMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint BottomRetractHeightSlowMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint BottomRetractHeightTotalMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint RetractHeightSlowMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
uint RetractHeightTotalMagnified1000Times:24 <fgcolor=cBlack, bgcolor=cRed>; // (magnification 1000 times)
|
||
|
||
ubyte AccelerationType <fgcolor=cBlack, bgcolor=cRed>; // (0x00: S-shaped acceleration, 0x01: T-shaped acceleration, Default Value: S-shaped acceleration, currently only supports S-shaped acceleration)
|
||
|
||
|
||
ushort BottomLiftSpeedStart <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort BottomLiftSpeedSlow <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort BottomLiftSpeedFast <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte BottomLiftAccelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort LiftSpeedStart <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort LiftSpeedSlow <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort LiftSpeedFast <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte LiftAccelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort BottomRetractSpeedStart <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort BottomRetractSpeedSlow <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort BottomRetractSpeedFast <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte BottomRetractAccelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort RetractSpeedStart <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort RetractSpeedSlow <fgcolor=cBlack, bgcolor=cRed>;
|
||
ushort RetractSpeedFast <fgcolor=cBlack, bgcolor=cRed>;
|
||
ubyte RetractAccelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
|
||
ushort BottomLiftSpeedEnd <fgcolor=cBlack, bgcolor=cRed>;// 7
|
||
ubyte BottomLiftDecelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort LiftSpeedEnd <fgcolor=cBlack, bgcolor=cRed>;// 7
|
||
ubyte LiftDecelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort BottomRetractSpeedEnd <fgcolor=cBlack, bgcolor=cRed>;// 7
|
||
ubyte BottomRetractDecelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort RetractSpeedEnd <fgcolor=cBlack, bgcolor=cRed>; // 7
|
||
ubyte RetractDecelerationChange <fgcolor=cBlack, bgcolor=cRed>; // 5
|
||
|
||
ushort BottomWaitTimeAfterCureMagnified100Times <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
ushort BottomWaitTimeAfterLiftMagnified100Times <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
ushort BottomWaitTimeBeforeCureMagnified100Times <fgcolor=cBlack, bgcolor=cRed>; // s * 100
|
||
|
||
ushort Reserved <fgcolor=cWhite, bgcolor=cBlack>;
|
||
|
||
ubyte ProtocolType <fgcolor=cBlack, bgcolor=cRed>; // 0
|
||
|
||
local int leftover = HeaderLength - 350001;
|
||
/*if(HeaderLength == 350013) // VLR
|
||
{
|
||
uint Unknown <fgcolor=cBlack, bgcolor=cRed>; // 350054
|
||
ubyte Unknown1[8] <fgcolor=cBlack, bgcolor=cRed>;
|
||
leftover -= 12;
|
||
}*/
|
||
|
||
|
||
if(leftover > 0)
|
||
{
|
||
ubyte LeftOvers[leftover] <fgcolor=cBlack, bgcolor=cRed>;
|
||
}
|
||
} header;
|
||
|
||
struct LAYER_DEF {
|
||
ushort Mark <fgcolor=cBlack, bgcolor=cYellow>; // (OD OA begins, indicating that the model + support is included; the beginning of 0D 0B, indicating that the layer only has support data)
|
||
uint NumberOfLines <fgcolor=cBlack, bgcolor=cYellow>;
|
||
ushort StartY <fgcolor=cBlack, bgcolor=cYellow>;
|
||
|
||
local long currentPos = FTell();
|
||
local long rleSize = 0;
|
||
|
||
if (NumberOfLines > 0)
|
||
{
|
||
local byte buffer;
|
||
local byte slen;
|
||
while(!FEof())
|
||
{
|
||
buffer = ReadByte();
|
||
if ((buffer & 0x01) == 0x01) // It's a run
|
||
{
|
||
FSkip(1);
|
||
slen = ReadByte();
|
||
if (buffer == 0x0D && (slen == 0x0A || slen == 0x0B))
|
||
{
|
||
break;
|
||
}
|
||
|
||
FSkip(1);
|
||
rleSize += 2;
|
||
|
||
if ((slen & 0x80) == 0) {}
|
||
else if ((slen & 0xc0) == 0x80)
|
||
{
|
||
rleSize++;
|
||
FSkip(1);
|
||
}
|
||
else if ((slen & 0xe0) == 0xc0)
|
||
{
|
||
rleSize += 2;
|
||
FSkip(2);
|
||
}
|
||
else if ((slen & 0xf0) == 0xe0)
|
||
{
|
||
rleSize += 3;
|
||
FSkip(3);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
rleSize++;
|
||
FSkip(1);
|
||
}
|
||
}
|
||
FSeek(currentPos);
|
||
ubyte RLE[rleSize] <fgcolor=cBlack, bgcolor=cWhite>;
|
||
}
|
||
};
|
||
|
||
|
||
|
||
FSeek(header.HeaderLength);
|
||
|
||
struct LAYERS {
|
||
|
||
local int i = 0;
|
||
for( i = 0; i < header.LayerCount; i++ ){
|
||
LAYER_DEF layerDef <fgcolor=cBlack, bgcolor=cYellow>;
|
||
}
|
||
|
||
} layers;
|