Example #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            foreach (LabelWithText lwt in m_ListOfLabels)
            {
                lwt.ShowValue();
            }

            //labelCurrentToolPosition.Text = "CurrentToolPosition: " + (int)m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeCurrentToolPosition);
//            labelCurrentSensor.Text = "CurrentSensor: " + m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeCurrentSensor);
//            labelUpperToolTipState.Text = "UpperToolTipState: " + m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeUpperToolTipState);
//            labelLowerToolTipState.Text = "LowerToolTipState: " + m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeLowerToolTipState);

            progressBar1.Value = (int)m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeCurrentSensor);
            int position = (int)m_ProtocolDeSerializer.GetParamValue(eSendingParamType.paramTypeCurrentToolPosition);

            position = (position > trackBarPosition.Maximum)?(trackBarPosition.Maximum):(position);
            position = (position < trackBarPosition.Minimum)?(trackBarPosition.Minimum):(position);
            trackBarPosition.Value = position;
        }
Example #2
0
        public void ShowValue()
        {
            if (label == null)
            {
                return;
            }

            if (protocolDeser == null)
            {
                label.Text = textBefore + "protocol deserialiser == null" + textAfter;
                return;
            }

            int value = (int)protocolDeser.GetParamValue(paramType);

            if (numberToText == null)
            {
                label.Text = textBefore + value + textAfter;
            }
            else
            {
                label.Text = textBefore + numberToText[value] + textAfter;
            }
        }