Ejemplo n.º 1
0
        //public event QualityHandler OnQuality;

        #endregion

        public Calibration(Client cli)
        {
            client = cli;

            // Set default parameters
            calParams = new CalibrationParameters();
            calParams.SetDefaultParameters();
        }
Ejemplo n.º 2
0
        //public event QualityHandler OnQuality;

        #endregion

        public Calibration(Client cli)
        {
            client = cli;

            // Set default parameters
            calParams = new CalibrationParameters();
            calParams.SetDefaultParameters();
        }
Ejemplo n.º 3
0
        public void ExtractParametersFromString(string parameterStr)
        {
            // Seperating commands
            char[]   sepCalibrationParameters = { ',' };
            string[] calibrationParams        = parameterStr.Split(sepCalibrationParameters, 20);

            // Seperating values/parameters
            char[] sepValues = { '=' };

            var calParams = new CalibrationParameters();

            for (int i = 0; i < calibrationParams.Length; i++)
            {
                string[] cmdString = calibrationParams[i].Split(sepValues, 5);
                string   subCmdStr = cmdString[0];
                string   value     = cmdString[1];

                switch (subCmdStr)
                {
                case strNumberOfPoints:
                    NumberOfPoints = int.Parse(value);
                    break;

                case strSpeed:
                    Speed = double.Parse(value);
                    break;

                case strBackgroundColor:
                    BackgroundColor = Converter.GetColorFromString(value);
                    break;

                case strPointColor:
                    PointColor = Converter.GetColorFromString(value);
                    break;

                case strUseInfantGraphics:
                    UseInfantGraphics = bool.Parse(value);
                    break;

                case strRandomizePointOrder:
                    RandomizePointOrder = bool.Parse(value);
                    break;

                case strAutoAcceptPoints:
                    AutoAcceptPoints = bool.Parse(value);
                    break;

                case strWaitForValidData:
                    WaitForValidData = bool.Parse(value);
                    break;
                }
            }
        }
Ejemplo n.º 4
0
 public void CalibrationParameters(CalibrationParameters calParams)
 {
     client.SendCommand(Commands.CalibrationParameters, calParams.ParametersAsString);
 }
Ejemplo n.º 5
0
        public void ExtractDataAndRaiseEvent(string data)
        {
            char[] seperator = {' '};
            string[] cmd = data.Split(seperator, 5);
            string command = cmd[0];

            string parameters = "";

            if (cmd.Length > 1)
                parameters = cmd[1];

            switch (command)
            {
                case Commands.CalibrationStart:
                    if (OnStart != null)
                        OnStart(Int32.Parse(parameters)); // Number of points
                    break;

                case Commands.CalibrationAcceptPoint:
                    // No returning parameter/data 
                    break;

                case Commands.CalibrationAbort:
                    if (OnAbort != null)
                        OnAbort(true);
                    break;

                case Commands.CalibrationPointChange:
                    //OnCalibrationPointChange(Int32.Parse(cmd[1])); // Next point number
                    break;

                case Commands.CalibrationParameters:
                    if (OnParameters != null)
                    {
                        var calParams = new CalibrationParameters();
                        calParams.ExtractParametersFromString(parameters);
                        OnParameters(calParams);
                    }
                    break;

                case Commands.CalibrationAreaSize:
                    break;

                case Commands.CalibrationDefault:
                    break;

                case Commands.CalibrationEnd:
                    if (OnEnd != null)
                        OnEnd(Int32.Parse(parameters));
                    break;

                case Commands.CalibrationCheckLevel:
                    if (OnCheckLevel != null)
                        OnCheckLevel(Int32.Parse(parameters));
                    break;

                case Commands.CalibrationPoint:
                    break;

                case Commands.CalibrationStartDriftCorrection:
                    break;

                case Commands.CalibrationValidate:
                    if (OnValidate != null)
                        OnValidate(cmd[1], double.Parse(cmd[2]), double.Parse(cmd[3]), double.Parse(cmd[4]));
                    break;
            }
        }
Ejemplo n.º 6
0
 public void CalibrationParameters(CalibrationParameters calParams)
 {
     client.SendCommand(Commands.CalibrationParameters, calParams.ParametersAsString);
 }
Ejemplo n.º 7
0
        public void ExtractDataAndRaiseEvent(string data)
        {
            char[]   seperator = { ' ' };
            string[] cmd       = data.Split(seperator, 5);
            string   command   = cmd[0];

            string parameters = "";

            if (cmd.Length > 1)
            {
                parameters = cmd[1];
            }

            switch (command)
            {
            case Commands.CalibrationStart:
                if (OnStart != null)
                {
                    OnStart(Int32.Parse(parameters));     // Number of points
                }
                break;

            case Commands.CalibrationAcceptPoint:
                // No returning parameter/data
                break;

            case Commands.CalibrationAbort:
                if (OnAbort != null)
                {
                    OnAbort(true);
                }
                break;

            case Commands.CalibrationPointChange:
                //OnCalibrationPointChange(Int32.Parse(cmd[1])); // Next point number
                break;

            case Commands.CalibrationParameters:
                if (OnParameters != null)
                {
                    var calParams = new CalibrationParameters();
                    calParams.ExtractParametersFromString(parameters);
                    OnParameters(calParams);
                }
                break;

            case Commands.CalibrationAreaSize:
                break;

            case Commands.CalibrationDefault:
                break;

            case Commands.CalibrationEnd:
                if (OnEnd != null)
                {
                    OnEnd(Int32.Parse(parameters));
                }
                break;

            case Commands.CalibrationCheckLevel:
                if (OnCheckLevel != null)
                {
                    OnCheckLevel(Int32.Parse(parameters));
                }
                break;

            case Commands.CalibrationPoint:
                break;

            case Commands.CalibrationStartDriftCorrection:
                break;

            case Commands.CalibrationValidate:
                if (OnValidate != null)
                {
                    OnValidate(cmd[1], double.Parse(cmd[2]), double.Parse(cmd[3]), double.Parse(cmd[4]));
                }
                break;
            }
        }
Ejemplo n.º 8
0
 private void tcpipServer_OnCalibrationParameters(CalibrationParameters calParams)
 {
   // Todo: Should be sent from the tracker after applying settings everywhere..
   Tracker.Instance.Server.SendMessage(Commands.CalibrationParameters, calParams.ParametersAsString);
 }
Ejemplo n.º 9
0
        public void ExtractParametersFromString(string parameterStr)
        {
            // Seperating commands
            char[] sepCalibrationParameters = {','};
            string[] calibrationParams = parameterStr.Split(sepCalibrationParameters, 20);

            // Seperating values/parameters
            char[] sepValues = {'='};

            var calParams = new CalibrationParameters();

            for (int i = 0; i < calibrationParams.Length; i++)
            {
                string[] cmdString = calibrationParams[i].Split(sepValues, 5);
                string subCmdStr = cmdString[0];
                string value = cmdString[1];

                switch (subCmdStr)
                {
                    case strNumberOfPoints:
                        NumberOfPoints = int.Parse(value);
                        break;

                    case strSpeed:
                        Speed = double.Parse(value);
                        break;

                    case strBackgroundColor:
                        BackgroundColor = Converter.GetColorFromString(value);
                        break;

                    case strPointColor:
                        PointColor = Converter.GetColorFromString(value);
                        break;

                    case strUseInfantGraphics:
                        UseInfantGraphics = bool.Parse(value);
                        break;

                    case strRandomizePointOrder:
                        RandomizePointOrder = bool.Parse(value);
                        break;

                    case strAutoAcceptPoints:
                        AutoAcceptPoints = bool.Parse(value);
                        break;

                    case strWaitForValidData:
                        WaitForValidData = bool.Parse(value);
                        break;
                }
            }
        }