v5-rc2
Все изменения в CHANGELOG.md
This commit is contained in:
parent
766bb1a985
commit
ae07549e1b
32 changed files with 118162 additions and 33235 deletions
|
@ -10,6 +10,7 @@ type
|
|||
|
||||
type
|
||||
TStatorParams = record
|
||||
StatorName: String;
|
||||
BaseDiameter: Double;
|
||||
BaseRadius: Double;
|
||||
NumberOfRays: Integer;
|
||||
|
@ -32,7 +33,15 @@ type
|
|||
WorkSpeed :integer;
|
||||
end;
|
||||
|
||||
type
|
||||
TLayer = record
|
||||
Turns: Integer; // Êîëè÷åñòâî âèòêîâ
|
||||
StartX: double; // Íà÷àëüíàÿ êîîðäèíàòà
|
||||
EndX: double; // Êîíå÷íàÿ êîîðäèíàòà
|
||||
end;
|
||||
|
||||
var
|
||||
StartTime, EndTime, ExecutionTime: TDateTime;
|
||||
InputFileName, OutputFileName: string;
|
||||
StatorParams: TStatorParams;
|
||||
InFile, OutFile: TextFile;
|
||||
|
@ -41,6 +50,7 @@ var
|
|||
CurrentZ: double;
|
||||
coords: TPoint;
|
||||
normalizecoords: TPoint;
|
||||
Layers: array[1..10] of TLayer;
|
||||
i, j, k: Integer;
|
||||
CoilLength :double;
|
||||
CurrentCoilTurns, CoilTurnsSum :Integer;
|
||||
|
@ -51,7 +61,7 @@ var
|
|||
angle :double;
|
||||
MaxDepth,MaxPath :double;
|
||||
MoveForward:boolean;
|
||||
|
||||
OperationMode:string;
|
||||
|
||||
|
||||
function ParseLine(Line: string): Boolean;
|
||||
|
@ -69,13 +79,22 @@ var
|
|||
begin
|
||||
exit(true); // Ñòðîêà êîììåíòàðèÿ - ïðîïóñêàåì
|
||||
end;
|
||||
|
||||
Parts := SplitString(TrimmedLine, '='); // Èñïîëüçóåì TrimmedLine
|
||||
Result := Length(Parts) = 2;
|
||||
if Result then
|
||||
begin
|
||||
Value := LowerCase(Trim(Parts[1])); // Ïðèâîäèì ê íèæíåìó ðåãèñòðó
|
||||
case Trim(Parts[0]) of
|
||||
'stator_name': begin
|
||||
StatorParams.StatorName := Value;
|
||||
writeln('StatorName: ', StatorParams.StatorName);
|
||||
writeln();
|
||||
end;
|
||||
'Operation_Mode': begin
|
||||
OperationMode := Value;
|
||||
writeln('Operation Mode: ', OperationMode);
|
||||
writeln();
|
||||
end;
|
||||
'base_dia': begin
|
||||
StatorParams.BaseDiameter := StrToFloat(Value);
|
||||
writeln('Base Diameter: ', StatorParams.BaseDiameter:8:2);
|
||||
|
@ -293,6 +312,7 @@ end;
|
|||
|
||||
begin
|
||||
// Command line argument handling
|
||||
StartTime := Now;
|
||||
if ParamCount < 2 then
|
||||
begin
|
||||
Writeln('Usage: GCodeGenerator <input_file.txt> <output_file.gcode>');
|
||||
|
@ -308,6 +328,7 @@ begin
|
|||
try
|
||||
Rewrite(OutFile);
|
||||
// *** Your G-code generation logic here ***
|
||||
writeln(OutFile, ';Generate G-code file for ',StatorParams.StatorName,' stator. At ',FormatDateTime('dd.mm.yyyy hh:nn:ss.zzz', StartTime));
|
||||
writeln(OutFile, '; G-code for stator winding');
|
||||
writeln(OutFile, 'G90 ; Absolute coordinate system');
|
||||
writeln(OutFile, 'G1 Y-10');
|
||||
|
@ -515,8 +536,9 @@ begin
|
|||
end;
|
||||
end;
|
||||
CloseFile(OutFile);
|
||||
|
||||
writeln('G-code generated to: ', OutputFileName);
|
||||
EndTime := Now;
|
||||
ExecutionTime := EndTime - StartTime;
|
||||
writeln('G-code generated to: ', OutputFileName, ' in ', FormatFloat('0.000', ExecutionTime * 86400), ' seconds.');
|
||||
writeln('Press Enter... ');
|
||||
Readln;
|
||||
end.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue