浏览代码

zmiany do wersj pdstawoej

waldek 5 年前
父节点
当前提交
b85003b120
共有 40 个文件被更改,包括 953 次插入265 次删除
  1. 1
    1
      .idea/misc.xml
  2. 6
    1
      app/build.gradle
  3. 二进制
      app/debug/app-debug.apk
  4. 0
    1
      app/debug/output.json
  5. 6
    2
      app/src/main/AndroidManifest.xml
  6. 二进制
      app/src/main/ic_launcher-playstore.png
  7. 144
    29
      app/src/main/java/com/kfb/kfbv1/GateActivity.java
  8. 8
    2
      app/src/main/java/com/kfb/kfbv1/MainActivity.java
  9. 25
    0
      app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java
  10. 8
    5
      app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java
  11. 40
    4
      app/src/main/java/com/kfb/kfbv1/model/KfbGate.java
  12. 129
    13
      app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java
  13. 54
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbKttpRequest2.java
  14. 60
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java
  15. 13
    1
      app/src/main/java/com/kfb/kfbv1/model/KfbModel.java
  16. 22
    4
      app/src/main/java/com/kfb/kfbv1/model/KfbParser.java
  17. 31
    0
      app/src/main/java/com/kfb/kfbv1/model/KfbTablet.java
  18. 31
    20
      app/src/main/java/com/kfb/kfbv1/model/KfbTask.java
  19. 1
    0
      app/src/main/java/com/kfb/kfbv1/model/LogFile.java
  20. 70
    166
      app/src/main/res/drawable/ic_launcher_background.xml
  21. 31
    0
      app/src/main/res/drawable/ic_launcher_doc.xml
  22. 1
    1
      app/src/main/res/drawable/splash.xml
  23. 202
    0
      app/src/main/res/layout/activity_config.xml
  24. 7
    0
      app/src/main/res/layout/activity_gate.xml
  25. 7
    2
      app/src/main/res/layout/activity_main.xml
  26. 37
    7
      app/src/main/res/layout/fragment_item.xml
  27. 14
    0
      app/src/main/res/layout/toolbar.xml
  28. 2
    2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  29. 2
    2
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  30. 二进制
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  31. 二进制
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  32. 二进制
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  33. 二进制
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  34. 二进制
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  35. 二进制
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  36. 二进制
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  37. 二进制
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  38. 二进制
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  39. 二进制
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  40. 1
    1
      app/src/main/res/values/styles.xml

+ 1
- 1
.idea/misc.xml 查看文件

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <project version="4">
2
 <project version="4">
3
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
3
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
4
     <output url="file://$PROJECT_DIR$/build/classes" />
4
     <output url="file://$PROJECT_DIR$/build/classes" />
5
   </component>
5
   </component>
6
   <component name="ProjectType">
6
   <component name="ProjectType">

+ 6
- 1
app/build.gradle 查看文件

24
 }
24
 }
25
 
25
 
26
 dependencies {
26
 dependencies {
27
+    def room_version = "2.2.5"
28
+
29
+
27
     implementation fileTree(dir: 'libs', include: ['*.jar'])
30
     implementation fileTree(dir: 'libs', include: ['*.jar'])
31
+    implementation "androidx.room:room-runtime:$room_version"
28
 
32
 
29
     implementation 'com.loopj.android:android-async-http:1.4.9'
33
     implementation 'com.loopj.android:android-async-http:1.4.9'
30
-
31
     implementation 'androidx.appcompat:appcompat:1.1.0'
34
     implementation 'androidx.appcompat:appcompat:1.1.0'
32
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
35
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33
     testImplementation 'junit:junit:4.12'
36
     testImplementation 'junit:junit:4.12'
34
     androidTestImplementation 'androidx.test.ext:junit:1.1.1'
37
     androidTestImplementation 'androidx.test.ext:junit:1.1.1'
35
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
38
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
36
     implementation 'androidx.recyclerview:recyclerview:1.1.0'
39
     implementation 'androidx.recyclerview:recyclerview:1.1.0'
40
+    implementation 'com.google.android.material:material:1.1.0'
41
+    annotationProcessor 'androidx.room:room-compiler:2.1.0'
37
 }
42
 }

二进制
app/debug/app-debug.apk 查看文件


+ 0
- 1
app/debug/output.json 查看文件

1
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"app-debug.apk","properties":{}}]

+ 6
- 2
app/src/main/AndroidManifest.xml 查看文件

2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
     xmlns:tools="http://schemas.android.com/tools"
3
     xmlns:tools="http://schemas.android.com/tools"
4
     package="com.kfb.kfbv1">
4
     package="com.kfb.kfbv1">
5
+
6
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5
     <uses-permission android:name="android.permission.INTERNET" />
8
     <uses-permission android:name="android.permission.INTERNET" />
6
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
9
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
7
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
10
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
14
 
17
 
15
     <application
18
     <application
16
         android:allowBackup="true"
19
         android:allowBackup="true"
17
-        android:icon="@mipmap/ic_launcher"
18
         android:label="@string/app_name"
20
         android:label="@string/app_name"
19
-        android:roundIcon="@mipmap/ic_launcher_round"
21
+        android:roundIcon="@drawable/ic_launcher_round"
22
+        android:icon="@drawable/ic_launcher_round"
20
         android:supportsRtl="true"
23
         android:supportsRtl="true"
21
         android:theme="@style/AppTheme">
24
         android:theme="@style/AppTheme">
22
         <activity
25
         <activity
30
         </activity>
33
         </activity>
31
         <activity android:name=".MainActivity" android:noHistory="true"></activity>
34
         <activity android:name=".MainActivity" android:noHistory="true"></activity>
32
         <activity android:name=".GateActivity" android:noHistory="true"></activity>
35
         <activity android:name=".GateActivity" android:noHistory="true"></activity>
36
+        <activity android:name=".ConfigActivity" android:noHistory="true"></activity>
33
     </application>
37
     </application>
34
 
38
 
35
 </manifest>
39
 </manifest>

二进制
app/src/main/ic_launcher-playstore.png 查看文件


+ 144
- 29
app/src/main/java/com/kfb/kfbv1/GateActivity.java 查看文件

1
 package com.kfb.kfbv1;
1
 package com.kfb.kfbv1;
2
 
2
 
3
+import android.content.Intent;
3
 import android.os.Bundle;
4
 import android.os.Bundle;
4
 import android.os.Handler;
5
 import android.os.Handler;
5
 import android.os.Message;
6
 import android.os.Message;
7
+import android.view.MenuItem;
8
+import android.view.View;
6
 import android.view.WindowManager;
9
 import android.view.WindowManager;
7
-import android.widget.TextView;
10
+import android.widget.Button;
11
+import android.widget.ImageButton;
12
+
8
 
13
 
9
 import androidx.appcompat.app.AppCompatActivity;
14
 import androidx.appcompat.app.AppCompatActivity;
15
+
16
+import androidx.appcompat.widget.Toolbar;
10
 import androidx.recyclerview.widget.LinearLayoutManager;
17
 import androidx.recyclerview.widget.LinearLayoutManager;
11
 import androidx.recyclerview.widget.RecyclerView;
18
 import androidx.recyclerview.widget.RecyclerView;
12
 
19
 
20
+import com.kfb.kfbv1.db.DbManage;
21
+import com.kfb.kfbv1.db.Urzadzenia;
13
 import com.kfb.kfbv1.dummy.DummyContent;
22
 import com.kfb.kfbv1.dummy.DummyContent;
14
 
23
 
15
 import com.kfb.kfbv1.model.KfbGate;
24
 import com.kfb.kfbv1.model.KfbGate;
16
-import com.kfb.kfbv1.model.KfbHttpRequest;
17
 import com.kfb.kfbv1.model.KfbModel;
25
 import com.kfb.kfbv1.model.KfbModel;
18
 import com.kfb.kfbv1.model.KfbTask;
26
 import com.kfb.kfbv1.model.KfbTask;
19
-
20
 import java.util.ArrayList;
27
 import java.util.ArrayList;
21
 import java.util.List;
28
 import java.util.List;
22
 
29
 
23
 public class GateActivity  extends AppCompatActivity
30
 public class GateActivity  extends AppCompatActivity
24
 {
31
 {
32
+    private Toolbar toolbar;
25
     private MyItemRecyclerViewAdapter listAdapter;
33
     private MyItemRecyclerViewAdapter listAdapter;
26
     private List<DummyContent.DummyItem> ld1 = new ArrayList<DummyContent.DummyItem>() ;
34
     private List<DummyContent.DummyItem> ld1 = new ArrayList<DummyContent.DummyItem>() ;
27
     private RecyclerView recycler;
35
     private RecyclerView recycler;
30
         @Override
38
         @Override
31
         public void handleMessage(Message msg) {
39
         public void handleMessage(Message msg) {
32
             if(msg.what==2) {
40
             if(msg.what==2) {
33
-                DummyContent.DummyItem dr = ld1.get(msg.arg1);
34
-                dr.Temperatura = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMaxT();
35
-                dr.State = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmStatus();
36
-                dr.Error = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmError();
37
-                listAdapter.notifyDataSetChanged();
41
+                DummyContent.DummyItem dr=null;
42
+                for(int i = 0; i<ld1.size();i++)
43
+                {
44
+                    dr = ld1.get(msg.arg1);
45
+                    if(dr.id== msg.arg1)
46
+                    {
47
+                        break;
48
+                    }
49
+                }
50
+                if(dr!=null) {
51
+                    dr.Temperatura = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMaxT();
52
+                    dr.State = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmStatus();
53
+                    dr.Error = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmError();
54
+                    dr.imgHis = KfbModel.getData().getGates().getmGate().get(msg.arg1).getmMeasure().getHist();
55
+                    float t=0;
56
+                    if (dr.Temperatura != null) {
57
+                        t = Float.parseFloat(dr.Temperatura);
58
+                    }
59
+                    if (t > 38) {
60
+                         dr.Nok = "NOK";
61
+                    } else {
62
+                        dr.Nok = "OK";
63
+                    }
64
+                    listAdapter.notifyDataSetChanged();
65
+                }
38
             }
66
             }
39
             super.handleMessage(msg);
67
             super.handleMessage(msg);
40
         }
68
         }
45
         setContentView(R.layout.activity_gate);
73
         setContentView(R.layout.activity_gate);
46
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
74
         getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
47
 
75
 
76
+        ImageButton bConf = (ImageButton)findViewById(R.id.idConfig);
77
+        bConf.setOnClickListener(new View.OnClickListener() {
78
+
79
+            public void onClick(View v) {
80
+                onConfigClik(v);
81
+            }
82
+        });
83
+
48
         recycler = findViewById(R.id.recview);
84
         recycler = findViewById(R.id.recview);
49
         recycler.setHasFixedSize(true);
85
         recycler.setHasFixedSize(true);
50
         layoutManager = new LinearLayoutManager(this);
86
         layoutManager = new LinearLayoutManager(this);
51
         recycler.setLayoutManager(layoutManager);
87
         recycler.setLayoutManager(layoutManager);
52
 
88
 
53
 
89
 
90
+
54
         listAdapter = new MyItemRecyclerViewAdapter( ld1,null);
91
         listAdapter = new MyItemRecyclerViewAdapter( ld1,null);
55
         recycler.setAdapter(listAdapter);
92
         recycler.setAdapter(listAdapter);
93
+        DbManage dbRep = new DbManage(getApplicationContext());
94
+        List<Urzadzenia> urzdb = dbRep.getUrzadzeniaAll();
95
+            if(urzdb!=null) {
96
+                KfbModel.getData().clear();
97
+                for(int i=0;i<urzdb.size();i++){
56
 
98
 
57
-        KfbModel.getData().sendHttp=true;
58
-        KfbGate lGate = new KfbGate();
59
-        lGate.setmAdres("http://192.168.13.15");
60
-      //  lGate.setmAdres("http://p.sorveno.com/pp.html");
61
-        lGate.setmName("Gate 1");
62
-        KfbModel.getData().getGates().AddGate(lGate);
63
-        lGate = new KfbGate();
64
-        lGate.setmAdres("http://192.168.13.16");
65
-        lGate.setmName("Gate 2");
66
-        KfbModel.getData().getGates().AddGate(lGate);
67
-        for (int i =0; i<KfbModel.getData().getGates().getmSize();i++) {
68
-             DummyContent.DummyItem d1 = new DummyContent.DummyItem(String.valueOf(i)  ,KfbModel.getData().getGates().getmGate().get(i).getmName(), "ON", KfbModel.getData().getGates().getmGate().get(i).getmError(), KfbModel.getData().getGates().getmGate().get(i).getmStatus(), "", "", "", KfbModel.getData().getGates().getmGate().get(i).getmMaxT());
69
-            ld1.add(d1);
70
-        }
71
-        KfbModel.getData().handler = handler;
72
-        KfbModel.getData().setmAdapter(listAdapter);
73
-        this.StartMes();
74
-        listAdapter.notifyDataSetChanged();
75
-    }
99
+                    KfbGate lGate = new KfbGate();
100
+                    lGate.setId(urzdb.get(i).ID);
101
+                    lGate.setmAdres(urzdb.get(i).adres);
102
+                    if(i==0) {
103
+                        lGate.setmName("Gate 1");
104
+                    }
105
+                    if(i==1) {
106
+                        lGate.setmName("Gate 2");
107
+                    }
108
+                    if(i==2) {
109
+                        lGate.setmName("Gate 3");
110
+                    }
111
+                    if(i==3) {
112
+                        lGate.setmName("Gate 4");
113
+                    }
114
+                    lGate.setmActive(urzdb.get(i).active);
115
+                    KfbModel.getData().getGates().AddGate(lGate);
116
+                }
117
+            }
118
+                if (KfbModel.getData().getGates().getmSize() == 0) {
119
+                    KfbModel.getData().clear();
120
+                    KfbModel.getData().sendHttp = true;
121
+                    KfbGate lGate = new KfbGate();
122
+                    lGate.setId(0);
123
+                    lGate.setmAdres("http://192.168.1.15:6505");
124
+                    // lGate.setmAdres("http://51.83.130.248:3000");
125
+                    lGate.setmName("Gate 1");
126
+                    lGate.setmActive(true);
127
+                    KfbModel.getData().getGates().AddGate(lGate);
128
+                    Urzadzenia urzdbe = new Urzadzenia();
129
+
130
+                    urzdbe.active = lGate.ismActive();
131
+                    urzdbe.adres = lGate.getmAdres();
132
+                    urzdbe.ID =  lGate.getId();
133
+                    dbRep.insertUrzazenie(urzdbe);
76
 
134
 
135
+                    lGate = new KfbGate();
136
+                    lGate.setmAdres("http://192.168.1.16:6505");
137
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
138
+                    lGate.setmName("Gate 2");
139
+                    lGate.setId(1);
140
+                    lGate.setmActive(true);
141
+                    KfbModel.getData().getGates().AddGate(lGate);
142
+                    urzdbe = new Urzadzenia();
143
+                    urzdbe.active = lGate.ismActive();
144
+                    urzdbe.adres = lGate.getmAdres();
145
+                    urzdbe.ID =  lGate.getId();
146
+                    dbRep.insertUrzazenie(urzdbe);
147
+                    lGate = new KfbGate();
148
+                    lGate.setmAdres("http://192.168.1.17:6505");
149
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
150
+                    lGate.setmName("Gate 3");
151
+                    lGate.setId(2);
152
+                    lGate.setmActive(true);
153
+                    KfbModel.getData().getGates().AddGate(lGate);
154
+                    urzdbe = new Urzadzenia();
155
+                    urzdbe.active = lGate.ismActive();
156
+                    urzdbe.adres = lGate.getmAdres();
157
+                    urzdbe.ID =  lGate.getId();
158
+                    dbRep.insertUrzazenie(urzdbe);
159
+                    lGate = new KfbGate();
160
+                    lGate.setmAdres("http://192.168.1.18:6505");
161
+                    //lGate.setmAdres("http://p.sorveno.com/pp.html");
162
+                    lGate.setmName("Gate 4");
163
+                    lGate.setId(3);
164
+                    lGate.setmActive(true);
165
+                    urzdbe = new Urzadzenia();
166
+                    urzdbe.active = lGate.ismActive();
167
+                    urzdbe.adres = lGate.getmAdres();
168
+                    urzdbe.ID =  lGate.getId();
169
+                    dbRep.insertUrzazenie(urzdbe);
170
+                    KfbModel.getData().getGates().AddGate(lGate);
171
+                }
172
+            ld1.clear();
173
+            for (int i = 0; i < KfbModel.getData().getGates().getmSize(); i++) {
174
+                DummyContent.DummyItem d1 = new DummyContent.DummyItem(i, KfbModel.getData().getGates().getmGate().get(i).getmName(), "ON", KfbModel.getData().getGates().getmGate().get(i).getmError(), KfbModel.getData().getGates().getmGate().get(i).getmStatus(), "", "", "", KfbModel.getData().getGates().getmGate().get(i).getmMaxT());
175
+                 if( KfbModel.getData().getGates().getmGate().get(i).ismActive()) {
176
+                     ld1.add(d1);
177
+                 }
178
+            }
179
+            KfbModel.getData().handler = handler;
180
+            KfbModel.getData().setmAdapter(listAdapter);
181
+            this.StartMes();
182
+            listAdapter.notifyDataSetChanged();
183
+    }
184
+private void onConfigClik(View v)
185
+{
186
+    Intent i = new Intent(getApplicationContext(),ConfigActivity.class);
187
+    startActivity(i);
188
+}
77
     private void StartMes(){
189
     private void StartMes(){
78
         KfbModel.getData().sendHttp= true;
190
         KfbModel.getData().sendHttp= true;
79
         KfbTask tr = new KfbTask();
191
         KfbTask tr = new KfbTask();
80
         Thread T1 = new Thread(tr);
192
         Thread T1 = new Thread(tr);
81
         T1.start();
193
         T1.start();
82
     }
194
     }
83
-
84
-
195
+    @Override
196
+    protected void onStop() {
197
+        super.onStop();
198
+        KfbModel.getData().sendHttp=false;
199
+    }
85
 }
200
 }

+ 8
- 2
app/src/main/java/com/kfb/kfbv1/MainActivity.java 查看文件

16
 import android.widget.ProgressBar;
16
 import android.widget.ProgressBar;
17
 import android.widget.TextView;
17
 import android.widget.TextView;
18
 
18
 
19
+import com.kfb.kfbv1.db.DbManage;
20
+import com.kfb.kfbv1.db.User;
19
 import com.kfb.kfbv1.hotspot.WifiApManager;
21
 import com.kfb.kfbv1.hotspot.WifiApManager;
20
 import com.kfb.kfbv1.model.KfbGate;
22
 import com.kfb.kfbv1.model.KfbGate;
21
 import com.kfb.kfbv1.model.KfbGates;
23
 import com.kfb.kfbv1.model.KfbGates;
79
        //wifiApManager.setWifiApEnabled(con, true);
81
        //wifiApManager.setWifiApEnabled(con, true);
80
     }
82
     }
81
     private void onLoginClik(View v) {
83
     private void onLoginClik(View v) {
84
+
85
+        DbManage dbRep = new DbManage(getApplicationContext());
86
+        User us = dbRep.getUser("admin");
87
+
82
         Intent i = new Intent(getApplicationContext(),GateActivity.class);
88
         Intent i = new Intent(getApplicationContext(),GateActivity.class);
83
         startActivity(i);
89
         startActivity(i);
84
 
90
 
93
 
99
 
94
         KfbGate g1 = new KfbGate();
100
         KfbGate g1 = new KfbGate();
95
         g1.setmName("Test1");
101
         g1.setmName("Test1");
96
-    //    KfbModel.getData().getGates().AddGate(g1);
102
+        KfbModel.getData().getGates().AddGate(g1);
97
 
103
 
98
         T1 = new Thread(tr);
104
         T1 = new Thread(tr);
99
         T1.start();
105
         T1.start();
102
     protected void onResume() {
108
     protected void onResume() {
103
         super.onResume();
109
         super.onResume();
104
 
110
 
105
-        wifiApManager.showWritePermissionSettings(false);
111
+      //  wifiApManager.showWritePermissionSettings(false);
106
     }
112
     }
107
 
113
 
108
 }
114
 }

+ 25
- 0
app/src/main/java/com/kfb/kfbv1/MyItemRecyclerViewAdapter.java 查看文件

3
 import android.view.LayoutInflater;
3
 import android.view.LayoutInflater;
4
 import android.view.View;
4
 import android.view.View;
5
 import android.view.ViewGroup;
5
 import android.view.ViewGroup;
6
+import android.widget.ImageView;
6
 import android.widget.TextView;
7
 import android.widget.TextView;
7
 
8
 
8
 import androidx.recyclerview.widget.RecyclerView;
9
 import androidx.recyclerview.widget.RecyclerView;
39
         holder.Nazwa.setText(mValues.get(position).Nazwa);
40
         holder.Nazwa.setText(mValues.get(position).Nazwa);
40
         holder.Status.setText(mValues.get(position).Status);
41
         holder.Status.setText(mValues.get(position).Status);
41
         holder.Error.setText(mValues.get(position).Error);
42
         holder.Error.setText(mValues.get(position).Error);
43
+        holder.Error.setTextColor(0XFFFF0000);
42
         holder.State.setText(mValues.get(position).State);
44
         holder.State.setText(mValues.get(position).State);
45
+        holder.Nok.setText(mValues.get(position).Nok);
46
+        if(mValues.get(position).Nok!=null) {
47
+            if (mValues.get(position).Nok.equals("NOK")) {
48
+                holder.Nok.setTextColor(0XFFFF0000);
49
+            } else {
50
+                holder.Nok.setTextColor(0XFF00FF00);
51
+            }
52
+        }
43
         holder.Temperatura.setText(mValues.get(position).Temperatura);
53
         holder.Temperatura.setText(mValues.get(position).Temperatura);
54
+        String t = mValues.get(position).Temperatura;
55
+        if(t!=null) {
56
+            if (Float.parseFloat(t) >= 38.0F) {
57
+                holder.Temperatura.setTextColor(0XFFFF0000);
58
+            } else {
59
+                holder.Temperatura.setTextColor(0XFF00FF00);
60
+            }
61
+        }
62
+        if(mValues.get(position).imgHis!=null) {
63
+            holder.ImgHis.setImageBitmap(mValues.get(position).imgHis);
64
+        }
44
         holder.mView.setOnClickListener(new View.OnClickListener() {
65
         holder.mView.setOnClickListener(new View.OnClickListener() {
45
             @Override
66
             @Override
46
             public void onClick(View v) {
67
             public void onClick(View v) {
65
         public final TextView Error;
86
         public final TextView Error;
66
         public final TextView State;
87
         public final TextView State;
67
         public final TextView Temperatura;
88
         public final TextView Temperatura;
89
+        public final TextView Nok;
90
+        public final ImageView ImgHis;
68
 
91
 
69
         public DummyContent.DummyItem mItem;
92
         public DummyContent.DummyItem mItem;
70
 
93
 
76
             Error = (TextView) view.findViewById(R.id.idError);
99
             Error = (TextView) view.findViewById(R.id.idError);
77
             State = (TextView) view.findViewById(R.id.idState);
100
             State = (TextView) view.findViewById(R.id.idState);
78
             Temperatura = (TextView) view.findViewById(R.id.idTemperatura);
101
             Temperatura = (TextView) view.findViewById(R.id.idTemperatura);
102
+            Nok = (TextView) view.findViewById(R.id.idOK);
103
+            ImgHis = (ImageView) view.findViewById(R.id.imgHis);
79
         }
104
         }
80
 
105
 
81
         @Override
106
         @Override

+ 8
- 5
app/src/main/java/com/kfb/kfbv1/dummy/DummyContent.java 查看文件

1
 package com.kfb.kfbv1.dummy;
1
 package com.kfb.kfbv1.dummy;
2
 
2
 
3
+import android.graphics.Bitmap;
4
+
3
 import java.util.ArrayList;
5
 import java.util.ArrayList;
4
 import java.util.HashMap;
6
 import java.util.HashMap;
5
 import java.util.List;
7
 import java.util.List;
21
     /**
23
     /**
22
      * A map of sample (dummy) items, by ID.
24
      * A map of sample (dummy) items, by ID.
23
      */
25
      */
24
-    public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
26
+    public static final Map<Integer, DummyItem> ITEM_MAP = new HashMap<Integer, DummyItem>();
25
 
27
 
26
     private static final int COUNT = 4;
28
     private static final int COUNT = 4;
27
 
29
 
38
     }
40
     }
39
 
41
 
40
     private static DummyItem createDummyItem(int position) {
42
     private static DummyItem createDummyItem(int position) {
41
-        return new DummyItem(String.valueOf(position), "Test1","ON","ERROR","Empty","1","1","1","23.3");
43
+        return new DummyItem(1, "Test1","ON","ERROR","Empty","1","1","1","23.3");
42
     }
44
     }
43
 
45
 
44
     private static String makeDetails(int position) {
46
     private static String makeDetails(int position) {
54
      * A dummy item representing a piece of content.
56
      * A dummy item representing a piece of content.
55
      */
57
      */
56
     public static class DummyItem {
58
     public static class DummyItem {
57
-        public final String id;
59
+        public final int id;
58
         public final String Nazwa;
60
         public final String Nazwa;
59
         public final String Status;
61
         public final String Status;
60
         public String Error;
62
         public String Error;
63
         public final String s2;
65
         public final String s2;
64
         public final String s3;
66
         public final String s3;
65
         public String Temperatura;
67
         public String Temperatura;
66
-
67
-        public DummyItem(String id, String aNazwa,String aStatus,String aError,String aState,String aS1,String aS2,String aS3,String aTemperatura) {
68
+        public Bitmap imgHis;
69
+        public String Nok;
70
+        public DummyItem(int id, String aNazwa,String aStatus,String aError,String aState,String aS1,String aS2,String aS3,String aTemperatura) {
68
             this.id = id;
71
             this.id = id;
69
             this.Nazwa = aNazwa;
72
             this.Nazwa = aNazwa;
70
             this.State = aState;
73
             this.State = aState;

+ 40
- 4
app/src/main/java/com/kfb/kfbv1/model/KfbGate.java 查看文件

3
 import java.util.ArrayList;
3
 import java.util.ArrayList;
4
 
4
 
5
 public class KfbGate {
5
 public class KfbGate {
6
+    private int Id;
6
     private String mName;
7
     private String mName;
7
     private String mAdres;
8
     private String mAdres;
8
     private String mMaxT;
9
     private String mMaxT;
9
     private String mStatus;
10
     private String mStatus;
11
+    private String mStat;
10
     private String mError;
12
     private String mError;
13
+    private boolean mNoPing;
14
+    private boolean mActive;
15
+    private KfbMeasure mMeasure;
11
 
16
 
12
-    private ArrayList<KfbMeasure> mMeasure;
17
+    public String getmStat() {
18
+        return mStat;
19
+    }
20
+
21
+    public void setmStat(String mStat) {
22
+        this.mStat = mStat;
23
+    }
24
+
25
+    public boolean ismNoPing() {
26
+        return mNoPing;
27
+    }
28
+
29
+    public void setmNoPing(boolean mNoPing) {
30
+        this.mNoPing = mNoPing;
31
+    }
32
+
33
+    public boolean ismActive() {
34
+        return mActive;
35
+    }
36
+
37
+    public int getId() {
38
+        return Id;
39
+    }
40
+
41
+    public void setId(int id) {
42
+        Id = id;
43
+    }
44
+
45
+    public void setmActive(boolean mActive) {
46
+        this.mActive = mActive;
47
+    }
13
 
48
 
14
     public void setmName(String mName) {
49
     public void setmName(String mName) {
15
         this.mName = mName;
50
         this.mName = mName;
23
         return mAdres;
58
         return mAdres;
24
     }
59
     }
25
 
60
 
26
-    public void setmMeasure(ArrayList<KfbMeasure> mMeasure) {
61
+    public void setmMeasure(KfbMeasure mMeasure) {
27
         this.mMeasure = mMeasure;
62
         this.mMeasure = mMeasure;
28
     }
63
     }
29
 
64
 
31
         return mName;
66
         return mName;
32
     }
67
     }
33
 
68
 
34
-    public ArrayList<KfbMeasure> getmMeasure() {
69
+    public KfbMeasure getmMeasure() {
35
         return mMeasure;
70
         return mMeasure;
36
     }
71
     }
37
 
72
 
38
     public KfbGate()
73
     public KfbGate()
39
     {
74
     {
40
-        mMeasure = new ArrayList<KfbMeasure>();
75
+        mMeasure = new KfbMeasure();
76
+        mNoPing = true;
41
     }
77
     }
42
 
78
 
43
     public void setmMaxT(String mMaxT) {
79
     public void setmMaxT(String mMaxT) {

+ 129
- 13
app/src/main/java/com/kfb/kfbv1/model/KfbHttpRequest.java 查看文件

1
 package com.kfb.kfbv1.model;
1
 package com.kfb.kfbv1.model;
2
 
2
 
3
-import android.content.Context;
4
-import android.os.AsyncTask;
3
+import android.os.Handler;
4
+import android.os.Message;
5
 import android.util.Log;
5
 import android.util.Log;
6
-import android.widget.Toast;
7
 
6
 
8
 import com.loopj.android.http.AsyncHttpClient;
7
 import com.loopj.android.http.AsyncHttpClient;
9
 import com.loopj.android.http.AsyncHttpResponseHandler;
8
 import com.loopj.android.http.AsyncHttpResponseHandler;
10
-import com.loopj.android.http.ResponseHandlerInterface;
9
+import com.loopj.android.http.HttpGet;
11
 import com.loopj.android.http.SyncHttpClient;
10
 import com.loopj.android.http.SyncHttpClient;
12
 
11
 
13
-import java.io.ByteArrayOutputStream;
14
-import java.io.EOFException;
12
+import java.io.BufferedReader;
15
 import java.io.IOException;
13
 import java.io.IOException;
16
-import java.net.HttpURLConnection;
14
+import java.io.InputStream;
15
+import java.io.InputStreamReader;
16
+import java.net.InetAddress;
17
+import java.net.MalformedURLException;
17
 import java.net.URL;
18
 import java.net.URL;
18
-
19
-import javax.net.ssl.HttpsURLConnection;
19
+import java.net.UnknownHostException;
20
 
20
 
21
 import cz.msebera.android.httpclient.Header;
21
 import cz.msebera.android.httpclient.Header;
22
+import cz.msebera.android.httpclient.HttpEntity;
23
+import cz.msebera.android.httpclient.HttpResponse;
24
+import cz.msebera.android.httpclient.client.HttpClient;
25
+import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;
26
+
22
 
27
 
23
 public class KfbHttpRequest {
28
 public class KfbHttpRequest {
24
     private  KfbGate mGate;
29
     private  KfbGate mGate;
25
-    public  String outS;
26
-    private SyncHttpClient client;
30
+    static Handler handler = KfbModel.getData().handler;
31
+    public  static String outS;
32
+    private static String muri;
33
+    private static SyncHttpClient client;
34
+    private static AsyncHttpClient client1= new AsyncHttpClient();
27
 
35
 
28
     public String getTest(String aUrl)
36
     public String getTest(String aUrl)
29
     {
37
     {
30
         client = new SyncHttpClient();
38
         client = new SyncHttpClient();
31
         try {
39
         try {
32
             String uri = aUrl;
40
             String uri = aUrl;
41
+            muri = uri;
33
              client.get(uri, new AsyncHttpResponseHandler() {
42
              client.get(uri, new AsyncHttpResponseHandler() {
34
                 @Override
43
                 @Override
35
                 public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
44
                 public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
51
                   // KfbModel.getData().textViewout.setText(outS);
60
                   // KfbModel.getData().textViewout.setText(outS);
52
 
61
 
53
                 }
62
                 }
54
-            });
63
+
64
+                 @Override
65
+                 public void onRetry(int retryNo) {
66
+                     super.onRetry(retryNo);
67
+                     KfbModel.getData().tekser =outS;
68
+                     KfbModel.getData().error = true;
69
+                 }
70
+             });
55
             return  outS;
71
             return  outS;
56
         }catch (Exception e)
72
         }catch (Exception e)
57
         {
73
         {
59
             return "";
75
             return "";
60
         }
76
         }
61
     }
77
     }
78
+    public void checkIP(KfbGate aGate)
79
+    {
80
+        InetAddress in;
81
+        in = null;
82
+        // Definimos la ip de la cual haremos el ping
83
+        try {
84
+            URL u = new URL(aGate.getmAdres());
85
+
86
+            in = InetAddress.getByName(u.getHost());
87
+        } catch (UnknownHostException e) {
88
+            // TODO Auto-generated catch block
89
+            e.printStackTrace();
90
+        } catch (MalformedURLException e) {
91
+            e.printStackTrace();
92
+        }
93
+        // Definimos un tiempo en el cual ha de responder
94
+        try {
95
+            if (in.isReachable(500)) {
96
+            //    info.setText("Responde OK");
97
+                aGate.setmNoPing(false);
98
+            } else {
99
+                LogFile.appendLog("Blad polaczenia  "+ muri);
100
+                aGate.setmNoPing(true);
101
+            }
102
+        } catch (IOException e) {
103
+            // TODO Auto-generated catch block
104
+            aGate.setmNoPing(true);
105
+        }
106
+    }
107
+    public static void getRequest1(KfbGate aGate) {
108
+        HttpClient httpclient = new DefaultHttpClient();
109
+        String uri = aGate.getmAdres();
110
+        muri = uri;
111
+        HttpGet httpget = new HttpGet(muri);
112
+
113
+        // Execute the request
114
+        HttpResponse response;
115
+        try {
116
+            response = httpclient.execute(httpget);
117
+            // Examine the response status
118
+            //Log.i("Praeda",response.getStatusLine().toString());
119
+
120
+            // Get hold of the response entity
121
+            HttpEntity entity = response.getEntity();
122
+            // If the response does not enclose an entity, there is no need
123
+            // to worry about connection release
124
+
125
+            if (entity != null) {
126
+
127
+                // A Simple JSON Response Read
128
+                InputStream instream = entity.getContent();
129
+                String result= convertStreamToString(instream);
130
+                outS = result;
131
+                KfbModel.getData().tekser =outS;
132
+                KfbModel.getData().error = false;
133
+             //  LogFile.appendLog("Mam dane ");
134
+                instream.close();
135
+            }
136
+
137
+
138
+        } catch (Exception e) {}
139
+    }
140
+    private static String convertStreamToString(InputStream is) {
141
+        /*
142
+         * To convert the InputStream to String we use the BufferedReader.readLine()
143
+         * method. We iterate until the BufferedReader return null which means
144
+         * there's no more data to read. Each line will appended to a StringBuilder
145
+         * and returned as String.
146
+         */
147
+        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
148
+        StringBuilder sb = new StringBuilder();
149
+
150
+        String line = null;
151
+        try {
152
+            while ((line = reader.readLine()) != null) {
153
+                sb.append(line + "\n");
154
+            }
155
+        } catch (IOException e) {
156
+            e.printStackTrace();
157
+        } finally {
158
+            try {
159
+                is.close();
160
+            } catch (IOException e) {
161
+                e.printStackTrace();
162
+            }
163
+        }
164
+        return sb.toString();
165
+    }
166
+
62
     public void getRequest(KfbGate aGate) {
167
     public void getRequest(KfbGate aGate) {
63
         mGate = aGate;
168
         mGate = aGate;
64
-
169
+         LogFile.appendLog("Wykonuje polaczenie ");
65
         client = new SyncHttpClient();
170
         client = new SyncHttpClient();
66
         try {
171
         try {
67
             String uri = aGate.getmAdres();
172
             String uri = aGate.getmAdres();
173
+            muri = uri;
68
          client.get(uri, new AsyncHttpResponseHandler() {
174
          client.get(uri, new AsyncHttpResponseHandler() {
69
              @Override
175
              @Override
70
              public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
176
              public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
71
                  outS = new String(responseBody);
177
                  outS = new String(responseBody);
72
                  KfbModel.getData().tekser =outS;
178
                  KfbModel.getData().tekser =outS;
73
                  KfbModel.getData().error = false;
179
                  KfbModel.getData().error = false;
180
+                 LogFile.appendLog("Mam dane ");
74
              }
181
              }
75
 
182
 
76
              @Override
183
              @Override
78
                  outS = "ERROR"+ error.getMessage();
185
                  outS = "ERROR"+ error.getMessage();
79
                  KfbModel.getData().tekser =outS;
186
                  KfbModel.getData().tekser =outS;
80
                  KfbModel.getData().error = true;
187
                  KfbModel.getData().error = true;
188
+                 LogFile.appendLog("Blad polaczenia  "+ muri);
189
+             }
190
+             @Override
191
+             public void onRetry(int retryNo) {
192
+                 super.onRetry(retryNo);
193
+                 KfbModel.getData().tekser =outS;
194
+                 KfbModel.getData().error = true;
195
+                 LogFile.appendLog("Ponawiam  "+ retryNo);
196
+
81
              }
197
              }
82
          });
198
          });
83
 
199
 

+ 54
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbKttpRequest2.java 查看文件

1
+package com.kfb.kfbv1.model;
2
+
3
+import android.os.AsyncTask;
4
+import android.os.Handler;
5
+import android.os.Message;
6
+
7
+import com.loopj.android.http.AsyncHttpClient;
8
+import com.loopj.android.http.AsyncHttpResponseHandler;
9
+import com.loopj.android.http.SyncHttpClient;
10
+
11
+import cz.msebera.android.httpclient.Header;
12
+
13
+public class KfbKttpRequest2 extends AsyncTask<KfbGate,Void,String> {
14
+    Handler handler = KfbModel.getData().handler;
15
+    KfbParser p = new KfbParser();
16
+    SyncHttpClient client = new SyncHttpClient();
17
+
18
+    @Override
19
+    protected String doInBackground(final KfbGate... g) {
20
+        client.get(g[0].getmAdres(), new AsyncHttpResponseHandler() {
21
+
22
+            @Override
23
+            public void onStart() {
24
+                // called before request is started
25
+            }
26
+
27
+            @Override
28
+            public void onSuccess(int statusCode, Header[] headers, byte[] response) {
29
+                g[0].setmError("");
30
+                int i = g[0].getId();
31
+                String outS = new String(response);
32
+                KfbModel.getData().tekser =outS;
33
+                p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
34
+                KfbModel.getData().getGates().getmGate().get(i).getmMeasure().CreateBitMap();
35
+                Message msg = handler.obtainMessage();
36
+                msg.what = 2;
37
+                msg.obj = "Pomiar";
38
+                msg.arg1 =  KfbModel.getData().getGates().getmGate().get(i).getId();
39
+                handler.sendMessage(msg);
40
+            }
41
+
42
+            @Override
43
+            public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {
44
+                // called when response HTTP status is "4XX" (eg. 401, 403, 404)
45
+            }
46
+
47
+            @Override
48
+            public void onRetry(int retryNo) {
49
+                // called when request is retried
50
+            }
51
+        });
52
+        return "";
53
+    }
54
+}

+ 60
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbMeasure.java 查看文件

1
 package com.kfb.kfbv1.model;
1
 package com.kfb.kfbv1.model;
2
 
2
 
3
+import android.graphics.Bitmap;
4
+import android.graphics.Matrix;
5
+
6
+import java.util.HashMap;
7
+
3
 public class KfbMeasure {
8
 public class KfbMeasure {
4
-    private float mTemp;
9
+    public float[] mTemp;
10
+    public int[] mTempI;
11
+    int width = 8;
12
+    int height = 8;
13
+    Bitmap bitmap;
14
+
15
+public KfbMeasure(){
16
+    mTemp = new float[64];
17
+    mTempI = new int[64];
18
+}
19
+
20
+private int mapingColor(float aTemp)
21
+{
22
+    if(aTemp > 45 )
23
+    {
24
+        return 0xFFFFFFFF; //czerwony
25
+    }
26
+    if(aTemp > 38 )
27
+    {
28
+        return 0xFFFF0000; //czerwony
29
+    }
30
+    if(aTemp < 25 )
31
+    {
32
+        return 0xFF000000;
33
+    }
34
+    String f = String.format("%.1f", aTemp);
35
+    return KfbModel.getData().getMapColor().getKolor(f);
36
+}
37
+
38
+public void CreateBitMap()
39
+{
40
+    for(int i = 0 ; i < 64; i++)
41
+    {
42
+        mTempI[i] = this.mapingColor(mTemp[i]);
43
+
44
+        //  mTempI[i] = 0xFFFFFF00;
45
+    }
46
+    bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
47
+    bitmap.setPixels(mTempI, 0, width, 0, 0, width, height);
48
+
49
+    float scaleWidth = ((float) 350) / width;
50
+    float scaleHeight = ((float) 350) / height;
51
+    Matrix matrix = new Matrix();
52
+    // RESIZE THE BIT MAP
53
+    matrix.postScale(scaleWidth, scaleHeight);
54
+
55
+    // "RECREATE" THE NEW BITMAP
56
+    Bitmap resizedBitmap = Bitmap.createBitmap(
57
+            bitmap, 0, 0, width, height, matrix, false);
58
+    bitmap.recycle();
59
+    bitmap = resizedBitmap;
60
+}
61
+public Bitmap getHist(){
62
+    return bitmap;
63
+}
5
 }
64
 }

+ 13
- 1
app/src/main/java/com/kfb/kfbv1/model/KfbModel.java 查看文件

24
     private KfbModel()
24
     private KfbModel()
25
     {
25
     {
26
         mGates = new KfbGates();
26
         mGates = new KfbGates();
27
+        mMapColor = new KfbMapColor();
27
     }
28
     }
28
     // data private
29
     // data private
29
     private KfbGates mGates;
30
     private KfbGates mGates;
31
+    private KfbTablet mTablets;
30
     private MyItemRecyclerViewAdapter mAdapter;
32
     private MyItemRecyclerViewAdapter mAdapter;
33
+    private KfbMapColor mMapColor;
31
     // data
34
     // data
32
     public boolean sendHttp;
35
     public boolean sendHttp;
33
     public KfbProgrsBar progresBar;
36
     public KfbProgrsBar progresBar;
34
     public String  tekser;
37
     public String  tekser;
35
     public boolean error;
38
     public boolean error;
36
     public Handler handler;
39
     public Handler handler;
37
- public String url;
40
+    public String url;
38
 
41
 
39
     public MyItemRecyclerViewAdapter getmAdapter() {
42
     public MyItemRecyclerViewAdapter getmAdapter() {
40
         return mAdapter;
43
         return mAdapter;
47
     public KfbGates getGates(){
50
     public KfbGates getGates(){
48
         return mGates;
51
         return mGates;
49
     }
52
     }
53
+    public KfbTablet getTabletss(){
54
+        return mTablets;
55
+    }
56
+public void clear(){
57
+    mGates = new KfbGates();
58
+}
59
+    public KfbMapColor getMapColor(){
60
+        return mMapColor;
61
+    }
50
 }
62
 }

+ 22
- 4
app/src/main/java/com/kfb/kfbv1/model/KfbParser.java 查看文件

4
     public KfbGate dataParser(String aData,KfbGate aGate)
4
     public KfbGate dataParser(String aData,KfbGate aGate)
5
     {
5
     {
6
         KfbGate k = aGate;
6
         KfbGate k = aGate;
7
-        int p = aData.lastIndexOf("Tmax =");
8
-        p = p+6;
9
-        String t = aData.substring(p ,p+5);
10
-        k.setmMaxT(t);
7
+        int p  =0;
8
+        String[] aa =null;
9
+        float ff = 0;
10
+        KfbMeasure mm;
11
 
11
 
12
+        p = aData.lastIndexOf("Dane:");
13
+        p = p+5;
14
+        String t = aData.substring(p ,p+384);
15
+        aa = null;
16
+        aa = t.split(",");
17
+        for(int i=0;i<64;i++)
18
+        {
19
+            ff = Float.parseFloat(aa[i]);
20
+            k.getmMeasure().mTemp[i]=ff;
21
+        }
22
+        p = aData.lastIndexOf("Tmax:");
23
+        p = p+5;
24
+        t = aData.substring(p ,p+5);
25
+        k.setmMaxT(t);
26
+        p = aData.lastIndexOf("Stat:");
27
+        p = p+5;
28
+        t = aData.substring(p ,p+1);
29
+        k.setmStat(t);
12
         p = aData.lastIndexOf("status:");
30
         p = aData.lastIndexOf("status:");
13
         p=p+7;
31
         p=p+7;
14
         t = aData.substring(p ,p+6);
32
         t = aData.substring(p ,p+6);

+ 31
- 0
app/src/main/java/com/kfb/kfbv1/model/KfbTablet.java 查看文件

1
+package com.kfb.kfbv1.model;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class KfbTablet {
6
+    private int mSize;
7
+    private ArrayList<KfbGate> mGate;
8
+
9
+    public KfbTablet()
10
+    {
11
+        mGate = new ArrayList<KfbGate>();
12
+        mSize = 0;
13
+    }
14
+
15
+    public void AddTablet(KfbGate aGate){
16
+        mGate.add(aGate);
17
+        mSize++;
18
+    }
19
+
20
+    public void setmTablet(ArrayList<KfbGate> mGate) {
21
+        this.mGate = mGate;
22
+    }
23
+
24
+    public int getmSize() {
25
+        return mSize;
26
+    }
27
+
28
+    public ArrayList<KfbGate> getmGate() {
29
+        return mGate;
30
+    }
31
+}

+ 31
- 20
app/src/main/java/com/kfb/kfbv1/model/KfbTask.java 查看文件

16
         if(KfbModel.getData().tekser!=null)
16
         if(KfbModel.getData().tekser!=null)
17
         {
17
         {
18
             KfbParser p = new KfbParser();
18
             KfbParser p = new KfbParser();
19
-           // if(KfbModel.getData().error==false) {
20
-          //      p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(0));
21
-          //  }
19
+            if(KfbModel.getData().error==false) {
20
+                p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(0));
21
+
22
+            }
22
             Message msg = handler.obtainMessage();
23
             Message msg = handler.obtainMessage();
23
             msg.what = 1;
24
             msg.what = 1;
24
             msg.obj = "tekst";
25
             msg.obj = "tekst";
30
         while(KfbModel.getData().sendHttp==true)
31
         while(KfbModel.getData().sendHttp==true)
31
         {
32
         {
32
             KfbParser p = new KfbParser();
33
             KfbParser p = new KfbParser();
34
+
33
             for (int i = 0 ;i<KfbModel.getData().getGates().getmSize();i++)
35
             for (int i = 0 ;i<KfbModel.getData().getGates().getmSize();i++)
34
             {
36
             {
35
-                HttpKfb.getRequest(KfbModel.getData().getGates().getmGate().get(i));
36
-                if(KfbModel.getData().error==false) {
37
-                    p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
38
-                    Message msg = handler.obtainMessage();
39
-                    msg.what = 2;
40
-                    msg.obj = "Pomiar";
41
-                    msg.arg1 = i;
42
-                    handler.sendMessage(msg);
43
-                }
44
-                else
45
-                {
46
-                    KfbModel.getData().getGates().getmGate().get(i).setmError("ERROR");
47
-                    Message msg = handler.obtainMessage();
48
-                    msg.what = 2;
49
-                    msg.obj = "Pomiar";
50
-                    msg.arg1 = i;
51
-                    handler.sendMessage(msg);
37
+                if(KfbModel.getData().getGates().getmGate().get(i).ismActive()==true) {
38
+                    if (KfbModel.getData().getGates().getmGate().get(i).ismNoPing() == true) {
39
+                        HttpKfb.checkIP(KfbModel.getData().getGates().getmGate().get(i));
40
+                    } else {
41
+                        HttpKfb.getRequest1(KfbModel.getData().getGates().getmGate().get(i));
42
+
43
+
44
+                        if (KfbModel.getData().error == false) {
45
+                            KfbModel.getData().getGates().getmGate().get(i).setmError("");
46
+                            p.dataParser(KfbModel.getData().tekser, KfbModel.getData().getGates().getmGate().get(i));
47
+                            KfbModel.getData().getGates().getmGate().get(i).getmMeasure().CreateBitMap();
48
+                            Message msg = handler.obtainMessage();
49
+                            msg.what = 2;
50
+                            msg.obj = "Pomiar";
51
+                            msg.arg1 =  KfbModel.getData().getGates().getmGate().get(i).getId();
52
+                            handler.sendMessage(msg);
53
+                        } else {
54
+                            KfbModel.getData().getGates().getmGate().get(i).setmNoPing(true);
55
+                            KfbModel.getData().getGates().getmGate().get(i).setmError("ERROR");
56
+                            Message msg = handler.obtainMessage();
57
+                            msg.what = 2;
58
+                            msg.obj = "Pomiar";
59
+                            msg.arg1 = KfbModel.getData().getGates().getmGate().get(i).getId();
60
+                            handler.sendMessage(msg);
61
+                        }
62
+                    }
52
                 }
63
                 }
53
             }
64
             }
54
             try {
65
             try {

+ 1
- 0
app/src/main/java/com/kfb/kfbv1/model/LogFile.java 查看文件

32
             {
32
             {
33
                 // TODO Auto-generated catch block
33
                 // TODO Auto-generated catch block
34
                 e.printStackTrace();
34
                 e.printStackTrace();
35
+
35
             }
36
             }
36
         }
37
         }
37
         try
38
         try

+ 70
- 166
app/src/main/res/drawable/ic_launcher_background.xml 查看文件

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
-    android:width="108dp"
2
+<vector
4
     android:height="108dp"
3
     android:height="108dp"
4
+    android:width="108dp"
5
+    android:viewportHeight="108"
5
     android:viewportWidth="108"
6
     android:viewportWidth="108"
6
-    android:viewportHeight="108">
7
-    <path
8
-        android:fillColor="#3DDC84"
9
-        android:pathData="M0,0h108v108h-108z" />
10
-    <path
11
-        android:fillColor="#00000000"
12
-        android:pathData="M9,0L9,108"
13
-        android:strokeWidth="0.8"
14
-        android:strokeColor="#33FFFFFF" />
15
-    <path
16
-        android:fillColor="#00000000"
17
-        android:pathData="M19,0L19,108"
18
-        android:strokeWidth="0.8"
19
-        android:strokeColor="#33FFFFFF" />
20
-    <path
21
-        android:fillColor="#00000000"
22
-        android:pathData="M29,0L29,108"
23
-        android:strokeWidth="0.8"
24
-        android:strokeColor="#33FFFFFF" />
25
-    <path
26
-        android:fillColor="#00000000"
27
-        android:pathData="M39,0L39,108"
28
-        android:strokeWidth="0.8"
29
-        android:strokeColor="#33FFFFFF" />
30
-    <path
31
-        android:fillColor="#00000000"
32
-        android:pathData="M49,0L49,108"
33
-        android:strokeWidth="0.8"
34
-        android:strokeColor="#33FFFFFF" />
35
-    <path
36
-        android:fillColor="#00000000"
37
-        android:pathData="M59,0L59,108"
38
-        android:strokeWidth="0.8"
39
-        android:strokeColor="#33FFFFFF" />
40
-    <path
41
-        android:fillColor="#00000000"
42
-        android:pathData="M69,0L69,108"
43
-        android:strokeWidth="0.8"
44
-        android:strokeColor="#33FFFFFF" />
45
-    <path
46
-        android:fillColor="#00000000"
47
-        android:pathData="M79,0L79,108"
48
-        android:strokeWidth="0.8"
49
-        android:strokeColor="#33FFFFFF" />
50
-    <path
51
-        android:fillColor="#00000000"
52
-        android:pathData="M89,0L89,108"
53
-        android:strokeWidth="0.8"
54
-        android:strokeColor="#33FFFFFF" />
55
-    <path
56
-        android:fillColor="#00000000"
57
-        android:pathData="M99,0L99,108"
58
-        android:strokeWidth="0.8"
59
-        android:strokeColor="#33FFFFFF" />
60
-    <path
61
-        android:fillColor="#00000000"
62
-        android:pathData="M0,9L108,9"
63
-        android:strokeWidth="0.8"
64
-        android:strokeColor="#33FFFFFF" />
65
-    <path
66
-        android:fillColor="#00000000"
67
-        android:pathData="M0,19L108,19"
68
-        android:strokeWidth="0.8"
69
-        android:strokeColor="#33FFFFFF" />
70
-    <path
71
-        android:fillColor="#00000000"
72
-        android:pathData="M0,29L108,29"
73
-        android:strokeWidth="0.8"
74
-        android:strokeColor="#33FFFFFF" />
75
-    <path
76
-        android:fillColor="#00000000"
77
-        android:pathData="M0,39L108,39"
78
-        android:strokeWidth="0.8"
79
-        android:strokeColor="#33FFFFFF" />
80
-    <path
81
-        android:fillColor="#00000000"
82
-        android:pathData="M0,49L108,49"
83
-        android:strokeWidth="0.8"
84
-        android:strokeColor="#33FFFFFF" />
85
-    <path
86
-        android:fillColor="#00000000"
87
-        android:pathData="M0,59L108,59"
88
-        android:strokeWidth="0.8"
89
-        android:strokeColor="#33FFFFFF" />
90
-    <path
91
-        android:fillColor="#00000000"
92
-        android:pathData="M0,69L108,69"
93
-        android:strokeWidth="0.8"
94
-        android:strokeColor="#33FFFFFF" />
95
-    <path
96
-        android:fillColor="#00000000"
97
-        android:pathData="M0,79L108,79"
98
-        android:strokeWidth="0.8"
99
-        android:strokeColor="#33FFFFFF" />
100
-    <path
101
-        android:fillColor="#00000000"
102
-        android:pathData="M0,89L108,89"
103
-        android:strokeWidth="0.8"
104
-        android:strokeColor="#33FFFFFF" />
105
-    <path
106
-        android:fillColor="#00000000"
107
-        android:pathData="M0,99L108,99"
108
-        android:strokeWidth="0.8"
109
-        android:strokeColor="#33FFFFFF" />
110
-    <path
111
-        android:fillColor="#00000000"
112
-        android:pathData="M19,29L89,29"
113
-        android:strokeWidth="0.8"
114
-        android:strokeColor="#33FFFFFF" />
115
-    <path
116
-        android:fillColor="#00000000"
117
-        android:pathData="M19,39L89,39"
118
-        android:strokeWidth="0.8"
119
-        android:strokeColor="#33FFFFFF" />
120
-    <path
121
-        android:fillColor="#00000000"
122
-        android:pathData="M19,49L89,49"
123
-        android:strokeWidth="0.8"
124
-        android:strokeColor="#33FFFFFF" />
125
-    <path
126
-        android:fillColor="#00000000"
127
-        android:pathData="M19,59L89,59"
128
-        android:strokeWidth="0.8"
129
-        android:strokeColor="#33FFFFFF" />
130
-    <path
131
-        android:fillColor="#00000000"
132
-        android:pathData="M19,69L89,69"
133
-        android:strokeWidth="0.8"
134
-        android:strokeColor="#33FFFFFF" />
135
-    <path
136
-        android:fillColor="#00000000"
137
-        android:pathData="M19,79L89,79"
138
-        android:strokeWidth="0.8"
139
-        android:strokeColor="#33FFFFFF" />
140
-    <path
141
-        android:fillColor="#00000000"
142
-        android:pathData="M29,19L29,89"
143
-        android:strokeWidth="0.8"
144
-        android:strokeColor="#33FFFFFF" />
145
-    <path
146
-        android:fillColor="#00000000"
147
-        android:pathData="M39,19L39,89"
148
-        android:strokeWidth="0.8"
149
-        android:strokeColor="#33FFFFFF" />
150
-    <path
151
-        android:fillColor="#00000000"
152
-        android:pathData="M49,19L49,89"
153
-        android:strokeWidth="0.8"
154
-        android:strokeColor="#33FFFFFF" />
155
-    <path
156
-        android:fillColor="#00000000"
157
-        android:pathData="M59,19L59,89"
158
-        android:strokeWidth="0.8"
159
-        android:strokeColor="#33FFFFFF" />
160
-    <path
161
-        android:fillColor="#00000000"
162
-        android:pathData="M69,19L69,89"
163
-        android:strokeWidth="0.8"
164
-        android:strokeColor="#33FFFFFF" />
165
-    <path
166
-        android:fillColor="#00000000"
167
-        android:pathData="M79,19L79,89"
168
-        android:strokeWidth="0.8"
169
-        android:strokeColor="#33FFFFFF" />
7
+    xmlns:android="http://schemas.android.com/apk/res/android">
8
+    <path android:fillColor="#3DDC84"
9
+          android:pathData="M0,0h108v108h-108z"/>
10
+    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
11
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
12
+    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
13
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
14
+    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
15
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
16
+    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
17
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
18
+    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
19
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
20
+    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
21
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
22
+    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
23
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
24
+    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
25
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
26
+    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
27
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
28
+    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
29
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
30
+    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
31
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
32
+    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
33
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
34
+    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
35
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
36
+    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
37
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
38
+    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
39
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
40
+    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
41
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
42
+    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
43
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
44
+    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
45
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
46
+    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
47
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
48
+    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
49
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
50
+    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
51
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
52
+    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
53
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
54
+    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
55
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
56
+    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
57
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
58
+    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
59
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
60
+    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
61
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
62
+    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
63
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
64
+    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
65
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
66
+    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
67
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
68
+    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
69
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
70
+    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
71
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
72
+    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
73
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
170
 </vector>
74
 </vector>

+ 31
- 0
app/src/main/res/drawable/ic_launcher_doc.xml 查看文件

1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:aapt="http://schemas.android.com/aapt"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportWidth="108"
6
+    android:viewportHeight="108">
7
+    <path
8
+        android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
9
+        <aapt:attr name="android:fillColor">
10
+            <gradient
11
+                android:startY="49.59793"
12
+                android:startX="42.9492"
13
+                android:endY="92.4963"
14
+                android:endX="85.84757"
15
+                android:type="linear">
16
+                <item
17
+                    android:color="#44000000"
18
+                    android:offset="0.0" />
19
+                <item
20
+                    android:color="#00000000"
21
+                    android:offset="1.0" />
22
+            </gradient>
23
+        </aapt:attr>
24
+    </path>
25
+    <path
26
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
27
+        android:fillColor="#FFFFFF"
28
+        android:fillType="nonZero"
29
+        android:strokeWidth="1"
30
+        android:strokeColor="#00000000"/>
31
+</vector>

+ 1
- 1
app/src/main/res/drawable/splash.xml 查看文件

3
     android:opacity="opaque"><item android:drawable="@android:color/holo_purple" /><item>
3
     android:opacity="opaque"><item android:drawable="@android:color/holo_purple" /><item>
4
     <bitmap
4
     <bitmap
5
         android:gravity="center"
5
         android:gravity="center"
6
-        android:src="@drawable/logo" />
6
+        android:src="@drawable/ekranstartowy" />
7
 </item></layer-list>
7
 </item></layer-list>

+ 202
- 0
app/src/main/res/layout/activity_config.xml 查看文件

1
+<?xml version="1.0" encoding="utf-8"?>
2
+<androidx.constraintlayout.widget.ConstraintLayout
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
4
+    xmlns:app="http://schemas.android.com/apk/res-auto"
5
+    xmlns:tools="http://schemas.android.com/tools"
6
+    android:layout_width="match_parent"
7
+    android:layout_height="match_parent"
8
+    tools:context=".ConfigActivity">
9
+
10
+    <Switch
11
+        android:id="@+id/t3s"
12
+        android:layout_width="wrap_content"
13
+        android:layout_height="wrap_content"
14
+        android:layout_marginStart="16dp"
15
+        android:layout_marginTop="16dp"
16
+        android:text="Tab3"
17
+        app:layout_constraintStart_toStartOf="parent"
18
+        app:layout_constraintTop_toBottomOf="@+id/g3s" />
19
+
20
+    <ImageButton
21
+        android:id="@+id/back"
22
+        android:layout_width="wrap_content"
23
+        android:layout_height="wrap_content"
24
+        android:layout_marginStart="8dp"
25
+        android:layout_marginTop="5dp"
26
+        app:layout_constraintStart_toStartOf="parent"
27
+        app:layout_constraintTop_toTopOf="parent"
28
+        app:srcCompat="@android:drawable/ic_menu_revert" />
29
+
30
+    <Switch
31
+        android:id="@+id/g1s"
32
+        android:layout_width="wrap_content"
33
+        android:layout_height="wrap_content"
34
+        android:layout_marginStart="16dp"
35
+        android:layout_marginTop="108dp"
36
+        android:text="Gate1"
37
+        app:layout_constraintStart_toStartOf="parent"
38
+        app:layout_constraintTop_toTopOf="parent" />
39
+
40
+    <Switch
41
+        android:id="@+id/g2s"
42
+        android:layout_width="wrap_content"
43
+        android:layout_height="wrap_content"
44
+        android:layout_marginStart="16dp"
45
+        android:layout_marginTop="16dp"
46
+        android:text="Gate2"
47
+        app:layout_constraintStart_toStartOf="parent"
48
+        app:layout_constraintTop_toBottomOf="@+id/t1s" />
49
+
50
+    <Switch
51
+        android:id="@+id/g3s"
52
+        android:layout_width="wrap_content"
53
+        android:layout_height="wrap_content"
54
+        android:layout_marginStart="16dp"
55
+        android:layout_marginTop="10dp"
56
+        android:text="Gate3"
57
+        app:layout_constraintStart_toStartOf="parent"
58
+        app:layout_constraintTop_toBottomOf="@+id/t2s" />
59
+
60
+    <Switch
61
+        android:id="@+id/g4s"
62
+        android:layout_width="wrap_content"
63
+        android:layout_height="wrap_content"
64
+        android:layout_marginStart="16dp"
65
+        android:layout_marginTop="20dp"
66
+        android:text="Gate4"
67
+        app:layout_constraintStart_toStartOf="parent"
68
+        app:layout_constraintTop_toBottomOf="@+id/t3s" />
69
+
70
+    <Switch
71
+        android:id="@+id/t1s"
72
+        android:layout_width="wrap_content"
73
+        android:layout_height="wrap_content"
74
+        android:layout_marginStart="16dp"
75
+        android:layout_marginTop="10dp"
76
+        android:text="Tab1"
77
+        app:layout_constraintStart_toStartOf="parent"
78
+        app:layout_constraintTop_toBottomOf="@+id/g1s" />
79
+
80
+    <Switch
81
+        android:id="@+id/t2s"
82
+        android:layout_width="wrap_content"
83
+        android:layout_height="wrap_content"
84
+        android:layout_marginStart="16dp"
85
+        android:layout_marginTop="24dp"
86
+        android:text="Tab2"
87
+        app:layout_constraintStart_toStartOf="parent"
88
+        app:layout_constraintTop_toBottomOf="@+id/g2s" />
89
+
90
+    <Switch
91
+        android:id="@+id/t4s"
92
+        android:layout_width="wrap_content"
93
+        android:layout_height="wrap_content"
94
+        android:layout_marginStart="16dp"
95
+        android:layout_marginTop="24dp"
96
+        android:text="Tab4"
97
+        app:layout_constraintStart_toStartOf="parent"
98
+        app:layout_constraintTop_toBottomOf="@+id/g4s" />
99
+
100
+    <Button
101
+        android:id="@+id/idSave"
102
+        android:layout_width="wrap_content"
103
+        android:layout_height="wrap_content"
104
+        android:layout_marginStart="201dp"
105
+        android:layout_marginTop="469dp"
106
+        android:text="Zapisz"
107
+        app:layout_constraintStart_toStartOf="parent"
108
+        app:layout_constraintTop_toTopOf="parent" />
109
+
110
+    <EditText
111
+        android:id="@+id/g1t"
112
+        android:layout_width="292dp"
113
+        android:layout_height="43dp"
114
+        android:layout_marginStart="140dp"
115
+        android:layout_marginTop="91dp"
116
+        android:ems="10"
117
+        android:gravity="start|top"
118
+        android:inputType="textMultiLine"
119
+        app:layout_constraintStart_toStartOf="parent"
120
+        app:layout_constraintTop_toTopOf="parent" />
121
+
122
+    <EditText
123
+        android:id="@+id/t1t"
124
+        android:layout_width="292dp"
125
+        android:layout_height="44dp"
126
+        android:layout_marginStart="140dp"
127
+        android:ems="10"
128
+        android:gravity="start|top"
129
+        android:inputType="textMultiLine"
130
+        app:layout_constraintStart_toStartOf="parent"
131
+        app:layout_constraintTop_toBottomOf="@+id/g1t" />
132
+
133
+    <EditText
134
+        android:id="@+id/g2t"
135
+        android:layout_width="292dp"
136
+        android:layout_height="42dp"
137
+        android:layout_marginStart="140dp"
138
+        android:layout_marginTop="-1dp"
139
+        android:ems="10"
140
+        android:gravity="start|top"
141
+        android:inputType="textMultiLine"
142
+        app:layout_constraintStart_toStartOf="parent"
143
+        app:layout_constraintTop_toBottomOf="@+id/t1t" />
144
+
145
+    <EditText
146
+        android:id="@+id/t2t"
147
+        android:layout_width="292dp"
148
+        android:layout_height="42dp"
149
+        android:layout_marginStart="140dp"
150
+        android:layout_marginTop="-1dp"
151
+        android:ems="10"
152
+        android:gravity="start|top"
153
+        android:inputType="textMultiLine"
154
+        app:layout_constraintStart_toStartOf="parent"
155
+        app:layout_constraintTop_toBottomOf="@+id/g2t" />
156
+
157
+    <EditText
158
+        android:id="@+id/g3t"
159
+        android:layout_width="292dp"
160
+        android:layout_height="41dp"
161
+        android:layout_marginStart="140dp"
162
+        android:layout_marginTop="-1dp"
163
+        android:ems="10"
164
+        android:gravity="start|top"
165
+        android:inputType="textMultiLine"
166
+        app:layout_constraintStart_toStartOf="parent"
167
+        app:layout_constraintTop_toBottomOf="@+id/t2t" />
168
+
169
+    <EditText
170
+        android:id="@+id/t3t"
171
+        android:layout_width="292dp"
172
+        android:layout_height="wrap_content"
173
+        android:layout_marginStart="140dp"
174
+        android:ems="10"
175
+        android:gravity="start|top"
176
+        android:inputType="textMultiLine"
177
+        app:layout_constraintStart_toStartOf="parent"
178
+        app:layout_constraintTop_toBottomOf="@+id/g3t" />
179
+
180
+    <EditText
181
+        android:id="@+id/g4t"
182
+        android:layout_width="292dp"
183
+        android:layout_height="wrap_content"
184
+        android:layout_marginStart="140dp"
185
+        android:ems="10"
186
+        android:gravity="start|top"
187
+        android:inputType="textMultiLine"
188
+        app:layout_constraintStart_toStartOf="parent"
189
+        app:layout_constraintTop_toBottomOf="@+id/t3t" />
190
+
191
+    <EditText
192
+        android:id="@+id/t4t"
193
+        android:layout_width="292dp"
194
+        android:layout_height="wrap_content"
195
+        android:layout_marginStart="140dp"
196
+        android:ems="10"
197
+        android:gravity="start|top"
198
+        android:inputType="textMultiLine"
199
+        app:layout_constraintStart_toStartOf="parent"
200
+        app:layout_constraintTop_toBottomOf="@+id/g4t" />
201
+
202
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 7
- 0
app/src/main/res/layout/activity_gate.xml 查看文件

6
     android:layout_height="match_parent"
6
     android:layout_height="match_parent"
7
     tools:context=".GateActivity">
7
     tools:context=".GateActivity">
8
 
8
 
9
+    <include
10
+        android:id="@+id/toolbar"
11
+        layout="@layout/toolbar"
12
+        app:layout_constraintStart_toStartOf="parent"
13
+        app:layout_constraintTop_toTopOf="parent" />
14
+
9
     <androidx.recyclerview.widget.RecyclerView
15
     <androidx.recyclerview.widget.RecyclerView
10
         android:id="@+id/recview"
16
         android:id="@+id/recview"
11
         android:layout_width="598dp"
17
         android:layout_width="598dp"
12
         android:layout_height="1022dp"
18
         android:layout_height="1022dp"
19
+        android:layout_marginTop="65dp"
13
         app:layout_constraintStart_toStartOf="parent"
20
         app:layout_constraintStart_toStartOf="parent"
14
         app:layout_constraintTop_toTopOf="parent" />
21
         app:layout_constraintTop_toTopOf="parent" />
15
 </androidx.constraintlayout.widget.ConstraintLayout>
22
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 7
- 2
app/src/main/res/layout/activity_main.xml 查看文件

81
         android:layout_marginStart="36dp"
81
         android:layout_marginStart="36dp"
82
         android:layout_marginTop="207dp"
82
         android:layout_marginTop="207dp"
83
         android:text="Adres"
83
         android:text="Adres"
84
+        android:visibility="invisible"
84
         app:layout_constraintStart_toStartOf="parent"
85
         app:layout_constraintStart_toStartOf="parent"
85
         app:layout_constraintTop_toBottomOf="@+id/textView2" />
86
         app:layout_constraintTop_toBottomOf="@+id/textView2" />
86
 
87
 
92
         android:layout_marginTop="115dp"
93
         android:layout_marginTop="115dp"
93
         android:ems="10"
94
         android:ems="10"
94
         android:inputType="textPersonName"
95
         android:inputType="textPersonName"
95
-        android:text="http://"
96
+        android:text="http://p.sorveno.com/pp.html"
97
+        android:visibility="invisible"
96
         app:layout_constraintStart_toEndOf="@+id/textView3"
98
         app:layout_constraintStart_toEndOf="@+id/textView3"
97
         app:layout_constraintTop_toBottomOf="@+id/login" />
99
         app:layout_constraintTop_toBottomOf="@+id/login" />
98
 
100
 
105
         android:ems="10"
107
         android:ems="10"
106
         android:gravity="start|top"
108
         android:gravity="start|top"
107
         android:inputType="textMultiLine"
109
         android:inputType="textMultiLine"
110
+        android:visibility="invisible"
108
         app:layout_constraintStart_toStartOf="parent"
111
         app:layout_constraintStart_toStartOf="parent"
109
         app:layout_constraintTop_toBottomOf="@+id/editText" />
112
         app:layout_constraintTop_toBottomOf="@+id/editText" />
110
 
113
 
115
         android:layout_marginStart="456dp"
118
         android:layout_marginStart="456dp"
116
         android:layout_marginTop="37dp"
119
         android:layout_marginTop="37dp"
117
         android:text="Wykonaj"
120
         android:text="Wykonaj"
121
+        android:visibility="invisible"
118
         app:layout_constraintStart_toStartOf="parent"
122
         app:layout_constraintStart_toStartOf="parent"
119
-        app:layout_constraintTop_toBottomOf="@+id/editText4" />
123
+        app:layout_constraintTop_toBottomOf="@+id/editText4"
124
+        tools:visibility="invisible" />
120
 
125
 
121
 
126
 
122
 
127
 

+ 37
- 7
app/src/main/res/layout/fragment_item.xml 查看文件

41
             app:layout_constraintTop_toTopOf="parent" />
41
             app:layout_constraintTop_toTopOf="parent" />
42
 
42
 
43
         <ImageView
43
         <ImageView
44
-            android:id="@+id/imageView7"
44
+            android:id="@+id/imgHis"
45
             android:layout_width="150dp"
45
             android:layout_width="150dp"
46
             android:layout_height="199dp"
46
             android:layout_height="199dp"
47
             android:layout_marginStart="64dp"
47
             android:layout_marginStart="64dp"
48
+            android:adjustViewBounds="true"
48
             android:contentDescription=" "
49
             android:contentDescription=" "
50
+            android:scaleType="centerInside"
49
             android:visibility="visible"
51
             android:visibility="visible"
50
             app:layout_constraintStart_toEndOf="@+id/idTemperatura"
52
             app:layout_constraintStart_toEndOf="@+id/idTemperatura"
51
             app:layout_constraintTop_toTopOf="parent"
53
             app:layout_constraintTop_toTopOf="parent"
69
             android:layout_height="wrap_content"
71
             android:layout_height="wrap_content"
70
             android:layout_marginStart="26dp"
72
             android:layout_marginStart="26dp"
71
             android:layout_marginTop="27dp"
73
             android:layout_marginTop="27dp"
72
-            android:text="Step 1"
74
+            android:text="Stan"
73
             app:layout_constraintStart_toStartOf="parent"
75
             app:layout_constraintStart_toStartOf="parent"
74
             app:layout_constraintTop_toBottomOf="@+id/idState" />
76
             app:layout_constraintTop_toBottomOf="@+id/idState" />
75
 
77
 
80
             android:layout_marginStart="26dp"
82
             android:layout_marginStart="26dp"
81
             android:layout_marginTop="10dp"
83
             android:layout_marginTop="10dp"
82
             android:text="Step 2"
84
             android:text="Step 2"
85
+            android:visibility="invisible"
83
             app:layout_constraintStart_toStartOf="parent"
86
             app:layout_constraintStart_toStartOf="parent"
84
-            app:layout_constraintTop_toBottomOf="@+id/textView27" />
87
+            app:layout_constraintTop_toBottomOf="@+id/textView27"
88
+            tools:visibility="invisible" />
85
 
89
 
86
         <TextView
90
         <TextView
87
             android:id="@+id/textView29"
91
             android:id="@+id/textView29"
90
             android:layout_marginStart="26dp"
94
             android:layout_marginStart="26dp"
91
             android:layout_marginTop="10dp"
95
             android:layout_marginTop="10dp"
92
             android:text="Step 3"
96
             android:text="Step 3"
97
+            android:visibility="invisible"
93
             app:layout_constraintStart_toStartOf="parent"
98
             app:layout_constraintStart_toStartOf="parent"
94
             app:layout_constraintTop_toBottomOf="@+id/textView28" />
99
             app:layout_constraintTop_toBottomOf="@+id/textView28" />
95
 
100
 
99
             android:layout_height="30dp"
104
             android:layout_height="30dp"
100
             android:layout_marginStart="148dp"
105
             android:layout_marginStart="148dp"
101
             android:layout_marginTop="52dp"
106
             android:layout_marginTop="52dp"
102
-            android:visibility="visible"
107
+            android:visibility="invisible"
103
             app:layout_constraintStart_toStartOf="parent"
108
             app:layout_constraintStart_toStartOf="parent"
104
             app:layout_constraintTop_toBottomOf="@+id/textView24"
109
             app:layout_constraintTop_toBottomOf="@+id/textView24"
105
             app:srcCompat="@drawable/emot"
110
             app:srcCompat="@drawable/emot"
106
             tools:srcCompat="@tools:sample/avatars"
111
             tools:srcCompat="@tools:sample/avatars"
107
-            tools:visibility="visible" />
112
+            tools:visibility="invisible" />
108
 
113
 
109
         <ImageView
114
         <ImageView
110
             android:id="@+id/imageView9"
115
             android:id="@+id/imageView9"
111
             android:layout_width="31dp"
116
             android:layout_width="31dp"
112
             android:layout_height="30dp"
117
             android:layout_height="30dp"
113
             android:layout_marginStart="148dp"
118
             android:layout_marginStart="148dp"
119
+            android:visibility="invisible"
114
             app:layout_constraintStart_toStartOf="parent"
120
             app:layout_constraintStart_toStartOf="parent"
115
             app:layout_constraintTop_toBottomOf="@+id/imageView10"
121
             app:layout_constraintTop_toBottomOf="@+id/imageView10"
116
             app:srcCompat="@drawable/emot"
122
             app:srcCompat="@drawable/emot"
117
-            tools:srcCompat="@tools:sample/avatars" />
123
+            tools:srcCompat="@tools:sample/avatars"
124
+            tools:visibility="invisible" />
118
 
125
 
119
         <ImageView
126
         <ImageView
120
             android:id="@+id/imageView10"
127
             android:id="@+id/imageView10"
121
             android:layout_width="31dp"
128
             android:layout_width="31dp"
122
             android:layout_height="30dp"
129
             android:layout_height="30dp"
123
             android:layout_marginStart="148dp"
130
             android:layout_marginStart="148dp"
131
+            android:visibility="invisible"
124
             app:layout_constraintStart_toStartOf="parent"
132
             app:layout_constraintStart_toStartOf="parent"
125
             app:layout_constraintTop_toBottomOf="@+id/imageView8"
133
             app:layout_constraintTop_toBottomOf="@+id/imageView8"
126
             app:srcCompat="@drawable/emot"
134
             app:srcCompat="@drawable/emot"
127
-            tools:srcCompat="@tools:sample/avatars" />
135
+            tools:srcCompat="@tools:sample/avatars"
136
+            tools:visibility="invisible" />
128
 
137
 
129
         <TextView
138
         <TextView
130
             android:id="@+id/idTemperatura"
139
             android:id="@+id/idTemperatura"
166
             android:text="Error"
175
             android:text="Error"
167
             app:layout_constraintStart_toEndOf="@+id/idStatus"
176
             app:layout_constraintStart_toEndOf="@+id/idStatus"
168
             app:layout_constraintTop_toTopOf="parent" />
177
             app:layout_constraintTop_toTopOf="parent" />
178
+
179
+        <TextView
180
+            android:id="@+id/idOK"
181
+            android:layout_width="63dp"
182
+            android:layout_height="22dp"
183
+            android:layout_marginStart="72dp"
184
+            android:layout_marginTop="88dp"
185
+            app:layout_constraintStart_toStartOf="parent"
186
+            app:layout_constraintTop_toTopOf="parent" />
187
+
188
+        <ToggleButton
189
+            android:id="@+id/mikrofon"
190
+            android:layout_width="wrap_content"
191
+            android:layout_height="wrap_content"
192
+            android:layout_marginStart="200dp"
193
+            android:layout_marginTop="145dp"
194
+            android:button="@android:drawable/ic_btn_speak_now"
195
+            android:text="ToggleButton"
196
+            android:textOff="OFF"
197
+            app:layout_constraintStart_toStartOf="parent"
198
+            app:layout_constraintTop_toTopOf="parent" />
169
     </androidx.constraintlayout.widget.ConstraintLayout>
199
     </androidx.constraintlayout.widget.ConstraintLayout>
170
 
200
 
171
 </LinearLayout>
201
 </LinearLayout>

+ 14
- 0
app/src/main/res/layout/toolbar.xml 查看文件

1
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:app="http://schemas.android.com/apk/res-auto"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="match_parent"
5
+    android:fitsSystemWindows="true"
6
+    android:orientation="vertical">
7
+
8
+    <ImageButton
9
+        android:id="@+id/idConfig"
10
+        android:layout_width="wrap_content"
11
+        android:layout_height="wrap_content"
12
+        android:layout_gravity="right"
13
+        app:srcCompat="@android:drawable/ic_menu_preferences" />
14
+</LinearLayout>

+ 2
- 2
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml 查看文件

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@drawable/ic_launcher_background" />
4
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
3
+    <background android:drawable="@drawable/ic_launcher_background"/>
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
5
 </adaptive-icon>
5
 </adaptive-icon>

+ 2
- 2
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml 查看文件

1
 <?xml version="1.0" encoding="utf-8"?>
1
 <?xml version="1.0" encoding="utf-8"?>
2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
2
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
-    <background android:drawable="@drawable/ic_launcher_background" />
4
-    <foreground android:drawable="@drawable/ic_launcher_foreground" />
3
+    <background android:drawable="@drawable/ic_launcher_background"/>
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
5
 </adaptive-icon>
5
 </adaptive-icon>

二进制
app/src/main/res/mipmap-hdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-hdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-mdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-mdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xxhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png 查看文件


二进制
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png 查看文件


二进制
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png 查看文件


+ 1
- 1
app/src/main/res/values/styles.xml 查看文件

1
 <resources>
1
 <resources>
2
 
2
 
3
     <!-- Base application theme. -->
3
     <!-- Base application theme. -->
4
-    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
5
         <!-- Customize your theme here. -->
5
         <!-- Customize your theme here. -->
6
         <item name="colorPrimary">@color/colorPrimary</item>
6
         <item name="colorPrimary">@color/colorPrimary</item>
7
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
7
         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>