CANoe_调用C#控件的方法_DEMO方法演示

1、DEMO存放位置
D:\Users\Public\Documents\Vector\CANoe\Sample Configurations 11.0.96\CAN\MoreExamples\ActiveX_DotNET_Panels

每个人的电脑因为有区别存放位置不一样

2、控件制作--使用C#控件可以直接制作

 3、控件代码
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;namespace CSharpPanels
{public class CSharpControl : System.Windows.Forms.UserControl{// Declare typesprivate CANoe.Application         App;private CANoe.Measurement         Measurement;private CANoe.Variable            svMotorSwitch = null;private CANoe.Variable            svTurnSignal = null;private CANoe.Variable            svEngineSpeedEntry = null;private System.Windows.Forms.Timer tmrSignals;private System.Windows.Forms.GroupBox fraMotor;private System.Windows.Forms.GroupBox fraLight;private System.Windows.Forms.Label lblDriving;private System.Windows.Forms.Label lblTurn;private System.Windows.Forms.Button btnLightSwitch;private System.Windows.Forms.Button btnTurnSignal;private System.Windows.Forms.GroupBox fraEntry;private System.Windows.Forms.TrackBar sliSpeedEntry;private System.Windows.Forms.Button btnMotorSwitch;private System.Windows.Forms.Label lblCaption;/// <summary>/// Required designer variable./// </summary>private System.ComponentModel.Container components = null;public CSharpControl(){// This call is required by the Windows.Forms Form Designer.InitializeComponent();// Initialize timer to get Signal changestmrSignals = new System.Windows.Forms.Timer(components);if (tmrSignals != null){tmrSignals.Enabled = true;tmrSignals.Tick += new System.EventHandler(tmrSignals_Tick);}// Initialize typesApp            = new CANoe.Application();Measurement    = (CANoe.Measurement)App.Measurement;CANoe.System system = (CANoe.System)App.System;if (system != null){CANoe.Namespaces namespaces = (CANoe.Namespaces)system.Namespaces;if (namespaces != null){CANoe.Namespace nsEngine = (CANoe.Namespace)namespaces["Engine"];if (nsEngine != null){CANoe.Variables engineVars = (CANoe.Variables)nsEngine.Variables;if (engineVars != null){svMotorSwitch = (CANoe.Variable)engineVars["MotorSwitch"];svEngineSpeedEntry = (CANoe.Variable)engineVars["EngineSpeedEntry"];if (svMotorSwitch != null)svMotorSwitch.OnChange += new CANoe._IVariableEvents_OnChangeEventHandler(svMotorSwitch_OnChange);if (svEngineSpeedEntry != null)svEngineSpeedEntry.OnChange += new CANoe._IVariableEvents_OnChangeEventHandler(svEngineSpeedEntry_OnChange);}}CANoe.Namespace nsLights = (CANoe.Namespace)namespaces["Lights"];if (nsLights != null){CANoe.Variables lightsVars = (CANoe.Variables)nsLights.Variables;if (lightsVars != null){svTurnSignal = (CANoe.Variable)lightsVars["TurnSignal"];if (svTurnSignal != null)svTurnSignal.OnChange += new CANoe._IVariableEvents_OnChangeEventHandler(svTurnSignal_OnChange);}}}}}/// <summary>/// Clean up any resources being used./// </summary>protected override void Dispose( bool disposing ){if( disposing ){if( components != null )components.Dispose();if (tmrSignals != null)tmrSignals.Dispose();}base.Dispose( disposing );}#region Component Designer generated code/// <summary>/// Required method for Designer support - do not modify /// the contents of this method with the code editor./// </summary>private void InitializeComponent(){this.components = new System.ComponentModel.Container();this.fraMotor = new System.Windows.Forms.GroupBox();this.btnMotorSwitch = new System.Windows.Forms.Button();this.fraLight = new System.Windows.Forms.GroupBox();this.btnTurnSignal = new System.Windows.Forms.Button();this.btnLightSwitch = new System.Windows.Forms.Button();this.lblTurn = new System.Windows.Forms.Label();this.lblDriving = new System.Windows.Forms.Label();this.fraEntry = new System.Windows.Forms.GroupBox();this.sliSpeedEntry = new System.Windows.Forms.TrackBar();this.lblCaption = new System.Windows.Forms.Label();this.fraMotor.SuspendLayout();this.fraLight.SuspendLayout();this.fraEntry.SuspendLayout();((System.ComponentModel.ISupportInitialize)(this.sliSpeedEntry)).BeginInit();this.SuspendLayout();// // fraMotor// this.fraMotor.Controls.Add(this.btnMotorSwitch);this.fraMotor.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraMotor.Location = new System.Drawing.Point(8, 32);this.fraMotor.Name = "fraMotor";this.fraMotor.Size = new System.Drawing.Size(104, 72);this.fraMotor.TabIndex = 0;this.fraMotor.TabStop = false;this.fraMotor.Text = "Motor Switch";// // btnMotorSwitch// this.btnMotorSwitch.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.btnMotorSwitch.Location = new System.Drawing.Point(24, 32);this.btnMotorSwitch.Name = "btnMotorSwitch";this.btnMotorSwitch.Size = new System.Drawing.Size(56, 25);this.btnMotorSwitch.TabIndex = 0;this.btnMotorSwitch.Text = "Off";this.btnMotorSwitch.Click += new System.EventHandler(this.btnMotorSwitch_Click);// // fraLight// this.fraLight.Controls.Add(this.btnTurnSignal);this.fraLight.Controls.Add(this.btnLightSwitch);this.fraLight.Controls.Add(this.lblTurn);this.fraLight.Controls.Add(this.lblDriving);this.fraLight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraLight.Location = new System.Drawing.Point(120, 32);this.fraLight.Name = "fraLight";this.fraLight.Size = new System.Drawing.Size(136, 72);this.fraLight.TabIndex = 1;this.fraLight.TabStop = false;this.fraLight.Text = "Light Switch";// // btnTurnSignal// this.btnTurnSignal.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.btnTurnSignal.Location = new System.Drawing.Point(78, 38);this.btnTurnSignal.Name = "btnTurnSignal";this.btnTurnSignal.Size = new System.Drawing.Size(40, 25);this.btnTurnSignal.TabIndex = 3;this.btnTurnSignal.Text = "Off";this.btnTurnSignal.Click += new System.EventHandler(this.btnTurnSignal_Click);// // btnLightSwitch// this.btnLightSwitch.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.btnLightSwitch.Location = new System.Drawing.Point(14, 38);this.btnLightSwitch.Name = "btnLightSwitch";this.btnLightSwitch.Size = new System.Drawing.Size(40, 25);this.btnLightSwitch.TabIndex = 2;this.btnLightSwitch.Text = "Off";this.btnLightSwitch.Click += new System.EventHandler(this.btnLightSwitch_Click);// // lblTurn// this.lblTurn.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblTurn.Location = new System.Drawing.Point(66, 20);this.lblTurn.Name = "lblTurn";this.lblTurn.Size = new System.Drawing.Size(66, 16);this.lblTurn.TabIndex = 1;this.lblTurn.Text = "Turn signal";// // lblDriving// this.lblDriving.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblDriving.Location = new System.Drawing.Point(14, 20);this.lblDriving.Name = "lblDriving";this.lblDriving.Size = new System.Drawing.Size(48, 16);this.lblDriving.TabIndex = 0;this.lblDriving.Text = "Driving";// // fraEntry// this.fraEntry.Controls.Add(this.sliSpeedEntry);this.fraEntry.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraEntry.Location = new System.Drawing.Point(8, 112);this.fraEntry.Name = "fraEntry";this.fraEntry.Size = new System.Drawing.Size(248, 72);this.fraEntry.TabIndex = 2;this.fraEntry.TabStop = false;this.fraEntry.Text = "Motor Entry";// // sliSpeedEntry// this.sliSpeedEntry.Location = new System.Drawing.Point(16, 24);this.sliSpeedEntry.Maximum = 3500;this.sliSpeedEntry.Name = "sliSpeedEntry";this.sliSpeedEntry.Size = new System.Drawing.Size(216, 45);this.sliSpeedEntry.TabIndex = 0;this.sliSpeedEntry.TickFrequency = 350;this.sliSpeedEntry.Scroll += new System.EventHandler(this.sliSpeedEntry_Scroll);// // lblCaption// this.lblCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblCaption.Location = new System.Drawing.Point(8, 8);this.lblCaption.Name = "lblCaption";this.lblCaption.Size = new System.Drawing.Size(256, 16);this.lblCaption.TabIndex = 3;this.lblCaption.Text = "C# Control";this.lblCaption.TextAlign = System.Drawing.ContentAlignment.TopCenter;// // CSharpControl// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.Controls.Add(this.lblCaption);this.Controls.Add(this.fraEntry);this.Controls.Add(this.fraLight);this.Controls.Add(this.fraMotor);this.Name = "CSharpControl";this.Size = new System.Drawing.Size(264, 192);this.fraMotor.ResumeLayout(false);this.fraLight.ResumeLayout(false);this.fraEntry.ResumeLayout(false);this.fraEntry.PerformLayout();((System.ComponentModel.ISupportInitialize)(this.sliSpeedEntry)).EndInit();this.ResumeLayout(false);}#endregionprivate void btnMotorSwitch_Click(object sender, System.EventArgs e){if (Measurement.Running){if (svMotorSwitch != null){if (btnMotorSwitch.Text == "Off"){svMotorSwitch.Value = 1;btnMotorSwitch.Text = "On";}else{svMotorSwitch.Value = 0;btnMotorSwitch.Text = "Off";}}}}private void svMotorSwitch_OnChange(object Value){int tmp = (int)Value;if (tmp == 0){btnMotorSwitch.Text = "Off";}else{btnMotorSwitch.Text = "On";}}private void btnLightSwitch_Click(object sender, System.EventArgs e){if (Measurement.Running){CANoe.Bus bus = null;try{bus = (CANoe.Bus)App.get_Bus("CAN");if (bus != null){CANoe.Signal signal = (CANoe.Signal)bus.GetSignal(1, "LightState", "OnOff");if (signal != null){if (btnLightSwitch.Text == "Off"){signal.Value = 1;btnLightSwitch.Text = "On";}else{signal.Value = 0;btnLightSwitch.Text = "Off";}}}}catch{}}}private void tmrSignals_Tick(object sender, System.EventArgs e){// get all the signal values and actualize controlsif (Measurement.Running){CANoe.Bus bus = null;try{bus = (CANoe.Bus)App.get_Bus("CAN");if (bus != null){CANoe.Signal signal = (CANoe.Signal)bus.GetSignal(1, "LightState", "OnOff");if (signal != null){if (signal.Value == 0)btnLightSwitch.Text = "Off";elsebtnLightSwitch.Text = "On";}}}catch{}}}private void btnTurnSignal_Click(object sender, System.EventArgs e){if (Measurement.Running){if (btnTurnSignal.Text == "Off") {if (svTurnSignal != null){svTurnSignal.Value = 1;btnTurnSignal.Text = "On";}}else{if (svTurnSignal != null){svTurnSignal.Value = 0;btnTurnSignal.Text = "Off";}}}}private void svTurnSignal_OnChange(object Value){int tmp = (int)Value;if (tmp == 0){btnTurnSignal.Text = "Off";}else{btnTurnSignal.Text = "On";}}private void sliSpeedEntry_Scroll(object sender, System.EventArgs e){if(Measurement.Running){if (svEngineSpeedEntry != null){double tmp = sliSpeedEntry.Value;svEngineSpeedEntry.Value = tmp;}}}private void svEngineSpeedEntry_OnChange(object Value){sliSpeedEntry.Value = (int)((double)Value);}}
}
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;namespace CSharpPanels
{public class CSharpDisplay : System.Windows.Forms.UserControl{// Declare typesprivate CANoe.Application App;private CANoe.Measurement Measurement;internal GroupBox fraEngineSpeed;internal GroupBox fraMotor;internal GroupBox fraLight;internal Label lblEngine;internal Label lblRunning;internal Label lblDriving;internal Label lblTurn;internal Label lblDrivingState;internal Label lblTurnState;private System.Windows.Forms.Timer tmrSignals;internal Label lblCaption;private System.ComponentModel.IContainer components;public CSharpDisplay(){// This call is required by the Windows.Forms Form Designer.InitializeComponent();// Initialize typesApp         = new CANoe.Application();Measurement = (CANoe.Measurement)App.Measurement;}protected override void Dispose( bool disposing ){if( disposing ){if(components != null){components.Dispose();}}base.Dispose( disposing );}#region Component Designer generated code/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor./// </summary>private void InitializeComponent(){this.components = new System.ComponentModel.Container();this.fraEngineSpeed = new System.Windows.Forms.GroupBox();this.lblEngine = new System.Windows.Forms.Label();this.fraMotor = new System.Windows.Forms.GroupBox();this.lblRunning = new System.Windows.Forms.Label();this.fraLight = new System.Windows.Forms.GroupBox();this.lblTurnState = new System.Windows.Forms.Label();this.lblDrivingState = new System.Windows.Forms.Label();this.lblTurn = new System.Windows.Forms.Label();this.lblDriving = new System.Windows.Forms.Label();this.tmrSignals = new System.Windows.Forms.Timer(this.components);this.lblCaption = new System.Windows.Forms.Label();this.fraEngineSpeed.SuspendLayout();this.fraMotor.SuspendLayout();this.fraLight.SuspendLayout();this.SuspendLayout();// // fraEngineSpeed// this.fraEngineSpeed.Controls.Add(this.lblEngine);this.fraEngineSpeed.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraEngineSpeed.Location = new System.Drawing.Point(6, 26);this.fraEngineSpeed.Name = "fraEngineSpeed";this.fraEngineSpeed.Size = new System.Drawing.Size(111, 39);this.fraEngineSpeed.TabIndex = 0;this.fraEngineSpeed.TabStop = false;this.fraEngineSpeed.Text = "Engine Speed";// // lblEngine// this.lblEngine.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblEngine.Location = new System.Drawing.Point(6, 14);this.lblEngine.Name = "lblEngine";this.lblEngine.Size = new System.Drawing.Size(101, 19);this.lblEngine.TabIndex = 0;this.lblEngine.Text = "0";this.lblEngine.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;// // fraMotor// this.fraMotor.Controls.Add(this.lblRunning);this.fraMotor.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraMotor.Location = new System.Drawing.Point(121, 26);this.fraMotor.Name = "fraMotor";this.fraMotor.Size = new System.Drawing.Size(99, 39);this.fraMotor.TabIndex = 1;this.fraMotor.TabStop = false;this.fraMotor.Text = "Motor State";// // lblRunning// this.lblRunning.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblRunning.Location = new System.Drawing.Point(6, 14);this.lblRunning.Name = "lblRunning";this.lblRunning.Size = new System.Drawing.Size(89, 19);this.lblRunning.TabIndex = 0;this.lblRunning.Text = "Not Running";this.lblRunning.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;// // fraLight// this.fraLight.Controls.Add(this.lblTurnState);this.fraLight.Controls.Add(this.lblDrivingState);this.fraLight.Controls.Add(this.lblTurn);this.fraLight.Controls.Add(this.lblDriving);this.fraLight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.fraLight.Location = new System.Drawing.Point(6, 70);this.fraLight.Name = "fraLight";this.fraLight.Size = new System.Drawing.Size(214, 39);this.fraLight.TabIndex = 2;this.fraLight.TabStop = false;this.fraLight.Text = "Driving Light";// // lblTurnState// this.lblTurnState.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblTurnState.Location = new System.Drawing.Point(184, 17);this.lblTurnState.Name = "lblTurnState";this.lblTurnState.Size = new System.Drawing.Size(26, 15);this.lblTurnState.TabIndex = 3;this.lblTurnState.Text = "Off";this.lblTurnState.TextAlign = System.Drawing.ContentAlignment.TopRight;// // lblDrivingState// this.lblDrivingState.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblDrivingState.Location = new System.Drawing.Point(80, 17);this.lblDrivingState.Name = "lblDrivingState";this.lblDrivingState.Size = new System.Drawing.Size(26, 15);this.lblDrivingState.TabIndex = 2;this.lblDrivingState.Text = "Off";this.lblDrivingState.TextAlign = System.Drawing.ContentAlignment.TopRight;// // lblTurn// this.lblTurn.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblTurn.Location = new System.Drawing.Point(110, 17);this.lblTurn.Name = "lblTurn";this.lblTurn.Size = new System.Drawing.Size(76, 19);this.lblTurn.TabIndex = 1;this.lblTurn.Text = "Turn signal:";// // lblDriving// this.lblDriving.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblDriving.Location = new System.Drawing.Point(12, 17);this.lblDriving.Name = "lblDriving";this.lblDriving.Size = new System.Drawing.Size(63, 20);this.lblDriving.TabIndex = 0;this.lblDriving.Text = "Driving:";// // tmrSignals// this.tmrSignals.Enabled = true;this.tmrSignals.Tick += new System.EventHandler(this.tmrSignals_Tick);// // lblCaption// this.lblCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold);this.lblCaption.Location = new System.Drawing.Point(6, 6);this.lblCaption.Name = "lblCaption";this.lblCaption.Size = new System.Drawing.Size(214, 17);this.lblCaption.TabIndex = 3;this.lblCaption.Text = "C# Display";this.lblCaption.TextAlign = System.Drawing.ContentAlignment.TopCenter;// // CSharpDisplay// this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;this.Controls.Add(this.lblCaption);this.Controls.Add(this.fraLight);this.Controls.Add(this.fraMotor);this.Controls.Add(this.fraEngineSpeed);this.Name = "CSharpDisplay";this.Size = new System.Drawing.Size(226, 117);this.fraEngineSpeed.ResumeLayout(false);this.fraMotor.ResumeLayout(false);this.fraLight.ResumeLayout(false);this.ResumeLayout(false);}#endregionprivate void tmrSignals_Tick(object sender, System.EventArgs e){// get all the signal values and actualize controlsif(Measurement.Running){CANoe.Configuration configuration     = null;CANoe.SimulationSetup simulationSetup = null; CANoe.Nodes nodes                     = null;CANoe.Node node                       = null;CANoe.Signals motorInputs             = null;CANoe.Signals motorControlInputs      = null;try{configuration   = (CANoe.Configuration)App.Configuration;simulationSetup = (CANoe.SimulationSetup)configuration.SimulationSetup;nodes           = (CANoe.Nodes)simulationSetup.Nodes;node            = (CANoe.Node)nodes["Motor"];motorInputs     = (CANoe.Signals)node.Inputs;if (motorInputs["OnOff"].Value == 0){lblRunning.Text = "Not Running";}else{lblRunning.Text = "Running";}lblEngine.Text = motorInputs["EngineSpeed"].Value.ToString();motorInputs = null;node = (CANoe.Node)nodes["MotorControl"];motorControlInputs = (CANoe.Signals)node.Inputs;if(motorControlInputs["OnOff"].Value == 0){lblDrivingState.Text = "Off";}else{lblDrivingState.Text = "On";}if(motorControlInputs["TurnSignal"].Value == 0){lblTurnState.Text = "Off";}else{lblTurnState.Text = "On";}}catch{}finally{motorControlInputs = null;node = null;nodes = null;simulationSetup = null;configuration = null;}}}}
}
4、运行效果展示

 

 5、总结

现在啊,汽车电子这块儿技术发展得太快了,对测试和验证这些系统的需求也越来越多。CANoe呢,就像一个超级英雄的工具,专门用来模拟和测试汽车里的网络通信。我们想了个招儿,就是做几个自己定义的小工具,这样跟CANoe打交道就更直观了,能实时看着汽车信号怎么样,还能动手调调。

小工具是咋设计的:

我们做了两个小帮手,一个叫CSharpControl,负责接收你给的信号指令;另一个叫CSharpDisplay,就像个小喇叭,告诉你信号现在是啥状态。这样一分工,它们的职责就很清楚了,以后维护起来也方便,想加点新功能也容易。

信号是怎么处理的:

我们靠CANoe的超能力,实时拿到信号的状态,然后有个定时器(就像个小闹钟,我们叫它tmrSignals),不停地检查信号有没有变,一变就更新到界面上。这样你就能随时知道系统啥情况了,用起来更顺手。

事件驱动是咋回事:

我们还用了个挺聪明的方法,就是事件驱动。比如说你点个按钮,或者信号变了,就会触发一些程序去处理这些事情。这样写代码就更灵活了,以后想加新功能也不费劲。

资源管理这块儿也很重要:

我们得确保用的资源,比如CANoe里的对象和定时器,用完了都得好好收起来,别占着地方。所以我们在控件不用的时候,重写了个Dispose方法,让它们都能被正确回收,这样就不会浪费内存了。

界面长啥样:

界面设计嘛,我们想着得让用户用着舒服。所以用了一些分组框,把控件都归类放好了,看起来就整齐多了。每个区域都有名字,一看就知道是干啥的。

以后还能怎么发展:

现在的设计已经挺好了,但未来还能更上一层楼。比如说,想加更多控制信号和显示的功能,或者把CANoe的其他超能力,比如记录和分析数据,也集成进来。

最后说说感受:

这个项目让我们学会了怎么用C#和CANoe API做个很厉害的用户控件,跟汽车电子系统玩得转。设计得好,不仅现在开发起来快,以后维护、升级也方便。以后啊,我们还要继续挖掘新技能,让用户体验和系统性能都更上一层楼!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/444569.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java调用WebService接口实践案例

最终效果 在网上找了一个免费的webservice接口简单做个测试,可以正常返回结果 public static void main(String[] args) {String url = "http://www.webxml.com.cn/WebServices/WeatherWebService.asmx";String xmlData = "<soapenv:Envelope xmlns:soapen…

springboot 整合spring ai实现 基于知识库的客服问答

rag 需求产生的背景介绍&#xff1a; 在使用大模型时&#xff0c;常遇到的问题之一是模型可能产生幻觉&#xff0c;即生成的内容缺乏准确性。此外&#xff0c;由于大模型不直接访问企业的专有数据&#xff0c;其响应可能会显得泛泛而谈&#xff0c;不够精准或具体&#xff0c;…

onnx代码解读

一、定义 torch.jit.trace 相关代码解读onnx 内部实现 3 查看是否为aten 算子aten 算子实现torch.autograd.Functions 算子实现自定义算子实现查找未实现的节点一次性发现所有的未实现 aten 算子 二、实现 torch.jit.trace 相关代码解读 1. torch.jit.script() : 将其转换为…

CSD(computational storage devices)架构介绍

CSD&#xff08;computational storage devices&#xff09;架构介绍 前言一、CSD与传统SSD的架构对比二、为什么要采用FPGA三、FPGA缺点四、个人总结reference 前言 虽然一直有接触CSD&#xff0c;但一直对其原理和架构知之甚少&#xff0c;半知不解。今天&#xff0c;趁着我还…

CSS计数器

CSS 中的计数器类似于变量&#xff0c;可以实现简单的计数功能&#xff0c;并将结果显示在页面上&#xff0c;在早期的网站上应用比较广泛。要实现计数器需要用到以下几个属性&#xff1a; counter-reset&#xff1a;创建或者重置计数器&#xff1b;counter-increment&#xf…

机器学习框架(含实例说明)

机器学习框架是用于开发和部署机器学习模型的软件库和工具集。它们提供了一系列的算法、工具和基础设施&#xff0c;帮助开发者更高效地构建、训练和部署机器学习模型。以下是一些主要的机器学习框架及其详细介绍&#xff1a; 1. TensorFlow TensorFlow 是由Google开发的开源…

盘点2024年双十一最值得入手的好物,双十一必买清单大汇总

随着科技的飞速发展&#xff0c;数码产品已成为我们生活中不可或缺的伙伴。2024年双十一购物狂欢节即将来临&#xff0c;众多消费者早已摩拳擦掌&#xff0c;准备在这个年度盛事中淘到心仪的数码好物。在这个信息爆炸的时代&#xff0c;如何从琳琅满目的商品中挑选出性价比高、…

C# WPF 仿 Android Toast 效果

转载请注明出处: https://blog.csdn.net/hx7013/article/details/142860084 主职Android, 最近需要写一些WPF的程序作为上位机&#xff0c;目前WPF的MessageBox过于臃肿&#xff0c;且想找一个内置的非阻塞的简单提示一直找不到&#xff0c;想到了Android的Toast所以写了这个扩…

如何实现C#和Python之间实时视频数据交互

我们在做RTSP|RTMP播放的时候&#xff0c;遇到好多开发者&#xff0c;他们的视觉算法大多运行在python下&#xff0c;需要高效率的实现C#和Python的视频数据交互&#xff0c;常用的方法如下&#xff1a; 方法一&#xff1a;通过HTTP请求传输视频数据 服务器端&#xff08;Pyth…

浙江省发规院产业发展研究所调研组莅临迪捷软件考察调研

2024年10月10日下午&#xff0c;浙江省发展与规划院产业发展研究所调研组一行莅临迪捷软件考察调研&#xff0c;绍兴市府办、区发改、区经信、迪荡街道等相关领导陪同。 调研组一行参观了迪捷软件的展厅与办公区&#xff0c;深入了解了迪捷软件的公司发展历程、运营状况、产品…

『网络游戏』数据库表格转储【25】

避免勿删数据库表格&#xff0c;可以将表格存储 放到桌面即可 现在将表格删除后点击 浏览桌面表格保存即可 修改客户端脚本&#xff1a;NetSvc.cs 目的是在数据库更新异常时弹出提示以便修改 本章结束

一文区分SSTI 和 CSTI

前言 有时&#xff0c;SSTI&#xff08;服务器端模板注入&#xff09;和 CSTI&#xff08;客户端模板注入&#xff09;可能会由于它们相似的负载语法而混淆。这种混乱可能会导致渗透测试人员浪费时间尝试实现反向 shell&#xff0c;即使payload仅限于客户端。 定义 &#x1d…

【AI系统】AI系统的组成

AI系统的组成是实现其设计目标的基础。本文将详细介绍AI系统的各个组成部分&#xff0c;以及它们如何协同工作以支持AI应用程序的开发和运行。 I. 引言 AI系统的复杂性要求其组成不仅要关注单一的硬件或软件&#xff0c;而是需要一个多层次、多维度的架构设计。这包括从应用与…

安卓13禁止用户打开开发者选项 android13禁止用户打开开发者选项

总纲 android13 rom 开发总纲说明 文章目录 1.前言2.问题分析3.代码分析4.代码修改5.编译6.彩蛋1.前言 设置 =》关于平板电脑 =》版本号,一般的话,在这里连续点击就可以打开我们的开发者选项了。但是有些系统要进行保密,因此要禁止用户进入。 2.问题分析 这里我们是通过点…

vue3.5系列之响应式props解构的几点技巧对比

在最新的版本3.5x中&#xff0c;对props的能力也进行了加强。下面&#xff0c;我们具体看下有哪些变化&#xff0c;给我们带来的新的体验&#xff01; 体验一 3.5之前解构props的效果 // 子组件 <template><div><h1>响应式props</h1><p>{{ co…

Linux工具的使用——yum和vim的理解和使用

目录 linux工具的使用1.linux软件包管理器yum1.1yum的背景了解关于yum的拓展 1.2yum的使用 2.Linux编辑器-vim使用2.1vim的基本概念2.2vim的基本操作2.3命令模式命令集2.3.1关于光标的命令&#xff1a;2.3.2关于复制粘贴的命令2.3.3关于删除的命令2.3.4关于文本编辑的命令 2.4插…

ElasticSearch备考 -- Update by query Reindex

一、题目 有个索引task&#xff0c;里面的文档长这样 现在需要添加一个字段all&#xff0c;这个字段的值是以下 a、b、c、d字段的值连在一起 二、思考 需要把四个字段拼接到一起&#xff0c;组成一个新的字段&#xff0c;这个就需要脚本&#xff0c; 这里有两种方案&#xff…

Python进阶--正则表达式

目录 1. 基础匹配 2. 元字符匹配 1. 基础匹配 正则表达式&#xff0c;又称规则表达式&#xff08;Regular Expression&#xff09;&#xff0c;是使用单个字符串来描述、匹配某个句法规则的字符串&#xff0c;常被用来检索、替换那些符合某个模式&#xff08;规则&#xff…

zotero使用koofr+google drive/onedrive同步

最早了解到这个思路是来自 知乎-【从零开始使用Zotero】(3) Zotero文献同步方式 和 How to Sync Zotero Files Using WebDAV and Google Drive with Koofr: A Step-by-Step Guide 虽然周围很多人都在用Readpaper这种web端的了&#xff0c;但是经常逛Arxiv而且zotero的web插…

计算机网络——email

pop3拉出来 超出ASCII码范围就不让传了 这样就可以传更大的文件