Subversion Repositories jheat

Rev

Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 2
Line 1... Line 1...
1
package heizung;
1
package heizung;
2
 
2
 
-
 
3
import javax.swing.JButton;
3
import javax.swing.JLabel;
4
import javax.swing.JLabel;
4
import javax.swing.JTextField;
5
import javax.swing.JTextField;
5
import javax.swing.JFrame;
6
import javax.swing.JFrame;
6
import javax.swing.JComboBox;
7
import javax.swing.JComboBox;
7
import javax.swing.GroupLayout;
8
import javax.swing.GroupLayout;
Line 13... Line 14...
13
import java.lang.Float;
14
import java.lang.Float;
14
import java.util.Calendar;
15
import java.util.Calendar;
15
import java.util.Date;
16
import java.util.Date;
16
 
17
 
17
public class heizung implements ActionListener {
18
public class heizung implements ActionListener {
-
 
19
	// Network
-
 
20
	private String strServerName = "www.theosys.at";
18
	// Head
21
	// Head
19
	private JComboBox cmbWDay = new JComboBox();
22
	private JComboBox cmbWDay = new JComboBox();
20
	// Spalte 2 - Von
23
	// Spalte 2 - Von
21
	private JTextField tfVon_1 = new JTextField();
24
	private JTextField tfVon_1 = new JTextField();
22
	private JTextField tfVon_2 = new JTextField();
25
	private JTextField tfVon_2 = new JTextField();
Line 48... Line 51...
48
	private JTextField tfTemp_6 = new JTextField();
51
	private JTextField tfTemp_6 = new JTextField();
49
	private JTextField tfTemp_7 = new JTextField();
52
	private JTextField tfTemp_7 = new JTextField();
50
	private JTextField tfTemp_8 = new JTextField();
53
	private JTextField tfTemp_8 = new JTextField();
51
	private JTextField tfTemp_9 = new JTextField();
54
	private JTextField tfTemp_9 = new JTextField();
52
	private JTextField tfTemp_10 = new JTextField();
55
	private JTextField tfTemp_10 = new JTextField();
-
 
56
	// Bottom line with buttons
-
 
57
	private JButton btSave = new JButton();
-
 
58
	private JButton btExit = new JButton();
-
 
59
	private JButton btSchema = new JButton();
53
 
60
 
54
	private int actWDay = 0;
61
	private int actWDay = 0;
55
 
62
 
56
	private void createAndShowGUI() {
63
	private void createAndShowGUI() {
57
		// The main window
64
		// The main window
Line 94... Line 101...
94
			actWDay = 7;
101
			actWDay = 7;
95
		else
102
		else
96
			actWDay--;
103
			actWDay--;
97
 
104
 
98
		cmbWDay.setSelectedIndex(actWDay - 1);
105
		cmbWDay.setSelectedIndex(actWDay - 1);
-
 
106
		// Initialize the buttons
-
 
107
		btSave.setText("Speichern");
-
 
108
		btSave.addActionListener(new java.awt.event.ActionListener() {
-
 
109
			public void actionPerformed(java.awt.event.ActionEvent e) {
-
 
110
				saveButtonActionPerformed(e);
-
 
111
			}
-
 
112
		});
-
 
113
 
-
 
114
		btExit.setText("Exit");
-
 
115
		btExit.addActionListener(new java.awt.event.ActionListener() {
-
 
116
            public void actionPerformed(java.awt.event.ActionEvent e) {
-
 
117
            	exitButtonActionPerformed(e);
-
 
118
            }
-
 
119
		});
-
 
120
		
-
 
121
		btSchema.setText("Schema");
-
 
122
		btSchema.addActionListener(new java.awt.event.ActionListener() {
-
 
123
            public void actionPerformed(java.awt.event.ActionEvent e) {
-
 
124
            	/* To do */
-
 
125
            }
-
 
126
		});
-
 
127
 
99
		// Define and initialize the layout
128
		// Define and initialize the layout
100
		GroupLayout layout = new GroupLayout(frame.getContentPane());
129
		GroupLayout layout = new GroupLayout(frame.getContentPane());
101
		frame.getContentPane().setLayout(layout);
130
		frame.getContentPane().setLayout(layout);
102
		layout.setHorizontalGroup(
131
		layout.setHorizontalGroup(
103
	            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
132
	            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
Line 194... Line 223...
194
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
223
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
195
	                    	.addComponent(tfVon_10, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
224
	                    	.addComponent(tfVon_10, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
196
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
225
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
197
	                    	.addComponent(tfBis_10, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
226
	                    	.addComponent(tfBis_10, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE)
198
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
227
	                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
199
	                    	.addComponent(tfTemp_10, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)))
228
	                    	.addComponent(tfTemp_10, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE))
-
 
229
	                    .addGroup(layout.createSequentialGroup()
-
 
230
	                    	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-
 
231
	                    	.addComponent(btSave, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-
 
232
	                    	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-
 
233
	                    	.addComponent(btSchema, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-
 
234
	                    	.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-
 
235
	                    	.addComponent(btExit, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
200
	                .addContainerGap(27, Short.MAX_VALUE))
236
	                .addContainerGap(27, Short.MAX_VALUE))
201
	        );
237
	        );
202
 
238
 
203
 
239
 
204
        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lbl_top1, lbl_top2, lbl_top3, lbl_top4});
240
        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {lbl_top1, lbl_top2, lbl_top3, lbl_top4});
Line 274... Line 310...
274
                    	.addComponent(lbl_10)
310
                    	.addComponent(lbl_10)
275
                    	.addComponent(tfVon_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
311
                    	.addComponent(tfVon_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
276
                    	.addComponent(tfBis_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
312
                    	.addComponent(tfBis_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
277
                    	.addComponent(tfTemp_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
313
                    	.addComponent(tfTemp_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
278
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
314
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-
 
315
	                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-
 
316
	                    	.addComponent(btSave, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-
 
317
	                    	.addComponent(btSchema, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-
 
318
	                    	.addComponent(btExit, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-
 
319
	                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
279
	                .addContainerGap(21, Short.MAX_VALUE))
320
	                .addContainerGap(21, Short.MAX_VALUE))
280
	        );
321
	        );
281
		//Display the window.
322
		//Display the window.
282
        frame.pack();
323
        frame.pack();
283
        frame.setVisible(true);
324
        frame.setVisible(true);
284
	}
325
	}
285
	
326
	
-
 
327
	/**
-
 
328
     * This method performs saveButtonActionPerformed   
-
 
329
     */
286
//	private void saveButtonActionPerformed(ActionEvent evt) {
330
	private void saveButtonActionPerformed(ActionEvent evt) {
-
 
331
		int idx = cmbWDay.getSelectedIndex();
-
 
332
 
-
 
333
		saveDay(idx + 1);
-
 
334
		clearLines();
-
 
335
		readDay(idx + 1);
287
//	}
336
	}
288
	
337
	
-
 
338
	private void exitButtonActionPerformed(ActionEvent evt) {
-
 
339
		System.exit(0);
-
 
340
	}
289
 
341
 
290
	private String timeToString(long tm) {
342
	private String timeToString(long tm) {
291
		int hour, min;
343
		int hour, min;
292
 
344
 
293
		hour = (int)(tm / 3600);
345
		hour = (int)(tm / 3600);
294
		min = (int)((tm - (hour * 3600)) / 60);
346
		min = (int)((tm - (hour * 3600)) / 60);
295
		return String.format("%02d:%02d",hour, min);
347
		return String.format("%02d:%02d",hour, min);
296
	}
348
	}
297
 
349
 
-
 
350
	private boolean isDigit(int ch)
-
 
351
	{
-
 
352
		if (ch < '0' || ch > '9')
-
 
353
			return false;
-
 
354
 
-
 
355
		return true;
-
 
356
	}
-
 
357
	private long stringToTime(String stm)
-
 
358
	{
-
 
359
		int hour, min, i;
-
 
360
		long tm;
-
 
361
 
-
 
362
		if (stm.length() != 5 || !stm.contains(":") || stm.indexOf(':') != 2)
-
 
363
			return 0;
-
 
364
 
-
 
365
		for (i = 0; i < stm.length(); i++)
-
 
366
		{
-
 
367
			if (i != 2 && !isDigit(stm.charAt(i)))
-
 
368
				return 0;
-
 
369
		}
-
 
370
 
-
 
371
		hour = Integer.parseInt(stm.substring(0, 2));
-
 
372
		min = Integer.parseInt(stm.substring(3, 5));
-
 
373
 
-
 
374
		if (hour < 0 || hour > 23 || min < 0 || min > 59)
-
 
375
			return 0;
-
 
376
 
-
 
377
		tm = (long)(hour * 3600 + min * 60);
-
 
378
		return tm;
-
 
379
	}
-
 
380
 
298
	private void decode(String str) {
381
	private void decode(String str) {
299
		// Check for initial key word
382
		// Check for initial key word
300
		if (str.startsWith("LINE:"))
383
		if (str.startsWith("LINE:"))
301
		{
384
		{
302
		rm_str lr = new rm_str();
385
		rm_str lr = new rm_str();
Line 446... Line 529...
446
			return false;
529
			return false;
447
 
530
 
448
		ch = new char[2];
531
		ch = new char[2];
449
 
532
 
450
		try {
533
		try {
451
            s = new Socket("localhost", 11001);
534
            s = new Socket(strServerName, 11001);
452
            s.setSoTimeout(3000);
535
            s.setSoTimeout(3000);
453
            out = new PrintWriter(s.getOutputStream(), true);
536
            out = new PrintWriter(s.getOutputStream(), true);
454
            in = new BufferedReader(new InputStreamReader(s.getInputStream()));
537
            in = new BufferedReader(new InputStreamReader(s.getInputStream()));
455
        }
538
        }
456
		catch (UnknownHostException e) {
539
		catch (UnknownHostException e) {
Line 461... Line 544...
461
		{
544
		{
462
			System.err.println("Could't set timeout: "+e.getMessage());
545
			System.err.println("Could't set timeout: "+e.getMessage());
463
			System.exit(1);
546
			System.exit(1);
464
		}
547
		}
465
		catch (IOException e) {
548
		catch (IOException e) {
466
            System.err.println("Couldn't get I/O for the connection to: localhost: "+e.getMessage());
549
            System.err.println("Couldn't get I/O for the connection to: "+strServerName+": "+e.getMessage());
467
            System.exit(1);
550
            System.exit(1);
468
        }
551
        }
469
 
552
 
470
		// Just wait a little to let daemon initialize
553
		// Just wait a little to let daemon initialize
471
		try {
554
		try {
472
			Thread.sleep(1000);
555
			Thread.sleep(500);
473
		} catch (InterruptedException e1) {
556
		} catch (InterruptedException e1) {
474
			System.out.println("Error: "+e1.getMessage());
557
			System.out.println("Error: "+e1.getMessage());
475
		}
558
		}
476
 
559
 
477
		// Request a particular day
560
		// Request a particular day
Line 520... Line 603...
520
		}
603
		}
521
 
604
 
522
		return true;
605
		return true;
523
	}
606
	}
524
 
607
 
-
 
608
	public boolean saveDay(int wday)
-
 
609
	{
-
 
610
		Socket s = null;
-
 
611
		PrintWriter out = null;
-
 
612
		BufferedReader in = null;
-
 
613
		char[] ch;
-
 
614
		String answer;
-
 
615
		int i, numLines = 0;
-
 
616
		int err = 0;
-
 
617
		float tp;
-
 
618
 
-
 
619
		if (wday < 1 || wday > 7)
-
 
620
			return false;
-
 
621
 
-
 
622
		ch = new char[2];
-
 
623
 
-
 
624
		try {
-
 
625
            s = new Socket(strServerName, 11001);
-
 
626
            s.setSoTimeout(3000);
-
 
627
            out = new PrintWriter(s.getOutputStream(), true);
-
 
628
            in = new BufferedReader(new InputStreamReader(s.getInputStream()));
-
 
629
        }
-
 
630
		catch (UnknownHostException e) {
-
 
631
            System.err.println("Don't know about host: "+strServerName+": "+e.getMessage());
-
 
632
            System.exit(1);
-
 
633
        }
-
 
634
		catch (SocketTimeoutException e)
-
 
635
		{
-
 
636
			System.err.println("Could't set timeout: "+e.getMessage());
-
 
637
			System.exit(1);
-
 
638
		}
-
 
639
		catch (IOException e) {
-
 
640
            System.err.println("Couldn't get I/O for the connection to: "+strServerName+": "+e.getMessage());
-
 
641
            System.exit(1);
-
 
642
        }
-
 
643
 
-
 
644
		// Just wait a little to let daemon initialize
-
 
645
		try {
-
 
646
			Thread.sleep(500);
-
 
647
		} catch (InterruptedException e1) {
-
 
648
			System.out.println("Error: "+e1.getMessage());
-
 
649
		}
-
 
650
 
-
 
651
		// Find the number of complete lines
-
 
652
		if (!tfVon_1.getText().isEmpty() && !tfTemp_1.getText().isEmpty())
-
 
653
			numLines = 1;
-
 
654
 
-
 
655
		if (!tfVon_2.getText().isEmpty() && !tfTemp_2.getText().isEmpty())
-
 
656
			numLines = 2;
-
 
657
 
-
 
658
		if (!tfVon_3.getText().isEmpty() && !tfTemp_3.getText().isEmpty())
-
 
659
			numLines = 3;
-
 
660
 
-
 
661
		if (!tfVon_4.getText().isEmpty() && !tfTemp_4.getText().isEmpty())
-
 
662
			numLines = 4;
-
 
663
 
-
 
664
		if (!tfVon_5.getText().isEmpty() && !tfTemp_5.getText().isEmpty())
-
 
665
			numLines = 5;
-
 
666
 
-
 
667
		if (!tfVon_6.getText().isEmpty() && !tfTemp_6.getText().isEmpty())
-
 
668
			numLines = 6;
-
 
669
 
-
 
670
		if (!tfVon_7.getText().isEmpty() && !tfTemp_7.getText().isEmpty())
-
 
671
			numLines = 7;
-
 
672
 
-
 
673
		if (!tfVon_8.getText().isEmpty() && !tfTemp_8.getText().isEmpty())
-
 
674
			numLines = 8;
-
 
675
 
-
 
676
		if (!tfVon_9.getText().isEmpty() && !tfTemp_9.getText().isEmpty())
-
 
677
			numLines = 9;
-
 
678
 
-
 
679
		if (!tfVon_10.getText().isEmpty() && !tfTemp_10.getText().isEmpty())
-
 
680
			numLines = 10;
-
 
681
 
-
 
682
		// Write out the actual day
-
 
683
		answer = "SET DAY:"+numLines+":"+wday;
-
 
684
		
-
 
685
		for (i = 0; i < numLines; i++)
-
 
686
		{
-
 
687
			String st;
-
 
688
 
-
 
689
			switch(i)
-
 
690
			{
-
 
691
				case 0:
-
 
692
					st = tfTemp_1.getText().replace(",", ".");
-
 
693
					tp = Float.parseFloat(st);
-
 
694
 
-
 
695
					if (stringToTime(tfBis_1.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
696
						answer += ":"+stringToTime(tfBis_1.getText())+":"+tp;
-
 
697
					else
-
 
698
						err = 1;
-
 
699
				break;
-
 
700
 
-
 
701
				case 1:
-
 
702
					st = tfTemp_2.getText().replace(",", ".");
-
 
703
					tp = Float.parseFloat(st);
-
 
704
 
-
 
705
					if (stringToTime(tfBis_2.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
706
						answer += ":"+stringToTime(tfBis_2.getText())+":"+tp;
-
 
707
					else
-
 
708
						err = 1;
-
 
709
				break;
-
 
710
 
-
 
711
				case 2:
-
 
712
					st = tfTemp_3.getText().replace(",", ".");
-
 
713
					tp = Float.parseFloat(st);
-
 
714
 
-
 
715
					if (stringToTime(tfBis_3.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
716
						answer += ":"+stringToTime(tfBis_3.getText())+":"+tp;
-
 
717
					else
-
 
718
						err = 1;
-
 
719
				break;
-
 
720
 
-
 
721
				case 3:
-
 
722
					st = tfTemp_4.getText().replace(",", ".");
-
 
723
					tp = Float.parseFloat(st);
-
 
724
 
-
 
725
					if (stringToTime(tfBis_4.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
726
						answer += ":"+stringToTime(tfBis_4.getText())+":"+tp;
-
 
727
					else
-
 
728
						err = 1;
-
 
729
				break;
-
 
730
 
-
 
731
				case 4:
-
 
732
					st = tfTemp_5.getText().replace(",", ".");
-
 
733
					tp = Float.parseFloat(st);
-
 
734
 
-
 
735
					if (stringToTime(tfBis_5.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
736
						answer += ":"+stringToTime(tfBis_5.getText())+":"+tp;
-
 
737
					else
-
 
738
						err = 1;
-
 
739
				break;
-
 
740
 
-
 
741
				case 5:
-
 
742
					st = tfTemp_6.getText().replace(",", ".");
-
 
743
					tp = Float.parseFloat(st);
-
 
744
 
-
 
745
					if (stringToTime(tfBis_6.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
746
						answer += ":"+stringToTime(tfBis_6.getText())+":"+tp;
-
 
747
					else
-
 
748
						err = 1;
-
 
749
				break;
-
 
750
 
-
 
751
				case 6:
-
 
752
					st = tfTemp_7.getText().replace(",", ".");
-
 
753
					tp = Float.parseFloat(st);
-
 
754
 
-
 
755
					if (stringToTime(tfBis_7.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
756
						answer += ":"+stringToTime(tfBis_7.getText())+":"+tp;
-
 
757
					else
-
 
758
						err = 1;
-
 
759
				break;
-
 
760
 
-
 
761
				case 7:
-
 
762
					st = tfTemp_8.getText().replace(",", ".");
-
 
763
					tp = Float.parseFloat(st);
-
 
764
 
-
 
765
					if (stringToTime(tfBis_8.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
766
						answer += ":"+stringToTime(tfBis_8.getText())+":"+tp;
-
 
767
					else
-
 
768
						err = 1;
-
 
769
				break;
-
 
770
 
-
 
771
				case 8:
-
 
772
					st = tfTemp_9.getText().replace(",", ".");
-
 
773
					tp = Float.parseFloat(st);
-
 
774
 
-
 
775
					if (stringToTime(tfBis_9.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
776
						answer += ":"+stringToTime(tfBis_9.getText())+":"+tp;
-
 
777
					else
-
 
778
						err = 1;
-
 
779
				break;
-
 
780
 
-
 
781
				case 9:
-
 
782
					st = tfTemp_10.getText().replace(",", ".");
-
 
783
					tp = Float.parseFloat(st);
-
 
784
 
-
 
785
					if (stringToTime(tfBis_10.getText()) > 0 && tp > 5.0 && tp <= 30.0)
-
 
786
						answer += ":"+stringToTime(tfBis_10.getText())+":"+tp;
-
 
787
					else
-
 
788
						err = 1;
-
 
789
				break;
-
 
790
			}
-
 
791
		}
-
 
792
 
-
 
793
		answer += ";";
-
 
794
		
-
 
795
		if (err == 0)
-
 
796
		{
-
 
797
			out.print(answer);
-
 
798
			out.flush();
-
 
799
System.out.println("Send:"+answer);
-
 
800
			answer = "";
-
 
801
		
-
 
802
			try {
-
 
803
				while (in.read(ch, 0, 1) != -1)
-
 
804
				{
-
 
805
					if (ch[0] == ';')
-
 
806
						{
-
 
807
System.out.println("Found answer:"+answer);
-
 
808
						break;
-
 
809
					}
-
 
810
		
-
 
811
					answer = answer+ch[0];
-
 
812
				}
-
 
813
			}
-
 
814
			catch (SocketTimeoutException e)
-
 
815
			{
-
 
816
				System.err.println("Error: "+e.getMessage());
-
 
817
			}
-
 
818
			catch (IOException e) {
-
 
819
				System.err.println("Error reading from stream: "+e.getMessage());
-
 
820
				out.print("quit;");
-
 
821
				out.close();
-
 
822
				System.exit(1);
-
 
823
			}
-
 
824
		}
-
 
825
 
-
 
826
		out.print("quit;");
-
 
827
		out.close();
-
 
828
	
-
 
829
		try {
-
 
830
			in.close();
-
 
831
			s.close();
-
 
832
		}
-
 
833
		catch (IOException e) {
-
 
834
			System.err.println("Error closing a socket: "+e.getMessage());
-
 
835
			System.exit(1);
-
 
836
		}
-
 
837
	
-
 
838
		if (err == 0)
-
 
839
			return true;
-
 
840
		else
-
 
841
			return false;
-
 
842
	}
-
 
843
 
525
	public static void main(String[] args) {
844
	public static void main(String[] args) {
526
        //Schedule a job for the event-dispatching thread:
845
		//Schedule a job for the event-dispatching thread:
527
        //creating and showing this application's GUI.
846
        //creating and showing this application's GUI.
528
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
847
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
529
            public void run() {
848
            public void run() {
530
            	heizung thisClass = new heizung();
849
            	heizung thisClass = new heizung();
531
                thisClass.createAndShowGUI();
850
                thisClass.createAndShowGUI();
Line 541... Line 860...
541
		
860
		
542
        if (wday >= 0 && wday < 7)
861
        if (wday >= 0 && wday < 7)
543
        {
862
        {
544
        	actWDay = wday + 1;
863
        	actWDay = wday + 1;
545
        	clearLines();
864
        	clearLines();
546
System.out.println("wday:"+actWDay);
-
 
547
        	readDay(actWDay);
865
        	readDay(actWDay);
548
        }
866
        }
549
	}
867
	}
550
}
868
}
551
 
869