コード例 #1
0
        /// <summary>Get array of data map types</summary>
        /// <returns>Array of unsigned 32-bit-values of data map types</returns>
        public HJS.ECU.Firmware.KennfeldTyp[] GetDatamapTypes()
        {
            HJS.ECU.Firmware.KennfeldTyp[] ret = new HJS.ECU.Firmware.KennfeldTyp[0];

            for (int TaskPos = 0; TaskPos < mTaskAnzahl; TaskPos++)
            {
                for (int ItemPos = 0; ItemPos < maTask[TaskPos].GetNumber(); ItemPos++)
                {
                    if (maTask[TaskPos].GetItemType(ItemPos) == TaskDataType.type_kf_type_8)
                    {
                        if ((maTask[TaskPos].GetTaskId() == TaskIdentifier.taskCanIn) &&
                            (maTask[TaskPos].GetItemName(ItemPos) == "eTypDerating"))
                        {
                            // ignore data map type without data map identifier
                        }
                        else if ((maTask[TaskPos].GetTaskId() == TaskIdentifier.taskCanIn) &&
                                 (maTask[TaskPos].GetItemName(ItemPos) == "eTypNoxSensor"))
                        {
                            // ignore data map type without data map identifier
                        }
                        else
                        {
                            Array.Resize(ref ret, ret.Length + 1);
                            ret[ret.Length - 1] = (HJS.ECU.Firmware.KennfeldTyp)maTask[TaskPos].GetItemValue(ItemPos);
                        }
                    }
                }
            }
            return(ret);
        }
コード例 #2
0
        /// <summary>Default constructor</summary>
        public EditDatamapForm(UInt32 Id, HJS.ECU.Firmware.KennfeldTyp Type, byte Dim,
                               Int16 XStart, Int16 XSize, UInt16 XSteps, Int16 YStart, Int16 YSize, UInt16 YSteps,
                               Int16 ZStart, Int16 ZSize, UInt16 ZSteps, Array DatamapTypes)
        {
            InitializeComponent();

            Identifier = Id;
            Dimension  = Dim;
            X_Start    = XStart;
            X_Size     = XSize;
            Y_Start    = YStart;
            Y_Size     = YSize;
            Z_Start    = ZStart;
            Z_Size     = ZSize;
            X_Steps    = XSteps;
            Y_Steps    = YSteps;
            Z_Steps    = ZSteps;
            KfType     = (byte)Type;
            mEnm       = DatamapTypes;

            int sel = 0; int i = 0;

            foreach (object obj in DatamapTypes)
            {
                comboBoxType.Items.Add(obj.ToString());
                if ((HJS.ECU.Firmware.KennfeldTyp)obj == Type)
                {
                    sel = i;
                }
                i++;
            }
            comboBoxType.SelectedIndex   = sel;
            textBoxIdentifier.Text       = Identifier.ToString();
            numericUpDownDimension.Value = Dimension;
            if (Dimension < 2)
            {
                groupBox_Z.Enabled = false;
            }
            if (Dimension < 1)
            {
                groupBox_Y.Enabled = false;
            }
            numericUpDown_X_Start.Value    = (UInt16)X_Start;
            numericUpDown_X_Stepsize.Value = (UInt16)X_Size;
            numericUpDown_X_Steps.Value    = X_Steps;
            numericUpDown_Y_Start.Value    = (UInt16)Y_Start;
            numericUpDown_Y_Stepsize.Value = (UInt16)Y_Size;
            numericUpDown_Y_Steps.Value    = Y_Steps;
            numericUpDown_Z_Start.Value    = (UInt16)Z_Start;
            numericUpDown_Z_Stepsize.Value = (UInt16)Z_Size;
            numericUpDown_Z_Steps.Value    = Z_Steps;
        }
コード例 #3
0
 /// <summary>Allow data map type</summary>
 /// <param name="type">Allowed data map type</param>
 public void AllowDataMapType(HJS.ECU.Firmware.KennfeldTyp type)
 {
     if (mDataMapTypes == null)
     {
         mDataMapTypes    = new Firmware.KennfeldTyp[1];
         mDataMapTypes[0] = type;
     }
     else
     {
         Array.Resize(ref mDataMapTypes, mDataMapTypes.Length + 1);
         mDataMapTypes[mDataMapTypes.Length - 1] = type;
     }
 }
コード例 #4
0
 /// <summary>Check if data map type is valid for task item</summary>
 /// <param name="type">Required typ</param>
 /// <returns>True if required type is valid for task item</returns>
 public bool IsDataMapTypeValid(HJS.ECU.Firmware.KennfeldTyp type)
 {
     if (mDataMapTypes == null)
     {
         return(false);
     }
     for (int i = 0; i < mDataMapTypes.Length; i++)
     {
         if (mDataMapTypes[i] == type)
         {
             return(true);
         }
     }
     return(false);
 }