Learning git and dbc

1) How to use git

Command line instructions
You can also upload existing files from your computer using the instructions below.
Git global setup
git config --global user.name "username"
git config --global user.email "[email protected]"
Create a new repository

cd edr
touch README.md
git add README.md
git commit -m "add README"
git push -u origin main
Push an existing folder
cd existing_folder
git init

git add .
git commit -m "Initial commit"
git push -u origin main
Push an existing Git repository
cd existing_repo
git remote rename origin old-origin

git push -u origin --all
git push -u origin --tags

2) Learning dbc

BS_ 波特率设置
BU_ 网络节点定义
BO_ 报文帧消息,巧记方法: BAO,是报的读音,所以也报文帧消息关键字;
SG_ 信号

版本与新符号 version&NS_
波特率定义 BS_
网络节点定义 BU_;如BU_: node7 node6 node5
报文帧定义 BO_
信号定义	SG_
注释部分 CM_
属性定义 两种: BA_DEF_ 属性定义; BA_DEF_DEF_ 定义属性初始值;
数值表定义 VAL_;


BO_ 897 TimeSync: 64 Vector__XXX  
BA_DEF_DEF_为关键字,表示定义属性的初始值;
https://blog.csdn.net/weixin_44536482/article/details/89030152 //dbc文件格式说明

发下旋球就是相当于拿水瓢蒯水的感觉;

3) Use of cin.ignore

//清除以回车结束的输入缓冲区的内容,消除上一次输入对下一次输入的影响
    //案例:cin.ignore(1024, ‘\n'); 通常把第一个参数设置得足够大,这样实际上是为了只有第二个参数 ‘\n’ 起作用,
    //所以这一句就是把回车(包括回车)之前的所以字符从输入缓冲流中清除出去
    in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

4) Use cases where the subclass is used as actual parameters and the parent class is used as formal parameters:

class A
{
    
    
public:
    int a_ = 10;
};
class B : public A
{
    
    
public:
    int b_ = 20;
};
//如果形参是父类,而实参是子类,临时对象构造时只会构造父类的部分,而不会构造子类的任何特有的部分;
void func(A aa) //只能输出a_,不能输出b_;
{
    
    
    cout<<aa.a_<<endl;
}
int main(int argc, char** argv)
{
    
    
    B bobj;
    func(bobj);
    return 0;
}

Guess you like

Origin blog.csdn.net/qq_30143193/article/details/132971389