Ejemplo n.º 1
0
        private void btnWriteContainerAndShelfStop_Click(object sender, EventArgs e)
        {
            this.Enabled = false;

            //create an array of the container- and shelf-stop settings for every motor-group
            VirtualHandset.ContainerShelfStopSettings[] Settings =
                new VirtualHandset.ContainerShelfStopSettings[VirtualHandset.MAX_MF_MOTOR_GROUPS];

            // build some dummy container- and shelf-stop settings for motor-group 1
            Settings[0].ContainerStopActive   = true;
            Settings[0].ContainerStopPosition = 100;
            Settings[0].ShelfStopActive       = true;
            Settings[0].ShelfStopPosition     = 500;

            // build some dummy container- and shelf-stop settings for motor-group 2
            Settings[1].ContainerStopActive   = true;
            Settings[1].ContainerStopPosition = 110;
            Settings[1].ShelfStopActive       = true;
            Settings[1].ShelfStopPosition     = 510;

            // simple flag to check if we had an error writing the memo-positions
            bool ErrorWriting = false;

            // let's write all container- and shelf-stop settings...
            if (Handset.WriteContainerAndShelfStopSetting(Settings) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only one container- and shelf-stop settings...
            if (Handset.WriteContainerAndShelfStopSetting(VirtualHandset.MotorGroup.MotorGroup1, Settings[0]) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only a container-stop setting...
            if (Handset.WriteContainerStopSetting(VirtualHandset.MotorGroup.MotorGroup1, 50, true) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only a shelf-stop setting...
            if (Handset.WriteShelfStopSetting(VirtualHandset.MotorGroup.MotorGroup1, 550, true) < 0)
            {
                ErrorWriting = true;
            }

            // check if we had at least one error
            if (ErrorWriting)
            {
                MessageBox.Show("Could not write container- and shelf-stop settings!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            this.Enabled = true;
        }
Ejemplo n.º 2
0
        private void btnWriteContainerAndShelfStop_Click(object sender, EventArgs e)
        {
            this.Enabled = false;

            //create an array of the container- and shelf-stop settings for every motor-group
            VirtualHandset.ContainerShelfStopSettings[] Settings =
                new VirtualHandset.ContainerShelfStopSettings[VirtualHandset.MAX_MF_MOTOR_GROUPS];

            // build some dummy container- and shelf-stop settings for motor-group 1
            Settings[0].ContainerStopActive = true;
            Settings[0].ContainerStopPosition = 100;
            Settings[0].ShelfStopActive = true;
            Settings[0].ShelfStopPosition = 500;

            // build some dummy container- and shelf-stop settings for motor-group 2
            Settings[1].ContainerStopActive = true;
            Settings[1].ContainerStopPosition = 110;
            Settings[1].ShelfStopActive = true;
            Settings[1].ShelfStopPosition = 510;

            // simple flag to check if we had an error writing the memo-positions
            bool ErrorWriting = false;

            // let's write all container- and shelf-stop settings...
            if (Handset.WriteContainerAndShelfStopSetting(Settings) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only one container- and shelf-stop settings...
            if (Handset.WriteContainerAndShelfStopSetting(VirtualHandset.MotorGroup.MotorGroup1, Settings[0]) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only a container-stop setting...
            if (Handset.WriteContainerStopSetting(VirtualHandset.MotorGroup.MotorGroup1, 50, true) < 0)
            {
                ErrorWriting = true;
            }

            // let's write only a shelf-stop setting...
            if (Handset.WriteShelfStopSetting(VirtualHandset.MotorGroup.MotorGroup1, 550, true) < 0)
            {
                ErrorWriting = true;
            }

            // check if we had at least one error
            if (ErrorWriting)
            {
                MessageBox.Show("Could not write container- and shelf-stop settings!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            this.Enabled = true;
        }