Browse Source

修改直流桩可显示电压,交流只显示功率

hy 4 years ago
parent
commit
f3a4f0f7f4

+ 28 - 21
app/src/main/java/com/electric/chargingpile/adapter/ZhuangStatusadapter.java

167
            }
167
            }
168
168
169
            holder.llZhuangControl.setVisibility(View.GONE);
169
            holder.llZhuangControl.setVisibility(View.GONE);
170
            if ("0".equals(status.getNationalStandard())) {
171
                holder.tvType.setVisibility(View.GONE);
172
            } else {
173
                holder.tvType.setVisibility(View.VISIBLE);
174
                switch (status.getNationalStandard()) {
175
                    case "1":
176
                        holder.tvType.setText("国标2011");
177
                        break;
178
                    case "2":
179
                        holder.tvType.setText("国标2015");
180
                        break;
181
                    case "3":
182
                        holder.tvType.setText("国标2015,国标2011");
183
                }
184
            }
170
185
            String type, power, have_gun;
171
            String type, power, have_gun;
186
            if ("1".equals(status.getEleType())) {
172
            if ("1".equals(status.getEleType())) {
187
                type = "直流快充";
173
                type = "直流快充";
174
                power= status.getPower()+ "kw"+"/"+ status.getWattmeter()+"V";
188
            } else {
175
            } else {
189
                type = "交流慢充";
176
                type = "交流慢充";
177
                power= status.getPower()+ "kw";
190
            }
178
            }
191
            if ("0".equals(status.getPower())) {
192
                power = "";
193
            } else {
194
                power = " | " + status.getPower() + "kw";
195
            }
179
            holder.tvType.setText(power);
196
            //"has_gun": "0",//1有枪,2没有枪,0 没有这个桩的信息
180
            //"has_gun": "0",//1有枪,2没有枪,0 没有这个桩的信息
197
            switch (status.getHas_gun()) {
181
            switch (status.getHas_gun()) {
198
                case "1":
182
                case "1":
205
                    have_gun = "";
189
                    have_gun = "";
206
                    break;
190
                    break;
207
            }
191
            }
208
            holder.tvInfo.setText(type + power + have_gun);
192
193
            String gbFormat="";
194
            switch (status.getNationalStandard()) {
195
                case "1":
196
                    gbFormat=" | 国标2011";
197
                    break;
198
                case "2":
199
                    gbFormat=(" | 国标2015");
200
                    break;
201
                case "3":
202
                    gbFormat=(" | 国标2015,国标2011");
203
            }
204
            StringBuilder builderStr = new StringBuilder();
205
            if (gbFormat==""){
206
                builderStr.append(type)
207
                        .append(have_gun);
208
            }else{
209
                builderStr.append(type)
210
                        .append(gbFormat)
211
                        .append(have_gun);
212
213
            }
214
            holder.tvInfo.setText(builderStr);
215
209
        } catch (Exception e) {
216
        } catch (Exception e) {
210
            e.printStackTrace();
217
            e.printStackTrace();
211
        }
218
        }

+ 10 - 0
app/src/main/java/com/electric/chargingpile/data/ZhuangStatus.java

20
     * soc : 0
20
     * soc : 0
21
     * nationalStandard : 1
21
     * nationalStandard : 1
22
     * order : 1
22
     * order : 1
23
     * wattmeter :177   功率
23
     */
24
     */
24
25
25
    private String pile_id;
26
    private String pile_id;
34
    private String status;
35
    private String status;
35
    private String soc;
36
    private String soc;
36
    private String nationalStandard;
37
    private String nationalStandard;
38
    private String wattmeter;
37
    private int order;
39
    private int order;
38
40
41
    public String getWattmeter() {
42
        return wattmeter;
43
    }
44
45
    public void setWattmeter(String wattmeter) {
46
        this.wattmeter = wattmeter;
47
    }
48
39
    public String getPile_id() {
49
    public String getPile_id() {
40
        return pile_id;
50
        return pile_id;
41
    }
51
    }

+ 11 - 3
app/src/main/res/layout/item_zhuang_status.xml

1
<?xml version="1.0" encoding="utf-8"?>
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
4
    android:id="@+id/rl_layout"
5
    android:id="@+id/rl_layout"
5
    android:orientation="vertical"
6
    android:orientation="vertical"
6
    android:layout_width="match_parent"
7
    android:layout_width="match_parent"
8
    android:minHeight="96dp">
9
    android:minHeight="96dp">
9
10
10
    <TextView
11
    <TextView
12
        tools:textColor="#f1f1"
13
        tools:text="空闲"
11
        android:id="@+id/tv_zhuang_staus"
14
        android:id="@+id/tv_zhuang_staus"
12
        android:layout_width="wrap_content"
15
        android:layout_width="wrap_content"
13
        android:layout_height="wrap_content"
16
        android:layout_height="wrap_content"
70
        android:layout_marginRight="15dp">
73
        android:layout_marginRight="15dp">
71
74
72
        <TextView
75
        <TextView
76
            android:textStyle="bold"
77
            tools:text="桩编码:1101050408103"
73
            android:id="@+id/tv_pile_id"
78
            android:id="@+id/tv_pile_id"
74
            android:layout_width="wrap_content"
79
            android:layout_width="wrap_content"
75
            android:layout_height="wrap_content"
80
            android:layout_height="wrap_content"
76
            android:singleLine="true"
81
            android:singleLine="true"
77
            android:ellipsize="end"
82
            android:ellipsize="end"
78
            android:textColor="@color/ui_62"
83
            android:textColor="@color/color_text"
79
            android:textSize="14sp"
84
            android:textSize="14sp"
80
            android:layout_marginBottom="6dp"/>
85
            android:layout_marginBottom="6dp"/>
81
86
82
        <TextView
87
        <TextView
88
89
            tools:text="90w"
83
            android:id="@+id/tv_zhuang_type"
90
            android:id="@+id/tv_zhuang_type"
84
            android:layout_width="wrap_content"
91
            android:layout_width="wrap_content"
85
            android:layout_height="wrap_content"
92
            android:layout_height="wrap_content"
86
            android:singleLine="true"
93
            android:singleLine="true"
87
            android:ellipsize="end"
94
            android:ellipsize="end"
88
            android:textColor="@color/ui_65"
95
            android:textColor="@color/color_text"
89
            android:textSize="12sp"
96
            android:textSize="12sp"
90
            android:layout_marginBottom="4dp"/>
97
            android:layout_marginBottom="4dp"/>
91
98
127
        </LinearLayout>
134
        </LinearLayout>
128
135
129
        <TextView
136
        <TextView
137
            tools:text="直流快充 | 国标2015 | 有枪 "
130
            android:id="@+id/tv_zhuang_info"
138
            android:id="@+id/tv_zhuang_info"
131
            android:layout_width="wrap_content"
139
            android:layout_width="wrap_content"
132
            android:layout_height="wrap_content"
140
            android:layout_height="wrap_content"
133
            android:textColor="@color/ui_65"
141
            android:textColor="@color/color_text"
134
            android:textSize="12sp"
142
            android:textSize="12sp"
135
            android:layout_marginBottom="15dp"/>
143
            android:layout_marginBottom="15dp"/>
136
144

+ 1 - 0
app/src/main/res/values/color.xml

203
    <color name="color_e32727">#ffe32727</color>
203
    <color name="color_e32727">#ffe32727</color>
204
    <color name="color_707070">#ff707070</color>
204
    <color name="color_707070">#ff707070</color>
205
    <color name="color_f5f6f7">#F5F6F7</color>
205
    <color name="color_f5f6f7">#F5F6F7</color>
206
    <color name="color_text">#1A1B1F</color>
206

207

207

208

208

209