Initial LMEMoxaTransfer application

This commit is contained in:
Livio Merola
2026-07-24 09:11:00 +02:00
commit dee8e930ea
25 changed files with 2217 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
bin/
obj/
.vs/
build-check/
build-check-latest/
*.user
*.suo
*.userosscache
*.sln.docstates
RicezioniTemp/
+104
View File
@@ -0,0 +1,104 @@
# LMEMoxaTransfer
Solution VB.NET WinForms per inviare e ricevere programmi CNC tra PC e macchinario Okuma tramite dispositivo Moxa in modalita TCP Server.
Prima della riorganizzazione e' stata creata una copia completa in:
`C:\Users\livio\Documents\TrasferimentoProgrammiOkuma_backup_20260724_azienda_macchine`
## Configurazione vista nella schermata Moxa
- Operating mode: `TCP Server Mode`
- Local TCP port: `10001`
- Packing length: `0`
- Delimiter 1/2: `0 (Disable)`
- Force transmit: `0`
- Serial baud rate: `4800`
- Data bits: `7`
- Stop bits: `1`
- Parity: `Even`
- FIFO: `Disable`
- Flow ctrl: `None`
- Interface: `RS-232`
Con questa configurazione il PC si collega come client TCP all'indirizzo IP del Moxa sulla porta `10001`.
## Configurazione aziende e macchine
All'avvio l'app legge `moxa-okuma-settings.json` dalla cartella dell'eseguibile. Il file contiene:
- elenco aziende e macchine Okuma con IP Moxa;
- impostazioni predefinite di invio/ricezione;
- hash e salt della password amministratore.
Le macchine SECUREX mantengono il numero originale dell'immagine, quindi sono `M4`, `M5`, `M8`, `M11`, `M12`.
La password iniziale e' `moxa`. Se nel JSON si svuotano `AdminPasswordHash` e `AdminPasswordSalt`, al primo sblocco l'app chiede di impostare una nuova password senza richiedere la vecchia.
## Uso
1. Aprire `TrasferimentoProgrammiOkuma.sln` con Visual Studio.
2. Avviare il progetto `TrasferimentoProgrammiOkuma.App`.
3. Selezionare azienda e macchina dalle due tendine.
4. Per ricevere da Okuma:
- scegliere la cartella di destinazione sul PC;
- premere `Ricevi da Okuma`;
- dal controllo Okuma avviare l'uscita/invio programma.
- la ricezione viene salvata prima in una cartella temporanea dell'app;
- se nel file ricevuto e' presente un nome preceduto da `$`, l'app lo propone come nome finale nella cartella scelta; il nome e' modificabile prima del salvataggio definitivo.
5. Per inviare a Okuma:
- mettere il controllo Okuma in ricezione;
- scegliere il file programma dal PC;
- premere `Invia a Okuma`.
I controlli di configurazione sono bloccati di default. Rimangono disponibili i bottoni operativi e le caselle dei file. Usare `Sblocca controlli` per modificarli.
## Stato Moxa
La scheda `Stato Moxa` mostra tutte le macchine Okuma divise per azienda. Il pallino verde indica che l'IP Moxa risponde sulla porta TCP configurata, il rosso indica che non e' raggiungibile, il grigio indica che non e' ancora stato controllato.
Il pulsante `Aggiorna` e' sempre disponibile. Il controllo automatico usa l'intervallo `Intervallo s`, modificabile solo dopo lo sblocco con password.
## Menu e informazioni
I comandi generali sono nel menu `Strumenti`; la voce `? > Informazioni su` mostra azienda `Compomac SPA`, autore `Livio Merola` e versione dell'app.
All'avvio viene mostrato uno splash screen con l'icona dell'app.
## ClickOnce
Profilo di pubblicazione:
```powershell
& "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" .\TrasferimentoProgrammiOkuma.App\TrasferimentoProgrammiOkuma.App.vbproj /target:Publish /p:Configuration=Release /p:PublishProfile=GiteaClickOnce /p:PublishDir=..\clickonce\
```
La cartella `clickonce` contiene `LMEMoxaTransfer.application` e i file necessari. L'URL di aggiornamento configurato e':
`https://gitea.lmcloud.it/livio/LMEMoxaTransfer/raw/branch/main/clickonce/LMEMoxaTransfer.application`
## Note pratiche
- Se la ricezione termina troppo presto, aumentare `Fine ricez. s`.
- Se la ricezione non finisce mai, ridurre `Fine ricez. s`.
- Se Okuma richiede un fine programma esplicito, provare `Terminatore invio` con `%` oppure `% + CRLF`.
- Per la procedura Okuma READ da `CN0:`, attivare `Invio a blocchi`, lasciare `Dim. blocco byte` a `32` e `Pausa blocco ms` a `100` come punto di partenza, avviare prima READ sulla macchina, attendere che sia in ricezione, poi premere `Invia a Okuma`. Questa modalita aggiunge automaticamente `% + CRLF` e mantiene il socket aperto almeno 1 secondo dopo l'invio. Se appare ancora `5239`, provare `16` byte con `250` ms, poi `8` byte con `300` ms.
- Il trasferimento e' byte-per-byte: il programma non modifica il contenuto del file selezionato, salvo il terminatore opzionale in invio.
- Se l'invio verso Okuma genera `5238 RS232C device not ready ERROR FF`, controllare prima il lato seriale Okuma-Moxa: baud rate, data bit, parita, stop bit, flow control e segnali DSR/CTS/DTR/RTS. L'app TCP puo collegarsi al Moxa, ma non puo forzare la porta RS232C della macchina a diventare pronta.
- Per controlli Okuma che non accettano un flusso troppo rapido, lasciare attivo `Invio riga per riga`, provare `Pausa riga ms` tra `200` e `500`, attivare `Invio carattere per carattere`, provare `Pausa carattere ms` tra `10` e `30`, e tenere `Attesa dopo invio s` almeno a `2`.
- Dalla schermata Moxa attuale il flow control e' `None`. Se sul parametro Okuma e' impostato `DC CODE`, provare `XON/XOFF` sul Moxa. Se invece Okuma usa handshake hardware, provare `RTS/CTS` e controllare il cablaggio dei segnali ready.
- Se l'errore corretto e' `5239 memoria lettura per canale RS232C troppo piena`, il flusso in ingresso e' troppo rapido per il buffer Okuma. Ridurre la velocita applicativa con `Invio carattere per carattere`, aumentare le pause, oppure far funzionare correttamente il flow control `XON/XOFF` o hardware.
- Se `5239` appare subito appena si preme invio, usare `Test connessione`: apre TCP verso il Moxa senza inviare dati. Se l'allarme non compare, il problema nasce al primo byte seriale. Se compare comunque, riavviare il Moxa con `Save/Restart`, azzerare l'allarme Okuma e controllare stato/cablaggio RS232.
- Dopo modifiche Moxa premere sempre `Submit` e poi `Save/Restart`; in caso di prove fallite, spegnere/riaccendere o riavviare il Moxa per svuotare eventuali dati rimasti nel buffer.
## Build da terminale
```powershell
dotnet build .\TrasferimentoProgrammiOkuma.sln
```
## Avvio da terminale
```powershell
dotnet run --project .\TrasferimentoProgrammiOkuma.App\TrasferimentoProgrammiOkuma.App.vbproj
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

+31
View File
@@ -0,0 +1,31 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Text = "Form1"
End Sub
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
Friend Module Program
<STAThread()>
Friend Sub Main(args As String())
Application.SetHighDpiMode(HighDpiMode.SystemAware)
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
Using splash As New SplashForm()
splash.ShowDialog()
End Using
Application.Run(New Form1)
End Sub
End Module
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>..\clickonce\</PublishDir>
<PublishUrl>..\clickonce\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>1</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdateUrl>https://gitea.lmcloud.it/livio/LMEMoxaTransfer/raw/branch/main/clickonce/</UpdateUrl>
<InstallUrl>https://gitea.lmcloud.it/livio/LMEMoxaTransfer/raw/branch/main/clickonce/</InstallUrl>
<ProductName>LMEMoxaTransfer</ProductName>
<PublisherName>Compomac SPA</PublisherName>
<SuiteName>Compomac SPA</SuiteName>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<GenerateManifests>true</GenerateManifests>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<BootstrapperEnabled>true</BootstrapperEnabled>
<MapFileExtensions>true</MapFileExtensions>
</PropertyGroup>
</Project>
@@ -0,0 +1,72 @@
Imports System.Reflection
Public Class SplashForm
Inherits Form
Private ReadOnly closeTimer As New System.Windows.Forms.Timer()
Public Sub New()
FormBorderStyle = FormBorderStyle.None
StartPosition = FormStartPosition.CenterScreen
ClientSize = New Size(520, 260)
BackColor = Color.FromArgb(12, 18, 24)
ShowInTaskbar = False
Dim iconPath = IO.Path.Combine(Application.StartupPath, "Assets", "app-icon.png")
Dim picture As New PictureBox With {
.SizeMode = PictureBoxSizeMode.Zoom,
.Left = 34,
.Top = 42,
.Width = 150,
.Height = 150
}
If IO.File.Exists(iconPath) Then
picture.Image = Image.FromFile(iconPath)
End If
Controls.Add(picture)
Dim title As New Label With {
.Text = "LMEMoxaTransfer",
.ForeColor = Color.White,
.Font = New Font("Segoe UI", 24.0F, FontStyle.Bold),
.Left = 205,
.Top = 62,
.Width = 290,
.Height = 44
}
Controls.Add(title)
Dim subtitle As New Label With {
.Text = "Trasferimento programmi Okuma via Moxa",
.ForeColor = Color.FromArgb(170, 225, 220),
.Font = New Font("Segoe UI", 10.5F),
.Left = 208,
.Top = 112,
.Width = 290,
.Height = 28
}
Controls.Add(subtitle)
Dim versionLabel As New Label With {
.Text = $"Compomac SPA - Livio Merola - v{Assembly.GetExecutingAssembly().GetName().Version}",
.ForeColor = Color.FromArgb(180, 190, 200),
.Font = New Font("Segoe UI", 9.0F),
.Left = 208,
.Top = 154,
.Width = 290,
.Height = 28
}
Controls.Add(versionLabel)
closeTimer.Interval = 1400
AddHandler closeTimer.Tick, Sub()
closeTimer.Stop()
Close()
End Sub
End Sub
Protected Overrides Sub OnShown(e As EventArgs)
MyBase.OnShown(e)
closeTimer.Start()
End Sub
End Class
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<RootNamespace>TrasferimentoProgrammiOkuma.App</RootNamespace>
<AssemblyName>LMEMoxaTransfer</AssemblyName>
<Product>LMEMoxaTransfer</Product>
<AssemblyTitle>LMEMoxaTransfer</AssemblyTitle>
<Company>Compomac SPA</Company>
<Authors>Livio Merola</Authors>
<Version>1.0.0</Version>
<ApplicationIcon>Assets\app-icon.ico</ApplicationIcon>
<StartupObject>Sub Main</StartupObject>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<None Update="moxa-okuma-settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="Assets\app-icon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\app-icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Target Name="CopyClickOnceManifestsToPublishDir" AfterTargets="Publish">
<ItemGroup>
<ClickOnceManifestFiles Include="$(TargetDir)$(AssemblyName).application" />
<ClickOnceManifestFiles Include="$(TargetDir)$(AssemblyName).dll.manifest" />
</ItemGroup>
<Copy SourceFiles="@(ClickOnceManifestFiles)" DestinationFolder="$(PublishDir)" SkipUnchangedFiles="true" />
</Target>
</Project>
@@ -0,0 +1,129 @@
{
"AdminPasswordHash": "NZHINCSfx8Y4PePhYcXhbf/psJfiBfrDWRO0AgGnfE0=",
"AdminPasswordSalt": "QY9k9R4AmZvvj13geQ9N8A==",
"DefaultCompany": "SECUREX",
"MonitorRefreshSeconds": 30,
"LastReceiveDirectory": "",
"DefaultSettings": {
"Port": 10001,
"ConnectionTimeoutSeconds": 10,
"ReceiveIdleTimeoutSeconds": 15,
"SendTerminator": "%",
"LineDelayMs": 100,
"CharDelayMs": 10,
"LinePaced": true,
"CharPaced": false,
"BlockPaced": false,
"BlockSizeBytes": 32,
"BlockDelayMs": 100,
"WaitBeforeSendSeconds": 2,
"WaitAfterSendSeconds": 2
},
"Companies": [
{
"Name": "SECUREX",
"Machines": [
{
"Name": "M4 - N2LB 300",
"IpMoxa": "192.168.0.101",
"IpMachineWise": "192.168.0.214",
"Note": "OSP-U100L"
},
{
"Name": "M5 - N3LB 300",
"IpMoxa": "192.168.0.146",
"IpMachineWise": "192.168.0.47",
"Note": "OSP-E100L"
},
{
"Name": "M8 - CENTRO OKUMA",
"IpMoxa": "192.168.0.113",
"IpMachineWise": "192.168.0.68",
"Note": "OSP-P200M"
},
{
"Name": "M11 - TORNIO OKUMA LB25I-N",
"IpMoxa": "192.168.0.88",
"IpMachineWise": "192.168.0.223",
"Note": ""
},
{
"Name": "M12 - TORNIO OKUMA LB 400",
"IpMoxa": "192.168.0.99",
"IpMachineWise": "192.168.0.66",
"Note": ""
}
]
},
{
"Name": "EMILIA",
"Machines": [
{
"Name": "M1",
"IpMoxa": "192.168.30.8",
"IpMachineWise": "192.168.30.221",
"Note": ""
},
{
"Name": "M2",
"IpMoxa": "192.168.30.9",
"IpMachineWise": "192.168.30.222",
"Note": ""
},
{
"Name": "M3",
"IpMoxa": "192.168.30.10",
"IpMachineWise": "192.168.30.223",
"Note": ""
},
{
"Name": "M4 - CENTRO LAVORO OKUMA",
"IpMoxa": "192.168.30.11",
"IpMachineWise": "192.168.30.224",
"Note": ""
},
{
"Name": "M5",
"IpMoxa": "192.168.30.12",
"IpMachineWise": "192.168.30.225",
"Note": ""
},
{
"Name": "M6",
"IpMoxa": "192.168.30.13",
"IpMachineWise": "192.168.30.226",
"Note": ""
}
]
},
{
"Name": "SMART",
"Machines": [
{
"Name": "M1",
"IpMoxa": "192.168.35.10",
"IpMachineWise": "192.168.35.212",
"Note": ""
},
{
"Name": "M2",
"IpMoxa": "192.168.35.11",
"IpMachineWise": "192.168.35.211",
"Note": ""
},
{
"Name": "M3",
"IpMoxa": "192.168.35.12",
"IpMachineWise": "192.168.35.213",
"Note": ""
},
{
"Name": "M4 - CENTRO LAVORO OKUMA",
"IpMoxa": "192.168.35.13",
"IpMachineWise": "192.168.35.214",
"Note": ""
}
]
}
]
}
+34
View File
@@ -0,0 +1,34 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TrasferimentoProgrammiOkuma.App", "TrasferimentoProgrammiOkuma.App\TrasferimentoProgrammiOkuma.App.vbproj", "{C8229DCA-6227-47F6-BE2B-8698EF104AB7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|x64.ActiveCfg = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|x64.Build.0 = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|x86.ActiveCfg = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Debug|x86.Build.0 = Debug|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|Any CPU.Build.0 = Release|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|x64.ActiveCfg = Release|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|x64.Build.0 = Release|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|x86.ActiveCfg = Release|Any CPU
{C8229DCA-6227-47F6-BE2B-8698EF104AB7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="LMEMoxaTransfer.application" version="1.0.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="Compomac SPA" co.v1:suiteName="Compomac SPA" asmv2:product="LMEMoxaTransfer" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true">
<subscription>
<update>
<beforeApplicationStartup />
</update>
</subscription>
<deploymentProvider codebase="https://gitea.lmcloud.it/livio/LMEMoxaTransfer/raw/branch/main/clickonce/LMEMoxaTransfer.application" />
</deployment>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="LMEMoxaTransfer.dll.manifest" size="4831">
<assemblyIdentity name="LMEMoxaTransfer.exe" version="1.0.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>oi5lS/pRUXMeVYsdA+pak8lcLEA7jh6YsTIU0y/JugE=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
</asmv1:assembly>
+23
View File
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"LMEMoxaTransfer/1.0.0": {
"runtime": {
"LMEMoxaTransfer.dll": {}
}
}
}
},
"libraries": {
"LMEMoxaTransfer/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file not shown.
+93
View File
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="LMEMoxaTransfer.exe" version="1.0.0.0" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="msil" type="win32" />
<description asmv2:iconFile="Assets\app-icon.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
<assemblyIdentity name="Launcher" version="8.0.0.0" language="neutral" processorArchitecture="msil" />
<commandLine file="Launcher.exe" parameters="" />
</entryPoint>
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet Unrestricted="true" ID="Custom" SameSite="site" />
<defaultAssemblyRequest permissionSetReference="Custom" />
</applicationRequestMinimum>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!--
Opzioni manifesto Controllo dell'account utente
Se si vuole modificare il livello di Controllo dell'account utente di Windows, sostituire il
nodo requestedExecutionLevel con uno dei seguenti.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Se si vuole usare Virtualizzazione file system e registro di sistema per la
compatibilità con le versioni precedenti, eliminare il nodo requestedExecutionLevel.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentOS>
<osVersionInfo>
<os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" />
</osVersionInfo>
</dependentOS>
</dependency>
<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
<assemblyIdentity name="Microsoft.Windows.CommonLanguageRuntime" version="4.0.30319.0" />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Launcher.exe" size="16384">
<assemblyIdentity name="Launcher" version="8.0.0.0" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>3v/2JePabKRfZ0iw+t9nxGWMYs3Sn5Xy0OtlTNlsovs=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
<file name="Assets\app-icon.ico" size="9868">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>NM9t8/K8+c6z60ZCFceDhUGaGAJUWggXZzYw0ap3wbk=</dsig:DigestValue>
</hash>
</file>
<file name="Assets\app-icon.png" size="9846">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>vrKGEd9S1kba0lj1Dse7EraF35cGx7P3QeERgj0t9sQ=</dsig:DigestValue>
</hash>
</file>
<file name="LMEMoxaTransfer.dll" size="70656">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>jNXxFh3PRnxb5zDA++I58M/QVn1Fk7FQXBvcrYmB17w=</dsig:DigestValue>
</hash>
</file>
<file name="LMEMoxaTransfer.exe" size="161280">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>XHvEaaUXpCqo4cYw+kX/5yHnVAqbvb/DMqmvXo45vr8=</dsig:DigestValue>
</hash>
</file>
</asmv1:assembly>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true,
"CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS": false
}
}
}
Binary file not shown.
+129
View File
@@ -0,0 +1,129 @@
{
"AdminPasswordHash": "NZHINCSfx8Y4PePhYcXhbf/psJfiBfrDWRO0AgGnfE0=",
"AdminPasswordSalt": "QY9k9R4AmZvvj13geQ9N8A==",
"DefaultCompany": "SECUREX",
"MonitorRefreshSeconds": 30,
"LastReceiveDirectory": "",
"DefaultSettings": {
"Port": 10001,
"ConnectionTimeoutSeconds": 10,
"ReceiveIdleTimeoutSeconds": 15,
"SendTerminator": "%",
"LineDelayMs": 100,
"CharDelayMs": 10,
"LinePaced": true,
"CharPaced": false,
"BlockPaced": false,
"BlockSizeBytes": 32,
"BlockDelayMs": 100,
"WaitBeforeSendSeconds": 2,
"WaitAfterSendSeconds": 2
},
"Companies": [
{
"Name": "SECUREX",
"Machines": [
{
"Name": "M4 - N2LB 300",
"IpMoxa": "192.168.0.101",
"IpMachineWise": "192.168.0.214",
"Note": "OSP-U100L"
},
{
"Name": "M5 - N3LB 300",
"IpMoxa": "192.168.0.146",
"IpMachineWise": "192.168.0.47",
"Note": "OSP-E100L"
},
{
"Name": "M8 - CENTRO OKUMA",
"IpMoxa": "192.168.0.113",
"IpMachineWise": "192.168.0.68",
"Note": "OSP-P200M"
},
{
"Name": "M11 - TORNIO OKUMA LB25I-N",
"IpMoxa": "192.168.0.88",
"IpMachineWise": "192.168.0.223",
"Note": ""
},
{
"Name": "M12 - TORNIO OKUMA LB 400",
"IpMoxa": "192.168.0.99",
"IpMachineWise": "192.168.0.66",
"Note": ""
}
]
},
{
"Name": "EMILIA",
"Machines": [
{
"Name": "M1",
"IpMoxa": "192.168.30.8",
"IpMachineWise": "192.168.30.221",
"Note": ""
},
{
"Name": "M2",
"IpMoxa": "192.168.30.9",
"IpMachineWise": "192.168.30.222",
"Note": ""
},
{
"Name": "M3",
"IpMoxa": "192.168.30.10",
"IpMachineWise": "192.168.30.223",
"Note": ""
},
{
"Name": "M4 - CENTRO LAVORO OKUMA",
"IpMoxa": "192.168.30.11",
"IpMachineWise": "192.168.30.224",
"Note": ""
},
{
"Name": "M5",
"IpMoxa": "192.168.30.12",
"IpMachineWise": "192.168.30.225",
"Note": ""
},
{
"Name": "M6",
"IpMoxa": "192.168.30.13",
"IpMachineWise": "192.168.30.226",
"Note": ""
}
]
},
{
"Name": "SMART",
"Machines": [
{
"Name": "M1",
"IpMoxa": "192.168.35.10",
"IpMachineWise": "192.168.35.212",
"Note": ""
},
{
"Name": "M2",
"IpMoxa": "192.168.35.11",
"IpMachineWise": "192.168.35.211",
"Note": ""
},
{
"Name": "M3",
"IpMoxa": "192.168.35.12",
"IpMachineWise": "192.168.35.213",
"Note": ""
},
{
"Name": "M4 - CENTRO LAVORO OKUMA",
"IpMoxa": "192.168.35.13",
"IpMachineWise": "192.168.35.214",
"Note": ""
}
]
}
]
}
+120
View File
@@ -0,0 +1,120 @@
param(
[Parameter(Mandatory = $true)]
[string]$GoodFile,
[Parameter(Mandatory = $true)]
[string]$BadFile,
[int]$ContextBytes = 32,
[int]$MaxDifferences = 200
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
function Format-Byte {
param([byte]$Value)
if ($Value -eq 0x0D) { return "CR" }
if ($Value -eq 0x0A) { return "LF" }
if ($Value -eq 0x09) { return "TAB" }
if ($Value -eq 0x12) { return "DC2" }
if ($Value -eq 0x14) { return "DC4" }
if ($Value -eq 0x20) { return "SPACE" }
if ($Value -ge 32 -and $Value -le 126) { return [char]$Value }
return "."
}
function Format-Bytes {
param(
[byte[]]$Bytes,
[int]$Start,
[int]$Count
)
if ($Bytes.Length -eq 0) { return "" }
$safeStart = [Math]::Max(0, $Start)
$safeEnd = [Math]::Min($Bytes.Length - 1, $safeStart + $Count - 1)
if ($safeStart -gt $safeEnd) { return "" }
$hex = New-Object System.Collections.Generic.List[string]
$txt = New-Object System.Collections.Generic.List[string]
for ($i = $safeStart; $i -le $safeEnd; $i++) {
$hex.Add($Bytes[$i].ToString("X2"))
$txt.Add((Format-Byte $Bytes[$i]))
}
return ("HEX: " + ($hex -join " ") + [Environment]::NewLine + "TXT: " + ($txt -join " "))
}
$goodPath = (Resolve-Path -LiteralPath $GoodFile).Path
$badPath = (Resolve-Path -LiteralPath $BadFile).Path
$good = [System.IO.File]::ReadAllBytes($goodPath)
$bad = [System.IO.File]::ReadAllBytes($badPath)
Write-Host "GOOD: $goodPath"
Write-Host "BAD : $badPath"
Write-Host "GOOD length: $($good.Length) bytes"
Write-Host "BAD length: $($bad.Length) bytes"
Write-Host ""
$limit = [Math]::Min($good.Length, $bad.Length)
$diffCount = 0
for ($i = 0; $i -lt $limit; $i++) {
if ($good[$i] -ne $bad[$i]) {
$diffCount++
if ($diffCount -le $MaxDifferences) {
Write-Host ("Difference #{0} at byte {1} / 0x{1:X}" -f $diffCount, $i)
Write-Host (" GOOD: 0x{0} [{1}]" -f $good[$i].ToString("X2"), (Format-Byte $good[$i]))
Write-Host (" BAD : 0x{0} [{1}]" -f $bad[$i].ToString("X2"), (Format-Byte $bad[$i]))
Write-Host " GOOD context:"
Write-Host (Format-Bytes $good ($i - $ContextBytes) (($ContextBytes * 2) + 1))
Write-Host " BAD context:"
Write-Host (Format-Bytes $bad ($i - $ContextBytes) (($ContextBytes * 2) + 1))
Write-Host ""
}
}
}
if ($good.Length -ne $bad.Length) {
Write-Host "Files have different length."
if ($good.Length -gt $bad.Length) {
Write-Host "GOOD has extra bytes from offset $($bad.Length) / 0x$($bad.Length.ToString("X")):"
Write-Host (Format-Bytes $good $bad.Length ([Math]::Min(256, $good.Length - $bad.Length)))
} else {
Write-Host "BAD has extra bytes from offset $($good.Length) / 0x$($good.Length.ToString("X")):"
Write-Host (Format-Bytes $bad $good.Length ([Math]::Min(256, $bad.Length - $good.Length)))
}
Write-Host ""
}
Write-Host "Total differing byte positions in common length: $diffCount"
$badControls = @{}
for ($i = 0; $i -lt $bad.Length; $i++) {
$b = $bad[$i]
$allowed = $b -eq 0x09 -or $b -eq 0x0A -or $b -eq 0x0D -or ($b -ge 0x20 -and $b -le 0x7E)
if (-not $allowed) {
$key = "0x" + $b.ToString("X2") + " " + (Format-Byte $b)
if (-not $badControls.ContainsKey($key)) {
$badControls[$key] = New-Object System.Collections.Generic.List[int]
}
if ($badControls[$key].Count -lt 20) {
$badControls[$key].Add($i)
}
}
}
Write-Host ""
Write-Host "Suspicious bytes in BAD file, excluding TAB/CR/LF/ASCII printable:"
if ($badControls.Count -eq 0) {
Write-Host " none"
} else {
foreach ($entry in $badControls.GetEnumerator() | Sort-Object Name) {
Write-Host (" {0}: offsets {1}" -f $entry.Key, (($entry.Value | ForEach-Object { "$_ / 0x$($_.ToString("X"))" }) -join ", "))
}
}