コード例 #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         ProtokollerConfiguration.Load();
     }
     catch (Exception ex)
     { }
 }
 private void cmdCopyDataset_Click(object sender, RoutedEventArgs e)
 {
     if (grdDatasets.SelectedItem != null)
     {
         var newDS = ((DatasetConfig)grdDatasets.SelectedItem).Clone();
         newDS.Name += "_" + (ProtokollerConfiguration.ActualConfigInstance.Datasets.Count + 1);
         ProtokollerConfiguration.ActualConfigInstance.Datasets.Add(newDS);
         ProtokollerConfiguration.ReReferenceProtokollerConfiguration(ProtokollerConfiguration.ActualConfigInstance);
     }
 }
コード例 #3
0
        private void cmdLoadFromFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "*.conf|*.conf";
            if (dlg.ShowDialog() == true)
            {
                ProtokollerConfiguration.LoadFromFile(dlg.FileName);
            }
        }
コード例 #4
0
        private void cmdSaveToFile_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "*.conf|*.conf";
            if (dlg.ShowDialog() == true)
            {
                ProtokollerConfiguration.SaveToFile(dlg.FileName);
            }
        }
 protected override void OnStart(string[] args)
 {
     try
     {
         ProtokollerConfiguration.Load();
         myInstance = new ProtokollerInstance(ProtokollerConfiguration.ActualConfigInstance);
         myInstance.Start(true);
     }
     catch (Exception ex)
     {
         Logging.LogText("Exception occured! ", ex, Logging.LogLevel.Error);
     }
 }
コード例 #6
0
        public MultiStorage(ProtokollerConfiguration protokollerConfiguration, StorageConfig config, Action <string> NewDataCallback)
        {
            this._protokollerConfiguration = protokollerConfiguration;
            this._newDataCallback          = NewDataCallback;

            storages      = new List <DBBaseClass>();
            this.myConfig = config as MultiStorageConfig;

            foreach (string s in myConfig.StorageList)
            {
                var storCfg = _protokollerConfiguration.Storages.First(x => x.Name == s);
                var stor    = (DBBaseClass)StorageHelper.GetStorage(null, storCfg, RemotingServer.ClientComms.CallNotifyEvent);
                storages.Add(stor);

                storrageConfigs.Add(stor, storCfg);
            }
        }
        protected override void OnStart(string[] args)
        {
            try
            {
                TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;


                ProtokollerConfiguration.Load();
                myInstance = new ProtokollerInstance(ProtokollerConfiguration.ActualConfigInstance);
                myInstance.Start(true);
            }
            catch (Exception ex)
            {
                Logging.LogText("Exception occured! ", ex, Logging.LogLevel.Error);
            }
        }
コード例 #8
0
        public MultiStorage(ProtokollerConfiguration protokollerConfiguration, StorageConfig config, Action<string> NewDataCallback)
        {
            this._protokollerConfiguration = protokollerConfiguration;
            this._newDataCallback = NewDataCallback;

            storages = new List<DBBaseClass>();
            this.myConfig = config as MultiStorageConfig;

            foreach (string s in myConfig.StorageList)
            {
                var storCfg = _protokollerConfiguration.Storages.First(x => x.Name == s);
                var stor = (DBBaseClass)StorageHelper.GetStorage(null, storCfg, RemotingServer.ClientComms.CallNotifyEvent);
                storages.Add(stor);

                storrageConfigs.Add(stor, storCfg);

            }   
        }
コード例 #9
0
 public static IDBInterface GetStorage(ProtokollerConfiguration config, StorageConfig cfg, Action <string> NewDataCallback)
 {
     if (cfg is SQLiteConfig)
     {
         return(new SQLLiteStorage(NewDataCallback));
     }
     else if (cfg is CSVConfig)
     {
         return(new CSVStorage(NewDataCallback));
     }
     else if (cfg is ExcelConfig)
     {
         return(new ExcelStorage(NewDataCallback));
     }
     else if (cfg is PostgreSQLConfig)
     {
         return(new PostgreSQLStorage(NewDataCallback));
     }
     else if (cfg is MySQLConfig)
     {
         return(new MySQLStorage(NewDataCallback));
     }
     else if (cfg is Excel2007Config)
     {
         return(new Excel2007Storage(NewDataCallback));
     }
     else if (cfg is MsSQLConfig)
     {
         return(new MsSQLStorage(NewDataCallback));
     }
     else if (cfg is PLCConfig)
     {
         return(new PLCStorage(NewDataCallback));
     }
     else if (cfg is MultiStorageConfig)
     {
         return(new MultiStorage.MultiStorage(config, cfg, NewDataCallback));
     }
     return(null);
 }
コード例 #10
0
 public static IDBInterface GetStorage(ProtokollerConfiguration config, StorageConfig cfg, Action<string> NewDataCallback)
 {
     if (cfg is SQLiteConfig)
         return new SQLLiteStorage(NewDataCallback);
     else if (cfg is CSVConfig)
         return new CSVStorage(NewDataCallback);
     else if (cfg is ExcelConfig)
         return new ExcelStorage(NewDataCallback);
     else if (cfg is PostgreSQLConfig)
         return new PostgreSQLStorage(NewDataCallback);
     else if (cfg is MySQLConfig)
         return new MySQLStorage(NewDataCallback);
     else if (cfg is Excel2007Config)
         return new Excel2007Storage(NewDataCallback);
     else if (cfg is MsSQLConfig)
         return new MsSQLStorage(NewDataCallback);
     else if (cfg is PLCConfig)
         return new PLCStorage(NewDataCallback);
     else if (cfg is MultiStorageConfig)
         return new MultiStorage.MultiStorage(config, cfg, NewDataCallback);
     return null;
 }        
コード例 #11
0
 public ProtokollerInstance(ProtokollerConfiguration akConfig)
 {
     this.akConfig = akConfig;
 }
コード例 #12
0
 public ProtokollerInstance(ProtokollerConfiguration akConfig)
 {
     this.akConfig = akConfig;
 }
コード例 #13
0
 private void cmdImport_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.ImportFromRegistry();
 }
コード例 #14
0
 private void cmdClear_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Clear();
 }
コード例 #15
0
 private void cmdReload_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Load();
 }
コード例 #16
0
 private void cmdsave_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Save();
 }