Generell wird kein doc mehr erzeugt

prüfung ob uv anlage erreichbar ist
This commit is contained in:
HuskyTeufel
2022-03-25 13:42:15 +01:00
parent dea733183e
commit 3a51ada9d6
5 changed files with 36 additions and 4 deletions

View File

@@ -50,6 +50,7 @@
// cb_doc // cb_doc
// //
this.cb_doc.AutoSize = true; this.cb_doc.AutoSize = true;
this.cb_doc.Enabled = false;
this.cb_doc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cb_doc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.cb_doc.Location = new System.Drawing.Point(6, 12); this.cb_doc.Location = new System.Drawing.Point(6, 12);
this.cb_doc.Name = "cb_doc"; this.cb_doc.Name = "cb_doc";

View File

@@ -3,8 +3,10 @@ using Microsoft.Win32;
using SanShared; using SanShared;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net.NetworkInformation;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -17,6 +19,8 @@ namespace SanSystem
public event EventHandler OnStatusMessageChanged; public event EventHandler OnStatusMessageChanged;
public static readonly Global instance = new Global(); public static readonly Global instance = new Global();
const string userroot = "HKEY_CURRENT_USER\\Software"; const string userroot = "HKEY_CURRENT_USER\\Software";
const string firmkey = "Cosysda"; const string firmkey = "Cosysda";
const string subkey = "SanManager"; const string subkey = "SanManager";
@@ -29,6 +33,8 @@ namespace SanSystem
string statusMessage = ""; string statusMessage = "";
public string StatusMessage public string StatusMessage
{ {
get get
@@ -171,7 +177,18 @@ namespace SanSystem
} }
} }
public static bool CheckNetworkAnlageAvaible()
{
Ping pingSender = new Ping();
PingOptions options = new PingOptions();
string data = "aaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int timeout = 20;
PingReply reply = pingSender.Send("192.168.2.248", timeout, buffer, options);
return reply.Status == IPStatus.Success;
}
public void LoadLanguage() public void LoadLanguage()
{ {
@@ -181,7 +198,6 @@ namespace SanSystem
public Global() public Global()
{ {
LadeRegistry(); LadeRegistry();
} }
~Global() ~Global()

View File

@@ -200,6 +200,7 @@ namespace SanSystem
if (Global.Instance.AnlageType == AcceptedCSVFormats.BLUELIGHT) if (Global.Instance.AnlageType == AcceptedCSVFormats.BLUELIGHT)
{ {
OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog openFileDialog = new OpenFileDialog();
if(Global.CheckNetworkAnlageAvaible())
openFileDialog.InitialDirectory = @"\\192.168.2.248"; openFileDialog.InitialDirectory = @"\\192.168.2.248";
if (openFileDialog.ShowDialog() == DialogResult.OK) if (openFileDialog.ShowDialog() == DialogResult.OK)
{ {

View File

@@ -15,6 +15,12 @@ namespace SanSystem
public frmInfo() public frmInfo()
{ {
InitializeComponent(); InitializeComponent();
string copyright = "Dieses Programm wurde von Damian Bodde entwickelt";
string trenner = "";
for (int i = 0; i < copyright.Length; i++)
trenner += "#";
lst_info.Items.Add(copyright);
lst_info.Items.Add(trenner);
lst_info.Items.Add("Werte beziehen sich auf DN150"); lst_info.Items.Add("Werte beziehen sich auf DN150");
lst_info.Items.Add("3D Liner => ca 7% Schrumpf"); lst_info.Items.Add("3D Liner => ca 7% Schrumpf");
lst_info.Items.Add("DN125 Liner => ca 3% Schrumpf"); lst_info.Items.Add("DN125 Liner => ca 3% Schrumpf");

View File

@@ -27,7 +27,15 @@ namespace SanSystem
private void Btn_save_Click(object sender, EventArgs e) private void Btn_save_Click(object sender, EventArgs e)
{ {
string s = string.Format("{0} {1}", dateTimePicker.Value.ToShortDateString(), txt_offset.Text); string s = string.Format("{0} {1}", dateTimePicker.Value.ToShortDateString(), txt_offset.Text);
try
{
Offset = DateTime.Parse(s); Offset = DateTime.Parse(s);
}
catch(System.FormatException ex)
{
MessageBox.Show("Fehler beim Datum, es wird das jetzige Datum verwendet\n"+ex.Message);
Offset = DateTime.Now;
}
this.Close(); this.Close();
} }
} }