예제 #1
0
        public void setCarInfo(float add, float dec, float spd, int handle)
        {
            int index = 0;

            index = GetIdex.getDicOutputIndex("car01_S_ACC");
            ComTCPLib.SetOutputAsREAL32(handle, index, add);
            index = GetIdex.getDicOutputIndex("car01_S_DEC");
            ComTCPLib.SetOutputAsREAL32(handle, index, dec);
            index = GetIdex.getDicOutputIndex("car01_S_SPD");
            ComTCPLib.SetOutputAsREAL32(handle, index, spd);
        }
예제 #2
0
        //---------------------------------------------------
        #region 基本数据处理
        //type 1 uint,2 float,3 flag
        //设置数据
        public void updateValue(string name, string value, int type, int handle)
        {
            double time, timeStep;

            ComTCPLib.UpdateData(handle, out time, out timeStep);
            int index = GetIdex.getDicOutputIndex(name);

            if (type == 1)
            {
                ComTCPLib.SetOutputAsUINT(handle, index, uint.Parse(value));
            }
            else if (type == 2)
            {
                ComTCPLib.SetOutputAsREAL32(handle, index, float.Parse(value));
            }
        }