keky

SNUS - test 01 - example

Nov 11th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim GornjaGranica As Single
  2. Dim DonjaGranica As Single
  3. Dim oExcel As Object
  4. Dim oBook As Object
  5. Dim oSheet As Object
  6. Dim MSWord As Object
  7. Dim oDoc As Object
  8. Dim oPara1 As Object
  9.  
  10. Private Sub AlarmSummaryOCX1_AlarmAck()
  11.  
  12. End Sub
  13.  
  14. Private Sub CFixPicture_Initialize()
  15.     Fix32.Fix.VENTIL.F_CV = False
  16.     Fix32.Fix.PUMPA.F_CV = False
  17.     Fix32.Fix.NIVO_REZERVOARA = 25
  18.     Combo_Load
  19.    
  20. End Sub
  21.  
  22. Private Sub DGButton_Click()
  23.     DonjaGranica = CSng(DGBox.Text)
  24. End Sub
  25.  
  26. Private Sub ExcelButton_Click()
  27.     'Start a new workbook in Excel
  28.    Set oExcel = CreateObject("Excel.Application")
  29.     oExcel.Visible = True
  30.     Set oBook = oExcel.Workbooks.Add
  31.  
  32.     'Add data to cells of the first worksheet in the new workbook
  33.    Set oSheet = oBook.Worksheets(1)
  34.     oSheet.Range("A1").Value = "Nivo rezervoara"
  35.     oSheet.Range("B1").Value = Fix32.Fix.NIVO_REZERVOARA.F_CV
  36.  
  37.     'Save the Workbook and Quit Excel
  38.  
  39.     oBook.SaveAs "C:\Book1.xls"
  40.    
  41.     oExcel.Quit
  42. End Sub
  43.  
  44. Private Sub GGButton_Click()
  45.     GornjaGranica = CSng(GGBox.Text)
  46. End Sub
  47.  
  48. Private Sub RezimBox_Click()
  49.     If RezimBox.ListIndex = 0 Then
  50.         TextBox3.Text = "Automatski"
  51.     Else
  52.         TextBox3.Text = "Rucni"
  53.     End If
  54.    
  55.    
  56. End Sub
  57.  
  58. Private Sub Combo_Load()
  59.     RezimBox.AddItem "Automatski"
  60.     RezimBox.AddItem "Rucni"
  61. End Sub
  62.  
  63. Private Sub CFixPicture_KeyDown(ByVal KeyCode As Long, ByVal Shift As Long, ContinueProcessing As Boolean)
  64.  
  65. End Sub
  66.  
  67. Private Sub PipeHorz2_Edit()
  68.     frmPipes.InitializeDynamo PipeHorz2
  69.     frmPipes.Show
  70. End Sub
  71.  
  72. Private Sub PipeHorz1_Edit()
  73.     frmPipes.InitializeDynamo PipeHorz1
  74.     frmPipes.Show
  75. End Sub
  76.  
  77. Private Sub PipeVert3_Edit()
  78.     frmPipes.InitializeDynamo PipeVert3
  79.     frmPipes.Show
  80. End Sub
  81.  
  82. Private Sub PipeVert2_Edit()
  83.     frmPipes.InitializeDynamo PipeVert2
  84.     frmPipes.Show
  85. End Sub
  86.  
  87. Private Sub PumpCentrifugalAnimA1_Click()
  88.     'The Comments below have been added automatically.
  89.    'Any changes could cause adverse effects to the functionality
  90.    'of the Script Authoring Experts.
  91.    'WizardName=ToggleDigitalPoint
  92.    'Property1=Fix32.FIX.PUMPA.F_CV
  93.    'Property2=False
  94.    ToggleDigitalPoint "Fix32.FIX.PUMPA.F_CV"
  95. End Sub
  96.  
  97. Private Sub Tajmer_OnTimeOut(ByVal lTimerId As Long)
  98.  
  99.     If RezimBox.Value = "Automatski" Then
  100.         Radi
  101.         Automatski
  102.        
  103.     ElseIf RezimBox.Value = "Rucni" Then
  104.         Radi
  105.         Rucni
  106.     End If
  107.    
  108.    
  109.    
  110. End Sub
  111.  
  112. Private Sub Rucni()
  113.     If Fix32.Fix.NIVO_REZERVOARA.F_CV < DonjaGranica Then
  114.         Fix32.Fix.PUMPA.F_CV = True
  115.         Fix32.Fix.VENTIL.F_CV = False
  116.     ElseIf Fix32.Fix.NIVO_REZERVOARA.F_CV > GornjaGranica Then
  117.         Fix32.Fix.PUMPA.F_CV = False
  118.         Fix32.Fix.VENTIL.F_CV = True
  119.     End If
  120. End Sub
  121.  
  122. Private Sub Automatski()
  123.     If Fix32.Fix.NIVO_REZERVOARA.F_CV < 7.5 Then
  124.         Fix32.Fix.PUMPA.F_CV = True
  125.         Fix32.Fix.VENTIL.F_CV = False
  126.     ElseIf Fix32.Fix.NIVO_REZERVOARA.F_CV > 42.5 Then
  127.         Fix32.Fix.PUMPA.F_CV = False
  128.         Fix32.Fix.VENTIL.F_CV = True
  129.     End If
  130.        
  131. End Sub
  132.  
  133. Private Sub Radi()
  134.     If Fix32.Fix.PUMPA.F_CV And Fix32.Fix.VENTIL.F_CV = False Then
  135.         Fix32.Fix.NIVO_REZERVOARA.F_CV = Fix32.Fix.NIVO_REZERVOARA.F_CV + 2
  136.     ElseIf Fix32.Fix.PUMPA.F_CV And Fix32.Fix.VENTIL.F_CV Then
  137.         Fix32.Fix.NIVO_REZERVOARA.F_CV = Fix32.Fix.NIVO_REZERVOARA.F_CV - 2
  138.     ElseIf Fix32.Fix.PUMPA.F_CV = False And Fix32.Fix.VENTIL Then
  139.         Fix32.Fix.NIVO_REZERVOARA.F_CV = Fix32.Fix.NIVO_REZERVOARA.F_CV - 4
  140.     Else
  141.         Fix32.Fix.PUMPA.F_CV = True
  142.        
  143.        
  144.     End If
  145. End Sub
  146. Private Sub TextBox3_Change()
  147.  
  148. End Sub
  149.  
  150. Private Sub TrendButton_Click()
  151.     'The Comments below have been added automatically.
  152.    'Any changes could cause adverse effects to the functionality
  153.    'of the Script Authoring Experts.
  154.    'WizardName=OpenPicture
  155.    'Property1=priprema_kol1_hist.grf
  156.    'Property2=
  157.    'Property3=False
  158.    'Property4=
  159.    'Property5=
  160.    'Property6=False
  161.    'Property7=
  162.    'Property8=False
  163.    OpenPicture "priprema_kol1_hist.grf", "", "", ""
  164. End Sub
  165.  
  166. Private Sub ValveHorizontalOnOff1_Click()
  167.     'The Comments below have been added automatically.
  168.    'Any changes could cause adverse effects to the functionality
  169.    'of the Script Authoring Experts.
  170.    'WizardName=ToggleDigitalPoint
  171.    'Property1=Fix32.FIX.VENTIL.F_CV
  172.    'Property2=False
  173.    ToggleDigitalPoint "Fix32.FIX.VENTIL.F_CV"
  174. End Sub
  175.  
  176. Private Sub ValveHorizontalOnOff1_Edit()
  177.     frmValveColorAnim.InitializeDynamo ValveHorizontalOnOff1
  178.     frmValveColorAnim.Show
  179. End Sub
  180.  
  181. Private Sub PipeSqrElbowUL1_Edit()
  182.     frmPipes.InitializeDynamo PipeSqrElbowUL1
  183.     frmPipes.Show
  184. End Sub
  185.  
  186. Private Sub PipeVert1_Edit()
  187.     frmPipes.InitializeDynamo PipeVert1
  188.     frmPipes.Show
  189. End Sub
  190.  
  191. Private Sub TankBatchE1_Edit()
  192.     frmTankAnim.InitializeDynamo TankBatchE1
  193.     frmTankAnim.Show
  194. End Sub
  195.  
  196. Private Sub PumpCentrifugalAnimA1_Edit()
  197.     frmPumpAnim.InitializeDynamo PumpCentrifugalAnimA1
  198.     frmPumpAnim.Show
  199. End Sub
  200. Private Sub PipeSqrElbowUR1_Edit()
  201.     frmPipes.InitializeDynamo PipeSqrElbowUR1
  202.     frmPipes.Show
  203. End Sub
  204.  
  205. Private Sub PipeRndElbowLL1_Edit()
  206.     frmPipes.InitializeDynamo PipeRndElbowLL1
  207.     frmPipes.Show
  208. End Sub
  209.  
  210. Private Sub WordButton_Click()
  211.  
  212.     Set MSWord = CreateObject("Word.Application")
  213.     Set oDoc = MSWord.Documents.Add
  214.     MSWord.Visible = True
  215.    
  216.     Set oPara1 = oDoc.Content.Paragraphs.Add
  217.     oPara1.Range.Text = "Nivo rezervoara " + CStr(Fix32.Fix.NIVO_REZERVOARA.F_CV)
  218.     oPara1.Range.Font.Bold = True
  219.    
  220.     oDoc.SaveAs "C:\Kol1.doc"
  221.    
  222.     MSWord.Quit
  223. End Sub
Advertisement
Add Comment
Please, Sign In to add comment