Пример #1
0
 public static void Archive_OnClick(OpcServer.OpcList opcName, string nameStation = "")
 {
     try
     {
         bool          postgresql = ServiceData.GetInstance().GetSqlName() == "PostgreSQL";
         WindowArchive window     = new WindowArchive(OpcServer.GetInstance().GetConnectionStringData(opcName), null,
                                                      0, true, OpcServer.GetInstance().GetOpc(opcName).AnalogTags, OpcServer.GetInstance().GetOpc(opcName).DiscreteTags,
                                                      postgresql, OpcServer.GetInstance().GetObjectData(opcName).SqlTableName, nameStation, new DataNewArchiverReader());
         window.SaveGraphLeg += OnSaveGraphLeg;
         window.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ошибка:" + ex.Message);
     }
 }
Пример #2
0
 public static void Archive_OnClick()
 {
     try
     {
         //var connectionString = "server=localhost; user id=AS_Library;password=asuasu123;database=DbRbuDatabaseNew";
         //var opc = new OPC_client("opc.tcp://localhost:49320", "server=localhost;user id=AS_Library;password=asuasu123;database=DbOpcTables", "Rbu");
         //opc.cl.Connect("localhost", "", 100);0
         WindowArchive window = new WindowArchive(OpcServer.GetInstance().GetConnectionStringData(OpcServer.OpcList.Rbu), null,
                                                  0, true, OpcServer.GetInstance().GetOpc(OpcServer.OpcList.Rbu).AnalogTags, OpcServer.GetInstance().GetOpc(OpcServer.OpcList.Rbu).DiscreteTags,
                                                  true, OpcServer.GetInstance().GetObjectData(OpcServer.OpcList.Rbu).SqlTableName, "", new DataNewArchiverReader());
         window.SaveGraphLeg += OnSaveGraphLeg;
         window.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ошибка:" + ex.Message);
     }
 }