Commit 4b33044d authored by f4eyq's avatar f4eyq

pub visual2017 project on git

parent b4f8c56f
Pipeline #12 canceled with stages

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.489
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrxAgent", "CrxAgent\CrxAgent.csproj", "{34BC2791-71EA-4AB1-9BEF-769D639826F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
userConf|Any CPU = userConf|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.Release|Any CPU.Build.0 = Release|Any CPU
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.userConf|Any CPU.ActiveCfg = userConf|Any CPU
{34BC2791-71EA-4AB1-9BEF-769D639826F5}.userConf|Any CPU.Build.0 = userConf|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F422D431-F508-4A2F-9358-512F305E125B}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="CrxAgent.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
<userSettings>
<CrxAgent.Properties.Settings>
<setting name="param_wbs_url" serializeAs="String">
<value>http://ham.crx.cloud.test/wbsagent.php</value>
</setting>
<setting name="param_wbs_token" serializeAs="String">
<value>1-AAA-BBB</value>
</setting>
<setting name="param_udp_ip" serializeAs="String">
<value>127.0.0.1</value>
</setting>
<setting name="param_udp_port" serializeAs="String">
<value>2237</value>
</setting>
</CrxAgent.Properties.Settings>
</userSettings>
</configuration>
<Application x:Class="CrxAgent.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CrxAgent"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace CrxAgent
{
/// <summary>
/// Logique d'interaction pour App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
InitializeComponent();
}
}
}
21/03/2019 Finish the first working app, initial version 1.0
This version is only compatible with WSJT-X app.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{34BC2791-71EA-4AB1-9BEF-769D639826F5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CrxAgent</RootNamespace>
<AssemblyName>CrxAgent</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<PublishUrl>D:\DEV\CrxAgent\publication\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'userConf|AnyCPU'">
<OutputPath>bin\userConf\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>agent.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>CrxAgent.App</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>78E4F1EF917D6BB23F8D2E660C40D497420CA285</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>CrxAgent_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Settings.cs" />
<Compile Include="SyncFolderDataToWebservice.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="CrxAgent_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 et x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="agent.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>D:\DEV\CrxAgent\publication\|publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>fr-FR</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup>
<EnableSecurityDebugging>false</EnableSecurityDebugging>
</PropertyGroup>
</Project>
\ No newline at end of file
crx-qso-agent https://project.crx.cloud/crx-qso-agent
Copyright (c) Bastien Barbe F4EYQ and contributors.
All rights reserved.
crx-qso-agent is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
crx-qso-agent is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<Window x:Class="CrxAgent.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CrxAgent"
mc:Ignorable="d"
Title="CRX-QSO-AGENT" StateChanged="Window_StateChanged" Height="263.734" Width="792">
<Grid Height="241" VerticalAlignment="Top" Margin="0,0,0,-8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="89*"/>
<ColumnDefinition Width="34*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="292*"/>
<RowDefinition Height="127*"/>
</Grid.RowDefinitions>
<TextBox x:Name="textbox_wbs_url" HorizontalAlignment="Left" Height="23" Margin="114,27,0,0" TextWrapping="Wrap" Text="&#xD;&#xA;" VerticalAlignment="Top" Width="220" Grid.ColumnSpan="2"/>
<TextBox x:Name="textbox_wbs_token" HorizontalAlignment="Left" Height="23" Margin="114,53,0,0" TextWrapping="Wrap" Text="&#xD;&#xA;" VerticalAlignment="Top" Width="220" Grid.ColumnSpan="2"/>
<TextBox x:Name="textbox_udp_server_host" HorizontalAlignment="Left" Height="23" Margin="114,101,0,0" TextWrapping="Wrap" Text="&#xD;&#xA;" VerticalAlignment="Top" Width="120"/>
<TextBlock HorizontalAlignment="Left" Margin="-2,14,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-4.315,-9.64" Width="124"><Run Text=" "/><Run Text="CRX"/><Run Text="-CLOUD"/><Run Text=" "/><Run Text=" :"/><LineBreak/><Run Text=" "/><Run Text=" "/><Run Text="Webservice"/><Run Text=" URL"/><Run Text=" :"/></TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="25,53,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="23" Width="88"><Run Text="Your "/><Run Text="log "/><Run Text="token"/><Run Text=" :"/><Run Text=" "/></TextBlock>
<TextBlock HorizontalAlignment="Left" Margin="17,107,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-4.425,-4.691"><Run Text="UDP Server Host"/><Run Text=" :"/></TextBlock>
<TextBox x:Name="textbox_udp_server_port" HorizontalAlignment="Left" Height="23" Margin="114,126,0,0" TextWrapping="Wrap" Text="&#xA;" VerticalAlignment="Top" Width="81"/>
<TextBlock HorizontalAlignment="Left" Margin="17,125,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-4.425,-4.691"><Run Text="UDP Server "/><Run Text=" "/><Run Text="Port"/><Run Text=" :"/></TextBlock>
<Rectangle Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="227" Margin="43,5,0,0" Stroke="Black" VerticalAlignment="Top" Width="439" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="2"/>
<Button x:Name="button_run_agent" Content="Run agent" HorizontalAlignment="Left" Margin="258,28,0,0" Grid.Row="1" VerticalAlignment="Top" Width="98" Grid.Column="1" Click="Button_run_agent_Click" Background="#FFA9D8AB" Grid.ColumnSpan="2"/>
<Button x:Name="button_save_configuration" Content="Save configuration" HorizontalAlignment="Left" Margin="10,34,0,0" VerticalAlignment="Top" Width="108" Click="Button_save_configuration_Click" RenderTransformOrigin="0.575,-0.6" Grid.Row="1"/>
<TextBlock HorizontalAlignment="Left" Margin="6,89,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="24" Width="88" Text="WSJT-X : "/>
<Button x:Name="button_stop_agent" Content="Stop it" Grid.Column="2" HorizontalAlignment="Left" Margin="46,28,0,0" Grid.Row="1" VerticalAlignment="Top" Width="76" Click="Button_stop_agent_Click"/>
<TextBox x:Name="textbox_wbs_debug" Grid.Column="1" HorizontalAlignment="Left" Height="180" Margin="52,11,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="420" Grid.ColumnSpan="2" Grid.RowSpan="2" VerticalScrollBarVisibility="Visible"/>
</Grid>
</Window>
using System;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using System.Text;
using System.Threading;
//using System.Threading.Tasks;
using System.Net;
using System.Net.Sockets;
using System.Windows;
using System.Windows.Controls;
//using System.Windows.Forms;
namespace CrxAgent{
/// <summary>
/// Logique d'interaction pour MainWindow.xaml
/// </summary>
public partial class MainWindow : System.Windows.Window {
string appVersion = "1.0-23032019";
private System.Windows.Forms.NotifyIcon MyNotifyIcon;
private Thread thdUDPWsJtServer;
private volatile bool _threadRunning = false;
private ManualResetEvent _signal = new ManualResetEvent(false);
private SyncFolderDataToWebservice _syncFolder2Wbs;
public static MainWindow _MainWindow;
[STAThread]
public static int Main(string[] args){
if (args != null && args.Length > 0)
{
// TODO: Add your code to run in command line mode
Console.WriteLine("CrxAgent");
Console.ReadLine();
return 0;
}
else
{
var app = new App();
return app.Run();
}
}
public void DisplayMessageInfo(string Str){
var CurrentStrContent = GetText(textbox_wbs_debug);
SetText(textbox_wbs_debug, CurrentStrContent + "\n" + DateTime.Now.ToString() + " " + Str);
}
public string GetText(TextBox TB){
if (TB.Dispatcher.CheckAccess()) return TB.Text;
else return (string)TB.Dispatcher.Invoke(new Func<TextBox, string>(GetText), TB);
}
public void SetText(TextBox TB, string Str){
if (TB.Dispatcher.CheckAccess()) TB.Text = Str;
else TB.Dispatcher.Invoke(new Action<TextBox, string>(SetText), TB, Str);
}
public MainWindow(){
InitializeComponent();
_MainWindow = this;
_syncFolder2Wbs = new SyncFolderDataToWebservice(_MainWindow);
MyNotifyIcon = new System.Windows.Forms.NotifyIcon();
MyNotifyIcon.Icon = new System.Drawing.Icon(@"agent.ico");
MyNotifyIcon.MouseDoubleClick +=
new System.Windows.Forms.MouseEventHandler
(MyNotifyIcon_MouseDoubleClick);
textbox_udp_server_port.Text = Properties.Settings.Default.param_udp_port;
textbox_udp_server_host.Text = Properties.Settings.Default.param_udp_ip;
textbox_wbs_token.Text = Properties.Settings.Default.param_wbs_token;
textbox_wbs_url.Text = Properties.Settings.Default.param_wbs_url;
//textbox_wbs_debug.ScrollBars = ScrollBars.Vertical;
DisplayMessageInfo("CRX-AGENT version:" + appVersion);
DisplayMessageInfo("program is starting ...");
}
public void SERVER_UDP_WSJT_TH() {
string webservice_token = GetText(textbox_wbs_token);
string webservice_url = GetText(textbox_wbs_url);
string udp_server_host = GetText(textbox_udp_server_host);
string udp_server_port = GetText(textbox_udp_server_port);
int udp_port = Int32.Parse(udp_server_port);//cast string to int32
var udp_ip = IPAddress.Parse(udp_server_host);//cast string into IP addr
DisplayMessageInfo("INFO Launch UDP-server:" + udp_server_host + ':' + udp_server_port);
//IPAddress.Any
UdpClient myUdpServer = new UdpClient(udp_port);
try{
while (!_signal.WaitOne(0)) {
var RemoteIpEndPoint = new IPEndPoint(udp_ip, udp_port);
var data = myUdpServer.Receive(ref RemoteIpEndPoint);
string returnClientData = Encoding.ASCII.GetString(data);
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(returnClientData);
var data64client = System.Convert.ToBase64String(plainTextBytes);
//Console.WriteLine("MRX:" + returnClientData.ToString());
//look into adif and extract to dx callsign to write into debug wbs window :
Match result = Regex.Match(returnClientData.ToString(), @"<call:([0-9]{1,50})\>([A-Za-z0-9\\\=\&\:\/\,\s\\{\}\*\+\-|\?\.\(\)]{0,300})");
string callsign_dx ="";
if (result.Success){
callsign_dx = result.Groups[2].Value;
}
if(callsign_dx != ""){
Console.WriteLine("From:" + RemoteIpEndPoint.Address.ToString() + ":" + RemoteIpEndPoint.Port.ToString());
Console.WriteLine("Message-b64 RX:" + data64client.ToString());
Console.WriteLine("Message-b64 RX-SIZE:" + data64client.Length);
Console.WriteLine("R:" + returnClientData.ToString());
if (data64client.Length > 250){
var myJsonContent = JsonConvert.SerializeObject(
new
{
dx = callsign_dx,
data = data64client.ToString(),
token = webservice_token,
type = "ft8"
}
);
//save QSO into a TXT.
_syncFolder2Wbs.CreateTxtFromQSOData(myJsonContent, "ft8");
DisplayMessageInfo("INFO Rx QSO "+ callsign_dx + " from udp.");
}
}
}
}
catch (Exception e)
{
Console.WriteLine("Exception in thead SERVER_UDP_WSJT_TH:" + e.ToString());
}
finally
{
Console.WriteLine("Close UDP listenner.");
myUdpServer.Close();
}
DisplayMessageInfo("INFO local UDP server is stoped.");
_threadRunning = false;
}
void MyNotifyIcon_MouseDoubleClick(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.WindowState = WindowState.Normal;
}
private void Window_StateChanged(object sender, EventArgs e){
if (this.WindowState == WindowState.Minimized)
{
this.ShowInTaskbar = false;
MyNotifyIcon.BalloonTipTitle = "Minimize Sucessful";
MyNotifyIcon.BalloonTipText = "Minimized the app ";
MyNotifyIcon.ShowBalloonTip(400);
MyNotifyIcon.Visible = true;
}
else if (this.WindowState == WindowState.Normal)
{
MyNotifyIcon.Visible = false;
this.ShowInTaskbar = true;
}
}
private void Button_Click(object sender,RoutedEventArgs e) { }
private void Button_run_agent_Click(object sender, RoutedEventArgs e) {
_syncFolder2Wbs.SetWebserviceUrl(textbox_wbs_url.Text);
_syncFolder2Wbs.CreateAppDataFolder("crx-agent");
if (!_threadRunning){
_signal.Reset();
Console.WriteLine("Starting Wsjt-x-udp-server ... ");
thdUDPWsJtServer = new Thread(new ThreadStart(SERVER_UDP_WSJT_TH));
thdUDPWsJtServer.Name = "Wsjt-x-udp-server";
thdUDPWsJtServer.IsBackground = true;
thdUDPWsJtServer.Start();
_threadRunning = true;
_syncFolder2Wbs.ReadDataQsoFolderAndSyncQsoWithWebservice();
_syncFolder2Wbs.WatchNewFileIntoAppDataQsoFolder();
}
else
{
Console.WriteLine("Wsjt-x-udp-server already running.");
}
}
private void Button_stop_agent_Click(object sender, RoutedEventArgs e){
_signal.Set();
if (_threadRunning){
DisplayMessageInfo("Ask Wsjt-x-udp-server to stop now.");
//var m16 = GetText(textbox_wbs_debug);
//SetText(textbox_wbs_debug, m16 + "\n" + DateTime.Now.ToString() + " Ask UDP server to stop now.");
}
_threadRunning = false;
if (thdUDPWsJtServer != null){
// thdUDPWsJtServer.Join();
Console.WriteLine("Wait Wsjt-x-udp-server to stop ...");
}
}
private void SetDebugWindowText(string txt){
var m16 = GetText(textbox_wbs_debug);
SetText(textbox_wbs_debug, m16 + "\n" + DateTime.Now.ToString() + txt);
}
private void Button_save_configuration_Click(object sender, RoutedEventArgs e){
Properties.Settings.Default.param_udp_port = textbox_udp_server_port.Text;
Properties.Settings.Default.param_udp_ip = textbox_udp_server_host.Text;
Properties.Settings.Default.param_wbs_token = textbox_wbs_token.Text;
Properties.Settings.Default.param_wbs_url = textbox_wbs_url.Text;
Properties.Settings.Default.Save();
Properties.Settings.Default.Upgrade();
_syncFolder2Wbs.SetWebserviceUrl(textbox_wbs_url.Text);
DisplayMessageInfo("INFO Configuration has been saved.");
}
private void Textbox_wbs_debug_TextChanged(object sender, TextChangedEventArgs e) { }
}
}
\ No newline at end of file
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("CrxAgent")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CrxAgent")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
//Pour commencer à générer des applications localisables, définissez
//<UICulture>CultureUtiliséePourCoder</UICulture> dans votre fichier .csproj
//dans <PropertyGroup>. Par exemple, si vous utilisez le français
//dans vos fichiers sources, définissez <UICulture> à fr-FR. Puis, supprimez les marques de commentaire de
//l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans
//la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //où se trouvent les dictionnaires de ressources spécifiques à un thème
//(utilisé si une ressource est introuvable dans la page,
// ou dictionnaires de ressources de l'application)
ResourceDictionaryLocation.SourceAssembly //où se trouve le dictionnaire de ressources générique
//(utilisé si une ressource est introuvable dans la page,
// dans l'application ou dans l'un des dictionnaires de ressources spécifiques à un thème)
)]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :