Skip to content

Commit 71bef4d

Browse files
committed
V1.3 update
1 parent b2367d6 commit 71bef4d

File tree

14 files changed

+647
-268
lines changed

14 files changed

+647
-268
lines changed

MetaCom/MetaCom.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@
285285
<Generator>MSBuild:Compile</Generator>
286286
<SubType>Designer</SubType>
287287
</ApplicationDefinition>
288+
<Compile Include="Models\ConfigModel.cs" />
288289
<Compile Include="ViewModels\MainWindowBase.cs" />
289290
<Compile Include="ViewModels\MainWindowVM.cs" />
290291
<Compile Include="ViewModels\AboutWindowVM.cs" />

MetaCom/Models/ConfigModel.cs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
using MetaCom.ViewModels;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Collections.ObjectModel;
5+
using System.IO;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Xml;
9+
using System.Xml.Serialization;
10+
11+
namespace MetaCom.Models
12+
{
13+
[XmlRoot(ElementName = "Config")]
14+
public class ConfigModel : MainWindowBase
15+
{
16+
private string _port;
17+
[XmlAttribute(AttributeName = "port", Namespace = "")]
18+
public string Port
19+
{
20+
get
21+
{
22+
return _port;
23+
}
24+
set
25+
{
26+
_port = value;
27+
RaisePropertyChanged(nameof(Port));
28+
}
29+
}
30+
31+
32+
[XmlRoot(ElementName = "commoncmd")]
33+
public class CommonCmd : MainWindowBase
34+
{
35+
private string _item;
36+
[XmlElement(ElementName = "item", Namespace = "")]
37+
public string Item
38+
{
39+
get
40+
{
41+
return _item;
42+
}
43+
set
44+
{
45+
_item = value;
46+
RaisePropertyChanged(nameof(Item));
47+
}
48+
}
49+
}
50+
private ObservableCollection<CommonCmd> _commoncmds;
51+
[XmlElement(ElementName = "commoncmds", Namespace = "")]
52+
public ObservableCollection<CommonCmd> CommonCmds
53+
{
54+
get
55+
{
56+
return _commoncmds;
57+
}
58+
set
59+
{
60+
_commoncmds = value;
61+
RaisePropertyChanged(nameof(CommonCmds));
62+
}
63+
}
64+
[XmlRoot(ElementName = "rescentcmd")]
65+
public class RescentCmd : MainWindowBase
66+
{
67+
private string _item;
68+
[XmlElement(ElementName = "item", Namespace = "")]
69+
public string Item
70+
{
71+
get
72+
{
73+
return _item;
74+
}
75+
set
76+
{
77+
_item = value;
78+
RaisePropertyChanged(nameof(Item));
79+
}
80+
}
81+
82+
}
83+
private ObservableCollection<RescentCmd> _rescentcmds;
84+
[XmlElement(ElementName = "rescentcmds", Namespace = "")]
85+
public ObservableCollection<RescentCmd> RescentCmds
86+
{
87+
get
88+
{
89+
return _rescentcmds;
90+
}
91+
set
92+
{
93+
_rescentcmds = value;
94+
//NotifyPropertyChange("RescentCmds");
95+
RaisePropertyChanged(nameof(RescentCmds));
96+
}
97+
}
98+
99+
}
100+
}

MetaCom/Models/HelpModel.cs

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -32,68 +32,10 @@ public string VerInfo
3232
}
3333
}
3434
}
35-
36-
#region 状态栏 - 发送文件进度条可见性
37-
private string _StatusBarProgressBarVisibility;
38-
public string StatusBarProgressBarVisibility
39-
{
40-
get
41-
{
42-
return _StatusBarProgressBarVisibility;
43-
}
44-
set
45-
{
46-
if (_StatusBarProgressBarVisibility != value)
47-
{
48-
_StatusBarProgressBarVisibility = value;
49-
RaisePropertyChanged(nameof(StatusBarProgressBarVisibility));
50-
}
51-
}
52-
}
53-
54-
private double _StatusBarProgressBarValue;
55-
public double StatusBarProgressBarValue
56-
{
57-
get
58-
{
59-
return _StatusBarProgressBarValue;
60-
}
61-
set
62-
{
63-
if (_StatusBarProgressBarValue != value)
64-
{
65-
_StatusBarProgressBarValue = value;
66-
RaisePropertyChanged(nameof(StatusBarProgressBarValue));
67-
}
68-
}
69-
}
70-
71-
private bool _StatusBarProgressBarIsIndeterminate;
72-
public bool StatusBarProgressBarIsIndeterminate
73-
{
74-
get
75-
{
76-
return _StatusBarProgressBarIsIndeterminate;
77-
}
78-
set
79-
{
80-
if (_StatusBarProgressBarIsIndeterminate != value)
81-
{
82-
_StatusBarProgressBarIsIndeterminate = value;
83-
RaisePropertyChanged(nameof(StatusBarProgressBarIsIndeterminate));
84-
}
85-
}
86-
}
87-
#endregion
88-
8935
public void HelpDataContext()
9036
{
91-
VerInfoNumber = "1.2.0";
37+
VerInfoNumber = "1.3.0";
9238
VerInfo = "MetaCom V" + VerInfoNumber;
93-
94-
StatusBarProgressBarVisibility = "Collapsed";
95-
StatusBarProgressBarValue = 0;
96-
StatusBarProgressBarIsIndeterminate = false;
9739
}
9840
}
9941
}

MetaCom/Models/SendModel.cs

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,19 +130,73 @@ public bool CrLfEnable
130130
}
131131
}
132132
#endregion
133+
#region 状态栏 - 发送文件进度条可见性
134+
private string _StatusBarProgressBarVisibility;
135+
public string StatusBarProgressBarVisibility
136+
{
137+
get
138+
{
139+
return _StatusBarProgressBarVisibility;
140+
}
141+
set
142+
{
143+
if (_StatusBarProgressBarVisibility != value)
144+
{
145+
_StatusBarProgressBarVisibility = value;
146+
RaisePropertyChanged(nameof(StatusBarProgressBarVisibility));
147+
}
148+
}
149+
}
133150

151+
private double _StatusBarProgressBarValue;
152+
public double StatusBarProgressBarValue
153+
{
154+
get
155+
{
156+
return _StatusBarProgressBarValue;
157+
}
158+
set
159+
{
160+
if (_StatusBarProgressBarValue != value)
161+
{
162+
_StatusBarProgressBarValue = value;
163+
RaisePropertyChanged(nameof(StatusBarProgressBarValue));
164+
}
165+
}
166+
}
167+
168+
private bool _StatusBarProgressBarIsIndeterminate;
169+
public bool StatusBarProgressBarIsIndeterminate
170+
{
171+
get
172+
{
173+
return _StatusBarProgressBarIsIndeterminate;
174+
}
175+
set
176+
{
177+
if (_StatusBarProgressBarIsIndeterminate != value)
178+
{
179+
_StatusBarProgressBarIsIndeterminate = value;
180+
RaisePropertyChanged(nameof(StatusBarProgressBarIsIndeterminate));
181+
}
182+
}
183+
}
184+
#endregion
134185
public void SendDataContext()
135186
{
136187
SendData = string.Empty;
137188
SendDataCount = 0;
138189

139190
AutoSendNum = "1000";
140191

141-
/* 发送换行 */
142192
NonesEnable = false;
143193
CrEnable = false;
144194
LfEnable = false;
145195
CrLfEnable = true;
196+
197+
StatusBarProgressBarVisibility = "Collapsed";
198+
StatusBarProgressBarValue = 0;
199+
StatusBarProgressBarIsIndeterminate = false;
146200
}
147201
}
148202
}

MetaCom/Models/SerialModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ public string GetPortInformation( String PortName )
595595
var name = property.GetPropertyValue("Name");
596596
if (name != null && name.ToString().Contains(PortName))
597597
{
598+
// var portInfo = new SerialPortInfo(property);
598599
Console.WriteLine("Port Name: " + name);
599600
Console.WriteLine("Port description: " + property.GetPropertyValue("Description"));
600601
return property.GetPropertyValue("Description").ToString();

MetaCom/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
5050
//通过使用 "*",如下所示:
5151
// [assembly: AssemblyVersion("1.0.*")]
52-
[assembly: AssemblyVersion("1.2.0")]
53-
[assembly: AssemblyFileVersion("1.2.0")]
52+
//[assembly: AssemblyVersion("1.2.0")]
53+
//[assembly: AssemblyFileVersion("1.2.0")]

MetaCom/ViewModels/MainWindowBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace MetaCom.ViewModels
66
{
7-
internal class MainWindowBase : INotifyPropertyChanged
7+
public class MainWindowBase : INotifyPropertyChanged
88
{
99
public event PropertyChangedEventHandler PropertyChanged;
1010

0 commit comments

Comments
 (0)