https://github.com/saintzet/fiscaldevicestatusdecoder
Program for decode HEX response from fiscal device to Binary and transformation into a comfortable look using the documentation of this device.
https://github.com/saintzet/fiscaldevicestatusdecoder
binary daisy datecs ddd domain-driven-design eltrade fd fiscal fiscal-printer fiscaldevices hex incotex mvvm mvvm-architecture port tremol unit-testing wpf xaml
Last synced: about 1 month ago
JSON representation
Program for decode HEX response from fiscal device to Binary and transformation into a comfortable look using the documentation of this device.
- Host: GitHub
- URL: https://github.com/saintzet/fiscaldevicestatusdecoder
- Owner: SaintZet
- License: unlicense
- Created: 2022-07-29T15:19:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-14T22:23:24.000Z (about 3 years ago)
- Last Synced: 2023-04-16T17:20:19.401Z (about 3 years ago)
- Topics: binary, daisy, datecs, ddd, domain-driven-design, eltrade, fd, fiscal, fiscal-printer, fiscaldevices, hex, incotex, mvvm, mvvm-architecture, port, tremol, unit-testing, wpf, xaml
- Language: C#
- Homepage:
- Size: 165 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This application will help you decode the response from the fiscal device.
How:
* It accepts numbers in HEX format as input.
Removes all invalid characters. Removes numbers less than **127**.
For example: *04H 80H 80H C0H 80H 80H B8H 05H* > *80 80 C0 80 80 B8*.
* Converts to bytes *80 80 C0 80 80 B8 FF FF* > *10000000 10000000 11000000 10000000 10000000 10111000*.
* Parse on existing documentation.
Of course, you will have to make changes to the program if you are interested in other groups of fiscal devices or other manufacturers.
## Getting Started
### Dependencies
.NET 6.0 Runtime
### Installing
#### Add manufacturer
Create new Manufacturer in Domain/Manufacturer.
```csharp
public sealed class *YourManufacturer* : BaseManufacturer
{
...
}
```
#### Add documentation
Add new line in property **AllModels**. Find at Domain/Manufacturer/*YourManufacturer*.cs
```csharp
public override Dictionary<(string[], Country), Dictionary<(int, int), string>>? AllModels => new()
{
{(new string[] { "DP-05", "DP-25", "DP-35", "WP-50", "DP-150" }, Country.BG), Document1! },
{(new string[] { "YourModel1", "YourModel2", "YourModel3" }, Country.YourCountry), YourDocument! },
...
};
```
P.S. Example for document you can find in *BaseManufacturer.cs*
P.P.S. Usually in documantation from manufacturer FD first Bit from left have name 0.7, but we are call it 0.0
#### Add target devices to application process
Add new line in method **InitializeDevices**. Find at Application/MainViewModel.cs
```csharp
private static List InitializeDevices() => new List()
{
new DeviceModels(Datecs.Instance, 6 , Country.BG , new string[] { "DP-05", "DP-25", "DP-35", "WP-50", "DP-150" }),
new DeviceModels(YourManufacturer.Instance, 6, Country.YourCountry, new string[] { "YourModel1" }),
...
};
```
### Portable version
If u wanna create portable version(only .exe file) use this CMD line for build in project directory.
```
dotnet publish -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
```
## Authors
Chepets Serhii
Contacts: [LinkedIn](https://www.linkedin.com/in/serhii-chepets-412b46223/) / [GitHub](https://github.com/SaintZet) / [Telegram](https://t.me/SaintZet)
## Version History
* v1.0.0
* Removes all invalid characters in input field .
* Removes HEX numbers less than 127(DEC).
* Converts HEX to bytes.
* Parse on existing documentation.
* Error messages when trying to decode invalid values for specific fiscal machine.
## License
This project is unlicensed.
