@@ -152,23 +152,6 @@ public override void OpenJob(string filename, IFileReaderWriterProgress progress
152152
153153 private void ParseGCodeFile ( )
154154 {
155- Dictionary < int , MarkingParams > _markingParamsMap = new Dictionary < int , MarkingParams >
156- {
157- // {LaserSpeedInMmPerSec, LinearInterpolationCommand.feedRate where isOperation = true}
158- // {JumpSpeedInMmPerSec, LinearInterpolationCommand.feedRate where isOperation = false}
159- // {FurtherMarkingParams, Acceleration}
160- // {FurtherMarkingParams, ToolParams}
161- // {FurtherMarkingParams, RemainingParameters}
162- // {FurtherMarkingParams, RecordedParameters}
163- } ;
164-
165- Dictionary < Type , Func < VectorBlock . VectorDataOneofCase > > vectorDataMap = new Dictionary < Type , Func < VectorBlock . VectorDataOneofCase > >
166- {
167- //{typeof(LinearInterpolationCmd), () => new LinearInterpolationCmd()},
168- //{typeof(CircularInterpolationCmd), () => new CircularInterpolationCmd()},
169- //{typeof(PauseCommand), () => new PauseCommand()},
170- //{typeof(MiscCommand), () => new MiscCommand()}
171- } ;
172155 _workPlane = new WorkPlane
173156 {
174157 WorkPlaneNumber = 0 ,
@@ -191,49 +174,15 @@ private void ParseGCodeFile()
191174 {
192175 bool [ ] objectUpdates = gCodeState . Update ( commandLine ) ;
193176 bool workingPlaneChanged = objectUpdates [ 0 ] , markingParamsChanged = objectUpdates [ 1 ] , vectorBlockChanged = objectUpdates [ 2 ] ;
194- if ( gCodeState . Update ( commandLine ) )
195- {
196- switch ( gCodeState . gCodeCommand )
197- {
198- case LinearInterpolationCmd linearCmd :
199- _currentVectorBlock . Vector
200- break ;
201177
202- case CircularInterpolationCmd circularCmd :
203- break ;
204-
205- case PauseCommand pauseCmd :
206- break ;
207-
208- case MiscCommand miscCommand :
209- break ;
210- }
211- }
212- else
178+ if ( workingPlaneChanged )
213179 {
214- switch ( gCodeState . gCodeCommand )
180+ _workPlane = new WorkPlane
215181 {
216- case LinearInterpolationCmd linearCmd :
217- _currentVectorBlock . LineSequence . Points . Add ( ( float ) linearCmd . xPosition ) ;
218- _currentVectorBlock . LineSequence . Points . Add ( ( float ) linearCmd . yPosition ) ;
219- break ;
220-
221- case CircularInterpolationCmd circularCmd :
222- _currentVectorBlock . Arcs . Centers . Add ( ( float ) circularCmd . xCenterRel ) ;
223- _currentVectorBlock . Arcs . Centers . Add ( ( float ) circularCmd . yCenterRel ) ;
224- break ;
225-
226- case PauseCommand pauseCmd :
227- _currentVectorBlock . ExposurePause . PauseInUs = ( ulong ) pauseCmd . duration * 1000 ;
228- break ;
229-
230- case MiscCommand miscCommand :
231- //_currentMarkingParams._unknownFields
232- break ;
233- }
234-
182+ WorkPlaneNumber = _workPlane . WorkPlaneNumber + 1 ,
183+ ZPosInMm = gCodeState . position . Z
184+ } ;
235185 }
236-
237186 }
238187 _cacheState = CacheState . CompleteJobCached ;
239188
0 commit comments