瀏覽代碼

Build Date 표시 하도록 수정

YJ 5 年之前
父節點
當前提交
1145769128

+ 3 - 1
.gitignore

@@ -258,4 +258,6 @@ paket-files/
258 258
 
259 259
 # Python Tools for Visual Studio (PTVS)
260 260
 __pycache__/
261
-*.pyc
261
+*.pyc
262
+.vs/RF_TRIO_PLL_ZIG/v15/Server/sqlite3/db.lock
263
+*.lock

+ 5 - 3
Basic_Terminal/Properties/AssemblyInfo.cs

@@ -2,6 +2,7 @@
2 2
 using System.Runtime.CompilerServices;
3 3
 using System.Runtime.InteropServices;
4 4
 
5
+
5 6
 // 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 
6 7
 // 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
7 8
 // 이러한 특성 값을 변경하세요.
@@ -31,6 +32,7 @@ using System.Runtime.InteropServices;
31 32
 //
32 33
 // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로
33 34
 // 지정되도록 할 수 있습니다.
34
-// [assembly: AssemblyVersion("1.0.*")]
35
-[assembly: AssemblyVersion("1.0.0.1")]
36
-[assembly: AssemblyFileVersion("1.0.0.1")]
35
+[assembly: AssemblyVersion("1.0.*")]
36
+/*[assembly: AssemblyVersion("1.0.0.1")]
37
+[assembly: AssemblyFileVersion("1.0.0.1")]*/
38
+

+ 5 - 1
Basic_Terminal/RF_TRIO_PLL_ZIG.csproj

@@ -11,7 +11,7 @@
11 11
     <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12 12
     <FileAlignment>512</FileAlignment>
13 13
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14
-    <Deterministic>true</Deterministic>
14
+    <Deterministic>false</Deterministic>
15 15
     <PublishUrl>publish\</PublishUrl>
16 16
     <Install>true</Install>
17 17
     <InstallFrom>Disk</InstallFrom>
@@ -162,4 +162,8 @@
162 162
     </BootstrapperPackage>
163 163
   </ItemGroup>
164 164
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
165
+  <PropertyGroup>
166
+    <PreBuildEvent>
167
+    </PreBuildEvent>
168
+  </PropertyGroup>
165 169
 </Project>

+ 3 - 3
Basic_Terminal/Wnd/Main_Form.Designer.cs

@@ -2483,11 +2483,11 @@
2483 2483
             // label_Build
2484 2484
             // 
2485 2485
             this.label_Build.AutoSize = true;
2486
-            this.label_Build.Location = new System.Drawing.Point(1100, 819);
2486
+            this.label_Build.Location = new System.Drawing.Point(1056, 819);
2487 2487
             this.label_Build.Name = "label_Build";
2488
-            this.label_Build.Size = new System.Drawing.Size(64, 12);
2488
+            this.label_Build.Size = new System.Drawing.Size(166, 12);
2489 2489
             this.label_Build.TabIndex = 112;
2490
-            this.label_Build.Text = "Ver.0.0.0.0";
2490
+            this.label_Build.Text = "Ver.yyyy/MM/dd hh:mm:ss";
2491 2491
             // 
2492 2492
             // Main_Form
2493 2493
             // 

+ 50 - 3
Basic_Terminal/Wnd/Main_Form.cs

@@ -12,6 +12,7 @@ using System.Windows.Forms;
12 12
 using System.IO;
13 13
 using System.IO.Ports;
14 14
 using System.Reflection;
15
+using System.Globalization;
15 16
 
16 17
 namespace RF_TRIO_PLL_ZIG
17 18
 {
@@ -28,10 +29,56 @@ namespace RF_TRIO_PLL_ZIG
28 29
             InitializeComponent();
29 30
             serial.Serial_Initialize(ref comboBox_Port);
30 31
             System.Version assemblyVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
31
-            DateTime buildDate = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
32
-            this.label_Build.Text = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
32
+            //DateTime buildDate = new DateTime(2000, 1, 1).AddDays(assemblyVersion.Build).AddSeconds(assemblyVersion.Revision * 2);
33
+            DateTime buildDate = getBuildDateTime();
34
+            this.label_Build.Text = buildDate.ToString("yyyy/MM/dd hh:mm:ss");
35
+            //this.label_Build.Text = "Ver." + Assembly.GetExecutingAssembly().GetName().Version.ToString();
36
+        }
37
+        /// <summary>
38
+        /// Version Text로부터 Build된 일시를 구합니다.
39
+        /// </summary>
40
+        /// <returns></returns>
41
+        /*public DateTime getBuildDateTime()
42
+        {
43
+            //1. Assembly.GetExecutingAssembly().FullName의 값은 
44
+            //'ApplicationName, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
45
+            //와 같다. 
46
+            string strVersionText = Assembly.GetExecutingAssembly().FullName
47
+                    .Split(',')[1]
48
+                    .Trim()
49
+                    .Split('=')[1];
50
+
51
+            //2. Version Text의 세번째 값(Build Number)은 2000년 1월 1일부터 
52
+            //Build된 날짜까지의 총 일(Days) 수 이다.
53
+            int intDays = Convert.ToInt32(strVersionText.Split('.')[2]);
54
+            DateTime refDate = new DateTime(2000, 1, 1);
55
+            DateTime dtBuildDate = refDate.AddDays(intDays);
56
+
57
+            //3. Verion Text의 네번째 값(Revision NUmber)은 자정으로부터 Build된
58
+            //시간까지의 지나간 초(Second) 값 이다.
59
+            int intSeconds = Convert.ToInt32(strVersionText.Split('.')[3]);
60
+            intSeconds = intSeconds * 2;
61
+            dtBuildDate = dtBuildDate.AddSeconds(intSeconds);
62
+
63
+
64
+            //4. 시차조정
65
+            DaylightTime daylingTime = TimeZone.CurrentTimeZone
66
+                    .GetDaylightChanges(dtBuildDate.Year);
67
+            if (TimeZone.IsDaylightSavingTime(dtBuildDate, daylingTime))
68
+                dtBuildDate = dtBuildDate.Add(daylingTime.Delta);
69
+
70
+
71
+            return dtBuildDate;
72
+        }*/
73
+        /// <summary>
74
+        /// Assembly의 Build된 일시를 구합니다.
75
+        /// </summary>
76
+        /// <returns></returns>
77
+        public DateTime getBuildDateTime()
78
+        {
79
+            Assembly assembly = Assembly.GetExecutingAssembly();
80
+            return System.IO.File.GetLastWriteTime(assembly.Location);
33 81
         }
34
-
35 82
         private void Firmware_Update_Click(object sender, EventArgs e)
36 83
         {
37 84
             OpenFileDialog ofd = new OpenFileDialog();

+ 1 - 1
Basic_Terminal/Wnd/Main_Form.resx

@@ -1109,7 +1109,7 @@
1109 1109
 </value>
1110 1110
   </data>
1111 1111
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
1112
-    <value>90</value>
1112
+    <value>91</value>
1113 1113
   </metadata>
1114 1114
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
1115 1115
     <value>

二進制
Basic_Terminal/bin/Debug/Basic_Terminal.exe


二進制
Basic_Terminal/bin/Debug/Basic_Terminal.pdb