Exemplo n.º 1
0
        public CustomCodeGroups()
        {
            // Obtain references to the main application's objects, devices and members. (See MCF Dev Guide.)
            FCodeGroupFolder gcodes = (FCodeGroupFolder)FObject.GetRef("GCodes");
            FCodeGroupFolder mcodes = (FCodeGroupFolder)FObject.GetRef("MCodes");

            controller = FDevice.GetRef("Controller");

            MainProgram          = FFile.GetRef("NcFile.MainProgram");
            MainProgram.Changed += MainProgram_Changed;  // Hint: tab twice after you type the "+=" for some VS magic!

            theIniFile.TheFile = g.ApplicationDirectory + @"\PowerPmacNC.ini";

            // Add G-code groups:
            // - the order of items below will determine the order they display in the Machine View list of Gcode Groups
            //new FCodeGroup<ECustomGGroup>(gcodes, controller, "CustomGGroup", "Custom G-code group", ECustomGGroup.None);

            // Add M-code groups:
            // - the order of items below will determine the order they display in the Machine View list of Mcode Groups
            //new FCodeGroup<ECustomMGroup>(mcodes, controller, "CustomMGroup", "Custom M-code group", ECustomMGroup.M200);
            OutfileLoggingGroup = new FCodeGroup <EOutfileLoggingGroup>(mcodes, controller, "OutfileLoggingGroup", "Locator Pins M-code group", EOutfileLoggingGroup.M31);
            HoldDownsGroup      = new FCodeGroup <EHoldDownsGroup>(mcodes, controller, "HoldDownsGroup", "Hold Downs M-code group", EHoldDownsGroup.M41);
            LocatorPinsGroup    = new FCodeGroup <ELocatorPinsGroup>(mcodes, controller, "LocatorPinsGroup", "Locator Pins M-code group", ELocatorPinsGroup.M51);

            // Handlers (if needed) to react to a G-Mcode group changing
            //HoldDownsGroup.Changed += HoldDownsGroup_Changed;  // add a Changed handler
            OutfileLoggingGroup.Changed += OutfileLoggingGroup_Changed;  // add a Changed handler

            //go to INI file to get user set parameters for Outfile processing
            // - these are in the "PowerPmacNC.ini" file on the main NC14 application
            // - these are in the section [Router_Addin] of Ini file
            OutfilePath       = theIniFile.GetValue("Router_Addin", "OutfilePath", "C:\\Outfile\\");
            OutfileName       = theIniFile.GetValue("Router_Addin", "OutfileName", "Outfile.txt");
            OutfileDelimiter  = theIniFile.GetValue("Router_Addin", "OutfileDelimiter", ",");
            MachineName       = theIniFile.GetValue("Router_Addin", "MachineName", "Watoga");
            AvgFeedrateEnable = theIniFile.GetValue("Router_Addin", "AvgFeedrateEnable", "1");
            AvgOverideEnable  = theIniFile.GetValue("Router_Addin", "AvgOverideEnable", "1");


            //Key Down Handler defined
            g.theMachine.KeyDown += OnKeyDown;
        }
Exemplo n.º 2
0
        public CustomObject(FObject Owner)
            : base(Owner, "CustomObject")
        {
            //DisplayName = "Custom Object";
            DisplayName = "CNC Router";

            Description = "Use this Custom Object as a starting point for your development.";
            Image       = new BitmapImage(new Uri("/PPNC_Router_Addin;component/Images/stingray.png", UriKind.Relative)); // 24x24 PNG

            // Obtain references to the main application's objects, devices and members, and attach Changed handlers.
            // (See MCF Dev Guide.)
            theController = FDevice.GetRef("Controller");
            AxesDisplay   = FMember.GetRef("Axes.Display");
            AxesDisplay.ChangedAsString += AxesDisplay_ChangedAsString;



            // Device members created here will appear in Machine View in the main application.  (See MCF Dev Guide.)
            // FDeviceBoolean, FDeviceInteger, FDeviceFloat, FDeviceDouble, FDeviceString, FDeviceList<T>, FDeviceFile.
            // The PMAC variables and update rates are specified in this project's "DeviceMembers.xml" file.

            var ToolNumberInSpindle = new FDeviceInteger(this, theController, "Tool Number In Spindle", "P821", 500, EMemberCategory.Setting)
            {
                Description = "Tool Number NOW in Spindle."
            };

            var PowerPendantEnabled = new FDeviceBoolean(this, theController, "PowerPendantEnabled", "P820", 500, EMemberCategory.Setting)
            {
                Description = "This boolean highlights one of the two buttons on \"Custom Page\"."
            };

            var XaxisParkPosition = new FDeviceDouble(this, theController, "XAxisParkPositionInch", "P822", 500, EMemberCategory.Setting)
            {
                Description = "X Axis Park Position in Absolute Machine Inches."
            };
            var YaxisParkPosition = new FDeviceDouble(this, theController, "YAxisParkPositionInch", "P823", 500, EMemberCategory.Setting)
            {
                Description = "Y Axis Park Position in Absolute Machine Inches."
            };
            var ZaxisParkPosition = new FDeviceDouble(this, theController, "ZAxisParkPositionInch", "P824", 500, EMemberCategory.Setting)
            {
                Description = "Z Axis Park Position in Absolute Machine Inches."
            };
            var XaxisParkSpeed = new FDeviceDouble(this, theController, "XAxisParkSpeedIpm", "P825", 500, EMemberCategory.Setting)
            {
                Description = "X Axis Park Speed (In/Min)"
            };
            var YaxisParkSpeed = new FDeviceDouble(this, theController, "YAxisParkSpeedIpm", "P826", 500, EMemberCategory.Setting)
            {
                Description = "Y Axis Park Speed (In/Min)"
            };
            var ZaxisParkSpeed = new FDeviceDouble(this, theController, "ZAxisParkSpeedIpm", "P827", 500, EMemberCategory.Setting)
            {
                Description = "Z Axis Park Speed (In/Min)"
            };
            var XAwayPos = new FDeviceDouble(this, theController, "XAwayPosInch", "P828", 500, EMemberCategory.Setting)
            {
                Description = "X Axis Away from Park Inches (Pins Go Down)"
            };
            var SheetZeroOffset = new FDeviceDouble(this, theController, "SheetZeroOffsetInch", "P829", 500, EMemberCategory.Setting)
            {
                Description = "X Distance to Start of Sheet (Inches)"
            };
            var SheetLength = new FDeviceDouble(this, theController, "SheetLengthInch", "P830", 500, EMemberCategory.Setting)
            {
                Description = "Sheet Length Default (Inches)"
            };

            var Roller1MinPos = new FDeviceDouble(this, theController, "Roller1MinPosInch", "P831", 500, EMemberCategory.Setting)
            {
                Description = "Roller 1 Min Position Inches"
            };
            var Roller1MaxPos = new FDeviceDouble(this, theController, "Roller1MaxPos", "P832", 500, EMemberCategory.Setting)
            {
                Description = "Roller 1 Max Position Inches"
            };
            var Roller2MinPos = new FDeviceDouble(this, theController, "Roller2MinPos", "P833", 500, EMemberCategory.Setting)
            {
                Description = "Roller 2 Min Position Inches"
            };
            var Roller2MaxPos = new FDeviceDouble(this, theController, "Roller2MaxPos", "P834", 500, EMemberCategory.Setting)
            {
                Description = "Roller 2 Max Position Inches"
            };
            var Roller3MinPos = new FDeviceDouble(this, theController, "Roller3MinPos", "P835", 500, EMemberCategory.Setting)
            {
                Description = "Roller 3 Min Position Inches"
            };
            var Roller3MaxPos = new FDeviceDouble(this, theController, "Roller3MaxPos", "P836", 500, EMemberCategory.Setting)
            {
                Description = "Roller 3 Max Position Inches"
            };
            var Roller4MinPos = new FDeviceDouble(this, theController, "Roller4MinPos", "P837", 500, EMemberCategory.Setting)
            {
                Description = "Roller 4 Min Position Inches"
            };
            var Roller4MaxPos = new FDeviceDouble(this, theController, "Roller4MaxPos", "P838", 500, EMemberCategory.Setting)
            {
                Description = "Roller 4 Max Position Inches"
            };
        }