Bläddra i källkod

添加紧急呼叫按钮点阵屏显示

linjpxc 5 år sedan
förälder
incheckning
f20f47d601

BIN
IPCALLServicePro.zip


+ 9 - 1
IPCALLServicePro/IPCALLServicePro.vbproj

@@ -64,6 +64,9 @@
   <PropertyGroup>
     <ApplicationIcon>logo.ico</ApplicationIcon>
   </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>My Project\app.manifest</ApplicationManifest>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CoreAudioApi">
       <HintPath>..\dlls\CoreAudioApi.dll</HintPath>
@@ -175,10 +178,10 @@
     </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
-    <None Include="a.ini" />
     <None Include="Config.ini">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Include="My Project\app.manifest" />
     <None Include="My Project\Application.myapp">
       <Generator>MyApplicationCodeGenerator</Generator>
       <LastGenOutput>Application.Designer.vb</LastGenOutput>
@@ -196,6 +199,11 @@
     <PackageReference Include="MySql.Data">
       <Version>6.9.12</Version>
     </PackageReference>
+    <PackageReference Include="WMPLib">
+      <Version>1.0.0</Version>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+      <PrivateAssets>all</PrivateAssets>
+    </PackageReference>
   </ItemGroup>
   <ItemGroup>
     <Content Include="logo.ico" />

+ 1 - 1
IPCALLServicePro/My Project/Application.Designer.vb

@@ -24,7 +24,7 @@ Namespace My
         <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
         Public Sub New()
             MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
-            Me.IsSingleInstance = false
+            Me.IsSingleInstance = true
             Me.EnableVisualStyles = true
             Me.SaveMySettingsOnExit = true
             Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses

+ 1 - 1
IPCALLServicePro/My Project/Application.myapp

@@ -2,7 +2,7 @@
 <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <MySubMain>true</MySubMain>
   <MainForm>frmMain</MainForm>
-  <SingleInstance>false</SingleInstance>
+  <SingleInstance>true</SingleInstance>
   <ShutdownMode>0</ShutdownMode>
   <EnableVisualStyles>true</EnableVisualStyles>
   <AuthenticationMode>0</AuthenticationMode>

+ 25 - 24
IPCALLServicePro/My Project/Resources.Designer.vb

@@ -1,40 +1,41 @@
 '------------------------------------------------------------------------------
 ' <auto-generated>
-'     This code was generated by a tool.
-'     Runtime Version:4.0.30319.42000
+'     此代码由工具生成。
+'     运行时版本:4.0.30319.42000
 '
-'     Changes to this file may cause incorrect behavior and will be lost if
-'     the code is regenerated.
+'     对此文件的更改可能会导致不正确的行为,并且如果
+'     重新生成代码,这些更改将会丢失。
 ' </auto-generated>
 '------------------------------------------------------------------------------
 
 Option Strict On
 Option Explicit On
 
+Imports System
 
 Namespace My.Resources
-
-    'This class was auto-generated by the StronglyTypedResourceBuilder
-    'class via a tool like ResGen or Visual Studio.
-    'To add or remove a member, edit your .ResX file then rerun ResGen
-    'with the /str option, or rebuild your VS project.
+    
+    '此类是由 StronglyTypedResourceBuilder
+    '类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    '若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    '(以 /str 作为命令选项),或重新生成 VS 项目。
     '''<summary>
-    '''  A strongly-typed resource class, for looking up localized strings, etc.
+    '''  一个强类型的资源类,用于查找本地化的字符串等。
     '''</summary>
-    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
-     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
-     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
-     Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"),  _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _
+     Global.Microsoft.VisualBasic.HideModuleNameAttribute()>  _
     Friend Module Resources
-
+        
         Private resourceMan As Global.System.Resources.ResourceManager
-
+        
         Private resourceCulture As Global.System.Globalization.CultureInfo
-
+        
         '''<summary>
-        '''  Returns the cached ResourceManager instance used by this class.
+        '''  返回此类使用的缓存的 ResourceManager 实例。
         '''</summary>
-        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _
         Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
             Get
                 If Object.ReferenceEquals(resourceMan, Nothing) Then
@@ -44,17 +45,17 @@ Namespace My.Resources
                 Return resourceMan
             End Get
         End Property
-
+        
         '''<summary>
-        '''  Overrides the current thread's CurrentUICulture property for all
-        '''  resource lookups using this strongly typed resource class.
+        '''  重写当前线程的 CurrentUICulture 属性
+        '''  重写当前线程的 CurrentUICulture 属性。
         '''</summary>
-        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _
         Friend Property Culture() As Global.System.Globalization.CultureInfo
             Get
                 Return resourceCulture
             End Get
-            Set(ByVal value As Global.System.Globalization.CultureInfo)
+            Set
                 resourceCulture = value
             End Set
         End Property

+ 36 - 36
IPCALLServicePro/My Project/Settings.Designer.vb

@@ -1,10 +1,10 @@
 '------------------------------------------------------------------------------
 ' <auto-generated>
-'     This code was generated by a tool.
-'     Runtime Version:4.0.30319.42000
+'     此代码由工具生成。
+'     运行时版本:4.0.30319.42000
 '
-'     Changes to this file may cause incorrect behavior and will be lost if
-'     the code is regenerated.
+'     对此文件的更改可能会导致不正确的行为,并且如果
+'     重新生成代码,这些更改将会丢失。
 ' </auto-generated>
 '------------------------------------------------------------------------------
 
@@ -13,42 +13,42 @@ Option Explicit On
 
 
 Namespace My
-
-    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
-     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
-     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    
+    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0"),  _
+     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _
     Partial Friend NotInheritable Class MySettings
         Inherits Global.System.Configuration.ApplicationSettingsBase
-
-        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
-
-#Region "My.Settings Auto-Save Functionality"
+        
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
+        
+#Region "My.Settings 自动保存功能"
 #If _MyType = "WindowsForms" Then
-        Private Shared addedHandler As Boolean
+    Private Shared addedHandler As Boolean
 
-        Private Shared addedHandlerLockObject As New Object
+    Private Shared addedHandlerLockObject As New Object
 
-        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
-        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
-            If My.Application.SaveMySettingsOnExit Then
-                My.Settings.Save()
-            End If
-        End Sub
+    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+    Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
+        If My.Application.SaveMySettingsOnExit Then
+            My.Settings.Save()
+        End If
+    End Sub
 #End If
 #End Region
-
+        
         Public Shared ReadOnly Property [Default]() As MySettings
             Get
-
+                
 #If _MyType = "WindowsForms" Then
-                   If Not addedHandler Then
-                        SyncLock addedHandlerLockObject
-                            If Not addedHandler Then
-                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
-                                addedHandler = True
-                            End If
-                        End SyncLock
-                    End If
+               If Not addedHandler Then
+                    SyncLock addedHandlerLockObject
+                        If Not addedHandler Then
+                            AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+                            addedHandler = True
+                        End If
+                    End SyncLock
+                End If
 #End If
                 Return defaultInstance
             End Get
@@ -57,13 +57,13 @@ Namespace My
 End Namespace
 
 Namespace My
-
-    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
-     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
-     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+    
+    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(),  _
+     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
+     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()>  _
     Friend Module MySettingsProperty
-
-        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+        
+        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")>  _
         Friend ReadOnly Property Settings() As Global.IPCALLServicePro.My.MySettings
             Get
                 Return Global.IPCALLServicePro.My.MySettings.Default

+ 75 - 0
IPCALLServicePro/My Project/app.manifest

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <!-- UAC 清单选项
+             如果想要更改 Windows 用户帐户控制级别,请使用
+             以下节点之一替换 requestedExecutionLevel 节点。n
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
+
+            指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
+            如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
+            元素。
+        -->
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
+           Windows 版本的列表。取消评论适当的元素,
+           Windows 将自动选择最兼容的环境。 -->
+
+      <!-- Windows Vista -->
+      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+
+      <!-- Windows 7 -->
+      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+
+      <!-- Windows 8 -->
+      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+
+      <!-- Windows 8.1 -->
+      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+
+      <!-- Windows 10 -->
+      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+
+    </application>
+  </compatibility>
+
+  <!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
+       自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
+       选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
+       在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
+  <!--
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+    </windowsSettings>
+  </application>
+  -->
+
+  <!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
+  <!--
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity
+          type="win32"
+          name="Microsoft.Windows.Common-Controls"
+          version="6.0.0.0"
+          processorArchitecture="*"
+          publicKeyToken="6595b64144ccf1df"
+          language="*"
+        />
+    </dependentAssembly>
+  </dependency>
+  -->
+
+</assembly>

+ 1 - 1
IPCALLServicePro/comGlobalVars.vb

@@ -644,7 +644,7 @@ Module comGlobalVars
             If Val(Temp(1)) = 0 Then
                 Temp(1) = Temp(2)
             End If
-            'SysLedContrl.AddCallingProgram(Temp(1) + "W", ParseStr(DisWCToNurseCalling, Temp))
+            SysLedContrl.AddCallingProgram(Temp(1) + "W", ParseStr(DisWCToNurseCalling, Temp), Int32.Parse(Temp(10)))
             TempStr = ParseStr(SpeechWCCalling, Temp)
             SpeechAddStr(TempStr)
 

+ 8 - 4
IPCALLServicePro/frmMain.vb

@@ -1,5 +1,6 @@
 Imports System.IO
 Imports WDMsgLib
+
 Public Class frmMain
 
     Protected Overrides Sub DefWndProc(ByRef m As Message)
@@ -31,8 +32,6 @@ Public Class frmMain
         End Try
     End Sub
 
-
-
     Private Sub frmMain_Disposed(sender As Object, e As System.EventArgs) Handles Me.Disposed
         Try
             End
@@ -130,7 +129,11 @@ Public Class frmMain
                 FileClose(1)
                 Me.txtLog.Text = ""
             End If
-            Button5.Text = "【UPS】BatVolt:" + SysUPS.BatVolt.ToString + "V  SysVolt:" + SysUPS.SysVolt.ToString + "V  Mode:" + SysUPS.ChargeMode.ToString
+
+            If Not SysUPS Is Nothing Then
+                Button5.Text = "【UPS】BatVolt:" + SysUPS.BatVolt.ToString + "V  SysVolt:" + SysUPS.SysVolt.ToString + "V  Mode:" + SysUPS.ChargeMode.ToString
+            End If
+
             'txtLog.AppendText(txtLog.Text)
 
             'txtLog.ScrollToCaret()
@@ -206,4 +209,5 @@ Public Class frmMain
 
     Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
     End Sub
-End Class
+
+End Class

+ 10 - 4
LatticeScreenServer/CarouselController.cs

@@ -104,18 +104,24 @@ namespace HNWD.LatticeScreen.Server
 
         public void AddCallingProgram(string CallId, string CallText, int PartID)
         {
-            for (int i = 0; i < ledLatticeScreenlist1[PartID.ToString()].Count; i++)
+            var partIdStr = PartID.ToString();
+            if (!ledLatticeScreenlist1.ContainsKey(partIdStr))
+            {
+                return;
+            }
+
+            for (int i = 0; i < ledLatticeScreenlist1[partIdStr].Count; i++)
             {
-                CallingProgram cp = new CallingProgram(ledLatticeScreenlist1[PartID.ToString()][i], CallId);
+                CallingProgram cp = new CallingProgram(ledLatticeScreenlist1[partIdStr][i], CallId);
 
                 cp.SetEntity(new WD_ProgramInfo()
                 {
                     PROGRAM_TEXT = CallText,
                 });
 
-                if (!ledLatticeScreenlist1[PartID.ToString()][i].CallingList.Exists(f => f.CallId == CallId))
+                if (!ledLatticeScreenlist1[partIdStr][i].CallingList.Exists(f => f.CallId == CallId))
                 {
-                    ledLatticeScreenlist1[PartID.ToString()][i].CallingList.Add(cp);
+                    ledLatticeScreenlist1[partIdStr][i].CallingList.Add(cp);
                 }
             }
         }

+ 26 - 1
LatticeScreenServer/Hards/LedControl.cs

@@ -9,6 +9,7 @@ using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Threading;
 using System.Windows.Forms;
 using LatticeScreenServer;
 
@@ -413,6 +414,7 @@ namespace HNWD.LatticeScreen
 
                 if (isEmpty)
                 {
+                    StopEraseThreead();
                     foreach (var item in list)
                     {
                         var aheader = new bx_sdk_dual.EQareaHeader_G6();
@@ -637,9 +639,32 @@ namespace HNWD.LatticeScreen
             return 0;
         }
 
+        private static Thread eraseThread;
+
         public static int JHErase(IntPtr hdl)
         {
-            return JHDrawText(hdl, 0, 0, ushort.MaxValue, ushort.MaxValue, 0, "");
+            //return JHDrawText(hdl, 0, 0, ushort.MaxValue, ushort.MaxValue, 0, "");
+
+            StopEraseThreead();
+            eraseThread = new Thread(state =>
+            {
+                Thread.Sleep(TimeSpan.FromSeconds(10));
+                JHDrawText(hdl, 0, 0, ushort.MaxValue, ushort.MaxValue, 0, "");
+            });
+
+            return 0;
+        }
+
+        private static void StopEraseThreead()
+        {
+            try
+            {
+                eraseThread?.Abort();
+                eraseThread?.DisableComObjectEagerCleanup();
+            }
+            catch
+            {
+            }
         }
 
         public static int JHDrawBitmap(IntPtr hdl, short x, short y, ushort width, ushort height, uint format, tagBitmapSource pbmpsrc)