/*
         GCode Process for building 3d DVP UV objects
         
         * <Build Start>
         * <Slicing Comments> comments containing the slicing and building parameters
         * <Header Code> start.gcode - commands from this 
         * file are inserted, they contain whatever intiailization sequences are need to initialize the machine
         * at this point, the build tray is in position to start printing a layer
         * <Layer Start>
         * Display the correct image slice for the current layer
         * Delay for <Layertime> to expose the UV resin
         * <Layer End>
         
         
        */

        // here we prepare the gcode preprocessor and fill all nessesary variables 
        protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi)
        {
            PreProcessor pp = new PreProcessor();
            pp.SetVar("$LayerThickness", sf.m_config.ZThick); // the thickenss of the layer in mm
            pp.SetVar("$ZLiftDist", sf.m_config.liftdistance); // how far we're lifting
            pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate); // the rate at which we're lifting
            pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate); // how fast we'r retracting
            pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval); // any used slide / tilt value on the x axis
            pp.SetVar("$BlankTime", sf.m_config.blanktime_ms); // how long to show the blank in ms
            pp.SetVar("$LayerTime", sf.m_config.layertime_ms); // total delay for a layer for gcode commands to complete - not including expusre time
            pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms); // time to expose the first layers in ms
            pp.SetVar("$NumFirstLayers", sf.m_config.numfirstlayers); // number of first layers
            return pp;
        }
        /*
         GCode Process for building 3d DVP UV objects

         * <Build Start>
         * <Slicing Comments> comments containing the slicing and building parameters
         * <Header Code> start.gcode - commands from this
         * file are inserted, they contain whatever intiailization sequences are need to initialize the machine
         * at this point, the build tray is in position to start printing a layer
         * <Layer Start>
         * Display the correct image slice for the current layer
         * Delay for <Layertime> to expose the UV resin
         * <Layer End>

        */
        // here we prepare the gcode preprocessor and fill all nessesary variables
        protected static PreProcessor PreparePreprocessor(SliceFile sf, MachineConfig pi)
        {
            PreProcessor pp = new PreProcessor();
            pp.SetVar("$LayerThickness", sf.m_config.ZThick);
            pp.SetVar("$ZLiftDist", sf.m_config.liftdistance);
            pp.SetVar("$ZLiftRate", sf.m_config.liftfeedrate);
            pp.SetVar("$ZRetractRate", sf.m_config.liftretractrate);
            pp.SetVar("$SlideTiltVal", sf.m_config.slidetiltval);
            pp.SetVar("$BlankTime", sf.m_config.blanktime_ms);
            pp.SetVar("$LayerTime", sf.m_config.layertime_ms);
            pp.SetVar("$FirstLayerTime", sf.m_config.firstlayertime_ms);
            return pp;
        }