DESIGN.RetagRemovalProject

From Compost Wiki
Jump to navigation Jump to search

Overview

Retag is not a good way to use line numbers in posts. It requires many special characters and is confusing to many post developers. There are better and more modern ways of handling it.

Uses

Retag is used for 2 things, turning canned cycles and mill sub routines.


Replacement

To replace retag we simply need the ability to push line numbers to a stack and pop them off, as well as the ability to take the last closed sub and merge it into the current output stream.

Turning Canned Cycles Code

 TurnCannedCycle:
   
   PushSeqLabC {Save the current line number so that it can be used before the canned cycle call,and increment like we had called EOL}
   
   SaveTPStartSeq { save the current seq number and associate it with the op's toolpath start}
   
   {throw the toolpath into a sub}
   OpenSub
   Toolpath {this will call Seq for the first and last toolpath line of the canned path }
   CloseSub
   
   SaveTPEndSeq {this will save the last seq number and assoicate it with the op's toolpath end }
   
   {output the canned cycle line with the saved seq number if we are doing line nubmers}
   PopSeqLabC Lcycle doCycleStart 'L' GetTPStartSeq# 'P' GetTPEndSeq# EOL
   
   {take the last closed sub and output it to the current output stream and remove it from the concat list}
   FlushLastSub
   doCycleExitStuff
   
 RETURN

Description

By keeping a stack of saved sequence numbers we can allow the lines that call subroutines to be output AFTER the sub is generated. By allowing the contact process to be overwriten and the items merged right now it lets the code be inline. since the line numbers are a stack this can be used for nested subs. The start and stop line numbers do not need to be a stack since nested subs will use them before then overwrite them.

The only other thing that may be needed is a version of the get commands that takes an op number so that we can do them for master ops.